datacube-classification is a Python package that allows the classification of data cubes through the datacube-stats tool of the Open Data Cube (ODC) ecosystem. This package implements the time series classification approach employed in the Brazil Data Cube (BDC) project, applied in several papers, and implemented through the SITS package .
This initiative aims to expand the use of this approach and make it available to the ODC community.
Inspired by the features provided by the SITS package, datacube-classification implements functions that allow extracting time series from the data cubes indexed in the ODC, temporal interpolation, and classification of the data cubes. Below, the functionalities are presented by categories:
Machine learning: In this category, features are present that allow data to create classification maps.
Time series extraction:
datacube_classification.sits.datacube_get_sits
.Training scikit-learn machine learning models:
datacube_classification.models.train_sklearn_model
Cloud removal based on a Fmask 4.x mask:
datacube_classification.cloud.cloud_mask
Temporal interpolation:
datacube_classification.interp.datacube_temporal_interpolate
Data cube classification:
datacube_classification.operations.classification.ScikitLearnClassifier
.Note that the classification-related functionality is currently implemented, expecting the use of scikit-learn models, but it is possible to extend this to the use of other packages. scikit-learn was initially applied because of its concise API, which has the same methods for all algorithms.
Post classification: After classification, it may be necessary to perform class smoothing. For this, in datacube-classification, the spatial smoothing function, implemented by Rolf Simoes in the SITS package, was imported.
- Bayesian smoothing:
datacube_classification.spatial_smoothing.bayes_spatial_smoothing
.
derived data cubes: In addition to the classification and post-processing features presented, the package also provides operations that allow derived cubes' creation. Currently implemented are:
Generation of fraction image cubes based on the linear spectral mixture model (MLME):
datacube_classification.operations.regression.SpatioTemporalLinearMixtureModel
.Generate spectral index cubes based on user-defined functions:
datacube_classification.spectral_index
The endmembers used in MLME were generated by Souza and Small (2017) and are valid only for Landsat-8/OLI data cubes.
Examples of using the package for each of the features listed above can be found in the examples directory. In the directory examples are available:
- Application of MLME for the generation of fraction cubes
- Training a machine learning algorithm
- Temporal interpolation
- Generation of spectral indices based on User-defined functions
- Classification of data cubes