A Machine Learning-based Crop Recommendation Web Application that recommends the most suitable crop based on soil and environmental conditions.
The system uses machine learning to analyze parameters such as Nitrogen, Phosphorus, Potassium, temperature, humidity, pH, and rainfall and recommends a suitable crop for cultivation.
- 🌱 Crop recommendation using Machine Learning
- 🧪 Soil parameter analysis
- 🌡️ Temperature-based recommendation
- 💧 Humidity and rainfall analysis
- ⚗️ Soil pH analysis
- 📊 User-friendly web interface
- 🤖 Pre-trained machine learning model
- 🔤 Label encoding for crop classes
- 🌐 Flask-based web application
- Python
- Scikit-learn
- Pandas
- NumPy
- Machine Learning Classification
- Flask
- HTML
- CSS
- JavaScript
Crop-Reccomendation-System/
│
├── app.py
├── train_model.py
│
├── crop_model.pkl
├── model.pkl
├── label_encoder.pkl
│
├── Crop_recommendation.csv
│
├── static/
│ ├── style.css
│ ├── script.js
│ └── images/
│
├── templates/
│ ├── index.html
│ ├── predict.html
│ └── about.html
│
└── .gitignore
- The user enters soil and environmental parameters.
- The application receives the input through the web interface.
- The input data is processed by the Flask backend.
- The trained machine learning model analyzes the parameters.
- The model predicts the most suitable crop.
- The recommended crop is displayed to the user.
The system considers important agricultural parameters such as:
- Nitrogen (N)
- Phosphorus (P)
- Potassium (K)
- Temperature
- Humidity
- pH
- Rainfall
The trained machine learning model is stored in:
crop_model.pkl
Additional model files include:
model.pkl
label_encoder.pkl
The label encoder converts crop names into numerical labels during model training and prediction.
The project uses:
Crop_recommendation.csv
The dataset contains soil and environmental parameters along with the corresponding recommended crop.
Clone the repository:
git clone https://github.com/nischithapoojary11-ctrl/Crop-Reccomendation-System.gitNavigate to the project directory:
cd Crop-Reccomendation-SystemInstall the required Python packages:
pip install flask pandas numpy scikit-learnStart the Flask application:
python app.pyOpen the local URL displayed in the terminal in your web browser.
To retrain the machine learning model using the dataset:
python train_model.pyThis will generate/update the required model files.
- Smart agriculture
- Crop selection
- Precision farming
- Agricultural decision support
- Soil-based crop recommendation
- Machine learning education
- Data science projects
- Add real-time weather data
- Add location-based crop recommendations
- Add fertilizer recommendations
- Add crop disease prediction
- Add yield prediction
- Add multilingual support
- Deploy the application online
- Add farmer login and personalized recommendations
Nischitha Poojary
Computer Science and Engineering Student
If you find this project useful, consider giving the repository a ⭐ on GitHub.