Unsupervised Classification of Aerial Images Based on the Otsu’s Method

Remote-sensing research focusing on image classification has long attracted the attention of the remote-sensing community because classification results are the basis for many environmental and socioeconomic applications. However, classifying remotely sensed data into a thematic map remains a challenge because many factors, such as the complexity of the landscape in a study area, selected remotely sensed data, and image-processing and classification approaches, may affect the success of a classification [1]. In forest management, a number of activities are oriented towards wood production or forest inventories with the aims of controlling parameters of interest such as diameter of trees, height, crown height, bark thickness, canopy, humidity, illumination, CO2 transformation among others, always with the goal of environmental sustainability with high social impact. The unsupervised classification of aerial image offer solutions for monitoring production in forest trees while the same time costs are minimized. Also with Unmanned Aerial Vehicles (UAV) equipped with an appropriate image classification system, have become powerful tools for early fire forest detection and posterior monitoring. This technology has also been applied for crop monitoring under wireless sensor network architecture. Clustering is the task of categorizing objects having several attributes into different classes so that the objects belonging to the same class are similar, and those that are broken down into different classes are not. Clustering is the subject of active research in several fields such as statistics, pattern recognition, machine learning, data mining, information science, agriculture technology and spatial databases. A wide variety of clustering algorithms have been proposed for different applications [1], [2]. Classification and segmentation in agriculture and forest management is an interesting topic but not new. There are many classification approaches that are oriented toward the identification of textures in agricultural and forest images. Most of them can be grouped as follows.


Introduction
Remote-sensing research focusing on image classification has long attracted the attention of the remote-sensing community because classification results are the basis for many environmental and socioeconomic applications.However, classifying remotely sensed data into a thematic map remains a challenge because many factors, such as the complexity of the landscape in a study area, selected remotely sensed data, and image-processing and classification approaches, may affect the success of a classification [1].In forest management, a number of activities are oriented towards wood production or forest inventories with the aims of controlling parameters of interest such as diameter of trees, height, crown height, bark thickness, canopy, humidity, illumination, CO2 transformation among others, always with the goal of environmental sustainability with high social impact.The unsupervised classification of aerial image offer solutions for monitoring production in forest trees while the same time costs are minimized.Also with Unmanned Aerial Vehicles (UAV) equipped with an appropriate image classification system, have become powerful tools for early fire forest detection and posterior monitoring.This technology has also been applied for crop monitoring under wireless sensor network architecture.Clustering is the task of categorizing objects having several attributes into different classes so that the objects belonging to the same class are similar, and those that are broken down into different classes are not.Clustering is the subject of active research in several fields such as statistics, pattern recognition, machine learning, data mining, information science, agriculture technology and spatial databases.A wide variety of clustering algorithms have been proposed for different applications [1], [2].Classification and segmentation in agriculture and forest management is an interesting topic but not new.There are many classification approaches that are oriented toward the identification of textures in agricultural and forest images.Most of them can be grouped as follows.


Currently, many of the agriculture, livestock and forestry are planned using spatial analysis tools, seeking different specific objectives [3].In this sense, the images acquired by remote sensors provide the necessary spatial resolution to obtain information about objects, areas, or phenomena on the earth's surface, at different scales.These sensors measure the intensity of the energy emitted or reflected by the objects by means of the electromagnetic spectrum [1].


