Original articles
Issue 2 - 2025
An intelligent analysis of food allergens through computer vision and generative models
Abstract
Introduction. Food allergies represent a leading cause of adverse reactions and hospital admissions among children, with significant impact on quality of life and public health. The rapid and accurate detection of allergens in meals is therefore crucial for safety.
Materials and methods. We developed an AI-based prototype that combines YOLOv8n, a state-of-the-art object detection model trained on the Allergen30 dataset, with Gemini 2.0 Flash, an advanced generative model, to provide multimodal allergen analysis. All images were preprocessed and split into training (70%), validation (15%), and test (15%) sets, with careful class balancing.
Results. The system achieved high class-specific performance in detecting allergenic foods from real meal images, with mAP50 >90% and detailed contextual analysis via Gemini 2.0 Flash.
Discussion and conclusions. AI-assisted allergen analysis from meal images is feasible and shows promise, but does not replace ingredient disclosure or clinical precautions. Further development and real-world validation are warranted
References
- Gupta RS, Warren CM, Smith BM, et al. The public health impact of parent-reported childhood food allergies in the United States. Pediatrics 2018;142:e20181235. https://doi.org/10.1542/peds.2018-1235
- Sicherer SH, Sampson HA. Food allergy: Epidemiology, pathogenesis, diagnosis, and treatment. J Allergy Clin Immunol 2014;133:291-307. https://doi.org/10.1016/j.jaci.2013.11.020.
- Mishra M, Sarkar T, Choudhury T, et al. Allergen30: Detecting food items with possible allergens using deep learning-based computer vision. Food Anal Methods 2022;1-34. https://doi.org/10.1007/s12161-022-02353-9.
- Ultralytics. YOLOv8 Documentation. https://docs.ultralytics.com/models/yolov8/ (Accessed on: 15/02/2025).
- Konstantakopoulos FS, Georga EI, Fotiadis DI. A Review of Image-Based Food Recognition and Volume Estimation Artificial Intelligence Systems. IEEE Rev Biomed Eng 2024;17:136-152. https://doi.org/10.1109/RBME.2023.3283149.
- Google DeepMind – Gemini. https://deepmind.google/technologies/gemini/ (Accessed on: 15/02/2025).
- Landau T, Gamrasni K, Barlev Y, et al. A machine learning approach for stratifying risk for food allergies utilizing electronic medical record data. Allergy 2024;79:499-502. https://doi.org/10.1111/all.15839.
- Grabenhenrich LB, Dölle-Bierke S, Worm M, et al. Global trends in anaphylaxis epidemiology and clinical implications. J Allergy Clin Immunol Pract 2020;8:1948-1963.e1. https://doi.org/10.1016/j.jaip.2020.05.041.
- Allen KJ, Turner PJ, Pawankar R, Taylor S, Sicherer S, Lack G, Rosario N, Ebisawa M, Wong G, Mills ENC, Beyer K, Fiocchi A, Sampson HA. Precautionary labelling of foods for allergen content: are we ready for a global framework? World Allergy Organ J 2014;7:10. https://doi.org/10.1186/1939-4551-7-10.
- Nwaru BI, Hickstein L, Panesar SS, et al. Prevalence of common food allergies in Europe: A systematic review and meta-analysis. Allergy 2014;69:992-1007. https://doi.org/10.1111/all.12423.
- Warren CM, Dyer AA, Otto AK, et al. Food Allergy-Related Risk-Taking and Management Behaviors Among Adolescents and Young Adults. J Allergy Clin Immunol Pract. 2017;5:381-390.e13. https://doi.org/10.1016/j.jaip.2016.12.012.
- Guéant JL, Guéant-Rodriguez RM. Hidden food allergens and the risk of severe reactions in sensitized individuals. J Allergy Clin Immunol 2002;109:1043-1048. https://doi.org/10.1067/mai.2002.122261.
- Baker MG, Saf S, Tsuang A, Nowak‑Wegrzyn A. Hidden allergens in food allergy. Ann Allergy Asthma Immunol 2018;121:285-292. https://doi.org/10.1016/j.anai.2018.05.011.
- Qian C, Murphy SI, Orsi RH, et al. How Can AI Help Improve Food Safety? Annu Rev Food Sci Technol 2023;14:517-538. https://doi.org/10.1146/annurev-food-060721-013815.
- Liu D, Zuo E, Wang D, He L, Dong L, Lu X. Deep Learning in Food Image Recognition: a Comprehensive Review. Appl Sci 2025;15:7626. https://doi.org/10.3390/app15147626.
- Bochkovskiy A, Wang CY, Liao HYM. YOLOv4: Optimal speed and accuracy of object detection. arXiv:2004.10934. https://doi.org/10.48550/arXiv.2004.10934.
- Skypala IJ, Capucilli P, Wedner HJ. Food-induced anaphylaxis: role of hidden allergens and cofactors. Front Immunol 2019;10:673. https://doi.org/10.3389/fimmu.2019.00673.
- Yin S, Fu C, Zhao S, Li K, Sun X, Xu T, Chen E. A survey on multimodal large language models. Natl Sci Rev 2024;11:nwae403. https://doi.org/10.1093/nsr/nwae403.
- Min W, Liu C, Xu L, Jiang S. Applications of knowledge graphs for food science and industry. Patterns 2022;3:100484. https://doi.org/10.1016/j.patter.2022.100484.
- Ding H, Tian J, Yu W, Wilson DI, Young BR, Cui X, Xin X, Wang Z, Li W. The Application of Artificial Intelligence and Big Data in the Food Industry. Foods 2023;12:4511. https://doi.org/10.3390/foods12244511.
- Redmon J, Farhadi A. YOLO9000: Better, Faster, Stronger. In: 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Honolulu, HI, USA, 2017, pp. 6517-6525. https://doi.org/10.1109/CVPR.2017.690
- Brown TB, Mann B, Ryder N, et al. Language Models are Few-Shot Learners. arXiv:2005.14165. https://doi.org/10.48550/arXiv.2005.14165.
- Gradio. https://www.gradio.app/ (Accessed on: 15/02/2025).
- Wang L, Niu D, Zhao X, et al. A Comparative Analysis of Novel Deep Learning and Ensemble Learning Models to Predict the Allergenicity of Food Proteins. Foods 2021;10:809. https://doi.org/10.3390/foods10040809
- Sheth A, Taylor SS, Hourihane JO’B. Deriving individual threshold doses from clinical food challenge data: implications for public policy. J Allergy Clin Immunol 2019;143:2172-2175. https://doi.org/10.1016/j.jaci.2018.12.1024.
- Li Y, Xu X, Dewey M, et al. Artificial Intelligence in Food Safety: a Decade Review and Current Status. Foods 2023;12:456. https://doi.org/10.3390/foods12030456.
Downloads
License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
Copyright
Copyright (c) 2025 Italian Journal of Pediatric Allergy and Immunology
How to Cite
- Abstract viewed - 25 times
- pdf downloaded - 8 times