Skip to content

VeAg (Vacant Vectors Agriculture) is a comprehensive AI-powered platform designed to detect and manage crop diseases efficiently.

License

Notifications You must be signed in to change notification settings

mdjubayerd1/VeAg_Project

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VeAg - AI-Powered Crop Disease Detection Platform

VeAg Logo

Empowering Agriculture with Artificial Intelligence

Version License React Node.js


About VeAg

VeAg (Vacant Vectors Agriculture) is a comprehensive AI-powered platform designed to help farmers and agronomists detect and manage crop diseases efficiently. Using state-of-the-art deep learning models, VeAg provides:

  • 🔍 Accurate Disease Detection - AI-powered analysis using ensemble of ConvNeXt, EfficientNetV2, and DeiT models
  • 📸 Image-Based Diagnosis - Upload crop images for instant analysis
  • 💡 Treatment Recommendations - Available in standalone model interface (integration with main platform coming soon)
  • 📊 Case Management - Track and manage multiple disease cases
  • 💳 Subscription Plans - Flexible pricing for different user needs
  • 🌐 Web & Mobile Ready - Responsive design for all devices

🎯 Project Overview

VeAg is a final year project by Sarthak Chakraborty , demonstrating the practical application of:

  • Deep Learning in Agriculture
  • Full-Stack Web Development
  • Cloud Computing & DevOps
  • Payment Gateway Integration
  • Real-time AI Model Deployment

Current Implementation

  • Example Crop: Rice Leaf Disease Detection
  • Diseases Detected: Bacterial leaf blight, Brown spot, Leaf smut
  • Extensible: Can be adapted for wheat, corn, tomato, potato, and other crops

🏗️ Architecture

VeAg follows a modern microservices architecture:

┌─────────────────────────────────────────────────────────────┐
│                        VeAg Platform                         │
└─────────────────────────────────────────────────────────────┘

┌──────────────────┐     ┌──────────────────┐     ┌──────────────────┐
│                  │     │                  │     │                  │
│  CLIENT (React)  │────▶│  SERVER (Node)   │────▶│  MODEL (Python)  │
│                  │     │                  │     │                  │
│  • React 18      │     │  • Express.js    │     │  • Gradio        │
│  • Vite          │     │  • MongoDB       │     │  • PyTorch       │
│  • Tailwind CSS  │     │  • Cloudinary    │     │  • TIMM          │
│  • Firebase Auth │     │  • Razorpay      │     │  • ConvNeXt      │
│  • Framer Motion │     │  • Gradio Client │     │  • EfficientNet  │
│                  │     │                  │     │  • DeiT          │
└──────────────────┘     └──────────────────┘     └──────────────────┘
         │                        │                         │
         │                        │                         │
         ▼                        ▼                         ▼
┌──────────────────┐     ┌──────────────────┐     ┌──────────────────┐
│  Firebase        │     │  MongoDB Atlas   │     │  Hugging Face    │
│  Authentication  │     │  Database        │     │  Spaces          │
└──────────────────┘     └──────────────────┘     └──────────────────┘

📁 Project Structure

VeAg_Project/
├── client/                      # React frontend application
│   ├── src/
│   │   ├── components/         # Reusable React components
│   │   ├── contexts/           # React context providers
│   │   ├── pages/              # Application pages
│   │   ├── config/             # Firebase configuration
│   │   └── utils/              # Utility functions
│   ├── public/                 # Static assets
│   └── package.json            # Client dependencies
│
├── server/                      # Node.js backend server
│   ├── config/                 # Configuration files
│   ├── controllers/            # Request handlers
│   ├── models/                 # MongoDB schemas
│   ├── routes/                 # API routes
│   ├── services/               # Business logic
│   └── package.json            # Server dependencies
│
├── model/                       # AI/ML components
│   ├── backend/                # Model training pipeline
│   │   └── ML_Crop_Disease_Detection_Model.ipynb
│   ├── client/                 # Gradio inference application
│   │   ├── app.py             # Gradio web interface
│   │   ├── src/               # Model handlers
│   │   ├── models/            # Trained model files
│   │   └── Model.ipynb        # Development notebook
│   └── README.md              # Model documentation
│
└── README.md                    # This file

🚀 Quick Start

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js 18.x or higher
  • Python 3.8 or higher
  • MongoDB 6.x or higher
  • Git for version control

Installation Steps

  1. Clone the repository

    git clone https://github.com/ok-sarthak/VeAg_Project.git
    cd VeAg_Project
  2. Set up the Model (Optional - if training new models)

    cd model/backend
    # Follow instructions in model/backend/README.md
    # Train models and copy .pth files to model/client/models/checkpoints/
  3. Set up the Model Client (Gradio)

    cd model/client
    pip install -r requirements.txt
    # Configure classes.json for your crops
    python app.py
    # Or deploy to Hugging Face Spaces
  4. Set up the Backend Server

    cd server
    npm install
    
    # Create .env file
    cp .env.example .env
    # Edit .env with your credentials
    
    npm run dev
  5. Set up the Frontend Client

    cd client
    npm install
    
    # Create .env file
    cp .env.example .env
    # Edit .env with your Firebase and API credentials
    
    npm run dev
  6. Access the Application

