Genetic Algorithm-Based Anisotropic Diffusion Filter and Clustering Algorithms for Thyroid Tumor Detection

Medical imaging is a technique that has been used for diagnosis and treatment of a large number of diseases. Therefore it has become necessary to conduct a good image processing to extract the finest desired result and information. In this study, genetic algorithm (GA)-based clustering technique (K-means and Fuzzy C Means (FCM)) were used to segment thyroid Computed Tomography (CT) images to an extraction thyroid tumor. Traditional GA, K-means and FCM algorithms were applied separately on the original images and on the enhanced image with Anisotropic Diffusion Filter (ADF). The resulting cluster centers from K-means and FCM were used as the initial population in GA for the implementation of GAKMean and GAFCM. Jaccard index was used to study resemblance, dissimilarity, distance between two sets of images, and effect of ADF on enhancing the CT images. The results showed that ADF increases the segmentation accuracy, where the value of Jaccard index of similarity between the ground truth image and segmented image was increased for all segmentation algorithms, in particular for FCM and GAFCM where similarity percent was up to 88%.


Materials and Proposed Method
The following flowchart explains the strategies used in this study to detect and extract tumors from thyroid CT images ( Figure-1).

Figure 1-A diagram of the strategies used in the present study.
It is worth to mention that the X-ray computed tomography (CT) images adopted in this study were supplied by: 1. Abu Ghareeb hospital \ Department of radiology (image size 512x512 pixels and 5mm slice thickness). 2. X-Ray institute (Image size 256 x 256 pixels and 5mm slice thickness).
3. Figure-2 shows some of CT images for patients with thyroid cancer of different modalities.

Axial
Axial Axial Coronal Figure 2-The four adopted images: the red arrows refer to the abnormalities (thyroid cancer) in the images.

Anisotropic Diffusion Filter (ADF)
The process of diffusion described by Fick's first law is a physical process which equalizes the concentration difference. If the concentration replaces the image intensity and the inhomogeneities of small concentration can be modeled as the noise, the diffusion filter can be used to smoothen the inhomogeneities of the image and adjust the image by solving equation 1 )the partial differential equation for noise removing ( [19] : where ( ) is the change of intensity as a function of time and D is the diffusion tensor . The diffusion is isotropic if D of image is homogenous. In this case, the filter constantly minimizes the noise of image but it also blurs the edges, which is it difficult to identify [19].  [11] that needs to accept the following conditions to achieve the above properties [19]: The following equations are proposed by Perona and Malik for d (│ I│) [19,11]: …………………………………… (4) When the anisotropic diffusion is performed, the diffusion coefficient in equation (3) is favorited to recognize the edges of high-contrast from the edges of low-contrast, while the wide area is favorited over the smaller regions in equation (4) [20,11].

……………………………….(5)
The partial differential equation which is used to enhance the image is [19]: The parameter (k) controls the diffusion magnitude. The low k value means that the low-intensity gradients are stopping the diffusion over the edges, while the large k leads the diffusion to skip the small intensity barriers, and hence decreasing the effect of intensity on anisotropic diffusion. The ideal range of k is between 20 and 100 [19]. The number of the iterations is another control parameter over the filtered images with ADF to smoothen the homogeneousity of image regions, with keeping the edges [11].

Clustering Methods
The conventional methods in clustering analysis are the unsupervised segmentation algorithms, such as k-mean and fuzzy c-mean, where an automatic algorithm separates the given dataset (CT image) into two or more clusters. The procedure involves grouping the data of similar features into one cluster and the data points of dissimilar characteristics into another cluster [21][22].

1.
K-Means Clustering Algorithm K-mean algorithm is built on the cluster centers selection. Optimum cluster centers are chosen to achieve the best result. Minimum Euclidean distance between pixels and cluster center is used to assign each pixel to the nearest cluster [23]. The process continues until the mean vectors in two consecutive iterations are equals [24]. The objective function used in this algorithm is [21]:

Abbas
Iraqi Journal of Science, 2020, Vol. 61, No. 5, pp: 1016-1026 1020 where ‖xi − vj‖ is the Euclidean distance from the pixel (xi) to the cluster center (vj), C is the number of cluster centers, and Ci is the number of pixels in each cluster [21].

Fuzzy C-Mean (FCM) Clustering Algorithm.
FCM is a method developed by Dunn in 1973 and improved in 1981 by Bezdex. It is an algorithm used to clustering data of unities information into two or many clusters and employed in pattern recognition [25]. It is based on minimizing the objective functions difference in two sequences ( ) [26,27]: where ( ) is the Euclidean distance between cluster center and each pixel, U ij is a membership of each pixel x i to cluster with center c j . The object function is optimized by a continual update of the ( ) and (c ) until the difference between two iterations becomes less than the threshold ( ) [26,27].

Genetic Algorithm
Genetic algorithms (GA) are defined as models of natural evolutionary systems and they have been used in science and engineering for solving practical computational problems as adaptive algorithms [28,29]. Genetic algorithm was inspired from the Darwinian theory of evolution by the concept of "survival of the fittest". It is of a stochastic analysis type, which depends on the selection of crossover and mutation operators. Genetic algorithm is composed of a population of a bit (0 or 1) represented as a chromosome. Each chromosome is a solution of a fitness function, which plays an important factor in the optimization function. The crossover and the mutation operators are used to produce new chromosomes from the old ones, where the new populations are generated at each iteration until the best solutions are found, due to the genetic algorithm nature. Fit individuals are used to reproduce the next generation by replacing some or all chromosomes in the old generation. The cycle continues until the optimum function value reaches the element of higher fitness [30,31], where the fitness is a key to success and meaningful for GA applications [29]. A simple GA consists of the following steps [28, 32, 33]: 1. Input data (image or data).

