Classification Exercise in envi
 
 
 

Geog2021

Lewis

RSU, Dept. Geography

Introduction

The aim of this practical is for you to gain experience in the supervised classification of Eath Observation (EO) imagery, using envi software. At the end of this practical, you should be able to analyse multispectral EO data for the purpose of classsification, derive statical descriptions of training classes, and apply these to achieve categorisation (classification) of the data.



Image data

Refer to the basic UNIX commands page for help if required. Type the following commands :  

machine% cd Data
machine% mkdir classification

machine%
cp ~plewis/classification/ETM-* classification
machine% cp ~plewis/classification/TM-*
classification
machine% cp ~plewis/classification/SRTM-2002*
classification
machine% cd classification
machine% ls -l ETM-* TM-* SRTM-2002*

-rw-r--r--   1 plewis   311040000 Sep 29 15:23 ETM-110801
-rw-r--r--   1 plewis       1237 Sep 29 15:24 ETM-110801.HDR
-rw-r--r--   1 plewis       3339 Sep 29 14:27 ETM-110801.sta
-rw-r--r--   1 plewis   51840000 Sep 29 15:20 SRTM-2002
-rw-r--r--   1 plewis        544 Sep 29 15:20 SRTM-2002.HDR
-rw-r--r--   1 plewis   311040000 Sep 29 15:22 TM-250792
-rw-r--r--   1 plewis       1195 Sep 29 15:25 TM-250792.HDR

The EO image data you are classifiying are:

1. TM-250792

Thematic Mapper data at 28.5 m resolution imaged on 25th July 1992 in 6 wavebands:

1
2
3
4
5
6
450-520 nm
520-600 nm
630-690 nm
760-900 nm
1550-1750 nm
2080-2350 nm

The extent of the imagery is (Lat/Lon):
62o 58' 27.57'' W  11o 1' 31.29'' S to
62o 1' 55.96 W 11o 57' 4.75 S

2. ETM-110801

Enhanced Thematic Mapper data at 28.5 m resolution imaged on 11th August 2001 in the same 6 wavebands over the same spatial extent.

Real colour composites of the images are shown below.

TM
etm
TM 27th July 1992
ETM 11th August 2001


3. SRTM DEM data

Digital Elevation model (DEM) data, obtained by RADAR interferometry from data on the SRTM (Shuttle Radar Topography Mission), are also available for the site. The data have been resampled to the same reolution and area as the TM/ETM data above.


SRTM DEM data

All data were obtained from the GLCF.

The area covered is in the region of Rondonia, Brazil, a region much studied using satellite data to monitor deforestation. A good example of this is shown on the USGS Earthshots site.



Map of region shown on right (from Earthshots)
 Satellite data 1975-1992 (from Earthshots)

It is very clear from the Earthshots Landsat imagery that the area viewed has undergone large scale deforestation from 1975 to 1992. The deforestation between 1992 and 2001 seen in the data you have for this practical appears to be not quite so dramatic, but land cover dynamics in the area are still of intense interest (e.g. Douglas et al. 2006).

See the references below for more information on using satellite data over the area. See also the LBA-eco website, which has a range of relevant public-access scientific datasets.

To complete the practical, you will need to perform the following tasks:

A. Examine the data and decide on classes
B. Define a series of ROIs (Regions of Interest).
C. Image Classification.


You should read over the envi help pages for classification for more detailed information on any aspect of  how to use the tools.

A. Examination of the data

