
A comprehensive land use and crop classification workflow that utilizes machine learning for multi-year analysis using satellite imagery from both Sentinel-2 and Landsat. This workflow implements a Random Forest classifier trained on a single year's ground data to perform land use and crop classification across two decades of satellite data. The model leverages seasonal median composites and multiple vegetation indices to achieve robust classification performance.
The classification workflow requires the following inputs / configuration:
- Surface reflectance data: from Sentinel-2 (2018 - 2023) and Landsat 5, 7, 8, and 9 (2000 - 2023).
- Spectral Indices: derived layers including NDVI, NDWI, and EVI2.
- Training data: A single year of reference data collected in Morocco (see table below) was used to train the model for application across the full two-decade study period (2000 - 2023). This training data is also included as a publicly accessible GEE asset within the workflow.
|
Label |
Class |
Polygons No. |
Area (ha) |
|
0 |
Vineyard |
5 |
3.3 |
|
1 |
Bare ground |
129 |
3083.8 |
|
2 |
Green peas |
8 |
8.0 |
|
3 |
Olive trees |
72 |
80.0 |
|
4 |
Double-crop |
22 |
19.4 |
|
5 |
Alfalfa |
30 |
2.0 |
|
6 |
Faba beans |
3 |
1.8 |
|
7 |
Cereals |
6 |
3.4 |
|
8 |
Citrus trees |
33 |
104.2 |
|
9 |
Apricot trees |
4 |
8.4 |
|
10 |
Watermelon |
35 |
29.6 |
|
11 |
Water |
4 |
2.1 |
|
12 |
Rainfed crops |
24 |
66.2 |
- The Pre-processing / RF parameters are summarized as follows:
| Category | Parameter / satellite | Value |
| Number of trees | - | 50 |
| Variable per split | - |
Square root of the total by default |
| Predictor variables | S2 |
B2-8A, B11, B12, NDVI, EVI2, NDWI |
| Landsat |
B2-B7, NDVI, EVI2, NDWI | |
| Cloud masking | S2 |
65% threshold / cloud probability dataset. |
| Landsat |
65% threshold / Pixel-QA band. | |
| Image compositing | Number of composites |
6 |
| Days per composite |
45 days | |
| Statistical metric |
Median | |
| Period used |
January 1st to February 15th (DOY 1 to DOY 46), February 15th to April 1st (DOY 46 to DOY 91), April 1st to May 15th (DOY 91 to DOY 135), and May 15th to July 1st (DOY 135 to DOY 182), July 1st to September 15th (DOY 182 to DOY 258), September 15th to November 1st (DOY 258 to DOY 305). |
Two separate algorithms are provided to handle the different sensor characteristics:
- One algorithm for processing all Landsat imagery (2000 - 2023).
- A second algorithm for processing all Sentinel-2 imagery (2018 - 2023).
For users seeking to understand or replicate the workflow, comprehensive documentation is available in two forms:
- Step-by-step guide: a README.md file with a detailed, step-by-step explanation of the entire process.
- In-Code documentation: Every step of both algorithms is thoroughly explained through inline comments within the code itself.
- The research paper available at : sciencedirect.com