How Anfold calculates nutrition one ingredient at a time.
Anfold works out nutrition from the ingredients, their amounts and how they were cooked. This page shows each step, where AI is involved, and where the limits are.
In short
Anfold splits each meal into ingredients, matches each one to an entry in a nutrition database, and adds them up. Today that database is USDA FoodData Central, and more are being added. When the best entry is for the raw food and you ate it cooked, Anfold recalculates it with published nutrient-retention and cooking-yield data. Every value is labeled “Verified Database”, “Verified Database, Transformed” or “AI Deduced”; the last one means no database entry fit, so the value is an AI estimate.
These are estimates, not measurements. They get closer the more precisely you describe the foods, the amounts and how they were cooked.
More
Anfold works in three steps: match ingredients to database entries, transform for cooking state, then assign a label (Verified Database; Verified Database, Transformed; or AI Deduced) so you can see how the value was produced.
To choose a database entry, we look first for the version of the food you most likely ate, then for an entry that matches how it was prepared, and only then at the data source. Cooking transformations use published retention and yield factors, mostly from USDA tables, to model nutrient changes and mass adjustments.
Where the nutrition data comes from
Anfold matches ingredients to entries in nutrition databases: reference databases that list nutrient values for generic foods. Today that’s USDA FoodData Central, a public database maintained by the United States Department of Agriculture, and more databases are being added.
Each database organizes its entries in its own way. FoodData Central has several data types: Foundation Foods (recent laboratory analyses, published for a selected set of nutrients), SR Legacy Foods (the long-standing standard reference, with the most complete nutrient profiles), and Survey Foods (foods as eaten in national dietary surveys, calculated from recipes). The data type only decides between entries that are equally typical of what you ate and equally well matched to how it was prepared; then the most recent laboratory analysis wins.
AI assistance: We use AI to extract ingredients from descriptions and images, identify cooking methods, match user-described foods to database entries, and fill gaps when database values are missing.
No branded data
We don’t use manufacturer-provided nutrition entries. Branded data varies by region, reformulation, and labeling practices. Using standardized sources improves consistency and comparability.
Ground beef · 90 g
- Protein 22.0 g × 488.0
- Fat 15.1 g × 9135.9
≈ 224 kcal
kcal per gram
- Protein4
- Available carbs4
- Fiber2
- Fat9
- Alcohol7
Calories are always calculated from the macronutrients, never copied from a database row or from AI: 4 kcal per gram of protein and of available carbohydrate, 2 per gram of fiber, 9 per gram of fat and 7 per gram of alcohol. These are the energy conversion factors of EU food labeling law.
How each value is labeled
Every value carries one of three labels, the same ones you see in the app:
- Tier 1Verified Database
- Values straight from a nutrition database entry, without changes. Used when your food matches a database entry in the same state.
- Tier 2Verified Database, Transformed
- Database values recalculated for the cooking method. Used when your food is in a different state than the database entry (e.g., steamed vs. raw).
- Tier 3AI Deduced
- AI-estimated values, used when no database entry matches or nutrient fields are missing.
What a transformation changes
Tier 2 transformations apply cooking-method factors: nutrient retention rates from USDA research, mass changes (water loss/gain, oil absorption), and preparation details (drained vs. undrained).
When values are AI estimates
Tier 3 is used when no database entry is the same food, when the only entries were cooked a clearly different way, or when the chosen entry is missing some nutrients. In that last case only the missing values are estimated; a value the database has is never overwritten.
How ingredients are matched
When you log a food, we extract its ingredients and search our nutrition database for each one with a keyword-based search. An AI model then judges which results are the same food and which of them is the version you most likely ate. The final choice follows a fixed order: that typical version first, then how the food was prepared, then the data source.
Our matching uses a progressive fallback chain: first looking for matches in the target cooking state, then falling back to raw ingredients that can be transformed. This helps provide useful data even when the database doesn’t have your exact preparation.
How one entry is chosen
- The version you most likely atePlain “cheese” means an average across the kinds people eat.
- Prepared the way you ate itBoiled carrots take a boiled-carrot entry.
- The data sourceOnly breaks a tie: the most recent laboratory analysis wins.
What that means in practice
If you log something generic, like “cheese”, Anfold prefers the database’s “not further specified” (NFS) entry, an average across the kinds people eat, over one particular variety.
Among equally typical entries, one already prepared the way you ate it wins: boiled carrots take the database’s boiled-carrot entry rather than a raw one recalculated for boiling.
An entry cooked a clearly different way is never used. Fries don’t get boiled-potato values; if nothing else fits, the line becomes a labeled AI estimate.
A few database entries list only some of a food’s macronutrients. When the chosen entry is one of them, Anfold uses a complete entry for the same food, prepared the same way, if there is one. If there isn’t, the missing values are AI estimates.
How matching works
Anfold searches for ingredients by name (e.g., “rice”, “chicken”, “broccoli”), but a matching name is not enough on its own. The AI reads each result’s full database description: plain “flour” means white flour, not whole-grain; “ground lamb” means ordinary lamb, not a lean import. Among the typical versions, an entry already prepared the way you ate it is preferred; otherwise a raw entry is transformed for your cooking method. The data source only breaks the remaining ties.
If no result is the same food, or the only results were cooked in a clearly different way, nothing is forced: the values are estimated by AI and marked as AI deduced (Tier 3).
How cooking changes the numbers
When the database has an ingredient in a different cooking state than what you consumed (e.g., raw broccoli vs. steamed broccoli), Anfold transforms the nutrition data using retention and yield factors that account for both nutrient retention and mass changes.
Cooking affects food in two ways: nutrients can degrade or leach (retention), and mass can change through water loss/gain or oil absorption (yield). Our transformations model both effects separately.
Raw or cooked? How Anfold accounts for cooking losses and weight change
Cooking changes two things, and Anfold handles them separately. Some nutrients are lost to heat or to the cooking water (retention). And the food’s weight changes as water leaves or is absorbed (yield), which changes how much of everything sits in each 100 g.
- 100 g of dry rice becomes about 240 g once boiled, so cooked rice has well under half the calories per 100 g of dry rice.
- Meat goes the other way. Raw chicken breast has about 23 g of protein per 100 g. Grilled, the same protein sits in about 75 g, so it reads about 31 g per 100 g. Nothing was gained; water left.
Rice, boiled
The same nutrients in about 2.4 times the weight, so each 100 g has well under half the calories.
Chicken breast, grilled
The same 23 g of protein in about 75 g, so it reads about 31 g per 100 g.
So it matters which weight you give. Anfold reads the weight of a side like rice or pasta as what was on your plate, unless you say it’s the dry weight (“80 g rice, dry”).
Frying oil is counted once. If your meal lists the oil or butter, that line is the fat that counts, and Anfold adds no absorbed oil to the fried foods. If it doesn’t, Anfold adds a typical amount of absorbed oil to fried foods, more for deep-frying than for a pan. Fatty meat is the exception: it renders its own fat, so it gets none.
The core calculation
Anfold always works with a 100g reference sample: convert source per-100g to absolute amounts, apply retention factors (nutrient loss), compute final mass (yield + category adjustments), add oil if applicable, then convert back to per-100g in the target state.
Retention factors
Different nutrients behave differently during cooking. Macros are generally stable. Water-soluble vitamins (B, C) are heat-sensitive and leach into water. Fat-soluble vitamins (A, D, E, K) are more stable. Minerals don’t degrade but can leach if drained.
Mass changes
Dry heat drives water out: grilled meat ends up at about 75% of its raw weight, roasted vegetables at about 80%. Grains and dried pulses absorb water instead (rice ends up at about 240% of its dry weight). Frying adds absorbed oil, which adds both weight and fat.
Drained or undrained
Keeping cooking liquid dramatically improves nutrient retention. Boiled-drained loses ~45% of water-soluble vitamins and ~20% of minerals. Boiled-undrained retains ~85% of vitamins and ~95% of minerals.
How mixed dishes are calculated
For complex meals (pizza, casseroles, stews), we use the ingredient decomposition approach.
Anfold breaks a dish into ingredients, works out each one, then adds them up. That’s how recipe nutrition is usually calculated, and it has known gaps (below).
Where decomposition works best
It works better for dry-cooked dishes (pizza, casseroles, roasted dishes) than for wet-cooked ones (soups, stews, braises), where nutrients move between the ingredients and the cooking liquid.
Known limits
The approach doesn’t model shared cooking liquids (nutrient redistribution in soups/stews), fat migration between ingredients (bacon fat absorbed by vegetables), or moisture migration. It still gives useful estimates for everyday tracking.
Limitations and considerations
Anfold accounts for cooking method effects, water loss/gain, oil absorption, vitamin and mineral retention, mass changes, and drained vs. undrained preparations.
What Anfold doesn’t model
Anfold doesn’t model exact cooking time/temperature, individual equipment variations, added seasonings (unless specified), protein digestibility changes, fat that drips off meat on a grill or in a roasting tin, or nutrient redistribution in shared cooking liquids. So treat values for soups, stews and heavily sauced dishes as rougher estimates.
Please note
- Anfold is in beta and for personal tracking. It is not a medical device or a substitute for professional advice.
- If you have a health condition or notice worrying symptoms, talk to a professional before relying on the app.
- Results are only estimates and can vary according to your data and particular circumstances.
- Artificial Intelligence (AI) is used to interpret or fill gaps, which may be inaccurate or incomplete.
- Use your judgment. Don’t use the app for clinical decisions without consulting a professional.
Sources
These are the tables, databases and studies the method draws on.
How this page is kept current
When the way Anfold calculates something changes, this page changes with it. Spotted something wrong? Write to [email protected].
USDA data and official tables
- U.S. Department of Agriculture, Agricultural Research Service (2019). FoodData Central. fdc.nal.usda.gov
- U.S. Department of Agriculture, Agricultural Research Service, Nutrient Data Laboratory (2007). USDA Table of Nutrient Retention Factors, Release 6. Beltsville, MD. PDF
- Roseland, J. M., Nguyen, Q. V., Williams, J. R., Patterson, K. Y., Showell, B. A., & Pehrsson, P. R. (2014). USDA Table of Cooking Yields for Meat and Poultry, Release 2. U.S. Department of Agriculture, Agricultural Research Service, Nutrient Data Laboratory. PDF
- U.S. Department of Agriculture, Agricultural Research Service, Food Surveys Research Group. Food and Nutrient Database for Dietary Studies (FNDDS). USDA Food and Nutrient Database for Dietary Studies
Energy conversion factors
- Regulation (EU) No 1169/2011 of the European Parliament and of the Council of 25 October 2011 on the provision of food information to consumers, Annex XIV. Official Journal of the European Union, L 304, 22.11.2011, 18–63. EUR-Lex
- FAO (2003). Food energy: methods of analysis and conversion factors. FAO Food and Nutrition Paper 77. Rome: Food and Agriculture Organization of the United Nations. fao.org
Nutrient and alcohol retention
- Lee, S., Choi, Y., Jeong, H. S., Lee, J., & Sung, J. (2018). Effect of different cooking methods on the content of vitamins and true retention in selected vegetables. Food Science and Biotechnology, 27(2), 333–342. doi:10.1007/s10068-017-0281-1
- Yuan, G. F., Sun, B., Yuan, J., & Wang, Q. M. (2009). Effects of different cooking methods on health-promoting compounds of broccoli. Journal of Zhejiang University Science B, 10(8), 580–588. doi:10.1631/jzus.B0920051
- Kimura, M., & Itokawa, Y. (1990). Cooking losses of minerals in foods and its nutritional significance. Journal of Nutritional Science and Vitaminology, 36(Suppl. 1), S25–S33. doi:10.3177/jnsv.36.4-SupplementI_S25
- Augustin, J., Augustin, E., Cutrufelli, R. L., Hagen, S. R., & Teitzel, C. (1992). Alcohol retention in food preparation. Journal of the American Dietetic Association, 92(4), 486–488. PubMed
Cooking yields and weight change
- Bognár, A. (2002). Tables on weight yield of food and retention factors of food constituents for the calculation of nutrient composition of cooked foods (dishes). Berichte der Bundesforschungsanstalt für Ernährung, BFE-R--02-03. Karlsruhe. doi:10.5445/IR/9642002
- Lisciani, S., Camilli, E., Marletta, L., & Marconi, S. (2022). Weight change of food after cooking: focus on the Italian Food Composition Tables appendix. International Journal of Gastronomy and Food Science, 30, 100605. doi:10.1016/j.ijgfs.2022.100605
- Liu, Y., Gu, Q., Huang, M., et al. (2025). Investigating the effects of protein thermal denaturation on the water-holding capacity of beef: insights from structural dynamics. International Journal of Food Science and Technology, 60(1), vvaf076. doi:10.1093/ijfood/vvaf076
Oil absorption during frying
- Bouchon, P. (2009). Understanding oil absorption during deep-fat frying. Advances in Food and Nutrition Research, 57, 209–234. ScienceDirect
- Saguy, I. S., & Dana, D. (2003). Integrated approach to deep fat frying: engineering, nutrition, health and consumer aspects. Journal of Food Engineering, 56(2–3), 143–152. doi:10.1016/S0260-8774(02)00243-1
- Manjunatha, S. S., Ravi, N., Negi, P. S., Raju, P. S., & Bawa, A. S. (2014). Kinetics of moisture loss and oil uptake during deep fat frying of Gethi (Dioscorea kamoonensis Kunth) strips. Journal of Food Science and Technology, 51(11), 3061–3071. doi:10.1007/s13197-012-0841-6
Recipe calculation and food composition standards
- Reinivuo, H., Bell, S., & Ovaskainen, M.-L. (2009). Harmonisation of recipe calculation procedures in European food composition databases. Journal of Food Composition and Analysis, 22(5), 410–413. doi:10.1016/j.jfca.2009.04.003
- FAO/INFOODS (2012). Standards and guidelines: food matching; checking food composition data; converting units, denominators and expressions. Rome: Food and Agriculture Organization of the United Nations. fao.org/infoods