Smart-Farming / README.md
parthmax's picture
Update README.md
8ec049e verified
metadata
title: Crop Recommendation System
emoji: 🌾
colorFrom: green
colorTo: yellow
sdk: docker
app_file: app.py
pinned: false
license: mit

🌾 Smart Farming: Crop Recommendation System for Popular Indian Crops

πŸ”¬ A Machine Learning-based Web Application to Recommend Suitable Crops Based on Environmental Conditions
πŸ‘¨β€πŸŒΎ Built by Saksham Pathak | IIIT Lucknow | 94.3% Accuracy | Deployed using Flask


πŸ“Œ Overview

Smart Farming is a crop recommendation system that leverages machine learning to assist Indian farmers in selecting the most suitable crop for cultivation based on key environmental parameters. The system uses a Random Forest Classifier trained on soil and climatic data to suggest the best crop from a set of 22 popular Indian crops.

🌱 This project empowers sustainable agriculture, efficient resource utilization, and smarter farming decisions through AI.


🧠 Key Features

  • βœ… ML-Powered Predictions (94.3% Accuracy)
  • πŸ§ͺ Inputs: Nitrogen, Phosphorus, Potassium, Temperature, Humidity, pH, Rainfall
  • 🌾 Outputs: Rice, Maize, Banana, Cotton, Sugarcane, etc.
  • πŸ“Š Model Used: Random Forest Classifier
  • 🌐 Flask-based Web App with real-time crop suggestions
  • 🎨 Clean and responsive UI (HTML + CSS + JS)

πŸš€ Live Demo

Watch Demo
πŸ”’ Link coming soon or hosted locally


πŸ–₯️ Tech Stack

Component Technology
πŸ‘¨β€πŸ’» Language Python, HTML, CSS, JS
πŸ” ML Model Random Forest Classifier
βš™οΈ Backend Flask (Python)
πŸ–Ό Frontend HTML + CSS + JavaScript
πŸ“¦ Deployment Pickle Model Serialization

πŸ“‚ Project Structure


πŸ“ crop-recommendation
β”œβ”€β”€ πŸ“ static/
β”‚   └── images
β”œβ”€β”€ πŸ“ templates/
β”‚   └── index.html
β”œβ”€β”€ πŸ“„ app.py             # Flask backend
β”œβ”€β”€ πŸ“„ crop\minmaxscaler.pkl,standscaler.pkl    # Trained ML model
β”œβ”€β”€ πŸ“„ requirements.txt
β”œβ”€β”€ πŸ“„ Dockerfile
└── πŸ“„ README.md

πŸ“Š Model Performance

Model Accuracy Precision Recall F1-Score
🌟 Random Forest 94.3% 92.7% 91.5% 92.1%
Gradient Boosting 92.1% 90.5% 89.3% 89.9%
XGBoost 91.4% 88.9% 87.5% 88.2%
SVM 85.7% 83.2% 81.6% 82.4%

πŸ“Œ Key Factors Influencing Prediction:

  • Rainfall
  • Soil pH
  • Temperature
  • NPK (Nitrogen, Phosphorus, Potassium)

πŸ“₯ How to Run Locally

1️⃣ Clone the Repository

git clone https://github.com/parthmax2/crop-recommendation-system.git
cd crop-recommendation-system

2️⃣ Install Dependencies

pip install -r requirements.txt

3️⃣ Run the Flask App

python app.py

4️⃣ Open in Browser

Visit http://localhost:5000/ to use the web app.


πŸ“ˆ Future Enhancements

  • 🌀 Real-time Weather API Integration
  • πŸ“‘ IoT-based Soil Sensor Integration
  • πŸ› Pest & Disease Prediction Module
  • 🌍 Satellite/GIS data for advanced insights
  • 🌐 Multilingual and Offline Support

✍️ Author

Saksham Pathak M.Sc. AI & ML, IIIT Lucknow πŸ”— GitHub | LinkedIn


πŸ“„ License

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


πŸ“š References


🌱 "Empowering farmers through AI-driven decisions for a greener tomorrow."