AI-powered Smart Crop, Fertilizer & Disease Prediction System built with Java Spring Boot backend and a modern single-page HTML/CSS/JS frontend. Uses k-NN ML algorithm for crop recommendation, rule-based NPK analysis for fertilizer guidance, and image-based disease detection.
A transparent discovery signal based on current public GitHub metadata.
Recent activity35% weight
90
Community adoption25% weight
0
Maintenance state20% weight
100
License clarity10% weight
0
Project information10% weight
35
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
README preview
🌾 Smart Crop, Fertilizer & Disease Prediction System
An AI-powered full-stack agricultural intelligence web application built with Java Spring Boot backend and a modern single-page HTML/CSS/JS frontend.
🖥️ Live Preview
Open agri-tools/frontend/index.html in your browser after starting the backend.
📌 Features
Module
Description
🌾 Crop Recommendation
Enter soil N-P-K, pH, rainfall & region → get the best crop to grow using k-NN ML
🧪 Fertilizer Guidance
Enter current N-P-K & crop → get precise increase/decrease fertilizer advice
🔬 Disease Detection
Upload a leaf photo → get disease name, description & step-by-step treatment
🌱 Smart Farming Chatbot is an AI-powered assistant for farmers, built with HTML, CSS, JS (frontend) and Node.js + Botpress (backend). It provides guidance on crops, irrigation, soil, pests, and weather. Featuring a ChatGPT-style light-green UI, it supports APIs for smart farming insights and promotes sustainable agriculture.
🌱 Smart Crop Advisory System is an AI-powered farming platform using Random Forest (86%) for crop recommendation, CNN (82%) for disease detection, LSTM for price prediction, and Decision Tree (84%) for irrigation advice. Built with Python, TensorFlow, Scikit-learn, HTML, CSS, JavaScript, Flask/Streamlit.
POST http://localhost:9090/api/disease/detect
Content-Type: multipart/form-data
image: <file> (JPG / PNG / WEBP — max 10 MB)
Response:
{
"disease": "Bacterial Spot",
"description": "A common disease caused by Xanthomonas bacteria...",
"treatmentSteps": [
"Use certified pathogen-free seed and disease-free transplants.",
"Rotate crops to break the bacterial cycle.",
"Apply copper-containing bactericides regularly."
],
"severity": "moderate"
}
🧪 Sample Test Data
🌾 Crop Recommendation — 10 Examples
#
Nitrogen
Phosphorus
Potassium
pH
Rainfall
Region
Expected Crop
1
83
33
36
6.21
68.7
North
Cotton
2
71
40
36
6.81
67.5
West
Cotton
3
68
31
45
6.71
72.2
East
Wheat
4
92
38
30
6.35
180.5
East
Rice
5
87
49
43
6.19
179.1
South
Rice
6
104
81
73
6.86
236.0
South
Sugarcane
7
144
70
64
6.52
173.7
Central
Sugarcane
8
120
52
34
6.63
60.8
North
Maize
9
86
50
31
6.98
75.8
South
Wheat
10
93
44
33
5.91
119.0
South
Rice
🧪 Fertilizer Guidance — 10 Examples
#
Nitrogen
Phosphorus
Potassium
Crop
Expected Result
1
60
50
30
rice
N↑30, P↓10, K↑10
2
90
40
40
rice
✅ Optimal
3
50
20
50
wheat
N↑30, P↑15, K↓10
4
80
35
40
wheat
✅ Optimal
5
130
70
35
maize
N↑10, K↑5
6
120
60
40
maize
✅ Optimal
7
70
60
60
cotton
N↑30, P↑10, K↑10
8
100
50
50
cotton
✅ Optimal
9
60
25
100
mango
N↑15, P↑5, K↑10
10
180
90
180
banana
N↑20, P↑10, K↑20
🔬 Disease Detection — 10 Examples
Rename any leaf image to include these keywords before uploading:
#
Filename to use
Detected Disease
Severity
1
healthy_leaf.jpg
No Disease Detected
Low
2
blight_sample.jpg
Leaf Blight
High
3
powdery_mildew.png
Powdery Mildew
Low
4
bacterial_spot.jpg
Bacterial Spot
Moderate
5
spot_check.jpg
Bacterial Spot
Moderate
6
mildew_leaf.jpg
Powdery Mildew
Low
7
blight_early.jpg
Leaf Blight
High
8
healthy_plant.png
No Disease Detected
Low
9
bacterial_infection.jpg
Bacterial Spot
Moderate
10
leaf_blight_stage2.jpg
Leaf Blight
High
💡 The classifier checks the filename first. Rename any image with the keyword above to trigger that specific result. Replace with a real CNN model by updating classifyStub() in DiseaseDetectionService.java.
🧠 ML Architecture
Crop Prediction — k-NN (k=5)
Loads recommended_crops_dataset.csv (100 records) at startup
Features: Nitrogen, Phosphorus, Potassium, pH, Rainfall, Region (encoded 0–4)
Applies min-max normalisation per feature before computing Euclidean distances
Returns the majority-vote label among the 5 nearest neighbours
Fertilizer Recommendation — Rule-Based
Compares user N-P-K against hardcoded optimal values per crop
Outputs precise delta adjustments (increase/decrease by X units)
AI -powered monitoring of crop health ,soil conditions and pest risk using multispectral/hyperspectral imaging and sensor data using Python → AI/ML model, backend, sensor data processing HTML, CSS, JavaScript → Frontend dashboard UI Domain name : Artificial intelligence machine learning
AI Farmer Assistant is a smart agriculture support system that helps farmers with crop recommendations, pest detection, weather updates, soil analysis, fertilizer guidance, and AI-powered farming assistance. Built using Python, HTML, CSS, JavaScript, and AI technologies to promote smart and sustainable farming solutions.