1. Introduction
Image segmentation is a key component of image processing aimed at separating important or relevant localized areas within an image region. Only by segmenting the target area accurately can the features of the target image be extracted, analyzed, and measured. Image segmentation has many applications, including license plate recognition, medical image segmentation, object defect detection, and so on. Image thresholding segmentation is a simple and efficient method, and it is one of the most commonly used methods. The Otsu image segmentation algorithm is widely used because it has low computational complexity, high stability, and good segmentation effects. The one-dimensional Otsu algorithm has less histogram information, and the image segmentation effect is poor, so researchers proposed the 2-D Otsu algorithm, which enhances the segmentation effects significantly, although the computation of the 2-D Otsu algorithm was intensive. Reddi et al. [
1] combined the differential evolutionary algorithm with the 2-D Otsu algorithm, which reduced the computational complexity and improved the speed of the algorithm. Zhang et al. [
2] improved the neighborhood mean algorithm by using 2-D gray and gradient histograms and introduced the separation information between classes to improve the threshold function, which was simplified to reduce the computational complexity; however, the threshold vector was calculated directly, requiring a lot of time.
The key to the 2-D Otsu image segmentation algorithm is to find the threshold vector that best maximizes the dispersion between classes, and group intelligence algorithms are gradually applied to threshold selection. The group intelligence algorithm significantly improves the effect of threshold segmentation, making it better than other methods. Huang et al. [
3] proposed the Otsu image segmentation algorithm based on the Fruit Fly Optimization Algorithm (FOA), which was a fast image segmentation algorithm with high real-time capability. Liu et al. [
4] suggested a multi-threshold Otsu image segmentation method, using a cell membrane and adaptive step size to improve the Firefly Algorithm (FA), which solved the problem of the local optimum and achieved a higher convergence speed and better segmentation results. The researchers in [
5,
6] used some methods to enhance the whale optimization algorithm (WOA) and proposed a hybrid whale optimization algorithm for Otsu multi-threshold image segmentation, which improved the efficiency and accuracy of image segmentation. However, the convergence rate of the above algorithm was slow, reaching convergence only after many iterations. Therefore, the algorithm convergence rate needed to improve.
The Butterfly Optimization Algorithm (BOA) is an intelligent algorithm [
7] that simulates the behavior of butterflies, such as their search for food and mate selection. It is used to solve global optimization problems, and it has a simple principle, few parameters, and good results for optimal searches. It is also widely used in path planning, particle filtering, photovoltaic power generation, and so on. However, the traditional BOA algorithm has some shortcomings, such as low optimization accuracy and slow convergence speed. Therefore, there is considerable scope for enhancing its optimization stability and accuracy. Wu et al. [
8] proposed a revised BOA algorithm that combines refractive opposition learning and adaptive inertia weights and used it to achieve multi-threshold image segmentation. This method improved the image segmentation accuracy and segmentation efficiency, but the convergence speed was slow.
Fractional-order calculus is a part of high-level mathematics and can be used in a wide range of fields, including engineering, artificial intelligence, and medicine. Pu et al. [
9] illustrated the physical significance and an algorithm for implementing the fractional order in signal processing, which set the stage for using the fractional order in image processing. Micael et al. [
10] enhanced the Particle Swarm Optimization algorithm through fractional-order differentiation and suggested that the convergence speed of an algorithm is related to the fractional order. The adaptive order of fractional-order differentiation was proposed by Wei [
11], and she used fractional-order differentiation to improve the Particle Swarm Optimization (PSO) algorithm. This method improved the convergence speed of the algorithm and prevented it from falling into the local optimum; further, it introduced a symmetric particle distribution to improve the algorithm’s optimization accuracy. Fractional-order calculus can improve the convergence rate of group intelligence algorithms, but few people use the fractional order to solve the disadvantages of traditional algorithms. Only several researchers have used fractional-order and intelligence algorithms to process image segmentation [
12,
13].
Therefore, this paper introduces fractional-order differentiation and other methods to avoid the shortcomings of the traditional BOA algorithm, and it proposes the hybrid fractional-order butterfly optimization algorithm (HFBOA), which uses fractional-order differentiation and adaptive flavor perception strength to improve the global position search of the BOA algorithm. At the local stage, it combines fractional-order differentiation with the sine-cosine algorithm as the position from which the local search is updated, improving the convergence speed and optimal search accuracy. This paper introduces dynamic conversion probability so that the algorithm performs a more intensive global search in the early stage and an enhanced local search in the later stage, preventing the BOA algorithm from falling into a local optimum. Finally, this paper proposes a 2-D Otsu image segmentation algorithm based on the HFBOA and demonstrates the use of this algorithm to perform image segmentation, improving the efficiency of the process.
2. The 2-D Otsu Threshold Segmentation Algorithm
The 2-D Otsu image segmentation algorithm adds the distribution of the difference between the original pixel gray level and the average gray level of the domain pixel to the pixel gray level distribution and produces a 2-D distribution histogram. The segmentation principle of the 2-D Otsu image segmentation algorithm is as follows: for a digital image
whose size is
M ×
N, the total pixel gray level is
L, so the average gray value in the
k ×
k neighborhood centered on (
x,
y) is
:
where
k,
l, and
q are integer numbers, meaning that
and
will take integer values.
The neighborhood grayscale gradient of the pixel is
. When the pixel’s gray value
=
i and the neighborhood grayscale gradient of the pixel
=
j, then
i,
j are taken as a binary group
. The appearance frequency of the pixel point (
i,
j) is
, and the corresponding point probability density
is defined as follows:
Assuming the binary group threshold
of the segmented image, where
s is the grayscale threshold and the gradient threshold is
t, the image can be segmented into four parts: the planar 2-D histogram is shown in
Figure 1, where I and III represent the background and the target, respectively, and the II and IV parts represent the edge and the noise, respectively.
Because the target and the background cover a relatively large area of the whole image, the edge and the noise parts can be ignored when calculating the probability of every part. The probability of the background class is
, and the appearance probability of the target class is
. The calculations are as follows:
The mean vectors of the background class
and target class
are
The total mean vector
of the pixels is
The inter-class dispersion matrix between the background class and the target class is
The inter-class dispersion value means the difference between the background class and the target class. The larger the value, the larger the difference between the background and the target, and the better the image segmentation. To measure the dissimilarity, the trace of the dispersion matrix is used as the fitness function:
When the trace of the dispersion matrix is the maximum, the best segmentation threshold
is obtained.
5. Experimental Results and Analysis
To verify the convergence speed and the segmentation accuracy of the HFBOA-Otsu algorithm, different types of images were chosen to perform threshold segmentation. The HFBOA-Otsu algorithm was compared with the 2-D Otsu image threshold segmentation based on the BOA algorithm (BOA-Otsu), the 2-D Otsu image threshold segmentation based on the PSO algorithm (PSO-Otsu), the 2-D Otsu image threshold segmentation based on Fractional PSO (Im-FpsoOtsu) [
11], and the 2-D Otsu image threshold segmentation based on the Fractional Firefly Algorithm (FFA-Otsu) [
20]. The experimental hardware environment was Intel(R) Core(TM) i5-8265U CPU 1.80 GHz, with 8 GB of memory, and the software environment was MATLAB R2017a.
Three types of images were selected for the segmentation experiment: human images, scenery images, and medical images. The image segmentation effects were objectively evaluated on the basis of five indexes: the fitness function value, iterations, Peak-Signal-to-Noise Ratio (PSNR), mean square error (MSE), and Structural Similarity Index (SSIM). The larger the fitness function value, the greater the gap between the background class and the target class, and the better the segmentation effects. The number of iterations reflects the algorithm convergence rate, and the smaller the value, the faster the algorithm convergence rate. The PSNR value reflects the noise performance of the algorithm, and the greater the value, the higher the quality of the segmented image. The MSE value represents the mean square errors between the original image and the segmented image, and the smaller the value, the higher the segmentation accuracy. The SSIM value measures the similarity between the original image and the segmented image, and the larger the value, the lower the image distortion.
There are four human images: the Lena image, the Pirate image, the Woman-blonde image, and the Kodim image. The segmentation results of human images are shown in
Figure 4. The first column of
Figure 4 is the original images, and the second column to the sixth column are the segmentation results of the five image segmentation algorithms. From the subjective visual perspective, in the Lena image segmentation results, the HFBOA-Otsu algorithm generates more detailed segmentation results in the hat and window areas. In the Pirate image, the HFBOA-Otsu algorithm retains more details than other algorithms. In the Woman-blonde image segmentation results, the HFBOA-Otsu algorithm segments a clear and complete hand. For the Kodim image, the segmentation results of the HFBOA-Otsu algorithm largely retain the texture at the collar. Therefore, the HFBOA-Otsu algorithm has greater advantages in human image segmentation. The differences in image segmentation results between the five algorithms are highlighted by the red squares.
The objective evaluation indexes of the human segmentation images are shown in
Table 3, and
Figure 5 shows the fitness curves of the human images. For the Lena image, combining
Table 3 and the fitness curve indicates that the HFBOA-Otsu algorithm finds the best segmentation threshold in 10 iterations, while the BOA-Otsu algorithm reaches convergence at 30 iterations, with the FFA-Otsu algorithm, the Im-FpsoOtsu algorithm, the PSO-Otsu algorithm converging at 19, 48, and 88, respectively. This shows that the convergence rate of the HFBOA-Otsu algorithm is faster. Moreover, the fitness function value and the SSIM value of the HFBOA-Otsu algorithm are higher than those of the other algorithms, indicating that the HFBOA-Otsu algorithm not only improves the convergence speed but also has a better segmentation effect. The PSNR value of the HFBOA-Otsu algorithm is also higher than those of the other algorithms, and the MSE value is smaller, so the HFBOA-Otsu algorithm can guarantee a high segmentation accuracy.
For the Pirate image, the number of iterations with the HFBOA-Otsu is five. As can be seen in
Figure 5b, the HFBOA-Otsu algorithm reaches convergence earlier, and it has a higher fitness function value and better segmentation effects. The PSNR value and the SSIM value of the HFBOA-Otsu algorithm are higher than those of other algorithms, and the MSE value is smaller, which shows that the segmentation accuracy and anti-noise performance of the HFBOA-Otsu algorithm are better than those of the other algorithms.
For the Woman-blonde image, the convergence of the HFBOA-Otsu algorithm, compared with the BOA-Otsu algorithm, the FFA-Otsu algorithm, the Im-FpsoOtsu algorithm, and the PSO-Otsu algorithm, is accelerated by 89.28%, 80%, 75%, and 89.65%, respectively. The fitness function value, the PSNR value, and the SSIM value are higher, indicating that the segmentation effects and anti-noise performance of the HFBOA-Otsu algorithm are improved. For the Kodim image, the convergence rate of the HFBOA-Otsu algorithm is faster, and the objective evaluation indexes are better than those of the other algorithms, which shows the HFBOA-Otsu algorithm has higher segmentation accuracy and better effects.
The scenery images include the Wall image, the Gorge image, the Butterfly image, and the Mandril image. The original images and the segmented images are shown in
Figure 6. And the first column is the original images, the second column is the images segmented by the BOA-Otsu algorithm, and the third column to sixth column are the images segmented by the FFA-Otsu algorithm, the Im-FpsoOtsu algorithm, the PSO-Otsu algorithm, and the HFBOA-Otsu algorithm, respectively. By comparison, for the segmented image of the Wall, the HFBOA-Otsu algorithm provides more details of the bricks. In the Gorge image, the HFBOA-Otsu algorithm can segment a clear line for the distant snow mountains, and the details of the segmentation effects are better than the other algorithms. In the segmentation of the Butterfly image, the HFBOA-Otsu algorithm can completely segment the petals at the edge of the image. For the Mandril image, the HFBOA-Otsu algorithm attains more details of the whiskers and hairs. Compared to the other algorithms, the HFBOA-Otsu algorithm can segment a clear scenery image and retain more details.
Table 4 show the objective evaluation indexes of the scenery segmentation images, and
Figure 7 shows the fitness curves of the scenery images.
According to
Table 4 and the fitness curve of the Wall image, the convergence rate of the HFBOA-Otsu algorithm is faster, and the fitness function value is slightly higher than that of the Im-FpsoOtsu algorithm; the fitness function value is about 12 times higher than the BOA-Otsu algorithm, and the HFBOA-Otsu algorithm greatly improves the segmentation effects of the Wall image. The PSNR value and the SSIM value are higher than those of the other algorithms, and the average PSNR value has risen by 0.1604, while the SSIM value has risen by 0.0276. Moreover, the MSE value is lower than those of the other algorithms, indicating that the segmentation accuracy and anti-noise resistance performance of the HFBOA-Otsu algorithm are improved.
For the Gorge image, the HFBOA-Otsu algorithm reaches convergence after 14 iterations, and the other four algorithms reach convergence after 18 iterations, 30 iterations, 42 iterations, and 67 iterations. The fitness curve of the Gorge image shows that the HFBOA-Otsu algorithm has a higher fitness function value than the other algorithms. Compared with the other algorithms, the PSNR value and the SSIM value of the HFBOA-Otsu algorithm are higher, and the MSE value is smaller. Therefore, the segmentation accuracy and anti-noise performance of the HFBOA-Otsu algorithm are better than those of the other algorithms.
For the segmentation results of the Butterfly image, the PSNR value of the HFBOA-Otsu algorithm is higher, and the MSE value is lower compared with the other algorithms; the SSIM value and the fitness function value are also higher, so the segmentation accuracy of the HFBOA-Otsu algorithm is higher and the segmentation effect is better. According to the fitness curve of the Butterfly image, the convergence of the HFBOA-Otsu algorithm is faster. For the Mandril image, the HFBOA-Otsu algorithm reaches convergence at 13 iterations, which is slightly smaller than that obtained with the FFA-Otsu algorithm, but its fitness function value is higher than that of the FFA-Otsu algorithm, about 4.2896, which shows that the HFBOA-Otsu algorithm ensures good image segmentation effects and has a faster convergence rate. The PSNR value, MSE value, and SSIM value of the HFBOA-Otsu algorithm are better than those of the other algorithms; therefore, the segmentation accuracy of the HFBOA-Otsu algorithm is higher and better.
There are four medical images: the Lung1 image, the Lung2 image, the Thorax image, and the Brain image.
Figure 8 shows the original images and the medical images’ segmentation results. From the first row, it can be seen that the HFBOA-Otsu algorithm has better segmentation effects and clearly segments the lung tissue. In the segmentation results of the Lung2 image, the BOA-Otsu algorithm cannot fully segment the lung tissue. The FFA-Otsu algorithm and the Im-FpsoOtsu algorithm are able to segment the lung tissue completely; however, there are some shortcomings in the details, whereas the segmentation results of the HFBOA-Otsu algorithm are clearer and have more details. For the Thorax image, the HFBOA-Otsu algorithm enabled the precise segmentation of organ tissue, and the lesion tissue is clear and complete. For the segmentation of the Brain image, the HFBOA-Otsu algorithm ensures the organ tissues are clearer and more complete. Therefore, the HFBOA-Otsu algorithm provides better segmentation results of medical images.
The objective evaluation indexes of the medical segmentation images are shown in
Table 5, which clearly shows the results of the medical segmentation images using the five algorithms, and it also shows the performance of each image threshold segmentation algorithm. The fitness curves of the medical images are shown in
Figure 9, comparing the convergence speed of the five algorithms.
As shown in
Table 5, for the Lung1 image, the number of iterations with the HFBOA-Otsu algorithm is four: compared with the BOA-Otsu algorithm, it is 92.72% faster. The FFA-Otsu algorithm, the Im-FpsoOtsu algorithm, and the PSO-Otsu algorithm find the optimal value after 13 iterations, 12 iterations, and 73 iterations, respectively. Therefore, the convergence rate of the HFBOA-Otsu algorithm is faster. The fitness function value, the SSIM value, the PSNR value, and the MSE value are better than those of the other algorithms. From the fitness curve of the Lung2 image, the HFBOA-Otsu algorithm has faster convergence, a higher fitness function value, and better segmentation effects. The MSE value and the SSIM value of the HFBOA-Otsu algorithm are better, indicating that the segmentation accuracy of the HFBOA-Otsu algorithm is higher. The PSNR value is also higher, and the segmentation results of the HFBOA-Otsu algorithm are least affected by noise.
According to the fitness curve of the Thorax image, the HFBOA-Otsu algorithm finds the optimal threshold after nine iterations. The other algorithms converged after 58 iterations, 14 iterations, 70 iterations, and 96 iterations, respectively. The fitness function value of the HFBOA-Otsu algorithm is larger, and the convergence speed and segmentation effects of the algorithm are improved. The PSNR value and SSIM value of the HFBOA-Otsu algorithm are larger than those of the other algorithms, and the MSE value is smaller, which means that the anti-noise performance of the HFBOA-Otsu algorithm is guaranteed, and the segmentation accuracy is improved. From the objective evaluation indexes of the Brain image segmentation results in
Table 5, it can be seen that the indexes of the HFBOA-Otsu algorithm are better than those of the other algorithms, indicating that the segmentation accuracy and anti-noise performance of the HFBOA-Otsu algorithm are improved.