AI-driven food safety risk prediction: a transformer-based approach with RASFF database

Omer Faruk Sari*, Mohamed Bader-El-Den, Craig Leadley, Ramazan Esmeli, Alaa Mohasseb, Volkan Ince

*Corresponding author for this work

Research output: Contribution to journalArticlepeer-review

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.

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: 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 policy makers and industry stakeholders to improve risk management and early hazard detection.
Original languageEnglish
JournalBritish Food Journal
Early online date23 Jun 2025
DOIs
Publication statusEarly online - 23 Jun 2025

Keywords

  • Food Safety
  • RASFF
  • Transfer Learning
  • Transformers Models
  • Risk Prediction

Fingerprint

Dive into the research topics of 'AI-driven food safety risk prediction: a transformer-based approach with RASFF database'. Together they form a unique fingerprint.

Cite this