Food allergies pose a critical health risk, underscoring the need for accurate allergen detection in food products. This study explores the use of supervised machine learning to classify food items based on their potential allergens. Using a dataset of 399 products, textual ingredients were transformed via Count Vectorization and used to train five classifiers: Logistic Regression, Decision Tree, Random Forest, Support Vector Machine (SVM), and K-Nearest Neighbors (KNN). Logistic Regression and Random Forest achieved the highest accuracy at 80%, effectively predicting allergen presence from component data. SVM and Decision Tree showed moderate results, while KNN performed poorly at 55% accuracy. The results confirm the viability of machine learning as a tool for enhancing allergen transparency in food labeling. The proposed model can be integrated into food manufacturing quality control systems to screen ingredients before production, assist regulatory bodies in verifying label compliance, and power consumer-facing mobile applications that allow users to scan products for potential allergens instantly.
Jhetam et al. (Thu,) studied this question.