AgriEngineering (Nov 2024)

Caffeine Content Prediction in Coffee Beans Using Hyperspectral Reflectance and Machine Learning

  • Dthenifer Cordeiro Santana,
  • Rafael Felipe Ratke,
  • Fabio Luiz Zanatta,
  • Cid Naudi Silva Campos,
  • Ana Carina da Silva Cândido Seron,
  • Larissa Pereira Ribeiro Teodoro,
  • Natielly Pereira da Silva,
  • Gabriela Souza Oliveira,
  • Regimar Garcia dos Santos,
  • Rita de Cássia Félix Alvarez,
  • Carlos Antonio da Silva Junior,
  • Matildes Blanco,
  • Paulo Eduardo Teodoro

DOI
https://doi.org/10.3390/agriengineering6040255
Journal volume & issue
Vol. 6, no. 4
pp. 4480 – 4492

Abstract

Read online

The application of hyperspectral data in machine learning models can contribute to the rapid and accurate determination of caffeine content in coffee beans. This study aimed to identify the machine learning algorithm with the best performance for predicting caffeine content and to find input data for these models that can improve the accuracy of these algorithms. The coffee beans were harvested one year after the seedlings were planted. The fresh beans were taken to the spectroscopy laboratory (Laspec) at the Federal University of Mato Grosso do Sul, Chapadão do Sul campus, for spectral evaluation using a spectroradiometer. For the analysis, the dried coffee beans were ground and sieved for the quantification of caffeine, which was carried out using a liquid chromatograph on the Waters Acquity 1100 series UPLC system, with an automatic sample injector. The spectral data of the beans, as well as the spectral data of the roasted and ground coffee, were analyzed using machine learning (ML) algorithms to predict caffeine content. Four databases were used as input: the spectral information of the bean (CG), the spectral information of the bean with additional clone information (CG+C), the spectral information of the bean after roasting and grinding (CGRG) and the spectral information of the bean after roasting and grinding with additional clone information (CGRG+C). The caffeine content was used as an output to be predicted. Each database was subjected to different machine learning models: artificial neural networks (ANNs), decision tree (DT), linear regression (LR), M5P, and random forest (RF) algorithms. Pearson’s correlation coefficient, mean absolute error, and root mean square error were tested as model accuracy metrics. The support vector machine algorithm showed the best accuracy in predicting caffeine content when using hyperspectral data from roasted and ground coffee beans. This performance was significantly improved when clone information was included, allowing for an even more accurate analysis.

Keywords