Inspiration π€
Hackathons are objectively one of the most unhealthy activities for humans ππ. When Tom got a stomach bug π€’ after the first night (not Hacklytics' fault π ), we wanted to investigate what was really in our food. We believe food is the most dangerous drug in America ππΊπΈ, and by giving people an easy, firsthand view π of their consumption, everyone can make better, more sustainable π± munching options.
What it does π
Hack-A-Food essentially "hacks" into any packaged food identified by a barcode π¦π±. Upon scanning the package, the user gets insights on all ingredients π₯¦π₯©, nutrients π, additives βοΈ, as well as environmental π influences involved in creating the food. Our website also allows for interactive learning through Cerebras Inference π§ and information marks. We even recommend similar foods π½οΈ, enabling users to explore and discover healthier or more interesting alternatives as they browse through the web app.
How we built it π οΈ
We utilized the Open Food Facts dataset, providing comprehensive attributes for over 3.7 million varieties of packaged food. We called their API π to access information based on food barcodes. For our food similarity search algorithm, we employed Term Frequency-Inverse Document Frequency (TF-IDF) π vectorization of product names and keywords, calculating cosine similarity to recommend similar products. This approach effectively leveraged names, keywords, nutri-score π, and food attributes, with adjustable weights βοΈ. Our frontend was built with the Next.js framework π» for a reactive, responsive web experience.
Challenges we ran into π
Deployment. After finishing, we spent about ~4 hours struggling with deployment, yet still couldn't fully succeed π΅βπ«. Technical debt π§Ύ within our system led to infinite loops of errors, despite successful builds. The web interface itself deployed partially, but the backend infrastructure hit issues like import/export errors β οΈ. We also aimed to create a reinforcement learning (RL) model to understand relationships between foods, but computational constraints with 3.7 million data points made it impractical π€. We attempted a smaller-scale version and achieved decent results. Ultimately, we settled for a simpler recommender system but enjoyed experimenting with RL.
Accomplishments that we're proud of πͺ
We completed a hackathon despite getting super sick π€§βa true test of perseverance. We're proud of experimenting with reinforcement learning and successfully developing a smaller-scale (~10k data points) recommender model. It was incredibly rewarding to explore these new concepts.
What we learned π§
It's never truly over until it's over π. Even when feeling down π, pressed for time, and unsure we'd finish, we quickly adapted to challenges through resourceful teamwork and technology β‘. Resilience and flexibility were key lessons π we took from this hackathon.
What's next for Hack-A-Food π±
Mobile App π²! We initially attempted mobile development with Expo and React-Native but found the learning curve too steep π. Now, without hackathon constraints, we're determined to create an accessible, user-friendly mobile app π. Promoting food health education ππ should be simple and accessible to everyone!
Built With
- css3
- flask
- html5
- javascript
- mongodb
- nextjs
- open-food-fact
- python
- pytorch
- react
- recommender-systems
- scikit-learn
- tailwind
- typescript
- zxing
Log in or sign up for Devpost to join the conversation.