Table of Contents
Fetching ...

Visible and Hyperspectral Imaging for Quality Assessment of Milk: Property Characterisation and Identification

Massimo Martinelli, Elena Tomassi, Nafiou Arouna, Morena Gabriele, Laryssa Perez Fabbri, Luisa Pozzo, Giuseppe Conte, Davide Moroni, Laura Pucci

TL;DR

This study demonstrates that visible and hyperspectral imaging, when coupled with machine learning, can non-invasively predict key biochemical attributes of cow's milk, including polyphenol content, antioxidant capacity (FRAP), and fatty acid profiles. Visible RGB data achieved perfect discrimination for sample shelf-life and antibiotic treatment and enabled accurate estimation of polyphenols and FRAP via XGBoost. Hyperspectral imaging, analyzed with a suite of ML methods, yielded high accuracies for several fatty acids (>95%) and for treatment-group discrimination (≈95%), with RF achieving 94.83% accuracy and identifying spectral biomarkers such as C18:1t19 and C18:2t12. The work suggests a cost-effective, portable path toward rapid milk quality control, though it calls for larger datasets and standardized validation to generalize these findings across broader dairy contexts. Overall, the integrated imaging–AI framework offers a scalable alternative to conventional chemical analyses for real-time dairy quality assessment.

Abstract

Rapid and non-destructive assessment of milk quality is crucial to ensuring both nutritional value and food safety. In this study, we investigated the potential of visible and hyperspectral imaging as cost-effective and quick-response alternatives to conventional chemical analyses for characterizing key properties of cowś milk. A total of 52 milk samples were analysed to determine their biochemical composition (polyphenols, antioxidant capacity, and fatty acids) using spectrophotometer methods and standard gas-liquid and high-performance liquid chromatography (GLC/HPLC). Concurrently, visible (RGB) images were captured using a standard smartphone, and hyperspectral data were acquired in the near-infrared range. A comprehensive analytical framework, including eleven different machine learning algorithms, was employed to correlate imaging features with biochemical measurements. Analysis of visible images accurately distinguished between fresh samples and those stored for 12 days (100 percent accuracy) and achieved perfect discrimination between antibiotic-treated and untreated groups (100 percent accuracy). Moreover, image-derived features enabled perfect prediction of the polyphenols content and the antioxidant capacity using an XGBoost model. Hyperspectral imaging further achieved classification accuracies exceeding 95 percent for several individual fatty acids and 94.8 percent for treatment groups using a Random Forest model. These findings demonstrate that both visible and hyperspectral imaging, when coupled with machine learning, are powerful, non-invasive tools for the rapid assessment of milkś chemical and nutritional profiles, highlighting the strong potential of imaging-based approaches for milk quality assessment.

Visible and Hyperspectral Imaging for Quality Assessment of Milk: Property Characterisation and Identification

TL;DR

This study demonstrates that visible and hyperspectral imaging, when coupled with machine learning, can non-invasively predict key biochemical attributes of cow's milk, including polyphenol content, antioxidant capacity (FRAP), and fatty acid profiles. Visible RGB data achieved perfect discrimination for sample shelf-life and antibiotic treatment and enabled accurate estimation of polyphenols and FRAP via XGBoost. Hyperspectral imaging, analyzed with a suite of ML methods, yielded high accuracies for several fatty acids (>95%) and for treatment-group discrimination (≈95%), with RF achieving 94.83% accuracy and identifying spectral biomarkers such as C18:1t19 and C18:2t12. The work suggests a cost-effective, portable path toward rapid milk quality control, though it calls for larger datasets and standardized validation to generalize these findings across broader dairy contexts. Overall, the integrated imaging–AI framework offers a scalable alternative to conventional chemical analyses for real-time dairy quality assessment.

Abstract

Rapid and non-destructive assessment of milk quality is crucial to ensuring both nutritional value and food safety. In this study, we investigated the potential of visible and hyperspectral imaging as cost-effective and quick-response alternatives to conventional chemical analyses for characterizing key properties of cowś milk. A total of 52 milk samples were analysed to determine their biochemical composition (polyphenols, antioxidant capacity, and fatty acids) using spectrophotometer methods and standard gas-liquid and high-performance liquid chromatography (GLC/HPLC). Concurrently, visible (RGB) images were captured using a standard smartphone, and hyperspectral data were acquired in the near-infrared range. A comprehensive analytical framework, including eleven different machine learning algorithms, was employed to correlate imaging features with biochemical measurements. Analysis of visible images accurately distinguished between fresh samples and those stored for 12 days (100 percent accuracy) and achieved perfect discrimination between antibiotic-treated and untreated groups (100 percent accuracy). Moreover, image-derived features enabled perfect prediction of the polyphenols content and the antioxidant capacity using an XGBoost model. Hyperspectral imaging further achieved classification accuracies exceeding 95 percent for several individual fatty acids and 94.8 percent for treatment groups using a Random Forest model. These findings demonstrate that both visible and hyperspectral imaging, when coupled with machine learning, are powerful, non-invasive tools for the rapid assessment of milkś chemical and nutritional profiles, highlighting the strong potential of imaging-based approaches for milk quality assessment.
Paper Structure (14 sections, 13 figures, 6 tables)

This paper contains 14 sections, 13 figures, 6 tables.

Figures (13)

  • Figure 1: Example of a picture of a milk sample taken with a mobile phone
  • Figure 2: Example of the preparation of the samples over the hyperspectral scanner tray
  • Figure 3: Visual distribution of polyphenol and FRAP values at T0 and T12, highlighting the shift between the two milking times
  • Figure 4: Boxplots illustrating the standard deviations and the coefficient of variation of FRAP. The data show that the treatments significantly influence the variability of the antioxidant response rather than the absolute magnitude of the parameters
  • Figure 5: Confusion matrix of the test dataset for image classification of milking time (T0, T12) and of CTR, SIG. Identical results achieved with a decision tree classifier, an SVM, and a three-layer feed-forward perceptron
  • ...and 8 more figures