Auto Halal Detection Products Based on Euclidian Distance and Cosine Similarity

Nur Aini Rakhmawati, Azmi Adi Firmansyah, Pradita Maulidya Effendi, Rosyid Abdillah, Taufiq Agung Cahyono


Although Indonesia is the world the world's most populous Muslim-majority country, the number of halal-certified products in Indonesia is only 20% of the products on the Indonesian market. Halal certification is voluntary as such there are many food products which are halal but are not certified as halal. In principle, these food products may have similar halal ingredients with halal-certified products.  In this study, we build a system that can compare products that have not been certified halal with halal certified products based on its ingredients.  The food products are collected from Open Food Facts, Institute  For  Foods,  Drugs,  And  Cosmetics Indonesian  Council  Of  Ulama (LPPOM MUI) and our halal system. As of this paper writing, the halal-certified products are obtained from LPPOM MUI.  The system uses the Euclidean Distance and Cosine Similarity that generate top-5 similar products. Those two similarity calculations are based on Term Frequency-Inverse Entity Frequency weighting function.  The weighting function calculates the frequency of a term on a product name and ingredients.  If a similarity value of a product with no halal certification and a halal-certified product is higher than 75%, then the former could be indicated as a halal product. In the end, the system can give a recommendation of unknown products from a related pool of halal-certified products based on similarity of product composition. Cosine similarity accuracy is higher than Euclidean Distance and MoreLikeThis accuracy. Cosine similarity gets the highest precision because the cosine similarity is based on the vector angle of the term in a product.


halal; ingredients; euclidean distance; cosine similarity.

Full Text:



Badan Pusat Statistik Indonesia. (2010). “Jumlah dan Distribusi Pendudukâ€. [Online]. Available:

Santoso, A. B. (2015). “Berdasar Survei Ini, Pertambahan Penduduk Kristen di Indonesia Lebih Cepat Dibanding Muslim. [Online]. Available: survei-ini-pertambahan-penduduk-kristen-di-indonesia-lebih-cepat-dibanding-muslim

Tomoutou. (2017). “Jumlah Penganut Agama di Indonesia Tiap Provinsiâ€.[Online].Available:

Jati, S. “Sertifikasi Halal MUIâ€. Jakarta: Majelis Ulama Indonesia. 2017

LPPOM MUI. (2017). “Prosedur Sertifikasi Halal MUIâ€. [Online]. Available: 62/page/1

LPPOM MUI. (2017). “Statistik Sertifikasi Halal Indonesiaâ€. [Online]. Available:

Pratama, A. F. (2014). “Produk Bersertifikasi Halal di Indonesia Baru 20 Persen, Malaysia Sudah 90 Persenâ€. [Online]. Available:

B, Ali, and J.M. Regenstein, “ Halal food certification challenges and their implications for Muslim Societies Worldwide,†Electronic Turkish Studies, vol. 9, pp. 111-130, Nov. 2014.

A. Y. Rofiqi, “Clustering Berita Olahraga Berbahasa Indonesia Menggunakan Metode K-Medoid Bersyarat†SimanteC Journal, vol. 6 no 1. pp. 25-32.], June.2017.

T. Korenius, J, Laurikkala, M. Juhola, “On principal component analysis, cosine and Euclidean measures in information retrieval,†Information Sciences, vol. 177, pp. 4893-905, Nov 2007.

W.He et al. “Validation of origins of tea samples using partial least squares analysis and Euclidean distance method with near-infrared spectroscopy data,†Spectrochimica Acta Part A: Molecular and Biomolecular Spectroscopy, vol 86, pp. 399–404, Feb. 2012.

C. Bizer, “The emerging web of linked data,†IEEE Intelligent Systems, vol. 24, pp.87-92, Oct. .2009

G.A.Pradnyana, ER, N. A. S. “Perancangan dan mplementasi Automated Document Integration dengan menggunakan Algoritma Complete Linkage Agglomerative Hierarchical Clusteringâ€. Jurnal Ilmu Komputer, vol. 5, 2012.

Fatawi, J, N.A Rakhmawati, “Rancang bangun perangkat lunak linked open data halal dan gizi pada produk makanan dan minuman,†2016.

C. Bizer, T. Heath, T.Berners-Lee. "Linked data: The story so far." In Semantic services, interoperability and web applications: emerging concepts, pp. 205-227. IGI Global, 2011.

R. Delbru, et al. “Searching web data: an entity retrieval modelâ€. Digital Enterprise Research Institute, National University of Ireland, Galway, 2010

V.I. Levenshtein, “Binary codes capable of correcting deletions, insertions, and reversals,â€. Soviet physics doklady, vol. 10, no. 8, pp. 707-710, Feb.1996.

S. Niwattanakul, J. Singthongchai, E. Naenudorn, S. Wanapu, S, “Using of Jaccard coefficient for keywords similarity,†in Proceedings of the International MultiConference of Engineers and Computer Scientists, vol. 1, no. 6. Marc. 2013.



  • There are currently no refbacks.

Published by INSIGHT - Indonesian Society for Knowledge and Human Development