Fuzzy Image Segmentation Algorithms in Wavelet Domain

The images are considered one of the most important means of information transmission; therefore the image processing has become an important tool in a variety of fields such as video coding, computer vision and medical imaging. Within the image processing, there is the segmentation process that involves partitioning an image into a set of homogeneous and meaningful regions, such that the pixels in each partitioned region possess an identical set of properties or attributes (Gonzalez & Woods, 1992). The sets of properties of the image may include gray levels, contrast, spectral values, or texture properties, etc. The result of segmentation is a number of homogeneous regions, each having a unique label. Image segmentation is often considered to be the most important task in computer vision. However, the segmentation in images is a challenging task due to several reasons: irregular and dispersive lesion borders, low contrast, artifacts in the image and variety of colors within the interest region. Therefore, numerous methods have been developed for image segmentation within applications in the computer vision. Image segmentation can be classified into three categories: A) Supervised.These methods require the interactivity in which the pixels belonging to the same intensity range pointed out manually and segmented. B) Automatic.This is also known as unsupervised methods, where the algorithms need some priori information, so these methods are more complex, and C) Semi-automatic.That is the combination of manual and automatic segmentation. Some of practical applications of image segmentation are: the medical imaging tasks that consist of location of tumors and other pathologies, recognition of the objects in images of remote sensing obtained via satellite or aerial platforms, automated-recognition systems to inspect the electronic assemblies, biometrics, automatic traffic controlling systems, machine vision, separating and tracking the regions appearing in consequent frames of an sequence, and finally, the real time mobile robot applications employing vision systems. 1.


Introduction
The images are considered one of the most important means of information transmission; therefore the image processing has become an important tool in a variety of fields such as video coding, computer vision and medical imaging.Within the image processing, there is the segmentation process that involves partitioning an image into a set of homogeneous and meaningful regions, such that the pixels in each partitioned region possess an identical set of properties or attributes (Gonzalez & Woods, 1992).The sets of properties of the image may include gray levels, contrast, spectral values, or texture properties, etc.The result of segmentation is a number of homogeneous regions, each having a unique label.Image segmentation is often considered to be the most important task in computer vision.However, the segmentation in images is a challenging task due to several reasons: irregular and dispersive lesion borders, low contrast, artifacts in the image and variety of colors within the interest region.Therefore, numerous methods have been developed for image segmentation within applications in the computer vision.Image segmentation can be classified into three categories: A) Supervised.-These methods require the interactivity in which the pixels belonging to the same intensity range pointed out manually and segmented.B) Automatic.-This is also known as unsupervised methods, where the algorithms need some priori information, so these methods are more complex, and C) Semi-automatic.-That is the combination of manual and automatic segmentation.Some of practical applications of image segmentation are: the medical imaging tasks that consist of location of tumors and other pathologies, recognition of the objects in images of remote sensing obtained via satellite or aerial platforms, automated-recognition systems to inspect the electronic assemblies, biometrics, automatic traffic controlling systems, machine vision, separating and tracking the regions appearing in consequent frames of an sequence, and finally, the real time mobile robot applications employing vision systems.1 .

Related work
A lot of methods have been developed in the image segmentation.Let present brief description of the several promising frameworks.

Adaptive thresholding (AT)
In (Argenziano & Soyer, 1996), the automatic adaptive thresholding (AT) performs the image segmentation comparing the color of each a pixel with a threshold.The pixel is classified as a lesion if it is darker than the threshold, finally, presenting the output as a binary image.Morphological post-processing is then applied to fill the holes and to select the largest connected component in the binary image.For color images, an automatic selection of the color component based on the entropy of the color component i is used: where

Statistical region merging
In (M.Celebi, 2008), the authors use a variant of region growing and merging technique, called as statistical region merging (SRM).The authors propose the following strategy: • Regions are defied as the sets of pixels with homogeneous properties that then are iteratively growing by combining smaller regions.• Region growing/merging techniques is used employing a statistical test to form the merging of regions.
The SRM framework uses the image generation homogeneity property and performs as follows in Fig. 2: Ideally, the order in testing the region merging is when any test between two true regions occurs, which means that all tests inside each of the two true regions have previously occurred.