🔑 Environment Configuration

Client (.env)

VITE_FIREBASE_API_KEY=your_firebase_api_key
VITE_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your-project-id
VITE_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
VITE_FIREBASE_APP_ID=your_app_id
VITE_API_URL=http://localhost:5000
VITE_API_BASE_URL=http://localhost:5000/api

Server (.env)

PORT=5000
NODE_ENV=development
MONGODB_URI=mongodb://localhost:27017/veag
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_key
CLOUDINARY_API_SECRET=your_cloudinary_secret
RAZORPAY_KEY_ID=your_razorpay_key
RAZORPAY_KEY_SECRET=your_razorpay_secret
GRADIO_SPACE_URL=sharkthak/VeAg
CLIENT_URL=http://localhost:5173

Model Client (.env)

GEMINI_API_KEY=your_gemini_api_key
PORT=7860

💡 Features

For Farmers & Agronomists

  • Easy Image Upload: Take photos of affected crops and upload instantly
  • Quick Diagnosis: Get AI-powered disease detection in seconds
  • Treatment Advice: Available in standalone model interface (full integration coming in v4.0.0)
  • Case History: Track all your submitted cases in one place
  • Multi-Language Support: English, Hindi (हिंदी), and Bengali (বাংলা) - Making agriculture accessible across India

For Researchers & Students

  • Training Pipeline: Complete notebook for training custom models
  • Model Comparison: Evaluate different architectures (ConvNeXt, EfficientNetV2, DeiT)
  • Ensemble Methods: Combine models for improved accuracy
  • Extensible Design: Adapt for different crops and diseases
  • Open Architecture: Learn from complete implementation

Technical Features

  • Authentication: Secure Google Sign-In via Firebase
  • Image Storage: Cloud-based storage with Cloudinary
  • AI Processing: Gradio-powered ML inference
  • Payment Gateway: Razorpay integration for subscriptions
  • Responsive Design: Works on desktop, tablet, and mobile
  • Real-time Updates: Track case processing status
  • RESTful API: Clean, documented API endpoints
  • Database: MongoDB for scalable data storage
  • Progressive Web App (PWA): Install and use offline capabilities
  • Batch Processing: Analyze multiple images simultaneously

Multilingual Support 🌍

VeAg supports three major Indian languages to make agricultural technology accessible to farmers across India:

  • 🇬🇧 English - Primary language for international users and technical documentation
  • 🇮🇳 Hindi (हिंदी) - India's most widely spoken language, serving millions of farmers
  • 🇮🇳 Bengali (বাংলা) - Supporting farmers in West Bengal regions

Language Features:

  • ✅ Full UI translation for all pages
  • ✅ Disease names and descriptions in local languages
  • ✅ Treatment recommendations in user's preferred language
  • ✅ Easy language switching from settings
  • ✅ Automatic language detection based on browser settings

📊 Disease Detection Models

Supported Architectures

  1. ConvNeXt-Base (88M parameters)

    • Modern CNN architecture
    • Excellent overall accuracy
    • Balanced performance
  2. EfficientNetV2-M (54M parameters)

    • Optimized for efficiency
    • Fast inference time
    • Production-ready
  3. DeiT-Small (22M parameters)

    • Vision Transformer
    • Attention mechanisms
    • Captures global features
  4. Ensemble Model

    • Combines all three architectures
    • Customizable weights
    • Best overall performance

Detection Capabilities

Current Implementation (Rice):

  • Bacterial leaf blight
  • Brown spot
  • Leaf smut
  • Healthy leaf detection

Extensible to Other Crops:

  • Wheat: Rust, blight, powdery mildew
  • Tomato: Early blight, late blight, leaf mold
  • Potato: Early blight, late blight, black scurf
  • Corn: Northern corn leaf blight, gray leaf spot

💳 Subscription Plans

Feature Free Plan Premium Plan
Cases per month Unlimited
AI Analysis
Treatment Advice
Priority Support
Advanced Analytics
Export Reports
Price ₹0 ₹9/month

*Treatment advice is currently available in the standalone model interface. Integration with the main platform is planned for v4.0.0.

Note: Currently, there is no free plan. All users require a premium subscription.

🛠️ Technology Stack

Frontend

  • React 18.3 - UI library
  • Vite 5.1 - Build tool
  • Tailwind CSS - Styling
  • Framer Motion - Animations
  • React Router v6 - Routing
  • Axios - HTTP client
  • Firebase - Authentication

Backend

  • Node.js - Runtime
  • Express.js - Web framework
  • MongoDB - Database
  • Mongoose - ODM
  • Cloudinary - Image storage
  • Razorpay - Payments

AI/ML

  • Python 3.8+ - Programming language
  • PyTorch - Deep learning framework
  • TIMM - Model architectures
  • Gradio - Web interface
  • Pandas - Data processing
  • Matplotlib - Visualization

