Environmental Remote Sensing

Forestry 753

Lab 5: Supervised Classification


I. Introduction

As we know from class and the previous lab, classification, in the remote sensing context, is the process of sorting pixels into a finite number of individual classes, or categories, based on the values of their digital numbers (DN). If a pixel satisfies a certain set of criteria, then the pixel is assigned to the class that corresponds to those criteria.

Supervised classification is more closely controlled by the analyst than unsupervised classification. In the unsupervised approach used in the last exercise, spectral clusters were calculated, and then the categories corresponding to the spectral clusters were determined. In the supervised approach, the categories of interest are defined by the user. Homogeneous training areas representing each category are identified, and then the spectral separability of the categories is evaluated. Statistics derived from the training data for each category are used as a basis for classification. Knowledge of the data, the classes desired, and the algorithm to be used are required before you begin selecting training samples.

This exercise will show you how the supervised classification tools in Imagine allow you to control the classification process. These tools let you select pixels that represent the categories of interest (the training sites or areas of interest), generate statistics for the categories (the signatures), and evaluate the signatures. Once you have determined which signatures to use, you can then run the supervised classification.

 

II. Delineating Training Sites and Generating Signatures

In Imagine, an individual training site is delineated as an "area of interest" and given a class name. The pixels within the training site are used to generate a "signature." This process is repeated to gather several training sites for each class.

