CDHF at S em E val-2025 Task 9: A Multi-Task Learning Approach for Food Hazard Classification (2025)

Abstract: We present our system in SemEval-2025 Task 9: Food Hazard Detection. Our approach focuses on multi-label classification of food recall titles into predefined hazard and product categories. We fine-tune pre-trained transformer models, comparing BERT and BART. Our results show that BART significantly outperforms BERT, achieving an F1-score of 0.8033 during development. However, in the final evaluation phase, our system obtained an F1-score of 0.7676, ranking 54th in Subtask 1. While our performance is not among the top, our findings highlight the importance of model choice in food hazard classification. Future work can explore additional improvements, such as ensemble methods and domain adaptation

## introduction semeval 2025 task 9: the food hazard detection challenge @xcite focuses on classifying food incident reports to identify hazards and affected products. the task includes two sub-tasks: (st1) food hazard prediction and (st2) hazard and product vector detection. we present a multi-task learning approach using the facebook/bart-large-mnli @xcite model to predict hazard and product categories. our system fine-tunes a transformer-based model with a custom neural network featuring two classification heads for multi-label prediction. experimental results highlight the effectiveness of this approach in food hazard detection. 1 2 task and background the food hazard detection task focuses on developing explainable classification models to analyze the titles of food-incident reports collected from web sources. these models aim to assist automated systems, such as web crawlers, in identifying and extracting food safety issues from online platforms, including social media. given the potential economic and public health impact of food hazards, ensuring transparency in these classification systems is essential. semeval-2025 task 9: the food hazard detection with two main subtask: subtask 1: category classification: in this subtask, the goal is to classify a food-incident report into predefined categories. specifically, models must predict both the product category (e.g., "meat, egg, and dairy products") and the hazard category (e.g., "biological contamination"). since the dataset is highly imbalanced, handling rare categories effectively is a key challenge.subtask 2: vector classification: this subtask requires a more detailed prediction by identifying the exact product (e.g., "ice cream") and hazard (e.g., "salmonella") mentioned in the report. instead of selecting from broad categories, models must extract precise labels, making this task more complex. performance is evaluated based on macro f1, with a focus on hazard detection. ## system overview our system for the food hazard detection task focuses exclusively on subtask 1 (st1), which involves classifying food-related hazard and product categories based on textual data. we employ a transformer-based multi-task learning approach to handle both classification tasks simultaneously. this section details the key components of our system, including data preprocessing, model architecture, training strategy, and evaluation. ## experimental setup we use the dataset provided by the organizers, which consists of 6,644 short texts. the data is split into training, validation, and test sets. the training set is used for model training, the validation set for hyperparameter tuning and early stopping, and the test set for final evaluation. each text is tokenized using the bart-large-mnli @xcite tokenizer with a maximum sequence length of 128. labels are encoded using scikit-learn's labelencoder, and missing labels in the validation and test sets are assigned default values. we fine-tune the bart-large-mnli model for multilabel classification with a batch size of 16 and the adamw optimizer (learning rate 2×10 -5 ). a learning rate scheduler (reducelronplateau) adjusts the learning rate based on validation loss. early stopping is applied with a patience of 3 epochs, and training runs for up to 20 epochs. our implementation uses transformers @xcite , torch @xcite , scikit-learn @xcite , and pandas. ## results our system did not achieve a high ranking in the competition, placing 14th in subtask 1. however, we observed notable improvements in performance through model selection. initially, using bert resulted in a macro-f1 score of 0.71. by switching to bart, performance increased significantly to 0.8033 on the validation set. finally, in the evaluation phase, our system achieved a macro-f1 score of 0.7676. to further analyze the effectiveness of our approach, we compared different model architectures. the results confirm that leveraging a more powerful pretrained model such as bart provides a substantial boost over bert, likely due to its stronger contextual representation and sequence-tosequence training paradigm. for error analysis, we examined some misclassified examples and found that many errors involved ambiguous or rare hazard categories, suggesting that our model struggles with underrepresented classes. a confusion matrix could provide more insight into these misclassifications, highlighting specific categories where performance can be improved. future improvements could focus on handling class imbalance, exploring data augmentation techniques, or incorporating external knowledge sources to enhance classification accuracy. ## conclusion in this paper, we presented our approach for subtask 1 of the food hazard detection shared task. our system leveraged pre-trained transformer models fine-tuned for multi-label classification, focus-ing on identifying food hazard categories and affected product types. through our experiments, we observed a significant performance improvement when switching from bert to bart, with the f1-score increasing from 0.71 to 0.8033 on the development set. this result highlights the advantage of using more advanced transformer architectures for text classification tasks. however, in the final evaluation phase, our system's performance slightly declined to an f1-score of 0.7676, ranking 14th overall. while our model did not achieve top-tier rankings, our findings underscore the potential of transformer-based approaches for food hazard classification. the results suggest that further optimizations, such as better handling of class imbalances, domain adaptation, or ensemble methods, could further enhance performance in future iterations of this task.