Classify
Algorithm
The Classify operation performs a multi-spectral image classification according to training pixels in a sample set.
The following classification methods are available:
Explanation of terms:
- The term 'Class mean' (mi) is used for the means of the training pixels in class i for the n input bands. When for example you wish to classify an image with 7 bands, a class mean vector is a 7 x 1 vector, containing the mean values of a single class in band 1, in band 2, ..., band 7. The class means (in all input bands) of a certain class are directly visible in the Sample Statistics of your sample set.
- The term 'Feature vector' (x) is used for the spectral values of a certain pixel to be classified in n bands. When for example you wish to classify an image with 7 bands, and a pixel to be classified has value 56 in band 1, value 88 in band 2, value 190 in band 3, ... , and value 165 in band 7, the feature vector for this pixel is a 7 x 1 vector containing values 56, 88, 190, ..., 165.
- The optional 'threshold' value is expressed as the n-dimensional spectral distance towards a class mean; how the spectral distance is calculated depends on the selected classification method.
In general, it is compared whether the spectral distance of a feature vector towards a class mean is smaller than the specified n-dimensional spectral threshold distance or not:
- if smaller, the pixel (feature vector) is acceptable for this class;
the pixel will be classified as this class, when there is no other class mean at an even smaller spectral distance;
- if larger, the pixel (feature vector) is rejected for, i.e. not classified as, this class.
Examples of the threshold value using the Minimum Distance classifier:
- Suppose you wish to classify an image containing 7 bands:
- When specifying a threshold of 100, then the root of the squared sums of distances towards a class mean in all bands may not exceed 100.
- When, for a certain feature vector to be classified, the distance (or difference) towards a certain class mean equals 3 in bands 1, 2, and 3, and equals 4 in bands 4, 5, 6, and 7, then:
100 ≤ Ö(32 + 32 + 32 + 42 + 42 + 42 + 42)
The inequality is fulfilled, thus the feature vector is accepted and the pixel will be classified as this class.
- Similarly, a feature vector will also be accepted and classified as this class, when the distances of the feature vector towards a certain class mean equals 7 in band 1; 5 in band 2; 4 in bands 3, 4, 5; and 1 in bands 6 and 7; as
100 ≤ Ö(72 + 52 + 42 + 42 + 42 + 12 + 12)
- Suppose you wish to classify an image with 3 bands:
- When specifying a threshold of 100, then the root of the squared sums of distances towards a class mean in all bands may not exceed 100.
- When, for a certain feature vector to be classified, the distance (or difference) towards a certain class mean equals 6 in two bands, and equals 5 in the other band, then:
100 ≤ Ö(62 + 62 + 52)
The inequality is fulfilled, thus the feature vector is accepted and the pixel will be classified as this class.
- Similarly, a feature vector will also be accepted and classified as this class, when the distances of the feature vector towards a certain class mean equals 9 in one band, and equals 3 in the two other bands, as
100 ≤ Ö(92 + 32 + 32)
In case of Minimum Distance, the spectral distance of a feature vector towards a class mean is thus a simple Euclidian distance in n-dimensions, as demonstrated above. For the Minimum Mahalanobis distance or the Maximum Likelihood classifier however, the calculation of the spectral distance towards a class mean involves the variance-covariance matrix of the class; this implies a non-Euclidian distance concept.
Classification methods
Prior to any classification, empirical statistics are drawn from the training pixels in the input sample set. These sample statistics are calculated per class of training pixels and per band. For instance, for a single class (i), n mean values are calculated when there are n input bands; these n mean values together are called the class mean (vector) for that class (mi).
Depending on the selected classification method, the following statistics are calculated:
- for each class i of training pixels
:
- the means of training pixels per band (mi),
- in case of box classifier: the variance of the training pixels per band,
- the standard deviation of the training pixels per band (should be > 0),
- the predominant value (mode) per band,
- in case of Minimum Mahalanobis distance, Maximum Likelihood and Prior Probability classifier: an n x n variance-covariance matrix (Vi) which stores class variance per band, and class covariance between bands.
For each feature vector to be classified, these statistics are used to calculate the shortest 'distance' towards the training classes. All classification decisions are thus based on these statistical empirical parameters.
Box classifier:
For each class, a multi-dimensional box is drawn around the class mean.
For each class, the size of the box is calculated as:
(class mean ± standard deviation per band) * multiplication factor
- If a feature vector falls inside a box, then the corresponding class name is assigned.
- if a feature vector falls within two boxes, the class name of the box with the smallest product of standard deviations is assigned, i.e. the class name of the smallest box.
- if a feature vector does not fall within a box, the undefined value is assigned.
Minimum Distance to Mean:
For each feature vector, the distances towards class means are calculated.
- The shortest Euclidian distance to a class mean is found;
- if this shortest distance to a class mean is smaller than the user-defined threshold, then this class name is assigned to the output pixel.
- else the undefined value is assigned.
Minimum Mahalanobis distance:
For each feature vector, the Mahalanobis distances towards class means are calculated. This includes the calculation of the variance-covariance matrix V for each class i.
The Mahalanobis distance is calculated as:
di(x) = yTVi-1y
For an explanation of the parameters, see Maximum Likelihood classifier.
- For each feature vector x, the shortest Mahalanobis distance to a class mean is found;
- if this shortest distance to a class mean is smaller than the user-defined threshold, then this class name is assigned to the output pixel.
- else the undefined value is assigned.
Maximum Likelihood:
For each feature vector, the distances towards class means are calculated. This includes the calculation of the variance-covariance matrix V for each class i.
The formula used in Maximum Likelihood reads:
di(x) = ln|Vi| + yTVi-1y
where:
di
|
distance between feature vector (x) and a class mean (mi) based on probabilities
|
Vi
|
the n x n variance-covariance matrix of class i, where n is the number of input bands
|
|Vi|
|
determinant of Vi
|
Vi-1
|
the inverse of Vi
|
y
|
x - mi ; is the difference vector between feature vector x and class mean vector mi
|
yT
|
the transposed of y
|
- For each feature vector x, the shortest distance di to a class mean mi is found;
- if this shortest distance to a class mean is smaller than the user-defined threshold, then this class name is assigned to the output pixel.
- else the undefined value is assigned.
Maximum Likelihood including Prior Probabilities:
For each feature vector, the distances towards class means are calculated. This includes the calculation of the variance-covariance matrix V for each class i. Furthermore, for each class, the prior probabilities are taken into account; these are listed in a column of a table.
The formula used in Maximum Likelihood with Prior Probabilities reads:
di(x) = ln|Vi| + yTVi-1y - 2 ln(P(Ci))
where:
P(Ci)
|
the prior probability for class i
|
For an explanation of the other parameters, see Maximum Likelihood classifier.
- For each feature vector x, the shortest distance di to a class mean mi is found;
- if this shortest distance to a class mean is smaller than the user-defined threshold, then this class name is assigned to the output pixel.
- else the undefined value is assigned.
Reference:
- Gorte, B., 1998. Probabilistic Segmentation of Remotely Sensed Images. ITC publication nr 63. ITC, Enschede. 143 pp.
See also:
Classify : functionality