An end-to-end remote sensing & machine learning system for tracking urban vegetation health, land-use change, and ecological disturbances using multi-spectral satellite imagery.
π Quick Start Β· π Study Regions Β· ποΈ Architecture Β· π Results Β· π€ Contributing
- About The Project
- Key Features
- Sandbox Previews
- Tech Stack
- Architecture & Pipeline
- Study Regions
- Project Structure
- Quick Start
- Web Application
- HPC Training Workflow
- Evaluation Metrics
- Roadmap
- Contributing
- License
Urban Leaf Health Monitoring is a comprehensive, production-grade pipeline that leverages multi-spectral Sentinel-2 satellite imagery, deep learning, and an interactive Next.js web application to deliver actionable ecological intelligence for urban planning, conservation, and environmental monitoring.
The system solves a fundamental challenge in geospatial science:
How do we transform raw satellite data into a full machine-learning pipeline for pixel-level vegetation and disturbance segmentation at scale?
By integrating cloud-masked data ingestion from Google Earth Engine, a 14-channel Attention U-Net model, and a browser-based segmentation comparison tool, this project delivers a complete research-to-web workflow for monitoring forests, bushfire recovery, and urban encroachment across diverse geographic regions.
| Feature | Description |
|---|---|
| π°οΈ Multi-Spectral Ingestion | Pulls 10 Sentinel-2 bands + 4 computed indices (NDVI, EVI, SAVI, BSI) via Google Earth Engine |
| βοΈ Cloud-Masked Pipeline | Strict QA60 cloud filtering ensures high-quality, cloud-free imagery |
| π¬ Attention U-Net | 14-channel input, 5-class dense prediction with attention gates for selective focus |
| π§ͺ Domain-Aware Augmentation | Spectral jitter, random band dropout, spatial transforms β purpose-built for satellite imagery |
| β±οΈ Temporal Analysis | Multi-year and event-window comparisons (pre/during/post disturbance) |
| π Interactive Web App | Side-by-side model comparison lab built with Next.js, WebWorkers, and canvas rendering |
| π₯οΈ HPC-Ready | Full PBS job scripts, environment setup, AMP training, and H100-optimized training loop |
| π¦ Dashboard-Ready Artifacts | Inference exports segmentation masks, overlays, JSON summaries, and GeoTIFFs |
Defining geographic bounding boxes for the Hasdeo study area inside Google Earth Engine.
Applying
QA60cloud and cirrus masking ensures downstream vegetation analysis is not polluted by cloud shadows.
NDVI-based degradation visualization exposing deforestation signals in the Hasdeo Forest between 2018β2023.
(Top) Cumulative forest loss chart across the Hasdeo timeline. (Bottom) Class separability matrix validating spectral feature quality.
The backend follows a clean 6-phase pipeline, each encapsulated in its own module:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Urban Leaf ML Pipeline β
βββββββββββββ¬ββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ β
β Phase 1 β Data Collection β GEE β 10 bands + 4 indices β GeoTIFF β
β Phase 2 β Preprocessing β Patch extraction (256Γ256, stride 128)β
β Phase 3 β Augmentation β Spatial + Spectral (SpectralJitter, β
β β β RandomBandDrop, flips, noise) β
β Phase 4 β Model β Attention U-Net (14ch in, 5-class out)β
β Phase 5 β Training β AMP, Cosine LR, Combined Dice+CE Loss β
β Phase 6 β Inference β Tiled prediction β mask/overlay/JSON β
βββββββββββββ΄ββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββ
Input: (B, 14, 256, 256) β 10 Sentinel-2 bands + NDVI, EVI, SAVI, BSI
Encoder: DoubleConv β Down β Down β Down β Down (bottleneck)
Decoder: Up + AttentionGate Γ 4
Output: (B, 5, 256, 256) β 5 land-cover classes
5 Output Classes:
- π³ Vegetation
- πΎ Sparse Vegetation
- π« Bare Soil / Rock
- ποΈ Built-up / Urban
- π§ Water / Shadow
Loss: 50% CrossEntropy + 50% Dice Loss β balances pixel accuracy with region-overlap quality.
| Region | Focus | Time Range |
|---|---|---|
| π² Hasdeo Forest, India | Mining-driven deforestation, NDVI degradation signals | 2018 β 2024 |
| ποΈ Sydney Blue Mountains Fringe, AU | Urban expansion, ecological boundary shifts | Multi-year |
| π₯ Kangaroo Island, AU | Black Summer bushfire impact & post-fire recovery | 2020 β 2021 |
Urban-Leaf-Health-Monitoring/
β
βββ π app/ # Next.js 14 Web Application
β βββ segmentation-lab/ # Side-by-side segmentation comparison UI
β β βββ page.tsx # Main page with upload, sample selector, KPIs
β β βββ segmentation.worker.ts # Web Worker β runs pixel classification off main thread
β βββ hypothesis/ # Hypothesis/analysis pages
β βββ recommendation/ # Recommendation pages
β βββ api/ # Next.js API routes (asset serving)
β βββ globals.css # Global CSS design system
β βββ layout.tsx # Root layout
β
βββ π h100_config/ # Core ML Pipeline (HPC-ready)
β βββ 01_data_collection.py # GEE Sentinel-2 data collection
β βββ 02_preprocessing.py # Patch extraction, normalization
β βββ 03_augmentation.py # Spatial + spectral augmentation
β βββ 04_model.py # Attention U-Net architecture + losses
β βββ 05_train.py # Training loop (AMP, checkpointing)
β βββ 06_predict_visualize.py # Inference, mask/overlay export
β βββ setup_env.sh # HPC environment setup
β βββ job_cpu.pbs # PBS CPU job script
β βββ job_gpu.pbs # PBS GPU job script
β βββ LOCAL_TEST.py # Local pipeline test runner
β
βββ π scripts/ # Research Notebooks & Analysis
β βββ 01_area_of_interest_selection/ # ROI selection notebooks
β βββ 02_comparison_based_on_events/ # Event-window comparison (bushfire, mining)
β βββ 03_comparison_based_on_years/ # Multi-year temporal analysis
β βββ 04_data_agumentation/ # Augmentation experiments
β βββ 05_data_modelling/ # Model training notebooks
β
βββ π data/ # Earth Engine exports & datasets
β βββ 01_area_of_interest_selection_using_sampling/
β β βββ batch_1/ # Hasdeo Forest dataset
β β βββ batch_2/ # Sydney Blue Mountains dataset
β β βββ batch_3/ # Kangaroo Island dataset
β βββ 02_comparison_based_on_events/
β βββ event_1/ # Hasdeo event CSVs and TIFF exports
β βββ event_2/ # Additional event data
β
βββ π assets/ # Visualizations & project media
β βββ plots/ # Result plots (plot_1.png β¦ plot_10.png)
β βββ year_wise_comparison/ # Year-over-year forest change charts
β βββ presentation_images/ # Key images (NDVI, cloud removal, ROI)
β βββ ppts/ # Presentation PDFs
β
βββ π docs/ # Technical documentation
β βββ Urban_Leaf_Model_Pipeline_Guide.md
β βββ Urban_Leaf_Web_Project_Guide.md
β
βββ package.json # Node.js dependencies
βββ requirements.txt # Python dependencies
βββ next.config.mjs # Next.js configuration
βββ tsconfig.json # TypeScript configuration
βββ README.md
- Node.js
18+β for the web application - Python
3.9+β for the ML pipeline - pip / conda β for Python dependency management
- Google Earth Engine account β for data collection
git clone https://github.com/vijaysolanki9079/Urban-Leaf-Health-Monitoring.git
cd Urban-Leaf-Health-Monitoring# Install Python dependencies
pip install -r requirements.txt
# Authenticate with Google Earth Engine
earthengine authenticate# Install Node.js dependencies
npm install
# Run the development server
npm run devOpen http://localhost:3000 to view the Segmentation Lab and interactive comparison tools.
The web application provides an interactive Segmentation Comparison Lab that:
- π€ Accepts user-uploaded PNG / JPEG / WebP images (up to 30 MB)
- π Runs two segmentation engines simultaneously in a dedicated Web Worker (keeps the UI fully responsive)
- π¨ Renders colour-coded segmentation masks and overlays using the Canvas API
- π Displays class distribution bars and 4 derived scene indicators β Canopy Cover, Built-up Share, Exposed Surface, Water/Shadow
- πΌοΈ Includes 3 preloaded sample scenes from the Hasdeo and Kangaroo Island datasets
npm run dev # Development server (hot reload)
npm run build # Production build
npm run lint # ESLint check
npm run typecheck # TypeScript type checkFor running the model training pipeline on an HPC cluster (PBS/Slurm):
cd h100_config
# 1. Set up the environment
bash setup_env.sh
# 2. Submit CPU preprocessing job
qsub job_cpu.pbs
# 3. Submit GPU training job
qsub job_gpu.pbsManual training and inference:
# Train the Attention U-Net
python h100_config/05_train.py \
--data-dir /path/to/augmented \
--model-dir /path/to/models \
--results-dir /path/to/results
# Run inference & export visualizations
python h100_config/06_predict_visualize.py \
--checkpoint /path/to/models/best_model.pth \
--input /path/to/processed \
--output-dir /path/to/results/inferenceTraining outputs:
best_model.pthβ best checkpoint by validation mIoUtraining_history.json/.csvβ full loss/metric historypseudo_label_distribution.jsonβ class imbalance report*.pngoverlays,*.tifmasks,*.jsonsummaries from inference
H100 optimizations enabled:
- β TF32 matmul & cuDNN
- β cuDNN benchmark mode
- β AMP with GradScaler
- β Gradient accumulation & clipping
- β Cosine annealing LR schedule
| Metric | Type | Purpose |
|---|---|---|
| mIoU | Segmentation | Mean Intersection over Union β primary quality metric |
| Dice Coefficient | Segmentation | Region-overlap quality across all classes |
| Pixel Accuracy | Classification | Fraction of correctly classified pixels |
| Precision / Recall | Classification | Per-class accuracy analysis |
| Confusion Matrix | Classification | Full inter-class error breakdown |
| Land-cover loss % | Temporal | Quantitative deforestation / recovery tracking |
- GEE-based Sentinel-2 data collection
- Cloud masking & valid-pixel filtering
- Patch extraction & radiometric normalization
- Spectral augmentation pipeline
- Full local sync of 1,000+ Hasdeo GeoTIFF files
- Spectral indices: NDVI, EVI, SAVI, BSI, NBR
- Attention U-Net implementation
- AMP training with checkpointing and resume
- Expert ground-truth masks & final benchmark metrics
- Hasdeo mining event comparison (2022 window)
- Monthly/seasonal time-series exports
- Inference masks, overlays, GeoTIFFs & JSON summaries
- Live checkpoint integration into web segmentation page
Contributions are very welcome! Whether it's selecting new study regions, improving the augmentation pipeline, or enhancing the web UI β feel free to get involved.
- Fork the repository
- Create your feature branch:
git checkout -b feature/your-feature - Commit your changes:
git commit -m 'feat: add your feature' - Push to the branch:
git push origin feature/your-feature - Open a Pull Request
This project is licensed under the MIT License β see the LICENSE file for details.
MIT License
Copyright (c) 2026 Vijay Solanki
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
Made with πΏ by Vijay Solanki
β Star this repository if you found it useful!


