Classification

The topics presented here are:


See how to execute a Classification in the SPRING.


See also:
Other techniques for Image Processing.
How to execute a Classification.
SPRING Images menu options


Introduction to Classification


Classification is an information extraction process in images to recognize patterns and homogeneous objects.

The classification methods are used to map earth surface areas that presents the same meaning in digital images.

The spectral information in a scene can be represented by an spectral image, where each "pixel" has the spatial coordinates x, y and the spectral coordinate L, that represents the target radiance in the wave length interval in a spectral band. Each "pixel" in a band has a corresponding spatial with another "pixel", in all other bands, that is, for an image with K bands, there are K gray levels associated to each "pixel", one for each spectral band.

The set of a "pixel" spectral features is denoted by the "spectral attributes" term.

Depending on the classification process used, the classifiers can be divided into "pixel by pixel" classifiers and regions classifiers.

    "Pixel by pixel" Classifiers use only the pixel spectral information, isolated, to find homogeneous regions. These classifiers can still be separated in statistical methods (using probability theory rules) and deterministic.

    Regions Classifiers they use, besides the spectral information of each "pixel", the spatial information involving the relation among "pixels" and their neighbors. These classifiers try to simulate the behavior of a photo-interpreter, when recognizing homogeneous areas in the images, based on spectral and spatial image properties. The boundary information is used initially to separate the regions and the spectral and spatial properties that will connect areas with the same texture.

The digital classification result is represented by spectral classes (areas that have similar spectral attributes). Example: the urban soil usage mapping through a multispectral image.

The user might want to map residential or industrial areas, and these classes are rarely characterized by a single spectral signature (representing a vector with dimension equals the number of bands, and the coordinates are target radiance measures), because the different types of target present, such as vegetation, buildings, paved roads etc.

Because of these problems, in a classification process, the user has to consider the relation between the targets spectral response and the class one wants to map.

The final result in a classification process is a digital image that has a map of classified "pixels", represented by graphic symbols or colors.

The digital classification process transforms a large number of gray levels, in each spectral band, in a small number of classes in a single image.

The classification techniques that can be applied only to a single spectral channel (image band) are known as unidimensional classification.

The techniques in which the decision criteria depends on the gray level distribution, in several spectral channels, are defined as multispectral classification techniques.

The most common "pixel by pixel" multispectral classification techniques are: maximum likelihood (MAXVER), minimum distance and parallelepiped method (not implemented in this SPRING version).

The first step in a multispectral classification process is the training. Training is the classes spectral signature recognition.

There are basically two training forms: supervised and non-supervised.

When there are image regions where the user has information allowing the identification of a class of interest, the training is known as supervised.

For a supervised training the user has to identify in the image a representative area for each class. It is important that the training area is a homogeneous sample of the respective class, but at the same time it is required to include all the variability in the gray level of the current theme.

It is recommended that the user gets more than one training, using the largest number of available information, such as field work, maps etc.

In order to get statistically reliable classes, it is required from 10 to a 100 "pixels" for training in each class. The number of training "pixels" required for the precision of a class recognition increases when the classes variability increases.

The figure below shows how the user has to select the areas, in the supervised training.

When the user selects an algorithm to recognize the classes presented in the image, the training is called non-supervised . When defining non-supervised training areas, the user does not have to be concerned with the classes homogeneity. The selected areas have to be heterogeneous to guarantee that all the possible classes and variations are included.

The figure below shows how the user has to select the areas, in the non-supervised training.

The "pixels" inside a training area are used in a grouping algorithm ("clustering") that determines the data grouping, in a dimension spatial aspect equals the number of bands present. This algorithm considers that each group ("cluster") represents the probability distribution in a class.



Classification Topics


"Pixel by Pixel" Classifiers

The SPRING has three types of pixel by pixel classifiers, which are presented next:

MAXVER

MAXVER, it is based on the statistical method of Maximum Likelihood, this is the most common "pixel by pixel" classification method. It considers the weight of the distances among averages of the classes digital levels, using statistical parameters.

