Analisis Pengolahan Citra Produk Pangan Olahan Kemasan Untuk Deteksi Kehalalan Menggunakan Metode Optical Character Recognition (OCR) dan Klasifikasi Support Vector Machine (SVM) serta Convolutional Neural Network (CNN)
Keywords:
OCR, SVM, CNN, Text Classification, halal, haram, NERAbstract
This research aims to detect the halal status of packaged processed food products with OCR technology and machine learning based classification methods. Datasets in the form of product packaging images are collected through direct documentation and official sources, then processed using image preprocessing (grayscale, Otsu thresholding, resize 2x) to improve text reading quality. The OCR extracted text is then processed through the cleaning stage (lowercasing, normalisation, stopword removal) and analysed using a spaCy based NER approach with non-halal ingredient entity rules. The labelled data is used as input for two classification models SVM with TF-IDF representation and CNN with token-sequence representation. Evaluation was conducted using accuracy, precision, recall, F1-score, and confusion matrix metrics on 80:20 and 70:30 data split scenarios. The results showed that the SVM model recorded the highest accuracy of 99.36% and macro F1-score of 97.05% in the 80:20 scenario, and 99.22% and 96.29% in the 70:30 scenario. The CNN model recorded an accuracy of 98.61% and macro F1-score of 93.78% in the 80:20 scenario, as well as 98.08% and 91.50% in the 70:30 scenario. SVM model shows stability and consistently higher accuracy, while CNN remains competitive mainly due to its ability to capture contextual patterns from text data through embedding and convolution.
References
[1] Bangkit, D. A. (2022). Implementasi Named-Entity Recognition dan Optical Character Recognition untuk Aplikasi Pendeteksi Kehalalan Bahan Makanan. Jakarta: Fakultas Sains dan Teknologi, UIN Syarif Hidayatullah.
[2] Borade, R., Gupta, A., Kathpalia, A., Jain, T., & Chakurkar, P. (2024). Machine Learning Model for Optical Character Recognition-Based Food Allergen Detection with Recommendation System for Alternative Food. International Journal of Intelligent Systems and Applications in Engineering, 1869–1875.
[3] Khairani, D., Bangkit, D. A., Rozil, N. F., Masruroh, S. U., Oktaviana, S., & Rosyadi, T. (2022). Named-Entity Recognition and Optical Character Recognition for Detecting Halal Food Ingredients: Indonesian Case Study. 2022 10th International Conference on Cyber and IT Service Management (CITSM).
[4] Fadhilah, H., C., E. D., Ilyas, R., & Najmurrokhman, A. (2018). Non-Halal Ingredients Detection of Food Packaging Image Using Convolutional Neural Networks. International Symposium on Advanced Intelligent Informatics (SAIN) (pp. 131-136). Cimahi: SAIN.
[5] Aji, D. P. (2024). Aplikasi Pendeteksi Komposisi Makanan Pada Makanan Kemasan Menggunakan Teknologi Optical Character Recognition (OCR). Repository Universitas AMIKOM Purwokerto.
[6] Tarannum, S. (2023). Halal Food Identification from Product Ingredients using Machine Learning. United International University.
[7] W, B. K., Prasetyo, H., L, G. A., Wibisono, B. A., & Prasvita, D. S. (2021). Analisis Perbandingan Algoritma SVM dan CNN untuk Klasifikasi Buah. SENAMIKA.
[8] Ladopurab, Y. U., & Kaesmetan, Y. R. (2025). Analisis Perbandingan Convolutional Neural Network Dan Support Vector Machine Pada Analisis Sentimen Ruu Pilkada Di Aplikasi X. Journal of Information System, Applied, Management, Accounting and Research, 908-927.
[9] Yogi, M., Sari, M. I., & Handayani, R. (2023). Sistem Deteksi Teks Pada Kemasan Produk Makanan Menggunakan Metode Deep Learning Berbasis Raspberry Pi. e-Proceeding of Applied Science, Vol. 9, 2198-2205.
[10] Angela, S. M., A. E., & Mauliana, M. I. (2024). Pengembangan Teknologi Optical Character Recognition di Flutter Berupa Deteksi Teks pada Gambar. Jurnal TEKINKOM, Vol. 7, 17-24.
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Muhamad Quraisy, Agung Budi Susanto, Tukiyat

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