Accurate Skin Tone Classification for Foundation Shade Matching using GLCM Features-K-Nearest Neighbor Algorithm

Authors

  • Muhammad Reza Syahputra Faculty of Mathematics and Natural Science, Department of Computer Science, Lambung Mangkurat University, Kalimantan, Indonesia
  • Muhammad Itqan Mazdadi Faculty of Mathematics and Natural Science, Department of Computer Science, Lambung Mangkurat University, Kalimantan, Indonesia
  • Irwan Budiman Faculty of Mathematics and Natural Science, Department of Computer Science, Lambung Mangkurat University, Kalimantan, Indonesia
  • Andi Farmadi Faculty of Mathematics and Natural Science, Department of Computer Science, Lambung Mangkurat University, Kalimantan, Indonesia
  • Setyo Wahyu Saputro Faculty of Mathematics and Natural Science, Department of Computer Science, Lambung Mangkurat University, Kalimantan, Indonesia
  • Hasri Akbar Awal Rozaq Graduate School of Informatics, Department of Computer Science, Gazi University, Ankara, Turkey
  • Deni Sutaji Graduate School of Informatics, Department of Computer Science, Gazi University, Ankara, Turkey

DOI:

https://doi.org/10.52436/1.jutif.2025.6.5.4723

Keywords:

Classification Model, Color Matching, Complexion Analysis, Image Processing, Pattern Recognition

Abstract

Foundation shade matching remains a significant challenge in the beauty industry, particularly in Indonesia where consumers exhibit three distinct skin tone categories: ivory white, amber yellow, and tan. Manual foundation selection often results in mismatched shades, leading to customer dissatisfaction. This study presents a novel automated skin tone classification system combining Gray Level Co-Occurrence Matrix (GLCM) feature extraction with the K-Nearest Neighbor (KNN) algorithm. The GLCM method extracts four key texture features (contrast, homogeneity, energy, and entropy) from facial images, while KNN performs classification. A comprehensive dataset of 963 facial images was used, with 770 training and 193 test samples collected under controlled lighting conditions. After testing K values from 1 to 15, the optimal K=1 achieved 75.65% accuracy. Compared to baseline color histogram methods (60% accuracy), our GLCM-KNN approach demonstrates 15.65% improvement in classification performance. This research contributes to computer vision applications in beauty technology, enabling the development of mobile applications for virtual foundation try-on and personalized product recommendations. The findings have significant implications for the cosmetics industry, particularly for automated cosmetic shade matching systems and enhanced customer experience in online beauty retail. Further research is recommended to explore deep learning approaches and expand dataset diversity to improve accuracy.

Downloads

Download data is not yet available.

References

Y.-H. Choi, S. E. Kim, and K.-H. Lee, “Changes in consumers’ awareness and interest in cosmetic products during the pandemic,” Fash. Text., vol. 9, no. 1, p. 1, Jan. 2022, doi: 10.1186/s40691-021-00271-8.

Y. Yan, J. Lee, J. Hong, and H. Suk, “Measuring and describing the discoloration of liquid foundation,” Color Res. Appl., vol. 46, no. 2, pp. 362–375, Apr. 2021, doi: 10.1002/col.22584.

L. Liu, R. Huang, S. Yang, and N. Sang, “Detecting skin colors under varying illumination,” Nov. 2011, p. 80040N, doi: 10.1117/12.901776.

R. Kips, L. Tran, E. Malherbe, and M. Perrot, “Beyond Color Correction : Skin Color Estimation In The Wild Through Deep Learning,” Electron. Imaging, vol. 32, no. 5, pp. 82-1-82–8, Jan. 2020, doi: 10.2352/ISSN.2470-1173.2020.5.MAAP-082.

C. M. Frisby, “Black and Beautiful: A Content Analysis and Study of Colorism and Strides toward Inclusivity in the Cosmetic Industry,” Adv. Journal. Commun., vol. 07, no. 02, pp. 35–54, 2019, doi: 10.4236/ajc.2019.72003.

