Original papersRecognition of coffee roasting degree using a computer vision system
Graphical abstract
Introduction
Roasting is one of the most complex and important stages of the coffee production chain. During the roast process, several chemical reactions, such as hydrolysis, polymerization and pyrolysis contribute to the chemical and physical changes that occur in the beans. These chemical reactions produce volatile and non-volatile compounds that will compose the organoleptic properties of the drink such as aroma and flavor, and are also responsible for the color change of the coffee beans (Cheong et al., 2013). The change in bean coloring during roasting is due to the formation of melanoidins, which are dark and high molecular weight compounds resulting from complex chemical transformations of the Maillard reaction and the caramelization reaction (Ludwig et al., 2012). Both chemical reactions are closely related to the sensory properties, in this way the correct definition of coffee roast degree is of paramount importance as it directly influences the beverage quality (Kocadagli and Gökmen, 2015, Kucera et al., 2016).
Besides, as far as the coffee beans color is concerned, the industries and coffee shops may need to maintain a roasting pattern. However, few equipment help in the correct color reading of roasted coffee beans. Generally, the definition of the roast degree is made by masters of roast that show great sensory variability during this subjective color reading or by equipment, such as colorimeters and spectrophotometers which are expensive and not economically viable for small coffee industries. Although there are recent developments in coffee bean quality assessment, such as the analysis of hyperspectral images (Calvini et al., 2015, Chu et al., 2018, Kiani et al., 2018), color remains a significant factor in the marketing of the product.
The CIE L*a*b* system, a color standard implemented by the Commission Internationale de l'Eclairage' (CIE, 1986), has been used worldwide for color measurements because it has a uniform distribution and its color space is regardless of the used device. The color is described by the coordinates L*, a* and b*. The L* coordinate represents the luminance, while the a* and b*coordinates represent the change of color from red to green and yellow to blue, respectively. Differently from the RGB color space, the CIE L*a*b* one is perceptually uniform (Capitán-Vallvey et al., 2015). Traditional CIE L*a*b* color measurement equipment, such as colorimeters and spectrometers, typically capture a small and uniform sample. This limitation has generated the need of new systems of computer vision that aid in the color reading on non-uninform samples, as is the case of roasted coffee beans (Seginini et al., 1999, Papadakis et al., 2000, León-Roque et al., 2016, Oliveira et al., 2016).
Computer vision is a scientific area that aims to develop algorithms to automatically extract and analyze useful information about a given object or scene from an observed image, image set or image sequence (Brosnan and Sun, 2003, Wu and Sun, 2013, Wan et al., 2018). In this sense, it extracts quantitative color information from digital images using image processing and analysis, resulting in a non-contact and fast color measurement, besides providing a cheaper and more versatile path than traditional color measurement instruments (León et al., 2006, Costa et al., 2015, Sanaeifar et al., 2016, Vidal et al., 2018).
The color tone for roasted coffee beans can vary widely depending on the roasting time and temperature, air pressure in the chamber, type of coffee, among others. This hinders a reliable visual definition or the use of equipment that requires constant calibrations. Thus, the aim of this work was to develop a calibrated computer vision system to measure the roast degree of coffee samples (whole and ground beans) in a universal color space based on a roast index defined by the Specialty Coffee Association of America (SCAA, 2017).
This work proposes a color transformation model that converts the RGB (Red Green Blue) color space to the independent CIE L*a*b* using artificial neural networks (ANNs) (Haykin, 2009), considering whole and ground coffee beans images. In addition, it is proposed a roasting degree recognition system capable of predicting the Agtron/SCAA value of each sample, using polynomial regression models and ANNs for colored and grayscale images.
Section snippets
Coffee samples
Two types of commercial coffees (Coffeaarabica L.) were selected, the first being dry processed (natural coffee) and the second wet processed (peeled coffee cherry), originating from the 2014 harvest in the state of Minas Gerais, Brazil. The coffees were stored in sealed containers with CO2 injection until the roasting time in order to preserve their physical and chemical characteristics (Borém et al., 2013).
For the roasting procedure, 150 samples were selected, 75 for each type of processing,
Color space transformation model
Based on the Tukey test, it was verified that the neural networks with five neurons in the hidden layer obtained the best results for transforming RBG to CIE L*a*b*. The mean errors obtained by the transformation model after 500 iterations from hold-out cross-validation procedure are shown in Table 1.
The results obtained in this study are 0.4984% ± 0.6805% for the training set and 0.8170% ± 0.7146% for the validation data (Eq. (1)); these values are lower than those reported by (Papadakis et
Conclusions
This study presents a computer vision system for analysis and identification of the coffee roasting degree by computer intelligence techniques. The results show that the development of regression models allows a precise and objective analysis of the roasting degree for both whole and ground beans based on the CIE L*a*b* color space or grayscale. It was observed that the estimation of the roasting degree in whole beans is more difficult than the estimation in ground beans, being necessary the
Acknowledgments
We thank to the Coffee Quality Technology Center/INOVACAFÉ of the Federal University of Lavras (UFLA) for the space and use of its equipment and to the agencies FAPEMIG, CAPES and CNPq for the financial support.
References (31)
- et al.
Near infrared spectroscopy: an analytical tool to predict coffee roasting degree
Anal. Chim. Acta
(2008) - et al.
Evaluation of the sensory and color quality of coffee beans stored in hermetic packaging
J. Stored Prod. Res.
(2013) - et al.
Influence of modulated vaccum cooling on the cooling rate, mass loss and vase life of cute lily flowers
Biosyst. Eng.
(2003) - et al.
Practical comparison of sparse methods for classification of Arabica and Robusta coffee species using near infrared hyperspectral imaging
Chemometrics Intell. Laborat. Syst.
(2015) - et al.
Recent developments in computer vision-based analytical chemistry: a tutorial review
Anal. Chim. Acta
(2015) - et al.
Volatile composition and antioxidant capacity of arabica coffee
Food Res. Int.
(2013) - et al.
Digital image-based classification of biodiesel
Talanta
(2015) - et al.
Application of artificial neural network in food classification
Anal. Chim. Acta
(2011) - et al.
Hyperspectral imaging, a non-destructive technique in medicinal and aromatic plant products industry: current status and potential future applications
Comput. Electron. Agric.
(2018) - et al.
Study of composition of espresso coffee prepared from various roast degrees of Coffeaarabica L. coffee beans
Food Chem.
(2016)
Color measurement in L* a* b* units from RGB digital images
Food Res. Int.
Prediction of fermentation index of cocoa beans (Theobroma cacao L.) based on color measurement and artificial neural networks
Talanta
Extraction of coffee antioxidants: impact of brewing time and method
Food Res. Int.
Prediction of banana quality indices from color features using support vector regression
Talanta
Colour calibration of a laboratory computer vision system for quality evaluation of pre-sliced hams
Meat Sci.
Cited by (39)
Impact of the physicochemical parameters on the sensory characterization of Brazilian coffee by the CATA method
2023, Food Chemistry AdvancesFarmers' perception of barriers that difficult the implementation of agriculture 4.0
2023, Agricultural SystemsVisualizing chemical indicators: Spatial and temporal quality formation and distribution during black tea fermentation
2023, Food ChemistryCitation Excerpt :Computer vision is a bionic vision technique that mimics human visual functions to obtain information such as the color, texture and shape of the sample under test (Di Rosa et al., 2017). It has been widely used to monitor quality parameters in the processing of agricultural products and foodstuffs due to its speed, nondestructiveness, and applicability in processing lines (Fan et al., 2019; Leme et al., 2019). Furthermore, as this assessment is noninvasive, it poses no health risk to consumers.
Coffee and tea bioactive compounds
2022, Functional Foods and their Implications for Health PromotionHow do green and black coffee brews and bioactive interaction with gut microbiome affect its health outcomes? Mining evidence from mechanistic studies, metagenomics and clinical trials
2021, Trends in Food Science and TechnologyCitation Excerpt :Roasting is one of the most complex and significant phases of the coffee production chain and to affect green coffee composition dramatically. During the roasting process, many chemical reactions, such as hydrolysis, polymerization and pyrolysis contribute to changes in sensorial and biological effects (Leme, da Silva, Barbosa, Borém, & Pereira, 2019). Colorful compounds, such as melanoidins, which are dark and have a high molecular weight, are produced during the roasting process as a result of the complex chemical transformations of the Maillard and the caramelization reactions.
Detection, classification, and mapping of coffee fruits during harvest with computer vision
2021, Computers and Electronics in AgricultureCitation Excerpt :Because the imaging of fruits is an important source of information regarding their quality (Mazzia et al., 2020), the creation of a system to obtain such information in high sampling densities is essential for a trustworthy spatial representation and to assign value to the product. In this context, computer vision has been shown as a promising technique, especially with the ability to detect objects (Bresilla et al., 2019; Roy et al., 2019; Sa et al., 2016; Song et al., 2014; Tu et al., 2020; Yu et al., 2019) and provide a detailed pixel-based characterization of the color uniformity of objects (De Oliveira et al., 2016; Leme et al., 2019; Mazen and Nashat, 2019; Wu and Sun, 2013). This technique not only presents higher accuracy, but has been documented to be more versatile, faster, and can reduce labor costs (Belan et al., 2012).