A machine learning-based land cover classification project that identifies Forest and Non-Forest regions on a university campus using Sentinel-2 satellite imagery and Google Earth Engine.
University campus region defined using a custom polygon boundary (centered at approximately 80.02°E, 23.17°N).
- Satellite: Sentinel-2 Surface Reflectance (
COPERNICUS/S2_SR_HARMONIZED) - Date Range: November 2025 - January 2026
- Cloud Filter: < 30% cloudy pixel percentage
- Cloud masking using QA60 band
- Median composite generation
- NDVI calculation:
(B8 - B4) / (B8 + B4)
Three classifiers trained on manually digitized points:
- Random Forest -
ee.Classifier.smileRandomForest(150) - SVM -
ee.Classifier.libsvm() - XGBoost -
ee.Classifier.smileGradientTreeBoost(10)
Labels:
- Forest = 1
- Non-Forest = 0
All models trained with 70/30 train-test split.
| Model | Algorithm | Accuracy | Kappa | Confusion Matrix |
|---|---|---|---|---|
| Random Forest | smileRandomForest(150) |
0.9230 | 0.8454 | [[20, 3], [0, 16]] |
| SVM | libsvm |
0.9574 | 0.9126 | [[19, 1], [1, 26]] |
| XGBoost | smileGradientTreeBoost(10) |
0.9761 | 0.9523 | [[20, 1], [0, 21]] |
Confusion Matrix Format:
[[TN, FP], [FN, TP]]
├── notebooks/
│ ├── random_forest/
│ │ └── forest_classification.ipynb
│ ├── svm/
│ │ └── forest_classification.ipynb
│ └── xg_boost/
│ └── forest_classification.ipynb
├── scripts/
│ └── classify_forest.py
├── .env
├── .gitignore
├── requirements.txt
└── README.md
- Python 3.10+
- Google Earth Engine account
-
Clone the repository
git clone <repository-url> cd <project-directory>
-
Create virtual environment & install dependencies
python -m venv .venv source .venv/bin/activate pip install -r requirements.txt -
Authenticate Earth Engine
earthengine authenticate
-
Configure environment
Create a
.envfile:EE_PROJECT_ID=your-earth-engine-project-id
jupyter notebookOpen any notebook in notebooks/ directory and run all cells.
python scripts/classify_forest.pyBinary classification map:
- 🌲 Dark Green = Forest
- ⬜ Light Gray = Non-Forest
Made with ❤️ using Google Earth Engine