{'fraction_non_alphanumeric': 0.03568204494702333, 'fraction_numerical': 0.012210766380006653, 'mean_word_length': 4.73202614379085, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Hybrid Method for Image Segmentation Based on Artificial Fish Swarm Algorithm and Fuzzy c-Means Clustering

Image segmentation plays an important role in medical image processing. Fuzzy c-means (FCM) clustering is one of the popular clustering algorithms for medical image segmentation. However, FCM has the problems of depending on initial clustering centers, falling into local optimal solution easily, and sensitivity to noise disturbance. To solve these problems, this paper proposes a hybrid artificial fish swarm algorithm (HAFSA). The proposed algorithm combines artificial fish swarm algorithm (AFSA) with FCM whose advantages of global optimization searching and parallel computing ability of AFSA are utilized to find a superior result. Meanwhile, Metropolis criterion and noise reduction mechanism are introduced to AFSA for enhancing the convergence rate and antinoise ability. The artificial grid graph and Magnetic Resonance Imaging (MRI) are used in the experiments, and the experimental results show that the proposed algorithm has stronger antinoise ability and higher precision. A number of evaluation indicators also demonstrate that the effect of HAFSA is more excellent than FCM and suppressed FCM (SFCM).


Introduction
Image segmentation is to divide the image into regions with different features. As an important procedure in image processing, image segmentation is a hotspot and difficulty in medical image technology field [1]. One of the most widely used algorithms in the area of image segmentation [2,3] is the fuzzy -means (FCM). FCM [4][5][6] is the mainstream algorithm in fuzzy clustering method. It has advantages of unsupervised, simple implementation, no threshold set, and practicality, but at the same time it has the disadvantages of sensitivity to random initial value, easily falling into local optimal solution, and large calculation under the multidimensional space. Intelligent algorithm can obtain global optimal solution quickly, and it is suitable for the complex data space of nonlinear multidimension while few approaches aim at combining AFSA with FCM. As early as 1996, Chun and Yang have introduced intelligent algorithm into image segmentation field by researching the combination of genetic algorithm and FCM [7]. The hybrid algorithms [8][9][10][11][12] have more excellent performance to overcome the shortcomings of FCM.
Artificial fish swarm algorithm (AFSA) [13,14] is an algorithm which is put forward by Li et al. It has features of universality, combining with the traditional algorithm easily, and less sensitivity to initial value, and its theory is suitable for solving the clustering problem. For years, some scholars introduced AFSA into the field of image segmentation [15][16][17][18]. Most of the approaches aim at the optimization of threshold segmentation method, while the approach on combining AFSA with FCM is less. Wang et al. [19] utilized AFSA to get the optimal clustering centers and then carried out the local searching by FCM so as to avoid local optimum. Liu et al. [20] proposed a dynamic fuzzy clustering method based on artificial fish swarm algorithm by introducing a fuzzy equivalence matrix. He et al. [21] verified that AFSA with adaptive visual and step combining with FCM is more superior to genetic algorithm.
In this paper, we propose a hybrid artificial fish swarm clustering algorithm (HAFSA). The proposed algorithm combines artificial fish swarm algorithm (AFSA) with FCM. With parallel search technology, HAFSA can overcome the defect that the FCM is easy to fall into local optimal solution. Metropolis criterion and noise reduction mechanism are introduced into the proposed algorithm, not only improving the convergence rate but also taking advantage of spatial neighborhood information to enhance antinoise ability and practicability. The artificial grid graph and Magnetic Resonance imaging (MRI) are utilized in the experiments. The experimental results compared with FCM and SFCM [22] show that HAFSA is more excellent through a number of evaluation indicators. These verify that HAFSA is effective and feasible in overcoming the sensitivity of initial value and noise.

Fuzzy -Means Algorithm
FCM algorithm was proposed by Dunn [5] and improved by Bezdek [6] later. The basic FCM algorithm can divide the gray image data into several clusters. The optimization model of FCM is shown in the following formula: where U = { } × denotes the fuzzy membership matrix, ∈ [0, 1] is the degree of membership of the pixel in the cluster V , and = × is the size of gray image. V = {V } denotes cluster centers.
= ‖V − ‖ is the Euclidean distance between and V . The fuzzy weighting exponent ∈ [1, ∞) is generally set to 2. The update equations of membership degree matrix and cluster centers are shown in the following formula: FCM algorithm has simple principle and process without initial parameters. However, FCM is sensitive to initial membership degree matrix (or cluster centers) and falls easily into local optimal solution because of the iterative process of gradient descent. Images are frequently attacked by noises. FCM is not suitable for the actual image without the ability to identify noise. At present, scholars improved the defects of FCM by changing the objective function or combining with other optimization algorithms [23,24]. SFCM [22] was proposed to improve the clustering performance as well as convergence rate by introducing the suppression factor. Moreover, some researchers educed noise by spatial information [25,26] or noise processing [27].

Artificial Fish Swarm Algorithm (AFSA).
AFSA is an intelligent optimization algorithm which is designed by imitating the behaviors of fish swarm. The algorithm is an autonomous model based on four major behaviors, preying behavior, swarming behavior, following behavior, and random behavior, which fully perform the local search so that the population diversity is ensured maximally and local optimal solution avoids premature convergence. Let = {0, 1, . . . , − 1} denote the gray levels, where = 256 and gray levels are from 0 to 255. In the process of image segmentation, fish's location coding is a pixel gray value vector V = (V 1 , V 2 , . . . , V ) which consisted of cluster centers. The -means objective function serves as food concentration of artificial fish; that is, (V) = (V). As shown in Figure 1, AFSA mainly adjusts the position of the artificial fish by swarm behavior and follow behavior. AFSA will be terminated when it converges or achieves the maximum generation Maxgen. The four basic behaviors are described below.
(i) Prey Behavior. Prey behavior is the default behavior of the swarm behavior and follow behavior. Assuming the current position of artificial fish is V , another position V is randomly selected in the visual field of V . If (V ) < (V ), the artificial fish moves a step to V according to formula (3) and prey behavior terminates. If (V ) ≥ (V ), keep reselecting new V until (V ) < (V ) or reach the maximum reselection times . Artificial fish will perform the random behavior if it still cannot select an ideal position after times reselection. Consider where is the maximum moving distance of artificial fish and is the random scalar.
(ii) Swarm Behavior. If (V )/num < ⋅ (V ), V will have more food concentration and will be more uncrowded than V ; then the artificial fish should move a step toward V according to formula (3) (V ← V ); else perform the prey behavior, where integer num denotes the number of partners in the visual field of V , V is the center position of num partners, and ∈ [0, 1] is the congestion level.
, V * will have more food concentration and will be more uncrowded than V ; then the artificial fish should move a step toward V * according to formula (3) (V ← V * ); else perform the prey behavior, where the partner position V * has minimalmeans objective function in visual field of V .
(iv) Random Behavior. Random behavior is the default of prey behavior. The artificial fish in position V should perform the random behavior according to formula (4) when it cannot select a more excellent position in prey behavior after No times random reselection, where denotes a random vector in [−1, 1] with the size of × 1. Consider

Metropolis Criterion.
Metropolis criterion stems from simulated annealing algorithm (SA) [28]. In HAFSA, Metropolis criterion exists in each iteration behind the swarm behavior and follow behavior. Cluster center vector V and the -means objective function (V ) are equivalent to the state of the atom and the energy function in SA.
After swarm behavior and follow behavior, the artificial fish located in the original position V will move a step to a new position V . If (V ) ≤ (V ), the artificial fish should accept superior position V unconditionally. If (V ) > (V ), the artificial fish should accept inferior position by probability , which is defined as formula (5), or refuse V and turn back to V . Consider where = 1 is Boltzmann constant, = −1 ⋅ is the temperature of the th iteration, = ( end / 0 ) 1/ is the refrigeration level, 0 is the initial temperature, and end is the final temperature.
In HAFSA, Metropolis criterion is utilized to distinguish whether the artificial fish should accept a new position. At the beginning of HAFSA, the probability of accepting inferior position is larger, the diversity of population is increased, and the wide area searching is enlarged to avoid falling into local optimum. With the increasing of iterations, the acceptance probability decreases and more and more inferior position will be refused; then the convergence speed slows down but the local search ability will be enlarged which is helpful for keeping global optimal position.

Noise Reduction Mechanism.
Most noises are Gaussian noise and salt and pepper noise in medical images. Noises generally locate in the same cluster or boundary of several different clusters. The gray image is mostly like a grid network where each pixel possesses 8 neighbors (except the pixels at the edge of the image) as shown in Figure 2(a). Different from the common pixels, the noise pixels usually have huge disparities with most of their neighbors. In previous articles, the noises usually are processed by filter, but the filter is only suitable for specific images which will lead to the deterioration of segmentation accuracy for edge blur. A noise reduction mechanism is proposed in this section which integrates into AFSA and achieves the identification and procession of noises. Gaussian noise is chosen to test the antinoise ability of HAFSA.
In AFSA, artificial fish will obtain the best cluster center V best with minimal -means objective function after each iterative computation. According to V best , we can calculate the fuzzy membership matrix U and then the best cluster matrix C by the value of the -means objective function. Consider where , ∈ {1, . . . , } denotes the cluster attribute of pixel V , . Let 8 nearest pixels be the neighbors of V , . When the number of neighbors cluster attributes which are equal to , is less than , V , can be defined as a noise pixel, where is an arbitrary integer and mostly set as 1. At the end of each iteration, after recognizing all the noises, we replace noise pixel with an average pixel of the neighbors which belong to the maximum cluster set. With the convergence of AFSA, the noise in the gray image will be recognized and reduced step by step.
As an example, Figure 2(a) demonstrates that the pixel of candidate noise V , generally has a huge difference with its 8 neighbors. Figure 2(b) demonstrates that V , has been signed as cluster attributes 3 by AFSA, but its neighbors have been signed as cluster attributes 1 . There are no neighbors signed as 3 , and then V , can be recognized as a noise. As the density of noise increases, we can set larger to recognize adjacent noises. As shown in Figure 2(c), the adjacent noises V , and V , +1 will be recognized if = 2. After recognizing noises, we will replace noise with average pixel of its neighbors.  (18) Record the artificial fish V best with minimum -means objective function (19) Calculate the best segmentation result C according to V best (20) Process the noise pixels in according to C (21) end while (22) Centers ← V best (23) return C, Centers Algorithm 1: HAFSA. 1 and 2 ; means noise V , locates in the boundary of 2 clusters. The size of cluster 1 is 5, and the size of 3 is 3; hence we replace V , with the average pixel of 5 neighbors in 1 as An effective integration is designed by combining the noise reduction mechanism with AFSA, which processes the noise based on the best cluster center after each iterative concentration and reduces the calculation. Noise reduction mechanism always exists in the iterative process of AFSA and then subsequently converges. The procession of noise reduction gradually avoids the misjudgment of noise and ensures the accuracy and adaptability of noise identification.

Hybrid Artificial Fish Swarm Algorithm (HAFSA).
HAFSA is proposed in this section by introducing Metropolis criterion and noise reduction mechanism, based on AFSA. HAFSA inherits the computing framework of AFSA which has the advantages of strong optimization ability and less easiness of falling into the local optimum. By introducing Metropolis criterion, HAFSA's convergence speed has been accelerated and segmentation accuracy has been improved. The proposed noise reduction mechanism makes full use of AFSA's cluster result, which can improve the noise identification ability of HAFSA; meanwhile it has fewer computations than other noise reduction mechanisms. HAFSA is shown in Algorithm 1.

Experimental Results
The experiments are based on the computer with Intel Core i3, 4GB RAM, and dual-core 3.40 MHz and were performed in Matlab 2009a compiler. In order to verify FCM, SFCM, and HAFSA, artificial grid graph and Magnetic Resonance Imaging (MRI) (mr030.pgm in Computational and Mathematical Methods in Medicine 5 http://decsai.ugr.es/cvg/dbimagenes/gbio256.php) have been introduced to test the antinoise ability and the segmentation effect on real-world environment. In addition to the visually qualitative results, we have introduced many numerical indexes to evaluate the accuracy of segmentation results.
In HAFSA, we set the maximum number of iterations as = 50, fuzzy weighting exponent as = 2, food concentration as formula (3), the size of population as 20, visual field as V = /10, congestion level as = 3, step of self-adaption as = V /2, initial temperature as 0 = 10 4 , and final temperature as end = 10 2 . Iterative threshold in FCM and SFCM is 10 − 5.

Assessment of Segmentation Performance.
In this section, numerous evaluation indexes [24] have been carried out to evaluate the segmentation of HAFSA, FCM, and SFCM. They are -means objective function value , Peak Signalto-Noise Ratio (PSNR), mean square error (MSE), variance partition coefficient (vpc), variance partition entropy (vpe), segmentation accuracy (Accuracy), and Jaccard similarity (JS). With the increasing of and vpe and the decreasing of PSNR, vpc, Accuracy, and JS, the algorithms' segmentation results will get better. The calculation of evaluation indexes is described below.
PSNR is an objective standard to evaluate images which calculates the mean square error between original image and processed image whose computational formula is shown in formula (7). MSE is the mean square error between original image and processed image whose formula is shown in formula (8). Consider the following: where ( , ) is the gray level of the pixel in original image, ( , ) is the gray level of the pixel in processed image, and max is the maximum gray level of the image. Partition coefficient, vpc, and partition entropy, vpe, are defined in the following formula: Segmentation accuracy is defined as the sum of the correctly classified pixels divided by the sum of the total number of pixels; the computational formula is shown in the following formula: where 1 represents the set of pixels belonging to the th cluster by the segmentation algorithm and 2 represents the set of pixels belonging to the th cluster in the reference segmented image. Jaccard similarity (JS) is applied as the metric to quantitatively evaluate the segmentation accuracy. JS is defined as follows: where 1 and 2 represent segmentation results of different algorithms and ground truth, respectively.

Segmentation of Artificial Grid Graph.
In this section, we design the artificial grid graph to test the antinoise ability of HAFSA, FCM, and SFCM. Figure 3(a) demonstrates the artificial grid graph which consisted of 3 kinds of pixels: black (0), gray (127), and white pixels (255). The grid graph can be divided into 4 × 4, a total of 16, sublumps according to the pixel level. The artificial grid graph is an ideal simulation object which has clear boundaries between different lumps. In order to test antinoise ability, 5% Gaussian noise and 10% Gaussian noise have been added to the artificial grid graph and produced Figures 3(b) and 3(c). Figures 3(d), 3(e), and 3(f) are the segmentation results of HAFSA, FCM, and SFCM on 5% Gaussian noise grid graph. Figures 3(g), 3(h), and 3(i) are the segmentation results of HAFSA, FCM, and SFCM on 10% Gaussian noise grid graph.
As it can be seen in Figure 3, compared with FCM and SFCM, the segmentation results of HAFSA have clear boundaries and almost no noise pixel under the 5% and 10% Gaussian noises, which verifies the strong antinoise ability of HAFSA. Even though the segmentation results of SFCM are slightly superior to FCM, both of them are unable to identify or eliminate noise, and their segmentation results are seriously attacked by noises.
In order to verify the performances among these three algorithms, evaluation indexes have been introduced to make a comprehensive assessment. We take the average of 30 times experiment results for each algorithm. Table 1 presents 7 evaluation indexes of 3 algorithms on 3 kinds of artificial grid graph. From Table 1, it can be seen that all the evaluation indexes of 3 algorithms on grid graph have reached their best value, which means that 3 algorithms can get excellent segmentation on the no-noise condition. The evaluation indexes of HAFSA are more superior to FCM and SFCM under 5% and 10% Gaussian noises. It demonstrates that HAFSA has outstanding antinoise ability. Figures 4(a) and 4(b) show curves of the relationship between -means objective function and the intensity of Gaussian noise and Speckle noise. According to Figures  4(a) and 4(b), the value of 3 algorithms increases with the increasing intensity of Gaussian noise or Speckle noise. Under the same noise intensity situation, HAFSA is superior (with smaller ) to SFCM obviously, and SFCM algorithm is superior to FCM algorithm slightly. With the increasing of the Gaussian noise, increases rapidly for SFCM and FCM but slowly for HAFSA (note that in Figure 4(a) -axis is uneven;  Hence, MRI can be divided into 4 clusters [10]. The first column of Figure 5 presents the original MRI, standard segmentation of WM, standard segmentation of GM, and standard segmentation of CSF; from the second column to the fourth column are the segmentation results of FCM, SFCM, and HAFSA, respectively. Observing the first row of    Figure 5. The basic FCM algorithm and the SFCM algorithm obtain the inferior effectiveness of segmentation whose edges are in the 3 target regions with a lot of trivial and rough areas, and the details of the target regions cannot be distinguished clearly. The proposed HAFSA can restore the original details even under complicated noise environment. The segmentation figures generated by HAFSA usually have clear outline, complete targets, and the maximum similarity with the standard segmentations which are divided manually by experienced experts. Table 2 presents 7 evaluation indexes of 3 algorithms on MRI. The evaluation indexes , PSNR, vpc, vpe, Accuracy, JS, and MSE of HAFSA are superior to the ones of FCM and SFCM obviously; only vpe is inferior to SFCM slightly. Table 2 shows that HAFSA has precise segmentation results on MRI, which means that HAFSA is suitable for practical application.
The CPU times of FCM, SFCM, and HAFSA are 1.6821 seconds, 3.9431 seconds, and 4.4052 seconds on the artificial grid graph and 1.7890 seconds, 4.2350 seconds, and 4.6943 seconds on MRI, respectively. HAFSA is slower than FCM and almost as fast as SFCM.

Conclusion
The proposed algorithm, HAFSA, is a combination of AFSA, noise reduction mechanism, and Metropolis criterion, and it has the advantages of insensitiveness to initial values, powerful capability of antinoise, robust and precise segmentation result, and fast convergence. The experimental results which are verified by the visual effects and evaluation indexes, , PSNR, vpc, vpe, Accuracy, JS, and MSE, demonstrate that HAFSA is superior to classical FCM and SFCM on both artificial grid graph and actual MRI.