PlantGuard is an advanced AI web application that detects plant diseases with 99.82% training accuracy using a state-of-the-art Vision Transformer (ViT) model. It provides instant diagnosis and treatment recommendations for 38 different plant disease classes.
| Service | URL | Status |
|---|---|---|
| Frontend | https://plant-guard-six.vercel.app | π’ Live |
| Backend API | https://rushikatabathuni-plantguard-backend.hf.space | π’ Live |
| Model Hub | Hugging Face Model | π’ Live |
- High-Accuracy Detection: 99.82% training accuracy (~98.5% validation).
- 38 Disease Classes: Covers Tomato, Apple, Corn, Grape, Potato, and more.
- Real-Time Inference: Fast predictions (1β2 seconds on CPU).
- Responsive UI: Mobile-friendly interface built with Next.js & shadcn/ui.
- User Authentication: Secure JWT-based authentication.
- Detection History: Track and review past diagnoses.
- Treatment Advisory: Comprehensive treatment recommendations.
| Area | Technologies |
|---|---|
| Frontend | Next.js 16, React 19, TypeScript, Tailwind CSS, shadcn/ui, Vercel |
| Backend | FastAPI, Python 3.12, SQLAlchemy, SQLite, JWT, HuggingFace Spaces |
| Machine Learning | PyTorch, Hugging Face Transformers (ViT), PlantVillage Dataset |
- Node.js 22.x
- Python 3.12.x
- Git
- Clone Repository
git clone https://github.com/rushikatabathuni/plantguard.git
cd plantguard- Backend Setup
cd backend
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On macOS/Linux
# venv\Scripts\activate # On Windows
# Install dependencies
pip install -r requirements.txt
# Run FastAPI server
uvicorn main:app --reload --host 0.0.0.0 --port 8000
- Frontend Setup
cd frontend
# Install dependencies
npm install --legacy-peer-deps
# Create environment file
echo "NEXT_PUBLIC_API_URL=http://localhost:8000" > .env.local
# Run development server
npm run dev
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /auth/register | Create a new user | β No |
| POST | /auth/login | Authenticate and receive a JWT token | β No |
| POST | /detect | Upload an image for disease detection | β Yes |
| GET | /history | Get the user's detection history | β Yes |
| GET | /health | Check the health of the API | β No |