📖 Documentation

Detailed documentation for each component:

🚀 Deployment

Frontend (Vercel/Netlify)

cd client
npm run build
# Deploy dist/ folder

Backend (Railway/Render)

cd server
# Push to platform
# Set environment variables

Model (Hugging Face Spaces)

cd model/client
# Create new Space
# Upload files
# Set secrets

🧪 Testing

Client

cd client
npm test

Server

cd server
npm test

Model

cd model/client
python -m pytest tests/

📈 Performance

  • Detection Accuracy: 95%+ (ensemble model)
  • Response Time: < 15 seconds for analysis
  • Uptime: 99.9% availability target
  • Concurrent Users: Supports 1000+ simultaneous users

🔒 Security

  • Authentication: Firebase Auth with JWT tokens
  • Data Encryption: HTTPS/TLS for all communications
  • Payment Security: PCI-compliant Razorpay integration
  • Input Validation: Server-side validation for all inputs
  • Rate Limiting: API rate limits to prevent abuse
  • CORS: Configured for security

🤝 Contributing

This is a final year academic project of Sarthak Chakraborty. I welcome feedback and suggestions!

How to Contribute

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

📄 License

MIT License

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

Why MIT License?

We chose the MIT License for VeAg because:

  1. 🌍 Maximum Accessibility

    • Anyone can use, modify, and distribute VeAg
    • Perfect for educational institutions and research
    • Enables farmers and NGOs to deploy without legal concerns
  2. 🚀 Encourages Innovation

    • Developers can build upon VeAg for commercial use
    • Startups can integrate our disease detection models
    • Academic researchers can extend and improve the system
  3. 📚 Educational Purpose

    • Students can learn from production-ready code
    • Great for portfolio and resume projects
    • Demonstrates best practices in full-stack development
  4. 🤝 Community Collaboration

    • Simple and permissive - easy to understand
    • No complex restrictions or copyleft requirements
    • Encourages contributions and forks
  5. 💼 Business-Friendly

    • Can be used in proprietary software
    • No obligation to open-source derivatives
    • Suitable for commercial agricultural technology companies

What the MIT License Allows:

  • ✅ Commercial use
  • ✅ Modification
  • ✅ Distribution
  • ✅ Private use

Requirements:

  • 📋 Include original copyright notice
  • 📋 Include copy of MIT License text

Limitations:

  • ❌ No warranty provided
  • ❌ No liability for damages

Our Vision: We believe agricultural technology should be accessible to everyone. By using MIT License, we ensure VeAg can benefit the maximum number of farmers worldwide, whether through direct use, derivative works, or commercial applications.

🙏 Acknowledgments

  • PyTorch Team - Deep learning framework
  • TIMM Library - Pre-trained models
  • Gradio - ML interface framework
  • Firebase - Authentication services
  • Cloudinary - Image storage
  • Razorpay - Payment gateway
  • MongoDB - Database
  • Open-source crop disease datasets

📞 Contact & Support

🗺️ Roadmap

Current Version (v3.3.3)

  • ✅ Rice disease detection
  • ✅ User authentication
  • ✅ Case management
  • ✅ Subscription system
  • ✅ Payment integration

Upcoming Features (v4.0.0 and later)

  • 🔄 Multi-crop support (10+ crops)
  • 🔄 Mobile app (React Native - iOS & Android)
  • 🔄 Treatment Advice Integration (currently available in model interface)
  • 🔄 Advanced analytics dashboard with insights
  • 🔄 Community forum for farmers
  • 🔄 Expert consultation system (connect with agronomists)
  • 🔄 Offline mode for areas with poor connectivity
  • 🔄 SMS/WhatsApp notifications for case updates
  • 🔄 Voice input for disease descriptions
  • 🔄 Weather integration for prevention advice
  • 🔄 Crop calendar and farming tips
  • 🔄 More languages (Tamil, Telugu, Marathi, Punjabi, etc.)
  • 🔄 Blockchain-based disease tracking
  • 🔄 Farmer-to-farmer marketplace

⚠️ Disclaimer

VeAg provides automated crop disease predictions and treatment suggestions for educational and informational purposes only. It is not a substitute for professional agricultural advice. Always consult with agricultural experts and local extension services for critical farming decisions.

📊 Project Statistics

  • Lines of Code: 30,000+
  • Components: 25+ React components
  • API Endpoints: 20+ REST endpoints
  • ML Models: 3 architectures + ensemble
  • Database Collections: 7 MongoDB collections
  • Deployment Ready: ✅ Production-grade

Built by Sarthak Chakraborty

Empowering farmers with AI-driven crop disease detection

⬆ Back to Top

About

VeAg (Vacant Vectors Agriculture) is a comprehensive AI-powered platform designed to detect and manage crop diseases efficiently.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 94.8%
  • JavaScript 4.8%
  • Python 0.4%
  • Shell 0.0%
  • Batchfile 0.0%
  • CSS 0.0%