Automated Defect Classification of Coffee Beans Using Deep-Stacking Ensemble Learning

Main Article Content

Porntida Kaewkamol
Sujitra Arwatchananukul
Rattapon Saengrayap
Phasit Charoenkwan

Abstract

Quality control in coffee production is essential for maintaining product standards and preserving market value. A key practice in this process is to identify and remove defective beans which ensures high-quality standards and enhances consumer experience. However, traditional methods of classifying coffee bean defect often rely on manual inspection which is labour-intensive, time-consuming and subject to human errors. As such, adopting image classification for coffee bean defects could improve accuracy and boosts operational efficiency. This study explores the effectiveness of stacking-based deep learning ensemble method for coffee bean defect classification. The methodology involves a performance study as a baseline approach from fourteen traditional machine learning algorithms, including Support Vector Machines (SVM) and Random Forest (RF), along with ten different feature extraction techniques, such as FOS and GLDS. Besides, twenty well-known deep learning architectures including ResNet50, ConvNeXt and EfficientNet were compared to fourteen lightweight models such as TinyNet and MobileNet. Additionally, the performance of stacking-based deep learning models is also analysed to optimise coffee bean defect classification. The results indicate that ConvNeXt achieved the highest testing accuracy at 72.94% across all DL architectures. Additionally, the stacking approach significantly improves classification performance as it achieved an accuracy improvement from 72.94% to 87.64%. This study contributes to a comprehensive benchmarking to evaluate a diverse range of machine learning and deep learning algorithms. It also highlights the effectiveness of the stacking ensemble model to enhance accuracy in coffee bean defect classification. 

Article Details

Section
Research Article

References

Alamri, E. S., Altarawneh, G. A., Bayomy, H. M., & Hassanat, A. B. (2023). Machine learning classification of roasted Arabic coffee: Integrating color, chemical compositions, and antioxidants. Sustainability, 15(11561). https://doi.org/10.3390/su151511561

Arwatchananukul, S., Xu, D., Charoenkwan, P., Moon, S. A., & Saengraya, R. (2024). Implementing a deep learning model for defect classification in Thai Arabica green coffee beans. Smart Agricultural Technology, 9, 100680. https://doi.org/10.1016/j.atech.2024.100680

Balakrishnan, B. N., Jayakumari, A. N. K. M., Stephen, S. A., Venkitesan, P., & Raghavendra, V. (2024). Coffee bean graded based on deep net models. International Journal of Electrical and Computer Engineering (IJECE), 14(3), 3084–3093. https://doi.org/10.11591/ijece.v14i3.pp3084-3093

Bhoomika, & Verma, G. (2024). Enhancing coffee plant disease identification with EfficientNetB0 and deep learning. Proceedings of the International Conference on I-SMAC (IoT in Social, Mobile, Analytics, and Cloud) (I-SMAC 2024). IEEE. https://doi.org/10.1109/I-SMAC61858.2024.10714676

Hassan, E. (2024). Enhancing coffee bean classification: A comparative analysis of pre-trained deep learning models. Neural Computing and Applications, 36(9023–9052). https://doi.org/10.1007/s00521-024-09623-z

Khan, A. H., Iskandar, D. N. A., Mewada, H., & Sherazi, M. A. (2022). Ensemble learning of deep learning and traditional machine learning approaches for skin lesion segmentation and classification. Concurrency and Computation: Practice and Experience. https://doi.org/10.1002/cpe.6907

Karypidis, E., Mouslech, S. G., Skoulariki, K., & Gazis, A. (2022). Comparison analysis of traditional machine learning and deep learning techniques for data and image classification. WSEAS Transactions on Mathematics, 21(19). https://doi.org/10.37394/23206.2022.21.19

Kumar, V., Aydav, P. S. S., & Minz, S. (2024). Crop seeds classification using traditional machine learning and deep learning techniques: A comprehensive survey. SN Computer Science, 5(1031). https://doi.org/10.1007/s42979-024-03379-y

