Inspiration

How often do you open your fridge and think, 'Wow, this food item is about to expire,' or 'I have no idea what to make with this'? If you're like us, it happens more often than you'd like. That’s why we created this app, to make it easier to find great recipes using the ingredients you already have, so nothing goes to waste.

What it does

It takes as input photos of ingredients, and then returns a page of up to 5 random recipes sourced from Food Network that contain the ingredients from the picture.

How we built it

To build this app, we created a database to store recipes and the nutritional macros for each food item. We sourced the recipes dataset from this GitHub repo: link. Then, we used Flask in Python to set up the backend of the web app, which makes calls to separate scripts for querying the database based on the ingredients recognized in the input images. For image analysis, we utilized OpenCV and a pre-trained YOLOv5 model, which processes the uploaded images and identifies the ingredients present in the image. The frontend is implemented entirely using HTML/css and Javascript.

Challenges we ran into

One of the challenges we encountered was training a YOLOv5 model to accurately scan food items when using a smaller, less diverse dataset. The limited dataset necessitated adjusting confidence thresholds to account for variability, but this approach was not ideal for images with differing resolutions, lighting conditions, and object sizes. In the end, we used YOLOv5s which is pre-trained and optimized for food detection.

Accomplishments that we're proud of

Although our image recognition isn't as robust as we'd like, we're incredibly proud of the progress we made with OpenCV, starting with no prior experience. Additionally, we're proud of how our app promotes sustainability by reducing food waste and creating seamless interactions between the user, database, and recipe recommendations.

What we learned

The biggest lesson we learned was the importance of breaking down a project into clear, manageable tasks rather than focusing solely on the final result. Proper planning ensures a structured approach, optimizes time and resource management, and makes the development process more streamlined. We realized that as the project progressed, development slowed down, which we attribute to insufficient planning and addressing problems only as they arose. This experience highlighted the value of anticipating challenges and proactively creating a roadmap for the entire project lifecycle.

What's next for Recipe Generator from pictures of ingredients

One potential addition is introducing an option to filter recipes based on nutritional goals such as calorie intake, weight management, protein content, or other common dietary preferences. This feature would improve the tool's convenience and utility. This would alas allows users to customize their results to align with specific health objectives and dietary needs simply from the click of a picture and some filters. (Fun fact: if you look closely at the source code, sliders for macros are already fully implemented, just hidden until we can get a dataset that includes all the macros associated with each recipe!)

Share this project:

Updates