Journal of Agri-Food Science and Technology (JAFoST)
Vol. 7 No. 3 (2026): September

Automated Multi-Scenario Classification of Food Allergens in Indonesian Culinary Datasets Using Bernoulli Naïve Bayes with Augmentation and Oversampling Methods

Aji Prasetya Wibawa (Department of Electrical Engineering and Informatics, Faculty of Engineering, Universitas Negeri Malang, Malang, Indonesia)
David Satria Alamsyah (Department of Electrical Engineering and Informatics, Faculty of Engineering, Universitas Negeri Malang, Malang, Indonesia)
Aldy Rahmat Yulianto (Department of Electrical Engineering and Informatics, Faculty of Engineering, Universitas Negeri Malang, Malang, Indonesia)
Ahmad 'Ammar Musyaffa' (Department of Electrical Engineering and Informatics, Faculty of Engineering, Universitas Negeri Malang, Malang, Indonesia)
Adil Zakaria (Department of Electrical Engineering and Informatics, Faculty of Engineering, Universitas Negeri Malang, Malang, Indonesia)
Agung Bella Putra Utama (Department of Electrical Engineering and Informatics, Faculty of Engineering, Universitas Negeri Malang, Malang, Indonesia)



Article Info

Publish Date
26 Jun 2026

Abstract

Limited awareness of allergen content in traditional Indonesian foods poses a potential health risk because recipe platforms rarely provide explicit allergen information. This study develops an automated allergen classification system for Indonesian recipes using the Bernoulli Naïve Bayes algorithm. The contributions include the construction of a recipe-level allergen dataset, the integration of text preprocessing, augmentation, and resampling techniques, and the introduction of multi-scenario allergen classification to support safer food choices. Recipe data were collected from Cookpad, producing 9,921 cleaned recipes after preprocessing. To increase data diversity and address class imbalance, rule-based ingredient augmentation expanded the dataset to 15,030 recipes. The model was evaluated under three classification scenarios: binary allergen detection (0–1), allergen exposure levels (0–3), and detailed allergen counts (0–14). Each scenario was tested using four dataset configurations: raw data, raw + ROS (Random Oversampling), augmented data, and augmented + ROS. Class distributions become increasingly imbalanced as the number of classes grows, particularly in the 15-class scenario. The binary scenario achieved perfect performance, with accuracy, precision, recall, and F1-score all equal to 1.0 across all dataset variants. Scenario 2 achieved the best multi-class performance with an F1-score of 0.9293 using Augmented + ROS data. Performance decreased in the 15-class setting due to increased classification complexity. Although a perfect binary score may raise concerns about overfitting, the result likely reflects the clear separability of the dataset’s allergen features. It should be interpreted cautiously when applied to broader culinary data.

Copyrights © 2026






Journal Info

Abbrev

jafost

Publisher

Subject

Agriculture, Biological Sciences & Forestry Biochemistry, Genetics & Molecular Biology Chemistry

Description

Journal of Agri food Science and Technology is a peer review journal that the Food Technology Department officially publishes Faculty of Industrial Technology Universitas Ahmad Dahlan As a scientific journal JAFOST publishes research and scientific studies related to the development of chemical or ...