# SoilGuard AI Report - Land ReGen Hackathon 2025
## Project Overview
SoilGuard AI is an AI-powered Minimum Viable Product (MVP) designed to monitor and detect soil degradation and vegetation loss in Ngong Forest, Kenya, aligning with SDG 15: Life on Land. Developed during the Land ReGen Hackathon (October 8-13, 2025), this project leverages Sentinel-2 Surface Reflectance imagery to generate annual NDVI composites and employs a simple machine learning model to identify degradation hotspots.
## Objectives
- **Theme**: Early detection of soil degradation and vegetation loss.
- **ROI**: Ngong Forest (approx. bounding box: [36.73, -1.33, 36.76, -1.30]).
- **Timeframe**: 2018–2022 annual median composites.
- **Goal**: Provide client-ready insights for reforestation and sustainable land management planning.
## Methodology
### Data Collection
- **Source**: Sentinel-2 Level-2A Surface Reflectance (`COPERNICUS/S2_SR`) from Google Earth Engine.
- **Processing**:
- Filtered for <10% cloud cover.
- Applied cloud and shadow masking using QA60 and SCL bands.
- Computed median NDVI composites for each year (2018–2022) over the ROI.
### Analysis
- **NDVI Calculation**: `(NIR - Red) / (NIR + Red)` using B8 (NIR) and B4 (Red) bands.
- **ML Model**: A PyTorch-based DegradationClassifier with a sigmoid activation to flag areas with NDVI < 0.3 as degraded.
- **Visualization**: Interactive map layers via `geemap` and sample NDVI plots.
### Exports
- Annual NDVI GeoTIFFs (2018–2022) exported to `C:\Users\MWAHUNGAPC\Documents\Projects\PLP\hackerthon\Land degradation\code\`.
## Results
- **Image Count**: Varies by year (e.g., 2018: 50 images, 2022: 70 images) due to cloud cover.
- **Degradation Risk**: Sample 2022 analysis shows ~25.4% of the area at risk (NDVI < 0.3).
- **Visuals**: NDVI timelapse and sample plots generated for presentation.
## Visualizations
- **Map**: Interactive Ngong Forest NDVI layers (2018–2022) available in the `geemap` map. …