International Journal of Computational Intelligence and Information Security
Evolutionary Image Segmentation By Pixel Classification Application To Medical Images A.EL Allaoui1, M. Merzougui1, M. Nasri1, M. EL Hitmy2 and H. Ouariachi 1 1 LABO MATSI, ESTO, B.P 473, University of Mohammed I, OUJDA, MOROCCO. 2
LABO LETAS, FSO, University of Mohammed I, OUJDA, MOROCCO
[email protected] ;
[email protected] ;
[email protected]
Abstract In this paper, we propose a segmentation method based on pixel classification and evolution strategies. The application of this evolutionary method on synthetic and medical images help to validate this method and show its interest in the problem of decision support in medical diagnosis. Keywords: Segmentation, evolutionary segmentation, Classification, evolutionary strategies, Segmentation by pixel classification.
1. Introduction The segmentation is an essential stage in image processing. There are many consistent methods available today for image segmentation, among these, there is the segmentation based on pixels classification as a function of their grey level values [1][7][8][12]. Every pixel in the image holds an inherent relationship with the pixels in its surrounding. The information at a particular pixel may be in relation with the information over the whole or part of the image. We may be interested in the mean or the median values of the pixels grey level. The process of segmentation by pixel classification consists of two stages: [1] [7] [8] [12].
•
Acquisition of data for each pixels in order to form the attribute vector
•
Pixel classification based on the acquired information Acquisition stage
classify the pixel with respect to centers that evolve at each iteration In Section 2 image segmentation with Kmeans algorithm is presented. Section 3 gives an introduction to evolution strategies approach. The proposed evolutionary Kmeans is presented in section 4, along with the image evolutionary segmentation. In section 5, a validation of our approach is given, experimental results are obtained over synthetic and medical images, noise has been added to the synthetic image in order to evaluate its effect. Finally we give a conclusion.
2. Kmeans classification 2.1. Descriptive elements Consider a set of M objects {O1, O2,..., OM} characterized by N attributes, grouped in a line vector form V = (a1 a2 ... aN). Let Ri = (aij) 1≤j≤N be a line vector of RN where aij is the value of the attribute aj for the object Oi. Let mat_obs be a matrix of M lines (representing the objects Oi) and N columns (representing the attributes aj):
( )
mat _ obs = aij
1≤i ≤ M 1≤ j ≤ N
(1)
For each pixel, we compute two values, the mean value of the grey levels (MGL), and the difference between the MGL and the maximum value of the grey levels surrounding the particular pixel (DMGL). For this purpose, we use a square window centred at the particular pixel.
V is the attribute vector, Ri is the observation associated with Oi or the realization of the attribute vector V for this object, RN is the observations space [1] and mat_obs is the observation matrix associated with V. The ith line of mat_obs is the observation Ri. Ri belongs to a class CLs, s=1, …, C.
Classification stage Kmeans and evolutionary Kmeans are used for this classification purpose. The two algorithms use the information provided by the parameters MGL and the DMGL, associated with each and individual pixel in order to
The Kmeans algorithm is one of the most common algorithms used for the classification. We are given maxobs observations (Ri)1≤i≤M which must be associated with C classes (CLs)1≤s≤C of centers
2.2. Kmeans algorithm
1
International Journal of Computational Intelligence and Information Security
(gs)1≤s≤C. The centers (gs)1≤s≤C are line vectors of N dimension. The Kmeans is based on the minimization of the optimization criterion given by [10] [20] [21]:
1 M C J = ∑∑ Ri − g s 2 i =1 s =1 where
.
2
(2)
is a distance which is generally
supposed to be Euclidean. The KM algorithm supposes that the number of classes C is known a priori.
2.3. Kmeans segmentation The objects that are processed by the KM algorithm are the pixels of the input image. The observation matrix in this case is formed by two columns which represent the attributes associated with each pixel of the image: the columns are associated with the MGL and the DMGL. The size of the square window used must have an odd length (3 * 3, 5 * 5, ...) [1][8][12][15]. In this process each pixel is attributed to a specific class. The resulting image is segmented into C different regions where each region corresponds to a class.
3. Evolution strategies Evolutionary strategies (ES) are particular methods for optimizing functions. These techniques are based on the evolution of a population of solutions which under the action of some precise rules optimize a given behavior, which initially has been formulated by a given specified function called fitness function [2]. An ES algorithm manipulates a population of constant size. This population is formed by candidate points called chromosomes. Each of the chromosomes represents the coding of a potential solution to the problem to be solved, it is formed by a set of elements called genes, these are reals. At each iteration, called generation, is created a new population from its predecessor by applying the genetic operators: selection and mutation. The mutation operator perturbs with a Gaussian disturbance the chromosomes of the population in order to generate a new population permitting to further optimize the fitness function. This procedure allows the algorithm to avoid the local optimums. The selection operator consists of constructing the population of the
next generation. This generation is constituted by the pertinent individuals [2] [3][11]. Figure 1 illustrates the different operations to be performed in a standard ES algorithm [2][3] : Random generation of the initial population Fitness evaluation of each chromosome Repeat Select the parents Update the genes by mutation Select the next generation Fitness evaluation of each chromosome Until Satisfying the stop criterion Figure 1: Standard SE algorithm.
4. Evolutionary Kmeans classification 4.1. Proposed coding The KM algorithm consists of selecting among all of the possible partitions the optimal partition by minimizing a criterion. This yields the optimal centers (gs)1≤s≤C. Thus we suggest the real coding as:
chr =(g sj )1≤ s ≤C,1≤ j ≤ N
(
)
(3) The chr chromosome is a real line vector of dimension C×N. The genes (gsj)1≤j≤N are the components of the gs center: = g11..g1N g 21..g 2N ..g s1..g sN ..gC1..gCN
(4) g s =(g sj )1≤ j ≤ N =(g s1g s2..g sj..g sN ) To avoid that the initial solutions be far away from the optimal solution, each chromosome chr of the initial population should satisfy the condition:
gsj∈[min aij1≤i ≤ M ,max aij1≤i ≤ M ]
(5)
In the EKM algorithm, we discard any chromosome with a gene that does not satisfy this constraint. This gene, if any, is replaced by an other one which complies with the constraint.
4.2. The proposed fitness function Let chr be a chromosome of the population formed by the centers (gs)1≤s≤C, for computing the fitness function value associated with chr, we define the fitness function F which expresses the behavior to be optimized (J criterion):
F (chr ) =
2 1 M C ∑ ∑ Ri − g s M i =1 s =1
(6)
The chromosome chr is optimal if F is minimal.
4.3. The proposed mutation operator The performances of an algorithm based on evolutionary strategies are evaluated according to the mutation operator used [11]. One of the
2
International Journal of Computational Intelligence and Information Security
mutation operator form proposed in the literature [20] [21]is given by: chr* = chr + σ × N(0,1)
(7)
where chr* is the new chromosome obtained by a Gaussian perturbation of the old chromosome chr. N(0,1) is a Gaussian disturbance of mean value 0 and standard deviation value 1, σ is the strategic parameter. σ is high when the fitness value of chr is high. When the fitness value of chr is low, σ must take very low values in order to be not far away from the global optimum. We have been inspired from this approach to propose a new form of the mutation operator. The fact that we have proposed a new mutation operator is motivated by our interest to reach the global solution in a small computational time.
ordering. We have also used the elitist technique [10].
4.4. The proposed EKM algorithm Figure 2 shows the different steps of the proposed EKM algorithm. [10][11] [18] [19]. Stage 1: 1.1. Fix: - The size of the population maxpop. - The maximum number of generations maxgen. - The number of classes C. 1.2. Generate randomly the population P: P = {chr1, .., chrk, ..., chrmaxpop} 1.3. Verify for each chr of P the constraint: gsj∈[min aij, max aij], 1≤i≤M 1.4. For each chr of P attribute, the observations Ri to the corresponding classes:
Ri ∈ CLs if Ri − g s = min s '=1,C Ri − g s ' 1.5. Update the population P, for each chr of P do:
Let chr be a chromosome of the population formed by the centers (gs)1≤s≤C. Let Ri ∈ CLs if Ri − g s = min s '=1,C Ri − g s ' , i.e. the class consisting of the Ri observations that are closest to the center gs. Let g°s be the center of gravity of the CLs class
∑Ri g s° =
Ri ∈CLs ls
where ls =card(CLs )
(8)
The mutation operator which we propose in this work consists in generating, from the chr, the new chromosome chr* formed by the centers (g*s)1≤s≤C, as: g*s = gs + fm × ( g°s - gs) × N(0,1)
(9)
where fm is a multiplicative constant factor taken to be randomly chosen between 0.5 and 1. The new strategic parameter proposed σ’ = fm × ( g°s - gs ) is low when gs gets closer to g°s and is high when gs is far from g°s. The proposed σ’ has two advantages: - When chr is far from the global solution, chr is subjected to a strong Gaussian perturbation allowing chr to move more quickly in the research space and in the same time to avoid local solutions. - σ’ controls the Gaussian perturbation level. Indeed, as the chromosome chr gets closer to the global solution, the Gaussian perturbation level is reduced until becoming null at convergence. Generating children from parent chromosomes we have adopted the technique of selection by
gs + g s' =
∑
Ri Ri ∈CLs
where ls =card(CLs ) 1+ls 1.6. Compute for each chr of P its fitness value F(chr). Stage 2: Repeat 2.1. Order the chromosomes chr in P from the best to the poor ( in an increasing order of F). 2.2. Choose the best chromosomes chr. 2.3. For each chr of P attribute, the observations Ri to the corresponding classes:
Ri ∈ CLs if Ri − g s = min s '=1,C Ri − g s ' 2.4. Generate randomly the constant fm (fm ∈ [0.5, 1]). 2.5. Mutation of all the chromosomes chr of P except the first one (elitist technique): g*s = gs + fm × ( g°s - gs) × N(0,1) 2.6. For each chr of P attribute except the first one, the observations Ri to the corresponding classes:
Ri ∈ CLs if Ri − g s = min s '=1,C Ri − g s ' 2.7. Update the population P, for each chr of P except for the first one, do:
gs + g s' =
∑
Ri Ri ∈CLs
where ls =card(CLs ) 1+ls (The population P obtained after the updating is the population of the next generation ) 2.8. Compute for each chr of P its fitness value F(chr). Until Nb_gen (generation number) ! maxgen Figure 2: The proposed EKM algorithm.
3
International Journal of Computational Intelligence and Information Security
4.5. EKmeans Segmentation
EKM
KM
The procedure to be carried out here is exactly the same at that taken in (2.3) for the Kmeans segmentation. The difference is in the classification algorithm which now is evolutionary.
5. Experimental results and evaluations 5.1. Introduction In order to evaluate the performances of the proposed method we have considered three grey level images, a synthesised image, the same synthesised image to which noise is added [1] [4], a real image of the brain taken by MRI [6][9][13][14]. The segmentation is carried out by the two algorithms KM and EKM for different values of C.
Figure 4: Result of image segmentation
The EKM algorithm converges quickly, in 3 generations, figure 5. 10000
8000
5.2. Synthetic image We have constructed a synthetic image which we name SYNTH1 of size 50 * 70. The image contains four objects of different geometrical forms, figure 3.
6000
4000
2000
0 0
5
10
15
20
25
30
Figure 5: Fitness value with respect to the generation.
Table 2 shows the results of the segmentation. Table 2: Results of segmentation
Figure 3: Synthesised image SYNTH1
Table 1 shows the classes of SYNTH1 along with the grey level values and the number of pixels of each class.
Initial image
Description
EKM
KM
1368
Background
1368
1368
1036
Rectangle
907
1224
317
Triangle
468
0
543
Disc
521
468
Table 1: Information on SYNTH1
Class
Description
Grey level GL
Number of pixels Np
255
1604
29
1036
2
Background of image Rectangle
4
Triangle
76
317
5
Disc
0
543
1
We considered for this test the attributes (MGL, DMGL) in a 3 * 3 window, and the number of classes is C =4. Figure 4 shows the results of segmentation procedure by two algorithms KM and EKM
The results show that the EKM clearly detects the four objects of the image, background, triangle, rectangle and disc. The KM was not able detect the triangle The number of misclassified pixels for both methods EKM and KM is respectively 302, 580. The corresponding error rate is:
τ EKM τ KM
=
302
= 9.25%
(11)
580 = 17.76% 3264
(12)
=
3264
4
International Journal of Computational Intelligence and Information Security
The two algorithms were run several times and we noticed that the EKM obtains each time the same result while the KM obtains different results. We can conclude that the EKM is the most stable, it outperforms the KM and it obtains good results
The EKM algorithm converges quickly, in 2 generations, figure 8. 4500 4000 3500
5.3. Noisy synthetic image
3000
In this test, we add a "salt and pepper" type of noise to SYNTH1 and we obtained the noisy image SYNTH2, figure 6.
2500 2000 1500 1000 500 0
5
10
15
20
25
30
Figure 8: Fitness value with respect to the generation.
The results show that the segmentation EKM clearly detects the four image objects (triangle, rectangle and disc) and gives good results. The KM method does not detect the triangle. . Figure 6: Noisy image SYNTH2
Table 3 shows the classes of SYNTH2, the grey level values and the number of pixels in each class.
We notice her again that the EKM is the most stable procedure because it goes to the same convergence point for several running times of the algorithm. The KM goes to different solutions when it is run again repeatedly.
5.4. Brain image IRM
Table 3: Information on SYNTH2
Class
Description
Grey level GL
1
Background
255
Number of pixels Np 2144
2
Rectangle
29
961
4
Triangle
76
298
5
Disc
0
630
We have considered for this test an MRI brain image of size 141 * 117, which contains a tumor, figure 9. We considered a windows of size 9 * 9, and a number of classes, test A: C = 4, and test B: C = 7. The segmentation objective in this case is to detect the tumor.
We have considered for this test the attributes MGL, DMGL, a window of size 3 * 3, and the number of classes C =5. Figure 7 shows the results of image segmentation applied to SYNTH2 by KM and EKM.
EKM
KM
Figure 9: MRI Brain image sample containing a tumor indicated by a white small region.
Figure 7: Result of image segmentation
5
International Journal of Computational Intelligence and Information Security
Test A : C=4
11
EKM
KM
10
9
8
7 6
5
4
EKM
3
KM
0
5
10
15
20
25
30
Figure 11: Fitness value with respect to the generation.
Figure 11 shows the rapid convergence of the EKM. Figure 10 and table 4 show the stability of the results obtained by the EKM for different running of the algorithm, while the results obtained by KM contain many changes. The tumor is clearer in the case of EKM. EKM
KM
Test B : C=7 EKM
Figure 10: Image segmented into 4 classes (3 times running the algorithm)
KM
EKM
KM
EKM
KM
Table 4: Number of pixels for each class
EKM
KM
Class number
Trial 1
Trial 2
Trial 3
CL1 CL2 CL3 CL4 CL1 CL2 CL3 CL4
138 3102 4821 6436 1285 3225 3558 6429
138 3102 4821 6436 2112 2845 3117 6423
138 3102 4821 6436 2971 3239 4108 4179
Figure 12: Image segmented into 7 classes (3 times running the algorithm)
6
International Journal of Computational Intelligence and Information Security
7. Références Tableau 5: Number of pixels for each class
EKM
KM
Class number CL1 CL2 CL3 CL4 CL5 CL6 CL7 CL1 CL2 CL3 CL4 CL5 CL6 CL7
Trial 1
Trial 2
0 0 39 99 3102 4821 6436 374 466 1463 2458 2505 3148 4083
Trial 3
0 0 39 99 3102 4821 6436 374 466 2170 2505 2813 3004 3165
0 0 39 99 3102 4821 6436 358 397 1323 2917 2967 3094 3441
7 6.5
[1] Cocquerez T.P. et Phillip S. "Analyse d'images : Filtrage et segmentation". Editions MASSON, Paris, 1995. [2] Hall, L. Q., Özyurt, I. B. et Bezdek, J. C. " Clustering with a genetically optimized approach ". IEEE Trans. on Evolutionary Computation, Vol.3, N°2, pp. 103-110, july 1999. [3] Presberger, T., Koch, M. " Comparison of evolutionary strategies and genetic algorithms for optimization of a fuzzy controller ". Proc. of EUFIT’95, Aachen, Germany, august 1995. [4] Florence Huet et Sylvie Phlipp Etude de contours haute-échelle pour la segmentation et la fermeture de contours en présence de zones texturées et/ou bruitées. Traitement du Signal 1998 Volume 15 - n° 1 [5] H.Ouariachi, Classification non –Supervisée de données par la réseaux de neurones et par une approche évolutionniste : application à la segmentation d’images. . Thèse de doctorat. Université Mohammed premier Oujda 2001.
6 5.5 5
[6] Barra, V. : Fusion d’Images 3D du Cerveau : Etude de Modèles et Applications : Ph.D. Thesis, Université d'Auvergne, Clermont-Ferrand (France), 2000.
4.5 4 3.5 0
5
10
15
20
25
30
Figure 13: Fitness value with respect to the generation.
Figure 13 shows the rapid convergence of the EKM. Although the number of the classes considered has increased in this test, the EKM shows its outperforming over the KM. Figure 12 and table 5 show stability of convergence and clearer detection of the tumor for the EKM with respect to KM for different running of the algorithm.
6. Conclusion Kmeans image segmentation show some stability difficulties due to the initialisation problem of the KM. We have proposed the evolutionary Kmeans image segmentation in order to get around this difficulty. The proposed approach has been validated on two synthetic images and an MRI brain image containing a tumor. The experimental results obtained show the rapid convergence and the good performance of this approach. The instability problem has been eliminated. This approach may be used for problems of decision support in medical diagnosis.
[7] Christophe Saint-Jean, Classification paramétrique robuste partiellement supervisée en reconnaissance des formes, Thèse de Doctorat, université de La Rochelle - UFR Sciences Laboratoire d’Informatique et d’Imagerie Industrielle 2001. [8] N.Vandenbroucke, L.Macaire, J.G. Postaire, Color image segmentation by pixel classification in an adapted hybrid color space. Application to soccer image analysis., Computer Vision and Image Understanding 90 (2), 190-216, (2003). [9] Zitouni Rafik, Segmentation Contextuelle des images IRM du cerveau humain (Application de la classification Semi Supervisée), Thèse d’ingéniorat, université de Sétif, institut d’informatique 2004. [10] Nasri M. Contribution à la classification de données par Approches Evolutionnistes : Simulation et Application aux images de textures’’. Thèse de doctorat. Université Mohammed premier Oujda 2004. [11] Nasri M, M. EL Hitmy, H. Ouariachi and M.Barboucha. Optimization of a fuzzy classification by evolutionary strategies. In proceedings of SPIE Conf.,6 th international conference on quality control by artificial vision,vol.5132,pp. 220230,USA, 2003.Repulished as an SME Technical Paper by The society of manufacturingn .
7
International Journal of Computational Intelligence and Information Security
[12] L. Macaire, N. Vandenbroucke, J.G Postaire Segmentation d'images par classification spatio-colorimétrique des pixels. Traitement du signal 2004 vol 21 N spécial L'image numérique couleur 423-437 [13] Z. Rafik1, B. Ihssen. Segmentation Contextuelle Des Images IRM Cérébrales par Le FCM Semi Supervisé. Première Etape a l’Aide au Diagnostic. Journées Francophones d’Informatique Médicale, Lille 12-13 mai 2005 [14] Semchedine, M., Toumi, L., Moussaoui, A. : Nouvelle Approche de Classification Multimodale Hybride d’Images IRM dans un SMA , Journées internationales sur l’informatique graphique .Tébessa 2006 [15] Dou, W. : Segmentation d'images multi spectrales basée sur la fusion d‘informations : application aux images IRM. Thèse doctorat de l’université de Caen, Spécialité : Traitement du Signal et des Images, 2006 [16] Non-dominated Sorting Evolution Strategy-based K-means Clustering Algorithm for Accent Classification. S. Ullah, F. Karray, and J.M. Won. 978-1-4244-2175-6/08/2008 IEEE [17] J. Gadeyne & A. Nassar Segmentation d'image naturelle texturée localement par fusion bayesienne de segmentation locale en deux classes.22 f_evrier 2009 [18] A. EL Allaoui, M. Merzougui, M. Nasri, M. EL Hitmy and H. Ouariachi. Optimization of Unsupervised Classification by Evolutionary Strategies. IJCSNS International Journal of Computer Science and Network Security, ISSN: 1738-7906, Vol. 10 No. 6 pp. 325-332 June, 2010. [19] M. Merzougui, A. EL Allaoui, M. Nasri, M. EL Hitmy and H. Ouariachi. Unsupervised classification using evolutionary strategies approach and the Xie and Beni criterion. IJAST International Journal of Advanced Science and Technology, ISSN: 2005-4238, Vol. 19, pp 43-58 June, 2010. [20] Bezdek, J. C. "Cluster validity with fuzzy sets". J. Cybernetics, Vol.3, N°3, pp. 58-73, 1974. [21] Karayiannis, N. B., Bezdek, J. C. et Hathaway, R. J. "Repairs to GLVQ : a new family of competitive learning schemes". IEEE Trans. on Neural Networks, Vol.7, N°5, pp. 1062-1071, 1996.
8