Skip to content
Β 
Β 

Repository files navigation

🦠 PathoWatch β€” Pathogen Risk Intelligence Platform

Real-time vegetation pathogen detection and human disease risk analysis using satellite imagery, spectral intelligence, and live environmental data.


🚨 Problem Statement

Every year, millions of people in India and across South Asia are affected by preventable diseases β€” malaria, dengue, cholera, typhoid, and respiratory illnesses caused by air pollution. At the same time, crop diseases silently devastate agricultural yields before farmers even notice symptoms on the ground.

The core problem is a lack of early, location-specific risk intelligence:

  • Farmers cannot detect vegetation stress before visible symptoms
  • Public health systems lack hyperlocal, real-time insights
  • Existing tools are expensive, slow, or too coarse
  • No unified platform combines environmental + health intelligence

πŸ’‘ Solution

PathoWatch is a unified platform that combines:

  1. Satellite-based vegetation pathogen detection
  2. Dynamic spectral intelligence using real scientific datasets
  3. Human disease risk scoring using live environmental data
  4. Actionable recommendations

🧠 PathoWatch – Complete Workflow (Simplified + Logical Flow)


πŸ”· 0. System Initialization (Backend Start)

  • Flask server starts
  • PathogenMonitoringSystem is initialized
  • Spectral library + detection models are loaded

πŸ‘‰ This prepares the system to process satellite images


🌍 MAIN WORKFLOW (5-Phase Pipeline)


🟒 PHASE 1: Data Infrastructure & Spectral Library

🎯 Goal:

Create reference β€œfingerprints” of diseases

βš™οΈ What happens:

  • Fetch real spectral data from USGS library

  • Generate synthetic pathogen signatures using:

    • Chlorophyll loss
    • Water stress
    • Leaf damage

πŸ“¦ Stored Signatures:

  • wheat_rust
  • rice_blast
  • late_blight
  • bacterial_blight

πŸ‘‰ Each pathogen has unique wavelength behavior


🟑 PHASE 2: Preprocessing (Cleaning Satellite Data)

🎯 Goal:

Make raw satellite data usable

βš™οΈ Steps:

1. Atmospheric Correction

  • Removes haze, dust, sunlight distortion
  • Uses Dark Object Subtraction

2. Noise Reduction

  • Smooth spectral values
  • Spatial filtering (Gaussian)

3. Dimensionality Reduction

  • Uses PCA
  • Reduces hundreds of bands β†’ important features

4. Feature Extraction

Calculates indices:

  • NDVI (vegetation health)
  • NDWI (water stress)
  • NDRE (disease stress)

πŸ‘‰ Converts raw image β†’ meaningful scientific data


πŸ”΅ PHASE 3: Detection (Core Intelligence)

🎯 Goal:

Detect disease patterns in pixels

βš™οΈ Techniques Used:

🧩 A. Spectral Angle Mapper (SAM)

  • Compares pixel spectrum with pathogen signature
  • Measures similarity (0 β†’ 1)

πŸ‘‰ If similar β†’ possible disease


🧠 B. 3D CNN (Deep Learning)

Uses:

  • Spatial info (image)
  • Spectral info (bands)

πŸ‘‰ Learns patterns automatically


πŸ” Hybrid Approach

  • SAM β†’ initial detection
  • CNN β†’ refinement

πŸ‘‰ Combines physics + AI


🟠 PHASE 4: Prediction & Monitoring

🎯 Goal:

Generate disease risk maps

βš™οΈ Steps:

  • Process hyperspectral image
  • Create similarity maps (per pathogen)

πŸ“Š Risk Levels:

  • πŸ”΄ High risk (> 0.7)
  • 🟑 Medium (0.4 – 0.7)
  • 🟒 Low (< 0.4)

πŸ“¦ Stored Outputs:

  • Risk maps (PNG)
  • Statistics
  • Trends

πŸ‘‰ Output = visual + numerical insights


πŸ”΄ PHASE 5: Validation & Quality Control

🎯 Goal:

Ensure reliability

βš™οΈ Metrics:

  • Spatial coherence
  • Signal-to-noise ratio (SNR)
  • Statistical consistency

🧠 Output:

  • Quality score

  • Recommendations:

    • Improve data
    • Increase resolution
    • Reduce noise

πŸ‘‰ Prevents false detections


πŸ”„ ADDITIONAL PIPELINE (Advanced ML Version)

βš™οΈ Enhancements:

  • SAM β†’ generates training labels

  • Feature extraction + PCA

  • Train models:

    • Random Forest
    • SVM
  • Ensemble prediction

πŸ‘‰ More accurate + adaptive system


🧬 Major Upgrade β€” Spectral Intelligence Pipeline (v2)

❌ Removed (Old System)

  • Hardcoded spectral dictionaries
  • Fixed wavelength arrays
  • Static thresholds
  • SAM-only detection

βœ… Added (New System)

  • 🌐 USGS spectral integration
  • πŸ“‘ Dynamic wavelength extraction
  • πŸ“Š Adaptive thresholding
  • πŸ€– Hybrid ML (RF + SVM)
  • βš™οΈ Configurable targets

🧬 Pipeline Flow

Input Raster
   ↓
Extract Wavelengths
   ↓
Fetch USGS Spectrum
   ↓
SAM Matching
   ↓
Dynamic Thresholding
   ↓
Feature Extraction
   ↓
ML Training
   ↓
Ensemble Prediction
   ↓
Risk Map Output

πŸ—οΈ Project Architecture

Pathowatch-repo/
β”‚
β”œβ”€β”€ server.py
β”œβ”€β”€ pathowatch_pipeline.py
β”œβ”€β”€ pathowatch.py
β”œβ”€β”€ index.html
β”‚
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ Procfile
β”‚
β”œβ”€β”€ Browser_images/
β”‚   β”œβ”€β”€ B02.tiff
β”‚   β”œβ”€β”€ B03.tiff
β”‚   β”œβ”€β”€ B04.tiff
β”‚   └── B08.tiff
β”‚
└── .env

πŸ› οΈ Tech Stack

Layer Technology
Backend Flask, Python
ML Scikit-learn
Satellite Google Earth Engine
Processing rasterio, numpy
Frontend HTML, JS, Leaflet
APIs OpenWeather, WAQI
Deployment Docker, Render

πŸš€ Running Locally

Python

pip install -r requirements.txt
python server.py

Docker

docker build -t pathowatch .
docker run --env-file .env -p 8080:8080 pathowatch

☁️ Deployment (Render)

  • Runtime: Docker
  • Region: Singapore
  • Add environment variables
  • Deploy

πŸš€ Future Scope

  • Hyperspectral drones
  • Deep learning models
  • Global disease tracking
  • Mobile app

πŸ“„ License

MIT License

About

An AI based anomaly detection tool

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages