Texture Feature Extraction in Grape Image Classification Using K-Nearest Neighbor

  • Pulung Nurtantio Andono Universitas Dian Nuswantoro
  • Siti Hadiati Nugraini Universitas Dian Nuswantoro
Keywords: KNN, GLCM, Grapes, classification


Indonesian Grapes are a vine. This fruit is often found in markets, shops, and the roadside. Along with the development of computer technology today, computers can solve problems by classifying objects and objects. How to apply GLCM and K-NN methods for the classification of grapes. The purpose of this study is to apply the GLCM and K-NN methods in the classification of grapes. The dataset used from kaggle.com sources, the data tested are 3 types of grapes, and the number of images is 2624. The fruit that will be used for the data collection and classification process is limited to three types of grapes, namely grape blue, grape pink, and grape white. How to apply GLCM and K-NN methods for the classification of grapes. The feature extraction of GLCM used in this study is the feature contrast, energy, correlation, and homogeneity. From testing the test data, the highest accuracy value is 99.5441% with k = 2 at level 8, while the lowest accuracy value is 24.924% at each k level 2. The GLCM level value is very influential on the accuracy results, namely, the higher the GLCM level value, the higher the GLCM value. accuracy is getting better.


Download data is not yet available.


Nana, D. I. Mulyana, A. Akbar, and M. Zikri, “Optimasi Klasifikasi Buah Anggur Menggunakan Data Augmentasi dan Convolutional Neural Network,” Smart Comp Vol., vol. 11, no. 2, pp. 148–161, 2022.

Z. Huang, A. Qin, J. Lu, A. Menon, and J. Gao, “Grape Leaf Disease Detection and Classification Using Machine Learning,” Proc. - IEEE Congr. Cybermatics 2020 IEEE Int. Conf. Internet Things, iThings 2020, IEEE Green Comput. Commun. GreenCom 2020, IEEE Cyber, Phys. Soc. Comput. CPSCom 2020 IEEE Smart Data, SmartD, no. March, pp. 870–877, 2020.

R. Berenstein, O. Ben Shahar, A. Shapiro, and Y. Edan, “Grape clusters and foliage detection algorithms for autonomous selective vineyard sprayer,” Intell. Serv. Robot., vol. 3, no. 4, pp. 233–243, 2010.

