Friday, April 6, 2018

Lab 7: Object Based Classification

Introduction

The goal of this lab is to use eCognition software to classify Landsat TM imagery of Eau Claire and Chippewa counties using the Random Forest and Support Vector Machine classifiers, and is to classify high resolution imagery (3.4 cm) using the Support Vector Machine classifier. Another goal of this lab is to become familiar with the eCognition software and understand how to classify imagery with it. Two different maps will be created. The first map will show the difference in the output generated by the Support Vector Machine classifier and the Random Forest classifier of Eau Claire and Chippewa counties, and the second map will show the classified image of the high resolution UAS imagery.

Methods

Classify Landsat TM Imagery Using the Random Forest Classifier

Prepare the imagery
To do this, first, the Landsat image was brought into the eCognition software. Next, in the Assign No Data Values window opened from the Create Project Dialog window, the check box to exclude pixels with no data was checked.

Next, the band combination was changed from blue, green, red, to NIR, red, green. This was changed because the delineation of objects is easier using this band combination than it is using the blue, green, red band combination. To change the band combination, one can open the Edit Image layer Mixing window from the main toolbar.

Segment the Imagery
To segment the imagery, a process was created in the Process Tree which was given the name "Lab7_Object_Classification" was created. A sub-process was then added called "Generate Objects" This sub-process was assigned to execute its child processes. Then, a child process given a default name was created. In this process the settings were changed as they appear in Figure 1 below. The scale parameter is a very important parameter in the window below. Set this parameters to large or too small and it will affect the accuracy of the classified output significantly.
Fig 1: Edit Process Window for Creating Objects on the Landsat Imagery
Fig 1: Edit Process Window for Creating Objects on the Landsat Imagery

The objects which this process created can be seen below in Figure 2. Assessing the objects is a visually and qualitative task. It is up to the analyst to determine whether the objects group pixels well or if they don't. Based on the output below, the objects seem to group pixels well, so the process to classify the imagery can be continued.
Fig 2: Objects Created from the Process Executed in Figure 1.
Fig 2: Objects Created from the Process Executed in Figure 1.
Collect Training Samples and Define Classes
First, the classes which will be used in the training samples and in the classification are defined. They are defined in the Class Hierarchy window. Classes are added by right clicking in the window, clicking on "Insert Class" and then by entering in the name of the class and its assigned color. Figure 3 shows the classes used for the Random Forest classifier.
Fig 3: LULC Classes Used
Fig 3: LULC Classes Used
The training samples are then collected by highlighting the "sample objects" button, having a LULC class selected and then by double clicking on the corresponding objects in the viewer. Ten samples were collected for forest, 20 for urban/built-up, 10 for water, 15 for Green vegetation/shrub, and 15 for bare soil.

Train and Apply the Training Samples and Classifier
The first step is to navigate to the Manage Variables window which is found under the Process tab. In this window, a scene variable is created to have a string data type and is given the name "RF Classifier". The next step is to create a sub-process within the RF Classification sub-process. This process is called "Train RF Classifier" and is called to execute its child's processes. A child is then inserted in this sub-process and is given the parameters as seen below in Figure 4. the Features parameters are accessed by clicking on the "..." button on the right side of its text box. Then, the "Brightness, Mean Layer 1, Mean Layer 2, Mean Layer 3, Mean Layer 4, Mean Layer 5, Mean Layer 6, max. diff, GLCM Dissimilarity (all dir.), and GLCM Mean (all dir.)" layers are added to be used in applying classifier. This child is then executed. 
Fig 4: Train the Classifier Parameters
Fig 4: Train the Classifier Parameters
To apply the classifier, a new sub-process was created within the RF Classifier sub-process called "Apply RF Classifier". Then, a child was inserted within this sub-process. This child's parameters can be seen below in Figure 5. The child is then executed. 
Figure 5: Apply the RF Classifier
Figure 5: Apply the RF Classifier
Make Edits to the Classification Output Image
There are two different ways to make edits to the classification output. One way is to tell the eCognition software two or three different LULC classes which it commonly classified incorrectly and then rerun the process within the Apply RF Classifier sub-process. This is done by reopening the child within the Apply RF Classifier and changing the "Class filter" parameters from "none" to the desired LULC classes which need to be fixed. Then, the child is executed. This can be done a few times to help clean up the classification. If this isn't working well, the second way to edit the objects is to do it manually. This is done by accessing the manual editing toolbar underneath the View tab and then chaining the "Select Class for Manual Classification" drop down list to the desired LULC which the analysts wishes to change an object on the map to. Then, once the appropriate LULC class is present in the list, the desired object is click on to change the LULC class. This can be as many times as the analyst determines is necessary. Once the manual edits are made, the map is then exported as a .tiff so a map of the output can be created in ArcMap. Once complete, the process tree for the Random Forest classification should look like it does in Figure 6 below.
Fig 6: Random Forest Process Tree
Fig 6: Random Forest Process Tree