2.
Population of N chromosomes is generated with a random way. 3. Calculate fitness function for each chromosome in population. 4. Select the subset of greater fitness feature. 5. Crossover and mutation should be done between the fittest individuals. 6. The current population should take the value of the new generation. 7. When the new generation does not reach the highest accuracy of classification, go to step 3. In order to calculate the new fitness value. 8. Repeat steps (3-7) until reaching the desired accuracy. 9. Extract the correct chromosomes.

Genetic Algorithm Based Clustering (GAFCM, GAK-Mean)
The GA-based clustering method was proposed, where each chromosome in the population encodes a suitable partition of the image and the quality of the chromosome is calculated by using a fitness Abbas Iraqi Journal of Science, 2020, Vol. 61, No. 5, pp: 1016-1026 1021 function. The clustering technique using GAFCM or GAK-mean can be described by the following steps [26].

Population initialization
Real numbers of pixel intensity in thyroid images represent the population chromosomes of GA. Each chromosome has several variables (genes) that represent cluster centroids and they are taken randomly between 0 and 1 (lower and upper bound values, respectively) from all possible values of intensity in the CT images [26].

Fitness computation
The factor that indicates the degree of quality of a solution is the fitness of a chromosome. In this study, the fitness of a chromosome is calculated as follows: 1. Executing an objective function of clustering algorithms (K-mean or FCM) to minimize the sum of intra-cluster differences and find the membership of each pixel of the clusters, so the optimum cluster centers' values are used for the initial GA. …………………….. (12) where Ec is the variation between two sequent objective functions that resulted from FCM, the value of which must be reduced. Dc is Euclidean distance through cluster centers, E is the matrix of the error. Gij is the reference matrix (2xN). One dimensional binary image represents the first row of the reference matrix, while the second row is the complement of the first [26].

Selection
The Roulette wheel strategy was utilized for the population strings, where each chromosome had a number relative to its own fitness value [26,35].

Crossover and Mutation
The genetic operators, crossover and mutation, were used for the creation of the new chromosomes. For the crossover, the cluster centers were investigated in order to be divided, which means that the crossover points are only performed through two cluster centers to select the best. The mutation role was to restore the missing or the unexplored genetic material into the population to prevent the early convergence of GA to a suboptimal ending [26]. The mutation is of three types; the first type includes the probability of a replaced valid location in the chromosome , the second includes the valid positions that were randomly generated and now removed and replaced by `#', while third type includes the invalid position which was randomly chosen and now changed with a random point of the data set. One of the three types of mutations was applied on selected chromosomes [35].

Jaccard distance
Jaccard index measures the resemblance, dissimilarity, and distance between two data sets. It is defined as the intersection divided by the summation of the sets of data [36]. I (A, B) =|AՈB|/|AՍB|=|AՈB|/|A|+|B|-|AՈB| , 0≤ I (A, B) ≤1 where A & B are two sets of data. Jaccard similarity coefficient is expressed as [25]: (13) where, x ( 1, 2, …. ) and y ( 1, 2, ….) are two vectors and ≥ 0. Jaccard distance is the variation between the expected and observed images. It is complementary to the coefficient of Jaccard and is obtained by subtracting the coefficient from one, as follows [25]:

Abbas
Iraqi Journal of Science, 2020, Vol. 61, No. 5, pp: 1016-1026 1022 ( ) ( ) …………………… (14) Jaccard coefficient is the parameter used to detect the similarity between the segmented image and the original image. Jaccard index will always give a value between 0 (no similarity) and 1 (identical sets); if x and y are empty then its range is 0 ≤ I (x, y) ≤ 1 and I(X, Y) = 1. The values of Jaccard distance lie between 0 and 1, where the best value is 1 and the worst is 0 [25]. Results and Discussion 1. In the first stage of the study, the anisotropic diffusion filter (ADF) technique was directly applied to smoothen the image regions and retain the edges. The results of applying ADF on four images are shown in fig.3. The anisotropic diffusion tools were applied with success as a sufficient preprocessing step to remove noise and significantly improve the visual quality of the image, while preserving the boundaries of objects without enhancement.

2.
To evaluate the quality of ADF, the differences between the original image and the filtered image can be determined by several parameters such as variance and signal-to-noise ratio (SNR). Table-1 shows that the SNR value of the filtered images was increased while the value of variance of the filtered images was decreased. A good filter is that which reduces the variance while increasing SNR [19].  3. The segmentation algorithms GA, KM, FCM, GAK-Meam, and GAFCM were applied independently on the filtered and non-filtered (original) images to extract the tumor and determine the effect of the filter on the segmentation by computing the tumor size and comparing the Jaccard distance between the original and the segmented images. Morphological operation was employed to extract the tumor from the segmented image. The results of applying the algorithms on one sample of images are shown in Figures-(4 and 5). The segmentation ability of all algorithms is measured by computing and comparing tumor size and jaccard distance values (Table-2).

Conclusions
Unsupervised segmentation is an important clustering technique where two-dimension data of images are grouped into clusters, so that the pixels of similar features are in the same cluster. K-mean and FCM algorithms were effective and easy techniques, but they may give suboptimal results, depending on the initial selection of the cluster center. While, GA-based clustering is an optimization technique that depends on the evolution and genetics laws and, hence, it is expected to bring out a result of optimal clustering which is better than that obtained by K-Mean and FCM methods. However, this method might take a longer time. Jaccard Index was applied in this study to assess the performance of these methods. It is obvious from the results that ADF increased the segmentation accuracy, where Jaccard index increased with the enhancement of the image, reaching to the value of 1 which indicates that the original image matched the segmented image.