
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
Coffee classification helps to obtain better cup quality and higher prices in the market. As well as with the naked eye, clear differences among healthy, sour and immature washed coffee beans, were observed with processed digital images. When washed coffee has a very advanced sour defect, the color of its husk is darker while immature washed coffee beans have a greenish coloration. In this study, digital images of healthy and defective coffee beans were obtained under controlled lighting and background conditions. A segmenting algorithm of the grains was developed and several color spaces were studied in order to find the greatest differences among the three classes: healthy, fermented, and immature beans. The greatest dispersion was observed in the B-G plane of the RGB color representation, in which three classifiers, namely, linear, Bayesian and K-nearest neighbors (K-NN) were applied. The mean efficacies of the classifiers were 88.4%, 79.3% and 88.1%, respectively. Due to good performance and low computational cost, the linear classifier, which validation had a right identification percentage of 91.4%, was chosen. The results of this research can be used in an electronic machine to separate those defective beans.