Pocket food scanners: what a beam of light can detect
A device the size of a keychain is held up to an apple, and sugar, protein, and calorie content appear on the screen. The physics behind this is real and has been used in industry for decades. The question is what happens to it when it is shrunk down to pocket size — and here the discrepancy between advertising and published tests is particularly large.
What the device measures
The method is called near-infrared spectroscopy. The sample is illuminated, part of the light is absorbed, part is reflected, and the reflected light is broken down by wavelength. Chemical bonds—primarily those involving hydrogen in water, fats, proteins, and carbohydrates—absorb at characteristic wavelengths, so a trace of the composition remains in the shape of the spectrum.
The key point: the device does not measure protein content. It measures a spectrum. The content is derived by recalculation using a calibration model built in advance on samples with a known composition.
Everything important follows from this. Accuracy is determined not by the device, but by the model: which samples it was trained on and how similar your sample is to them. A model calibrated on wheat varieties will not say anything meaningful about borscht.
What tests have shown
Portable devices do work for the tasks they were calibrated for. In a study on the composition of pasta with sauce mixtures, a portable device was used to determine energy, carbohydrates, fat, fiber, protein, and sugars, and the authors provide a realistically achievable accuracy for this narrow task. It is also explicitly stated there that the data companies present in promotional videos go beyond what is achievable with a handheld device.
A comparison of three devices—desktop, portable, and handheld—on the task of coriander seed authenticity showed that the pocket device handles the task: the share of correct classifications of authentic samples is about 96%. But the task there is different—not "how much of what," but "is this it or not."
The difference between the two types of tasks is the main thing. A pocket device can classify a sample into one of the known categories. It cannot name the quantitative composition of an arbitrary dish.
Four limitations that cannot be bypassed
Penetration depth is shallow. Light enters the product only by millimeters. The device sees the surface: apple skin, bread crust, the top layer of a salad. What is inside is a guess.
Uniformity is mandatory. The method is designed for a sample of uniform composition. A plate with a side dish, meat, and sauce does not meet this requirement: the spectrum is taken from one point, but the question is asked about the entire dish.
The wavelength range of pocket devices is restricted. This is done for the sake of price and size, and along with it, what is actually distinguishable in the spectrum is restricted.
Calibration is not transferable. A model for apples does not work on pears, and a model for raw meat does not work on cooked meat. Each new category requires its own calibration on its own samples.
Where such devices are useful
- Agriculture and processing. Grain moisture, milk fat content, dry matter in feed—these are uniform samples, narrow tasks, and calibrations are built on-site.
- Authenticity verification. Distinguishing a spice from a fake, one variety from another—this is a classification task, and the device handles it well.
- Incoming sorting. Rapid rejection of a batch that does not match the expected spectrum.
What all three have in common is the repeatability of conditions: the same product, the same preparation, the same calibration. A home kitchen does not provide any of these conditions.
Why it is easier to get the answer on packaging and on a plate in a different way
For a packaged product, scanning the spectrum is a workaround: the manufacturer has already indicated the composition and nutritional value on the label, and these values are retrieved in full via the barcode, rather than approximately. How this path works is analyzed in the materials on barcodes and product databases.
For a home-cooked dish, an accurate answer is provided not by a beam of light, but by a recipe and a scale: the sum of the ingredients is known, and dividing it into portions is simple arithmetic. This is analyzed in the material on calories in home-cooked food.
For someone else's dish, the composition of which is unknown, only an estimate remains—based on appearance and typical recipes. It is inaccurate, but its limitations are at least understandable: they are covered in the material on food recognition by photo.
How to read a seller's promises
- Ask about calibration. Which product categories it is built on and how many samples are in it. The answer "on all products" means there is no calibration.
- Test on something known. Hold the device up to a product whose composition is written on the packaging and compare. Discrepancies of several times are a common result outside of calibration.
- Distinguish classification from quantity. "Determines ripeness" and "determines caloric content" are tasks of different complexity, and the second is an order of magnitude harder.
- Remember the surface. No device of this kind can see the filling under the dough or the dressing under the top layer of a salad.
Frequently asked questions
- Can a pocket scanner determine the caloric content of a dish?
- For an arbitrary prepared dish, no. The method is designed for homogeneous samples and works via a calibration model built in advance for a specific category of products. A plate with a side dish, meat, and sauce does not meet this requirement.
- How does such a device work?
- It illuminates the product and breaks down the reflected light by wavelength. Chemical bonds in water, fats, proteins, and carbohydrates absorb light in characteristic ways, and the model estimates the composition based on the shape of the spectrum. The device measures the spectrum, not the nutrient content.
- Why does the device make mistakes with homemade food?
- Light penetrates the product by only a few millimeters, so only the top layer is visible, and calibration does not transfer from one category to another: a model for raw meat does not work on cooked meat. Plus, pocket devices have a limited wavelength range.
- In what tasks do such devices actually work?
- Where the sample is homogeneous and the task is narrow: grain moisture, milk fat content, or verifying the authenticity of spices. In verifying the authenticity of coriander seeds, a handheld device correctly identified about 96% of genuine samples.
- What should I ask the seller before buying?
- Which product categories the calibration is built on and how many samples it contains. Then, test the device on a product whose composition is written on the packaging: discrepancies of several times outside the calibration range are a common result.
Read next
- How a neural network recognizes food in a photo — A photo of a plate turns into a number on the screen in a few seconds, and from the outside, it looks like a measurement.
- Where do apps get calorie and macronutrient data and why do the numbers differ — The same cottage cheese gets different calorie counts in two apps, and people usually assume one of them is wrong.
- Calories and macros on the label: why the numbers don't match reality — The same buckwheat in three different apps gives three different calorie counts, and the package shows a fourth.
This article is for general information. It is not medical advice, a diagnosis, or a prescription for treatment or a diet, and it does not replace a consultation with your doctor. If you have a health condition, are pregnant, take medication, or follow a diet prescribed to you, decisions about food belong with your doctor.
Figures from regulations, guidelines and studies are given as they stood when this article was prepared and may since have changed; check them against the primary sources. This article is not advertising, an offer, or individual advice, and neither the author nor the site owner is responsible for decisions taken on the basis of it.