Load up the two images and examine the data. Try to identify the various classes you might like to obtain for this exercise decide how you can identify them. Examine feature space plots (scatter plots) to help you decide what may be feasible (and what may not). You may decide that transformations of the data (e.g. band ratios or Principal Components) might aid your ability (and the computer's ability) to discriminate between classes.

Some examples of the various classes you might consider (shown on a standard False Colour Composite (FCC) image):

Urban

May also include other 'built' structures such as roads. You should be able to recognise these from their spatial structure, even at this resolution.

Forest

This should be easy to spot, but there are sometime clear 'shading' effects (as in this example) that might complicate classification.

Rocks

Rocks are quite easily identifiable in the FCC images. You would generally expect them to be static between the two dates.

Rivers

There are rivers and other water bodies in the scene, which you will be able to recognise by their shape. They will be difficult to use as training sites as they are quite narrow at this resolution.

Farmland

You will see a broad patchwork of areas that have been cleared of forest and used to graze cattle or raise crops.  The areas a quite easy to spot in the FCC images, but might represent a broad spectral class because of the various physical cover types involved.

other

You may spot some areas that have rather different spectral properties to most of the other areas. One example is shown here of field-shaped areas (green and purple areas) that might be inferred to be farmland, but are clearly different spectrally to other areas of farmland. We cannot really determine what these areas are from the information available, so you might require an 'other' class to cope with such eventualities.

cloud

The images may contain a small amount of cloud or smoke/haze, an example of which is shown here. They are quite easy to recognise visually in the FCC, but may be difficult to classify unless they are quite thick. If there are any thick clouds, you may see cloud shadows on the ground as well.


B. Defining spectral classes

In order to classify the image data you are required to define a set of "signatures" which represent each class. These are then used to "train" the classification algorithm.

In envi, you need to define these classes via ROIs (Regions of Interest). The tool for defining ROIs is:

Tools->Regions of Interest->ROI Tool ...



You can choose the type of ROI (polygon, rectangle, ellipse ...) from the ROI_Type menu in this tool. You can also choose whether the ROIs are to have a single part or  'multi' parts. To start with, just use the defaults.

Having decided which class you are going to define, change the ROI name to something to represent that class (e.g. 'forest') and choose a colour for that class. You draw the region with the left mouse button and close with the right button. Clicking the right mouse button again will 'fill' the region with the colour you have defined.
If you make a mistake, you can delete the ROI from the ROI tool.






You can add new regions ('New Region' button) and continue until you believe you have defined sufficient classes.

You can merge regions using Options->Merge Regions ....

You can examine the statistics of any (one or more) class(es) by selecting that class and clicking the 'Stats' button.

You can also compute a measure of separability between the ROIs that you have defined, using the selection: Options->Compute ROI Separability.... This outputs Divergence metrics between the classes you have defined. These values range between 0 and 2.0. As a guide to interpretation, values greater than 1.9 indicate good separability of classes. If class separability is less than this, you might consider splitting the classes for the classification and recombining them post-classification (e.g. have two classes: forest1 and forest2).


When you have a suitable set of ROIs defined, save them to a file via File->Save ROIs..., selecting which ROIs you want to include in this file:




C. Image Classification

Having defined a signature set for each class, you can now use these definitions to define a supervised classification. Various algorithms are available under the Classification->Supervised... menu of envi. As a start, you might like to consider a Maximum Likelihood classification:

Classification->Supervised...->Maximum Likelihood

First, select the image data you wish to classify. If you do not have an ROI file currently open, you will need to open this via the Open->ROI File... option.

You now need to:

a. Decide which classes to use in the classification (Select Classes from Region);

b. Set a probability threshold for the classification (if pixels have less than this probability of being any class, they will be unclassified). You can set a value of None if you like, but something like 75% (0.80) might be more appropriate (perhaps try 'None' first time around).

c. Set a name of output files (Output Result to File) for the Result image and probably the 'Rule image' as well.


 You can preview the result for a limited region (Preview button), then if that looks fine, click 'OK':




Processing the classification may take a while, so whilst you are learning about this, you may choose to work on an image subset (choose Subset Spatially when you choose the image file to use).

You should find an output classified image:


Along with the 'rule' image (if selected). You should examine both output datasets to guage why the classification has worked as it has (the lower the (-ve) value in 'rule' image, the less likely that pixel is to be the particular class, so you might for instance find some areas which are almost as likelt to be two or more different cover types).


After examining these results, you may wish to go back and redefine your classes or choose new classes. Equally, you may like to try out different classification algorithms. You might also try out some unsupervised classification methods and/or the SMACC Endmember Extraction routines in envi, which will attempt to automatically define a set of 'pure' spectral classes (see envi manual and tutorials).

You can output further information for analysis of the result via: Classification->Post Classification->Class Statistics.

D. Accuracy Assessment

Now that we have one (or more) classifications of the image data, you can employ the results to examine, e.g the change in the proportion of forest cover, urban area etc. between the two dates of imagery. To be able to properly assess such differences however, we should know something about the uncertainty associated with the classification.

This should involve access to an independent classification dataset for sample regions of the image. This is best backed up by visiting the area to confirm the classes attributed, but can be attempted solely from the image data if we are prepared to accept the viability of the operator (you!) manually assigning classes.

Envi is able to calculate a confusion matrix between two classified images or between a classified image and 'ground truth' ROIs. First then, you must generate the ROIs for this purpose.

Once you have this new (independent) ROI dataset, select: Classification->Post Classification->Confusion Matrix->Using Ground Truth ROIs.... Select first the classification image you wish to assess, then in the following dialogue match up the class names of the classified image and the 'ground truth' ROIs:


Clicking 'OK' through the next box results in the confusion matrix being dsiplayed. For example:

Confusion Matrix: /data/rsu_raid_0/plewis/public_html/geog2021/classificationPractical/result 
 
Overall Accuracy = (10287/10427)  98.6573% 
Kappa Coefficient = 0.9792 
 
                  Ground Truth (Pixels) 
    Class           Forest         Rock        Urban         Farm        Total 
 Unclassified            0            0            0            0            0 
Forest [Purpl         2140            0            0            3         2143 
Rock [Blue] 1            0         1337            0           59         1396 
Urban [White]            0            0         1421           64         1485 
Farm [Green]             0            1           13         5389         5403 
        Total         2140         1338         1434         5515        10427 
 
 
                 Ground Truth (Percent) 
    Class           Forest         Rock        Urban         Farm        Total 
 Unclassified         0.00         0.00         0.00         0.00         0.00 
Forest [Purpl       100.00         0.00         0.00         0.05        20.55 
Rock [Blue] 1         0.00        99.93         0.00         1.07        13.39 
Urban [White]         0.00         0.00        99.09         1.16        14.24 
Farm [Green]          0.00         0.07         0.91        97.72        51.82 
        Total       100.00       100.00       100.00       100.00       100.00 
 
 
 
        Class   Commission     Omission          Commission            Omission 
                 (Percent)    (Percent)            (Pixels)            (Pixels) 
Forest [Purpl         0.14         0.00              3/2143              0/2140 
Rock [Blue] 1         4.23         0.07             59/1396              1/1338 
Urban [White]         4.31         0.91             64/1485             13/1434 
Farm [Green]          0.26         2.28             14/5403            126/5515 
 
 
        Class   Prod. Acc.    User Acc.          Prod. Acc.           User Acc. 
                 (Percent)    (Percent)            (Pixels)            (Pixels) 
Forest [Purpl       100.00        99.86           2140/2140           2140/2143 
Rock [Blue] 1        99.93        95.77           1337/1338           1337/1396 
Urban [White]        99.09        95.69           1421/1434           1421/1485 
Farm [Green]         97.72        99.74           5389/5515           5389/5403 

You should make sure that you understand this form of output and what it is telling you about how well your classified image matched your independent 'ground truth' data. Make sure you understand the terms such as 'User' and 'Producer' accuracy and other reported statistics.

You might also like to examine various options for 'post classification filtering', such as clump and seive. See the envi manual for more details on these operators.

Visualisation

If you have time, you may like to visualise either the original data or the classified image overlain on the SRTM topography. To do this:

Topographic->3D Surface View

You may as well set the image resolution to 'full' here. You may also like to increase the vertical exaggeration for 'dramatic effect' (e.g. to 20). Using the tool should be relatively intuitive. If not, read the envi manual on this feature.


References and further Reading:

Cardille Jeffrey A. and Jonathan A. Foley Agricultural land-use change in Brazilian Amazônia between 1980 and 1995: Evidence from integrated satellite and census data Remote Sensing of Environment, Volume 87, Issue 4, 15 November 2003, Pages 551-562

Carlos M. Souza, Jr. Mapping land use of tropical regions from space PNAS 2006 103: 14261-14262

Daniel C. Nepstad, Adalberto Verssimo, Ane Alencar, Carlos Nobre, Eirivelthon Lima, Paul Lefebvre, Peter Schlesinger, Christopher Potter, Paulo Moutinho, Elsa Mendoza, Mark Cochrane, Vanessa Brooks Large-scale impoverishment of Amazonian forests by logging and fire Nature 398, 505 - 508 (08 Apr 1999) Letters to Editor

Douglas C. Morton, Ruth S. DeFries, Yosio E. Shimabukuro, Liana O. Anderson, Egidio Arai, Fernando del Bon Espirito-Santo, Ramon Freitas, and Jeff Morisette Cropland expansion changes deforestation dynamics in the southern Brazilian Amazon PNAS 2006 103: 14637-14641. 

Frohn Robert C. and Yongping Hao (2006) Landscape metric performance in analyzing two decades of deforestation in the Amazon Basin of Rondonia, Brazil Remote Sensing of Environment, Volume 100, Issue 2, 30 January 2006, Pages 237-251

Lu, Dengsheng, Emilio Moran and Mateus Batistella Linear mixture model applied to Amazonian vegetation classification Remote Sensing of Environment, Volume 87, Issue 4, 15 November 2003, Pages 456-469

Powell , R. L. , N. Matzke , C. de Souza, Jr. , M. Clark , I. Numata , L. L. Hess and D. A. Roberts Sources of error in accuracy assessment of thematic land-cover maps in the Brazilian Amazon Remote Sensing of Environment, Volume 90, Issue 2, 30 March 2004, Pages 221-234