Abstract
Threshold segmentation based on swarm intelligence optimization algorithm is a research hotspot in image processing, because of its good segmentation effect and easy implementation. This paper proposes an image threshold segmentation method based on an improved sparrow search algorithm and 2-D maximum entropy method. In the proposed algorithm, the nonlinear inertia weight is introduced into the entrants’ update formula to improve the local exploration ability of the algorithm, and Levy flight is introduced into the vigilant sparrows’ update formula to prevent the algorithm from falling into the local optimal solution in the later stage of iteration. In addition, improved sparrow search algorithm is tested on fifteen benchmark functions. The results represent the merit of the proposed algorithm with respect to other algorithms. Finally, the proposed algorithm is applied to entropy based image segmentation. Experiment results on classical images and medical images show that the proposed method improves the segmentation effect in terms of peak signal-to-noise ratio and feature similarity.
Similar content being viewed by others
1 Introduction
Threshold image segmentation is a widely used segmentation technology that performs image segmentation based on the information contained in the image gray-level histogram. The gray value difference between the target area and the background area in the image is compared, an appropriate threshold is given to judge the gray value of each pixel in the image belongs to the target region or the background region, so as to segment the image. Nowadays, there are many threshold image segmentation methods, while maximum entropy method [17, 47], inter class variance method(OTSU) [4, 41], cross entropy method [10, 25, 50] and minimum error method [5, 22] are divided according to the selection criteria of threshold. Image segmentation based on entropy is very popular, and entropy can be divided into Shannon entropy [39], tsallis entropy [13], exponential entropy [42, 51] and arimoto entropy [30], etc. According to the dimension of image histogram, it also can be classified into one-dimensional (1-D) histogram, two-dimensional (2-D) histogram [1, 6, 45] and so on.
In the process of image threshold segmentation, the effects of some factors on segmentation results are summarized as follows:
-
(1)
The separation between peaks. It is assumed that the gray level of the image composed of target and background has unimodal distribution characteristics. The gray levels of adjacent pixels in the target or background are highly correlated, but the gray levels of pixels at the junction of target and background are very different. Then the image gray histogram can be regarded as a mixture of two single peak histograms corresponding to the target and background respectively. At this time, if the number of the two distributions is close, the standardized mean difference is far enough and the mean square deviation is small enough, the histogram is bimodal, the pixel value that can be used as the bottom of the valley is found as the threshold between the two peaks. Therefore, the farther the wave crest is away, the greater the chance of separating the target from the background.
-
(2)
Noise content in the image. Noise will change the gray value of some pixels in the histogram, resulting in imbalance, such as filling the bottom of the histogram and generating new peaks.
-
(3)
Relative size of objects and background. When the target is small or large, the peak of the target and the background in the histogram will be quite different, so it is difficult to distinguish the valley bottom, which affects the selection of threshold.
-
(4)
The uniformity of illumination and reflection. When the illumination or the image reflection is uneven, the brightness of the target and background will change, and shadow areas may appear around the target. These factors will affect the change of image gray value, thus affecting the distribution of histogram, resulting in poor segmentation effect.
Using entropy as texture feature is an important research theme, many scholars have used entropy as the basis of threshold image segmentation. Liu et al. proposed a novel image thresholding based on 2-D Arimoto Entropy (TDAE), called Ellipsoid Region Search Strategy (ERSS) [30]. Li et al. proposed a parameter adaptive hybrid model for image segmentation, the image’s local entropy was used to establish the index for measuring the image’s gray-level information [26]. Chakraborty et al. proposed an improved version of Fractional Order Darwinian PSO (IFODPSO) for segmenting 3D histogram-based color images at multiple levels of Berkley Segmentation Dataset (BSDS500), Multi-level Massi Entropy (MME) had been chosen as the objective function for finding the threshold values in combination with IFODPSO [7]. Nejad et al. proposed a multi-level thresholding method based on imperialist competition algorithm and Kapur’s entropy [40]. Yan et al. proposed a image segmentation method based on whale optimization algorithm (WOA) and Kapur’s entropy [57]. Lei et al. defined a new form of square rough entropy to measure the roughness in an image, and proposed a corresponding threshold image segmentation algorithm [23]. Moreover, Lin et al. adopted the Tsallis cross-entropy in threshold image segmentation [29].
Only when the most appropriate threshold is found accurately, can the image segmentation be more accurate. Therefore, how to find the appropriate threshold quickly and accurately becomes the key of threshold image segmentation research.
Optimization algorithm based on the swarm intelligence is a bionic algorithm which simulates the behaviors of insects, birds, fish and other wild animals foraging and hunting. There are many well-known algorithms such as particle swarm optimization (PSO) [20], artificial bee colony algorithm (ABC) [18], fruit fly optimization algorithm (FOA) [44], grey wolf optimizer (GWO) [49], chicken swarm optimization (CSO) [36] and the WOA [37] and so on.
In recent years, more and more scholars have used intelligence optimization algorithm to solve image segmentation problems and achieved good results. Some algorithms used in image segmentation are listed in Table 1.
Sparrow search algorithm (SSA) is a new swarm intelligence optimization algorithm proposed by Xue and Shen [56], it is inspired by the foraging behavior and vigilance behavior of sparrows. The algorithm has strong optimization ability and fast convergence speed. It has been widely investigated by scholars. Yuan et al. proposed a DMPPT control of photovoltaic microgrid based on improved SSA [58]. Liu et al. proposed a modified SSA with application in 3-D route planning for UAV [32]. Zhang et al. proposed a semi-supervised ensemble classifier with an improved SSA and applied it to pulmonary nodule detection [59]. Wang et al. conducted a research on economic optimization of microgrid cluster based on chaos SSA [53]. Gai et al. proposed a parameter-optimized deep belief network (DBN) based on SSA for gear fault severity detection [11]. Kathiroli et al. presented an efficient cluster-based routing model using Sparrow search algorithm derives a fitness function to perform clustering process [19]. Tuerxun et al. used the SSA to optimize the penalty factor and kernel function parameter of SVM and constructed the SSA-SVM wind turbine fault diagnosis model [52].
However, the SSA still has the disadvantage of easy to fall into the local optimal solution in the late iteration. Some scholars have put forward different solutions. Yuan et al. proposed a improved SSA based on the center of gravity reverse learning mechanism, learning coefficient and mutation operator [58]. Zhang et al. adopted sine cosine algorithm and new labor cooperation structure to increase the global optimal solution and convergence performance of SSA [59]. Wang et al. proposed a chaos SSA, which combines Bernoulli chaotic mapping, dynamic adaptive weighting, Cauchy mutation, and reverse learning [53]. Li et al. combined the SSA with direction learning strategy and metropolis criterion of simulated annealing algorithm [24]. Lv et al. improved the SSA by combining with the flight behavior in bird swarm algorithm [33]. Zhou et al. proposed a modified SSA by introducing crossover and mutation [60]. This algorithm has higher convergence rate than the original SSA. Liang et al. modified SSA with combining a homogeneous chaotic system, adaptive inertia weight, and improved boundary constraint [28].
In this research, an improved sparrow search algorithm (ISSA) is proposed which combines Levy flight and nonlinear inertia weight. Nonlinear inertia weight would enhance the local exploration ability and Levy flight would help the algorithm escaping from the local optimum. Then a new image threshold segmentation method is proposed based on ISSA. The gray value of each pixel in the graph and the mean of gray in its field are considered, the 2-D entropy is used as the evaluation function, and the entropy optimization is carried out by ISSA to obtain the threshold corresponding to the maximum entropy. In order to verify the feasibility and effectiveness of ISSA, it is tested on fifteen benchmark functions. Results are compared with some well-known algorithms such as SSA, PSO, GWO, ABC, WOA, CSO, and FOA. In the last, state-of-the-art approaches including ISSA, gold eagle optimizer (GEO) [38], rat swarm optimizer (RSO) [8], transient search optimization (TSO) [46], CRSSA [35], MSCA [48], HHO-PCNN [14], 2D-OTSU [31] and 1D-Exponential entropy [43] are applied to image segmentation. Peak signal-to-noise ratio (PSNR) and feature similarity (FSIM) are used as evaluation indexes for comparison. Experimental results demonstrate the effectiveness of the proposed method.
The main contributions of this paper are:
-
(1)
An improved sparrow search algorithm combining Levy flight and nonlinear inertia weight factor is proposed.
-
(2)
Compared with PSO, GWO, ABC, WOA, CSO, FOA and SSA, ISSA has better convergence speed, accuracy and robustness.
-
(3)
The experimental results show that compared with segmentation methods by GEO, RSO, TSO, CRSSA, MSCA and HHO-PCNN, 2D-OTSU and 1D-Exponential entropy, the segmented images obtained by ISSA and 2-D entropy have excellent peak signal-to-noise ratio and feature similarity.
The remainder of this paper is organized as follows. Section 2 introduces the SSA and the improved method. Section 3 analyzes the convergence of the ISSA. Section 4 proposes the threshold image segmentation based on ISSA and 2-D maximum entropy. Section 5 evaluates the performance of the ISSA and compares the segmentation results for different type of images. Finally, the paper is concluded in Section 6.
2 Improved sparrow search algorithm
2.1 Sparrow search algorithm
Sparrow search algorithm is proposed according to the predatory behavior and vigilant behavior of sparrow population. According to the role of each sparrow in the population, it can be divided into discoverer, entrant and vigilant sparrow.
The discoverers have more energy reserves in the whole population. They are responsible for exploring food for the whole population and guiding the entrants to search for foods. The fitness of the discoverers is better than entrants. In the process of searching for food, if the discoverer detects the danger, it will call to remind other members of the population and move to a new safe area to continue search for foods. In the algorithm, if the fitness of entrant is better than discoverer, the entrant will become discoverer to search for food. The location update formula of the discoverers is described as follows:
Where t represents the current iteration, j = 1, 2, 3, ... d, itermax represents the maximum number of iterations, Xi,j represents the position information of the i-th sparrow in the j-th dimension, α∈[0,1] represents a random number, R2 ∈[0,1] represents the warning value, ST∈[0.5,1] represents the safety value, Q represents a random number following normal distribution, L represents a 1 × d matrix, and each element in the matrix is 1.
When the warning value is less than the security value, the discoverers can explore in a large range, and the range gradually decreases with the increase of iterations. When the warning value is bigger than the safety value, the discoverers detect the danger, and then the discoverers randomly go to other safe areas to search for food.
Entrants are the sparrows with the low energy in the population. The sparrows with lower energy are more difficult to find food in their area, so they have to fly to other areas or follow the discoverers to search for foods. Discoverers and entrants will replace each other with the amount of energy stored. The specific location update formula of the entrant is computed as follows:
Where XP is the best position of the current population, Xworst is the worst position of the current population, A is the 1 × d matrix, each element in the matrix is randomly 1 or − 1, and A+ = AT(AAT)−1. When i is greater than n/2, it means that it is very difficult for the sparrows with low energy to find foods, so they need to fly to other places to find foods, otherwise they will fly to the vicinity of the discoverers to get more energy.
In the sparrow population, some sparrows are called vigilant sparrows, which usually account for 10% - 20% of the total population. When they realize the danger, the sparrows near the edge of the group will quickly move towards the safest area to avoid the danger. While the sparrows at the optimal position of the population, it will randomly walk near other sparrows to avoid the danger. The specific vigilant sparrow’s position update formula is calculated as follows:
Where Xbest is the optimal position of the current population, β is the step size, which is a normal distribution random number with mean value of 0 and variance of 1, K∈[−1,1], it represents a random number, fi represents the fitness of the current sparrow, fg represents the fitness of the current best sparrow, fw represents the fitness of the current worst sparrow, and ε is a small constant to prevent the denominator from being 0.
If the fitness of the current sparrow is greater than the best sparrow, which means that the sparrow is at the edge of the population and is vulnerable to attack, so it needs to move to the most secure central area. If the fitness of the current sparrow is equal to the best sparrow, which means that the sparrow is in the most secure area. At this time, it needs to move close to the nearby sparrows to avoid danger.
The algorithm flowchart is shown in Fig. 1.
-
Step 1 Initialize population and algorithm parameters.
-
Step 2 Calculate the fitness values and sort them from small to large, then divided the population into discoverers and entrants according to the proportion.
-
Step 3 Update the discoverers’ position via Eq.(1).
-
Step 4 Update the entrants’ position use via Eq.(2).
-
Step 5 Select some sparrows randomly from the population according to the proportion of vigilant sparrows, and use Eq.(3) to update the position.
-
Step 6 Recalculate the new position’s fitness. If the fitness is better than that of the previous iteration, update its position, otherwise give up.
-
Step 7 Judge whether the stop condition is satisfied. If it is satisfied, exit and output the best position. Otherwise, return to Step 2.
2.2 Improved methods
According to the position updating formula Eq. (2), when the entrants move towards the optimal region, the direction is only 1 or − 1, which makes it easy to fall into the local optimal solution in the late iteration, and the population diversity is poor. Therefore, a new position updating formula is obtained by Eq. (4) with a nonlinear inertia weight of cosine function.
Where w is the inertia weight, wmax and wmin are the maximum and minimum values of the weight, T is the number of current iterations, G is the maximum number of iterations. By introducing the nonlinear inertia weight of the cosine function, it can make the entrants explore more carefully and accurately near the current optimal position to make the local exploration ability stronger.
Levy flight was proposed by French mathematician Paul Levy in the 1930s. It is a probability distribution, a random step size that obeys Levy distribution. It is also a walking mode that can transform between a large number of short-distance search and occasional long-distance search. Mantegna algorithm is usually used to simulate, and the specific formula is as follows:
Where u and v are random numbers of normal distribution, Levy is step size random number of Levy distribution, β is a constant, usually 1.5.
According to the vigilant sparrow’s position update formula, if the current sparrow’s fitness is not optimal, it will move towards the optimal position. The step size control parameter β is a random number of normal distribution with mean value of 0 and variance of 1, which is easy to make the algorithm fall into the local optimal solution in the late iteration. Therefore, the Levy flight random number is introduced to replace β, it will make the algorithm easy to jump out of the local optimal solution, improve the local exploration ability, population diversity, and the optimization performance of the algorithm.
3 Convergence analysis
3.1 Convergence criteria
The ISSA belongs to random search algorithm. Therefore, this paper determines the convergence behavior of ISSA through the convergence criterion of random algorithm [54, 55]. For the optimization problem, there are the random optimization algorithm D, the result of the k-th iteration Xk, and the result of the next iteration Xk + 1 = D(Xk, ζ), ζ is the searched solution in the iteration of the algorithm D.
The infimum of the search is defined as follows:
Where V(x) is the Lebesgue measure on the set x, A is the feasible solution space, f(x) is the fitness function.
The optimal solution region can be defined as follows:
Where ε > 0, C is a sufficiently large positive number. If algorithm D finds a point in the optimal solution region, then the algorithm finds an acceptable global optimal solution.
-
Condition 1: f (D (x, ζ)) ≤ f (x), if ζ∈A, then f (D (x, ζ)) ≤ f (ζ).
-
Condition 2: for B∈A, s.t. V(B) > 0, there is \( \prod \limits_{k=0}^{\infty}\left(1-{u}_k(B)\right)=0 \), where is the probability measure of the k-th iterative search solution of algorithm D on set B.
Let f be measurable, measurable space A be a subset of upper measurable, and algorithm D satisfy condition 1 and condition 2, \( {\left\{{X}_{\mathrm{k}}\right\}}_{k=0}^{\infty } \) is the sequence generated by algorithm D. Then probability measure\( \underset{k\to \infty }{\lim }P\left({x}_k\in {R}_{\upvarepsilon, \mathrm{M}}\right)=1 \), Rε, Mis the optimal solution region, and D is the global convergence.
3.2 Convergence analysis of ISSA
The position states of all sparrows in the population constitute the sparrow state, which can be recorded as s = (x1, x2,.... xN), where xi is the position state of the i-th sparrow, N is the number of sparrow population, and all possible states in the sparrow population constitute a state space, which can be recorded as S = {s = (x1, x2,... xN) | xi ∈A, 1 ≤ i ≤ N}, and A is the feasible solution state space.
In the ISSA, the transition probability of sparrow position state from xi to xj is P (T(xi) = xj), while the transition probability of sparrow population state from si to sj can be expressed as follows:
From the above formula, we can know that the transition probability is obtained by multiplying the transition probability of each sparrow, so if s(t)∈S, then s(t + 1)∈S. The transition probability P (T(x(t)) = x(t + 1)) of each sparrow is only related to the state x(t), the number of sparrows i, the maximum iteration number itermax, the optimal sparrow position xp, the worst sparrow position xworst, and the random number Q at time t, but not related to time t. It can be concluded that the sparrow population position sequence s(t) generated by ISSA has Markov property and homogeneity, and the sparrow population state space s is a finite space. So ISSA’s sparrow population sequence {s(t), t ≥ 0} constitutes a finite homogeneous Markov chain.
In the ISSA, after each iteration, if the fitness value of a new position is better than the current best position, the new position will replace it and become the current best position. The best position of the algorithm is constantly changing and getting better in the iterative process. Therefore, the ISSA satisfies condition 1 of the convergence criterion.
If the optimal solution is x*, then the optimal state set of sparrow population is G = {s = {x} | f (x) = f (x *), s∈S}, and G∈S. for any optimal state set si and non optimal state set sj, the transition probability from si to sj is as follows:
In the optimal state set G, if at least one state reaches the optimal x*, then there is a transition probability P (T (x*) = xjk) = 0, then P (T (si) = sj) = 0, then we can conclude that the optimal state set G of sparrow population is a closed set on the state space S.
Suppose that there is a nonempty closed set M in the state space S, and M ∩ G = ∅, then for the state si = (x*) in G and the state sj = (xjk) in M, we can get f (x*) < f (xjk), and the transition probability of state sj to si can be known to be greater than 0, so M is not a closed set, so the hypothesis is not true. That is, there is only one closed set in the sparrow population state space S, which is the optimal state set G. That is, the Markov chain of the sparrow population state is irreducible.
Moreover, if there is a nonempty closed set E and there is no other nonempty closed set O to makeE ∩ O = ∅, So when j ∈ E, \( \underset{k\to \infty }{\lim }P\left({x}_k=j\right)={\pi}_j \), when j ∉ E, \( \underset{k\to \infty }{\lim }p\left({x}_k=j\right)=0 \), it can be concluded that when the iteration number of the ISSA tends to infinity, the sparrow population state must enter the optimal state set G, the probability that the ISSA can not find the global optimal solution is 0, so the condition 2 of convergence criterion is satisfied, it can be concluded that the ISSA is a global convergence algorithm.
4 Threshold image segmentation
Maximum entropy method was proposed by Kapur in 1985. The threshold selection standard of maximum entropy method is to maximize the total entropy of the segmented target and background (the largest amount of information).
Compared with the 2-D segmentation method, the 1-D segmentation method only considers the gray information of each pixel in the image, so the segmentation speed is faster. In 2-D methods, not only the gray information of each pixel, but also the gray information of its neighborhood is considered. The threshold t and region threshold s are selected to segment the image into four parts. The target and background (A and B in Fig. 2) are mainly concentrated in the two regions near the diagonal, and the other two regions are mainly the image edge and noise interference, we should makes full use of the gray information of the target and background areas, and more efficient and accurate to find the best threshold (t, s). Although the processing time of this 2-D method is long, the segmentation quality is better and the anti noise ability is superior.
Here we take a pixel and its surrounding 3 × 3 area as a calculation area to calculate the regional gray mean value of a pixel:
Where Pij is the probability when the current pixel gray level is i and its field gray level average is j, nij is the number of pixels whose gray level value is i and field gray level value is j, M × N is the pixel size of the image, w0 and wb are the probability sum of target class and background class respectively, L is the gray level, L = 256.
The image edge and noise interference area information is little and the probability is very small. Thus, we only consider the diagonal target area and background area and set the following formula:
For the threshold (t, s), the entropy expressions of target class and background class are described as follows:
2-D maximum entropy is calculated using Eq. (22).
The best threshold is determined as follows:
In the 2-D maximum entropy threshold image segmentation, the ISSA is used to find the best threshold:
In the ISSA, the lower the fitness, the better it is, so - fun {t, s} is taken as the fitness function.
The specific segmentation flowchart is shown in Fig. 3, and steps are explained as follows:
-
Step 1 Read the image to be segmented.
-
Step 2 Read the gray histogram of the image.
-
Step 3 Initialize the population and parameters.
-
Step 4 Calculate the fitness of all sparrows according to the Eq. (22).
-
Step 5 Implement the ISSA.
-
Step 6 Judge whether the stop condition is satisfied. If it is satisfied, exit and output the best threshold. Otherwise, return to Step 4.
-
Step 7 Use the best threshold {t *, s *} to segment the image and output the segmented image.
5 Tests and analysis
5.1 Benchmark test
In order to verify the convergence and robustness of the ISSA, fifteen benchmark functions are used to test ISSA and other optimization algorithms such as PSO [29], ABC [20], FOA [18], GWO [44], CSO [49] and WOA [36]. The parameters of these algorithms are shown in Table 2 and the benchmark functions are listed in Table 3. The experiments were performed on the platform of MATLAB R2018a, using a Dell Laptop with an Intel Core i5 processor and 8 GB memory, running the Windows 10 operating system. The number of population is 50 and the iterations is 300, and each algorithm runs 30 times independently.
Table 4 shows the statistical results, it can be seen from Table 4 that for single-mode test functions F1-F5, the average value, best value and variance of ISSA are smaller than other algorithms, and the global optimal value can be found accurately. For multi-mode test functions F6-F10, other algorithms are easy to fall into the local optimal value, but ISSA can accurately find the global optimal solution, which fully reflects excellent optimization ability of ISSA algorithm. For multi-mode test function with fixed dimension F11-F15, most algorithms can accurately find the global optimal solution, but the variance of ISSA is the smallest, which fully reflects excellent robustness of ISSA algorithm.
In order to further verify the convergence speed and accuracy of ISSA, the convergence curves of different algorithms are demonstrated in Fig. 4. For the convenience of observation, the ordinate of partial convergence curve is in the form of log.
It can be seen from Fig. 4 that, for single-mode test function F1-F5, the convergence of ISSA is obviously better than other algorithms, and the accuracy is higher, especially in the middle and late iteration of ISSA algorithm. For multi-mode test functions F6-F10, the convergence performance of ISSA is still better, especially for the F7 test function. The convergence speed of ISSA is obviously faster than other algorithms in the early iteration. In the F10 test function, although the convergence speed of ISSA is not the fastest in the early and middle stages, the convergence accuracy in the later stage is better than other algorithms. For multi-mode test function with fixed dimension F11-F15, although there is little difference in the convergence of each algorithm, and they all converge to the optimal value in the early stage, the convergence speed of ISSA is slightly faster than other algorithms.
In the complexity test of the algorithm, five single-mode functions with the optimal value of 0 were selected for test. Within 2000 iterations, we recorded the number of iterations and running time when error of the best fitness value is less than 10−5. If the algorithm did not find a solution less than 10−5 within 2000 iterations, we recorded the running time of 2000 iterations.
From Table 5, we can see that ISSA can converge below 10−5 with the least number of iterations on the five test functions, and in general, ISSA has lower computation complexity, except F2. It can be concluded that under the same number of iterations, ISSA will spend a longer running time, but it makes up for this drawback with an excellent optimization ability.
From the above test results, we can draw a conclusion that the convergence speed, convergence accuracy and robustness of ISSA algorithm are superior to other seven algorithms, and it has better optimization ability.
5.2 Application to threshold image segmentation
In this section, the ISSA is applied to threshold image segmentation, the optimal threshold and image segmentation quality are compared with image segmentation results based on GEO [38], RSO [8], TSO [46], CRSSA [35], MSCA [48], HHO-PCNN [14], 2D-OTSU method [31] and 1D-Exponential entropy method [43]. The maximum number of iterations is 30, the population size is 20. The parameters to be set for algorithms are shown in Table 6.
5.2.1 Application to classical images
We selected three gray images, six color images and three images with different noises for experiments. The test images and their resolutions and gray histograms are shown in Fig. 5.
From the results in Table 7, we can see that the proposed method is obviously superior to other methods. In twelve images, the threshold values sought by eleven images have higher entropies, which reflects the good convergence and high robustness of the ISSA-based segmentation method. Although MSCA-based segmentation method has also obtained a good threshold, on the whole, the performance of the ISSA-based segmentation method is more prominent.
Tables 8 and 9 show the PSNR and FSIM of the nine methods for twelve images. It can be seen that the threshold obtained by ISSA is used for image segmentation, although the PSNR and FSIM of some images are not ideal, the overall performance of ISSA-based segmentation is better. The segmented images are shown in Fig. 6.
5.2.2 Application to medical images
The outbreak of COVID-19 has brought great harm to people all over the world, and countless people have lost their lives. Image segmentation is also widely used in the medical field. For medical images, how to segment accurately is particularly important [3]. For lung CT images, the primary task of image segmentation is to segment the lung organs and nodules in the lung, which can enable doctors to judge the situation of the lung more accurately and prevent wrong judgment caused by blurred images [2]. Therefore, we used five lung CT images of COVID-19 patients to verify the effectiveness of the proposed method. The CT images, as well as the corresponding resolution and gray histogram are shown in Fig. 7 [2].
Tables 10, 11, 12 show a comparison of the thresholds, optimal entropy, PSNR and FSIM of different methods for five lung images. It is noted from the tables that other algorithms can find the threshold corresponding to the maximum entropy, but the effect of segmentation using these obtained threshold is not very ideal. Since ISSA can not only find the threshold of maximum entropy, but also the segmented images based on the found threshold have larger PSNR and FSIM.
Figure 8 shows the segmented images obtained by ISSA method. It can be seen from Fig. 8 that the lung organs are completely segmented, and the nodules and diseased tissues in the lung are clearly distinguished, which plays a certain role in the diagnosis of COVID-19 patients.
6 Conclusion
This paper proposes an ISSA by combining the nonlinear inertia weight and Levy flight and applies the ISSA to threshold image segmentation based on 2-D maximum entropy. The experimental results deliver several conclusions. First, compared with other algorithms, ISSA has faster convergence speed, more accurate convergence results and stronger robustness. Second, Through the threshold obtained by ISSA optimization for classical images segmentation, the maximum entropy is obtained, and higher PSNR and FSIM are achieved. The quality of segmented images is better. Third, the segmentation results for lung CT images show that in medical application, ISSA can still obtain better performance, including higher PSNR and FSIM. The nodules and diseased tissues on lung organs can be clearly segmented.
Tables 13 and 14 list algorithms that obtained the highest PSNR and FSIM in experiments, and record number of times to obtain the optimal values when segmented different images. The statistical results show the ISSA performs better in image segmentation of different types of images. Since in most tests, PSNR and FSIM obtained using ISSA method are the best.
The experiment results confirm the effectiveness of the proposed method, but there are some drawbacks. The running time of the ISSA increases compared with SSA, and in test function F7, ISSA cannot converge to the global optimal 0.
Image segmentation remains one of the main issues in image processing, this study deserves further methodological, algorithmic and numerical investigations. And as a newly proposed swarm intelligence optimization algorithm, the SSA has strong robustness, fast convergence speed, and can be applied to optimization problems in other areas, so it has great research significance. In future work, we will continue to focus on improvement of swarm intelligence optimization algorithm, and combine with deep learning method to solve image processing problems.
Change history
14 June 2022
A Correction to this paper has been published: https://doi.org/10.1007/s11042-022-13334-9
References
Abutaleb A, Eloteifi A (1988) Automatic thresholding of gray-level pictures using 2-D entropy. In: 31st annual technical symposium. International Society for Optics and Photonics. https://doi.org/10.1117/12.942103
Afshin S, Marjane K, Roohallah A et al (2020) Automated detection and forecasting of COVID-19 using deep learning techniques: a review. arXiv preprint arXiv:2007.10785
Afshin S, Marjane K, Mahboobeh J et al (2021) Applications of deep learning techniques for automated multiple sclerosis detection using magnetic resonance imaging: a review. Comput Biol Med 136:104697. https://doi.org/10.1016/j.compbiomed.2021.104697
Ashish K, Bhandari A, Ghosh I et al (2020) A local contrast fusion based 3d otsu algorithm for multilevel image segmentation. IEEE/CAA J Autom Sin 7(01):203–216. https://doi.org/10.1109/JAS.2019.1911843
Barron JT (2020) A generalization of Otsu’s method and minimum error thresholding. In: Vedaldi A, Bischof H, Brox T, Frahm JM (eds) Computer Vision – ECCV 2020. ECCV 2020. Lecture notes in computer science, vol 12350. Springer, Cham. https://doi.org/10.1007/978-3-030-58558-7_27
Cao Q, Shi Z, Wang R, Wang P, Yao S (2020) A brightness-preserving two-dimensional histogram equalization method based on two-level segmentation. Multimed Tools Appl 79(2):27091–27114. https://doi.org/10.1007/s11042-020-09265-y
Chakraborty R, Verma G, Namasudra S (2020) Ifodpso-based multi-level image segmentation scheme aided with masi entropy. J Ambient Intell Humaniz Comput 1:1–19. https://doi.org/10.1007/s12652-020-02506-w
Dhiman G, Garg M, Nagar A, Kumar V, Dehghani M (2021) A novel algorithm for global optimization: rat swarm optimizer. J Ambient Intell Humaniz Comput 12(8):8457–8482. https://doi.org/10.1007/s12652-020-02580-0
Duan L, Yang S, Zhang D (2021) Multilevel thresholding using an improved cuckoo search algorithm for image segmentation. J Supercomput 77(7):6734–6753. https://doi.org/10.1007/s11227-020-03566-7
Esmaeili L, Mousavirad SJ, Shahidi Ne Jad A (2021) An efficient method to minimize cross-entropy for selecting multi-level threshold values using an improved human mental search algorithm. Expert Syst Appl 182(3):115106. https://doi.org/10.1016/j.eswa.2021.115106
Gai J, Zhong K, Du X, Yan K, Shen J (2021) Detection of gear fault severity based on parameter-optimized deep belief network using sparrow search algorithm. Measurement 185:110079. https://doi.org/10.1016/j.measurement.2021.110079
Huang C, Li X, Wen Y (2020) An otsu image segmentation based on fruitfly optimization algorithm. AEJ - Alex Eng J 60(1):183–188. https://doi.org/10.1016/j.aej.2020.06.054
Jena B, Naik MK, Panda R, Abraham A (2021) Maximum 3d tsallis entropy based multilevel thresholding of brain mr image using attacking manta ray foraging optimization. Eng Appl Artif Intell 103(16):104293. https://doi.org/10.1016/j.engappai.2021.104293
Jia H, Kang LF, Sun KJ et al (2019) Harris eagle algorithm optimized automatic image segmentation based on pulse coupled neural network. Appl Sci Technol 46(4):16–20+25. https://doi.org/10.11991/yykj.201904022
Jiang Z, Zou F, Chen D, Kang J (2021) An improved teaching–learning-based optimization for multilevel thresholding image segmentation. Arab J Sci Eng 46:8371–8396. https://doi.org/10.1007/s13369-021-05483-0
Kalyani R, Sathya PD, Sakthivel VP (2021) Multilevel thresholding for image segmentation with exchange market algorithm. Multimed Tools Appl 80(1):1–39. https://doi.org/10.1007/s11042-021-10909-w
Kapur JN, Sahoo PK, Wong AKC (1985) A new method for gray-level picture thresholding using the entropy of the histogram. Comput Vision Graph Image Process 29(3):273–285. https://doi.org/10.1016/0734-189X(85)90125-2
Karaboga D, Basturk B (2007) A powerful and efficient algorithm for numerical function optimization: artificial bee colony (abc) algorithm. J Glob Optim 39(3):459–471. https://doi.org/10.1007/s10898-007-9149-x
Kathiroli P, Kanmani S (2021) An efficient cluster-based routing using sparrow search algorithm for heterogeneous nodes in wireless sensor networks. In: International Conference on Communication information and Computing Technology. https://doi.org/10.1109/ICCICT50803.2021.9510032
Kennedy J, Eberhart R (2002) Particle swarm optimization. In: Icnn95-international conference on neural networks. IEEE. https://doi.org/10.1109/ICNN.1995.488968
Khairuzzaman A, Chaudhury S (2020) Modified moth-flame optimization algorithm-based multilevel minimum cross entropy thresholding for image segmentation. International Journal of Swarm Intelligence Research (IJSIR) 11(4):123–139. https://doi.org/10.4018/IJSIR.2020100106
Kittler J, Illingworth J (1986) Minimum error thresholding. Pattern Recogn 19(1):41–47. https://doi.org/10.1016/0031-3203(86)-90030-0
Lei B, Fan J (2019) Image thresholding segmentation method based on minimum square rough entropy. Appl Soft Comput 84(1):105687. https://doi.org/10.1016/j.asoc.2019.105687
Li DQ (2021) A hybrid sparrow search algorithm. Comput Knowl Technol (05):232–234 (in China). https://doi.org/10.14004/j.cnki.ckt.2021.0594
Li CH, Lee CK (1993) Minimum cross entropy thresholding. Pattern Recogn 26(4):617–625. https://doi.org/10.1016/0031-3203(93)90115-D
Li G, Zhao Y, Zhang L, Wang X et al (2020) Entropy-based global and local weight adaptive image segmentation models. Tsinghua Sci Technol 25(1):149–160. https://doi.org/10.26599/TST.2019.9010026
Liang J, Wang L, Ma M, Zhang J (2018) A fast Sar image segmentation method based on improved chicken swarm optimization algorithm. Multimed Tools Appl 77(24):31787–31805. https://doi.org/10.1007/s11042-018-6119-x
Liang Q, Chen B, Wu H, Ma C, Li S (2021) A novel modified sparrow search algorithm with application in side lobe level reduction of linear antenna array. Wirel Commun Mob Comput 2021(22):1–25. https://doi.org/10.1155/2021/9915420
Lin QQ, Zhang L, Wu TL, Mean TS, Tseng HW (2020) Application of tsallis cross-entropy in image thresholding segmentation. Sensors Mater 32(8):2771. https://doi.org/10.18494/SAM.2020.2798
Liu Y, Li S (2010) Two-dimensional arimoto entropy image thresholding based on ellipsoid region search strategy. In: Multimedia Technology (ICMT), 2010 International conference on. IEEE. https://doi.org/10.1109/ICMULT.2010.5631047
Liu JZ, Li WQ (1993) The automatic thresholding of gray-level pictures via two-dimensional Otsu method. Acta Automat Sin 19(1):101–105. https://doi.org/10.3969/j.issn.1001-3695.2011.03.106
Liu G, Shu C, Liang Z, Peng B, Cheng L (2021) A modified sparrow search algorithm with application in 3d route planning for UAV. Sensors 21(4):1224. https://doi.org/10.3390/s21041224
Lv X, Mu XD, Zhang J (2021) Multi threshold image segmentation based on improved sparrow search algorithm. Syst Eng Electron (02):318–327 (in China). https://doi.org/10.12305/j.issn.1001-506x.2021.02.05
Mahajan S, Mittal N, Pandit AK (2021) Image segmentation using multilevel thresholding based on type ii fuzzy entropy and marine predators algorithm. Multimed Tools Appl 80(13):19335–19359. https://doi.org/10.1007/s11042-021-10641-5
Mao QH, Zhang Q (2021) Improved sparrow algorithm integrating Cauchy mutation and reverse learning. Comput Sci Explor 15(6):1155–1164 (in China. https://doi.org/10.3778/j.issn.1673-9418.2010032
Meng X, Yu L, Gao X, Zhang H (2014) A new bio-inspired algorithm: chicken swarm optimization. In: International conference in swarm intelligence. Springer International Publishing. https://doi.org/10.1007/978-3-319-11857-4_10
Mirjalili S, Lewis A (2016) The whale optimization algorithm. Adv Eng Softw 95:51–67. https://doi.org/10.1016/j.advengsoft.2016.01.008
Mohammadi-Balani A, Nayeri MD, Azar A, Taghizadeh-Yazdi M (2020) Golden eagle optimizer: a nature-inspired metaheuristic algorithm. Comput Ind Eng 152:107050. https://doi.org/10.1016/j.cie.2020.107050
Moussa M, Ouni HE, Douik A (2020) Edge detection based on fuzzy logic and hybrid types of shannon entropy. J Circuits Syst Comput 29(14):2050227. https://doi.org/10.1142/S0218126620502278
Nejad MR, Fartash M (2016) Applying chaotic imperialist competitive algorithm for multi-level image thresholding based on Kapur's entropy. Adv Sci Technol Res J 10(29):125–131. https://doi.org/10.12913/22998624/61940
Otsu N (2007) A threshold selection method from gray-level histograms. IEEE Trans Syst Man Cybern 9(1):62–66. https://doi.org/10.1109/TSMC.1979.4310076
Pal NR, Pal SK (1989) Object-background segmentation using new definitions of entropy. IEEE Proceedings Part E 136(4):284–295. https://doi.org/10.1049/ip-e.1989.0039
Pal NR, Pal SK (1989) Entropic thresholding. Signal Process 16(2):97–108. https://doi.org/10.1016/0165-1684(89)90090-X
Pan WT (2012) A new fruit fly optimization algorithm: taking the financial distress model as an example. Knowl-Based Syst 26(2):69–74. https://doi.org/10.1016/j.knosys.2011.07.001
Peng C, Zou J, Liang M, Zhang Z, Xu H, Zhang Z (2020) A novel linear ccd variable velocity two-dimensional imaging approach based on adaptive image segmentation. IEEE/ASME Trans Mechatron 25(2):762–769. https://doi.org/10.1109/TMECH.2020.2975096
Qais MH, Hasanien HM, Alghuwainem S (2020) Transient search optimization: a new meta-heuristic optimization algorithm. Appl Intell 50(11):3926–3941. https://doi.org/10.1007/s10489-020-01727-y
Roy PC, Boddeti VN (2019) Mitigating information leakage in image representations: a maximum entropy approach. In: IEEE/CVF Conference on Computer Vision & Pattern Recognition. https://doi.org/10.1109/CVPR.2019.00269
Shen YX, Zhang XF et al (2021) Multiscale sine cosine optimization algorithm. Control Decis:1–10 (in China. https://doi.org/10.13195/j.kzyjc.2021.0513
Sm A, Smm B, Al A (2014) Grey wolf optimizer. Adv Eng Softw 69:46–61. https://doi.org/10.1016/j.advengsoft.2013.12.007
Takeda H, Yoshida S, Muneyasu M (2020) Learning from Noisy Labeled Data Using Symmetric Cross-Entropy Loss for Image Classification. In: 2020 IEEE 9th global conference on consumer electronics (GCCE). IEEE. https://doi.org/10.1109/GCCE50665.2020.9291873
Taruna AHD, Tiwari P (2021) A new parametric generalized exponential entropy measure on intuitionistic vague sets. Int J Inf Technol 13(4):1375–1380. https://doi.org/10.1007/s41870-021-00655-5
Tuerxun W, Xu C, Guo H, Jin Z, Zhou H (2021) Fault diagnosis of wind turbines based on a support vector machine optimized by the sparrow search algorithm. IEEE Access 9:69307–69315. https://doi.org/10.1109/ACCESS.2021.3075547
Wang P, Zhang Y, Yang H (2021) Research on economic optimization of microgrid cluster based on chaos sparrow search algorithm. Comput Intell Neurosci 2021(3):1–18. https://doi.org/10.1155/2021/5556780
Wets JB (1981) Minimization by random search techniques. Math Oper Res 6(1):19–30. https://doi.org/10.2307/3689263
Wu DH, Kong F, Ji ZC (2017) Convergence analysis of chicken swarm algorithm. Journal of Central South University: Natural Science Edition 48(8):2105–2112. (in China. https://doi.org/10.11817/j.issn.1672-7207.2017.08.018
Xue JK, Shen B (2020) A novel swarm intelligence optimization approach: sparrow search algorithm. Systems Science & Control Engineering An Open Access Journal 8(1):22–34. https://doi.org/10.1080/21642583.2019.1708830
Yan Z, Zhang J, Yang Z, Tang J (2020) Kapur's entropy for underwater multilevel thresholding image segmentation based on whale optimization algorithm. IEEE Access 9:41294–41319. https://doi.org/10.1109/ACCESS.2020.3005452
Yuan J, Zhao Z, Liu Y, He B, Gao Y (2021) Dmppt control of photovoltaic microgrid based on improved sparrow search algorithm. IEEE Access 9:16623–16629. https://doi.org/10.1109/ACCESS.2021.3052960
Zhang J, Xia K, He Z, Yin Z, Wang S (2021) Semi-supervised ensemble classifier with improved sparrow search algorithm and its application in pulmonary nodule detection. Math Probl Eng 2021:1–18. https://doi.org/10.1155/2021/6622935
Zhou S, Xie H, Zhang C, Hua Y, Sui X (2021) Wavefront-shaping focusing based on a modified sparrow search algorithm. Optik - International Journal for Light and Electron Optics 244(35):167516. https://doi.org/10.1016/j.ijleo.2021.167516
Acknowledgments
The authors would like to thank the Editor-in-Chief, the Associate Editor, and the reviewers for their insightful comments and suggestions.
Funding
This work is supported by National Natural Science Foundation of China under Grant 61873326, Natural Science Foundation of Jiangsu Province under Grant BK20130873, The Scientific Research Foundation for Returned Scholars of Ministry of Education under Grant BJ213010, The Scientific Research Funds of Nanjing University of Posts and Telecommunications under Grant NY220216.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interest
We confirm that this article content has no conflicts of interest to declare.
Additional information
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
The original online version of this article was revised: The expressions of F9, F11, F12 and F14 in Table 3 and format of Table 4 were incorrect.
Rights and permissions
About this article
Cite this article
Wu, D., Yuan, C. Threshold image segmentation based on improved sparrow search algorithm. Multimed Tools Appl 81, 33513–33546 (2022). https://doi.org/10.1007/s11042-022-13073-x
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11042-022-13073-x