FoodTimer | Barcode Research

This week I want to dive into the barcode database, trying to upgrade a better user experience for users to input food info to the FoodTimer. Ideally, the happy path for a user to track the fresh-food duration is simply scanning the barcode from the food label and the food name and suggested expiration duration will be automatically applied to it.

To achieve the goal, I separated it into several baby steps:

Step 1: Research Phase:

  • Understanding barcode history and symbology
  • Barcode database for food
  • Food expiration database
  • How to bridge the gap between the barcode and the expiration suggestion

Step 2: Technology Feasibility & User Experience Joint Evaluation

  • What's the user scenario when users want to track the food expiration duration? Prioritize them
  • What's their user journey?
  • What inevitable information/action does the user need to provide to achieve the goal? Any process that can be assisted/simplified by technology?
  • How can the technology help during the process? Difficulty level? Prioritize them.

Step 3: Development Phase

  • TBD

Here's what I got so far.

1 Research Phase

1.1 barcode history and symbology - GTIN, EAN and UPC

The Global Trade Item Number (GTIN) is an identifier for trade items developed by the GS1 organization. The commonly used barcodes of retail goods are either 13-digit GTIN, or 12-digit GTIN, or 8-digit GTIN. 13-digit GTINs are encoded as EAN-13, whereas 12-digit GTINs are encoded as UPC and 8-digit GTINs as EAN-8.

Screenshot from Wikipedia

The European/International Article Number (EAN/IAN), is a standard describing a barcode symbology and numbering system used in global trade to identify a specific retail product type, in a specific packaging configuration, from a specific manufacturer, originally from EU. EAN-13 is the most commonly used barcode system for retails, in which the first 3 digit represents the country and the last 4 digit represents the manufacturers.

UPC (technically refers to UPC-A) consists of 12 numeric digits that are uniquely assigned to each trade item developed by George J. Laurer in US. It's also well-developed and used across the globe. The EAN-13 can be the superset of UPC-A when a prefix with a first digit of "0" indicates a 12-digit UPC-A code follows.

The less commonly used 8-digit EAN-8 barcode was introduced for use on small packages, where EAN-13 would be too large. These are generally used for periodicals like magazines or books, to indicate the current year's issue number; and weighed products like fresh food (meat/vegetables etc), to indicate the manufacturer's suggested retail price.

In sum, normally the goods used EAN-13 or UPC as barcodes, while weighed products like fresh food used EAN-8.

1.2 Barcode database for foods

There are mainly two free databases that are well developed and maintained: Open Food Facts and UPC Database (less data). Other barcode lookup APIs limits the request number and charge money.

Open Food Facts doesn't limit the barcode types but the database is mainly UPC-A since it's developed in US. The information of the food contains name, manufacturing, category, ingredients, nutrition, etc (see the data fields in the doc). It also provides offline database, APIs, Wrappers and SDKs that are compatible in multiple development environment including Node.js and Java.

Open Food Facts

UPC database is smaller but can serve as the supplementary database.

1.3 Food Expiration database

StillTasty is a searchable database reveals shelf life information for virtually every food and beverage found in the average kitchen. Created by Janice Revell and Regina Revell - a journalist and her mother (a retired food safety expert) - a primary source is the food safety research conducted by U.S. government agencies, including the United States Department of Agriculture, the U.S. Food & Drug Administration and the U.S. Centers for Disease Control and Prevention.

It provides the suggested shelf time for groceries like fruits, dairy, vegetables, meat, etc. The only way to get access to the shelf time is to search the item by name and click to see the shelf guide. No APIs provide.

Ten categories are provided in stillTasty
The process of getting suggested shelf time: search food by name -> Click item -> See shelf time.

1.4 Other resources

As Tom mentioned in the class, I found an ITP alumni's thesis One Less Hamburger was highly relevant, in which the author used Google Cloud Vision API to detect the text from food label picture.

There are also lots of food detection APIs on the internet: like this free food detection API, bite AI.

1.5 Status Quo & How to bridge the gap?

Status Quo

After searching groceries and food products from big stores like Trader Joes, Target and Walmart, I found that most food like chips, chocolates, bacons that have clear nutrition labels used 12-digit UPC-A and relatively long shelf date, and most of them can be found in the Open Food Facts database with full information. For those small packages and temporary food like diary, meat and vegetables, fruit etc, they use 8-digit UPC-E / EAN-8 barcode and cannot be found in the open source database.

How to bridge the gap

In that case, for those food with long shelf date, their full information can be easily gotten and it's not a problem to keep record of. But for those food easily rotten, their information was hard to get from the open database and thus, we had to use alternative ways like food detection to get its name and category, etc.

For the stillTasty database, we need to manually scrap its info and clean it up so as to use it in my database.

2 Technology Feasibility & UX Design

I drew the current user journey and the proposed new user journey to the same map so as to compare the differences. The core need we are trying to solve is to find a way to help people better recognize food status (still fresh/rotten) and reduce the food waste as well. We believe that it is crucial for people to keep themselves healthy, in that most metamorphic process cannot be seen by our naked eyes, as well as keeping the environment healthy since we can properly manage our food before their turning bad and reduce the waste.

We are imagining to use both application on the smartphone and a hardware device as a peripheral to solve the problem. The users need to at first save the food data into the database so as to keep track of them.

We categorized 2 types of food that were normally suitable in our use cases: 1) Main use case - 8-digit/no barcode temporary food with short shelf date, like fruit, vegetables, dairy & eggs, meat, fish and seafood, baked food, beverages; 2) 12-digit barcode food with clear nutrition label.

To simplify the data-filling process so as to provide a better user experience, we used multiple ways to help auto-fill the food information. For the second type, their barcode numbers can be scanned to find the food name, category, expire-by-date and nutrition and ingredient information in the Open Food Fact database. For the food with 8-digit barcode or without barcode, things became a little bit tricky in that no information available in the barcode database. We had to use food detection API to differentiate food and then give suggested shelf time accordingly.

The food information we need for each doc was:

  • Food name
  • Barcode/QR-code, unique ID
  • Categories
  • Food status (opened/unopened/raw/cooked/frozen/prepared/fresh/leftovers/finished, can be more than 1 tags).
  • suggested shelf time (according to StillTasty or manually set by user)
  • starting time (default is the data created date)
  • storing place (optional)
  • Label (optional)
  • ingredients (fat-free, vegan, etc) (optional)
  • others

The interface design of app of both the smartphone and hardware is as follows.

New Interface Design

Prioritize development list

  • Create fake ideal database
  • Realize scan barcode functions
  • Realize image recognition functions
  • Shelf time auto-fill based on food status and place
  • Search/tag functions
  • UI 1:1 realization