E. Markiewicz and O. Idowu, “Melanogenic Difference Consideration in Ethnic Skin Type: A Balance Approach Between Skin Brightening Applications and Beneficial Sun Exposure,” Clin. Cosmet. Investig. Dermatol., vol. Volume 13, pp. 215–232, Mar. 2020, doi: 10.2147/CCID.S245043.

M. Benčević, M. Habijan, I. Galić, D. Babin, and A. Pižurica, “Understanding skin color bias in deep learning-based skin lesion segmentation,” Comput. Methods Programs Biomed., vol. 245, p. 108044, Mar. 2024, doi: 10.1016/j.cmpb.2024.108044.

S. K. Mbatha, M. J. Booysen, and R. P. Theart, “Skin Tone Estimation under Diverse Lighting Conditions,” J. Imaging, vol. 10, no. 5, p. 109, Apr. 2024, doi: 10.3390/jimaging10050109.

C. M. Heldreth, E. P. Monk, A. T. Clark, C. Schumann, X. Eyee, and S. Ricco, “Which Skin Tone Measures Are the Most Inclusive? An Investigation of Skin Tone Measures for Artificial Intelligence,” ACM J. Responsible Comput., vol. 1, no. 1, pp. 1–21, Mar. 2024, doi: 10.1145/3632120.

P. Pi and D. Lima, “Gray level co-occurrence matrix and extreme learning machine for Covid-19 diagnosis,” Int. J. Cogn. Comput. Eng., vol. 2, pp. 93–103, Jun. 2021, doi: 10.1016/j.ijcce.2021.05.001.

M. M. D. Oghaz, V. Argyriou, D. Monekosso, and P. Remagnino, “Skin Identification Using Deep Convolutional Neural Network,” 2019, pp. 181–193.

P. Bjerring and P. H. Andersen, “Skin reflectance spectrophotometry,” Photodermatol., vol. 4, no. 3, pp. 167–171, Jun. 1987.

H. K. Jeong, C. Park, R. Henao, and M. Kheterpal, “Deep Learning in Dermatology: A Systematic Review of Current Approaches, Outcomes, and Limitations,” JID Innov., vol. 3, no. 1, p. 100150, Jan. 2023, doi: 10.1016/j.xjidi.2022.100150.

A. Almutairi and R. U. Khan, “Image-Based Classical Features and Machine Learning Analysis of Skin Cancer Instances,” Appl. Sci., vol. 13, no. 13, p. 7712, Jun. 2023, doi: 10.3390/app13137712.

A. Rasak, A. Zubair, O. A. Alo, and A. R. Zubair, “Grey Level Co-occurrence Matrix (GLCM) Based Second Order Statistics for Image Texture Analysis,” Int. J. Sci. Eng. Investig., vol. 8, no. 93, p. 93, 2019, [Online]. Available: www.IJSEI.com.

R. M. Haralick, K. Shanmugam, and I. Dinstein, “Textural Features for Image Classification,” IEEE Trans. Syst. Man. Cybern., vol. SMC-3, no. 6, pp. 610–621, Nov. 1973, doi: 10.1109/TSMC.1973.4309314.

U. Markowska-Kaczmar and A. Slimak, “Creating herd behavior by virtual agents using neural networks,” Procedia Comput. Sci., vol. 192, pp. 437–446, 2021, doi: 10.1016/j.procs.2021.08.045.

R. Andrian, M. A. Naufal, B. Hermanto, A. Junaidi, and F. R. Lumbanraja, “k-Nearest Neighbor (k-NN) Classification for Recognition of the Batik Lampung Motifs,” J. Phys. Conf. Ser., vol. 1338, no. 1, p. 012061, Oct. 2019, doi: 10.1088/1742-6596/1338/1/012061.

T. Johnson and S. K. Singh, “Fuzzy C strange points clustering algorithm,” in 2016 International Conference on Information Communication and Embedded Systems (ICICES), Feb. 2016, pp. 1–5, doi: 10.1109/ICICES.2016.7518929.

