Image Processing-Based Machine Learning for Multi-Class Apple Bruise Classification

Main Article Content

Daranat Tansui
0000-0002-0446-5396

Abstract

This research develops an automated apple bruise detection system that combines digital image processing and machine learning to enhance quality control. The study employs preprocessing techniques (resizing, grayscale conversion, thresholding) and extracts key features including pixel count, mean intensity, maximum and minimum pixel values, and estimated bruise area. A dataset of 513 apple samples was created and divided into training (70%), validation (15%), and test (15%) sets. Among the five evaluated classifiers, Decision Tree and Gradient Boosting demonstrate identical peak performance (99.35% accuracy, 0.9941 F1-score), with Decision Tree offering superior computational efficiency (200 times faster training). Random Forest achieves 98.70% accuracy, outperforming conventional methods (SVM, KNN, Logistic Regression). Notably, the Decision Tree accurately classifies severe bruises (Class 2), which is crucial for quality assurance. The system's effectiveness is validated through comprehensive metrics, including confusion matrices and ROC analysis. These results highlight the practical viability of implementing Decision Tree-based solutions in commercial fruit grading systems, offering an optimal balance between accuracy (99.35%) and operational efficiency (0.0012 seconds of training time). The findings enhance automated post-harvest inspection capabilities while addressing critical industry needs for rapid and reliable bruise detection.

Article Details

How to Cite
[1]
D. Tansui, “Image Processing-Based Machine Learning for Multi-Class Apple Bruise Classification”, ECTI-CIT Transactions, vol. 20, no. 1, pp. 116–129, Jan. 2026.
Section
Research Article
Author Biography

Daranat Tansui, Faculty of Communication Sciences Prince of Songkla University

Thai

References

J. Hou, Y. Che, Y. Fang, H. Bai, and L. Sun, “Early bruise detection in apple based on an improved Faster RCNN model,” Horticulturae, vol. 10, no. 1, 2024.

Z. Unal, T. Kızıldeniz, M. Ozden, H. Akta¸s and O. Karag¨oz, “Detection of bruises on red apples using deep learning models,” Scientia Horticulturae, vol. 329, p. 113021, Feb. 2024.

S. X. Fan, X. T. Liang, W. Q. Huang, V. J. Zhang, Q. Pang, X. He, L. J. Li and C. Zhang, “Real-time defects detection for apple sorting using NIR cameras with pruning-based YOLOV4 network,” Computers and Electronics in Agriculture, vol. 193, p. 106715, 2022.

Y. H. Yuan, Z. R. Yang, H. B. Liu, H. B. Wang, J. H. Li and L. L. Zhao, “Detection of early bruise in apple using near-infrared camera imaging technology combined with deep learning,” Infrared Physics & Technology, vol. 127, p. 104442, 2022

X. Tian, X. F. Liu, X. He, C. Zhang, J. B. Li, and W. Huang, “Detection of early bruises on apples using hyperspectral reflectance imaging coupled with optimal wavelength selection and improved watershed segmentation algorithm,” Journal of the Science of Food and Agriculture, vol. 103, no. 17, pp. 6689–6705, 2023.

I. Baek, C. Mo, C. Eggleton, S. A. Gadsden, B. K. Cho, J. Qin, D. E. Chan, and M. S. Kim, “Determination of spectral resolutions for multispectral detection of apple bruises using visible/near-infrared hyperspectral reflectance imaging,” Frontiers in Plant Science, vol. 13, p. 963591, 2022.

Y. Li et al., “Apple quality identification and classification by image processing based on convolutional neural networks,” Scientific Reports, vol. 11, p. 16618, 2021.

I. K. Opara, D. C. Divine, Y. Silue, U. L. Opara, J. A. Okolie and O. A. Fawole, “Application of machine learning in predicting fruit waste in a South African fresh produce wholesale market,” Journal of Agriculture and Food Research, vol. 22, 2025.

T. Adugna, W. Xu and J. Fan, “Comparison of random forest and support vector machine classifiers for regional land cover mapping using coarse resolution FY-3C images,” Remote Sensing, vol. 14, no. 3, 2022.

A. A. Taner, M. T. Mengstu, K. C¸ . Selvi, H. Du¨ran, O. Kaba¸s, I. G¨ur, T. Karak¨ose and N.-E. Gheorghit¸ˇa, “Multiclass apple varieties classification using machine learning with histogram of oriented gradient and color moments,” Applied Sciences, vol. 13, no. 20, p. 11113, 2023.