In order to get the required precision in the classification process the maximum likelihood method has to have a relatively high number of "pixels" for each training set.

The training sets define the classes spreading diagram and their probability distribution, considering the Normal probability distribution for each training class.

Two classes are presented (1 and 2) with distinct probability distribution. These probability distributions represent the probability that a pixel belongs to one or the other class, depending on the "pixel" position related to this distribution.

Notice that a region where the two curves overlap, indicating that a certain "pixel" has the same probability of belonging to both classes. In this case a decision criteria is established from the boundaries definition.

The classification limits are defined from the points with the same classification probability for one or the other class.

The figure presented next shows the classification accepting limit, in the point where both distribution intercept. In this way, a "pixel" located in the shadowed region, although they belong to class 2, will be classified as class 1, by the accepting limit defined.

The accepting limit indicates the probability distribution % of "pixels" of the class that will be classified as belonging to this class. A 99% limit, for instance, considers 99% of the pixels, and 1% will be ignored (the ones with small probabilities), compensating the possibility that some pixels were introduced in the training by mistake, in this class, or they are in the limit between the two classes. A 100% limit will result in an image classified without rejection, that is, all the pixels will be classified.

To reduce the misclassification, that is, reduce the overlap between the classes probability distributions, it is suggested that a considerable sample of distinct targets are acquired and the matrix evaluation of the sample classification.

The classification matrix presents a "pixel" percentage distribution correctly and incorrectly classified. In the next example it is presented a classification matrix with 4 classes percentage defined in the sample acquisition, the values of average performance, number of non-classified pixels, and average confusion.

The value of N represents the amount of each class (percentage of "pixels") which was not classified.

Class 1 corresponds to forest, class 2 to savannah, class 3 to river, and class 4 to deforest.

  N 1 2 3 4
1 4.7 94.3 0 0 0.9
2 1.1 0 82.3 0 16.6
3 0 13.3 0 86.7 0
4 3.8 0 4.7 0 91.5

Average performance: 89.37
Average of non-classified: 3.15
Confusion average: 7.48

An ideal classification matrix has to have the main diagonal values close to 100%, indicating that there is no confusion among the classes. However, this is a very hard situation in images with targets having similar spectral characteristics.

The value outside the main diagonal, for instance 13.3 (class line 3, column 1) means that 13.3% of the "river" class area sampled was classified as belonging to class 1 (forest). The same reasoning process has to be used in the other entries.

To reduce the confusion among classes, it is suggested a sample analysis.

The table below shows the sample analysis obtained for the forest class.

  Sample 1 2 3
Classes        
Forest   90 50 87
Savannah   5 50 0
River   5 0 0
Deforested   0 0 10

The percentage values show that in sample '1' 90% of the "pixels" were classified as forest , 5% as savannah and 5% as river, which means a reliable sample. In the other hand, sample 2 has a confusion of 50% between forest class and savannah class, indicating that it should be removed.

Classification Topics


MAXVER-ICM

While the MAXVER classifier associates classes considering individual points from the image, the MAXVER-ICM (Integrated Conditional Modes) considers also the spatial dependencies in the classification.

In a first phase, the image is classified by the MAXVER algorithm classifying the "pixels" based on its digital level values. In the next step, its taken into account the image contextual information, that is, the "pixel" classification is a function of its own class and also its neighbors class.

The algorithm classifies a "pixel" considering the neighbors interactively. This process is finished when the '%' changed is reached (the reclassified pixels percentage), as defined by the user.

The SPRING gives the user the 5%, 1% and 0.5% options for changed percentage. A 5% value means that the pixel's new classification process is interrupted when 5% or less of the total number of pixels in the image is changed.



Classification Topics


Euclidian Distance

The classification method by Euclidian distance is a supervised classification procedure which uses the Euclidian distance to associate a pixel to a class.

In the supervised training, the groupings representing classes are defined.

