Skip to content

Repository files navigation

SylvaSense πŸŒ²πŸ›°οΈ

Planetary Earth Observation & Forest Carbon Intelligence Platform

Hackathon Track License Python FastAPI React Leaflet GEE


πŸ“– Overview

SylvaSense is an end-to-end Earth Observation (EO) and Geospatial AI platform designed for high-resolution forest canopy monitoring, automated tree crown detection, above-ground biomass (AGB) estimation, and verifiable IPCC Tier-1 carbon stock accounting.

By fusing multi-spectral optical data (Sentinel-2 L2A), Synthetic Aperture Radar backscatter (Sentinel-1 SAR C-Band), Global Ecosystem Dynamics Investigation (ETH Global Canopy Height / GEDI), and digital surface elevation (Copernicus DEM 30m), SylvaSense bridges the gap between raw orbital telemetry and actionable environmental intelligence.

                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                  β”‚      Planetary Multi-Sensor Inputs     β”‚
                  β”‚   Sentinel-2 (Optical/NDVI)            β”‚
                  β”‚   Sentinel-1 (SAR C-Band VV/VH)        β”‚
                  β”‚   ETH / GEDI 10m Canopy Height         β”‚
                  β”‚   Copernicus DEM 30m & Hansen GFC      β”‚
                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                     β”‚
                                     β–Ό
                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                  β”‚       AIML & Biomass Processing        β”‚
                  β”‚  β€’ DeepForest Canopy Cluster Detection β”‚
                  β”‚  β€’ Chave et al. Allometric Modeling    β”‚
                  β”‚  β€’ Trained XGBoost Biomass Regressor   β”‚
                  β”‚  β€’ IPCC Tier-1 Carbon & CO2-eq Math    β”‚
                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                     β”‚
                                     β–Ό
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚                                                           β”‚
       β–Ό                                                           β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     FastAPI Geo Microservice  β”‚           β”‚   React GIS Command Center    β”‚
β”‚  β€’ Zonal Statistics & Coverageβ”‚           β”‚  β€’ Interactive Freehand Draw  β”‚
β”‚  β€’ Dynamic Tile Server        │◄─────────►│  β€’ Live Layer Compositor      β”‚
β”‚  β€’ Real-Time GeoJSON Delivery β”‚           β”‚  β€’ Side-by-Side A/B Analysis  β”‚
β”‚  β€’ Executive Report Exporter  β”‚           β”‚  β€’ AI Environmental Copilot   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

✨ Key Capabilities & Features

  1. Multi-Sensor Earth Observation Telemetry

    • Sentinel-2 L2A: 10-meter true color (RGB) and Normalized Difference Vegetation Index (NDVI) layers for photosynthetic activity and canopy vigor.
    • Sentinel-1 SAR: Dual-polarization C-band backscatter ($VV$ and $VH$) capturing canopy structure, surface roughness, and moisture independence from cloud cover.
    • ETH Global Canopy Height (10m): GEDI-calibrated spaceborne LiDAR canopy elevation model.
    • Hansen Global Forest Change: 2000–2023 loss/gain masks for tracking historical deforestation trajectories.
  2. AI Tree Crown & Canopy Cluster Detection

    • Pretrained DeepForest neural architecture deployed over satellite and aerial orthomosaics.
    • Extraction of crown centroids, estimated canopy bounding geometries, and spatial density vectors delivered via standard GeoJSON.
  3. Scientifically Grounded Biomass & Carbon Accounting

    • Allometric Crown Modeling: Implementation of the peer-reviewed Chave et al. pan-tropical equation relating crown diameter and canopy height to Aboveground Biomass (AGB).
    • Trained Gradient Boosted Regressor: Custom XGBoost model incorporating multi-band reflectance and radar backscatter to estimate wood density and biomass variation.
    • IPCC Tier-1 Standards: Exact conversion factors yielding total Dry Biomass (Tons), Carbon Stock ($0.47 \times \text{Biomass}$), and $\text{CO}_2$ Equivalent ($\frac{44}{12} \times \text{Carbon}$).
  4. Dynamic User-Drawn Polygon Analysis

    • Built-in Leaflet-Draw toolbar allowing operators to trace custom freehand polygons or bounding boxes anywhere across supported forest zones.
    • Instant computation of clipped acreage, total tree counts, mean NDVI, biomass density (Tons/Ha), and sequestered carbon.
  5. A/B Degradation Comparison Engine

    • Direct side-by-side comparison between intact primary forest cores and adjoining degraded/edge zones (e.g., TapajΓ³s National Forest Core vs. Fragmented Edge).
    • Instant delta quantification showing percentage loss of canopy cover, net carbon emissions, and biomass displacement.
  6. Executive GIS Command Center UI

    • Clean, modern, dark-mode command interface built with React, Tailwind CSS, and Lucide icons.
    • Live layer toggles (Optical RGB, False-Color Infrared, NDVI, Sentinel-1 SAR, Canopy Height, Tree Clusters).
    • Integrated AI Forest Assistant for instant contextual querying and anomaly diagnosis.
    • One-click executive PDF / visual report generator.

