Tutorial 03 - Image Classification

Lab 3: Image Classification

Unsupervised classification sorts image data into statistical \"clumps\", and the analyst needs only to provide a few starting parameters. This type of classification can be useful when one knows relatively little about an image. That is, no label or reference information is available. Unlike the unsupervised classification, the analyst closely controls supervised classification. In this process, the analyst selects the pixels that represent patterns that are known by the analyst, either from viewing the image or with data or observations from other sources. These other sources may include: aerial photographs, ground observations and maps. This lab provides practice of both unsupervised and supervised classification in ArcGIS.

1. Adding a multiband image for the classification

a. Go to Blackboard Learn and download lanier.img from the folder lab 3. lanier.img is a Landsat 5 Thematic Mapper (TM) image of Gainesville, Georgia, including Lake Lanier. Detailed information of Landsat TM bands is displayed in the table below.


Thematic\ Landsat\ Wavelength\ Resolution\ Mapper\ 4-5 (micrometers) (meters) (TM)


               Band 1         0.45-0.52              30

               Band 2         0.52-0.60              30

               Band 3         0.63-0.69              30

               Band 4         0.76-0.90              30

               Band 5         1.55-1.75              30

               Band 6         10.40-12.50            120\* (30)

               Band 7         2.08-2.35              30

* TM Band 6 was acquired at 120-meter resolution, but products processed before February 25, 2010 are resampled to 60-meter pixels. Products processed after February 25, 2010 are resampled to 30-meter pixels.

b. Start ArcMap.

c. Add the Image Classification toolbar to ArcMap.

  • Click the Customize menu in ArcMap.

  • Click Extentions..., and make sure Spatial Analyst is checked.

  • Click Toolbars > Image Classification.

{width="2.437007874015748in" height="3.0984251968503935in"}

d. On the Standard toolbar, click the Add Data button.

{width="6.028062117235345in" height="0.322746062992126in"}

On the Add Data dialog box, browse to Folder Connections > the drive you store the data > downloaded folder lab 3 > lanier.img and click Add. If you cannot find the location you need, which means that the folder is not connected, click the Catalog tab on the right side of the interface, right click Folder Connections, Connect Folder ... Select the folder you want to connect, and click OK.

{width="2.437007874015748in" height="2.377952755905512in"}

The image is added as a layer in the table of contents. Click on the color block on the left side of text (for example,{width="0.21875in" height="0.17708333333333334in"}), and select Layer_4 as the Red band, Layer_3 as the Green band, and Layer_2 as the Blue band. In this way, a false color image is displayed. If you want to view a representation of a true color image, select Layer_3 as the Red band, Layer_2 as the Green band, and Layer_1 as the Blue band. Why is this not really a true color image?

{width="5.704797681539808in" height="3.7624660979877516in"}

e. Save the ArcMap file to the same directory as the Landsat image.

f. On the Image Classification toolbar, click the Layer arrow and click the image layer you just added.

{width="4.23in" height="3.1892957130358703in"}

This specifies the source image for all the subsequent image classification tasks. All the bands associated with the image layer are used in the classification analysis.

2. Executing the Iso Cluster Unsupervised Classification tool

In this section of the lab, you will use statistical methods, specifically the ISO cluster technique, to generate an unsupervised classification of the image. As it is unclassified, no prior knowledge what is actually on the ground is required.

a. On the Image Classification toolbar, click Classification > Iso Cluster Unsupervised Classification. The Iso Cluster Unsupervised Classification tool is opened.

{width="6.0in" height="4.1625in"}

b. In the tool dialog box, specify Input raster bands as lanier.img, Number of classes as 5, and Output classified raster as, for example, D:\lab4\iso_5. You may accept default values for other parameters.

c. Click OK to run the tool.

d. The output classified raster will be automatically added to ArcMap when the tool finishes.

e. To create a labeled map of the results, start by editing the categories and colors of the resulting classification. This can be done by either right clicking on the iso_5 layer, selecting Properties, and then the Symbology tab, or by editing the colors and labels directly in the Table of Contents (click on the label or color to edit). Note that you will need to guess at a name for each classification by switching between the image and the iso_5 layer.

f. Once the layer legend has been edited, go to View > Layout to switch ArcMap to layout view. This will shift the view to the data within a standard letter sized sheet of paper.

g. From this view make sure that the iso_5 layer is visible and use Insert > Legend to add a legend to the page. Make sure to drag the legend to a location where it is visible.

h. Finally, save a version of the map by selecting File > Export Map. Specify the location and name for the output raster. Select Format as TIFF, resolution as 300 DPI, then click Save.

{width="5.249819553805774in" height="4.303757655293088in"}

3. Creating training samples

In this section of the lab, you will create training samples by visibly inspecting the image and identifying small regions of the whole image that limited to only one of the four land use classes that we will identify. These land use classes are: water, urban, forested and open land.

a. Click one of the drawing tools on the Image Classification toolbar. There are three drawing tools available, for drawing polygons, circles, and rectangles. Select Draw Polygon.

{width="3.9895833333333335in" height="0.5104166666666666in"}

b. Turn off the layer that was produced from the ISO classification, you want to do this step using the original Landsat 5 image. To better identify the classes, you may want to switch the image display to true color image by selecting Layer_3 as the Red band, Layer_2 as the Green band, and Layer_1 as the Blue band.

