Landscape change analysis with MOLUSCE - methods and algorithms

Материал из GIS-Lab
Перейти к навигации Перейти к поиску

Terminology used in this document

  • MOLUSCE is a QGIS plugin for Land Use Change Evaluation. MOLUSCE stands for Methods Of Land Use Chande Evaluation. Briefly, tThe plugin performs the following process:
  1. Takes raster of land use categories for the past time, raster of land use categories for the present time and rasters of explanatory variables or factors.
  2. Trains a model that predicts land use changes.
  3. Predicts future land use changes via model, current state of land use and current factors.
  • Model is an algorithm that is used for prediction of land use changes (transitions).
  • State raster is one-band raster that contains landuse categories encoded in the raster's pixels.
  • Input state raster is one-band raster that contains landuse categories of the past. It is an input for used model.
  • Factor rasters are rasters of explanatory variables. The rasters can be one-band or multy-band. These are inputs for used model.
  • Output state raster is one-band raster that contains landuse categories of the present. It is the desired result of prediction for model (a user trains the model to predict (input raster, factors) -> output raster).
  • Transition is a information about land use change. Every change (for example forest -> non-forest) can be viewed as a transition of land use categories (encoded as pixels) from Input state raster to Output state raster.
  • Change map is a one-band raster that stores information about transitions.

General structure of the plugin

MOLUSCE consists of several parts. The most important are:

  • GUI modules - implement user interface
  • Utility modules
    • Data Provider - provides procedures for reading/writing raster data and similar utility functions
    • Cross Tabulation - provides functions for creating contingency tables
    • Sampler - provides sampling procedure
  • Algorithmic modules:
    • Area Analysis - provides procedures of change searching, making change maps
    • Modeling - provides submodules for modeling relation between input-output data
    • Simulation - provides procedure of land change simulation
    • Validation - provides statistic functions and procedures for validation of simulation result

This manual gives general overview of the modules. The description is valid for structure of plugin version <= 1.x.x

Utility modules

Utility modules are used in many other modules of the plugin. The most important utility modules such as DataProvider and Sampler are discussed in this section.

Data Provider

This module provides data structure for internal storing of raster data. It uses numpy masked arrays as data store. Data Provider provides methods for:

  • Creation and storing rasters: reading data from file and manage no-data values, creating new rasters, saving data.
  • Access to the data and data manipulation: Read particular raster band, replace a band by new array of pixels, get statistics of raster's bands, normalize the data for particular algorithm, reads geometry and geography related information from the raster variable, etc.
  • Comparing geodata objects: check raster sizes, projections and geo transform objects between rasters.

Sampler

Sampler is the module that performs sampling procedure. A sample is a set of input data and corresponding output data that has to be predicted via a model.

Sampler works with single pixels and a neighborhood of pixels. This is means that a user can take into account a set of pixels around current pixel. The implementation of the algorithm uses square neighborhood. For example if the user set up 1-size neighborhood then sampling procedure reads the current pixel and all pixels located immediate vicinity (3x3 window size). If the user set up 2-size neighborhood then sampling procedure reads the current pixel and all pixels located in 5x5 window size and so on. Every neighborhood is stored as vector (9 elements, 25 elements and so on). That sampling is performed for every input raster (initial state raster and factors).

Therefore, a sample contains:

  • coordinates of the pixel,
  • input data (consists of 2 parts):
    • state pixel vector is the neighborhood that is read from 1-band raster, this raster contains initial states (categories). The raster is divided into set of dummy variables before sampling (see below).
    • factor pixel vectors are the neighborhoods extracted from factor rasters (they can be multiband).
  • output data is read from 1-band raster, this raster contains final states.

There are several sampling modes:

  • "All". This mode allows store all pixels of the input and output rasters. The mode of sampling needs big amount of RAM and CPU time if input rasters are big.
  • "Random". This mode allows store random selected samples: if output raster (target raster) has N pixels, then the every pixel has probability of selection 1/N.
  • "Stratified". This mode allows undersampling of major categories and/or oversampling of minor categories. If C is desired count of samples and K is number of output categories, then the sampling procedure select K random groups of pixels of equal size C/K. Every group will contain pixels of one certain category.