Clustering based segmentation
The most promising in segmentation of the images in general is the approach based on clustering.Cluster oriented-segmentation uses the multidimensional data to partition of the image pixels into clusters.Such kind of technique may be more appropriate than histogram-oriented ones in segmenting images, where each pixel has several attributes and is represented by a vector.Cluster analysis has attracted much attention since the 1960's and has been applied in many fields such as OCR (Optical Character Recognition) system.Below, let present three most successful frameworks based on this technique that we apply in segmentation applications.

K-Means clustering algorithm
K-Means algorithm is an unsupervised clustering algorithm that classifies the input data point into multiple classes based on their inherent distance from each other.The algorithm assumes that the data features from a vector space and tries to find natural clustering in them (Hartigan & Wong, 1979).It works an iterative manner according to the following steps: 1. Choose initial centroids m 1 ,...,m k of the clusters C 1 ,...,C k .2. Calculate new cluster membership.A feature vector x j is assigned to the cluster C i if and only if: (2) 3. Recalculate the centroids for the clusters according to where x j belong to data set X = x 1 ,,x i , x N .4. If none of the cluster centroids has been changed, finish the algorithm.Otherwise, go to step 2.
In Fig. 3, the segmentation process using the K-Means algorithm is exposed:

Preliminaries and background
The conventional set theory is based on a binary valued membership, which implies that a particular element either belongs to a particular set or it does not belong to it.A crisp set is defined as one whose elements fully belong to the set and they possess well-defined common attributes, which can be measured quantitatively.In a crisp set the common attributes are equally shared by all the elements of the set.On the other hand, in fuzzy sets, the degree of membership of an element to the set is indicated by a membership value, which signifies the extent to which the element belongs to the set.The membership value lies between 0 and 1, with membership "0" indicating no membership and "1" indicating full membership of the element to the set.In a crisp set, the membership values of its elements are either 0 or 1.The membership of an element z in a fuzzy set is obtained using a membership function µ(x) that maps every element belonging to the fuzzy set X F to the interval [0, 1].Formally, this mapping can be written as: The membership assignment is primarily subjective in the sense that the users specify the membership values.

Selection of the Membership Function
The assignment of the membership function may be performed by several ways.
• Membership based on visual model: The membership function may be assigned in accordance with the human visual perceptual model.We may model the variation of the membership values of the pixels in a linear fashion as the pixel gray value changes from 0 to L -1 (for an L level image).• Statistical Distribution: The membership values of the pixels may be assigned on the basis of image statistics as a whole or on the basis of local information at a pixel calculated from the surrounding pixels.The probability density function of the Gaussian or gamma distribution may be used for assignment of membership values (Chaira & Ray, 2003).

Fuzzy C-Means algorithm
Details of fuzzy approach to supervised pattern classification and clustering may be found in (Bezdek, 1981) In fuzzy clustering, a pattern is assigned with a degree of belongings to each cluster in a partition.Here, let present the most popular and efficient fuzzy clustering algorithm: Fuzzy C-Means Algorithm.The algorithm should find the center of 'n' number of clusters iteratively adjusting their position via evaluation of an objective function.
Additionally, it permits more flexibility by introducing the partial membership to the other clusters.The classical variant of this algorithm uses the following objective function: where µ k ij is the fuzzy membership of the pixel x i ; here, the cluster is identified by its center c j , and k ∈ [1, ∞] is an exponent weight factor.There is no fixed rule for choosing the exponent 130 Fuzzy Logic -Algorithms, Techniques and Implementations www.intechopen.comweight factor.However, in many applications k = 2 is a common choice.In case of crisp clustering, k may be chosen as 1.The membership value is proportional to the probability that a pixel belongs to some specific cluster where the probability is only dependent on the distance between the pixel and each independent cluster center.So, the criterion E has minimal value when for the pixels that are nearby the corresponding cluster center, higher membership values are assigned, while lower membership values are assigned to the pixels that are far from a center.This algorithm runs with the clusters' number and initial center positions that should be done at beginning, and then, the algorithm determines how many pixels belong to each cluster.The membership function and centers are determined as follows: The FCM algorithm runs four simple steps: 1.The center is initialized with the first value 't' of the data to be equal to zero, and this value is used as a counter for number of iterations.2. The fuzzy partition membership functions µ ij are initialized according to (6). 3. The value ′ t = t + 1 ′ is changed and novel centers are computed using (7).4. The steps 2 and 3 run until criterion E convergence.
Criterion E approaches to minimum value when its variations are decreased according to the restriction that a user should decide.The algorithm also can be interrupted if a user determines that only a certain number of iterations to be done Bezdek (1981).

