Supervised Classification of Hyperspectral Data: a Tutorial Using the Semi-Automatic Classification Plugin for QGIS

This post is about the supervised classification of hyperspectral data using the  Semi-Automatic Classification Plugin for QGIS. In particular, we are going to classify a Hyperion image.
Hyperion is a NASA satellite launched in the frame of the EO-1 project. This hyperspectral satellite has hundreds of bands from the visible to the Short Wavelength Infrared, allowing for the identification of the spectral signatures of materials. Images have 30m resolution pixels (the same as Landsat) and cover a land area of 7.5 km by 100 km.
You can see an example of spectral signatures from Hyperion data in the following image.

Spectral signatures from an Hyperion image (available from the U.S. Geological Survey)

For more information about the Hyperion sensor see here. Hyperion images are freely available from the USGS EarthExplorer website.

In this tutorial we are going to classify the following land cover classes:
  • Class 1 = Vegetation (e.g. grassland or trees);
  • Class 2 = Soil (e.g. soil without vegetation);
  • Class 3 = Built-up (e.g. artificial areas, buildings and asphalt);
  • Class 4 = Water (e.g. surface water).

The following are the main classification steps:
  1. Definition of the input;
  2. Creation of the ROIs and spectral signatures for the image;
  3. Classification of the image.

Before starting this tutorial, if it is your first time using the Semi-Automatic Classification Plugin, please follow the basic tutorial here.
First, download the Hyperion sample (a subset of an image acquired over Rome in 2002) from here (available from the U.S. Geological Survey). Hyperion bands are in 16-bit radiance values.

1. Definition of the input

  • Load all the bands (.tif files) in QGIS; select all the bands in the menu Layers and click Group Selected, then uncheck the visualization of the group (this way QGIS visualization will be faster);
Hyperion bands
  • Open the virtual raster bands_14_22_30_49.vrt that includes bands 14 (Blue), 22 (Green), 30 (Red), and 49 (Near-Infrared); left click on the layer to open its Properties > Style, then select Band 4 for Red band, Band 3 for Green band, Band 2 for Blue band; click OK;
Virtual raster properties
  • Download the Band set file from here, which I previously created using the information from Hyperion Spectral Coverage; in the Band set tab click Import and select this file;
Band set tab
  • In the dock ROI creation click the button New shp, and select where to save the shapefile (for instance ROI.shp);
  • Click the button Save in the dock Classification, in order to create a signature list file (for instance SIG.xml).
SCP definition of input

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

  • In the dock ROI creation, check Rapid ROI on band and select one band (e.g. 30);  click the button + beside Create a ROI click on a red pixel (which is vegetation);after a few seconds the ROI polygon will appear over the image (a semitransparent orange 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 calculated (the mean of ROI pixel values for all the bands) and added to the Signature list table;
Example of ROI

Repeat the above steps for every land cover class, and assign to each ROI a new incremental class ID, and the following macroclass IDs:
  • Vegetation (e.g. grassland or trees): MC ID = 1
  • Soil (e.g. soil without vegetation): MC ID = 2
  • Built-up (e.g. artificial areas, buildings and asphalt): MC ID = 3
  • Water (e.g. surface water): MC ID = 4

It is interesting to see the spectral signature plot. In the Classification dock, highlight a few spectral signatures, and click the button .

SCP Spectral signature plot

3. Classification of the image

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

Download the final classification from here, including the ROIs and the Signature list files.

This post was mainly a demonstration about how to classify hyperspectral data; one of the main advantages of hyperspectral data is the possibility to identify also similar materials, because of the accurate identification of the spectral signatures thereof.

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