# Application of Machine Learning to Assess the Quality of Food Products--Case Study: Coffee Bean
## 4 Conclusions  
The statistical analysis by ANOVA for color helped distinguish exactly three classes of coffee beans in the RGB color space model, which translated into the efficient recognition of coffee defects obtained during the coffee roasting process. The L*a*b* color model demonstrated the difficulty in distinguishing between the quality classes of under-roasted and properly roasted coffee beans. Nevertheless, the L*a*b* model successfully distinguished between the class of over-roasted coffee. Analyzing the properties of coffee color parameters as an indicator of authenticity can make valuable contributions to food quality and safety.  
More challenging was the classification based on digital images with a resolution of \(678\times 678\) by, among other things, the multidimensionality and complexity of the information contained in the acquired image as a result of image acquisition. The application of deep artificial neural networks made it possible to classify coffee bean samples using computer vision based on image pixels. As a result, an adequate CNN model was acquired, which was characterized by a high fit factor for the test set of 0.81.  
The quality assessment of coffee on the basis of representative characteristics (in this case, color) significantly affects both producers and consumers. The effective evaluation of coffee quality will maintain a high product standard in the industrial coffee-roasting process. Consumers will be inclined to select and consume the right kind of coffee through taste and satisfaction with the obtained high-quality food product.  
In the future, it is planned to use artificial intelligence methods to help effectively optimize the coffee quality evaluation process. Effectively modeling, operating a series of simulations, making predictions, optimizing, conducting quality control, detecting patterns and diagnosing through machine learning is becoming increasingly important in the food  
Figure 4: CNN model structure includes input data (obtained from image acquisition and processed as a result of image processing) and different types of layers, such as four convolutional layers (CONV2D), four layers of Max-pooling (MAXPOOLING), one dense layer with regularization (DENSE + regularization), one dropout layer (DROPOUT), one global average pooling layer, and describes the output size of the dense layer (DENSE).  
industry. The use of machine learning algorithms will help in the production of food products, leading to greater speed and efficiency, which will translate into minimizing losses and, at the same time, increasing sales.  
Conceptualization, M.G.-W. and K.P.; methodology, K.P. and M.G.-W.; software, K.P.; validation, K.P.; formal analysis, P.B., R.R. and B.D.J.; resources, K.P.; data curation, K.P., M.G.-W. and M.G.; writing--original draft preparation, K.P.; writing--review and editing, K.P., M.G.-W., R.R. and A.S.; visualization, K.P.; supervision, M.G.-W. and K.P.; project administration, M.G.-W.; funding acquisition, M.G.-W. and K.P. All authors have read and agreed to the published version of the manuscript.  
This study was funded by the Ministry of Education and Science (Poznan, Poland), MENUPP 506.784.03.00/KMIP.  
Not applicable.  
The data presented in this study are openly available in Repository for Open Data--RepOD at DOI: [[https://doi.org/10.18150/0B46](https://doi.org/10.18150/0B46) MT]([https://doi.org/10.18150/0B46](https://doi.org/10.18150/0B46) MT).  
The authors declare no conflict of interest.