πŸ”¬ Scientific Rigor & The "Honesty Metric"

Important

Resolution Transparency: DeepForest and similar computer-vision crown detectors are typically trained on sub-meter aerial / UAV drone imagery (~0.1 m/pixel). Standard Sentinel-2 optical data provides 10-meter spatial resolution.

In accordance with remote sensing best practices:

  • Detections over 10m Sentinel-2 data are calibrated and presented as canopy clusters / tree group centroids.
  • Aboveground Biomass and Carbon values utilize calibrated empirical models backed by spaceborne LiDAR (GEDI/ETH 10m height) and validated against benchmark study plots.
  • High-resolution aerial validation tiles demonstrate individual-tree delineation accuracy where high-resolution ground truth is available.

πŸ“Έ Interface Preview

GIS Command Map & Detections Dynamic Drawing & Zonal Analysis
GIS Command Map Dynamic Drawing Analysis
Biomass & Carbon Accounting Engine Side-by-Side A/B Degradation Comparison
Biomass Engine A/B Comparison

πŸ—ΊοΈ Pre-Configured Areas of Interest (AOIs)

SylvaSense includes fully cached, high-fidelity baseline packages across iconic global biomes:

AOI ID Name Biome / Description Bounding Coordinates
aoi_mudumalai Mudumalai Tiger Reserve (Tamil Nadu, India) Nilgiri Biosphere tropical deciduous & dry thorn forest corridor [76.50, 11.55, 76.65, 11.65]
aoi_1 Kudremukh National Park (Western Ghats, India) Shola-grassland tropical montane wet evergreen rainforest [75.20, 13.15, 75.30, 13.25]
aoi_2 TapajΓ³s National Forest Core (Amazon Basin, Brazil) Primary dense humid Amazonian tropical rainforest [-55.05, -3.10, -54.95, -3.00]
aoi_3 TapajΓ³s Agricultural Edge (Amazon Basin, Brazil) Fragmented forest fringe adjacent to agricultural clearance [-55.20, -3.25, -55.10, -3.15]

πŸ—οΈ Repository Architecture

