Monitoring Changes in the Amazon Rainforest: a Tutorial Using the Semi-Automatic Classification Plugin


Forest is defined as 'land spanning more than 0.5 hectares with trees higher than 5 meters and a canopy cover of more than 10 percent, or trees able to reach these thresholds in situ. It does not include land that is predominantly under agricultural or urban land use'  (FAO 2010, Global Forest Resources Assessment 2010 Main report).
This is a tutorial about the land cover monitoring of forests, using the Semi-Automatic Classification Plugin for QGIS. In particular, we are going to classify two Landsat images acquired over the Amazon Rainforest, in Rondônia (Brazil), in 1985 and 2013.

Before the tutorial, please watch the following video that illustrates the study area and provides very useful information about the deforestation (by ESA Earth from Space which broadcasts new videos every Friday). Also, a description and an animation of the area that we are going to classify is available here.




As shown in the previous video, in 1985 the study area was mainly covered by forest, and it has been affected by intense deforestation. We are going to classify a Landsat 5 image acquired in 1985 and a Landsat 8 image acquired in 2013 (available from the U.S. Geological Survey), in order to assess land cover change using a semi-automatic approach.

First, download the Landsat 5 image from here and the Landsat 8 image from here. The Landsat 5 image includes the bands described in the following table (each band is a single 8 bit raster).

Band ID Landsat 5 Band Number Spectral Range
1 Band 1 Blue
2 Band 2 Green
3 Band 3 Red
4 Band 4 Near-Infrared
5 Band 5 Short Wavelength Infrared 1
6 Band 7 Short Wavelength Infrared 2


The following table illustrates the bands included in the Landsat 8 image (each band is a single 16 bit raster).

Band IDLandsat 8 Band NumberSpectral Range
1Band 2Blue
2Band 3Green
3Band 4Red
4Band 5Near-Infrared
5Band 6Short Wavelength Infrared 1
6Band 7Short Wavelength Infrared 2

The following are the main classification steps:
  1. Conversion of raster bands from DN to Reflectance for the Landsat 5 image;
  2. Creation of the ROIs and spectral signatures for the Landsat 5 image;
  3. Classification of the Landsat 5 image;
  4. Conversion of raster bands from DN to Reflectance for the Landsat 8 image;
  5. Creation of the ROIs and spectral signatures for the Landsat 8 image;
  6. Classification of the Landsat 8 image;
  7. Calculation of the land cover change from 1985 to 2013.

