OptiCrop is a crop recommendation system built using Flask and Machine Learning.
The application recommends a suitable crop based on soil nutrients and environmental conditions. Users enter values like Nitrogen, Phosphorus, Potassium, Temperature, Humidity, pH, and Rainfall, and the model predicts the most suitable crop.
The project uses a Random Forest model for prediction and a simple Flask web application for the user interface.
- Recommend crops based on soil and environmental conditions
- Machine learning model using Random Forest
- Simple web interface built with Flask
- Exploratory Data Analysis (EDA) on the dataset
- Clean and easy-to-use interface
- The user enters soil and environmental values.
- Flask receives the input from the web page.
- The trained Random Forest model processes the input.
- The model predicts the most suitable crop.
- The recommended crop is displayed on the result page.
Backend
- Python
- Flask
Machine Learning
- Scikit-learn
- Random Forest Classifier
Frontend
- HTML
- CSS
- JavaScript
Data Analysis
- Pandas
- NumPy
- Matplotlib
- Seaborn
OptiCrop/
│
├── app.py
├── model.pkl
├── requirements.txt
├── README.md
│
├── dataset/
│ ├── Crop_recommendation.csv
│ ├── train.csv
│ └── test.csv
│
├── notebook/
│ ├── EDA.ipynb
│ └── train_model.ipynb
│
├── screenshots/
│ ├── home-page.png
│ ├── about-page.png
│ ├── find-crop-page.png
│ └── crop-recommendation-page.png
│
├── static/
│ ├── css/
│ ├── js/
│ └── images/
│
└── templates/
├── home.html
├── about.html
├── findyourcrop.html
├── result.html
└── index.html
Clone the repository:
git clone https://github.com/aadith-v/OptiCrop.gitMove to the project folder:
cd OptiCropCreate a virtual environment (optional):
Windows
python -m venv venv
venv\Scripts\activateLinux/macOS
python3 -m venv venv
source venv/bin/activateInstall the required packages:
pip install -r requirements.txtRun the application:
python app.pyOpen your browser and visit:
http://127.0.0.1:5000
The project uses the Crop Recommendation Dataset containing soil nutrients and environmental parameters to predict the most suitable crop.
Input Features
- Nitrogen (N)
- Phosphorus (P)
- Potassium (K)
- Temperature
- Humidity
- pH
- Rainfall
Output
- Recommended Crop
- Deploy the application online
- Add weather API integration
- Fertilizer recommendation
- Crop disease prediction
- Mobile application
- Support for multiple languages
This project is available for learning and educational purposes.



