Explainable transformer-based modelling for pathogen-oriented food safety inspection grade prediction using New York State open data

Omer Faruk Sari, Mohamed Bader-El-Den*, Volkan Ince

*Corresponding author for this work

Research output: Contribution to journalArticlepeer-review

Abstract

Foodborne pathogens remain a major public health concern, and the early identification of unsafe conditions is essential for preventive control. Routine inspections generate rich textual and structured data that can support real-time assessment of pathogen-related risk. The objective of this study is to develop an explainable transformer-based framework for predicting food safety inspection grades using multimodal inspection data. We combine structured metadata with unstructured deficiency narratives and evaluate classical machine learning models, deep learning architectures, and transformer models. RoBERTa achieved the highest performance (F1 = 0.96), followed by BiLSTM (F1 = 0.95) and LightGBM (F1 = 0.92). SHapley Additive exPlanations (SHAP) analysis revealed linguistically meaningful indicators of pathogen-related hazards such as temperature abuse, pests, and unsanitary practices. The findings demonstrate that transformer-based models, combined with explainable AI (XAI), can support pathogen-oriented monitoring and real-time risk assessment. This study highlights the potential of multimodal AI approaches to enhance inspection efficiency and strengthen public health surveillance.

Original languageEnglish
Article number223
Number of pages20
JournalFoods
Volume15
Issue number2
DOIs
Publication statusPublished - 8 Jan 2026

Keywords

  • explainable artificial intelligence
  • food safety inspections
  • pathogen detection
  • real-time risk assessment

Fingerprint

Dive into the research topics of 'Explainable transformer-based modelling for pathogen-oriented food safety inspection grade prediction using New York State open data'. Together they form a unique fingerprint.

Cite this