In the previous lesson, you segmented the imagery to simplify it for classification. Next, you'll perform a supervised classification of the segments. A supervised classification is based on user-defined training samples, which indicate what types of pixels or segments should be classified in what way. (An unsupervised classification, by contrast, relies on the software to decide classifications based on algorithms.) You'll first classify the image into broad land-use types, such as vegetation or roads. Then, you'll reclassify those land-use types into either pervious or impervious surfaces.
Create training samples
To perform a supervised classification, you need training samples. Training samples are polygons that represent distinct sample areas of the different land-cover types in the imagery. The training samples then signify that segments with certain spectral characteristics should be classified together to represent the same land-use type. First, you'll modify the default schema (which you chose when you configured the wizard) to contain two parent classes: Impervious and Pervious. Then, you'll add subclasses to each class that represent types of land cover. If you attempted to classify the segmented image into only pervious and impervious surfaces, the classification would be too generalized and likely have many errors. By classifying the image based on more specific land-use types, you'll create a more accurate classification. Later, you'll be able to reclassify these subclasses into their parent classes.
- On the Training Samples Manager page of the wizard, right-click each of the default classes and click Remove Class. For each class, click Yes in the Remove Class window.
- Right-click NLCD2011 and choose Add New Class.
- In the Add New Class window, for Name, type Impervious. For Value, type 20, and for Color, choose Gray 30%. Click OK.
- Right-click NLCD2011 again and choose Add New Class. Add a class named Pervious with a value of 40 and a color of Quetzal Green.
Next, you'll add a subclass for gray roof surfaces.
- Right-click the Impervious parent class and choose Add New Class. Add a class named Gray Roofs with a value of 21 and a color of Gray 50%.
Next, you'll create a training sample on the map using this class.
- Click the Gray Roofs class to select it. Then, click the Polygon button.
- Zoom to the cul-de-sac to the northwest of the neighborhood.
You can enable navigation tools while the Polygon tool is active by holding down the C key.
- On the northernmost roof in the cul-de-sac, draw a polygon. Make sure the polygon covers only pixels that comprise the roof.
A row is added to the wizard for your new training sample.
When creating training samples, you want to cover a high number of pixels for each land-use type. For now, you'll create more training samples to represent the roofs of the houses.
- Draw more rectangles on some of the nearby houses.
Every training sample that you make is added to the wizard. Although you have only drawn training samples on roofs, each training sample currently exists as its own class. You'll eventually want all gray roofs to be classified as the same value, so you'll merge the training samples that you've created into one class.
- In the wizard, click the first row to select it. Press Shift and click the last row to select all the training samples.
- Above the list of training samples, click the Collapse button.
The training samples collapse into one class. You can continue to add more training samples for gray roofs and merge them into the Gray Roofs class. Ultimately, the Gray Roofs class should have training samples on roofs throughout the entire image (not every roof needs a training sample, but more coverage is more likely to yield a satisfactory classification).
- Create two more impervious subclasses based on the following table:
Subclass Value Color
- Create four pervious subclasses based on the following table:
Subclass Value Color
These seven classes are specific to the land-use types for this image. Images of different locations may have different types of land use or ground features that should be represented in a classification. For example, a different location may have houses with both gray roofs and red roofs. Because the spectral signatures of both roof types are very different, it would be more accurate to classify gray roofs and red roofs as two classes.
Shadows are not actual surfaces and cannot be either pervious or impervious. However, shadows are usually cast by tall objects such as houses or trees and are more likely to cover grass or bare earth, which are pervious surfaces. Some shadows cover roads or driveways, but you'll factor these into your accuracy assessment later in the workflow.
- Draw training samples throughout the image to represent these seven main land-use types. Zoom and pan throughout the image as needed.
- Collapse training samples that represent the same types of land use into one class.
- When you're satisfied with your training samples, click the Save button.
Your customized classification schema is saved in case you want to use it again.
- Click Next.
Classify the image
Now that you've created the training samples, you'll choose the classification method. Each classification method uses a different statistical process involving your training samples. You'll use the Support Vector Machine classifier, which can handle larger images and is less susceptible to discrepancies in your training samples. Then, you'll train the classifier with your training samples and create a classifier definition file. This file will be used during the classification. Once you create the file, you'll classify the image. Lastly, you'll reclassify the pervious and impervious subclasses into their parent classes, creating a raster with only two classes.
- Confirm that Classifier is set to Support Vector Machine.
For the next parameter, you can specify the maximum number of samples to use for defining each class. You want to use all your training samples, so you'll change the maximum number of samples per class to 0. Changing the maximum to 0 is a trick to ensure all training samples are used.
- For Maximum Number of Samples per Class, type 0.
Lastly, you have the option to choose statistical attributes to include in the attribute table of any raster dataset created using the classifier. While these statistics can be interesting, you won't need any of them for your purposes, so you'll leave the default parameters unchanged. Next, you'll train the classifier and display a preview.
- Click Run.
The process may take a long time, as multiple processes are run. First, the image is segmented (previously, you only segmented the image on the fly, which isn't permanent). Then, the classifier is trained and the classification performed. When the process finishes, a preview of the classification is displayed on the map.
Depending on your training samples, your classification preview should appear to be fairly accurate (the colors in the dataset correspond to the colors you chose for each training sample class). However, you may notice that some features were classified incorrectly. For instance, in the example image, the muddy pond south of the neighborhood was incorrectly classified as a gray roof, when it is actually water. Classification is not an exact science and rarely will every feature be classified correctly. However, because this classification will be used to determine storm water fees for landowners, a high degree of accuracy is expected. If you see only a few inaccuracies, you can correct them manually later in the wizard. If you see a large number of inaccuracies, you may need to create more training samples. Later, you'll run tools to assess the accuracy of your classification.
To go back in the wizard and create more training samples, click the Previous button until you return to the correct page.
- If you're satisfied with the classification preview, click Next.
The next page is the Classify page. You'll use this page to run the actual classification and save it in your geodatabase.
- For Output Classified Dataset, change the output name to Classified_Louisville.tif.
The remaining parameters are optional. They allow you to create additional outputs, such as a classifier definition file or a segmented image. You've already created these files, so you don't need to create them again.
- Leave the remaining parameters unchanged and click Run.
The process runs and the classified raster is added to the map. It looks similar to the preview.
- Click Next.
The next page is the Merge Classes page. You'll use this page to merge subclasses into their parent classes. Your raster currently has seven classes, each representing a type of land use. While these classes were essential for an accurate classification, you're only interested in whether each class is pervious or impervious. You'll merge the subclasses into the Pervious and Impervious parent classes to create a raster with only two classes.
- For each class, in the New Class column, choose either Pervious or Impervious.
When you change the first class, a preview is added to the map. The preview shows what the reclassified image will look like. When you change all of the classes, the preview should only have two classes, representing pervious and impervious surfaces.
- Click Next.
The final page of the wizard is the Reclassifier page. This page includes tools for reclassifying small errors in the raster dataset. You'll use this page to fix an incorrect classification in your raster.
- In the Contents pane, uncheck all layers except the Preview_Reclass and Louisville_Neighborhood.tif layers. Click the Preview_Reclass layer to select it.
- On the ribbon, click the Appearance tab. In the Effects group, click Swipe.
- Drag the pointer across the map to visually compare the preview to the original neighborhood imagery.
One inaccuracy that you may notice is the muddy pond south of the neighborhood. Because the pond is muddy, it has a different spectral signature than the other water bodies on the map, so it will likely be classified incorrectly even with thorough training samples. This pond is not connected to any other impervious objects, so you can reclassify it with relative ease.
- Zoom to the muddy pond area.
- In the wizard, click Reclassify within a region.
With this tool, you can draw a polygon on the map and reclassify everything within the polygon.
- In the Remap Classes section, confirm that Current Class is set to Any. Change New Class to Pervious.
With these settings, any pixels in the polygon will be reclassified to pervious surfaces. Next, you'll reclassify the muddy pond.
- Draw a polygon around the muddy pond. Make sure you don't include any other impervious surfaces in the polygon.
The pond is immediately reclassified as a pervious surface.
If you make a mistake, you can undo the reclassification by unchecking it in the Edits Log.
While you likely noticed other inaccuracies in your classification, for the purposes of this lesson, you won't make any more edits.
- For Final Classified Dataset, type Louisville_Impervious.tif (including the .tif extension).
- Click Run. Then, click Finish.
The tool runs and the reclassified raster is added to the map.
- On the Quick Access Toolbar, click Save to save the project.
In this lesson, you classified imagery of a neighborhood in Louisville to determine land cover that was pervious and land cover that was impervious. In the next lesson, you'll perform an accuracy assessment on your classification to determine if it is within an acceptable range of error. Then, you'll calculate the area of impervious surfaces per land parcel so the local government can assign storm water fees.