- π Overview
- π°οΈ Project Context
- π§ System Architecture
- π Directory Structure
- π¦ Dataset
- π Pipeline Breakdown
- π Results & Metrics
- π§ Model Details
- βοΈ Technical Requirements
- π Usage
- π§Ύ Data Format
- π οΈ Troubleshooting
- β Best Practices
- π Citation
This repository presents a reproducible Earth Observation (EO) and Deep Learning pipeline for automated land-cover classification using Sentinel-2 RGB image patches and ESA WorldCover 2021 data.
The system enables:
- Automated geospatial data filtering
- Raster-based ground-truth label generation
- Supervised CNN training using ResNet-18
- Quantitative land-use and environmental analysis
The project is framed as an AI-based Geospatial Audit of the Delhi Airshed, suitable for research labs, environmental agencies, and policy analytics.
This work demonstrates how satellite imagery + deep learning can be leveraged for urban land-use monitoring and environmental auditing.
Data Sources
- Sentinel-2 (10m resolution RGB imagery)
- ESA WorldCover 2021 land-cover raster
- Delhi-NCR administrative boundary (EPSG:4326)
ββββββββββββββββββββββββββββββββ
β Delhi-NCR AOI (GeoJSON) β
ββββββββββββββββ¬ββββββββββββββββ
β
ββββββββββββββββββββββββββββββββ
β Spatial Grid (60Γ60 km) β
ββββββββββββββββ¬ββββββββββββββββ
β
ββββββββββββββββββββββββββββββββ
β Sentinel-2 RGB Image Chips β
β (128Γ128 @ 10m resolution) β
ββββββββββββββββ¬ββββββββββββββββ
β
ββββββββββββββββββββββββββββββββ
β ESA WorldCover Raster (10m) β
β β Mode-based Labeling β
ββββββββββββββββ¬ββββββββββββββββ
β
ββββββββββββββββββββββββββββββββ
β Clean Labeled Dataset (CSV) β
ββββββββββββββββ¬ββββββββββββββββ
β
ββββββββββββββββββββββββββββββββ
β ResNet-18 CNN (PyTorch) β
ββββββββββββββββ¬ββββββββββββββββ
β
ββββββββββββββββββββββββββββββββ
β Metrics: Accuracy, F1, CM β
ββββββββββββββββββββββββββββββββ
/Earth_Observation_Pipeline/
β
βββ data/
β βββ delhi_ncr_region.geojson
β βββ delhi_ncr_grid.geojson
β βββ worldcover_bbox_delhi_ncr_2021.tif
β βββ rgb/ # Sentinel-2 image patches (128Γ128)
β βββ image_coords.csv
β βββ imgs_within_grid.csv
β βββ labelled_images_clean.csv
β
βββ 01_grid_visualization.py
βββ 02_label_extract_assignment.py
βββ 03_train_test_split.py
βββ 04_cnn_train_eval.py
β
βββ requirements.txt
βββ README.md
Kaggle Dataset (Required): https://www.kaggle.com/datasets/rishabhsnip/earth-observation-delhi-airshed
Includes:
- Sentinel-2 RGB image patches
- Delhi-NCR shapefiles
- Image coordinate metadata
- Define AOI using Delhi-NCR boundary
- Generate a uniform 60 Γ 60 km grid
- Filter Sentinel-2 images by grid intersection
Script: 01_grid_visualization.py
- Extract raster patches from ESA WorldCover
- Assign land-cover class using mode-based sampling
- Handle missing data and edge effects
Script: 02_label_extract_assignment.py
- Remove invalid labels
- Perform stratified train-test split
- Analyze class distribution
Script: 03_train_test_split.py
- CNN: ResNet-18
- Input: Sentinel-2 RGB chips
- Metrics: Accuracy, F1 Score, Confusion Matrix
Script: 04_cnn_train_eval.py
(Representative β depends on training run)
- Overall Accuracy: ~75β85%
- Macro F1 Score: ~0.72β0.82
- Strong Performance: Urban, Vegetation, Water
- Challenges: Mixed land-cover and boundary regions
- Confusion Matrix
- Class-wise F1 Scores
- Correct vs Incorrect Prediction Visualizations
- Architecture: ResNet-18
- Framework: PyTorch
- Loss Function: Cross-Entropy
- Evaluation Metrics: Accuracy, F1 Score
- Python 3.8+
pip install geopandas numpy pandas rasterio shapely scipy \
matplotlib seaborn scikit-learn \
torch torchvision torchmetrics \
geemappython 01_grid_visualization.pypython 02_label_extract_assignment.pypython 03_train_test_split.pypython 04_cnn_train_eval.py| filename | lat | lon | label | class_str |
- Ensure all data paths are correct
- Run scripts in order
- Verify image presence in
rgb/
- Preserve intermediate outputs
- Validate class balance before training
- Track experiment configurations
Please cite the following if used in research or applications:
- ESA WorldCover 2021
- Copernicus Sentinel-2
- Relevant geospatial data providers
β If this repository helps your work, consider starring it!