Cluster pre-selection fuzzy C-Means
The FCM algorithm, which is one of the most commonly used procedures, has the following drawback: the number of clusters should be pre-determined by a user before it starts to work.Therefore, sometimes the correct number of clusters in the concrete application may not be the same that the number being chosen by a user.Therefore, a method that should add a process based on fuzzy logic to find the number of clusters to be used.To realize this, we take into consideration the difference between the max (Vmax) and the min (Vmin) values of intensity in an image D = Vmax − Vmin, these proportions determine the number of clusters.Following, obtained data are applied in the determination of the centers, reducing the operational time of the FCM algorithm.This value is the first data of our fuzzy system called 'Distance', that has six fuzzy sets, 'minimum', 'shorter', 'short', 'regular', 'large' and 'maximum' (see Tab. 1).For value of data of our fuzzy system called 'Size', that has five fuzzy sets, 'Min', 'Small', 'Medium', 'Big' and 'Max' (see Tab. 2).Finally, For value of data of our fuzzy system called 'Cluster', that has five fuzzy sets, 'Very few', 'Few', 'Some', 'Many' and 'Too Many' (see Tab.In the second phase, the number of clusters and its centers are already known, simply dividing the difference D into the 'N' clusters and determining its center. 132 Fuzzy Logic -Algorithms, Techniques and Implementations where 'N' represents the number of clusters to be created and 'j' is a counter to define all the centers.This looks like a hard type of algorithm, but the centers are still a bit far from the final ones, therefore, there are still a certain number of iterations that should be applied to find them, but the number of iterations is a lot less than for original system, permitting to reduce the computation time.RGB image is discomposed into its three-color channels, and the Euclidean distance is employed (L.A. & Zadeh, 1965) to determine, which one is the difference between three distances.
Two distances that are more alike should be combined into one gray scale image, and it is processed as a correct image, then the method proposed is used to determine the number of clusters to be created.The CPSFCM consists of the next steps: 1. Divide RGB image into three different images, use ( 9) to find two images that are more similar each to other and use them to create a new gray scale image.2. Calculate the distance between intensity levels in the image D, and obtain the size of an image.3. Feed with these data the fuzzy pre selective system and obtain the number of centers to be created.4. Use (8) to obtain the approximate centers.The initial value 't' is equal to zero and it is used as a counter for the number of the iterations. 5.The fuzzy partition membership functions µ i j are initialized according to (6). 6.Let the value be 't=t+1' and compute the new centers using (7).7. The steps 5 and 6 should be done until criterion E converges.

Continuous wavelet transform
The proposed frameworks in segmentation are based on wavelet analysis, so let present some brief introduction in this part.The continuous wavelet transform (CWT) (Grossman & Morlet, 1985) can be written as follows: The variables a and b represent the parameters for dilations and translations, respectively in the time axis.If the wavelet function ψ(t) is appropriately chosen, then it is possible to reconstruct the original waveform from the wavelet coefficients just as in the Fourier transform.Since the CWT decomposes the waveform into coefficients of two variables, a and b, a double summation en discrete case (or integration in continuous case) is required to recover the original signal from the coefficients (Meyers, 1993): |ω| dω and 0 < C < −∞ (so called aadmissibility condition).In fact, reconstruction of the original waveform is rarely performed using the CWT coefficients because of its redundancy.

Discrete wavelet transforms
The CWT has one serious problem: it is highly redundant.The CWT provides an oversampling of the original waveform: many more coefficients are generated than are actually needed to uniquely specify the signal.The discrete wavelet transform (DWT) achieves this parsimony by restricting the variation in translation and scale, usually to powers of two that is the case of the dyadic wavelet transform.The basic analytical expressions for the DWT is usually implemented using filter banks (Mallat, 1989): Here, k is related to a as: a = 2k ; b is related to λ as b = 2k ; and d(k, λ) is a sampling of W(a, b) at discrete points k and λ.In the DWT, it is introduced the scaling function, a function that facilitates computation of the DWT.To implement the DWT efficiently, the finest resolution is computed first.The computation then proceeds to coarser resolutions, but rather than start over on the original waveform, the computation uses a smoothed version of the fine resolution waveform.This smoothed version is obtained with the help of the scaling function.
The definition of the scaling function uses a dilation or a two-scale difference equation: Here, c(n) are the series of scalars that define the specific scaling function.This equation involves two time scales (t and 2t) and can be quite difficult to solve.In the DWT, the wavelet 134 Fuzzy Logic -Algorithms, Techniques and Implementations www.intechopen.comitself can be defined from the scaling function (Rao & Bopardikar, 1998): where d(n) are the series of scalars that are related to the waveform x(t) and that define the discrete wavelet in terms of the scaling function.While the DWT can be implemented using the above equations, it is usually implemented using filter bank techniques.The use of a group of filters to divide up a signal into various spectral components is termed sub-band coding.The most used implementation of the DWT for 2-D signal applies only two filters for rows and columns, as in the filter bank, which is shown in 5.

Wavelet based texture analysis
A recent overview of methods applied to segmentation of skin lesions in dermoscopic images (M.Celebi & Stoecker, 2009) results that clustering is the most popular segmentation technique, probably due to their robustness.In the image analysis, texture is an important characteristic, including natural scenes and medical images.It has been noticed that the wavelet transform (WT)provides an ideal representation for texture analysis presenting spatial-frequency properties via a pyramid of tree structures, which is similar to sub-band decomposition.The hierarchical decomposition allows analyzing the high frequencies in the image, which features are importantin the segmentation task.Several works beneficially use the image features within a WT domain during the segmentation process.In paper (Bello, 1994), the image data firstly are decomposed into channels for a selected set of resolution levels using wavelet packets transform, then the Markov random field (MRF) segmentation is applied to the sub-bands coefficients for each scale, starting with the coarsest level, and propagating the segmentation process from current level to segmentation at the next level.Strickland et al. (Strickland & Hahn, 2009)  domain for detection of microcalcifications in mammograms using a matching process and some a priori knowledge on the target objects.
Zhang et al. (Zhang & Desai, 2001) employ a Bayes classifier on wavelet coefficients to determine an appropriate scale and threshold that can separate segmentation targets from other features.

Proposed framework
The idea of our approach is consisted in employing the feature extraction in WT space before the segmentation process where the main difference with other algorithms presented in literature is in usage the information from three color channels in WT space gathering the color channels via a nearest neighbour interpolation (NNI).Developed approach uses the procedure that consists of the following stages: a digital color image I[n,m] is separated in R, G and Bchannels in the color space, where each a color channel is decomposed calculating their wavelets coefficients using Mallat's pyramid algorithm (Mallat, 1989).For chosen wavelet family is being used, the original image is decomposed into four sub-bands (Fig. 5).These sub-bands labeled as LH, HL and HH represent the finest scale wavelet coefficient (detail images), while the sub-band LL corresponds to coarse level coefficients (approximation image), noted below as D and A (2 i ) , respectively at given scale 2 j , for j = 1, 2, . . ., J, where J is the numbers of scales used in the DWT (Kravchenko, 2009).Finally, the DWT can be represented as follows: Therefore, W i is considered as a new image for each color channel.The following process employed in the wavelet transform space is consisted of the stages: the classic segmentation method is applied to images; the image segmented corresponding to the red channel is interpolated with the image segmented corresponding to the green channel, the found image after applying NNI process is interpolated with the image segmented corresponding to the blue channel using NNI again, finally, this image is considerers the output of the segmentation procedure, Fig. 6 shows the block diagram of the above.The importance of considering the information of the three-color channels is an advantage in the segmentation process as it is judged to clusters formed in each of them.
The block diagram in Fig. 7 explains the operations for: a) image segmentation if K-Means algorithm is used where the WT is applied, named as WK-Means; b) image segmentation if FCM algorithm is used where the WT is applied, named as W-FCM; finally c) image segmentation if CPSFCM algorithm is used where the WT is applied, named as W-CPSFCM.

