Inspiration
When I was young, my Mom gave me a simple task: grow any plant of my choosing in my garden until we can harvest it. I went to Home Depot and chose the first plant I saw; a zucchini. Just weeks after starting out, I hadn't checked on my plant in a few days, and was devastated to find that the entire plant was infested with pests, and would not be able to be used. If only I had been able to recognize when pests were infecting my plant early on, I could have saved it.
When I researched problems in Haiti and found that farmers have loss estimates ranging from one-third for cereal grains and legumes to nearly 50% for fruits and vegetables due to pests, plant diseases, and other factors, I knew I had to act. That's why I made CropIQ, which delivers a suite of farming applications to farmers in Haiti to improve their crop yield, boost their economy, and give them another chance against their natural roadblocks.
What it does
CropIQ provides a suite of applications for farmers to increase crop yields, forecast natural disasters or volatile weather, or recruit help. Users can sign into the portal using their credentials depending on whether they are a farmer or a user.
For farmers, we have a plant health analyzer, crop harvest checker, job postings, and weather forecasting. The plant health analyzer uses a picture of the farmers crop and analyzes it to see if there is any disease or not. The crop harvest checker also uses a picture of the crop and determines whether the crop is flowering, undergoing germination, ready to harvest, or is ready to eat (vegetative). Next, the job postings tab allows farmers to create job postings if they are in need of additional labor to harvest crops or do any other tasks. It is coupled by an applications tab which updates after any time a user applies to the job posting (more about that in the next paragraph), allowing the farmer to quickly sort through applications and find people to work for them in real time. Finally, there is a weather forecasting tab which uses real time data to see if there are any storms coming or if there are any natural disaster warnings in the area. This is especially useful if a crop needs to quickly harvest his crops or store them someplace else before a storm so that the crop is not ruined.
For the average user, there are two main features. Educational agriculture videos and job postings. The farming videos help educate them in agriculture and give them the experience they might need to work a real farming job. This is also useful because in Haiti, the quality of public education is very weak, and with over half of the population in poverty, most cannot afford an education or have low-quality teachers. Next, there are job postings. If a farmer decides to put a job posting out because they are in need of additional labor, it will be updated on the user's side and will allow them to apply with their email and resume. That allows the farmer to be able to coordinate a meetup later and quickly judge the skill level of the candidate.
How I built it
I built my app in Python. For my app, I used the Streamlit framework to display all my components. To implement user videos, I used Google Drive integration with gdown to pull videos from Google Drive and temporarily store them so that the user could download them or watch them. For my plant health analyzer model, I used a Convolutional Neural Network (CNN) fine-tuned on the pre-trained model MobileNetV2. I trained this on the "Plant Diseases" dataset on Kaggle and was able to achieve around 93% accuracy with my model. For the crop harvest checker, I used a YoloV8 model trained on public data to correctly identify which stage of growth a plant was in. For my Weather tab, I used two open source APIs, open-meteo and GDACS. Open-meteo retrieved weather data from online, and I was able to access the precipitation levels and other details to manually classify some days as being stormy according to these indicators, and GDACS looked for natural disaster alerts around Haiti.
I also used tools like PIL for image reformatting and requests to fetch data from those API links mentioned above.
Challenges we ran into
One of the biggest challenges I ran into was regarding my model training. I was unfamiliar with Convolutional Neural Networks, and I struggled with learning how to train it and implementing it into my Streamlit app (my tensorflow install wasn't recognized a lot of the time due to package issues). Along with that, it was also my first time training a YoloV8 model.
Along with that, I had a lot of trouble deploying to the Streamlit Community Cloud. This was because my requirements.txt and packages.txt were not getting read sometimes along with files that were too big and a whole string of internal errors. However, after lots of time and perseverance, I was able to deploy my website here.
Accomplishments that we're proud of
I am extremely proud of training my own CNN (Convolutional Neural Network) and YoloV8 model as it is the first time I have ever done so. I am also extremely proud of integrating login/logout functionality into my app and implementing the models above into there as well. Overall, I was very happy with how this turned out.
What we learned
One of the most important things I learned in this hackathon is file and package management. After running into countless package errors, I was able to learn how to effectively manage my packages and how the internal system works. I also learned how to deploy to Streamlit Community Cloud using a Github repository, something I had never done before.
What's next for CropIQ
As of now, I don't have user registration. However, that is a necessary feature I need to add. Currently, the only two users that work are these:
User Account (seeking jobs, education): Farmer Account: Username: jake54 Username: jaden_lakay Password: password Password: farming
Please use these accounts if you would like to test the features of the app.
Along with that, I would like to use React.js to make the app into a complete web app, and Flutter and Dart to unlock mobile app capabilities for the program.
Built With
- base64
- gdacs
- gdown
- github
- glib
- googlecolab
- kaggle
- keras
- numpy
- open-meteo-forecast
- python
- requests
- streamlit
- streamlit-cloud
- tensorflow
- yolov8
Log in or sign up for Devpost to join the conversation.