P. Cunningham and S. J. Delany, “k-Nearest Neighbour Classifiers - A Tutorial,” ACM Comput. Surv., vol. 54, no. 6, pp. 1–25, 2022.

S. Khare and K. P. Peeyush, “Automotive drive recorder as black box for low end vehicles,” in 2017 International Conference on Advances in Computing, Communications and Informatics (ICACCI), Sep. 2017, pp. 1855–1861, doi: 10.1109/ICACCI.2017.8126115.

Kuo Chih Liao, F. J. Richmond, T. Hogen-Esch, L. Marcu, and G. E. Loeb, “Sencil/spl trade/ project: development of a percutaneous optical biosensor,” in The 26th Annual International Conference of the IEEE Engineering in Medicine and Biology Society, vol. 3, pp. 2082–2085, doi: 10.1109/IEMBS.2004.1403612.

S. A. S. Rosiva, M. Zarlis, and W. Wanayumini, “Identifikasi Citra Daun dengan GLCM (Gray Level Co-Occurence) dan K-NN (K-Nearest Neighbor),” MATRIK J. Manajemen, Tek. Inform. dan Rekayasa Komput., vol. 21, no. 2, pp. 477–488, Mar. 2022, doi: 10.30812/matrik.v21i2.1572.

S. Suharyana, F. Anwar, A. C. Dewi, M. Yunianto, U. Salamah, and R. Chai, “Pneumonia Classification Based on GLCM Features Extraction using K-Nearest Neighbor,” Indones. J. Appl. Phys., vol. 13, no. 2, p. 325, Nov. 2023, doi: 10.13057/ijap.v13i2.77120.

D. P. Pamungkas, “Ekstraksi Citra menggunakan Metode GLCM dan KNN untuk Identifikasi Jenis Anggrek (Orchidaceae),” Innov. Res. Informatics, vol. 1, no. 2, Oct. 2019, doi: 10.37058/innovatics.v1i2.872.

O. Elsherif, “Skin Tone Data Classification,” Kaggle, 2022. https://www.kaggle.com/datasets/omarelsherif010/skin-tone-classification (accessed Apr. 07, 2024).

F. Pérez-García, R. Sparks, and S. Ourselin, “TorchIO: A Python library for efficient loading, preprocessing, augmentation and patch-based sampling of medical images in deep learning,” Comput. Methods Programs Biomed., vol. 208, p. 106236, Sep. 2021, doi: 10.1016/j.cmpb.2021.106236.

N. Iqbal, R. Mumtaz, U. Shafi, and S. M. H. Zaidi, “Gray level co-occurrence matrix (GLCM) texture based crop classification using low altitude remote sensing platforms,” PeerJ Comput. Sci., vol. 7, p. e536, May 2021, doi: 10.7717/peerj-cs.536.

F. Tampinongkol, “Identifikasi Penyakit Daun Tomat Menggunakan Gray Level Co-occurrence Matrix (GLCM) dan Support Vector Machine (SVM),” Techno Xplore J. Ilmu Komput. dan Teknol. Inf., vol. 8, no. 1, pp. 08–16, Apr. 2023, doi: 10.36805/technoxplore.v8i1.3578.

K. Djunaidi, H. Bedi Agtriadi, D. Kuswardani, and Y. S. Purwanto, “Gray level co-occurrence matrix feature extraction and histogram in breast cancer classification with ultrasonographic imagery,” Indones. J. Electr. Eng. Comput. Sci., vol. 22, no. 2, p. 795, May 2021, doi: 10.11591/ijeecs.v22.i2.pp795-800.

I. Sutrisno et al., “Design of Pothole Detector Using Gray Level Co-occurrence Matrix (GLCM) And Neural Network (NN),” IOP Conf. Ser. Mater. Sci. Eng., vol. 874, no. 1, p. 012012, Jun. 2020, doi: 10.1088/1757-899X/874/1/012012.

P. Kulkarni and D. Madathil, “Echocardiography image segmentation using semi‐automatic numerical optimisation method based on wavelet decomposition thresholding,” Int. J. Imaging Syst. Technol., vol. 31, no. 4, pp. 2295–2304, Dec. 2021, doi: 10.1002/ima.22631.

