ai-startup-skills
创业公司做 AI 产品的 7 步 Agent Skill 合集:验证 → BP → 政策 → 路演 → 获客 → 定价 → 注册。
Translation pending
Detect plant diseases and optimize pesticide use for farmers
AI summary · README
OtherJupyter Notebook · PythonGitHub @RajendraPatra7OnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
Loading the full README. The saved excerpt is shown below.
A Solution for Smart India Hackathon 2025 Empowering Farmers with Intelligent Disease Detection ⚠️ Note: Backend is hosted on Render free tier — first request after inactivity may take ~30-45 seconds to wake up. 📖 Overview SMART-SPRAY-X is an AI-driven initiative for Precision Agriculture, specifically targeted for the Smart India Hackathon 2025. It addresses the critical issue of indiscriminate pesticide use by farmers.Read the full README ↗
Empowering Farmers with Intelligent Disease Detection
A Solution for Smart India Hackathon 2026
| Service | URL |
|---|---|
| 🖥️ Frontend (React + Vite) | smartspray-x.vercel.app |
| ⚙️ Backend API (FastAPI) | plant-disease-9v9x.onrender.com |
| 📄 API Docs (Swagger) | plant-disease-9v9x.onrender.com/docs |
| 💚 Health Check | /api/v1/health |
⚠️ Note: Backend is hosted on Render free tier — first request after inactivity may take ~30-45 seconds to wake up.
SMART-SPRAY-X is an AI-driven initiative for Precision Agriculture, developed for the Smart India Hackathon 2026. It addresses the critical issue of indiscriminate pesticide use by farmers.
Unlike traditional methods where pesticides are sprayed uniformly, SMART-SPRAY-X uses intelligent disease detection to determine:
This "Spot-Spray" approach drastically reduces chemical usage, lowers costs for farmers, and protects the environment from toxic residue.
┌─────────────────────────────────────────────────────────────┐
│ User Browser │
│ (Vercel - React + Vite) │
│ https://smartspray-x.vercel.app │
└─────────────────────────┬───────────────────────────────────┘
│ REST API (HTTPS)
▼
┌─────────────────────────────────────────────────────────────┐
│ FastAPI Backend │
│ (Render - Docker Container) │
│ https://plant-disease-9v9x.onrender.com │
│ │
│ ┌─────────────────┐ ┌──────────────┐ ┌────────────────┐ │
│ │ 5-Layer Leaf │ │ MobileNetV2 │ │ Severity Index │ │
│ │ Validator │ │ (38 classes) │ │ HSV Segment. │ │
│ │ HSV + OOD + AR │ │ TF/Keras │ │ + Spot-Spray │ │
│ └─────────────────┘ └──────────────┘ └────────────────┘ │
└─────────────────────────────────────────────────────────────┘
| Feature | Details |
|---|---|
| 🌿 Multi-Class Detection | Identifies 38 different plant diseases across crops (Apple, Corn, Grape, Potato, Tomato, etc.) |
| ⚡ High Accuracy | MobileNetV2 fine-tuned on 87K+ images achieving ~96% validation accuracy |
| 🛑 5-Layer Non-Leaf Rejection | Solid background detection · Aspect ratio analysis · Foliage coverage · OOD confidence threshold · Top-2 margin check |
| 📊 Disease Severity Index | HSV symptom segmentation estimates affected leaf area on a 5-level scale (Very Low → Critical) |
| 💊 Pesticide Recommendations | Spot-spray optimization for each of the 38 disease classes |
| 📈 Interactive UI | Glassmorphism dark emerald React frontend with drag & drop upload |
| Layer | Technology |
|---|---|
| Frontend | React 18, Vite, Lucide Icons |
| Backend | FastAPI, Uvicorn, Python 3.10 |
| AI/ML | TensorFlow/Keras (MobileNetV2), NumPy |
| Deployment | Vercel (Frontend), Render + Docker (Backend) |
| Image Processing | PIL, Pure NumPy HSV |
cd "Plant Disease"
conda activate tensorflow
python start_backend.py
# → http://localhost:8000
cd frontend
npm install
npm run dev
# → http://localhost:5173
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/health | Health check + model status |
POST | /api/v1/predict | Upload leaf image → disease prediction + severity analysis |
GET | /api/v1/classes | List all 38 disease classes |
GET | /docs | Swagger API documentation |
POST /api/v1/predict returns a structured severity object alongside the existing prediction fields. Severity estimates how much of the leaf is visibly affected (not how confident the classifier is), derived from the image itself:
{
"is_valid_leaf": true,
"crop": "Apple",
"disease": "Cedar Rust",
"status": "Diseased",
"confidence_percentage": 94.0,
"recommendations": { "...": "..." },
"severity": {
"available": true,
"score": 67,
"label": "Severe",
"level": "severe",
"affected_area_percentage": 67.2,
"affected_regions": 2,
"largest_region_fraction": 0.81,
"confidence": 0.91,
"explanation": "An estimated 67.2% of the leaf area shows visible disease symptoms (necrotic/yellow tissue or pale mildew). Symptoms are spread across 2 separate regions."
}
}
How the score is computed (backend/app/services/severity_service.py):
Healthy classification discounts the measured area (healthy leaves naturally show veins/edges/senescence that color analysis can't fully separate from disease); a Diseased classification reports it directly.Severity scale (configurable via SEVERITY_THRESHOLDS):
| Score | Label | Indicator |
|---|---|---|
| 0 – 20 | Very Low | 🟢 |
| 21 – 40 | Mild | 🟡 |
| 41 – 60 | Moderate | 🟠 |
| 61 – 80 | Severe | 🔴 |
| 81 – 100 | Critical | 🔴 |
Limitations — The CNN is a classifier, not a segmenter; affected area is estimated from color, not measured by the network. Diseases with shape-based or very subtle symptoms (early leaf curl, mosaic mottling) are under-estimated. Color segmentation cannot separate true symptoms from sunburn, dirt, or lighting artifacts. When symptoms cannot be measured the module returns
"available": falserather than fabricating a score.
| Component | Detail |
|---|---|
| Base Model | MobileNetV2 (ImageNet pre-trained, fine-tuned) |
| Input | 128×128 RGB → internal Rescaling(1/127.5, offset=-1) layer |
| Feature Head | GlobalAveragePooling2D → BatchNormalization → Dense layers with Dropout |
| Output | Softmax over 38 classes |
| Optimizer | Adam |
| Model Size | ~13 MB (.keras format) |
To prevent false diagnoses (e.g., rejecting a dog photo on a green background), every uploaded image passes through 5 independent checks before the model is even consulted:
| Check | What it does | Catches |
|---|---|---|
| 1. Solid Background Detection | Color variance in green regions; rejects >70% uniform green with low variance | Green screen photos, artificial scenes |
| 2. Aspect Ratio Analysis | Bounding box of foliage; rejects objects with aspect ratio >6.0 | Elongated non-leaf objects |
| 3. Foliage Coverage | Requires ≥8% green/brown leaf-colored pixels | Documents, sky, water |
| 4. OOD Confidence | Rejects top-1 softmax <40% | Out-of-distribution inputs, non-plant images |
| 5. Top-2 Margin | Rejects when gap between top-1 and top-2 <8% | Ambiguous / confused predictions |
Upload Leaf Image
│
▼
┌─────────────────────────┐
│ 5-Layer Leaf Validator │ ← Rejects non-leaf, adversarial, ambiguous inputs
└─────────────┬───────────┘
│ ✅ Valid
▼
┌─────────────────────────┐
│ MobileNetV2 Classifier │ ← 38-class disease prediction + confidence margin
└─────────────┬───────────┘
│
▼
┌─────────────────────────┐
│ HSV Severity Engine │ ← Estimates affected leaf area → Very Low to Critical
└─────────────┬───────────┘
│
▼
┌─────────────────────────┐
│ Spot-Spray Recommender │ ← Pesticide type + dosage guidance
└─────────────────────────┘
Smart India Hackathon 2026 Participant
Developing innovative solutions for sustainable agriculture.
Made with ❤️ for SIH 2026 · SMART-SPRAY-X © 2026