There are many segmentation techniques reported in the literature [4,5].Most color image segmentation techniques are usually derived from methods designed for graylevel images.Processing each channel individually by directly applying graylevel where the channels are assumed independent and only their intra-spatial interactions are considered [6].Another option is decomposing the image into luminance and chromatic channel: after transforming the image data into the desired (usually application dependent) color space, texture features are extracted from the luminance channel while chromatic features are extracted from the chromatic channels, each in a specific manner [7].Reference [8] and [9] show combining spatial interaction within each channel and interaction between spectral channels and gray level texture analysis techniques are applied in each channel, while pixel interactions between different channels are also taken into account.Based on the presented considerations and in order to tackle the classification problem addressed in this paper, we have designed a new automatic strategy based on the thresholding Otsu´s method is proposed.The first step consists in the thresholding of each R, G and B channels into two parts based on within-class and between-class variances suggested by Otsu [10].This allows to classify each pixel to one part of each channel, so that conveniently combined the a pixel should be classified as belonging to one of the eight possible classes.Although in this paper we only use eight classes, the method can be easily extended to more classes, as described in section 2.2.2, even we can achieve until twenty seven.This makes the main contribution of this paper.Additionally, one major advantage of this algorithm is that it does not need to know how many classes are required to be clustered in advance, as it is required for most supervised clustering processes.The termination criterion is established based on the within-class variance, according to the Otsu's method.The proposed method is compared against the well-known Fuzzy c-means clustering [11], [12].The prediction of the correct number of clusters is a fundamental problem in unsupervised classification problems.Many clustering algorithms require the definition of the number of clusters beforehand.To overcome this problem, various cluster validity indices have been proposed to assess the quality of a clustering partition [13]- [16].Five cluster validation indices have been used in our tests, they are: Dunn's [15]- [19], Davies-Bouldin [15], [19]- [21], Calinski-Harabasz [15], [21]- [24], Krzanowski and Lai [22], [25]; and Hartigan [21], [22], [26].We have used five because there is not relevant conclusions in the literature about their performance, depending on the application their behavior could vary considerably.Based on the above indices we have verified the best performance of our approach against the MS method, particularly in the images where water bodies are present.The remainder of the paper is organized as follows.In Section 2, materials and methods; two issues will be addressed, unsupervised classification of color images and five of cluster validation indexes.Section 3, result and discussions; Conclusions are presented in Section 4.

Study area
In the present investigation 16 color aerial photographs in digital format were used, owned by the Institute of Geography of the Autonomous University of Mexico, taken in October 1997.The photographs correspond to the catchments of the river La Sabana, Guerrero, with spatial resolution of 1:19500, and three-band spectral resolution visible and radiometric resolution RGB from 0 to 255 levels.As an example, Fig. 1 displays a representative image of the set of images analyzed in this work.As we can see it contains several textures which must be classified as belonging to a cluster.

.2.1 Brief description of the Otsu's method
Otsu's method [10], one of the most widely used thresholding techniques in image analysis, has showed great success in image enhancement and segmentation.As mentioned before, it is an automatic thresholding strategy; we exploit the automatic capability for designing the unsupervised classification strategy justifying its choice.This research sought the optimal threshold (single or multiple) for each of the spectral bands of the color image by applying the algorithm modified [27,28]: The number of pixels with gray level i is denoted i f giving a probability of gray level i in an image of Then, the probability distributions for each class is The k w is regarded as the zeroth-order cumulative moment of the kth class C k .and the means for classes is .

Unsupervised classification strategy by within-class and between-classes spectral variances
There are three steps in the proposed classification strategy.First, the assignment process, that consists in assigning one of the possible classes to each pixel.Second, the codification of each cluster, which is identified by a label.Finally, a regrouping process so that very similar classes are merged into one.