P. Schober, E. J. Mascha, and T. R. Vetter, “Statistics From A (Agreement) to Z (z Score): A Guide to Interpreting Common Measures of Association, Agreement, Diagnostic Accuracy, Effect Size, Heterogeneity, and Reliability in Medical Research,” Anesth. Analg., vol. 133, no. 6, pp. 1633–1641, Dec. 2021, doi: 10.1213/ANE.0000000000005773.

I. M. Putra, I. Tahyudin, H. A. A. Rozaq, A. Y. Syafa’At, R. Wahyudi, and E. Winarto, “Classification analysis of COVID19 patient data at government hospital of banyumas using machine learning,” in 2021 2nd International Conference on Smart Computing and Electronic Enterprise: Ubiquitous, Adaptive, and Sustainable Computing Solutions for New Normal, ICSCEE 2021, Jun. 2021, pp. 271–274, doi: 10.1109/ICSCEE50312.2021.9498020.

M. Mahmud et al., “Implementation of C5.0 Algorithm using Chi-Square Feature Selection for Early Detection of Hepatitis C Disease,” J. Electron. Electromed. Eng. Med. Informatics, vol. 6, no. 2, pp. 116–124, Mar. 2024, doi: 10.35882/jeeemi.v6i2.384.

C. Andrade, “Z Scores, Standard Scores, and Composite Test Scores Explained,” Indian J. Psychol. Med., vol. 43, no. 6, pp. 555–557, Nov. 2021, doi: 10.1177/02537176211046525.

D. Könen, D. Schmidt, and C. Spisla, “Finding all minimum cost flows and a faster algorithm for the K best flow problem,” Discret. Appl. Math., vol. 321, pp. 333–349, 2022, doi: 10.1016/j.dam.2022.07.007.

