Gokul GopanContact
← Back to Projects
Sentinel-2 RGB composite of Munich with manually labelled training samplesRandom Forest land-cover classification of Munich

Supervised land-cover classification of Munich

Mapping urban land, bare or open land, water and vegetation from a May–September Sentinel-2 composite using Random Forest.

Sentinel-2 L2ARandom ForestGoogle Earth EngineRemote sensing

Objective

This project tests a transparent, four-class land-cover workflow for Munich: urban / built-up, bare / open land, water and vegetation. The goal is a concise, reproducible remote-sensing workflow rather than an authoritative production land-cover product.

Data. COPERNICUS/S2_SR_HARMONIZED Level-2A surface reflectance from May–September 2026 (91 scenes before compositing), cloud-screened with Google Cloud Score+ at a 0.60 clear-pixel threshold and aggregated as a growing-season median composite. The predictor stack combines B2, B3, B4, B8, B11, B12, NDVI and MNDWI.

RGB composite and classified map

The comparison below presents the supplied Earth Engine outputs with a portfolio-ready legend. The RGB source capture includes the manually labelled sample overlay; it has not been replaced with invented imagery.

Portfolio comparison of Munich RGB training samples and final land-cover classification
Sentinel-2 RGB composite with training samples (left) and the resulting four-class Random Forest map (right).

Method

Four land-cover classes were represented by 100 manually labelled reference points each. The 400 reference points were randomly divided into 276 training and 124 validation locations before Sentinel-2 predictor values were extracted. A 100-tree Random Forest with seed 42 was trained on the sampled training locations only.

Workflow from Sentinel-2 data through filtering, separate predictor extraction, Random Forest classification and held-out validation
Processing, separate sampling and held-out validation workflow implemented in Google Earth Engine.

View Google Earth Engine source ↗

Accuracy assessment

91.94%
Overall Accuracy
0.892
Kappa
124
Held-out validation samples
Held-out validation confusion matrix with 91.94 percent overall accuracy and 0.892 Kappa
Held-out validation result, with reference classes as rows and predictions as columns.
ClassProducer AccuracyUser Accuracy
Urban / Built-up90.9%90.9%
Bare / Open Land88.5%85.2%
Water92.1%100.0%
Vegetation96.3%89.7%

Model refinement

To address the urban–bare / open land confusion, NDBI and BSI were tested as additional predictors. Both received measurable Random Forest importance, but neither the held-out accuracy nor the confusion matrix changed. The simpler baseline model was therefore retained.

MetricBaselineEnhanced
Predictors810
Overall Accuracy91.94%91.94%
Kappa0.8920.892
Additional indices—NDBI, BSI
Out-of-bag error—10.1%
Final choiceRetained ✓Not retained
Enhanced Random Forest feature importance led by NDVI and near infrared
NDVI was the strongest enhanced-model predictor, followed by B8 near infrared. NDBI and BSI received non-zero importance but did not improve held-out performance, suggesting that much of their discriminatory information was already represented by the existing spectral predictors.

Interpretation

The strongest reciprocal confusion occurs between urban and bare / open land. Three urban reference samples were predicted as bare / open land, while three bare / open samples were predicted as urban. Water and vegetation show stronger separation, although three water validation samples were classified as vegetation. Vegetation achieved the highest producer accuracy at approximately 96.3%, while water achieved 100% user accuracy in the held-out validation sample. Fine-grained salt-and-pepper variation remains visible because this is a pixel-based classification without post-classification smoothing.

Limitations and tools

The reported accuracy is based on a random holdout of the original manually labelled reference points. The validation samples were excluded before predictor extraction and model training. However, because the training and validation locations originate from the same manually created sampling campaign and may be spatially close, the result should not be interpreted as a fully spatially independent accuracy assessment. A production workflow would use geographically independent validation data or external reference imagery.

Google Earth Engine · Sentinel-2 Level-2A · Cloud Score+ · Random Forest · JavaScript · Python · Matplotlib

Learning attribution: methodology informed by the Spatial Thoughts End-to-End Google Earth Engine course by Ujaval Gandhi.