AgriAI is a machine learning based we application build using React and Flask. AgriAI is used for recommending Crop and Fertilizers based on the soil features. The application used three accuractely predciting models to make the final predictions. The link for the python notebooks containing the implementation for the models are present in the All Links section of this Readme.
An API was built using Flask and was deployed on Heroku. This Flask API is used to get the recommendation made by the machine learning models in JSON format. The input data is sent as a POST request to the API to get the predicted information.
React JS was used to build the frontend part of the application. JS packages such as MaterialUI, Axios, react-router-dom were used for frontend part of the web application.
Deployed Web Application Link: https://agriai-app-a9c34.web.app
- Crop Recommendation End Point: https://agriculture-api.herokuapp.com/predict_crop
- Fertilizer Recommendation End Point: https://agriculture-api.herokuapp.com/predict_fertilizer
The data is returned in JSON format:
- For Crop Recommendation
{
xgb_model_prediction: "rice",
xgb_model_probability: 99.2%,
rf_model_prediction: "rice",
rf_model_probability: 99.3%,
knn_model_prediction: "rice",
knn_model_probability: 99.5%,
final_prediction: "rice",
}
- For Fertilizer Recommendation
{
xgb_model_prediction: "Urea",
xgb_model_probability: 99.2%,
rf_model_prediction: "Urea",
rf_model_probability: 99.3%,
svm_model_prediction: "Urea",
svm_model_probability: 99.5%,
final_prediction: "Urea",
}
Note: This API can be used in your Web Application or Mobile Application by just sending a POST request with the necessary input data to the above mentioned end points.
- Clone this repo.
- Open command prompt in the following folder "React_Frontend/agri-ai"
- Install all the npm packages
npm install
- Start the application
npm start
The Application Runs on localhost:3000
- Clone this repo
- Open command prompt in "Flask_API"
- Create a virtual environment
mkvirtualenv environment_name
- Install all the packages
pip install -r requirements.txt
- Run the app.py file
python app.py
- Crop Recommender Notebook Link
- Fertilizer Recommender Notebook Link
- Crop Dataset Link
- Fertilizer Dataset Link
- Deployed Web Application Link
NOTE: Please do support by upvoting the kaggle notebooks if you liked my work.
Please do ⭐ this repo if you liked my work.