Skip to content

stealthwhizz/AURA

Repository files navigation

🌾 Project AURA: Aflatoxin Universal Risk Assessment

License: MIT Node.js Python React

Predictive Public Health System for Agriculture

An intelligent ecosystem that predicts mycotoxin contamination in agricultural produce before it occurs, providing farmers with actionable interventions to save their harvests and protect public health.


🚨 The Problem

Aflatoxins are invisible killers in our food supply:

  • πŸ§ͺ Potent Carcinogens: Produced by fungus on staple crops (maize, groundnuts, rice, chilies)
  • πŸ“Š 18% of Indian food samples exceed safety limits
  • 🌾 70.5% contamination in Karnataka groundnuts alone
  • πŸ’€ Health Impact: Liver cancer, childhood stunting, immune suppression
  • πŸ’Έ Economic Loss: Millions lost in rejected export shipments
  • πŸ” Invisible Threat: Contamination happens silently during storage

Current Reality: Farmers only discover contamination when crops are rejected - too late to take action.


πŸ’‘ Our Solution

AURA transforms food safety from reactive to proactive.

We predict aflatoxin contamination 48-72 hours before it happens, giving farmers a critical intervention window to save their harvests.

Three-Pillar Architecture

1️⃣ Predictive AI Engine πŸ€–

  • Multi-Stream Data Fusion: Combines satellite imagery (Sentinel-2), real-time weather data, and storage conditions
  • LSTM Neural Network: Time-series deep learning model trained on contamination patterns
  • Risk Scoring: Real-time Aflatoxin Risk Score (ARS) from 1-10
  • Hyperlocal Forecasting: 48-72 hour prediction window with >75% accuracy

2️⃣ Smart Alert System πŸ“±

  • Progressive Web App: Mobile-first, works offline, installable
  • Proactive Alerts: "Humidity spike in 48 hours - Risk: 9/10 - Deploy drying beads NOW"
  • Actionable Intelligence: Not just warnings, but specific preventive actions
  • Real-time Dashboard: Live risk monitoring with visual indicators

3️⃣ Blockchain Certification ⛓️

  • AURA-Certified Ledger: Immutable record of preventive actions taken
  • QR Code Verification: Buyers can verify safety scores instantly
  • Premium Markets: Creates economic incentive for safe produce
  • Export Enablement: Meets international food safety standards

🎯 Key Features

For Farmers πŸ‘¨β€πŸŒΎ

βœ… Predict contamination before it happens
βœ… Get specific preventive actions (not generic advice)
βœ… Earn premium prices for AURA-certified produce
βœ… Access export markets with verified safe crops
βœ… Reduce post-harvest losses by 15-25%

For Buyers 🏒

βœ… Verify produce safety via blockchain + QR codes
βœ… Access guaranteed low-risk supply chains
βœ… Reduce rejection rates and losses
βœ… Meet food safety compliance requirements

For Public Health πŸ₯

βœ… Reduce aflatoxin-related cancer cases
βœ… Prevent childhood stunting from contaminated food
βœ… Create data-driven food safety infrastructure
βœ… Enable early warning systems for contamination outbreaks


πŸ› οΈ Technology Stack

Backend

  • Node.js + Express - RESTful API server
  • MongoDB - Database for farmers, predictions, alerts
  • JWT - Secure authentication
  • Axios - External API integration

Frontend

  • React 18 - Modern UI library
  • Vite - Lightning-fast build tool
  • PWA - Offline-capable, installable app
  • React Router - Client-side routing
  • Recharts - Data visualization

ML/AI

  • Python 3.8+ - Core ML runtime
  • TensorFlow/PyTorch - Deep learning frameworks
  • LSTM - Time-series prediction model
  • Flask - ML API server
  • NumPy/Pandas - Data processing

Blockchain

  • Solidity - Smart contract language
  • Hardhat - Development environment
  • Ethers.js - Blockchain interaction
  • Ethereum Sepolia - Testnet deployment

Data Sources

  • Sentinel-2 (Copernicus) - Satellite crop monitoring
  • OpenWeatherMap - Real-time weather data
  • Custom Storage Models - Aflatoxin growth simulations

πŸ“ Project Structure

project-aura/
β”œβ”€β”€ backend/                    # Node.js API Server
β”‚   β”œβ”€β”€ models/                # Database schemas
β”‚   β”œβ”€β”€ routes/                # API endpoints
β”‚   β”œβ”€β”€ controllers/           # Business logic
β”‚   └── server.js              # Entry point
β”‚
β”œβ”€β”€ frontend/                   # React PWA
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/        # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ pages/             # Route pages
β”‚   β”‚   β”œβ”€β”€ services/          # API integration
β”‚   β”‚   └── App.jsx            # Main app component
β”‚   └── vite.config.js         # Build configuration
β”‚
β”œβ”€β”€ ml-model/                   # Python ML Engine
β”‚   β”œβ”€β”€ predictor.py           # LSTM prediction model
β”‚   β”œβ”€β”€ data_integrator.py     # External data fetching
β”‚   β”œβ”€β”€ app.py                 # Flask API server
β”‚   └── requirements.txt       # Python dependencies
β”‚
β”œβ”€β”€ blockchain/                 # Smart Contracts
β”‚   β”œβ”€β”€ contracts/             # Solidity contracts
β”‚   β”œβ”€β”€ scripts/               # Deployment scripts
β”‚   └── hardhat.config.js      # Hardhat configuration
β”‚
β”œβ”€β”€ README.md                   # This file
β”œβ”€β”€ QUICKSTART.md              # 10-minute setup guide
β”œβ”€β”€ SETUP.md                   # Detailed deployment guide
└── API_DOCS.md                # Complete API reference

