madhans476 at S em E val-2025 Task 9: Multi-Model Ensemble and Prompt-Based Learning for Food Hazard Prediction (2025)

Abstract: This paper presents a hybrid approach to food hazard detection for SemEval-2025 Task 9, combining traditional machine learning with advanced language models. For hazard classification (Sub-Task 1), we implemented a novel ensemble system integrating XGBoost with fine-tuned GPT-2 Large and LLaMA 3.1 1B models. For vector detection (Sub-Task 2), we employed a prompt-engineered approach using Flan-T5-XL, highlighting challenges in exact vector matching. Our analysis demonstrates the effectiveness of combining complementary models while revealing opportunities for improvement in rare category detection and extraction precision.

## introduction food safety incidents can have severe consequences for public health and the food industry, making rapid and accurate identification of food hazards crucial. the semeval-2025 task 9: food hazard detection challenge @xcite addresses this critical need by focusing on automated analysis of food recall notifications, aiming to classify and extract specific hazard information from text descriptions. this task builds upon the cicle dataset @xcite , which provides a comprehensive collection of food recall notifications. our approach to this challenge combines the strengths of traditional machine learning(ml) techniques with large language models(llms). for sub-task 1 (st1), we implemented a novel ensemble system integrating xgboost @xcite with fine-tuned versions of gpt-2 large @xcite and llama 3.1 1b @xcite models. the sub-task 2 (st2) utilizes a prompt-engineered approach with flan-t5-xl @xcite , focusing on precise extraction of hazard and product information. this hybrid approach allows us to leverage both the statistical power of traditional methods and the semantic understanding capabilities of llms. we achieved competitive results in both conception and evaluation phases, with f1-scores of 0.78 and 0.74 respectively for st1. in contrast, st2 was more challenging with an f1score of 0.05, reflecting the difficulty of exact vector matching in food safety. our model performed well on common hazard categories but struggled with rare classes and precise match accuracy.the complete codebase for our system is available at https://github.com/madhans476/ food-hazard-detection-semeval-2025.git . ## background the data set for this task is derived from the cicle corpus @xcite , a large-scale dataset of 7,546 english food recall notices annotated with hazard types (e.g., biological, chemical, physical) and product categories (e.g., dairy, meat, beverages). its broad coverage of food safety incidents makes it well-suited for training and evaluating nlp models for food hazard detection. ## methodology this section presents the methodology employed for food hazard prediction using text classification (st1) and vector detection (st2) in the semeval-2025 shared task. our approach addresses class imbalance, leverages ensemble learning, fine-tuning llms using parameter-efficient fine-tuning (peft), and uses prompt-based tuning for hazard and product vector extraction. ## conclusion we presented a hybrid approach for food hazard prediction and classification in semeval-2025 task 9, combining traditional ml with state-of-the-art language models, achieving competitive performance in both classification (st1) and vector detection (st2). key contributions include: error analysis showed strong performance on common hazard categories and clear product descriptions, but challenges persist with rare classes and exact vector matches. the methods proposed here have broader applications in domains requiring finegrained classification and entity extraction from technical texts.