Cross Tabulation

Cross Tabulation is a module that is used in several places of the workflow. The main purpose of the module is creating of contingency tables. For example it is used during creating of transition matrix. In this case the method calculates transition statistic -- how many pixels has been changed. The result is the table:

Category 1 Category 2 ... Category N
Category 1 Count of unchanged pixels of Category 1 Count of transition Category 1 - > Category 2 ... Count of transition Category 1 - > Category N
Category 2 Count of transition Category 2 - > Category 1 Count of unchanged pixels of Category 2 ... Count of transition Category 2 - > Category N
... ... ... ... ...
Category N Count of transition Category N - > Category 1 Count of transition Category N - > Category 2 ... Count of unchanged pixels of Category N

Algorithmic modules

Area Analysis

The main purpose of area analysis module is change map calculation. The module uses the next scheme of transition encoding:

Category 1 Category 2 ... Category N
Category 1 0 1 ... N -1
Category 2 N N + 1 ... 2N -1
... ... ... ... ...
Category N (N-1)*N (N-1)*N + 1 ... N*N -1

For example, if in the state rasters category "Forest" coded as "3", category "Non-forest" coded as "2", then transition "forest" -> "non-forest" in the change map will be coded as "7".

For example, for 4 classes (N=4), there are 4*4=16 possible transitions:

Agriculture Forest Urban Water
Agriculture 0 1 2 3
Forest 4 5 6 7
Urban 8 9 10 11
Water 12 13 14 15

Output of Area Analysis stage is a raster where each pixel is assigned an integer value indicating its transition.

Modeling

A user has a number of factors, init state raster and final state raster. The goal of modeling stage is to create a model that can predict land use changes. Before to discus partial predicting methods we need to explain the common preparing stage.

The first subsection of this section discuses types of input and output data and necessary manipulations with the data, the next subsections describe concrete realizations of predicting models.

Data types and initialization procedures

The next assumptions was used during developing:

  • Initial and final state rasters are categorical one-band rasters, therefore a change map is categorical one-band raster too.
  • Factor rasters are ordinal or continuous rasters (one-band or multiband), but not categoraical.

A user fits model to predict land use changes, therefore the user has initial state raster and factors as input data and the change map as target variable (initial states, factors -> change map).

Initialization of sampling procedure

Logistic regression and Multilayer perceptron predictors uses sampling procedure. This procedure collects samples that are used during fitting of the model. But Sampler collects transformed data, because usually the transformation allows achieve better fitting. MOLUSCE uses two transformations:

  • Dummy coding for categoracal variables.
  • Normalization for continuous and ordered variables.
Dummy coding

Because the initial state raster and change map are categorical data, and each of them must be transformed to set of independent variables. To do that the plugin uses dummy coding when a categorical variable of N levels is divided into N-1 dummy variables. For example, for 4 classes land use map (Agriculture, Forest, Urban, Water), we have to use 3 dummy variables:

Dummy 1 Dummy 2 Dummy 3
Agriculture 0 0 1
Forest 0 1 0
Urban 1 0 0
Water 0 0 0

One row (in this case Water) consists of zeros. It is important because otherwise the dummy variables became linear-dependent. The condition of linear independence of data is crucial for Logistic regression and strongly recommended for Multilayer Percepton.

Normalization

The next stage of initialization procedure is normalization of factor data. Usually normalization allows to achieve more efficient training and more accurate prediction result. Plugin uses linear normalization:

where X is a variable, is normalized variable, is mean of X and is standard deviation of X.

Multilayer perceptron

The plugin uses classic realization of Multilayer perceptron. The input data is a collection of pixels of initial state raster and factor rasters. The target output data is the change map. The plugin performs the next actions:

  1. Initial preprocessing of the data (dummy coding and normalization).
  2. Sampling.
  3. Training.

The initial stages are described in the previous section, this subsection discussed the structure of the neural net and the training procedure.

MOLUSCE uses multilayer percepron with numpy.tanh sigmoid function, therefore target variables should be scaled to (-1, 1) interval.

Logistic regression

Weight of evidence

Multi criteria evaluation

Simulation

Validation

Special topics

Memory Usage

Sampler uses approximately bytes of memory