Evaluation criteria
In this section, let present the evaluation criteria focusing them in segmentation process in dermoscopic image.The same measures can be used for segmentation in other applications.Different objective measures are used in literature for the purpose of evaluation of the segmentation performance in dermoscopic images.For objective measures, there is needed  the ground truth (GT) image, which is determined by dermatologist manually drawing the border around the lesion.
Employing GT image Hance et al. (Hance, 1996) calculated the operation exclusive disjunction (XOR) measure, other metrics used in segmentation performance are presented in (Garnavi, 2011): the sensitivity and specificity, precision and recall, true positive rate, false positive rate, pixel misclassification probability, the weighted performance index, among others.Below, let consider the sensitivity and specificity measure.Sensitivity and specificity are statistical measures of the performance of a binary classification test, commonly used in medical studies.In the context of segmentation of skin lesions, sensitivity measures the proportion of actual lesion pixels that are correctly identified as such.Specificity measures the proportion of background skin pixels that are correctly identified.Given the following definitions: TP true positive, object pixels that are correctly classified as interest object.FP false positive, background pixels that are incorrectly identified as interest object.TN true negative, background pixels that are correctly identified as background.FN false negative, object pixels that are incorrectly identified as background.
In each of the above categories, the sensitivity and specificity are given by: We also apply the Receiver Operating Characteristic (ROC) analysis (Fig. 8) that permits to evaluate the image segmentation quality in terms of the ability of human observer or a computer algorithm using image data to classify patients as "positive"o r" negative" with respect to any particular disease.This characteristic represents the second level of diagnostic efficacy in the hierarchical model described by Fryback and Thornbury (Fryback DG, 1991).Fig. 8 presents the points of the ROC curve that are obtained by sweeping the classification threshold from the most positive classification value to the most negative.These points are desirable to produce quantitative summary measure using the ROC curve, called as an area under the ROC curve (AUC).

