Implementation of The Weighted K-Nearest Neighbors Algorithm in The Classification of Beef and Pork Images

Main Article Content

Nurdi Afrianto
Irzon Meiditra

Abstract

The demand for meat in Indonesia is still high, especially for the consumption of beef and pork, which are important commodities in the market. Although meat provides essential nutrients, pork has health risks because it contains more than 40 dangerous pathogens and various bacteria. In traditional markets in Indonesia, the fraudulent practice of mixing pork and beef to gain greater profits is a serious problem. This is very detrimental to consumers, especially Muslims who do not consume pork. The study used machine learning, the Weighted K-nearest neighbor (WKNN) algorithm, to classify meat based on color features. The stages used began with collecting a dataset of 400 images and divided into 200 images of pork and beef for each. Images were taken using a Canon EOS Kiss X50 DSLR camera at ISO 100-200 for good image quality. Feature extraction uses HSV and RGB algorithms that focus on color. Furthermore, the data is divided into 70% for training and 30% for testing. The model was evaluated with a confusion matrix, namely accuracy, precision, and F1 score, which each produced an accuracy of 85%, 86%, and 80%. The research is updated on the application of WKNN for meat classification in traditional markets.

Article Details

How to Cite
Afrianto, N., & Meiditra, I. (2024). Implementation of The Weighted K-Nearest Neighbors Algorithm in The Classification of Beef and Pork Images. Journal of Informatics Information System Software Engineering and Applications (INISTA), 7(1), 13-21. Retrieved from https://journal.ittelkom-pwt.ac.id/index.php/inista/article/view/1615
Section
Articles

References

[1] P. L. Greenwood, "Review: An overview of beef production from pasture and feedlot globally, as demand for beef and the need for sustainable practices increase," Animal, vol. 15, no. xxxx, p. 100295, 2021, doi: 10.1016/j.animal.2021.100295.
[2] N. Johnson, K. Truatman, S. Stastny, R. McGrath, and K. Hackney, "Beef Consumption and Functional Performance in Middle-Aged and Older Adults: A Systematic Review," vol. 3, no. 1, pp. 18–31, 2019.
[3] H. Dagevos, "Finding flexitarians: Current studies on meat eaters and meat reducers," Trends Food Sci. Technol., vol. 114, no. June, pp. 530–539, 2021, doi: 10.1016/j.tifs.2021.06.021.
[4] L. P. Penkert, R. Li, J. Huang, A. Gurcan, M. Chung, and T. C. Wallace, "Pork Consumption and Its Relationship to Human Nutrition and Health: A Scoping Review," Meat Muscle Biol., vol. 5, no. 1, 2021, doi: 10.22175/mmb.12953.
[5] E. Mighell and M. P. Ward, "African Swine Fever spread across Asia, 2018–2019," Transbound. Emerg. Dis., vol. 68, no. 5, pp. 2722–2732, 2021, doi: 10.1111/tbed.14039.
[6] T. Kayano, J. Pulford, and L. Thomas, "Identifying Pig- and Pork-Associated Zoonotic and Foodborne Hazards in Eastern and Southern Africa: A Systematised Review," Zoonotic Dis., vol. 3, no. 2, pp. 120–133, 2023, doi: 10.3390/zoonoticdis3020011.
[7] L. Soliani, G. Rugna, A. Prosperi, C. Chiapponi, and A. Luppi, "Salmonella Infection in Pigs: Disease, Prevalence, and a Link between Swine and Human Health," Pathogens, vol. 12, no. 10, 2023, doi: 10.3390/pathogens12101267.
[8] S. Pfuderer, R. M. Bennett, A. Brown, and L. M. Collins, "A flexible tool for the assessment of the economic cost of pig disease in growers and finishers at farm level," Prev. Vet. Med., vol. 208, no. September, p. 105757, 2022, doi: 10.1016/j.prevetmed.2022.105757.
[9] E. Radulovic et al., "The baseline immunological and hygienic status of pigs impact disease severity of African swine fever," PLoS Pathog., vol. 18, no. 8, pp. 1–22, 2022, doi: 10.1371/journal.ppat.1010522.
[10] N. Bor et al., "Prevalence of Antibiotic Residues in Pork in Kenya and the Potential of Using Gross Pathological Lesions as a Risk-Based Approach to Predict Residues in Meat," Antibiotics, vol. 12, no. 3, 2023, doi: 10.3390/antibiotics12030492.
[11] R. G. Ferrari, D. K. A. Rosario, A. Cunha-Neto, S. B. Mano, E. E. S. Figueiredo, and C. A. Conte-Juniora, "Worldwide epidemiology of Salmonella serovars in animal-based foods: A meta-analysis," Appl. Environ. Microbiol., vol. 85, no. 14, 2019, doi: 10.1128/AEM.00591-19.
[12] F. Tarakci and A. Ozkan, "Comparison of classification performance of kNN and WKNN algorithms," Selcuk Univ. J. Eng. Sci., vol. 20, no. 02, pp. 32–37, 2021, [Online]. Available: http://sujes.selcuk.edu.tr/sujes.
[13] C. Dewi and Y. K. Arbawa, "Performance Evaluation of Distance Function in KNN and WKNN for Classification of Soil Organic Matter," Proc. 2019 4th Int. Conf. Sustain. Inf. Eng. Technol. SIET 2019, pp. 196–199, 2019, doi: 10.1109/SIET48054.2019.8986030.
[14] A. M. Priyatno, F. M. Putra, P. Cholidhazia, and L. Ningsih, "Combination of extraction features based on texture and colour feature for beef and pork classification," J. Phys. Conf. Ser., vol. 1563, no. 1, 2020, doi: 10.1088/1742-6596/1563/1/012007.
[15] F. García-Lamont, J. Cervantes, A. López-Chau, and S. Ruiz-Castilla, "Color image segmentation using saturated RGB colors and decoupling the intensity from the hue," Multimed. Tools Appl., vol. 79, no. 1–2, pp. 1555–1584, 2020, doi: 10.1007/s11042-019-08278-6.
[16] Z. Yan, L. Xu, A. Suzuki, J. Wang, J. Cao, and J. Huang, "RGB Color Model Aware Computational Color Naming and Its Application to Data Augmentation," Proc. - 2022 IEEE Int. Conf. Big Data, Big Data 2022, pp. 1172–1181, 2022, doi: 10.1109/BigData55660.2022.10020750.
[17] Y. A. Anwar, B. E. W. Asrul, and S. Zuhriyah, “Implementasi Algoritma Hue Saturation Value (HSV) Pada Penentuan Kualitas Beras Berbasis Android,” Pros. Semin. Nas. Sist. Inf. dan Teknol., pp. 139–143, 2023.
[18] S. Simbolon et al., "Image Segmentation using Color Value of the Hue in CT Scan Result," J. Phys. Conf. Ser., vol. 2394, no. 1, 2022, doi: 10.1088/1742-6596/2394/1/012017.
[19] S. Dewi Purba and P. Sirait, "Credit Card Risk Classification Using K-Nearest Neighbor Weighted Algorithm Based on Forward Selection," J. Mantik, vol. 4, no. 3, pp. 1551–1559, 2020, [Online]. Available: https://iocscience.org/ejournal/index.php/mantik.
[20] L. Ningsih and P. Cholidhazia, "Classification Of Tomato Maturity Levels Based on RGB And HSV Colors Using KNN Algorithm," RIGGS J. Artif. Intell. Digit. Bus., vol. 1, no. 1, pp. 25–30, 2022, doi: 10.31004/riggs.v1i1.10.