Assignment process
Given a pixel i located at (x, y) in the original RGB image.Its three spectral components in this space are obtained, namely R(x, y As already mentioned, the thresholding methods split the histogram into two regions.As there are three spectral components, six sub-regions are obtained.If necessary, successive thresholding can be applied to each spectral channel.The second thresholding produces three partitions per channel.If a third thresholding is applied, four regions per component are obtained and so on.Therefore, assuming that eventually the number of thresholds per channel is M, there will be t where s denotes the spectral component, i.e., s = R, G or B, and t si are the consecutive thresholds.For example, it is known that in the RGB colour space values are in the range [0, 255].So, considering the spectral component R with two thresholds, t R1 = 120 and t R2 = 199, a pixel will be coded as 0, 1, or 2, if its spectral value R is smaller than 120, between 120 and 199, or greater than 199, respectively.

Cluster labelling
Once the whole image has been coded, the next step is the labelling of the existing classes.If M thresholds haven been obtained, there are n = M + 1 histogram partitions per channel, and therefore the number of possible combinations is n d , where d is the number of spectral components, i.e., d = 3 in the RGB colour space.This number of combinations represents the number of classes.Each cluster is identified by its label.Every pixel is assigned its corresponding label according to Equation (11).So, given the pixel i ≡ (x, y) with codes , ı , and ı , its label will be given by P as follows:

Merging process
Let C k be the number of clusters obtained by the classification procedure, where k identifies a class between 1 and n d , each class containing N k pixels of the original image.It could be www.intechopen.com said that each class is defined by a tri-dimensional vector (d = 3).The elements of that vector are the spectral components of the pixels according to the RGB colour model, i.e., i ≡ , , for the pixel i ≡ (x, y), if the pixel and its spectral components belong to class C k .For each class, the average value of the membership degrees to that class is calculated by Equation ( 12): Based on the potential of Otsu's method, it is possible to estimate the within-class and the between-classes spectral variances, denoted by k  and kh  respectively, according to Equations ( 1) and ( 16).Obviously, is only related to class C k and, as expected, kh Based on those variances, some classes can be fused due to their spectral similarities.The similarity is a concept defined as follows.Given the clusters . This is based on the hypothesis that if a good partition is already achieved, the classes obtained are properly separated, without overlapping, and then no further fusion is required.On the contrary, if classes overlap, the between-class variance kh  is greater than the individual within-class variances, k  and j  .This re-clustering process is repeated until all the between-class variances are greater than their corresponding within-class variances.Without lost of generality, if two classes are merged, the resulting fused class will be re-labelled with the name of the class with the smaller variance value.This does not affect the classification process because only labels are modified.After the fusion process, it must be checked if more clusters are necessary.This is carried out on the basis that if after the combination process no class has been fused, it means that more clusters are needed.A new clustering process starts again with the number of thresholds increased by one.This is repeated until a fusion occurs.

Fuzzy C-Means clustering
Fuzzy c-means clustering (FCM) is a data clustering technique wherein each data point belongs to a cluster to some degree that is specified by a membership grade.This technique was originally introduced by Jim Bezdek [11], as an improvement on earlier clustering methods.The FCM algorithm attempts to partition a finite collection of elements   12 , ,..., n Xx x x  into a collection of c fuzzy clusters with respect to some given criterion.The FCM algorithm, processes n vectors in p-space as data input, and uses them, in conjunction with first order necessary conditions for minimizing the FCM objective functional, to obtain estimates for two sets of unknowns.
G is a matrix of dimension pxp symmetric positive definite Where The exponent m is known as exponential weight and reduces the influence of noise when getting the centers of the clusters.The higher the m > 1, the greater this influence.More details on fuzzy c-means clustering [11,12].

Methods for cluster validation
Evaluation of clustering results (or cluster validation) is an important and necessary step in cluster analysis, but it is often time-consuming and complicated work [16].
The procedure of evaluating the results of a clustering algorithm is known under the term cluster validity.In reference [15] two kinds of validity indices are showed: external indices and internal indices.A third is added in reference [29], based on relative criteria.The first is based on external criteria.This implies that we evaluate the results of a clustering algorithm based on a pre-specified structure, which is imposed on a data set and reflects our intuition about the clustering structure of the data set.The second approach is based on internal criteria.We may evaluate the results of a clustering algorithm in terms of quantities that involve the vectors of the data set themselves.The third approach of clustering validity is based on relative criteria.Here the basic idea is the evaluation of a clustering structure by comparing it to other clustering schemes, resulting by the same algorithm but with different parameter values.To evaluate the proposed classification method, five cluster validation techniques are applied, based on internal criteria.These indices are used to measure the "goodness" of the result of the grouping; comparing the proposed classification method against the old pattern recognition procedure called Fuzzy c-means clustering.

Dunn's index
This index identifies sets of clusters that are compact and well separated.For any partition U X:X ...X c 1  where X i represents the i th cluster of such partition, the Dunn's validation index, D, is defined as: where (, ) XX ij  defines the distance between clusters X i and X j (intercluster distance); () X k  represents the intracluster distance of cluster X k , and c is the number of clusters of partition U.The main goal of this measure is to maximize intercluster distances whilst minimizing intracluster distances.Thus large values of D correspond to good clusters.Therefore, the number of clusters that maximizes D is taken as the optimal number of clusters, c.

Davies-Bouldin index
As the Dunn's index, the Davies-Bouldin index aims at identifying sets of clusters that are compact and well separated.The Davies-Bouldin validation index, DB, is defined as: where U, (, ) XX ij


, Δ(X ),Δ(X ) ij and c are defined as in equation (20).Small values of DB correspond to clusters that are compact, and whose centers are far away from each other.Therefore, the cluster configuration that minimizes DB is taken as the optimal number of clusters, c.

Calinski and Harabasz index
The index of Calinski and Harabasz is defined by: /( 1) () /( ) where k denotes the number of clusters, and B K and W k denote the between and within cluster sums of squares of the partition, respectively.Therefore an optimal number of clusters is then defined as a value of k that maximizes CH(k).

Krzanowski and Lai index
The index of Krzanowski and Lai is defined by: where; and p denotes the number of features in the data set.Therefore a value of k is optimal if it maximizes KL(k).

Hartigan index
The index of Hartigan is defined by: where, B K and W k denote the between and within cluster sums of squares of the partition, respectively.Therefore a value of k is optimal if it minimizes Han(k).

Results and discussion
In accordance with the objectives and methodology used in this research encouraging results were obtained regarding the proposal to adopt the criterion used in Otsu's method to the process of clustering and unsupervised classification of colour images, and the application of cluster validity methods by five cluster validation indices, compare the results with those generated by the old pattern recognition procedure, Fuzzy c-means clustering.
In the present paper three issues are addressed.First, our proposed RGB unsupervised classification method.Secondly, to compare results we apply an old pattern recognition procedure, the Fuzzy c-means clustering.Third, five of cluster validation indices will be proposed to evaluate the quality of clusterings.To demonstrate the effectiveness of our proposed RGB unsupervised classification method, using 16 digital images from colour aerial photographs in which they can observe different land cover objects such as buildings, streets, roads, tree crop plots, temporary plots of crops, pastures, water bodies etc.. Due to limited space, only the results of one experiment are included.

Unsupervised classification method by theory of the Otsu's method (results)
The proposed methodology is based on the method of Otsu.First a single thresholding of each of the bands of the RGB image, creating two classes per band as RGB in forming our startup account with eight classes.However, not all are representative, so that once segmented in this way the image is inserted through a sorting process exhaustive analysis of the variation between classes and within classes.
According to the characteristics of land cover images, which must be considered objects with different heterogeneous properties in size, shape and spectral behavior, we make the classification of the image labeled and grouped by simple thresholding, using the comprehensive analysis of variances between classes and within classes, to group and classify objects in the image.As a result of this process, the classifier automatically grouped the different objects of the landscape into five classes, generating the classified image showed in Fig. 2, and the number of pixels per class, you can see in Table 1.With size of 1 542 288 pixels per band, where 53.1% of the surface of the image contains vegetation cover, the image represented by the blue color, and 14.8% contains bodies of water identified by the gray color.The 8.3% contain natural green grass, identified by the red color, 11.7% contains dry natural grass in the image identified by the yellow color, 12% contain areas without vegetation identified by the cyan color.Among the latter the accumulated deposits on the river bank, the effect of Hurricane Pauline, as well as streets and buildings are considered.

The Fuzzy c-means clustering (results)
As a result of this process, the classifier automatically grouped the different objects of the landscape into three classes, generating the classified image showed in Fig. 3, and the number of pixels per class you can see in Table 2.With size of 1 542 288 pixels per band, where 23% of the surface of the image contains plant coverage, identified by the green colour; 36% of the surface of the image contains trees, identified by the blue colour; 28% of the surface of the image contains natural green grass, identified by the red colour; 9% of the surface of the image contains dry natural grass, identified by the yellow colour; and 4% of the surface of the image contains the accumulated deposits on the river bank, the effect of hurricane Pauline, the image represented by the cyan colour.As showed in visual analysis (Fig. 2

Quantitative results to validate the optimal number of clusters
Since clustering is an unsupervised method and there is no a priori indication for the actual number of clusters presented in a data set, there is a need of some kind of clustering result validation.
The results of the classification of colour images from aerial photographs by the proposed Otsu's method, and the method known as Fuzzy c-means clustering are evaluated using five levels of validation.These indices are detailed in Section 2.3.Since the results of the Fuzzy cmeans clustering algorithm, requires as input, the number of clusters, so it runs for 2.3, ..., 6; Fig. 3 corresponds to the optimal number of groups according to DB, who is the same as the proposed method.Davies-Bouldin Index says: the cluster configuration that minimizes DB is taken as the optimal number of clusters, therefore for this methodology, the optimal number of clusters is 5.

No
Calinski and Harabasz Index says: an optimal number of clusters is then defined as a value of k that maximizes CH(k), therefore for this methodology, the optimal number of clusters is 7.The Dunn's Index says: the value that maximizes D is taken as the optimal number of clusters, therefore for this methodology, the optimal number of clusters is 2. Krzanowski and Lai index says: a value of k is optimal if it maximizes KL(k), therefore for this methodology, the optimal number of clusters is 2 Hartigan index says: a value of k is optimal if it minimizes Han(k).therefore for this methodology, the optimal number of clusters is 7.
With the executed validation indices for Fuzzy c-means clustering, we want to find a match on the number of clusters of the new classification proposed.This was achieved with the Davies Bouldin index.Therefore, it indicates that the number of classes generated by the new classifier is optimal.

Conclusions
Otsu's method improved and changes implemented in this research can get the optimal threshold value as a basis for segmenting and classifying images in RGB color model, using a method of unsupervised classification.Under the principle of the concept of within-class and between-class variances as suggested by Otsu; the algorithm automatically regrouped and merged different values of the groups obtained from the image in RGB colour domain and once the within-class variance is less than the between-class variance for each clustered class, the algorithm is finished.
Since this algorithm does not need to know how many classes are required to be clustered, five cluster validity indices have been proposed to validate if the number of clusters classified by Otsu is suitable.Davies Bouldin index indicates that the number of classes generated by the new classifier is optimal.Also the classification made by the proposed method is better than that Fuzzy c-means clustering, as showed in Fig. 2, our method properly classified water bodies, whereas Fuzzy c-means clustering confuses the water bodies with vegetation.This method unsupervised of image classification, can be widely used as support in decision-making in aspects of the environment by diagnosing areas of interest such as the loss of tree cover due to deforestation or fires, crop areas, Water Bodies, etc.. by virtue the proposed methodology to classify areas of different coverage density including areas where the soil surface has been exposed to erosion.

Fig. 1 .
Fig. 1.Land cover images in RGB color model

k
The unknowns in FCM clustering are: 1.A fuzzy c-partition of the data, which is a c x n membership matrix n columns.The values in row i give the membership of all n input data in cluster i for k=1 to n ; the k-th column of U gives the membership p of vector k (which represents some object k) in all c clusters for i=1 to c.Each of the entries in U lies in [0,1]; each row sum is greater than zero; and each column sum equals 1. 2. The other set of unknowns in the FCM model is a set of c cluster centers or prototypes, arrayed as the c columns of a p x c matrix V.These prototypes are vectors (points) in the input space of p-tuples.Pairs (U,V) of coupled estimates are found by alternating optimization through the first order necessary conditions for U and V.The objective function minimized in the original version measured distances between data points and prototypes in any inner product norm, and memberships were weighted with an exponent m>1 That is: As   12 , ,..., n Xx x x  and the set all V cn real matrices of dimension c x n, with 2 cn .Can be obtained a matrix representing the partition follow   ik cn UV   .The basic definition FCM for m > 1 is to minimize the following objective function:

Fig. 2 .
Fig. 2. Image classified by the proposed classification Otsu method, where the optimal number of class is five.

Fig. 3 .
Fig. 3. Image classified by Fuzzy c-means clustering; where the optimal number of class by DB is five.

Fig. 4 .
Fig. 4. Image classified by Fuzzy c-means clustering; where the optimal number of class is seven, by CH and Han, in (a); and two by Dunn and KL, in (b).
Otsu developed by Otsu is the one that maximizes var t between-class , or equivalently minimizes var t within-class .

Table 1 .
distribution of the classification of Fig.2

Table 2 .
and 3), our proposal clearly identifies the water bodies, whereas by Fuzzy c-means clustering classifier water bodies with grass coverage are confused.Distribution of the classification of Fig.3

Table 3 .
Results obtained from 5 internal indices to validate the optimal number of clusters generated by Fuzzy c-means clustering.