J. Hou, Y. Che, Y. Fang, H. Bai and L. Sun, “Early bruise detection in apple based on an improved Faster RCNN model,” Horticulturae, vol. 10, no. 1, p. 100, 2024.

Y. Li, X. Feng, Y. Liu and X. Han, “Apple quality identification and classification by image processing based on convolutional neural networks,” Scientific Reports, vol. 11, no. 1, p. 16618, 2021.

D. ul Khairi, K. Ahsan, G. Badshah, S. Z. Ali, S. A. Raza, O. Alqahtani and M. Shiraz, “Comparison Analysis of Machine Learning Classification on Apple Fruit Quality,” Research Square, preprint, 2024.

D. Hu, D. Qiu, S. Yu, T. Jia, T. Zhou and X. Yan, “Integration of Optical Property Mapping and Machine Learning for Real-Time Classification of Early Bruises of Apples,” Food and Bioprocess Technology, vol. 17, pp. 2745–2756, Dec. 2024.

J. F. I. Nturam¬birwe, W. J. Perold and U. L. Opara, “Classification learning of latent bruise damage to apples using shortwave infrared hyperspectral imaging,” Sensors, vol. 21, no. 15, p. 4990, Jul. 2021.

Z. Sun, D. Hu, L. Xie and Y. Ying, “Detection of early-stage bruise in apples using optical property mapping,” Computers and Electronics in Agriculture, vol. 194, p. 106725, 2022.

A. Bhargava and A. Bansal, “Machine learning based quality evaluation of mono-colored apples,” Multimedia Tools and Applications, vol. 79, no. 31–32, pp. 22989–23006, 2020,

H.-J. Baek, J.-W. Lee and S. Cho, “Determination of spectral resolutions for multispectral linescan imaging for apple bruise detection,” Frontiers in Plant Science, vol. 13, p. 963591, 2022.

Y. Hou, B. Huang and H. Sun, “Early bruise detection in apples based on improved SWIR–Vis/NIR deep learning models,” Horticulturae, vol. 10, no. 1, p. 100, 2024.

A. Nturambirwe and U. Opara, “Feature reduction for the classification of bruise damage using near-infrared spectral data,” Computers and Electronics in Agriculture, vol. 204, p. 107514, 2023.

B. Li and Y. Wang, “Enhanced detection of early bruises in apples using universal near-infrared methods across cultivars,” Journal of Food Engineering, vol. 363, p. 111287, 2025.

N. T. M. Long and N. T. Thinh, “Using machine learning to grade the mango’s quality based on external features captured by a vision system,” Applied Sciences, vol. 10, no. 16, p. 5775, 2020,

T. Sutanto, M. R. Aditya, H. Budiman, M. R. N. Ridha, U. Syapotro, and N. Azizah, “Comparison of Logistic Regression, Random Forest, SVM, KNN Algorithm for Water Quality Classification Based on Contaminant Parameters,” Journal of Data Science, vol. 2024, p. 48, 2024.

R. Siddiqi, “Automated apple detection using state-of-the-art object detection techniques,” SN Applied Sciences, vol. 1, no. 1345, 2019.

Roboflow. (2025). Apple Bruise Dataset. Retrieved from https://universe.roboflow. com/vd-7gtfp/apple-bruise.

OpenCV Documentation. (2025). Image Processing with OpenCV. Retrieved from https: //docs.opencv.org/

A. Khan, A. Sohail, U. Zahoora and A. S. Qureshi, “A survey of the recent architectures of deep convolutional neural networks,” Artificial Intelligence Review, vol. 53, no. 8, pp. 5455–5516, 2020.

M. Al-Sarayreh, M. M. Reis, W. Q. Yan and R. Klette, “Detection of fresh bruises on apples using hyperspectral imaging,” Postharvest Biology and Technology, vol. 146, pp. 1–11, 2018.

N. M. Trieu and N. T. Thinh, “Quality classification of dragon fruits based on external performance using a convolutional neural network,” Applied Sciences, vol. 11, no. 10558, 2021.

K. Sawant, A. K. B. Shenoy, S. Pai and R. D. Shirwaikar, “Comprehensive analysis of fruit variety classification: Techniques, challenges, and application,” Computers and Electronics in Agriculture, vol. 194, p. 106725, 2025.

Q. Zhu, J. Zhang and Z. Liu, “Rapid detection and visualization of slight bruises on apples using hyperspectral imaging,” International Journal of Food Properties, vol. 22, no. 1, pp. 2737–2752, 2019.