In the classification, each pixel will be incorporated to a grouping, through the similarity measure analysis of the Euclidian distance, which is given by:

d (x,m) = (x2 - m2) 1/2

>where:
x = "pixel" that is being tested
m = grouping average
N = number of spectral bands


The classifier compares the pixel Euclidian distance to the grouping average.

The "pixel" will be incorporated to the grouping presenting the smallest Euclidian distance. This procedure is repeated until the whole image is classified.

Classification Topics


Segmented Images Classification - Regions Classifiers

Isoseg

The ISOSEG classifier is one of the available algorithms in the Spring for region classification in a segmented image. It is a non-supervised data grouping algorithm, applied over the regions set, which are characterized by their average statistical attributes, covariance matrix, and also by the area.

A clustering algorithm does not assume any previous knowledge of the themes probability density distribution, as in the maximum likelihood algorithm. It is a classification technique that try to group regions from a likelihood measure among them. The similarity measure uses the Mahalanobis distance between the class and the candidate regions.

The Isoseg uses regions statistical attributes: the covariance matrix and the average vector, to estimate the central value for each class. This algorithm is divided into three steps, described next.

(1ª) Threshold definition: the user defines the accepting threshold, given in percentage. This threshold defines the Mahalanobis distance, such that all regions belonging to a certain class by a distance smaller than the threshold. The higher the threshold the higher the distance and thus the smaller the number of detected classes by the algorithm.

(2ª) Classes Detection: the regions are ordered in area decreasing order and the classes grouping procedure is started. A class statistical parameters (average and covariance matrix) is defined by the statistical parameters of the region with the largest area which is not classified yet. Next, all regions that have a Mahalanobis distance smaller than the threshold defined are associated to this class.

In this way, the first class will have as statistical parameters those regions with larger area. The following classes will have statistical parameters from the largest area regions average, which are not associated to any class previously detected. This step is repeated until all regions are associated to a class.

(3ª) Competing classes: the regions are reclassified, considering the new class statistical parameters, defined in the previous step.

The step 2 basically consists in the class detection, which is a sequential process that can have a bias to classes that are detected first. In order to eliminate this bias the competing classes is executed. This competing consists in reclassifying all regions. The statistical parameter (average for each class) is recomputed. The process is repeated until the class average does not change (convergence).

When finishing, all regions are associated to a class defined by the algorithm. The user has to associate these classes (named themes in the Spring) to classes already defined in the data base, in the Conceptual File_Scheme option.

Battacharya

The Battacharya distance measure is used in this classifier by regions, to measure the statistical separability between a pair of spectral classes. That is, it measures the average distance between the spectral classes probability distributions.

The idea is similar to the one used by the Isoseg classifier, but the distance measure used is the Battacharya distance.

The Battacharya classifier, different than the Isoseg which is an automatic process, requires the user interaction, through training. In this case, the samples will be the regions formed in the image segmentation.


ClaTex

The ClaTex classifier is a supervised algorithm that uses regions texture attributes from a segmented image, to make the regions classification. The classification is performed by the grouping technique by regions from a similarity measure among them. The similarity measure used consists in the Mahalanobis distance between the class of interest and the candidate regions for this class. Thus, each region will be classified to an interest class based on the shortest Mahalanobis distance.