πŸš€ Quick Start

Prerequisites

10-Minute Setup

# 1. Backend (Terminal 1)
cd backend
npm install
copy .env.example .env
npm run dev
# βœ… Running on http://localhost:3000

# 2. ML Model (Terminal 2)
cd ml-model
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
python app.py
# βœ… Running on http://localhost:5000

# 3. Frontend (Terminal 3)
cd frontend
npm install
copy .env.example .env
npm run dev
# βœ… Running on http://localhost:5173

Test the System

  1. Open http://localhost:5173 in browser
  2. Click Register β†’ Create account
  3. Use test coordinates: Lat: 15.3173, Lon: 75.7139
  4. See live risk prediction on dashboard! πŸŽ‰

πŸ‘‰ For detailed setup: See QUICKSTART.md


πŸ“Š Expected Impact

Immediate (6 Months)

  • βœ… 15-25% reduction in aflatoxin contamination for participating farmers
  • βœ… 10-15% premium pricing for AURA-certified produce
  • βœ… 500-1000 farmers in pilot region (Karnataka)
  • βœ… Proof of concept for predictive food safety

Long-term (2-3 Years)

  • 🎯 Prevent 10,000+ cases of aflatoxin-related health issues
  • 🎯 Enable $50M+ in previously rejected export revenues
  • 🎯 Scale to 100,000+ farmers across major agricultural states
  • 🎯 Establish new standard for Indian agricultural food safety
  • 🎯 Reduce childhood stunting in high-contamination regions

Market Opportunity

  • πŸ’° $1.6B global mycotoxin testing market (2024)
  • πŸ’° Projected $2.3B by 2029 (CAGR: 7.5%)
  • πŸ’° First-mover advantage in predictive aflatoxin solutions
  • πŸ’° Government partnerships for food safety initiatives

πŸ”¬ How It Works

1. Data Collection

Satellite Imagery (Sentinel-2)
    ↓
  NDVI, Crop Health, Stress Levels
    ↓
Weather Data (Real-time + Forecast)
    ↓
  Temperature, Humidity, Rainfall
    ↓
Storage Conditions
    ↓
  Type, Ventilation, Moisture Content

2. AI Prediction

Multi-stream Data β†’ LSTM Model β†’ Risk Score (1-10)
                         ↓
            Risk Classification:
            β€’ LOW (1-3)
            β€’ MODERATE (4-5)
            β€’ HIGH (6-7)
            β€’ CRITICAL (8-10)

3. Actionable Alerts

Risk Threshold Crossed β†’ Alert Triggered
           ↓
   SMS + Push Notification
           ↓
   "CRITICAL: Deploy drying beads in 24h"
           ↓
   Farmer Takes Action
           ↓
   Risk Reduced β†’ Harvest Saved

4. Blockchain Certification

Successful Prevention β†’ Generate Certificate
           ↓
   Write to Blockchain
           ↓
   Generate QR Code
           ↓
   Buyer Scans β†’ Verifies Safety

πŸ“– Documentation


πŸ§ͺ API Example

Get Risk Prediction

curl -X POST http://localhost:5000/api/predict \
  -H "Content-Type: application/json" \
  -d '{
    "latitude": 15.3173,
    "longitude": 75.7139,
    "storage_type": "silo",
    "moisture_content": 12.5
  }'

Response:

{
  "prediction": {
    "risk_score": 6.5,
    "risk_level": "HIGH",
    "confidence": 0.85
  },
  "recommendations": {
    "priority": "HIGH",
    "actions": [
      "⚠️ HIGH RISK - Take action within 24 hours",
      "Increase ventilation in storage area",
      "Deploy moisture-absorbing desiccants"
    ]
  }
}

🀝 Contributing

We welcome contributions! Here's how:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Areas for Contribution

  • πŸ”¬ ML model improvements (accuracy, speed)
  • 🎨 UI/UX enhancements
  • πŸ“± Mobile app development (React Native)
  • 🌍 Multi-language support
  • πŸ“Š Data visualization features
  • πŸ§ͺ Testing and documentation

πŸ“„ License

This project is licensed under the MIT License - see LICENSE file.

Free to use, modify, and distribute with attribution.


πŸ™ Acknowledgments

  • Sentinel Hub - Satellite imagery API
  • OpenWeatherMap - Weather data API
  • Copernicus Programme - Earth observation data
  • Agricultural research community - Aflatoxin contamination patterns
  • Open source community - Amazing tools and libraries

πŸ“ž Contact & Support


🌟 Star History

If you find this project useful, please consider giving it a ⭐!


πŸ—ΊοΈ Roadmap

Phase 1: MVP βœ… (Current)

  • ML prediction engine
  • Backend API
  • Frontend dashboard
  • Blockchain certification
  • Database models

Phase 2: Enhancements (Q1 2026)

  • Real-time SMS/Push alerts
  • Historical data visualization
  • Map-based risk overlay
  • Mobile apps (iOS/Android)
  • Multi-language support

Phase 3: Scale (Q2-Q3 2026)

  • Government partnerships
  • Integration with agricultural cooperatives
  • Insurance product partnerships
  • Data marketplace for agribusiness
  • AI model continuous training

Phase 4: Expansion (Q4 2026+)

  • Other mycotoxins (Ochratoxin, Fumonisin)
  • International markets (Africa, Southeast Asia)
  • IoT sensor integration
  • Blockchain consortium
  • Research partnerships

🌾 Making Agriculture Safer, One Prediction at a Time 🌾

Built with ❀️ for farmers, by technologists

Get Started β€’ Documentation β€’ API Docs

About

The Invisible Toxin Crisis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published