Inspiration
Food waste is a global problem of staggering proportions. According to the United Nations, approximately one-third of all food produced worldwide goes to waste each year, amounting to about 1.3 billion tons. In a world where millions go hungry, it is an environmental crisis. Lefty aims to empower its users by suggesting recipes that prioritize the use of existing ingredients at home.
About Lefty
Lefty is a mobile application developed using React Native. It helps users discover new recipes based on the ingredients they have on hand. The app offers various features to streamline the recipe discovery process, including ingredient scanning using the device camera, a user-friendly interface for adding and managing ingredients, and a detailed recipe view with step-by-step instructions.
Key Features:
Ingredient Scanning: The app allows users to scan ingredients using their device's camera. It leverages Google Vision API to identify ingredients from images and Spacy Text Classification to further enhance accuracy, making it easy for users to add ingredients to their recipe search.
Ingredient Management: Users can manually add ingredients by typing or scanning, and they can view and edit their ingredient list. The app also provides an option to clear the ingredient list for a fresh start.
Recipe Search: After adding ingredients, users can search for recipes that match the ingredients they have. The app sends a request to an external recipe API, Spoonacular, to fetch recipe results. Users can adjust the search criteria and sorting options.
Detailed Recipe View: Users can view detailed information about each recipe, including a description, a list of required ingredients, and step-by-step cooking instructions. This view helps users decide which recipe they want to prepare.
Filter and Sort: The app offers a filter and sort feature to help users narrow down their recipe choices. Users can filter recipes by dish type, cuisine, dietary preferences, and more. Sorting options include ingredients needed and ingredients matched.
How Lefty Was Built
React Native framework was used to form the basis of the app. Libraries like react-native-element and react-native-paper were also used for further UI enhancements.
The recipes and ingredients were obtained from an open-sourced API, Spooncular.
On top of users entering each ingredient they wish to use, an AI image recognition feature was also implemented with Google Vision. The result of the image recognition software was an exhaustive list of keywords relating to the image, some of which even non-food related.
Thus, the need to process the text arose. Using spaCy and its TextCategorizer package, we were able to train a model with natural language processing abilities, using a list of over 3000 words to correctly identify food, from non-food products.
Lefty utilizes the custom model to correctly display a list of food items to the user after scanning a table of ingredients.
Challenges Faced
The greatest challenge we faced was the output of the Google Vision being an exhaustive list of keywords relating to the image, some of which even non-food related. Since the nature of Google Vision did not entail labeling, we implemented our own model to process the text.
With no experience in AI or machine learning, we quickly picked up the basic skills required to train and implement the model in the app. This was done with spaCy and its TextCategorizer package, in Python.
Another challenge faced was the API requiring very specific ingredients, with a differentiation between "vegetable" and "broccoli", for example. This results in an input of "vegetable" not being able to produce the same output as if the user entered "broccoli" instead. To resolve this issue, future iterations of Lefty will use a broader range of API sources to obtain even more ingredients and hence recipes.
Language processing might also be implemented to categorize. For example, by grouping "broccoli", "spinach", "cauliflower", etc. together as "vegetable", a query of any of these keywords will produce the same list of recipes.
Future Plans
- Expand database: By consolidating search results from multiple API sources, Lefty will be able to provide results for more variations of keywords.
- Inventory tracker: An additional page with custom ingredients added to inventory can further allow users to know what they have at home, so they can use the existing ingredients before purchasing more.
Built With
- amazon-web-services
- flask
- google-vision
- javascript
- python
- react-native
- spacy
Log in or sign up for Devpost to join the conversation.