HomeIsabela State University Linker: Journal of Engineering, Computing and Technologyvol. 2 no. 1 (2025)

Convolutional Neural Network-Based Ground Coffee Bean Classification in the Philippines

Marc P. Laureta | Meldrick Jake R. Carabeo | Aerold D. Torregoza | Milca Lianne P. Fulo

Discipline: Artificial Intelligence

 

Abstract:

While existing classification methods rely primarily on visual inspection or limited technological approaches, this research introduced a Convolutional Neural Network model specifically designed to address the challenges of classifying four major coffee varieties found in the Philippines: Arabica, Excelsa, Liberica, and Robusta. A comprehensive dataset of 1,817 ground coffee bean images captured in different lighting conditions, background colors, camera angles, and elevations was collected. To mitigate these challenges, advanced preprocessing and augmentation techniques were employed, including strategic resizing, flipping, and normalization to enhance the model's generalizability. The dataset was strategically divided into 80% training, 10% validation, and 10% testing sets to ensure efficient model performance. Utilizing TensorFlow and Keras on Kaggle, the CNN model was developed and subsequently deployed via a web-based application using Flask and HTML, offering an innovative, user-friendly interface for coffee bean classification. The model achieved a high overall classification accuracy of 96%, with Robusta and Arabica varieties demonstrating perfect classification. Thus, CNNs can effectively support the Philippine coffee industry by automating bean classification. Future work may focus on expanding the dataset to capture greater variability, refining the model—particularly for Excelsa and Liberica varieties, exploring advanced machine learning techniques to improve consistency and real-world deployment, and integrating the model into real-time classification systems to support broader adoption in the coffee industry.



References:

  1. Aghdamifar, E., Sharabiani, V. R., Taghinezhad, E., Fanaei, A. R., & Szymanek, M. (2023). Non-destructive method for identification and classification of varieties and quality of coffee beans based on soft computing models using VIS/NIR spectroscopy. European Food Research and Technology, 249(6), 1599–1612. https://doi.org/10.1007/s00217-023-04240-x
  2. Albawi, S., Mohammed, T. A., & Al-Zawi, S. (2017). Understanding of a convolutional neural network. In 2017 International Conference on Engineering and Technology (ICET) (pp. 1–6). IEEE. https://www.researchgate.net/publication/319253577
  3. Balbin, R., Ferrer, M., Olivares, A., Morales, A., & Antonio, S. (2021). A comprehensive systematic review on image processing techniques for coffee bean classification. International Journal of Scientific Research and Engineering Development, 7(1), 456–462. https://ijsred.com/volume7/issue1/IJSRED-V7I1P73.pdf
  4. Delmo, J. A. B., Villarica, M. V., & Vinluan, A. A. (2022). Classification of coffee variety using electronic nose. In 2022 IEEE 18th International Colloquium on Signal Processing & Applications (CSPA) (pp. 248–252). IEEE. https://doi.org/10.1109/CSPA55076.2022.9782056
  5. Gómez, N. A., Sánchez, K., & Arguello, H. (2019). Non-destructive method for classification of cocoa beans from spectral information. In 2019 XXII Symposium on Image, Signal Processing and Artificial Vision (STSIVA) (pp. 1–5). IEEE. https://doi.org/10.1109/STSIVA.2019.8730257
  6. Howard, A. G., Zhu, M., Chen, B., Kalenichenko, D., Wang, W., Weyand, T., Andreetto, M., & Adam, H. (2017). MobileNets: Efficient convolutional neural networks for mobile vision applications. arXiv. https://arxiv.org/abs/1704.04861
  7. Huang, N.-F., Chou, D.-L., Lee, C.-A., Wu, F.-P., Chuang, A.-C., Chen, Y.-H., & Tsai, Y.-C. (2020). Smart agriculture: Real-time classification of green coffee beans by using a convolutional neural network. IET Smart Cities, 2(3), 167–172. https://doi.org/10.1049/iet-smc.2020.0068
  8. Khattak, A., Asghar, M. U., Batool, U., Asghar, M. Z., Ullah, H., Al-Rakhami, M., & Gumaei, A. (2021). Automatic detection of citrus fruit and leaves diseases using deep neural network model. IEEE Access, 9, 112942–112954. https://doi.org/10.1109/ACCESS.2021.3096895
  9. Mendes, G. A., de Oliveira, M. A. L., Rodarte, M. P., dos Anjos, V. C., & Bell, M. J. V. (2022). Origin geographical classification of green coffee beans (Coffea arabica L.) produced in different regions of the Minas Gerais state by FT-MIR and chemometric. Current Research in Food Science, 5, 298–305. https://doi.org/10.1016/j.crfs.2022.01.017
  10. Mihailova, A., Liebisch, B., Islam, M. D., Carstensen, J. M., Cannavan, A., & Kelly, S. D. (2022). The use of multispectral imaging for the discrimination of Arabica and Robusta coffee beans. Food Chemistry: X, 14, Article 100325. https://doi.org/10.1016/j.fochx.2022.100325
  11. Pradana-Lopez, J. M., Cortes-Cedeno, J., Camargo, E. H., & Forero, J. F. (2021). Deep learning approach for adulteration detection in coffee blends using optical images. Journal of Food Engineering, 293, Article 110373. https://doi.org/10.1016/j.jfoodeng.2020.110373
  12. Rocchetti, G., Braceschi, G. P., Odello, L., Bertuzzi, T., Trevisan, M., & Lucini, L. (2020). Identification of markers of sensory quality in ground coffee: An untargeted metabolomics approach. Metabolomics, 16(12), 1–11. https://doi.org/10.1007/s11306-020-01751-6
  13. Santos, F., Rosas, J., Martins, R., Araújo, G., Viana, L., & Gonçalves, J. (2020). Quality assessment of coffee beans through computer vision and machine learning algorithms. Coffee Science, 15, e151752. https://doi.org/10.25186/.v15i.1752
  14. Tan, M., & Le, Q. V. (2019). EfficientNet: Rethinking model scaling for convolutional neural networks. arXiv. https://arxiv.org/abs/1905.11946
  15. World Coffee Research. (2022, February 23). WCR launches new membership model. World Coffee Research. https://worldcoffeeresearch.org/news/2022/wcr-launches-new-membership-model