c. To develop training samples, you will want to look through the image for areas that are consistent in land use, and identify 2-4 sites for each land use that are spread across the image. You are trying to capture the spectral variability within a land use type, while not including spectral signatures from other land use types. For example, if you zoom in on the lake water, you will see the image is speckled with different shades of blue and green (for the true color image). These represent visible changes in the water, as well as noise in the sensor and variations in atmospheric conditions. You want the areas selected to represent each land use class to be similar to itself and different from the other classes.

d. In ArcMap use the zoom in, zoom out and pan tools (see below), to move around the image and identify several (2-4) areas that belong to the water class. You can also use the scroll wheel on the mouse to zoom in and out on a point centered on the mouse icon. Avoid getting too close to the boundary of the area you are interested in, as this can introduce unwanted mixed pixels. For example, getting too close to the lake shore will result in image pixels that have a mixture of water and land in their spectral signature.

{width="5.308968722659667in" height="0.2417946194225722in"}

e. The following image shows a polygon training sample over water in ArcMap:

{width="5.72in" height="3.688305993000875in"}

To help identify land use classes, you may want go to open Google map and search for "lake lanier, ga". You should be able to see clearly what type of land use it is for each pixel. Identify areas that are clearly water, forest, urban, and open land. Make sure you have 2-4 areas representing the same class and these areas are distributed across the image.

{width="6.0in" height="3.225in"}



f. Once you finish drawing the training samples, a new class is created in the Training Sample Manager with a default name, value, and color. Open Training Sample Manager by click on the button show below. Change the class name, value, and color by clicking on the cell you want to change (water should be blue, open land = orange, forest = green, and urban = red; see figures next page).

{width="3.9895833333333335in" height="0.5104166666666666in"}

You can also delete/clear/merge/save training samples etc. by using the tools below.

{width="2.3125in" height="0.22916666666666666in"}

From left to right: Clear all samples; Load existing training samples; Save training samples; Merge training samples; Split training samples; Delete training samples; Move a training sample up or down; Renumber all training samples in ascending order.

g. Once you have your 2-4 areas for a single land use class, Click on the merge {width="0.23958333333333334in" height="0.19791666666666666in"} button to merge the 2-4 areas you identified into a single class, and name it appropriately.

h. Repeat steps d to g to create 3 more training samples to represent urban, forested and open/grassland land use classes. The following is what Training Sample Manager looks like after four classes are created:


{width="6.085986439195101in" height="3.993176946631671in"}



4. Evaluating training samples

Now you will use the training data you created in the previous step to classify the entire image.

a. In Training Sample Manager, choose one or more training samples to evaluate, for example, Water.

{width="3.8854166666666665in" height="2.46875in"}

b. In the dialog box, click the Histograms button{width="0.23958333333333334in" height="0.22916666666666666in"} to open the Histograms evaluation window.

The histograms for the selected classes are displayed in the Histograms window.

{width="4.0in" height="2.9074890638670166in"}

c. Examine the histograms for each class on all the bands available. Use the vertical scroll bar to show more graphs when more than four bands are available. The histograms of different classes should not overlap significantly across all spectral bands. If they do overlap, you need to remove or merge some of the classes.

d. Repeat the procedure in steps b and c, but now select the Scatterplots button and then the Statistics button to open their respective windows. Examine the scatterplots and statistics for different classes. They should not overlap across all spectral bands.

{width="3.8854166666666665in" height="0.21875in"}

{width="4.25in" height="2.864537401574803in"}

{width="6.0in" height="2.5097222222222224in"}

e. If you removed old training samples and created new ones, repeat steps a to d to evaluate the new training samples. This process is iterative and should be repeated until you are satisfied with the training sample set.

5. Creating a signature file

a. Click the Create Signature File button Create signature
    file{width="0.16666666666666666in" height="0.16666666666666666in"} on the Training Sample Manager dialog box.

b. A file browser dialog box appears.

c. On the file browser dialog box, pick a location and specify a name for the signature file (lanier.gsg), then click OK to save the file.

6. Executing the Maximum Likelihood Classification tool

a. On the Image Classification toolbar, click Classification > Maximum Likelihood Classification to open the Maximum Likelihood Classification tool.

b. In the tool dialog box, specify values for the three required parameters---Input raster bandsInput signature file (the signature file you just created), and Output classified raster (specify the image name and the location). Accept the default values for other parameters.

{width="6.0in" height="4.1625in"}

c. Click OK to run the tool.

d. The output classified raster will be automatically added to ArcMap when the tool finishes.

e. To save the classified image to disk, switch from data to layout view.

f. Position the map with training polygons visible to fill the window.

g. Add a legend.

h. Then click File > Export Map. Specify the location and name for the output raster. Select Format as TIFF, set resolution to 300 DPI, and then click Save.

[Finish the lab and submit the two TIFF files you created using the two different classification methods. Also submit a word document with answers to the following questions.]{.underline}

[Question 1:]{.underline} Which of the two classification methods resulted in the best representation of land use in the region?

[Question 2:]{.underline} How much influence does the selection of ground training sites have on the final classification?

[Question 3:]{.underline} Assume the table below shows the confusion matrices generated after the supervised classification you did above:


                    Ground                                      Total
                    Truth                                       
                    Classes

                    Forest     Urban      Water      Open land

Thematic Forest 35 5 2 2 44 Map
Classes

         Urban      10         87         37         3          137

         Water      12         7          153        1          173

         Open land  5          9          1          41         56

No. Ground 62 108 193 47
Truth
Pixels


Calculate the producers accuracy, users accuracy and overall accuracy.