Skip to content
sriguhan7764Public

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

AgriAI

Cloud-Native Precision Agriculture AI Platform

Architecture Overview

AgriAI is a multi-agent microservices architecture deployed on AWS. It provides a unified farm analysis report by orchestrating three core ML services:

  1. Disease Detection Service: CNN (EfficientNet-B3) for detecting 38 crop diseases (PlantVillage taxonomy). Includes GradCAM visual explainability.
  2. Weather Prediction Service: TCN (Temporal Convolutional Network) for 24-hour forecasting using historical Open-Meteo data. Uses MC Dropout for uncertainty estimation.
  3. Market Analytics Service: XGBoost and Ridge Regression models predicting crop yields and market prices, combined with an SLSQP portfolio optimizer for land allocation.
  4. Orchestration Agent: FastAPI service managing parallel, fault-tolerant execution of the above services. Synthesizes data into an actionable FarmInsightReport.

Architecture

Directory Structure

  • config/: Shared configuration and constants.
  • shared/: Common utilities (JWT Auth, Logging, AWS Clients).
  • services/: Microservices (Disease, Weather, Market, Orchestrator).
  • infrastructure/: Terraform configurations and Lambda processors.
  • pipelines/: Data acquisition and retraining scripts.
  • tests/: Pytest suite.
  • scripts/: Deployment and model download helpers.

Quickstart (Local Development)

  1. Download Models:

    ./scripts/download_models.sh

    (Note: This creates mock models locally. In production, it downloads from S3).

  2. Start LocalStack and Services:

    docker-compose up -d
  3. Run Tests: Ensure AWS_ENDPOINT_URL=http://localhost:4566 is set.

    pytest tests/

API Documentation

  • Orchestrator: http://localhost:8000/docs
  • Disease Detection: http://localhost:8001/docs
  • Weather Prediction: http://localhost:8002/docs
  • Market Analytics: http://localhost:8003/docs

Example Orchestrator Request

curl -X POST "http://localhost:8000/analyze/farm" \
  -H "Authorization: Bearer <token>" \
  -F "image=@/path/to/leaf.jpg" \
  -F "sensors=@/path/to/sensors.csv" \
  -F 'farm_metadata={"crop_type": "corn", "soil_quality": 85.0, "fertilizer_kg_ha": 120.0, "water_mm": 400.0}'

Deployment to AWS

  1. Configure AWS Credentials.
  2. Run deployment script:
    ./scripts/deploy.sh
    This applies Terraform and pushes Docker images to ECR.

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages