This past year, the pandemic has devastated the whole world and many people and communities are still recovering from permanent effects that the pandemic has left behind. As the economy slowly recovers, there are still many people who are homeless and struggling, not knowing where their next meal is going to come from. Yet, for many years, food waste has been a major issue in America. Most restaurants and supermarkets in the United States toss a startling 94% of their excess food away since it is cheaper than packing, delivering, and connecting with food banks. Furthermore, most of this food ends up in landfills where it releases methane gas contributing to global warming which leads to adverse environmental effects. Our inspiration was to create a cost efficient system that connects restaurants and supermarkets to local food banks. To solve this problem, we decided to create Supporthaven.

What it does

One of the main challenges of connecting surplus food from supermarkets and restaurants with food banks is that supermarkets and restaurants do not like to release their surplus amounts of food as it might indicate food wastage amounts. Our application addresses this problem by using machine learning to predict possible surpluses from publicly available data such as current inventory, price and expiry date of different categories of food items. Using this surplus data, we are able to connect donors with receivers based on receiver needs. We also included google maps in our website so that way the user can enter the address they would like to donate to and find out the distance.

How we built it

The front end of the Website was built using Python with the Django framework as well as some HTML, CSS, Javascript, and Jquery. The authentication system implemented on the Website uses the default Django authentication system which provides extra layers of security. The backend of the Website was created with Python. By using graphical models, we made dummy data that closely represented actual grocery store food data. We used different regression-based machine learning algorithms, like gradient boost, k-nearest neighbor, decision tree and ensemble learning to train our surplus quantity learning model. We used the gradient boost regressor finally as it gave the best accuracy (between 98-99%) on our evaluation data set. From there, we used a linear cost assignment algorithm from the Python scipy package to match donors and receivers; the calculated donor-receiver matching guaranteed that the most money was salvaged by donating food that would otherwise have been wasted.

Challenges we ran into

The biggest challenge we ran into was trying to connect the backend matching algorithm to the frontend forms. Furthermore, we found that keeping track of two databases, one matching algorithm, and one machine learning algorithm was like playing a juggling game in itself. But fortunately, by restructuring our code (and consulting countless YouTube videos) we were able to overcome the challenges.

Accomplishments that we're proud of

One accomplishment that we are proud of is connecting the machine learning algorithm to the front end of the application. As we talked about before, this was by far the toughest challenge we faced when making this project. When training and testing our machine learning model, we used various regressors and were able to find one with 99.84% accurate predictions. Additionally, we are proud of how we figured out to make simulation data in order to predict surpluses. Since we could not find any sources that could help us with this, we had to test our own hypothetical solutions that closely modeled real-life grocery stores’ food data and finally found one that worked.

What we learned

Our biggest takeaways from this project were learning how to make and connect Django databases with machine learning and figuring out how to simulate data to match real life scenarios.

What's next for SUPPORTHAVEN

To add on to Supporthaven, we plan to tackle the problem with delivering food from donor to receiver. Currently, many restaurants and grocery stores do not have enough drivers to transport from location to location and so they waste a lot of food. Our plan is to add a feature which matches drivers with donors in order to make a more streamlined food donation process.

Share this project: