An Intelligent Multi Feature Learning Approach for Palm Fruit Ripeness Classification: A Comparative Study of K-nearest Neighbor and Naïve bayes

Authors

  • Basiroh Basiroh Universitas Islam Batik
  • Widya Novita Al Afifah Irwanto Universitas Islam Batik
  • Siti Nurlaili Karim Universiti Teknologi Petronas

Keywords:

Machine Learning;, Feature Extraction, K-Nearest Neighbor (KNN), Texture Feature, Naïve Bayes, Multi-feature learning

Abstract

Digital technology has become increasingly integrated into the agricultural sector, with Computer Vision emerging as one of the most prominent artificial intelligence technologies that utilizes visual data to learn, analyze, and recognize objects automatically. The identification of oil palm fruit ripeness represents a form of collaboration between technology and agriculture. Accurate classification of oil palm fruit ripeness plays a crucial role in improving harvesting efficiency, maximizing oil yield, and maintaining the quality of crude palm oil. Conventional visual inspection performed by human operators is often subjective and inconsistent, leading to classification errors that may reduce production quality and economic value. Although previous studies have applied various machine learning algorithms for oil palm fruit classification, most have focused on a single feature type or individual classification algorithm, making it difficult to determine the most effective combination of features and classifier. To address this gap, this study presents a comparative analysis of two widely used classification algorithms, K-Nearest Neighbor (KNN) and Naïve Bayes, using color, texture, shape, and combined feature sets to identify the optimal approach for oil palm fruit ripeness classification. The dataset consists of images of unripe, ripe, and rotten oil palm fruits, comprising 600 training images and 150 testing images. Color features include mean RGB, RGB standard deviation, RGB skewness, and RGB entropy. Texture features consist of grayscale mean, grayscale standard deviation, contrast, correlation, energy, and homogeneity, while shape features include area, perimeter, metric, major axis, minor axis, and eccentricity. The novelty of this research lies in the comprehensive evaluation of multiple feature groups across different classification algorithms to determine the most discriminative feature–algorithm combination for oil palm ripeness assessment. Experimental results demonstrate that the KNN algorithm with k = 3 consistently outperforms Naïve Bayes, achieving accuracies of 91.3% using color features, 89.3% using texture features, 83.3% using shape features, and 98.0% when all features are combined. In comparison, Naïve Bayes achieves accuracies of 65.0%, 68.0%, 42.0%, and 77.0% for the respective feature sets. These findings indicate that combining color, texture, and shape features with the KNN classifier provides the most effective solution for automated oil palm fruit ripeness classification and can support the development of intelligent harvesting and quality control systems.

References

S. Puttinaovarat and S. Chai-arayalert, “Oil Palm Bunch Ripeness Classification and Plantation Verification Platform : Leveraging Deep Learning and Geospatial Analysis and Visualization,” 2024.

[2] F. Nadhirah, M. Nain, N. Hashimah, A. Hassain, and R. Abdullah, “A Review of an Artificial Intelligence Framework for Identifying the Most Effective Palm Oil Prediction,” 2022.

[3] S. Nasyira and L. Rosnita, “Comparison of K-Nearest Neighbors Method and Naïve Bayes Method in Classifying the Quality of Oil Palm Seed Varieties,” vol. 10, no. 2, pp. 413–425, 2025, doi: 10.31572/inotera.Vol10.Iss2.2025.ID539.

[4] G. Tan, H. Tzuan, F. H. Hashim, T. Raj, A. B. Huddin, and M. S. Sajab, “Oil Palm Fruits Ripeness Classification Based on the Characteristics of Protein , Lipid , Carotene , and Guanine / Cytosine from the Raman Spectra,” 2022.

[5] Z. Hong, W. Lei, J. Ruiming, and L. Junwei, “A distance measuring method using visual image processing,” Proc. 2009 2nd Int. Congr. Image Signal Process. CISP’09, vol. 1, no. 2, pp. 1–5, 2009, doi: 10.1109/CISP.2009.5303258.

[6] J. Q. Goh, A. Rashid, and M. Shariff, “Application of Optical Spectrometer to Determine Maturity Level of Oil Palm Fresh Fruit Bunches Based on Analysis of the Front Equatorial , Front Basil , Back Equatorial , Back Basil and Apical Parts of the Oil Palm Bunches,” 2025.

[7] A. Noviyanto, F. Ramadhani, V. Kautsar, Y. Avianto, and S. Gunawan, “Advancing Concession-Scale Carbon Stock Prediction in Oil Palm Using Machine Learning and Multi-Sensor Satellite Indices,” pp. 1–27, 2026.

[8] M. S. M. Alfatni et al., “Towards a Real-Time Oil Palm Fruit Maturity System Using Supervised Classifiers Based on Feature Analysis,” 2022.

[9] A. M. Syaifullah, “Proses Pengolahan Kelapa Sawit PT Perkebunan Nusantara XIV Unit PKS Luwu,” 2021.

[10] R. Hidayat, M. Fikry, Y. Yusra, F. Yanto, and E. P. Cynthia, “Penerapan Naïve Bayes Classifier dalam Klasifikasi Sentimen Publik di Twitter terhadap Puan Maharani,” JUKI J. Komput. dan Inform., vol. 6, no. 1, pp. 100–108, 2024, doi: 10.53842/juki.v6i1.479.

[11] M. A. Zulkhoiri et al., “Investigation of oil palm fruit bunch ripeness classification using machine learning classifiers,” vol. 02010, pp. 1–12, 2024.

[12] Y. Jusman, A. Maulana, and J. H. Lubis, “Classification of Leaf Diseases in Oil Palm Plants with Haar Wavelet Transform Features Based on Machine Learning,” vol. 01002, 2024.

