OCR-LSTM-Based Detection of Pork-Derived Non-Halal Ingredients from Food Labels
DOI:
https://doi.org/10.55537/bigint.v4i2.1856Keywords:
Halal Ingredient Screening, OCR, LSTM, Food-Label Text Classification, Deep LearningAbstract
Packaged food labels may contain technical and multilingual ingredient terms that complicate preliminary screening for pork-derived non-halal substances. This study develops a web-based pipeline that integrates optical character recognition (OCR), automatic translation, and Long Short-Term Memory (LSTM) text classification. A public dataset of 528,092 labeled ingredient records, comprising 291,920 halal and 236,172 pork-related non-halal records, was used for model development. After text normalization, tokenization, and sequence padding, the data were divided into training, validation, and testing subsets using an 80:10:10 ratio. The final test set contained 52,810 records. The confusion matrix contained 29,182 true negatives, 12 false positives, 41 false negatives, and 23,575 true positives, corresponding to 99.90% accuracy, 99.95% precision, 99.83% recall, and a 99.89% F1-score. The web implementation accepts label images, extracts text, translates non-English content, and applies the trained classifier. The reported metrics evaluate the text classifier rather than the complete OCR-to-classification pipeline; therefore, the system should be treated as a preliminary screening tool and not as a substitute for formal halal certification.
Downloads
References
K. Nakyinsige, Y. B. Che Man, and A. Q. Sazili, “Halal authenticity issues in meat and meat products,” Meat Science, vol. 91, no. 3, pp. 207–214, 2012, doi: 10.1016/j.meatsci.2012.02.015
A. Rohman and Y. B. Che Man, “Analysis of pig derivatives for halal authentication studies,” Food Reviews International, vol. 28, no. 1, pp. 97–112, 2012, doi: 10.1080/87559129.2011.595862
I. Usman et al., “Advances and challenges in conventional and modern techniques for halal food authentication: A review,” Food Science & Nutrition, vol. 12, no. 3, pp. 1430–1443, 2024, doi: 10.1002/fsn3.3870
A. M. Fathima, L. Rahmawati, A. Windarsih, and Suratno, “Advanced halal authentication methods and technology for addressing non-compliance concerns in halal meat and meat products supply chain: A review,” Food Science of Animal Resources, vol. 44, no. 6, pp. 1195–1212, 2024, doi: 10.5851/kosfa.2024.e75
S. Long, X. He, and C. Yao, “Scene text detection and recognition: The deep learning era,” International Journal of Computer Vision, vol. 129, pp. 161–184, 2021, doi: 10.1007/s11263-020-01369-0
Y. Goldberg, “A primer on neural network models for natural language processing,” Journal of Artificial Intelligence Research, vol. 57, pp. 345–420, 2016, doi: 10.1613/jair.4992
K. Kowsari, K. J. Meimandi, M. Heidarysafa, S. Mendu, L. Barnes, and D. Brown, “Text classification algorithms: A survey,” Information, vol. 10, no. 4, art. no. 150, 2019, doi: 10.3390/info10040150
S. Minaee, N. Kalchbrenner, E. Cambria, N. Nikzad, M. Chenaghlu, and J. Gao, “Deep learning-based text classification: A comprehensive review,” ACM Computing Surveys, vol. 54, no. 3, art. no. 62, pp. 1–40, 2021, doi: 10.1145/3439726
S. Hochreiter and J. Schmidhuber, “Long short-term memory,” Neural Computation, vol. 9, no. 8, pp. 1735–1780, 1997, doi: 10.1162/neco.1997.9.8.1735
K. Greff, R. K. Srivastava, J. Koutnik, B. R. Steunebrink, and J. Schmidhuber, “LSTM: A search space odyssey,” IEEE Transactions on Neural Networks and Learning Systems, vol. 28, no. 10, pp. 2222–2232, 2017, doi: 10.1109/TNNLS.2016.2582924
S. Tarannum, M. S. Jalal, and M. N. Huda, “HALALCheck: A multi-faceted approach for intelligent halal packaged food recognition and analysis,” IEEE Access, vol. 12, pp. 28462–28474, 2024, doi: 10.1109/ACCESS.2024.3367983
D. Mulyana, D. H. F. Pratama, D. Fujianti, D. A. Nurhakim, and D. Rabbani, “Automation of halal food classification using Bidirectional Long Short-Term Memory on ingredients list,” Khazanah Journal of Religion and Technology, vol. 3, no. 2, pp. 36–44, 2025, doi: 10.15575/kjrt.v3i2.1774
I. A. Habibi, “List of Food Ingredients with Halal Label,” Kaggle dataset, 2023. https://www.kaggle.com/datasets/irfanakbarihabibi/list-of-food-ingredients-with-halal-label
R. M. H. Raja Nhari, J. H. Soh, N. F. Khairil Mokhtar, N. A. Mohammad, and A. Mohd Hashim, “Halal authentication using lateral flow devices for detection of pork adulteration in meat products: A review,” Food Additives & Contaminants: Part A, vol. 40, no. 8, pp. 971–980, 2023, doi: 10.1080/19440049.2023.2242955
A. A. Aida, Y. B. Che Man, and R. Son, “Detection of pig derivatives in food products for halal authentication by polymerase chain reaction–restriction fragment length polymorphism,” Journal of the Science of Food and Agriculture, vol. 87, no. 4, pp. 569–572, 2007, doi: 10.1002/jsfa.2699
D. P. Kingma and J. Ba, “Adam: A method for stochastic optimization,” in Proc. International Conference on Learning Representations, 2015, doi: 10.48550/arXiv.1412.6980
Google Cloud, “Cloud Translation documentation,” 2026. [Online]. Available: https://cloud.google.com/translate/docs
S. Siska, M. I. Jumadil, S. Abdullah, D. Ramadon, and A. Mun’im, “ATR-FTIR and chemometric method for the detection of pig-based derivatives in food products: A review,” International Food Research Journal, vol. 30, no. 2, pp. 281–289, 2023, doi: 10.47836/ifrj.30.2.01
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Muhammad Siddik Hasibuan, Suhardi Suhardi, Bagus Ageng Alfahri

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

