Analysis of shape features by applying gain ratio and machine learning for coffee bean classification

Authors

DOI:

https://doi.org/10.25186/.v19i.2206

Abstract

Coffee is one of the daily consumed beverages in many countries. It is yielded from coffee beans, which have proceeded through several processes. Several common coffee beans have been produced in Indonesia, such as Arabica, Robusta, Liberica, and Excelsa. Nevertheless, many coffee fanatics are unable to distinguish the various coffee bean types visually based on those shapes. Accordingly, it is necessary to classify the types of coffee beans. The work applied training and testing steps. Both involved ROI detection, pre-processing, segmentation, feature extraction, selection, and classification. Image processing was used in ROI detection, pre-processing, and segmentation to simplify the procedure and separate the coffee bean from the background. The feature extraction produced 14 shape features to distinguish the coffee bean’s class, but the proposed method’s performance has yet to reach the optimal result. The gain ratio was used to reduce the features; hence, only 4 features were selected, including aspect ratio, eccentricity, equivalent diameter, and area. These features were utilized as input data for classification using Naive Bayes, Artificial Neural Network (ANN), Support Vector Machine (SVM), C4.5, and decision tree. The proposed method used 4 features and a decision tree classifier. The local dataset has 400 coffee bean photos in four classes of 100 images each. The photos were divided for training and testing using k-fold 10 cross-validation. The accuracy evaluation parameter reached 0.995.

Key words: Coffee beans; otsu method; features reduction; cross-validation; decision tree.

References

AGUS, N. The impact of food safety standard on Indonesia’s coffee exports. Procedia Environmental Sciences, 20:425-433, 2014.

ALCAYDE, M.; ELIJORDE, F. I.; BYUN, Y. Quality monitoring system for pork meat using computer vision. 2019 IEEE Transportation Electrification Conference and Expo, Asia-Pacific - ITEC Asia-Pacific, p. 1-5, 2019.

ARBOLEDA, E. R.; FAJARDO, A. C.; MEDINA, R. P. Classification of coffee bean species using image processing, artificial neural network and K nearest neighbors. 2018 IEEE International Conference on Innovative Research and Development (ICIRD), p. 1-5, 2018.

ARSALANE, A. et al. Artificial vision and embedded systems as alternative tools for evaluating beef meat freshness. 2020 IEEE 6th International Conference on Optimization and Applications - ICOA, p. 1-6, 2020.

BAZAME, H. C. et al. Detection, classification, and mapping of coffee fruits during harvest with computer vision. Computers and Electronics in Agriculture, 183:106066, 2021.

BEHERA, S. K. et al. Maturity status classification of papaya fruits based on machine learning and transfer learning approach. Information Processing in Agriculture, 8(2):244-250, 2021.

DARWISH, A.; EZZAT, D.; HASSANIEN, A. E. An optimized model based on convolutional neural networks and orthogonal learning particle swarm optimization algorithm for plant diseases diagnosis. Swarm and Evolutionary Computation, 52:100616, 2020.

DENG, X. et al. An improved method to construct basic probability assignment based on the confusion matrix for classification problem. Information Sciences, 340-341:250-261, 2016.

DUTTA, K.; TALUKDAR, D.; BORA, S. Segmentation of unhealthy leaves in cruciferous crops for early disease detection using vegetative indices and Otsu thresholding of aerial images. Measurement, 189:110478, 2022.

FAHMI, F. et al. Image processing analysis of geospatial uav orthophotos for palm oil plantation monitoring. Journal of Physics, 978:012064, 2018.

FEBRIANA, A. et al. USK-COFFEE Dataset: A Multi-class green arabica coffee bean dataset for deep learning. 2022 IEEE International Conference on Cybernetics and Computational Intelligence (CyberneticsCom), p. 469-473, 2022.

FEBRIANTO, N. A.; ZHU, F. Coffee bean processing: Emerging methods and their effects on chemical, biological and sensory properties. Food Chemistry, 412:135489, 2023.

HAMDANI, H. et al. Detection of oil palm leaf disease based on color histogram and supervised classifier. Optik, 245:167753, 2021.

IQBAL, Z. et al. An automated detection and classification of citrus plant diseases using image processing techniques: A review. Computers and Electronics in Agriculture, 153:12-32, 2018.

JAMALLUDIN, M. D. et al. Implementation of feature selection using gain ratio towards improved accuracy of support vector machine (SVM) on youtube comment classification. 2021 International Seminar on Application for Technology of Information and Communication (iSemantic). p.22-31, 2021.

JANA, S.; PAREKH, R.; SARKAR, B. A De novo approach for automatic volume and mass estimation of fruits and vegetables. Optik, 200:163443, 2020.

JI, Y. et al. Non-destructive classification of defective potatoes based on hyperspectral imaging and support vector machine. Infrared Physics & Technology, 99:71-79, 2019.

LÜ, J. et al. Immature citrus fruit detection based on local binary pattern feature and hierarchical contour analysis. Biosystems Engineering, 171:78-90, 2018.

MUNERA, S. et al. Maturity monitoring of intact fruit and arils of pomegranate cv. ‘Mollar de Elche’ using machine vision and chemometrics. Postharvest Biology and Technology, 156:110936, 2019.

NYALALA, I. et al. Tomato volume and mass estimation using computer vision and machine learning algorithms: Cherry tomato model. Journal of Food Engineering, 263:288-298, 2019.