R. Chamelat, E. Rosso, A. Choksuriwong, C. Rosenberger, H. Laurent, and P. Bro, “Grape detection by image processing,” IECON Proc. (Industrial Electron. Conf., pp. 3697–3702, 2006.

F. M. Lacar, M. M. Lewis, and I. T. Grierson, “Use of hyperspectral imagery for mapping grape varieties in the Barossa Valley, South Australia,” Int. Geosci. Remote Sens. Symp., vol. 6, no. C, pp. 2875–2877, 2001.

P. B. Padol and A. A. Yadav, “SVM classifier based grape leaf disease detection,” Conf. Adv. Signal Process. CASP 2016, pp. 175–179, 2016.

M. J. Cejudo-Bastante, F. J. Rodríguez-Pulido, F. J. Heredia, and M. L. González-Miret, “Assessment of sensory and texture profiles of grape seeds at real maturity stages using image analysis,” Foods, vol. 10, no. 5, 2021.

H. Cecotti, A. Rivera, M. Farhadloo, and M. A. Pedroza, “Grape detection with convolutional neural networks,” Expert Syst. Appl., vol. 159, p. 113588, 2020.

O. R. Indriani, E. J. Kusuma, C. A. Sari, E. H. Rachmawanto, and D. R. I. M. Setiadi, “Tomatoes classification using K-NN based on GLCM and HSV color space,” in 2017 International Conference on Innovative and Creative Information Technology (ICITech), 2017, vol. 2018-Janua, pp. 1–6.

P. N. Andono, E. H. Rachmawanto, N. S. Herman, and K. Kondo, “Orchid types classification using supervised learning algorithm based on feature and color extraction,” Bull. Electr. Eng. Informatics, vol. 10, no. 5, pp. 2530–2538, Oct. 2021.

C. A. Sari, M. W. Kuncoro, D. R. I. M. Setiadi, and E. H. Rachmawanto, “Roundness and eccentricity feature extraction for Javanese handwritten character recognition based on K-nearest neighbor,” 2018 Int. Semin. Res. Inf. Technol. Intell. Syst. ISRITI 2018, pp. 5–10, 2018.

S. Sanjaya, M. L. Pura, S. K. Gusti, F. Yanto, and F. Syafria, “K-Nearest Neighbor for Classification of Tomato Maturity Level Based on Hue, Saturation, and Value Colors,” Indones. J. Artif. Intell. Data Min., vol. 2, no. 2, p. 101, Nov. 2019.

N. Nafiah, “Klasifikasi Kematangan Buah Mangga Berdasarkan Citra HSV dengan KNN,” J. Elektron. List. dan Teknol. Inf. Terap., vol. 1, no. 2, pp. 1–4, 2019.

H. Manickam, P. L. Chithra, and M. Henila, “Fruit Classification using image processing techniques Fruits Classification Using Image Processing Techniques,” Int. J. Comput. Sci. Eng. Open Access Res. Pap., no. 5, 2019.

I. U. W. Mulyono et al., “Parijoto Fruits Classification using K-Nearest Neighbor Based on Gray Level Co-Occurrence Matrix Texture Extraction,” J. Phys. Conf. Ser., vol. 1501, no. 1, 2020.

N. D. A. Partiningsih, R. R. Fratama, C. A. Sari, D. R. I. M. Setiadi, and E. H. Rachmawanto, “Handwriting Ownership Recognition using Contrast Enhancement and LBP Feature Extraction based on KNN,” Proc. - 2018 5th Int. Conf. Inf. Technol. Comput. Electr. Eng. ICITACEE 2018, pp. 342–346, 2018.

C. Irawan, W. Listyaningsih, D. R. I. M. Setiadi, C. Atika Sari, and E. Hari Rachmawanto, “CBIR for Herbs Root Using Color Histogram and GLCM Based on K-Nearest Neighbor,” Proc. - 2018 Int. Semin. Appl. Technol. Inf. Commun. Creat. Technol. Hum. Life, iSemantic 2018, no. 3, pp. 509–514, 2018.

F. Wibowo and A. Harjoko, “Klasifikasi Mutu Pepaya Berdasarkan Ciri Tekstur GLCM Menggunakan Jaringan Saraf Tiruan,” Khazanah Inform. J. Ilmu Komput. dan Inform., vol. 3, no. 2, p. 100, Jan. 2018.

Eliyani, Tulus, and F. Fahmi, “Pengenalan Tingkat Kematangan Buah Pepaya Paya Rabo Menggunakan Pengolahan Citra Berdasarkan Warna RGB Dengan K-Means Clustering,” Singuda Ensikom Image Process., vol. Image Proc, no. Special Issue 2013, pp. 1–5, 2013.

N. Krithika and A. Grace Selvarani, “An individual grape leaf disease identification using leaf skeletons and KNN classification,” Proc. 2017 Int. Conf. Innov. Information, Embed. Commun. Syst. ICIIECS 2017, vol. 2018-Janua, pp. 1–5, 2018.

S. A. Banday and A. H. Mir, “Statistical textural feature and deformable model based brain tumor segmentation and volume estimation,” Multimed. Tools Appl., vol. 76, no. 3, pp. 3809–3828, 2017.

D. M. Mahalakshmi and S. Sumathi, “Brain Tumour Segmentation Strategies Utilizing Mean Shift Clustering and Content Based Active Contour Segmentation,” ICTACT J. Image Video Process., vol. 9, no. 4, pp. 2002–2008, 2019.

E. Hossain, M. F. Hossain, and M. A. Rahaman, “A Color and Texture Based Approach for the Detection and Classification of Plant Leaf Disease Using KNN Classifier,” 2nd Int. Conf. Electr. Comput. Commun. Eng. ECCE 2019, pp. 1–6, 2019.

M. Daniel, J. Raharjo, and K. Usman, “Iris-based image processing for cholesterol level detection using gray level co-occurrence matrix and support vector machine,” Eng. J., vol. 24, no. 5, pp. 135–144, Sep. 2020.

A. E. Minarno, F. D. Setiawan Sumadi, H. Wibowo, and Y. Munarko, “Classification of batik patterns using K-Nearest neighbor and support vector machine,” Bull. Electr. Eng. Informatics, vol. 9, no. 3, pp. 1260–1267, Jun. 2020.

A. Nosseir and S. E. A. Ahmed, “Automatic Classification for Fruits’ Types and Identification of Rotten Ones Using k-NN and SVM,” Int. J. Online Biomed. Eng., vol. 15, no. 03, p. 47, Feb. 2019.

S. Jafarpour, Z. Sedghi, and M. C. Amirani, “A robust brain MRI classification with GLCM features A Robust Brain MRI Classification with GLCM Features,” Int. J. Comput. Appl., vol. 37, no. May, 2016.

Y. Chen et al., “Variety identification of orchids using Fourier transform infrared spectroscopy combined with stacked sparse auto-encoder,” Molecules, vol. 24, no. 13, 2019.

E. Hari Rachmawanto, G. Rambu Anarqi, D. R. I. Moses Setiadi, and C. Atika Sari, “Handwriting Recognition Using Eccentricity and Metric Feature Extraction Based on K-Nearest Neighbors,” Proc. - 2018 Int. Semin. Appl. Technol. Inf. Commun. Creat. Technol. Hum. Life, iSemantic 2018, pp. 411–416, 2018.

A. Susanto, D. Sinaga, C. A. Sari, E. H. Rachmawanto, and D. R. I. M. Setiadi, “A High Performace of Local Binary Pattern on Classify Javanese Character Classification,” Sci. J. Informatics, vol. 5, no. 1, p. 8, 2018.

O. R. Indriani, E. J. Kusuma, C. A. Sari, E. H. Rachmawanto, and D. R. I. M. Setiadi, “Tomatoes Classification Using K-NN Based on GLCM and HSV Color Space,” in International Conference on Innovative and Creative Information Technology (ICITech), 2017, pp. 1–6.

S. Bhattacharyya, A. Khasnobish, S. Chatterjee, A. Konar, and D. . Tibarewala, “Performance analysis of LDA, QDA and KNN algorithms in left-right limb movement classification from EEG data,” in 2010 International Conference on Systems in Medicine and Biology, 2010, no. December, pp. 126–131.

K. Zhang, Y. Yan, P. Li, J. Jing, X. Liu, and Z. Wang, “Fabric Defect Detection Using Salience Metric for Color Dissimilarity and Positional Aggregation,” IEEE Access, vol. 6, pp. 49170–49181, 2018.

How to Cite
Pulung Nurtantio Andono, & Nugraini, S. H. (2022). Texture Feature Extraction in Grape Image Classification Using K-Nearest Neighbor. Jurnal RESTI (Rekayasa Sistem Dan Teknologi Informasi), 6(5), 768 - 775. https://doi.org/10.29207/resti.v6i5.4137
Artikel Teknologi Informasi