Allergen Classification and Ingredient Substitution Strategy for Indonesian Cuisine Using Clustered Random Forest

Aldy Rahmat Yulianto, Aji Prasetya Wibawa, Ahmad ‘Ammar Musyaffa’, Adil Zakaria, David Satria Alamsyah, Agung Bella Putra Utama

Abstract

The lack of standardized recipes in Indonesian traditional cuisine hinders Micro, Small, and Medium Enterprises (MSMEs) from complying with food safety regulations, specifically allergen labeling. Current manual identification methods are inefficient, prone to bias, and prohibitively expensive for routine industrial screening. This study proposes a cost-effective, automated computational framework to detect allergen risks and support product reformulation. Utilizing a dataset of 9,921 recipes extracted from the Cookpad portal, the research applies a semi-supervised approach combining K-Means Clustering for risk labeling and Random Forest for classification, mapped to 14 EU allergen standards. To ensure industrial reliability, Data Augmentation and Random Over Sampling (ROS) were implemented to address class imbalances common in traditional recipes. The experimental results demonstrate that the model, optimized via Bayesian Optimization, achieves near-perfect accuracy (0.999) and high sensitivity (Recall > 0.997), effectively minimizing the risk of false negatives critical for food safety. Furthermore, Bayesian Optimization proved to be 6.2 times faster than Grid Search, offering a computationally efficient solution for scalable implementation. Beyond detection, this study introduces an innovative "Ingredient Substitution Advisor" based on clustering patterns to assist food technologists in formulating hypoallergenic products. This framework contributes to the digitalization of food safety systems, providing an accurate, low-cost alternative to support HACCP implementation and certification for the agro-industry.

Full Text:

PDF

References

Adedeji, A. A., P. V Priyesh, and A. A. Odugbemi. 2024. The magnitude and impact of food allergens and the potential of AI-Based Non-Destructive testing methods in their detection and quantification. Foods 13:994.

Afuan, L., and R. R. Isnanto. 2025. Enhanced Fall Detection using Optimized Random Forest Classifier on Wearable Sensor Data. Journal of Applied Data Sciences 6:213–224.

Cempaka, L., A. A. Rizki, N. Asiah, W. David, K. Ramadhan, A. S. Mukaromah, H. Pramastya, F. Husain, and N. Huda. 2023. Characteristics of Soto, an ethnic food that reflects Indonesian diversity: Based on ingredients. Canrea Journal: Food Technology, Nutritions, and Culinary Journal:1–16.

Chang, F., L. Eng, and C. Chang. 2023. Food allergy labeling laws: international guidelines for residents and travelers. Clinical Reviews in Allergy & Immunology 65:148–165.

Dominguez, S., J. Théolier, B. Povolo, J. Gerdts, and S. B. Godefroy. 2022. Allergen management under a voluntary PAL regulatory framework–A survey of Canadian food processors. Heliyon 8.

Dudek, G. 2022. A comprehensive study of random forest for short-term load forecasting. Energies 15:7547.

Ghosh, D., and J. Cabrera. 2021. Enriched random forest for high dimensional genomic data. IEEE/ACM transactions on computational biology and bioinformatics 19:2817–2828.

Hassoun, A., S. Jagtap, H. Trollman, G. Garcia-Garcia, N. A. Abdullah, G. Goksen, F. Bader, F. Ozogul, F. J. Barba, and J. Cropotova. 2023. Food processing 4.0: Current and future developments spurred by the fourth industrial revolution. Food Control 145:109507.

Holzhauser, T., P. Johnson, J. P. Hindley, G. O’Connor, C.-H. Chan, J. Costa, C. K. Fæste, B. J. Hirst, F. Lambertini, and M. Miani. 2020. Are current analytical methods suitable to verify VITAL® 2.0/3.0 allergen reference doses for EU allergens in foods? Food and Chemical Toxicology 145:111709.

Krisnawati, D. I., M. Alimansur, D. S. Atmojo, E. Q. Rahmawati, D. Rahayu, E. Susilowati, and T.-R. Kuo. 2022. Food allergies: immunosensors and management. Applied Sciences 12:2393.

Linacero, R., A. Sanchiz, I. Ballesteros, and C. Cuadrado. 2020. Application of real-time PCR for tree nut allergen detection in processed foods. Critical Reviews in Food Science and Nutrition 60:1077–1093.

Lu, Q., K. D. Polyzos, B. Li, and G. B. Giannakis. 2023. Surrogate modeling for Bayesian optimization beyond a single Gaussian process. IEEE Transactions on Pattern Analysis and Machine Intelligence 45:11283–11296.

Mu, W., G. A. Kleter, Y. Bouzembrak, E. Dupouy, L. J. Frewer, F. N. Radwan Al Natour, and H. J. P. Marvin. 2024. Making food systems more resilient to food safety risks by including artificial intelligence, big data, and internet of things into food safety early warning and emerging risk identification tools. Comprehensive Reviews in Food Science and Food Safety 23:e13296.

Onorato, G. 2024. Bayesian optimization for hyperparameters tuning in neural networks. arXiv preprint arXiv:2410.21886.

Pellegrini, C., E. Özsoy, M. Wintergerst, and G. Groh. 2021. Exploiting Food Embeddings for Ingredient Substitution. HEALTHINF 5:67–77.

Rohman, F. N., F. Farikhin, and B. Surarso. 2025. Hyperparameter Tuning of Random Forest Algorithm for Diabetes Classification. International Journal of Current Science Research and Review 8.

Roither, A., M. Kurz, and E. Sonnleitner. 2022. The chef’s choice: system for allergen and style classification in recipes. Applied Sciences 12:2590.

Sinaga, K. P., and M.-S. Yang. 2020. Unsupervised K-means clustering algorithm. IEEE access 8:80716–80727.

Song, F., B. Zhu, Y. Hao, and S. Wang. 2024. Enhancing recipe retrieval with foundation models: A data augmentation perspective. Pages 111–127 European Conference on Computer Vision. Springer.

Song, Z., X. Yang, Z. Xu, and I. King. 2022. Graph-based semi-supervised learning: A comprehensive review. IEEE Transactions on Neural Networks and Learning Systems 34:8174–8194.

Yayusman, M. S., U. K. Yaumidin, and P. N. Mulyasari. 2023. On considering Australia: exploring Indonesian restaurants in promoting ethnic foods as an instrument of Indonesian gastrodiplomacy. Journal of Ethnic Foods 10:43.

DOI

https://doi.org/10.21107/agrointek.v20i3.32625

Metrics

Refbacks

  • There are currently no refbacks.




Copyright (c) 2026 Aldy Rahmat Yulianto, Aji Prasetya Wibawa, Ahmad ‘Ammar Musyaffa’, Adil Zakaria, David Satria Alamsyah, Agung Bella Putra Utama

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.