Classify Landsat TM Imagery Using the Support Vector Machine Classifier

Prepare the imagery
This is done exactly the same as explained in the Random Forest classifier section.

Segment the Imagery
This is done exactly the same as explained above in the Random Forest classifier section.

Collect Training Samples and Define Classes
The classes are created same way as explained in the Random Forest classifier section as well as the training samples. A new set of training samples is collected using about the same number of training samples per class as explained in the Random Forest classifier section.

Train and Apply the Training Samples and Classifier
This is done similarly as explained in the Random Forest classifier section above, but the process is named to correspond with the Support Vector Machine classifier rather than the Random Forest classifier. The parameters entered in the child are also different and are shown below in Figure 7. This child is then executed.
Fig 7: Train the SVM Classifier
Fig 7: Train the SVM Classifier
Next, the apply process is created within a new sub-process just like for the Random Forest classifier. The parameters for this child can be seen below in Figure 8. This child is then executed.
Fig 8: Apply the SVM Classifier
Fig 8: Apply the SVM Classifier
Make Edits to the Classification Output Image
Lastly, edits are made on the SVM classified output the same way as explained in Random Forest classifier section. Then, the output is exported as a .tif so a map can be created ArcMap. The process tree for the Support Classification classifier should look like it does in Figure 9.
Fig 9: Support Vector Machine Process Tree
Fig 9: Support Vector Machine Process Tree

Classify High Resolution UAS Imagery Using the Support Vector Machine Classifier

Prepare the imagery
This is done exactly the same as explained in the Random Forest classifier section.

Segment the Imagery
This is done exactly the same as explained above in the Random Forest classifier section except that the scale parameters is changed from 9 to 180.

Collect Training Samples and Define Classes
The classes are created same way as explained in the Random Forest classifier section as well as the training samples. A new set of training samples is collected incorporating the following classes: shadow, asphalt, roof, grass, and tree.

Train and Apply the Training Samples and Classifier
This is done similarly as explained in the Random Forest classifier section above, but the process is named to correspond with the Support Vector Machine classifier rather than the Random Forest classifier. The parameters entered in the child are the same as shown in Figure 7. This child is then executed. Next, the apply process is created within a new sub-process just like for the Random Forest classifier for the Landsat imagery. The parameters for this child are the same as seen in Figure 8. This child is then executed.

Make Edits to the Classification Output Image
Lastly, edits are made on the SVM classified output for the UAS imagery the same way as explained in Random Forest classifier section. Then, the output is exported as a .tif so a map can be created ArcMap. The process tree for the Support Classification classifier should look like it does in Figure 10.
Fig 10: Support Vector Machine Process Tree for the UAS Image
Fig 10: Support Vector Machine Process Tree for the UAS Image

Results

Figure 11 shows the two classified images of the Landsat TM imagery using the Random Forest and Support Vector Machine classifiers as explained above. It appears that the output created using the Support Vector Machine classifier classified the imagery better than the Random Forest classifier. This is evident by looking at the urban LULC class. In the Random Forest classifier, based off of what the analyst knows of the LULC of the study area, it appears as though many agriculture and bare soil LULC classes are mis-classified as urban. Also, it appears as though many areas that should be classified as forest were classified as vegetation / shrub. This can be seen by looking at how there is more homogeneity to the forest LULC class in the output generated by the Support Vector Machine classifier than there is in the output generated by the Random Forest Classifier.
Fig 11: LULC Maps Created Using the Random Forest and Support Vector Machine Classifiers
Fig 11: LULC Maps Created Using the Random Forest and Support Vector Machine Classifiers
Figure 12 shows the classified image of the high resolution UAS imagery using the Support Vector Machine classifier. Overall, the classification is pretty good. The classifier visually appears as though it had a difficult time differentiating between the roofs and asphalt LULC classes. This output does however look visually satisfying. Object based classification is really meant for classifying high resolution UAS imagery rather than classifying Landsat imagery. This is why the output of the UAS imagery is much more clear than that of the Landsat imagery. If pixel based classification were to be ran on the UAS imagery, the salt and pepper effect would be very present compared to the output below.
Fig 12: Object Based Classified Imagery Using Support Vector Machine on High Resolution UAS Imagery
Fig 12: Object Based Classified Imagery Using Support Vector Machine on High Resolution UAS Imagery

Sources

Esri, 2017. US Geodatabase
United States Geological Survey, (2017). Earth Resources Observation and Science Center
UWEC Geography & Anthropology UAS Center, (2016) Mikes House Imagery
Wilson, C (2017) Lab 7 Object Based Classification retrieved from
    https://drive.google.com/open?id=1DSAZ310x3SeQMhscuTs0RUw4cv_5T9Ze

No comments:

Post a Comment