Inspiration

Agriculture is the backbone of many economies and the primary source of sustenance for billions worldwide. However, the challenges faced by the agricultural sector are profound. According to a study by the Food and Agriculture Organization (FAO), up to 40% of global food crops are lost annually due to pests and diseases. This translates to a staggering $220 billion in trade of agricultural products being affected. Furthermore, these pests and diseases are responsible for the loss of 10-16% of the global harvest, which could have been used to feed millions.

The implications of these losses are manifold. For farmers, it means reduced yields, economic hardships, and uncertainty about their future. Consumers are concerned about limited availability and the possible health hazards linked to consuming crops afflicted by disease. The ripple effect of these losses impacts global food security, the economic stability of regions, and the livelihoods of millions of farmers.

These statistics and the stories of hardship behind them deeply moved our team. We recognized the pressing need to address these substantial losses and their broader implications on society. This urgency became the driving force behind our project, inspiring us to develop a solution that would empower farmers with real-time insights and tools, ensuring their livelihoods and the safety of the global food supply.

What it does

Farmer Pro is a comprehensive digital assistant for farmers. At its core:

  • Disease Detector: Utilizing advanced machine learning algorithms, it analyzes uploaded images to swiftly and accurately identify various crop diseases, allowing farmers to make sure the crop they sell is healthy and won't spread or cause disease. It does this using a MobileNetV2 Convolutional Neural Network (CNN) model that classifies if a user-uploaded image, either through their webcam or through a file upload, is a healthy crop. The dataset we used to train this model includes thousands of images of healthy and diseased tomatos, corn, and soybeans but we have the infrastructure and resources to add more crops. After the user uploads their image, it is uploaded to our Firebase cloud database which stores the image securely from which our Flask API downloads from. Once the image is downloaded, our model runs its classification, and then uploads the result to our api that our front end reads from and displays.

  • Location-based Crop Recommendations: Farmers can pinpoint their location and receive tailored crop recommendations through an interactive map interface, optimizing yield and sustainability. Our machine learning model uses Logistic Regression trained on data points such as Latitude, Longitude, Weather data, precipitation data, heat and the pH of the Soil for that area. ML Model provides 4 crops that would be best suitable to grow in that area that user has selected and the steps to grow the product in that area. Also provides a 4 year recommendation cycle based on crop costs. Model also describes why the given order works best.

  • Real-time Farming News: A constantly updated feed ensures farmers are always in the loop with the latest agricultural research, trends, and news, enabling them to make informed decisions. The News works by dynamically updating the keywords it uses to search articles. These keywords are based on the users crop recommendation and crop image scanning history to ensure a personalized experience for users. Our backend API uses a webcrawler to get articles from newsapi and runs NLP and Sentiment Analysis on the articles to ensure only the most relevant, useful, and positive articles are presented to the user.

How we built it

We wanted to ensure that our machine learning model was extremely accurate keeping in mind the crucial information that it was predicting. We wanted to make sure that our website was easily navigable and users would have no trouble going through our website. We chose colors that were inviting and would ensure that users have a positive experience going through our pages. Our front end was created using React-Native and our Backend was created using Flask. We also used different api's for our backend machine learning models such as the weatherapi and newsapi. Features:

  • Crop disease detection: This module focuses on the detection of diseases in crops. It employs computer vision and machine learning techniques to identify diseases and pests affecting plants, providing early detection and prevention measures to farmers

  • Notification: The Notification System is designed to keep farmers informed about important events, such as weather alerts, disease outbreaks, and market price fluctuations. It sends timely notifications to help farmers make informed decisions

  • Soil Selector: The Soil Selector module assists farmers in choosing the right type of soil for their crops. It analyzes soil properties, including pH levels, nutrient content, and moisture levels, to recommend suitable crops and planting strategies

  • News: We are scrapping the news from the news api and then storing it in a sql lite database. Then we are using NLP to summarize the articles and then using Random Forrest Regression, we run a sentiment analysis on the articles that classifies them as positive, neutral, or negative. We then display all the positive articles from most to least relevant.

Challenges we ran into

  • Trying to have our backend and frontend communicate for API usage across different http and https certificates.
  • Getting both models to train in a timely fashion and avoid overfitting.
  • Working on the UI to ensure functionality looks good with React dynamic rendering
  • Finding data to train the model on was also challenging as we had to find good data with a decent number of reference images. We also ended up retraining models with our own set of images compiled online.
  • Using the news API to classify news dynamically based on the user's preferences was challenging since we have to figure out the most efficient ways to store this data.
  • One of the biggest challenges we overcome was working collaboratively with a team of 5 people, mostly with different majors and minors, and working around each others strengths and weaknesses

Accomplishments that we're proud of

We're proud of being able to accomplish and finish all the desired functionality for this project in less than 24 hours. We are also proud of being able to work on a project that may be able to be used for social good by farmers and regular people to hopefully promote self grown gardens!

What we learned

Our journey with Farmer Pro was a profound learning experience. We delved deep into the intricacies of the agricultural sector, gaining insights into the challenges and aspirations of farmers. We also realized the transformative potential of technology when applied thoughtfully to age-old practices. We also learned how to train multiple different AI ML models, how to work with OpenAI api, and how to create a webscraper as well as use NLP and sentiment analysis. We also learned how to self certificate self hosted servers to allow for frontend communication.

What's next for Croptimizer

The future is bright for Farmer Pro. We plan to expand our disease database continuously, incorporate more granular location-specific data, and foster collaborations with agricultural experts and institutions. We're also excited about introducing community-driven features, enabling farmers to connect, share insights, and collaborate globally. We also want to expand into a mobile app to allow for more portability and on the go usage. We also plan to allow for a dislike/like feature on our crop disease detection model so users can let the model know if it got something too far off. This way our model can be trained on the go, improving as more users use it, by retraining on user feedback. We would also like to allow for user auth in the future so users can get personalized news feedback that is saved across user login sessions.

Share this project:

Updates