Evaluating Coffee Bean Roasting Duration with Hyperspectral Camera
Whether it's monitoring the roasting time of coffee beans for the perfect cup or detecting algae blooms in lakes, Resonon's hyperspectral cameras offer rapid insights for both manufacturers and researchers.
While human vision is impressive, relying on just four types of sensors in our retina (rods and three types of cones), we can only perceive three colours and are sensitive to light wavelengths between 400 and 700 nm. Although we can qualitatively observe coffee beans changing colour and shade during roasting (refer to Figure 1), our ability to make precise quantitative assessments by eye is limited.
Accurate record-keeping and process control are essential for coffee roasters to consistently achieve the ideal roast and blends. Errors or flaws in the process can result in under or over-roasted beans, leading to wasted time, product, and money, not to mention a less-than-perfect cup of coffee. This study demonstrates how hyperspectral camera can be used to determine the roasting time of coffee beans in real-time.
Figure 1: Colour Images of the Roasted Coffee Bean Samples Used in the Study
Application Overview
This study utilized a hyperspectral camera, the Pika® XC2, which boasts 447 spectral channels covering the 400 to 1000 nm wavelength range. This range surpasses that of the human eye and offers significantly higher spectral resolution. The collected hyperspectral data underwent processing using Spectronon™, Resonon's complimentary hyperspectral camera analysis software, to extract precise quantitative data regarding the roasting time of coffee beans.
Eight samples of coffee beans were scanned, each roasted for 0, 2, 4, 6, 8, 10, 12, and 14 minutes, respectively. Of these scans, seven were utilized (excluding the 12-minute roasted beans) to develop a regression model for roasting time, with the 12-minute roasted beans' data reserved for testing the model's accuracy.
For those unfamiliar with regression analysis, it is a statistical method that quantifies the relationship between one or more independent variables and a dependent variable. In this study, the regression model establishes the relationship between the average reflectance spectra of a datacube of roasted coffee beans (the independent variable) and the time of roasting (the dependent variable). Once trained, the regression model can predict the roasting duration of a batch of coffee beans based on their average spectral signature. Figure 2 displays the average spectral signature for each bean group depicted in Figure 1.

Figure 2: Illustrates the average reflectance spectra of coffee beans at varying roasting durations.
Results
Following the training of the regression model on all samples except the 12-minute roasted batch, the model was tasked with predicting the roasting duration of the 12-minute batch. The model's estimation was 12.1 minutes.
Despite significant color variation within and among beans in a batch, the algorithm can process data from millions of pixels (each containing 447 colour channels in this case) to derive meaningful insights and estimate the roasting time for each pixel in the scan. Averaging these estimates over all pixels in the scan yields an accurate prediction of the batch's roasting time.
This study exemplifies how non-destructive measurements with Resonon's hyperspectral cameras enable valuable insights into processes that are otherwise challenging to monitor.
Find out more on Resonon’s Hyperspectral Cameras.
For further information on how hyperspectral imaging can address your specific application, please contact us.