NutriLens AR

NutriLens AR

Screenshot
Screenshot
Screenshot
Screenshot
Screenshot
Screenshot
Screenshot
Screenshot
NutriLens AR
NutriLens AR checks food in the shop. Scan a barcode or a product name and get a health score from 0 to 100. With AR, the score floats above the real package, and the sugar, salt and fat drop onto your table as cubes and spoons you can count.
Genre Simulation
Release Date 30.11.2026
Academic Term: 2026 Fall Semester
Platform Android
Engine Unity
Supervisor Andrejs Birzgals Teacher

About This Software

Description

NutriLens AR is an Android app for grocery shopping. Scan a barcode or point the camera at a product name. The app gives the product a score from 0 to 100. With AR, it also shows how much sugar, salt and fat is inside.

Who it is for

Adults in Latvia and the Baltics who want to eat healthier but don't read the small print on labels. For example, parents who buy food for their kids, people with food allergies, and people who have to eat less sugar or salt.

The problem

Labels show grams per 100 g. "10.6 g of sugar" is hard to imagine. A shelf has ten similar products, and you would have to read ten labels to compare them. Many Baltic products have no Nutri-Score letter.

The AR solution

The app turns numbers into things you can see next to the real product. It uses two AR mechanics:

  • Ground Plane. Sugar cubes (4 g each), teaspoons of salt or pieces of fat drop onto your table. You see how much is in one portion or in the whole pack. A 330 ml can of cola is almost 9 sugar cubes.
  • Image Target. A score card floats above the real package on the shelf. The app uses the package itself as the target, so you don't need to print anything. It can follow up to 6 packages at once and marks the best and the worst choice.

Why AR

Grams are hard to picture, but you can count a pile of sugar cubes on your own table. On the shelf you see the score above each package, so you don't have to look back and forth between the phone and the shelf. This only works with AR, because the app needs to know where the product and the table are.

What you can do

  • Tap the card above a package to open the product page.
  • On the table, switch between sugar, salt and fat, change the portion (100 g, one serving or the whole pack), move the pile, and put a second product's pile next to it.
  • Play "Sugar detective": guess how many cubes there will be before they drop.

More features

  • A profile with the 14 EU allergens and diets (vegan, no palm oil, less sugar or salt). If a product is not right for you, you see a warning and the AR card gets a red frame.
  • Healthier products from the same category.
  • "Ingredients" mode: the camera colours the E-numbers on the ingredient list by risk.
  • "Table" mode: if a product is not in the database, the app reads its nutrition table and scores it.
  • A shopping basket, a food diary with a weekly chart, a score card you can share, and the score read out loud.
  • 32,793 products work offline: Latvia, Lithuania, Estonia, and popular products from Poland, Finland, Germany and Sweden. Online, the app searches all of Open Food Facts.
  • Latvian, English and Russian. Light and dark theme.

Technical

Made with Unity 6000.3.23f1 and Vuforia Engine 11.4.4. Needs Android 10 or newer with ARCore. Both AR mechanics run on the free Vuforia plan with no watermark. The score is for information only. It is not medical advice.

Sources and licences

  • Product data: Open Food Facts (ODbL 1.0). Product photos: CC BY-SA 3.0.
  • Nutri-Score 2023 algorithm: Merz B. et al., "Nutri-Score 2023 update", Nature Food, 2024.
  • Fonts Onest, Unbounded and Noto Sans: SIL Open Font License 1.1.
  • ZXing.Net: Apache 2.0. Google ML Kit, Vuforia Engine (Basic plan) and Unity: their own terms.
  • Icons, logo and 3D models were made by the author.

Documentation

1. Idea

The first idea was Garden Planner AR, a garden planner with GPS and Ground Plane. After the first prototype it was dropped because it was too big for this project. The new idea is to check food in the shop.

Apps like Yuka already show a score, but only on the screen. NutriLens uses AR to show the amount as real objects and to put the score right next to the product.

2. Main choices

ChoiceWhy
Image Target from the cameraYou can't use a printed marker in a shop.
Ground Plane for sugar, salt and fatThe pile works on any table, no marker needed.
Vuforia, not AR FoundationIt has both mechanics and can make an Image Target while the app runs.
ZXing.Net for barcodesThe Vuforia barcode scanner shows a watermark on the free plan.
Offline databaseShops often have bad internet.
One score (0–100) and 4 coloursYou can decide in a second.
Latvian, English, RussianThe languages people in Latvia shop in.

3. Tools

  • Unity 6000.3.23f1 (Built-In Render Pipeline). The whole interface (uGUI) is built in code.
  • Vuforia Engine 11.4.4, Basic plan.
  • ZXing.Net: reads barcodes (EAN-13, EAN-8, UPC).
  • Google ML Kit Text Recognition: reads product names, ingredients and nutrition tables (through a small Java plugin made for the app).
  • Open Food Facts: product data.
  • Newtonsoft.Json, Android TextToSpeech, MediaStore.
  • Python: prepares the data.