Start by opening tm_data/raleigh94_alb.img in a viewer. Then left click on the Classifier box from the Imagine main tool bar and select Signature Editor... which will give you the "Signature Editor" window (it's a good idea to expand the window so you can see all of the columns):

 

 

 

 

 

 

 

 

 

 

Now, open the AOI (Area Of Interest) tool menu be selecting, from the viewer window menu, AOI / Tools...

 

The AOI tools let you interactively select, by using the cursor, a specific area from the image.

The pixel values of all image bands within an AOI are used to generate a signature. A signature includes the mean and variance of the digital numbers in each band, as well as the covariance between bands, for all pixels within a training area. Other statistics (min, max, mode, etc.) may also be generated.

Zoom in on an area of the image and select the polygon tool  from the AOI tools. Then, in the viewer over an "area of interest", left-click to mark each node of the polygon; double-click to close the polygon. Additional "tools" for drawing training sites other than polygons are also available. For example, a linear feature, such as a road (often only one pixel wide and difficult to draw within a polygon) can be delineated as a training area.

Try to delineate a polygon that represents a homogeneous group of pixels representing a particular class.

Once you have defined an AOI (make sure it is "activated" by left-clicking within the polygon), add that area as a training area by selecting Edit / Add from the Signature Editor menu. Alternately you can click on the add button . A signature will be generated based on the pixel values within the polygon you just created. This signature will appear automatically in the Signature Editor Cell Array. Note that Imagine defaults to generating signatures based on all of the data layers (bands) in the *.img file and not just those bands displayed in the Viewer.

In the Signature Editor, left-click inside the Signature Name column for the training area you just added. Give the signature a new name - one that makes sense to you and matches the training area, then hit enter.

This process is repeated until you have several training sites for each of the classes in which you are interested.

In creating signatures you are "telling" the computer how a particular class "looks". The algorithm used for the supervised classification will use the summary statistics from the signature areas and match every pixel in the image to one (and only one) of the signatures. One pixel at a time, the computer will find which signature is most similar to each pixel and assign the pixel to that signature's class. So, you want your signatures to be specific enough so that each class is as clearly defined as possible. Also, you want the range of classes to be wide enough so that it is reasonable for all of the pixels to fit into at least one class.

Your training sites should be (you are likely to see this again):

  1. Representative of all classes present in the image
  2. Numerous
  3. As homogeneous as possible
  4. As large as possible while still maintaining homogeneity

BEFORE CLOSING THE VIEWER , while the polygons are still displayed, select File/Save as... from the Viewer menu bar. This dialog allows you to save the AOIs in a file (in your own directory). The *.aoi extension should be automatically displayed. Left-click OK to save the AOIs. This file can now be used in any function which applies to AOIs. You can also use File/Open/AOI to display the AOIs at any time for adding or deleting areas. Note that once edited the AOI file must be saved again. If you save it to the same name as the original AOI file, Imagine will first ask if you want to write over the existing file.

Also, you should save your training data by saving a *.sig file by selecting File/Save as... from the Signature Editor menu (The ".sig" extension should be automatically added.)


III. Imagine Utilities for Evaluating Signatures

Once a signature file has been created, the signatures can be evaluated and edited. Several procedures are available for analyzing signatures. Three of these are described below.

Alarms

The Signature Alarm utility highlights the pixels in the Viewer that are estimated to belong to selected classes according to the parallelepiped decision rule. An alarm can be performed with one or more signatures. If you do not have any signatures selected (yellow highlight), then the active signature, which is next to the ">" will be used.

To conduct an "Alarm", within the Signature Editor, select a signature (or signatures) so that the alarm is performed using this signature.

You may want to change the color of this signature so that the alarm is more visible in the image. In the Signature Editor, right-hold in the color column. Select a color for this signature from the popup list or colorwheel, or edit the color value in the color column.

Now, from the Signature Editor menu bar, left-hold View/Image Alarm . The Signature Alarm dialog box appears:

 

 

 

 

Accept the default parallelepiped limits, and left-click OK . The alarmed pixels appear in the Viewer.

The "alarmed" pixels are those that would fall into the category described by the particular signature(s) selected. In the viewer, all pixels that would fall into a certain class are changed to the color of that class as shown in the Signature Editor window. Note that if only a subset of signatures is selected, the results could be misleading. "Alarmed" pixels may include those which would have fallen into another category (signature) if it had been selected.

The "Alarm" procedure is helpful for determining gross errors such as signatures that define categories other than the ones they were intended to define.

Contingency Matrix

The Contingency Matrix utility allows you to evaluate signatures that have been created from your AOIs in the image. This utility classifies only the pixels in the image AOI training samples, based on the signatures generated from these AOIs. We would expect that the pixels of an AOI would be classified to the class for which they train. However, the pixels of the AOI training sample only weight the statistics of the signature. Training areas are rarely so homogenous that every pixel within the area is actually assigned to the expected class.

The Contingency Matrix utility can be performed with multiple signatures. If no signatures are selected, then all signatures are used.

The output of the Contingency Matrix utility is a matrix of percentages and/or pixel numbers that allows you to see how many pixels in each training area were assigned to each class. Each AOI training sample should be composed primarily of pixels that belong to its corresponding signature class. A perfect set of training data would result in a contingency matrix of values only along the diagonal.

To obtain a "Contingency Matrix", from the Signature Editor Cell Array, select all of the signatures.

Left-hold Evaluate/Contingency . The Contingency Matrix dialog box appears:

 

 

 

 

 

 

 

 

Select Pixel Percentage (toggle button). Accept the default for other options.

Left-click OK to start the process.

When the process is complete, the Imagine Text Editor appears displaying the resultant contingency matrix. You can print or save the file under File in the text editor window.

Contingency matrices are helpful for determining both training site homogeneity and categorical separability. Note that if several training areas are used to describe a single category and the signatures for these sites are known to be near-identical, one would expect the classifed pixels to be "confused".

Signature Objects

The Signature Objects dialog box allows you to view plots of signature statistics, so that you can compare the signatures. The graphs appear as sets of ellipses in a feature space image. Each ellipse is based on the mean and standard deviation of one signature. A plot can be generated for one or more signatures. If you do not have any signatures selected, then the active signature, which is next to the ">" is used.

Before you view signature ellipses, you will have to create Feature Space images in which you will display your ellipses. We learned this in Lab 4, but here the feature space images will be created from within the Signature Editor window.

Again, a feature space image is simply a 2-way plot of band combinations in the selected *.img file.

Left-hold Feature/Create/Feature Space Layers in the Signature Editor. The Create Feature Maps dialog box appears.

In the Create Feature Space Maps dialog box, under Input Raster Layer, left-click on the file name from which the feature space image(s) will be generated.

Specify your directory and a root file name so that the file which will be created will be placed in your directory. Check "Output to Viewer."

Accept the default for other options (all two-way band combinations will be generated).

Examine the created images. The images essentially depict the total distribution of pixels in the selected band combination with a default color table (red = most frequently occurring band values, etc.).

You may need to zoom the image to a desired size so that you can clearly read the ellipses created in the following steps.

In the Signature Editor menu bar, left-hold Feature/Objects . The Signature Objects dialog box appears:

 

 

 

 

 

 

 

 

 

 

In the Signature Editor window, select the signatures that you want to compare.

In the Signature Objects dialog box, set the Viewer number field to the Viewer in which the Feature Space image you want to use is displayed.

The Plot Ellipse and Label check boxes should be selected. Set the Std. Dev. number field to 2 or 3, or a reasonable number. This will affect the sizes of your ellipses.

Left-click OK.

The ellipses for these signatures appear in the feature space Viewer.

Here is an example feature space objects image:

By comparing the ellipses for different signatures for one band pair, you can easily see if the signatures represent similar groups of pixels by seeing where the ellipses overlap on the feature space image.

When ellipses do not overlap, then the signatures represent distinct sets of pixels in the two bands being plotted, which is desirable for classification. However, some overlap is expected between similar categories because it is rare that all classes are totally distinct.

This utility is helpful for determining both within-site homogeneity and separabilty between categories.

 

IV. Editing Signature Files

After you have made your initial evaluation of the signatures you may need to edit them by deleting, merging, or renaming them. To delete, select (left-click to yellow highlight) the signature you wish to delete and select Edit / Delete. For this exercise, avoid merging signatures (merging signatures is an option under Edit / Merge.) The net result of merging is, in most instances, to increase the variance within the signature. If generalized classes are all that are desired, this can be acceptable. Otherwise, the signature may be defining too broad a category.

Use Edit / Layer Selection from the Signature Editor to select the bands you want in your final signature file. In general, you should use all available bands unless you have a good reason to eliminate one or more bands.

V. Perform Classification

In the Signature Editor window, select all of the signatures so that they will all be used in the classification process. (If none of the signatures are selected, then they are all used by default.)

From the Signature Editor menu bar, left-hold Classify / Supervised to proceed with the classification. The Supervised Classification dialog box appears:

 

 

 

 

 

 

 

 

 



In the Supervised Classification dialog box, under "Output Classified Layer", type in an output file name, specifying your directory. This is the name for the supervised classification thematic raster layer.

Left-hold the Parametric Rule pop-up list to select "Maximum Likelihood".

For a supervised classification, the following "Parametric Rules" are provided in Imagine:

Maximum Likelihood
Mahalanobis Distance
Minimum Distance
From the reading assignments you should be familiar with these terms. These are also described in the Field Guide.

The Supervised Classification utility outputs a thematic layer (.img extension) and, if you select Output Distance File , a distance file (.img extension). The distance file indicates the distance between the band values in a given pixel and the class mean. (Distances can be used for further analysis related to the classification.)

Accept the defaults for other options.

Left-click OK to classify the .img file.

Display the classified image and create a color scheme for the classified image in a way similar to our unsupervised classification from Lab 4.

The thematic raster layer automatically contains the following data:

class values (a class number corresponding the the class number in the input signature file)
class names (also from the signature file)
color table (default gray-scale)
statistics (compare with the original signature statistics)
histogram (number of pixels in each class)

The *.img file also contains any signature attributes that were selected in the Supervised Classification utility.


Review Questions:

1. Establish training sites in your image file for each of the applicable categories from the USGS Level I Classification Scheme.

Try to follow this procedure:

For each category, establish a minimum of three training sites.
For each category that has obvious spectral variability, establish three training sites for each known spectral variation. For instance, Cultivated Land includes soils which can be sandy or organic, wet or dry, vegetated or covered with sparse vegetation (weeds or crop stubble). These variations are usually apparent in the imagery (even if the exact cause of the variation is not known). You should try to define three signatures for each of the obvious variations in the desired categories.
Be sure to give each training area (AOI) a unique name and record the information on that training area.
If a particular category is only sparsely represented, you may not be able to find three areas to use as training sites. It is also possible that a particular cover type may be so scattered that you will not be able to find areas large enough or homogeneous enough to be training sites. Some categories may not be represented at all. These situations are to be expected and this is part of the "fun" of remote sensing!
You may alter the categories of interest if you have a particular cover type (or condition, like turbid water) that you want to identify.

Discuss what classes you used and how you selected them.


2. Use the evaluation techniques described in this lab to determine:

Discuss how your training samples did in these tests, why you think you got the results you did, and if you are unsatisfied with the results how you could improve the samples.

3. Complete a supervised classification of an image using a subset of the original seven bands; preferably no more than 4 bands. You may want to specifically use the bands that you used in your unsupervised classification so that you can directly compare results.

Make a detailed evaluation of the results of your supervised classification. Although you have "supervised" this classification, results may still not be what you anticipated. The evaluation tools from the previous lab give you some indication of signature separability and possible confusions, but actual classification can be unpredictable. You should check each class in your output image using the method described for identifying spectral clusters in the unsupervised classification (i.e. use the Raster/Attribute Editor to color and analyze each class, one at a time). How did you do?

4. Try at least three of the other classification options to find out what they do. For example, you could try different parametric or nonparametric decision rules. Describe in detail how the option you chose works (consult the Field Guide) and how it affected your results.

5. Develop a way in which you could utilize both unsupervised and supervised classification on the same image to produce an enhanced classification technique.

Feel free to play around with different options. There are many options in the Signature Editor which we have not described in this lab. Some of these different techniques may give you some insight for a direction for your project. As always, the Online Documentation and the Field Guide give details on all of the menu options available to you.