The main approach is to classify Forest (e.g. trees), Non-Forest (e.g. bare soil, grassland, artificial areas), and surface water.
This tutorial will focus on the land cover change assessment; for detailed instructions about land cover classifications using the SCP see my previous post.
Following, the video of this tutorial and the description of the phases.


    1. Conversion of raster bands from DN to Reflectance for the Landsat 5 image

    The conversion of raster bands to surface reflectance, performing the image-based atmospheric correction using the DOS1 method, aims to improve the classification results.

    Steps:
    • Open QGIS and start the Semi-Automatic Classification Plugin;
    • In the main interface select the tab Pre processing > Landsat;
    • Select the directory that contains the Landsat 5 bands (and also the required metafile MTL.txt), and select the output directory where converted bands are saved;
    • Check the option Apply DOS1 atmospheric correction, and click Perform conversion to convert Landsat bands to reflectance (leaving checked Create Virtual Raster);
    SCP tab Landsat
    • At the end of the process, converted bands are loaded in QGIS. Also, a virtual raster named landsat.vrt is loaded (containing all the Landsat bands converted to reflectance);
    • Select the Landsat virtual raster, left click and open its properties; in Style select band 4 (i.e. Near-Infrared) for the red band, band 3 (i.e. Red) for the green band, and band 2 (i.e. Green) for the blue band.
    Landsat virtual raster properties

    The result of the color composite is shown in the following image.

    Landsat color composite RGB=543

    2. Creation of the ROIs and spectral signatures for the Landsat 5 image

    After the definition of the input image (i.e. the Landsat 5 bands), the training shapefile (for the ROI collection), and the signature list file (which stores the spectral signatures calculated from ROIs or imported from other sources) as described here (step 2), we need to create ROIs over the image.

    Steps:
    • In the dock ROI creation click the button + beside Create a ROI and then click a forest area (red pixels); alternatively, click the button  and draw a ROI on the image (left click on the image to define the ROI vertices and right click on the image to define the last vertex and close the polygon);
    • Under ROI Signature definition type a brief description of the ROI inside the field Class Information and Macroclass Information, and assign a Macroclass ID and Class ID;
    • In order to save the ROI to the training shapefile click the button Save ROI to shapefile; if the checkbox Add sig. list is checked, then the spectral signature is added to the Signature list table;
    • Define the class color with a double click on the Color column in the Signature list.
    Example of ROI collected

    Repeat the above steps for every land cover class (forest and non-forest), and assign to each ROI a new incremental class ID, and the following macroclass IDs: 
    • Forest (e.g. trees): MC ID = 1 
    • Non-Forest (e.g. bare soil, grassland, artificial areas): MC ID = 2
    • Water (e.g. surface water): MC ID = 3
    Following, a few examples of ROIs created for these land cover classes.
    Non-Forest: low vegetation

    Non-Forest: bare soil

    Forest: sparse trees

    Water: surface water

    3. Classification of the Landsat 5 image

    SCP allows for classification previews that show very rapidly the classification results in small areas.
    Classifications previews are useful during the collection of ROIs, and for the selection of the more accurate spectral signatures.

    Steps:
    • In the dock Classification, under Classification preview set Size = 500 (i.e. the side of the classification preview in pixel unit); check Use Macroclass IDand select the Maximum Likelihood algorithm; click the button + and then click on the image; after a few seconds, the classification preview will be displayed;
    Classification preview
    • In order to perform the final classification, click the button Perform classification and select where to save the output (e.g. classification_1985.tif).
    Land cover classification

    The classification process can take a few minutes.
    You can download the Landsat 5 classification, the ROIs, and the Signature file from here.

    4. Conversion of raster bands from DN to Reflectance for the Landsat 8 image

    Now, we convert the Landsat 8 bands to surface reflectance, performing the DOS1 atmospheric correction, as we did for the Landsat 5 image; see the step 1 of this tutorial. It is recommended to open a new QGIS project for processing Landsat 8.

    Landsat image 2013
    Tip: in order to show you the potential of the SCP, you can open the signature file created with the 1985 image, and try to perform a classification on the 2013 image; the results is quite good. However, we need to collect new ROIs on the Landsat 8 image because its sensor is different from Landsat 5.

    5. Creation of the ROIs and spectral signatures for the Landsat 8 image

    As we did in step 2 of this tutorial, we need to define the input image, the training shapefile, and the signature list file.
    Then, we can collect ROIs and spectral signatures for the following macro classes:
    • Forest (e.g. trees): MC ID = 1 
    • Non-Forest (e.g. bare soil, grassland, artificial areas): MC ID = 2
    • Water (e.g. surface water): MC ID = 3

    Collection of ROIs and spectral signatures

    6. Classification of the Landsat 8 image

    After a few previews, when the result is good, we can perform the land cover classification as in step 3 of this tutorial.

    Steps:
    • In order to perform the final classification, select the Maximum Likelihood algorithm and click the button Perform classification and select where to save the output (e.g. classification_2013.tif).
    Land cover classification 2013

    Depending on your computer specs, the classification process can take a few minutes.
    You can download the Landsat 8 classification, the ROIs, and the Signature file from here.

    7. Calculation of the land cover change from 1985 to 2013

    In order to assess the land cover change we need to compare the two classifications and calculate the number of pixels that change from one class to another one. SCP has a tool for the automatic calculation of land cover change.

    Steps:
    • Open the classification_1985.tif in QGIS;
    • Select the tab Post processing > Land cover change of the SCP Main interface;
    • Select the classification_1985.tif as reference classification, and select classification_2013.tif as new classification; uncheck the checkbox Report unchanged pixels, and click the button Calculate land cover change; select where to save the land cover change raster (in addition, a file .csv will be saved in the same directory, containing the statistics of the classes of change);
    SCP tab Land cover change
    • After a few seconds the land cover change raster will be displayed in QGIS; in the tab Land cover change the statistics of the classes of change are displayed.
    Land cover change raster

    You can download the land cover change raster from here.
    As we can see in the land cover change raster, a vast area has been deforested during the last decades. Following the table that illustrates all the land cover change classes. We can estimate that about 1600km2 of forest were lost in about 30 years (change code 1). Large part of this area has agricultural use now.

    Change Code
    Reference Classification (MC ID)
    New Classification (MC ID)
    Pixel Sum
    Area (km2)
    1
    1
    2
    1802509
    1622,3
    2
    1
    3
    496
    0,4
    3
    2
    1
    40907
    36,8
    4
    2
    3
    49
    0,0
    5
    3
    1
    502
    0,5
    6
    3
    2
    138
    0,1

    These figures are the result of a tutorial about land cover change monitoring and of course are affected by errors; for a better estimation we would need several ROIs for each class, considering their spectral variability, and field data for improving the collection of ROIs and spectral signatures.
    However, monitoring changes in rainforests can be affordable and reliable using free Landsat images, which provide an invaluable source of information through the decades. In addition, the use of semi-automatic classifications allows for very rapid land cover change assessment.
    For further information about mapping forest changes, please read this interesting article by NASA.

    In the next week tutorial I am going to describe the classification of hyperspectral data, which are images with hundreds of spectral bands allowing for the accurate identification of material spectral signatures.

    Please, remember that a Facebook group and a Google+ Community are available for sharing information and asking for help about the Semi-Automatic Classification Plugin.
    Newer posts Older posts