OLIVEIRA, E. M. de. et al. A computer vision system for coffee beans classification based on computational intelligence techniques. Journal of Food Engineering, 171:22-27, 2016.

PALACIOS-MORILLO, A. et al. Differentiation of Spanish paprika from protected designation of origin based on color measurements and pattern recognition. Food Control, 62:243-249, 2016.

PASHA, S. J.; MOHAMED, E. Advanced hybrid ensemble gain ratio feature selection model using machine learning for enhanced disease risk prediction. Informatics in Medicine Unlocked, 32:101064, 2022.

PATIL, J. K.; KUMAR, R. Analysis of content based image retrieval for plant leaf diseases using color, shape and texture features. Engineering in Agriculture, Environment and Food, 10(2):69-78, 2017.

PIEDAD, E. J. et al. Postharvest classification of banana (Musa acuminata) using tier-based machine learning. Postharvest Biology and Technology, 145:93-100, 2018.

PRASETIYO, B. et al. Evaluation of feature selection using information gain and gain ratio on bank marketing classification using naïve bayes. Journal of Physics, 1918(4):042153, 2021.

RAJASEKHAR, K.; BABU, T. R. G. Analysis and classification of dermoscopic images using spectral graph wavelet transform. Periodica Polytechnica Electrical Engineering and Computer Science, 64(3):313-323, 2020.

RANGKUTI, A. H.; HARJOKO, A.; PUTRA, A. E. A novel reliable approach for image batik classification that invariant with scale and rotation using MU2ECS-LBP algorithm. Procedia Computer Science, 179:863-870, 2021.

SANTOS, E. M. D. et al. Coffee by-products in topical formulations: A review. Trends in Food Science and Technology, 111:280-291, 2021.

SANTOS, F. F. L. D. et al. Quality assessment of coffee beans through computer vision and machine learning algorithms. Coffee Science, 15:e151752, 2020.

SARINO, J. N. C. et al. Classification of coffee bean degree of roast using image processing and neural network. ResearchGate, 8(10):3231-33, 2019.

SEPTIARINI, A. et al. Pixel quantification and color feature extraction on leaf images for oil palm disease identification. 2021 7th International Conference on Electrical, Electronics and Information Engineering - ICEEIE. p. 1-5. 2021.

SEPTIARINI, A. et al. Multi-Class support vector machine for arabica coffee bean roasting grade classification. 2022 5th International Conference on Information and Communications Technology - ICOIACT, p. 407-411, 2022a.

SEPTIARINI, A. et al. Image processing techniques for tomato segmentation applying k-means clustering and edge detection approach. 2021 International Seminar on Machine Learning, Optimization, and Data Science – ISMODE, p. 92-96, 2022b.

SEPTIARINI, A. et al. Maturity grading of oil palm fresh fruit bunches based on a machine learning approach. 2020 Fifth International Conference on Informatics and Computing - ICIC, p. 1-5, 2020.

SHARIF, M. et al. Detection and classification of citrus diseases in agriculture based on optimized weighted segmentation and feature selection. Computers and Electronics in Agriculture, 150:220-234, 2018.

TAN, K. et al. Recognising blueberry fruit of different maturity using histogram oriented gradients and colour features in outdoor scenes. Biosystems Engineering, 176:59-72, 2018.

TRABELSI, M.; MEDDOURI, N.; MADDOURI, M. A New feature selection method for nominal classifier based on formal concept analysis. Procedia Computer Science, 112:186-194, 2017.

UTAMININGRUM, F. et al. Descending stairs and floors classification as control reference in autonomous smart wheelchair. Journal of King Saud University - Computer and Information Sciences, 34(8):6040-6047, 2022.

VELÁSQUEZ, S. et al. Classification of the maturity stage of coffee cherries using comparative feature and machine learning. Coffee Science, 16:e161710, 2021.

YANG, X. et al. Machine learning for cultivar classification of apricots (Prunus armeniaca L.) based on shape features. Scientia Horticulturae, 256:108524, 2019.

ZHANG, C.; LIU, F.; HE, Y. Identification of coffee bean varieties using hyperspectral imaging: influence of preprocessing methods and pixel-wise spectra analysis. Scientific Reports, 8: 2166, 2018.

ZHANG, L.; WANG, J.; DUAN, Q. Estimation for fish mass using image analysis and neural network. Computers and Electronics in Agriculture, 173:105439, 2020.

ZHENG, Y. et al. Adaptive neural decision tree for EEG based emotion recognition. Information Sciences, 643:119160, 2023.

ZHUANG, J. et al. Detection of orchard citrus fruits using a monocular machine vision-based method for automatic fruit picking applications. Computers and Electronics in Agriculture, 152:64-73, 2018.

ZOU, K. et al. Broccoli seedling pest damage degree evaluation based on machine learning combined with color and shape features. Information Processing in Agriculture, 8(4):505-514, 2021.

Downloads

Published

2024-06-28

How to Cite

SEPTIARINI, A.; HAMDANI, H.; SELA, E. I. .; HIDAYAT, N. .; AFUAN, L. . Analysis of shape features by applying gain ratio and machine learning for coffee bean classification. Coffee Science - ISSN 1984-3909, [S. l.], v. 19, p. e192206, 2024. DOI: 10.25186/.v19i.2206. Disponível em: https://coffeescience.ufla.br/index.php/Coffeescience/article/view/2206. Acesso em: 14 oct. 2024.