Spaces:
Running
Running
File size: 4,157 Bytes
5b80137 8ec049e 5b80137 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
---
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](https://github.com/parthmax2) | 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
[](https://your-deployment-link.com)
*π 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
```bash
git clone https://github.com/parthmax2/crop-recommendation-system.git
cd crop-recommendation-system
````
### 2οΈβ£ Install Dependencies
```bash
pip install -r requirements.txt
```
### 3οΈβ£ Run the Flask App
```bash
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](https://github.com/parthmax2) | [LinkedIn](https://linkedin.com/in/sakshampathak)
---
## π License
This project is licensed under the **MIT License** β see the [LICENSE](LICENSE) file for details.
---
## π References
* [IEEE Paper 1](https://ieeexplore.ieee.org/document/10575152)
* [Crop Dataset - Kaggle](https://www.kaggle.com/datasets/atharvaingle/crop-recommendation-dataset)
* Full list of academic references is included in the `paper.pdf`.
---
> π± *"Empowering farmers through AI-driven decisions for a greener tomorrow."*
```
|