Step 4: Supervised classification
4.1: Create training information
In order for QGIS to perform the classification, it will need to know which specific areas of the image – and which underlying values – belong to which class. Classification is a remote sensing technique that categorizes image pixels into classes based on land cover. This is done by comparing the reflectance values of different spectral bands in different regions. Ucontrolled classification, the user determines the sample classes on which the classification is based, while foruncontrolled classificationthe result is just the result of computer processing. In this case, controlled classification is carried out. Therefore, training inputs will need to be developed.
Create a new training item by navigating to the training item in the SCP Dock and clicking the buttonicon. Name the file and save it in the same folder as the satellite data.
It is up to the user to determine which and how many classes there will be. However, for change detection, the number of classes should be relatively small. The more classes there are, the more complex the change matrix and future analysis will be. In this Recommended Practice, the purpose of the analysis is to find out how much forest was lost between 2015 and 2019. The classes used are shown in the figure below. To create classes, go to the Macro Classes list under Training Input in the SCP Dock. Add classes by clickingicon and change the name by clicking on the MC info cell. Make sure each class has a unique MC ID value as shown in the image below.
Figure 12: List of SCP Dock macro classes
Band view allows you to change the map view. This is a useful tool for differentiating between land cover classes. For example, the water in the image below is difficult to identify because the color of the rainforest is quite similar.
Figure 13: Layer properties, symbols
In this window, the bars for each color can be changed via the drop-down menu. The ribbon display can be changed at any time during the sorting process.
Once the classes are created, you will be taken to the ROI signature list where you can start adding ROIs.
There are two types of ROI that can be created. The first is to draw yourself a polygon of an area that you clearly see as belonging to a certain class. Do it by clickingicon that you can find on the SCP toolbar. Now draw the polygon on the map. Right-click to finalize the polygon.
Then verify that the polygon is assigned to the correct class by changing the MC ID. In the image below, the polygon being saved is assigned to the water class (MC ID 1).
Figure 14: ROI polygon class and MC ID information
Now click onicon in the SCP Dock to save polygons.
Figure 15: ROI polygon
Another option is to add a group of pixels as an ROI by clicking.Now click on a pixel on the map of a certain class. QGIS will automatically select surrounding pixels that have the same or similar reflectance values. Saving works the same as drawing polygons.
Figure 16: ROI by comparable pixels
Make at least 10 ROIs for each class. The more the better, but accuracy is important. If the pixels are assigned to the wrong class, the classification result is likely to be poor.
Figure 17: List of non-SCP Dock ROIs
Once the ROIs are created, they can be visualized in the spectral signature plot by highlighting the ROI and clickingThis is a useful tool for assessing the quality of a classification.
Figure 18: SCP: spectral signature diagram
The graph shows the ROI values for each wavelength. Dashed lines represent each band in the Landsat image. As you can see in this graph, water (blue) and forest (green) have very consistent values within their class, while the third class, non-forest, is much more heterogeneous. This can be explained by the wide variety of land cover that falls into this class, from agriculture to buildings. However, classes where the ROIs have very similar values are preferred as this increases the classification accuracy.
Another way to estimate ROI is to create an example ranking. Do it by clickingon the SCP toolbar and click an area on the map. This area is now classified so that the accuracy of the results can be assessed. The image below shows an example display.
Figure 19: Example of classification
if you are satisfied with the quality of the ROI, the classification can be performed for the whole image. In the SCP dock, go to the classification window.
Slika 20: SCP-dock
Make sure the MC ID is checked and the algorithm performs the minimum distance. Start sorting. This will create a layer for the entire area that looks like the preview and image below. The color can be changed in the layer properties window (right click on the layer > Properties > Symbology).
observing:In this best practice, the minimum distance algorithm was implemented because it gave better results. However, it is possible that in the second case the maximum likelihood algorithm gives better results. Therefore, it is advisable to run both algorithms and choose the one with the best results.
Figure 21: Land cover classification
Save the layer as a GeoTiff file by right-clicking on it and going to Export > Save As.
Repeat step 3 and step 4 for the second image. Check if this image is from the same satellite, from the same region, but at a different time. Also, make sure to recreate your list of macro classes in an identical fashion, using the same names, numbers, and MCIDs for each class as you did for the first image. Create a new ROI for your second image and reclassify it.
There are now two layers of classification. Make sure both are loaded in the QGIS Layers panel. Go to SCP > Post Processing > Change Land Cover.
Load the oldest classification layer as the reference classification and the newest classification as the new classification. Make sure the "report unchanged pixels" box is checked as this provides valuable information for interpretation. Then click Run.
Figure 22: The Land Cover Change tab of the SCP plugin
Figure 23: Results of land cover changes in SCP
The output window displays a table showing how many pixels have been changed for the second class. In this example, the change code 6 shows how many pixels have changed from forest (ReferenceClass 2.0) to non-forest (ReferenceClass 3.0), which represents deforestation.
QGIS also creates a change detection analysis layer. For this analysis, we want to focus primarily on forest land that becomes non-forest land. So we want to visualize the pixels that have changed from class 2 to class 3. Do this by going to properties > symbology. Change the display type to Palletized/Individual Values and click sort.
Figure 24:Properties of layers, symbolism
Since we are only interested in Change Code 6, change all other colors to black and select the desired color for 6. Click Apply and OK.
Figure 25: Map of the results of land cover change
This produces an output where only the pixels that have been cropped are highlighted. The layer can be saved and exported or further processed into a map in QGIS.