Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quality facet - Nutrition - Compare stated and calculated energy for higher accuracy of product listings and spotting faulty products #2429

Closed
bredowmax opened this issue Oct 14, 2019 · 2 comments · Fixed by #7683
Assignees
Labels
🧽 Data quality - Measure - Quality facets One of the facets available in Open Food Facts is /quality & allows us to spot products w/ bad data 🧽 Data quality https://wiki.openfoodfacts.org/Quality ✨ Feature Features or enhancements to Open Food Facts server Nutrition facts

Comments

@bredowmax
Copy link

bredowmax commented Oct 14, 2019

What

  • Stated and calculated energy does not fit for approx. 14.000 products. Reason could be a simple type-o, a mistake in the label itself, but most often, it's editors that confuse kj and Kcal.

For example:

  1. If calculated kcal is approx 4.2x higher than stated, then the editor probably meant KCal but wrote the energy in kj
  2. If calculated kj is approx. 4.2x smaller than stated, then the editor probably meant kj but wrote the energy in KCal

Proposed solution

An automatic test, something along Is kcal/100g approx. 9*fat+4*CH+4*protein (+/- 10%)
If that test is not passed have it pass on to manual review, e.g. hunger games

These products would likely fail this test:
Sheet 1: Is calculated energy from fat+carbs+protein < 3800kj?--> 68 products
Sheet 2: Is calculated energy from fat+carbs+protein at least 80% of stated energy?--> 9000 products
Sheet 3: Is calculated energy from fat+carbs+protein max. 120% of stated energy? --> 5000 products
https://docs.google.com/spreadsheets/d/142UD8SrbOS2ZGNiaXLnNacw32Wtcia_iEMiPR2vxxAY/edit?usp=sharing

Considered alternatives

  1. Fix existing objects
  2. Avoid future mistakes

Option 1: Calculate Kilocalories
Option 2: Calculate Kilojoules

Open question: Should g fibres be calculated with 7kj/g?

Context

https://openfoodfacts.slack.com/archives/C03H290LF/p1569656651003000

Part of

@bredowmax bredowmax added the ✨ Feature Features or enhancements to Open Food Facts server label Oct 14, 2019
@stephanegigandet stephanegigandet self-assigned this Oct 15, 2019
@stephanegigandet
Copy link
Contributor

I will add this to the data quality tests.

@stephanegigandet stephanegigandet added 🧽 Data quality https://wiki.openfoodfacts.org/Quality 🧽 Data quality - Measure - Quality facets One of the facets available in Open Food Facts is /quality & allows us to spot products w/ bad data labels Oct 15, 2019
@stephanegigandet
Copy link
Contributor

List of the different factors used to compute energy in kcal and kj used in the US, Canada, Mexico and the EU: https://esha.com/calorie-calculation-country/

EU law: https://eur-lex.europa.eu/legal-content/FR/TXT/HTML/?uri=CELEX:32011R1169&from=FR

@teolemon teolemon changed the title Compare stated and calculated energy for higher accuracy of product listings and spotting faulty products Quality facet - Compare stated and calculated energy for higher accuracy of product listings and spotting faulty products Oct 11, 2021
@teolemon teolemon changed the title Quality facet - Compare stated and calculated energy for higher accuracy of product listings and spotting faulty products Quality facet - Nutrition - Compare stated and calculated energy for higher accuracy of product listings and spotting faulty products Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧽 Data quality - Measure - Quality facets One of the facets available in Open Food Facts is /quality & allows us to spot products w/ bad data 🧽 Data quality https://wiki.openfoodfacts.org/Quality ✨ Feature Features or enhancements to Open Food Facts server Nutrition facts
Projects
Archived in project
3 participants