[13] X. Jian, W. Loon, K. Shien, and W. Zhe, “Expert systems in oil palm precision agriculture : A decade systematic review,” J. King Saud Univ. - Comput. Inf. Sci., vol. 34, no. 4, pp. 1569–1594, 2022, doi: 10.1016/j.jksuci.2022.02.006.

[14] Y. Luo, A. P. P. A. Majeed, Z. Omar, S. Jagtap, G. Garcia-garcia, and Y. Chen, “Synergizing Residual and Dense Architectures for Fine-Grained Oil Palm Grading : A Deep Feature Concatenation Approach,” pp. 1–23, 2026.

[15] T. Dzulkarnain, D. E. Ratnawati, and B. Rahayudi, “Penggunaan Metode Naïve Bayes Classifier pada Analisis Sentimen Penilaian Masyarakat Terhadap Pelayanan Rumah Sakit di Malang,” J. Teknol. Inf. dan Ilmu Komput., vol. 11, no. 5, pp. 993–1000, 2024, doi: 10.25126/jtiik.2024117979.

[16] N. S. Suriani, N. H. Mohd, S. M. Shah, S. Z. Muji, F. Atyka, and N. Rashid, “A Feasibility Study on Synthetic RGB-NIR Image Generation for Oil Palm Fresh Fruit Bunch Grading,” vol. 17, no. 2, pp. 729–739, 2026.

[17] C. Li et al., “Integrating Multi-Temporal Landsat and Sentinel Data for Enhanced Oil Palm Plantation Mapping and Age Estimation in Malaysia,” pp. 1–27, 2025.

[18] D. S. Arief, M. Shiddiq, J. Jahrizal, and M. Dalil, “Machine vision for detection of defective oil palm fresh fruit bunches using YOLO Algorithm,” vol. 3186, pp. 1–16, 2026, doi: 10.1088/1742-6596/3186/1/012026.

[19] S. Singh, H. Dureja, and R. Singh, “A multilingual smart farming system for real time agricultural decisions using machine learning,” 2026.

[20] T. Li et al., “Advancements in Intelligent Monitoring Technologies for Behavioral , Physiological , and Biomarker Analysis in Cattle Health : A Review,” pp. 1–40, 2026.

[21] P. Chaudhary, P. Gulia, N. S. Gill, N. Alduaiji, and P. K. Shukla, “An evaluation of machine learning for soil analysis in internet of things-enabled smart farming,” pp. 1–24, 2026.

[22] S. Lingamgunta, J. Mudidana, D. R. Vincent, and S. A. M. Felicita, “Distilled vision transformers with CNN fusion for robust cashew apple maturity prediction,” no. April, pp. 1–20, 2026, doi: 10.3389/fpls.2026.1787609.

[23] L. Colaco and P. Kamat, Artificial intelligence advances for cashew fruit maturity and quality detection : a systematic review on models , sensors , and farming applications. 2025.

[24] W. Novita and A. Afifah, “ANALISIS SENTIMEN NEGATIVE PADA APLIKASI JOBSTREET MENGGUNAKAN HADOOP DISTRIBUTED FILE SYSTEM ( HDFS ),” vol. 4, no. 4, pp. 287–293, 2025.

[25] R. Wulandari and A. Abas, “Understanding the impact of climate change on oil palm plantation : a systematic literature review,” no. August, pp. 1–17, 2025, doi: 10.3389/fsufs.2025.1621217.

[26] M. P. J. Tabe-ojong, A. G. Geffersa, and K. T. Sibhatu, “Producer organizations , productivity and sustainable intensification practices in oil palm production,” pp. 1–18, 2026.

[27] V. Lai, N. Yusma, M. Yusoff, A. Najah, and Y. F. Huang, “The benefits and perspectives of the palm oil industry,” Environ. Dev. Sustain., no. 0123456789, 2024, doi: 10.1007/s10668-024-04593-7.

[28] J. Ma, M. Li, W. Fan, and J. Liu, “State-of-the-Art Techniques for Fruit Maturity Detection,” 2024.

[29] Y. Xu, H. Li, Y. Zhou, Y. Zhai, Y. Yang, and D. Fu, “GLL-YOLO : A Lightweight Network for Detecting the Maturity of Blueberry Fruits,” pp. 1–22, 2025.

[30] C. J. Huang, M. C. Liu, S. S. Chu, and C. L. Cheng, “Application of machine learning techniques to Web-based intelligent learning diagnosis system,” Proc. - HIS’04 4th Int. Conf. Hybrid Intell. Syst., pp. 242–247, 2005, doi: 10.1109/ichis.2004.25.

[31] Y. Liu, Q. Yu, S. Geng, S. Guo, and L. Liu, “SSViT-YOLOv11 : fusing lightweight YOLO & ViT for coffee fruit maturity detection,” no. December, pp. 1–20, 2025, doi: 10.3389/fpls.2025.1691643.

[32] N. Wu et al., “Maturity detection and counting of blueberries in real orchards using a novel STF-YOLO model integrated with ByteTrack algorithm,” no. November, pp. 1–26, 2025, doi: 10.3389/fpls.2025.1682024.

[33] S. Jiang et al., “A Real-Time Detection and Maturity Classification Method for Loofah,” 2023.

[34] T. Daware, P. Ramteke, U. Shaikh, and S. Bharne, “Crop Guidance and Farmer ’ s Friend – Smart Farming using Machine Learning,” vol. 03021, pp. 1–8, 2022.

[35] J. P. Mehare, “Classification and Regression Supervised Machine Learning Approach in Smart Farming for Hydroponics System with Intelligent and Precise Management based on IoT,” vol. 20, no. August, pp. 9334–9347, 2022, doi: 10.14704/nq.2022.20.10.NQ55912.

Published

2026-09-29