Build: Android, IL2CPP, ARM64, Android 10 (API 29) or newer. APK size 68.9 MB, version 2.7.

4. How the AR works

Image Target

  1. The user scans a barcode or a product name (ML Kit). The app finds the product.
  2. The "Pin" button takes the part of the camera picture inside the frame (greyscale, up to 640 px). If the picture has too little detail, the app rejects it.
  3. The app turns this picture into an Image Target while it runs (ObserverFactory.CreateImageTarget). Up to 6 at once.
  4. A 3D card appears above the package: score, colour, a better alternative and its rank among the visible products. If the product is not right for the user's profile, the card has a red frame.
  5. Tap the card to open the product page.

Ground Plane

  1. The Plane Finder starts looking for a surface as soon as the product page opens. The pile appears by itself when the surface has been steady for 0.45 s.
  2. Sugar cubes (4 g) and pieces of fat (10 g) fall with real physics (Rigidbody). Salt is shown in teaspoons (6 g).
  3. You can switch between sugar, salt and fat, change the portion, move the pile and add a second product's pile.
  4. "Sugar detective": guess the number of cubes before the pile drops.

All 3D models are made in code. The biggest pile has about 41,500 triangles (the limit is 50,000).

5. Data and score

  • 32,793 Open Food Facts products work offline (LV, LT, EE and popular PL, FI, DE, SE products). If a product is missing, the app searches the Open Food Facts API, or the user takes a photo of the nutrition table.
  • The name search gives rare words more weight (IDF) and understands Latvian and Lithuanian word endings.
  • Score: 60% nutrition (Nutri-Score 2023), 30% additives, 10% organic. A high-risk additive caps the score at 49. Alcoholic drinks get no score.
  • Levels: 75–100 excellent, 50–74 good, 25–49 average, 0–24 poor.
  • Nutrient colours use the UK FSA limits. Daily limits: EU (90 g sugar, 6 g salt, 70 g fat), WHO (50 / 5 / 70 g) or your own.
  • Profile: 14 EU allergens and diets. If a product has no allergen data, the app says "unknown".

6. Problems and fixes

ProblemFix
Garden Planner AR was too bigNew idea: food in the shop
A printed marker doesn't work in a shopImage Target from the camera
The Vuforia barcode scanner has a watermarkZXing.Net
Ground Plane was slow to find the tableThe search starts early and the pile appears by itself
Shiny or plain packages don't track wellA detail check and a tip for the user
Antivirus blocked Gradle downloadsIts certificate was added to the Java trust store
Gradle error "Duplicate class kotlin"Removed androidx, sharing now uses MediaStore
Bugs found in testing: allergens, basket, search, beer score, equal scores on the shelfFixed. Each one now has an automatic check in Unity.

7. Testing

  • Unity: every screen is saved as an image in 3 languages and 2 themes. Automatic checks repeat the bugs that were found.
  • Samsung Galaxy S23 Ultra: barcode, Image Target with several packages, Ground Plane, comparing two products. The demo video was recorded on this phone.
  • Xiaomi Redmi Note 10S (M2101K7BG): the app installs and the AR mechanics work.

8. Licences and sources

ResourceSourceLicence
Product data, E-number listOpen Food FactsODbL 1.0
Product photos (demo targets)Open Food FactsCC BY-SA 3.0
Nutri-Score 2023 algorithmMerz B. et al., Nature Food 5, 102–110 (2024)Scientific paper
Nutrient colour limitsUK FSA, front-of-pack guidance (2016)Public information
Daily limitsEU Regulation 1169/2011; WHOPublic documents
Fonts Onest, Unbounded, Noto SansGoogle FontsSIL OFL 1.1
ZXing.Netgithub.com/micjahn/ZXing.NetApache 2.0
Google ML KitGoogleGoogle APIs Terms of Service
Vuforia Engine 11.4.4PTCVuforia Developer Agreement (Basic)
Unity 6Unity TechnologiesUnity Personal
Newtonsoft.JsonUnity packageMIT


 

Controls / How to Play

1. Allow camera access when the app asks. 2. Scan: point the camera at a barcode or a product name. The score appears at the bottom. Tap "Open" for the full product page. 3. Show on the table: on the product page tap "Show on the table" and point the phone at a table. Guess the number of sugar cubes, then watch them fall. Switch Sugar / Salt / Fat and the portion. "Move" moves the pile, "Compare" adds a second product. 4. Above the pack: tap "Above the pack", put the front of the package in the frame and tap "Pin". The score card stays above the real package. Pin up to 6 packages to compare them. Tap a card to open the product. 5. Modes at the bottom: Scan, Ingredients (E-numbers on the label), Table (read a nutrition table), Basket. Tips: good light, a table with some texture, the front of the package in the frame.

More from Ņikita Magamedgadžijevs

See All
The Lost Key
Programmer
NiikmaG NiikmaG
0
141
Count or Boom
Programmer
NiikmaG NiikmaG
1
150
Planet Shield
Programmer
NiikmaG NiikmaG
0
141
The Merger Of Shadows
Game Designer
NiikmaG NiikmaG
1
295