At MHacks 2024, our team worked on a farming problem: how to make soil and crop data useful for decisions about fertilizer and yield. Fertilizer overuse has environmental consequences, while cost and access to information can make decisions harder for smaller or first-time farmers.

We built FarmX, a 24-hour prototype combining nitrogen prediction, crop-yield projection, and farmer resources. I worked on the frontend and machine learning models, developing the Streamlit application and integrating the predictions into the interface.

Turn the idea into something we could finish

The scope centered on a few concrete questions. Given environmental conditions such as temperature, humidity, pH, and rainfall, what nitrogen value does the model predict? How does projected yield change with crop type, moisture, weight, and harvested area?

Those questions gave the application a structure. Users could enter conditions, inspect predictions, and compare crop and yield information. A resource page linked out to soil-health, fertilizer, and USDA-related material so the experience included a route to further information.

Change tools when the workflow calls for it

We initially explored a KivyMD direction and shifted to Streamlit. With the data and model work already in Python, Streamlit provided a direct way to bring the predictions into an interactive application within the deadline.

I worked on making that interface and the ML models function together. Random Forest models supported the prediction tasks, with saved models reused in the Streamlit workflow. Scatterplots, correlation matrices, and actual-versus-predicted views helped us inspect the data and outputs.

The time constraint made tool choice practical. We were learning several parts of the stack as we went, and the project needed a working path from input to result.

What we took away from MHacks

FarmX won Best Sustainability Track at MHacks 2024. We finished with a working prototype that connected an agricultural problem to a model and an interface, rather than leaving it at a prediction notebook.

The prototype was not a field-validated farming system. Ideas such as phosphorus and potassium prediction, geographical soil data, and sensor inputs would require more data and evaluation. Within the hackathon, the achievement was getting a focused version working and making its purpose understandable.

The project gave me early experience working across frontend development and model integration under a deadline. It also connected sustainability to the kind of technical work I enjoy: turning data into something a person can interact with.

Explore FarmX - Sustainable Agriculture

  • Python
  • scikit-learn
  • Random Forest
  • Streamlit
  • Pandas
  • NumPy