SylvaSense/
β”œβ”€β”€ aiml/                               # AI/ML & Remote Sensing Pipeline
β”‚   β”œβ”€β”€ evaluate_accuracy.py            # Model precision & recall benchmark suite
β”‚   β”œβ”€β”€ evaluate_generalization.py      # Cross-biome generalization tests
β”‚   β”œβ”€β”€ gee_engine.py                   # Google Earth Engine telemetry integration
β”‚   β”œβ”€β”€ model_zoo.py                    # Model architectures & weights catalog
β”‚   β”œβ”€β”€ run_biomass.py                  # Allometric biomass & carbon estimation
β”‚   β”œβ”€β”€ run_depth.py                    # Canopy height & vertical profiling
β”‚   β”œβ”€β”€ run_detection.py                # DeepForest tree crown inference
β”‚   β”œβ”€β”€ run_pipeline.py                 # Multi-sensor ingestion & preprocessing
β”‚   β”œβ”€β”€ spatial_engine.py               # Vector topology & CRS coordinate math
β”‚   β”œβ”€β”€ train_biomass_model.py          # XGBoost biomass model training script
β”‚   └── model_cache/                    # Pretrained XGBoost models & metric weights
β”œβ”€β”€ backend/                            # FastAPI Geospatial Microservice
β”‚   β”œβ”€β”€ main.py                         # REST API endpoints & tile streaming
β”‚   β”œβ”€β”€ requirements.txt                # Python backend dependencies
β”‚   β”œβ”€β”€ test_api.py                     # API integration test suite
β”‚   └── gee-service-account.template.json # Template for Earth Engine credentials
β”œβ”€β”€ contracts/                          # Contract-Driven Integration Specs
β”‚   β”œβ”€β”€ aoi_config.json                 # AOI definitions, extents, and centers
β”‚   β”œβ”€β”€ api_spec.yaml                   # OpenAPI 3.0 specification
β”‚   β”œβ”€β”€ geojson_schema.md               # Standardized detection schema
β”‚   └── stats_schema.json               # JSON schema for biomass/carbon responses
β”œβ”€β”€ data/                               # Cached Datasets & Reports
β”‚   β”œβ”€β”€ processed/                      # Precomputed GeoJSONs, stats, depth profiles
β”‚   └── thumbnails/                     # AOI preview imagery
β”œβ”€β”€ docs/                               # Documentation & Visual Assets
β”‚   └── screenshots/                    # High-resolution dashboard screenshots
└── frontend/                           # React + Leaflet Web Application
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ components/                 # UI components (Map, Sidebar, Panels)
    β”‚   β”œβ”€β”€ App.jsx                     # Master application shell & state
    β”‚   └── main.jsx                    # Application entrypoint
    β”œβ”€β”€ package.json                    # Frontend dependencies
    └── vite.config.js                  # Vite configuration

πŸš€ Quick Start Guide

Prerequisites

  • Python 3.10+
  • Node.js 18+ & npm
  • (Optional) A Google Earth Engine active service account or account credential for live planetary tile streaming. (SylvaSense runs seamlessly in offline cached mode out of the box).

1. Backend Setup

# Navigate to the backend directory
cd backend

# Create and activate a Python virtual environment
python -m venv venv

# On Windows:
.\venv\Scripts\activate
# On macOS/Linux:
# source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# (Optional) Setup GEE credentials if running live planetary queries
# Copy gee-service-account.template.json to gee-service-account.json and fill in your keys

# Start the FastAPI server
uvicorn main:app --reload --host 0.0.0.0 --port 8000

The backend documentation will now be available at http://localhost:8000/docs.


2. Frontend Setup

# In a new terminal window, navigate to the frontend directory
cd frontend

# Install dependencies
npm install

# Start the development server
npm run dev

Open your browser and navigate to http://localhost:5173 to access the interactive GIS Command Center.


3. Running Verification Tests

To verify that all API endpoints, cached AOIs, GeoJSON layers, and analytical calculations are operational:

cd backend
python test_api.py

πŸ”Œ API Reference Overview

Method Endpoint Description
GET /api/health Service health status and list of ready cached AOIs
GET /api/aois List all configured Areas of Interest with bounding boxes
GET /api/aois/{aoi_id}/stats Fetch tree count, AGB (Tons), Carbon, and $\text{CO}_2$ metrics
GET /api/aois/{aoi_id}/detections Fetch canopy crown features in GeoJSON format
GET /api/aois/{aoi_id}/layers/{layer} Retrieve optical RGB, NDVI, or SAR radar raster assets
GET /api/aois/{aoi_1}/compare/{aoi_2} Calculate comparative deltas (degradation %, biomass loss)
GET /api/coverage Supported satellite capture corridors footprint (GeoJSON)
POST /api/analyze/polygon Compute real-time biomass & tree counts for user-drawn geometries
GET /api/gee/status Current status of Google Earth Engine authentication

Full OpenAPI specification is available in contracts/api_spec.yaml or at /docs.


πŸ“Š Evaluation & Benchmarks

SylvaSense includes automated evaluation suites to benchmark detection quality and biomass estimation:

  • Accuracy Benchmarks (aiml/evaluate_accuracy.py): Measures IoU, precision, recall, and F1 score against annotated forest canopy plots.
  • Generalization Tests (aiml/evaluate_generalization.py): Validates model stability across diverse forest strata (evergreen rainforest vs. dry deciduous vs. fragmented margins).
  • Results are automatically generated and preserved in data/processed/evaluation_report.json.

πŸ‘₯ Contributors & Hackathon Submission

Developed for Orion 1.0 '26 Hackathon β€” Problem Statement PS-03 (Earth Observation AI Track).


πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages