P uer AI at S em E val-2025 Task 9: Research on Food Safety Data Classification Using M odern BERT (2025)

Abstract: This paper presents our research in the SemEval-2025 Task 9: Food Hazard Detection Challenge, with a focus on the application of ModernBERT for food safety data classification. We applied the ModernBERT model for the food hazard classification task, achieving a score of 0.7952 on the validation set and 0.7729 on the final test set, outperforming other models. Through comparative experiments with various deep learning architectures, we further confirmed the superiority of ModernBERT in food hazard detection. The results demonstrate the significant potential of ModernBERT in food safety management, providing strong support for its practical applications in the field. The code of this paper is available at: https://github.com/daojiaxu/semeval_2025_Task-9.

## introduction the rapid development of artificial intelligence (ai) has led to its widespread use across various sectors, with significant impacts on society @xcite . in food safety, which directly affects public health, ai technologies such as big data analytics and machine learning offer innovative solutions to enhance food safety measures @xcite . foodborne illnesses remain a global concern, and these advancements present new opportunities to address this issue. this study, part of semeval 2025 task 9: the food hazard detection challenge, explores the potential of pre-trained models for detecting and classifying food hazards @xcite . the primary objective of this study is to classify food products into hazard and product categories based on safety-related attributes. we explore the application of pre-trained models to categorize food hazards into 10 types and products into 22 types. by leveraging ai, we aim to create a more efficient, accurate, and automated approach to managing food safety data. we selected several state-of-the-art models, including bert, roberta, qwen, and modern-bert, as candidate models for the classification tasks. our experiments indicate that modernbert consistently outperforms other models, demonstrating its effectiveness in food safety applications on both the validation and test sets. by comparing the performance of these models, we seek to identify the most effective pre-trained models based method for managing food safety information. these findings not only contribute to advancing theoretical research but also provide practical insights for real-world food safety management, with the potential to enhance public health by improving food safety and preventing foodborne diseases. ## related work the advent of artificial intelligence has profoundly impacted various fields, particularly food safety research, with many scholars making significant contributions. leonieke's systematic reviews evaluated multiple machine learning algorithms and combinations, with the hybrid naive bayes-support vector machine (nb-svm) model reducing expert workload and improving review accuracy @xcite . sina integrated multi-criteria decision analysis (mcda) into an ai-driven database system for automated food incident report classification, verified through field tests @xcite . with the rise of large language models (llms) @xcite , the research landscape has shifted. zhao's 2024 survey emphasized llms' transformative potential across fields. hassani demonstrated that bert and gpt architectures excelled in regulatory text classification, with the optimized gpt-4o model outperforming traditional methods @xcite . randl introduced an llm-in-the-loop framework, enhancing classifier performance while reducing energy consumption. their analysis showed that logistic regres-figure 1 : data samples sion models with tf-idf features outperformed advanced models in certain food recall categories @xcite . neris also contributed significantly. neris used llms for zero-shot chemical hazard extraction, proving their effectiveness in environmental monitoring @xcite . ma showcased llm applications in decision support, driving progress in food science @xcite . zhang dan's icl2fid framework improved annotation accuracy in food-poisoning event labeling on social media, offering cost-effective advantages over traditional methods @xcite . in conclusion, previous studies have explored food safety from various perspectives with different methods and models, laying a foundation for our research, which aims to further expand and deepen the field. ## conclusion this study proposes a modernbert-based framework for food safety data classification in semeval 2025 task 9 subtask st1. through systematic comparisons with pre-trained models including bert, roberta, and qwen, we demonstrate that modernbert achieves superior performance in food hazard detection. experimental results show that the framework obtains macro f1-scores of 0.7952 and 0.7729 on the validation and final test sets respectively, ranking 12th in the official evaluation of semeval-2025 task 9. this work estab-lishes an effective technical pathway for applying language models to food safety management systems.