Motta, I. V. C., Vuillerme, N., Pham, H.-H., & de Figueiredo, F. A. P. (2025). Machine learning techniques for coffee classification: A comprehensive review of scientific research. Artificial Intelligence Review, 58(1), 15. https://doi.org/10.1007/s10462-024-11004-w

Nawaz, M., Nazir, T., Javed, A., Amin, S. T., Jeribi, F., & Tahir, A. (2024). CoffeeNet: A deep learning approach for coffee plant leaves diseases recognition. Expert Systems With Applications, 237, 121481. https://doi.org/10.1016/j.eswa.2023.121481

Ossani, P. C., Rossoni, D. F., Cirillo, M. Â., & Borém, F. M. (2020). Unsupervised classification of specialty coffees in homogeneous sensory attributes through machine learning. Coffee Science, 15, e151780. https://doi.org/10.25186/cs.v15i.1780

Pragathi, S. P., & Jacob, L. (2022). Review on image-based coffee bean quality classification: Machine learning approach. 2022 4th International Conference on Advances in Computing, Communication Control and Networking (ICAC3N), 706–711. https://doi.org/10.1109/ICAC3N56670.2022.10074124

Rangarajan, A. K., Purushothaman, R., Prabhakar, M., & Szczepański, C. (2021). Crop identification and disease classification using traditional machine learning and deep learning approaches. Journal of Engineering Research, 11(1B), 228–252. https://doi.org/10.36909/jer.11941

Ramamurthy, K., Chattopadhyay, S., & Thekkath, R. D. (2023). A novel deep learning architecture for disease classification in Arabica coffee plants. Concurrency and Computation: Practice and Experience. https://doi.org/10.1002/cpe.7625

Selvanarayanan, R., Rajendran, S., & Alotaibi, Y. (2023). Early detection of Colletotrichum Kahawae disease in coffee cherry based on computer vision techniques. Computer Modeling in Engineering & Sciences. https://doi.org/10.32604/cmes.2023.044084

Singh, M. K., & Kumar, A. (2024). Coffee leaf disease classification by using a hybrid deep convolution neural network. SN Computer Science, 5(618). https://doi.org/10.1007/s42979-024-02960-9

Thai, H.-D., Ko, H.-J., & Huh, J.-H. (2024). Coffee bean defects automatic classification: Realtime application adopting deep learning. IEEE Access. https://doi.org/10.1109/ACCESS.2024.3452552

Thakur, D., Gera, T., Aggarwal, A., Verma, M., Kaur, M., Singh, D., & Amoon, M. (2024). SUNet: Coffee leaf disease detection using hybrid deep learning model. IEEE Access. https://doi.org/10.1109/ACCESS.2024.3476211

Tsai, J.-J., Chang, C.-C., Huang, D.-Y., Lin, T.-S., & Chen, Y.-C. (2023). Analysis and classification of coffee beans using single coffee bean mass spectrometry with machine learning strategy. Food Chemistry, 426, 136610. https://doi.org/10.1016/j.foodchem.2023.136610

Velásquez, S., Franco, A. P., Peña, N., Bohórquez, J. C., & Gutiérrez, N. (2021). Classification of the maturity stage of coffee cherries using comparative feature and machine learning. Coffee Science, 16, e161710. https://doi.org/10.25186/.v16i.1710

Wang, P., Fan, E., & Wang, P. (2021). Comparative analysis of image classification algorithms based on traditional machine learning and deep learning. Pattern Recognition Letters, 141, 61–67. https://doi.org/10.1016/j.patrec.2020.11.024

Zhang, X., Chan, F. T. S., & Mahadevan, S. (2022). Explainable machine learning in image classification models: An uncertainty quantification perspective. Knowledge-Based Systems, 243, 108418. https://doi.org/10.1016/j.knosys.2022.108418

Jantawong, S. (2024). Image detection of GT pesticide test kit results in organic agricultural products using the CiRA-CORE deep learning model. International Journal of Science and Innovative Technology, 7(2)