The set of texture measures that can be used by this classifier is divided into 5 (five) groups:

  1. General Measures: this group includes the average, the variance, the standard deviation, the kurtosis, the asymmetry and the variation coefficient;
  2. Histogram Measures: this group includes the median, the absolute average deviation, the entropy and the energy;
  3. Logarithm Measures: in these group are the average logarithm, the variance logarithm, the texture and deviation logarithm (defined by: , where is a sampled average of the variable;
  4. Autocorrelation Measures: the bi dimensional spatial autocorrelation measures can be defined for the "lags" that change between -4 and 4 and also the ratio between two autocorrelation measures can be defined.
  5. Haralick Measures : these group measures are based on the Haralick co-occurrence matrix (Gray Level Co-occurrence Matrix - GLCM). The eighteen measures from this group are entropy, contrast, energy, homogeneity, dissimilarity, correlation, chi-squared, "cluster shade", "cluster prominence", and the average, variance, energy and the entropy of the summation and difference vectors and the contrast of the difference vector.

The steps to be followed to perform the classification using the ClaTex algorithm are similar to the ones presented for the supervised classifier. However, there are two basic differences in the ClaTex algorithm, summarized below:

  • (1st) Layer Definition: layer is the term used in the literature to define an information layer that has a grouping of textural measures selected related to itself which will be extracted from the same Information Layer.
  • (2nd) Measure Selection: because the number of measures that can be generated using this algorithm is so large, the selection of measures to be effectively performed in the classification can be done automatically, where the pair of classes which have a higher distance between them are ordered in decreasing order, based on a factor that evaluates the separability of the class pairs.

And finally the classification step is performed, based on the Mahalanobis distance, generating a classified image.


To Execute a Supervised Classification

Before presenting the procedures to perform a classification, the logical sequence of operations is described next:

    1. Create a Context File - this file stores the bands that will be used in the classification process, the method (pixel by pixel, or region) used, and the samples, if the method is pixel based;

    2. Training Execution - samples have to be done over a drawing area in the image, using a rectangular or polygonal samples;

    3. Sample Analyses - it allows to verify the collected samples validity;

    4. Executing the Classification - having the samples and the selected bands, the image is classified;

    5. Executing the After-classification procedure - this process extracts the isolated pixels as a function of a threshold and a weight given by the user (not mandatory);

    6. Executing the Classes Mapping - allow to transform the classified image (Image category) in a raster thematic map (Thematic category).

    NOTE: In the regions classification case, the samples will be the regions themselves.


The sequence for a classification execution from a segmented image

The user has to follow the steps presented next to generate a classification using a segmented image:

    1. Create a segmented image - generate an image separated in regions based on the gray level analysis

    2. Create a Context File - this file stores the bands that will be used in the regions classification process

    3. Region Extraction: in this procedure the algorithm extracted the statistical information of average and variable for each region, considering the bands indicated in the context

    4. Tanning Execution - samples have to be performed over an image in the drawing area 

    5. Samples Analysis - it allows to verify the validity of the collected samples

    6. Classification - to perform the classification of a segmented image it has to use the regions classifier

    7. Execute the Classes Mapping - it allows to transform the classified image (Image category) for a thematic raster map (Thematic category).


After-Classification

This procedure is applied in a classified image with the purpose to make the themes uniform, that is , to eliminate isolated points, classified differently of its neighborhood. In this case a classified image is generated with reduced noise.

In a 3 x 3 pixel window, the central point is evaluated related to the classes frequency (themes), in its neighborhood. According to the weight values and the threshold, defined by the user, this central point will have or not its class substituted by the class with the highest frequency in the neighborhood.

The weight varies from 1 to 7, and defines the number of times the frequency of the central point has to be considered.

The threshold varies also from 1 to 7, and it is the frequency value above which the central point is modified.

For instance, for the window of a classified image in the example below (each number represents a class color), the central pixel will be evaluated to belong to class 2:

3 3 1
5 2 3
5 5 5

A weight and a threshold equal 3 is considered and the following classes frequencies are obtained:

Class 1 2 3 5
Frequency 1 3 3 4

The table above indicates that class 1 occurs three times and the class 5, four times. The class 2 frequency is considered 3, because the weight factor was defined as 3.

The threshold equals to 3 will make the central point (from class 2) to belong to class 5, which frequency (4) is higher than the defined threshold.

The classified window together with the uniform themes become:

3 3 1
5 5 3
5 5 5

The weight definition and threshold depends on the user experience and from the characteristics of the classified image. The smaller the weight and smaller the threshold, the higher the number of performed substitutions.

Classification Topics



See also:
Other Image Processing Techniques.
How to execute a Classification.