A. R. Isnain, J. Supriyanto, and M. P. Kharisma, “Implementation of K-Nearest Neighbor (K-NN) Algorithm For Public Sentiment Analysis of Online Learning,” IJCCS (Indonesian J. Comput. Cybern. Syst., vol. 15, no. 2, p. 121, Apr. 2021, doi: 10.22146/ijccs.65176.

V. R. Joseph, “Optimal ratio for data splitting,” Stat. Anal. Data Min. ASA Data Sci. J., vol. 15, no. 4, pp. 531–538, Aug. 2022, doi: 10.1002/sam.11583.

A. A. Kurniawan and M. Mustikasari, “Implementasi Deep Learning Menggunakan Metode CNN dan LSTM untuk Menentukan Berita Palsu dalam Bahasa Indonesia,” J. Inform. Univ. Pamulang, vol. 5, no. 4, p. 544, 2021, doi: 10.32493/informatika.v5i4.6760.

Q. H. Nguyen et al., “Influence of Data Splitting on Performance of Machine Learning Models in Prediction of Shear Strength of Soil,” Math. Probl. Eng., vol. 2021, pp. 1–15, Feb. 2021, doi: 10.1155/2021/4832864.

G. Valente, A. L. Castellanos, L. Hausfeld, F. De Martino, and E. Formisano, “Cross-validation and permutations in MVPA: Validity of permutation strategies and power of cross-validation schemes,” Neuroimage, vol. 238, p. 118145, Sep. 2021, doi: 10.1016/j.neuroimage.2021.118145.

B. G. Marcot and A. M. Hanea, “What is an optimal value of k in k-fold cross-validation in discrete Bayesian network analysis?,” Comput. Stat., vol. 36, no. 3, pp. 2009–2031, Sep. 2021, doi: 10.1007/s00180-020-00999-9.

A. X. Wang, S. S. Chukova, and B. P. Nguyen, “Ensemble k-nearest neighbors based on centroid displacement,” Inf. Sci. (Ny)., vol. 629, pp. 313–323, Jun. 2023, doi: 10.1016/j.ins.2023.02.004.

C. Feng, B. Zhao, X. Zhou, X. Ding, and Z. Shan, “An Enhanced Quantum K-Nearest Neighbor Classification Algorithm Based on Polar Distance,” Entropy, vol. 25, no. 1, p. 127, Jan. 2023, doi: 10.3390/e25010127.

I. M. Karo Karo, A. Khosuri, J. S. I. Septory, and D. P. Supandi, “Pengaruh Metode Pengukuran Jarak pada Algoritma k-NN untuk Klasifikasi Kebakaran Hutan dan Lahan,” J. Media Inform. Budidharma, vol. 6, no. 2, p. 1174, Apr. 2022, doi: 10.30865/mib.v6i2.3967.

M. Suyal and P. Goyal, “A Review on Analysis of K-Nearest Neighbor Classification Machine Learning Algorithms based on Supervised Learning,” Int. J. Eng. Trends Technol., vol. 70, no. 7, pp. 43–48, Jul. 2022, doi: 10.14445/22315381/IJETT-V70I7P205.

W. Wahyono, I. N. P. Trisna, S. L. Sariwening, M. Fajar, and D. Wijayanto, “Comparison of distance measurement on k-nearest neighbour in textual data classification,” J. Teknol. dan Sist. Komput., vol. 8, no. 1, pp. 54–58, Jan. 2020, doi: 10.14710/jtsiskom.8.1.2020.54-58.

M. Hasnain, M. F. Pasha, I. Ghani, M. Imran, M. Y. Alzahrani, and R. Budiarto, “Evaluating Trust Prediction and Confusion Matrix Measures for Web Services Ranking,” IEEE Access, vol. 8, pp. 90847–90861, 2020, doi: 10.1109/ACCESS.2020.2994222.

S. Napi’ah, T. H. Saragih, D. T. Nugrahadi, D. Kartini, and F. Abadi, “Implementation of Monarch Butterfly Optimization for Feature Selection in Coronary Artery Disease Classification Using Gradient Boosting Decision Tree,” J. Electron. Electromed. Eng. Med. Informatics, vol. 5, no. 4, Oct. 2023, doi: 10.35882/jeeemi.v5i4.331.

I. Tahyudin, H. A. A. Rozaq, and H. Nambo, “Machine Learning Analysis for Temperature Classification using Bioelectric Potential of Plant,” in 2022 6th International Conference on Information Technology, Information Systems and Electrical Engineering (ICITISEE), Dec. 2022, pp. 465–470, doi: 10.1109/ICITISEE57756.2022.10057768.

J. Xu, Y. Zhang, and D. Miao, “Three-way confusion matrix for classification: A measure driven view,” Inf. Sci. (Ny)., vol. 507, pp. 772–794, Jan. 2020, doi: 10.1016/j.ins.2019.06.064.

F. Eka Khoirunisa and N. Charibaldi, “Effect of Using GLCM and LBP+HOG Feature Extraction on SVM Method in Classification of Human Skin Disease Type,” Inf. J. Ilm. Bid. Teknol. Inf. dan Komun., vol. 9, no. 2, pp. 145–150, Jul. 2024, doi: 10.25139/inform.v9i2.8275.

F. T. Kurniati, D. H. Manongga, I. Sembiring, S. Wijono, and R. R. Huizen, “The object detection model uses combined extraction with KNN and RF classification,” Indones. J. Electr. Eng. Comput. Sci., vol. 35, no. 1, p. 436, Jul. 2024, doi: 10.11591/ijeecs.v35.i1.pp436-445.

F. Kirimi, “Remote sensing based assessment of land cover and soil moisture in the Kilombero floodplain in Tanzania,” Bonn University, 2018.

Additional Files

Published

2025-10-21

How to Cite

[1]
M. R. Syahputra, “Accurate Skin Tone Classification for Foundation Shade Matching using GLCM Features-K-Nearest Neighbor Algorithm”, J. Tek. Inform. (JUTIF), vol. 6, no. 5, pp. 3558–3571, Oct. 2025.

Most read articles by the same author(s)