Prototype Development of Sorting System for Coffee Cherries Using Computer Vision

Main Article Content

Rattapol Pornprasit
Phongprapan Kantakaew
Kitiyaporn Takam
Wassanai Wattanutchariya

Abstract

Thailand's coffee market has experienced remarkable growth, with a consistent annual increase of 7.3% from 2017 to 2023, reaching a market valuation of 34 million Baht. Given this growth, assuring consistent coffee quality has become increasingly critical, particularly at the initial stage of coffee cherry selection. The quality of coffee cherries directly impacts the final coffee bean quality, making efficient and accurate sorting essential for premium coffee production. This research explores an innovative approach to coffee cherry classification using image processing techniques. We developed and compared four machine learning models: Support Vector Machine (SVM), K-Nearest Neighbors (KNN), Artificial Neural Network (ANN), and Convolutional Neural Network (CNN). Each model was evaluated based on classification accuracy and processing speed. The experimental results revealed that the CNN model significantly outperformed other approaches, achieving an overall operational accuracy of 81.73% and a throughput of approximately 120 cherries per minute (about 2 kg per hour). These findings suggest that automated visual inspection using CNN-based methods can substantially improve the efficiency and consistency of coffee cherry sorting, demonstrating strong potential for practical implementation in small- to medium-sized specialty coffee community enterprises.

Article Details

Section
Research Articles

References

Anita, S. and I. Albarda. 2020. Classification cherry’s coffee using k-nearest neighbor (KNN) and artificial neural network (ANN). pp.117-122. In: 2020 International Conference on Information Technology Systems and Innovation (ICITSI), Bandung.

Anonymous. 2024. Coffee++ Thailand project piloted to strengthen a network regenerative agriculture, economic and environmental resilience. (Online). Available: https://asean-agrifood.org/coffee-thailand-project-piloted-to-strengthen-a-network-regenerativeagriculture-economic-and-environmental-resilience/ (May 26, 2026).

Balbin, J.R., C.D. Del Valle, V.J.L.G. Lopez and R.F. Quiambao. 2020. Grading and profiling of coffee beans for international standards using integrated image processing algorithms and back-propagation neural network. pp. 1–6. In: IEEE 12th International Conference on Humanoid, Nanotechnology, Information Technology, Communication and Control, Environment, and Management (HNICEM), Manila.

Chumprasert, W., N. Kooprasert, A. Jieumdenngam and A. Srirat. 2020. Quality coffee a solution for Thai farmers. (Online). Available: https://www.bot.or.th/th/research-and-publications/articles-and-publications/articles/regional-articles/reg-article-2020jun02.html (May 26, 2026).

Euromonitor. 2023. Cafés/Bars in Thailand. (Online). Available: https://www.euromonitor.com/cafes-bars-in-thailand/report. (May 26, 2026).

Fracarolli, J.A., F.F.A. Pavarin, W. Castro and J. Blasco. 2021. Computer vision applied to food and agricultural products. Revista Ciência Agronômica 51(5): doi: 10.5935/1806-6690.20200087.

Haile, M. and W.H. Kang. 2019. The harvest and post-harvest management practices’ impact on coffee quality. pp. 59-76. In: D.T. Castanheira (ed.). Coffee- Production and Research. IntechOpen, London.

Iriondo-DeHond A., M. Iriondo-DeHond and M.D. del Castillo. 2020. Applications of compounds from coffee processing by-products. Biomolecules 10(9): 1219, doi: 10.3390/biom10091219.

Klingel, T., J.I. Kremer, V.Gottstein, T.R. De Rezende, S. Schwarz, and D.W. Lachenmeier. 2020. A review of coffee by-products including leaf, flower, cherry, husk, silver skin, and spent grounds as novel foods within the European Union, Foods 9(5): 665, doi: 10.3390/foods9050665.

Pei, Y., M. Lian, Y.Jiang, J. Ye, X. Han and Y. Gu. 2019. Real-time cherry color grading based on machine vision. pp.1-6. In: IEEE International Conference on Signal, Information and Data Processing (ICSIDP), Chongqing.

Peña, J.M., P.A. Gutiérrez, C. Hervás-Martínez, J. Six, R.E. Plant and F. López-Granados. 2014. Object-based image classification of summer crops with machine learning methods. Remote Sensing 6(6): 5019-5041.

Santos, F.F.L., J.T.F. Rosas, R.N. Martins, G.D.M. Araújo, L.D.A. Viana and J.P. Gonçalves. 2020. Quality assessment of coffee beans through computer vision and machine learning algorithms. Coffee Science 15: 1-9, doi: 10.25186/.v15i.1752.

Soedibyo, D.W., U. Ahmad and I.D.M. Subrata. 2010. Design of intelligent sorting system based on image processing for green coffee. Jurnal Keteknikan Pertanian 24(3): 67-74.

Stanley-Foreman, Z. 2023. Why cherry sorting is essential to improving coffee quality. (Online). Available: https://perfectdailygrind.com/2023/11/coffee-cherry-sorting/ (December 20, 2024).

Techanan, A., K. Rumjuankiat, K. Boonmee, C. Chumpun, I. Panchan, H. Urairong and P. Angkasith. 2023. Genetic diversity of arabica coffee varieties from the Royal Project Foundation using genotyping-by-sequencing (GBS). International Journal of Agricultural Technology 19(1): 257-276.

ULKA. 2025. Popular coffee varieties in Thailand: Arabica, Robusta, and major growing regions. (Online). Available: https://ulka.co.th/popular-thai-coffee-varieties/ (May 26, 2026).

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

Velásquez, S., N. Peña, J.C. Bohórquez, N. Gutierrez and G.L. Sacks. 2019. Volatile and sensory characterization of roast coffees effects of cherry maturity. Food Chemistry 274: 137-145.