💡 Inspiration

Soil degradation leads to various costs not only paid for by farmers, but by rural communities and taxpayers as well. Soil degradation also leads to frequent landslides, increase in pollution and desertification. It is caused due to intensive farming practices like overgrazing, and producing plants in unsuitable soil types. According to researchers from the European Union Joint Research center approximately $8 billion is lost annually from the global GDP due to soil degradation. This caused the food supply to decrease by 33.7%. In addition, 33% of Earth’s soil is degraded and 90% of all soil is projected to degrade by 2050. Degraded soil loses its ability to absorb water and also offers less protection to crops during floods. As a result, crops planted in degraded soil will suffer more from floods and droughts than crops in healthy soil, leading to an unstable food supply. Soil degradation is most prevalent in sub-Saharan Africa, Asia, and Europe causing an estimated 970m tonnes of soil loss every year. Education regarding sustainable farming practices is crucial to avoid these costs.

Using precision agriculture to diversify the crop rotation is a method used to prevent soil degradation. Precision agriculture is the farming management concept that uses technological tools such as apps to measure, predict, and control the crops. Diversifying the crop rotation disrupts pests’ lifecycles, adds fertility to the soil, and maintains the organic content of the soil year round. Monocropping occurs in the absence of a crop rotation, meaning that only one type of crop will be planted in the soil year round. Monocropping depletes the soil’s nutrients and requires more fertilizer, pesticides, and herbicides. The soil is more vulnerable to pests since their life cycles are less likely to be disrupted. The increased fertilizer use leads to damaged soil, and additionally contributes to water and air pollution along with the increased use of pesticides. Since the crops planted are genetically similar, their resistance to specific diseases is also similar, leading to higher disease susceptibility. These problems with monocropping combined lead to lower yields than polycropping, the practice of growing multiple types of crops on the same farm.

⚙️ What it does

To protect the soil and prevent soil degradation, we created an web app that uses machine learning to help farmers decide on what crops to plant based on details about the soil and environment. The app recommends multiple crops to incorporate into a crop rotation or other form of polycropping to avoid monocropping and further soil degradation. The app is efficient, cheap, and accessible while increasing sustainability, and reducing environmental impact. Choosing the correct crops to grow in the environment helps to reduce the need for fertilizers, water, herbicides, and pesticides and leads to greater yields than with monocropping.

⚒️ How we built it

For the project we used the Kaggle database to create a model to predict a suitable type of plants that can grow in a specific soil. This dataset is available for research purposes on the public domain. The independent variable includes all the values taken as input, which includes the temperature, humidity, pH, rainfall, nitrogen, phosphorus, potassium levels. The dependent variable is the crop the model identifies to plant in a specific type of soil. The dataset contains a total of 2200 inputs, 100 inputs for each of the 22 unique plants.

The input consists of seven values that affect the crop planted. The first three include the ratio of Nitrogen, Phosphorus and Potassium content in the soil in kg/ha. The fourth input is the temperature in degrees Celsius, and the next input is the relative humidity levels in a percentage. The next input is the pH, which measures the acidity of the soil from a range of 1 to 14. The last input value is the amount of rainfall in millimeters.

⏳ Challenges we ran into

This was the first time we used streamlit and we had to learn how to use PyCharm to create a webapp. We struggled with using Heroku to deploy the app. We wanted to display the web app on a custom url from Freenom using Heroku but were unable to resolve our errors with Heroku within the time constraints. Instead, we chose to deploy the app using streamlit.

➡️ What's next for Farm Clean

To make our web app more effective, the web app would also educate the user on farming techniques they should employ to improve the soil condition (crop rotation, eliminate tillage). The machine learning model can be integrated with robots, to monitor the field throughout the day and detect changes to soil conditions and the amount of yield to expect. We also want to improve our web app so that user can enter only some of the input fields and we use machine learning to predict what the other input fields are or find the best crop matches based off of the entered fields to make the app more accessible. We also want to work on making the web app faster.

Built With

Share this project:

Updates