AI used to find unsafe foods using consumer product reviews

A new program can track all recalled foods based from Amazon customer reviews. Called BERT, the AI program identified thousands of recalled products with an accuracy rate of 74 percent.

Researchers from the Boston University School of Medicine developed an artificial intelligence (AI) program that can detect unsafe food contaminated with chemicals, toxins, pathogens, and those which are mislabeled of allergens.

Many people experience illness resulting from the consumption of unsafe food items, which is now considered a global health problem. Because of this, the researchers developed a machine learning approach to help detect reports of unsafe food items from Amazon, a multinational technology company and the world’s largest online retailer.

Artificial Intelligence illustration. Image Credit: PopTika / Shutterstock
Artificial Intelligence illustration. Image Credit: PopTika / Shutterstock

Combing through online reviews

The Food and Drug Administration (FDA) is the federal agency of the government responsible for protecting public health by controlling food safety, including medicines and supplements. The regulatory agency can take a few months to verify a problem before they could issue a recall.

The new study, published in the Journal of the American Medical Informatics Association (JAMIA), provides a faster and better method for product recalls as the AI program can comb through online reviews to identify public health threats.

To land to their findings, the researchers linked food product reviews to Food and Drug Administration (FDA) food recalls between 2012 and 2014, using PostGres relational database text machine approaches. They taught an existing deep-learning AI called the Bidirectional Encoder Representation from Transformations (BERT), to project food product recalls from Amazon reviews.

They acquired 1,297,156 product reviews from and found that only 5,149 were linked to recalled food products. To determine accurate results, they used BERT to identify unsafe food reviews, and it was able to recognize 20,000 reviews suggesting unsafe food products that had not been recalled or investigated.

“Health departments in the US are already using data from Twitter, Yelp, and Google for monitoring foodborne illnesses," Dr. Elaine Nsoesie, assistant professor of global health at BUSPH, said.

"Tools like ours can be effectively used by health departments or food product companies to identify consumer reviews of potentially unsafe products, and then use this information to decide whether further investigation is warranted,” she added.

Bidirectional Encoder Representation from Transformations (BERT)

The new tool, the Bidirectional Encoder Representation from Transformations (BERT), is an AI that’s trained on the English-language text, which includes English Wikipedia. It can also interpret the text for a specific purpose.

The researchers first used humans to help categorize about 6,000 reviews that contained phrases or words like “label,” “foul,” “ill,” “rotten,” and others. They also included other data like the title of the review and the star rating. Meanwhile, they used BERT to scan the same customer reviews, and it was able to identify correctly with 74-percent accuracy.

Global health threat

Unsafe food products are a global public health problem, with more than 200 illnesses linked to unsafe foods that can lead to serious disease and even death. While foodborne diseases affect people of all ages, some individuals are at a higher risk of developing serious complications, including pregnant women, sick individuals, the elderly, and children.

The World Health Organization (WHO) reports that about 600 million people suffered from illness due to contaminated food worldwide in 2010.

The researchers noted that using social media and other platforms can help monitor reports of foodborne illness. Some health departments have used data from social media and other websites to conduct restaurant inspections and outbreak identification that is not usually reported through conventional surveillance methods.

They also reiterated that the study could improve early detection of unsafe foods to prevent illness and death. If the method is successful, people and agencies can use the new tool to detect unsafe food products sold on the internet, based on consumer reviews. Mostly, the websites and platforms that can provide important customer data include e-commerce sites, social media, and even forums.

“Early identification of unsafe food products would have important implications not only in the United States but globally. By identifying unsafe food products early, companies can take appropriate actions to stop the sale of these products,” the researchers wrote in their paper.

“This would also limit the occurrence of large foodborne disease outbreaks, thereby preventing illness and deaths, and reducing the health and economic impact on households, businesses and the food industry,” they added.

Journal reference:

Adyasha Maharana, Kunlin Cai, Joseph Hellerstein, Yulin Hswen, Michael Munsell, Valentina Staneva, Miki Verma, Cynthia Vint, Derry Wijaya, Elaine O Nsoesie, Detecting reports of unsafe foods in consumer product reviews, JAMIA Open,,

Angela Betsaida B. Laguipo

Written by

Angela Betsaida B. Laguipo

Angela is a nurse by profession and a writer by heart. She graduated with honors (Cum Laude) for her Bachelor of Nursing degree at the University of Baguio, Philippines. She is currently completing her Master's Degree where she specialized in Maternal and Child Nursing and worked as a clinical instructor and educator in the School of Nursing at the University of Baguio.


Please use one of the following formats to cite this article in your essay, paper or report:

  • APA

    Laguipo, Angela. (2019, August 06). AI used to find unsafe foods using consumer product reviews. News-Medical. Retrieved on July 13, 2024 from

  • MLA

    Laguipo, Angela. "AI used to find unsafe foods using consumer product reviews". News-Medical. 13 July 2024. <>.

  • Chicago

    Laguipo, Angela. "AI used to find unsafe foods using consumer product reviews". News-Medical. (accessed July 13, 2024).

  • Harvard

    Laguipo, Angela. 2019. AI used to find unsafe foods using consumer product reviews. News-Medical, viewed 13 July 2024,


The opinions expressed here are the views of the writer and do not necessarily reflect the views and opinions of News Medical.
Post a new comment

While we only use edited and approved content for Azthena answers, it may on occasions provide incorrect responses. Please confirm any data provided with the related suppliers or authors. We do not provide medical advice, if you search for medical information you must always consult a medical professional before acting on any information provided.

Your questions, but not your email details will be shared with OpenAI and retained for 30 days in accordance with their privacy principles.

Please do not ask questions that use sensitive or confidential information.

Read the full Terms & Conditions.

You might also like...
Machine learning identifies cancer-driving mutations at CTCF binding sites