Dermoscopic images
In the processing area of biomedical image processing, we applied the developed and existed segmentation techniques to dermoscopic images.Let present some definitions of commonly used terms in this application area.The term "skin cancer" refers to three different conditions that are from the least to the most dangerous can be presented as follows: • Basal cell carcinoma (or basal cell carcinomaepithelioma) • Squamous cell carcinoma (the first stage of which is called actinic keratosis) • Melanoma The two most common forms of skin cancer are basal cell carcinoma and squamous cell carcinoma.Together, these two are also referred to as nonmelanoma skin cancer.Melanoma is generally the most serious form of skin cancer because it tends to spread (metastasize) throughout the body quickly.For a diagnosis, doctors usually remove all or a part of the growth by performing a biopsy but is considered an invasive technique.Alternative, dermatoscopy reduces the need for a biopsy applying a dermatoscope device, which magnifies the sub surface structures with the use of oil and illumination, also called epiluminescence.Dermatoscopy is a particularly helpful standard method of diagnosing the malignancy of skin lesions (Argenziano & Soyer, 2001).A mayor advantage is the accuracy of dermatoscopy is increased to 20% in the case of sensitivity and up to 10% in the case of specificity, compared with naked-eye examination, permitting to reduce the frequency of unnecessary surgical excisions of benign lesions (Vestergaard, 2001).Several instruments designed for a computer aided diagnosis (CAD) (Fig. 9 of skin lesions have been proposed, which usually work in four steps: data acquisition of skin (dermoscopic images), segmentation, feature extraction and classification.The most relevant step is segmentation process because it provides fundamental information to the next stages.Image segmentation is the process of adequately grouping pixels into a few regions, which pixels share some similar characteristics.Automated analysis of edges, colors, and shape of the lesion relies upon an accurate segmentation and is an important first step in any CAD system but irregular shape, nonuniform color, and ambiguous structures make the problem difficult.segmentation.The dataset presents 24-bits color images in JPEG format with 600 x 600 pixel size.Below, we only expose five different images with different texture characteristics where the sensitivity and specificity are used as the evaluation criteria for segmentation accuracy.

Simulation results
We also plotted the ROC curves to examine the classifier performance.Additionally, the diagnostic performance was quantified by AUC measure.Fig. 10 shows the images of different nature used in this study.The simulation results in Table present the values of AUC for the proposed framework based on different wavelet families confirming their better performance in comparison with classical techniques.The maximum value of AUC is obtained when WF Daubechies 4 is used, followed by the WAF π 6 .According to (Fryback DG, 1991) AUC measure should have values greater than 0.8 to consider a good test, but our study is focused in the best approximation of segmented image to GT, this means to get the value of AUC approximated to one.
Based on the objective quantity metrics and subjective visual results presented in Fig. 4, one can see that the W-FCM presents borders that characterize the lesion (green color), in Fig. 11 141 Table 4. AUC simulation results using different segmentation algorithms c-f, it is easy to note that the segmentation procedure has performed only around the lesion.On other hand, in Fig. 11 g-j, where WAF results are presented, one can see that together with segmentation of lesion boarder there are some areas into the lesion segmented.

Conclusion
The segmentation process involves the partition of an image into a set of homogeneous and meaningful regions allowing the detection of an object of interest in a specific task, and is an important stage in the different problems such as computer vision, remote sensing, medical images, etc.In this chapter, we present a review of existed promising methods of image segmentation; some of them are popular because they are used in various applications.Novel approach in segmentation exposed here has generated several frameworks that use traditional and fuzzy logic techniques (WK-Means, W-FCM, W-CPSFCM), all of them involve the wavelet transform space and approximation procedures for inter color channels processing, permitting better extraction of the image features.Numerous simulation results summarize the performance of all investigated algorithms for segmentation in images of different nature exposing quality in form of ROC curves (sensitivity-specificity parameters) and AUC values.It has been justified sufficiently better performance of the developed frameworks (WK-Means, W-FCM, and W-CPSFCM) that apply different classic wavelets families and WAF in comparison with traditional existed techniques.

Fig. 4 .
Fig. 4. Pre-selection of the Number of Clusters.

Fig. 5 .
Fig. 5. Structure of the analysis filter bank for 2-D image.

137Fuzzy
Image Segmentation Algorithms in Wavelet Domain www.intechopen.com

Figure 12 Fig. 11 .
Figure12presents ROC curves for lesion 1 comparing the classic and proposed algorithms.In particular, Fig.11c) exposes the ROC curves for WK-means and K-Means algorithms where one can see superiority of proposed WK-Means algorithm that uses WAFp6 (see ROC curve in light green color), Fig.12 d) presents ROC curves for W-FCM and FCM algorithms where it is easy to observe the better performance of WK-Means that employs the WF biorthogonal 6.8 (seeROC curve in red color), and finally, in Fig.12 e), theROC curves for W-CPSFCM and CPSFCM algorithms have confirmed the better performance of the first one for WF biorthogonal 6.8usage (see ROC curve in red color).

Table 2 .
Member functions of "Size"

Table 3 .
Member functions of "Clusters" time axis, and if it is less than one (but still positive) it contacts the function.Wavelets are functions generated from one single function (basis function) called the prototype or mother wavelet by dilations (scalings) and translations (shifts) in time (frequency) domain.If the mother wavelet is denoted by ψ(t) , the other wavelets ψ a,b (t) can be represented as: where b acts to translate the function across x(t), and the variable a acts to vary the time scale of the probing function, ψ.If value a is greater than one, the wavelet function, ψ is stretched 133 Fuzzy Image Segmentation Algorithms in Wavelet Domain www.intechopen.comalong the