AI-driven food safety risk prediction: a transformer-based approach with RASFF database
- 23 June 2025
- journal article
- research article
- Published by Emerald Publishing in British Food Journal
- Vol. 127 (9) , 3427-3445
Abstract
Purpose: This study aims to enhance food safety risk classification by systematically evaluating the effectiveness of machine learning and transformer-based AI models using the RASFF dataset. While AI-powered surveillance has gained attention, most research focuses on isolated applications of machine learning without systematically comparing them to advanced transformer architectures. This research addresses this gap by evaluating the predictive accuracy and interpretability of the model to ensure that AI-driven risk assessments are both effective and transparent for regulation. Design/methodology/approach: The study employs a structured evaluation framework in which traditional machine learning models, including logistic regression, support vector machines and random forest, are compared with advanced transformer-based models such as BERT, RoBERTa and BioBERT. Additionally, explainable AI (XAI) techniques, particularly SHAP analysis, enhance the interpretability of the models by identifying the key food safety risk factors that influence classification decisions. Findings: Transformer-based models significantly outperform traditional machine learning methods, with RoBERTa achieving the highest classification accuracy. The SHAP analysis highlights key hazards salmonella, aflatoxins, listeria and sulphites as primary factors in serious risk classification, while procedural attributes like certification status and temperature control are less impactful. Despite improvements in accuracy, computational efficiency and scalability remain challenges for real-world deployment. Originality/value: We introduce a novel end-to-end AI framework that integrates state-of-the-art transformers with Explainable AI for the RASFF database. By integrating explainable AI, it bridges the gap between AI research and regulatory implementation and provides actionable insights for policymakers and industry stakeholders to improve risk management and early hazard detection.Keywords
This publication has 25 references indexed in Scilit:
- Evaluation of methods for the detection of hazardous substances in food based on machine learningNew Journal of Chemistry, 2023
- A data-driven approach for prioritising microbial and chemical hazards associated with dairy products using open-source databasesScience of The Total Environment, 2023
- Food safety news events classification via a hierarchical transformer modelHeliyon, 2023
- The Use of Big Data in Food Safety Management: Predicting Food Safety Risks Using Big Data and Artificial Intelligence2023
- A comparison of neural and non-neural machine learning models for food safety risk prediction with European Union RASFF dataFood Control, 2022
- How do food safety concerns affect consumer behaviors and diets in low- and middle-income countries? A systematic reviewGlobal Food Security, 2022
- Gas sensor array to classify the chicken meat with E. coli contaminant by using random forest and support vector machineBiosensors and Bioelectronics: X, 2021
- Chatbot Interaction with Artificial Intelligence: human data augmentation with T5 and language transformer ensemble for text classificationJournal of Ambient Intelligence and Humanized Computing, 2021
- COVID-19 and the food industry: Readiness assessmentFood Control, 2021
- Random ForestsMachine Learning, 2001