Free Of


Course Project | April 2019 - May 2019

Background


Free Of was created as my term project for 15-112 Fundamentals of Programming and Computer Science at Carnegie Mellon University. This course is a popular freshman year course that covers python programming in immense detail. The project involved creating a unique program during a 3-week time period using python. My project also incorporates open cv and webscraping. As a person with many food allergies, I decided to create an interactive food allergy program that allows users to scan barcodes or type in ingredient lists and find out whether they are allergic to the food or not. There is also a recommender system for similar foods that the user wouldn’t be allergic to.


How It Works


The core component of Free Of is the method in which it is determined wether a food is safe or not safe for a consumer to eat. To determine this, I created dictionaries of the top 8 major allergens mapping the allergen name to a set of every item that would be a part of that allergen, such as including whey protein isolate in the set that is mapped to the key “Dairy.” When a user selects what they are allergic to and an item is scanned, the ingredients of the item are compared to the allergen dictionaries and if there is a match, then the item is unsafe to eat. Further, if a user types in their own allergen, then the ingredient list is separately checked for that specific allergen in particular. A more complex component of Free Of is the recommender system, which recommends similar, but safe, products to a product that a user is allergic to. To make the recommender system, I first took the dictionary of the names of every USDA food product mapped to the ingredients. I added products that had a certain percentage of similar words in the product name, as well as a certain percentage of ingredients. Once the product was found, I webscraped barcodelookup.com/ with the barcode included after the slash so that I could include photos and links to shop the recommended products.


Design Process


My main goals while developing Free Of was to make it as accurate as possible, and to be able to include as many products as possible. Because of this, I used a Food Composition Database from the USDA, as well as included an option for users to type in their own ingredients. Users could also customize their allergens to suit their needs. When users are allergic to a food, I wanted there to be similar products recommended to them that they could click to buy. By including all these features, I feel as though Free Of provides accurate and helpful information to those with food allergies.


Final Thoughts


Overall, this project pushed me intellectually and creatively, forcing me to utilize resources and help outside of what is typically taught in class to create a fully-fledged product that was completely my own. Through this project, I learned a lot about how I think through organizing data, how to manipulate and handle large products, and how to out my own personal ideas into action.