Inspiration
This project was inspired by the recent flooding in Pakistan in 2022. The flooding caused devastation to many farms in Pakistan. As Pakistan recovers, it becomes all the more important to use sustainable farming practices to find the ideal crops to grow based on one’s farm conditions.
What it does
The Croptimizer Web Application predicts the ideal crop to grow based on input data farmers can collect on their farms and local areas. Using ideal crops can reduce the need for fertilizers and other additives which can harm the environment with eutrophication as well as lower crop yields.
We also included a nutrient additive calculator. Excessive nutrients can be detrimental to the environment by causing eutrophication which can kill aquatic organisms by depleting dissolved oxygen. The nutrient additive calculator is an important step in making sustainable farms and decreasing the environmental impact of growing crops as well as increasing crop yield.
How we built it
The Croptimizer Web application uses machine learning models (Logistic Regression, Random Forest, and Decision Trees) to make predictions on specific input data not collected from previous studies. This is available to anyone in the world and could be used by farmers or gardeners to make growing more sustainable and efficient. We used a dataset containing 22 different crops with 100 samples each. We split the data into training and test data. After splitting the data, we trained the classification models to predict whether or not certain conditions could grow a crop. After this, we created functions that ran the machine-learning models for each crop to give a yes or no based on input conditions.
The nutrient calculator uses a compiled database containing the crop type and the required amount of nutrients in parts per million. Arithmetic calculations were used to find the amount of salt compounds needed to be mixed with water to meet the nutrient requirements for specific crops. If specific data on the crops’ requirements could not be found, more standard requirements were used which were determined by whether the crop is a monocot or dicot plant. These basic calculations can then be scaled depending on how much solution the user intends to make.
We used Streamlit, a module in Python, to synthesize the different collab notebooks with our algorithms to make a simple and clean web application for users.
Challenges we ran into
Debugging and deploying the Streamlit app was one of the most challenging parts as well as collecting data. There is not an abundance of data available on soil conditions in Pakistan. As a result, we had to search scientific articles to find relevant data for Pakistani farmers.
Accomplishments that we're proud of
We are proud of giving our app a global application and the ability to help farmers who are being impacted by climate change as well as find plans to conduct methods of more sustainable agriculture.
Additionally, we are proud of utilizing functions to run machine learning algorithms multiple times to find which crops can be grown based on the initial input. Additionally, we are proud of our algorithm's accuracy based on the limited time to train them.
What we learned
We learned how to apply machine learning to real-world problems and real data that can make an impact. Additionally, we learned how to assess different web application designs to try and find a design that could easily be used by our audience. We brought in an outsider to use our web application which was an informative process. Continuing this project, we can use even more trial runs and incorporate more feedback.
What's next for Croptimizer
In the future, Croptimizer wants to collect more samples from various regions in Pakistan to deliver more accurate results to farmers. Additionally, we want to expand the Crop Recommendation dataset used to build the machine-learning models to allow Croptimizer to be more accurate for farmers and gardeners across the world. We’d also like to further improve the accuracy of the calculator, as well as increase the number of options for crops.
Built With
- matplotlib
- pandas
- python
- scikit-learn
- seaborn
- streamlit
Log in or sign up for Devpost to join the conversation.