Exploring the Use of Spectral Technologies in Ovine Milk Analysis: A Preliminary Study
Abstract
1. Introduction
2. Materials and Methods
2.1. Sampling and Reference Analyses
2.2. Spectral Acquisition
2.3. Dataset and Data Analysis
2.4. Machine Learning Modeling and Validation
3. Results
3.1. Principal Component Analysis
3.2. Regression Results
3.3. Classification Results
4. Discussion
5. Conclusions
Author Contributions
Funding

Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Melfsen, A.; Hartung, E.; Haeussermann, A. Accuracy of In-Line Milk Composition Analysis with Diffuse Reflectance near-Infrared Spectroscopy. J. Dairy Sci. 2012, 95, 6465–6476. [Google Scholar] [CrossRef]
- Frizzarin, M.; Gormley, I.C.; Berry, D.P.; Murphy, T.B.; Casa, A.; Lynch, A.; McParland, S. Predicting Cow Milk Quality Traits from Routinely Available Milk Spectra Using Statistical Machine Learning Methods. J. Dairy Sci. 2021, 104, 7438–7447. [Google Scholar] [CrossRef] [PubMed]
- Tsenkova, R.; Meilina, H.; Kuroki, S.; Burns, D.H. Near Infrared Spectroscopy Using Short Wavelengths and Leave-One-Cow-Out Cross-Validation for Quantification of Somatic Cells in Milk. J. Near Infrared Spectrosc. 2009, 17, 345–351. [Google Scholar] [CrossRef]
- Coppa, M.; Revello-Chion, A.; Giaccone, D.; Ferlay, A.; Tabacco, E.; Borreani, G. Comparison of near and Medium Infrared Spectroscopy to Predict Fatty Acid Composition on Fresh and Thawed Milk. Food Chem. 2014, 150, 49–57. [Google Scholar] [CrossRef]
- Aernouts, B.; Polshin, E.; Lammertyn, J.; Saeys, W. Visible and Near-Infrared Spectroscopic Analysis of Raw Milk for Cow Health Monitoring: Reflectance or Transmittance? J. Dairy Sci. 2011, 94, 5315–5329. [Google Scholar] [CrossRef] [PubMed]
- Bogomolov, A.; Dietrich, S.; Boldrini, B.; Kessler, R.W. Quantitative Determination of Fat and Total Protein in Milk Based on Visible Light Scatter. Food Chem. 2012, 134, 412–418. [Google Scholar] [CrossRef]
- Yang, B.; Guo, W.; Liang, W.; Zhou, Y.; Zhu, X. Design and Evaluation of a Miniature Milk Quality Detection System Based on UV/Vis Spectroscopy. J. Food Compos. Anal. 2022, 106, 104341. [Google Scholar] [CrossRef]
- Albanell, E.; Caja, G.; Such, X.; Rovai, M.; Salama, A.A.K.; Casals, R. Determination of Fat, Protein, Casein, Total Solids, and Somatic Cell Count in Goat’s Milk by Near-Infrared Reflectance Spectroscopy. J. AOAC Int. 2003, 86, 746–752. [Google Scholar] [CrossRef]
- Núñez-Sánchez, N.; Martínez-Marín, A.L.; Polvillo, O.; Fernández-Cabanás, V.M.; Carrizosa, J.; Urrutia, B.; Serradilla, J.M. Near Infrared Spectroscopy (NIRS) for the Determination of the Milk Fat Fatty Acid Profile of Goats. Food Chem. 2016, 190, 244–252. [Google Scholar] [CrossRef]
- Llano Suárez, P.; Soldado, A.; González-Arrojo, A.; Vicente, F.; De La Roza-Delgado, B. Rapid On-Site Monitoring of Fatty Acid Profile in Raw Milk Using a Handheld near Infrared Sensor. J. Food Compos. Anal. 2018, 70, 1–8. [Google Scholar] [CrossRef]
- Kalinin, A.; Krasheninnikov, V.; Sadovskiy, S.; Yurova, E. Determining the Composition of Proteins in Milk Using a Portable near Infrared Spectrometer. J. Near Infrared Spectrosc. 2013, 21, 409–415. [Google Scholar] [CrossRef]
- Diaz-Olivares, J.A.; Adriaens, I.; Stevens, E.; Saeys, W.; Aernouts, B. Online Milk Composition Analysis with an On-Farm near-Infrared Sensor. Comput. Electron. Agric. 2020, 178, 105734. [Google Scholar] [CrossRef]
- De La Roza-Delgado, B.; Garrido-Varo, A.; Soldado, A.; González Arrojo, A.; Cuevas Valdés, M.; Maroto, F.; Pérez-Marín, D. Matching Portable NIRS Instruments for in Situ Monitoring Indicators of Milk Composition. Food Control 2017, 76, 74–81. [Google Scholar] [CrossRef]
- Gullifa, G.; Barone, L.; Papa, E.; Giuffrida, A.; Materazzi, S.; Risoluti, R. Portable NIR Spectroscopy: The Route to Green Analytical Chemistry. Front. Chem. 2023, 11, 1214825. [Google Scholar] [CrossRef]
- Gullifa, G.; Albertini, C.; Amoresano, A.; Pinto, G.; Illiano, A.; Dirito, P.; Materazzi, S.; Risoluti, R. A Smart Based Screening System by MicroNIR and Chemometrics for On-Site Authentication of Buffalo Milk in Dairy Industry. Appl. Food Res. 2025, 5, 101159. [Google Scholar] [CrossRef]
- Mohamed, H.; Nagy, P.; Agbaba, J.; Kamal-Eldin, A. Use of near and Mid Infra-Red Spectroscopy for Analysis of Protein, Fat, Lactose and Total Solids in Raw Cow and Camel Milk. Food Chem. 2021, 334, 127436. [Google Scholar] [CrossRef]
- Saji, R.; Ramani, A.; Gandhi, K.; Seth, R.; Sharma, R. Application of FTIR Spectroscopy in Dairy Products: A Systematic Review. Food Humanit. 2024, 2, 100239. [Google Scholar] [CrossRef]
- Nanou, E.; Pliatsika, N.; Stefas, D.; Couris, S. Identification of the Animal Origin of Milk via Laser-Induced Breakdown Spectroscopy. Food Control 2023, 154, 110007. [Google Scholar] [CrossRef]
- Abdel-Salam, Z.; El-Saeid, R.; Abdelghany, S.; Abdel-Salam, S.; Radwan, M. Assessment of Milk Quality at Farm Level Using Laser Techniques. Egypt. J. Chem. 2022, 66, 273–278. [Google Scholar] [CrossRef]
- Barreto, M.C.; Braga, R.G.; Lemos, S.G.; Fragoso, W.D. Determination of Melamine in Milk by Fluorescence Spectroscopy and Second-Order Calibration. Food Chem. 2021, 364, 130407. [Google Scholar] [CrossRef]
- Zhu, Z.; Zhu, X.; Kong, F.; Guo, W. Quantitatively Determining the Total Bacterial Count of Raw Goat Milk Using Dielectric Spectra. J. Dairy Sci. 2019, 102, 7895–7903. [Google Scholar] [CrossRef] [PubMed]
- Guerra, A.; De Marchi, M.; Niero, G.; Chiarin, E.; Manuelian, C.L. Application of a Short-Wave Pocket-Sized near-Infrared Spectrophotometer to Predict Milk Quality Traits. J. Dairy Sci. 2024, 107, 3413–3419. [Google Scholar] [CrossRef]
- Iweka, P.; Kawamura, S.; Mitani, T.; Kawaguchi, T. Online Near-Infrared Spectroscopy for the Measurement of Cow Milk Quality in an Automatic Milking System. Eng. Proc. 2023, 56, 145. [Google Scholar]
- Iweka, P.; Kawamura, S.; Mitani, T.; Kawaguchi, T. Cow Milk Quality Determination Using a Near-Infrared Spectroscopic Sensing System for Smart Dairy Farming. Eng. Proc. 2023, 58, 118. [Google Scholar]
- Agiomavriti, A.-A.; Nikolopoulou, M.P.; Bartzanas, T.; Chorianopoulos, N.; Demestichas, K.; Gelasakis, A.I. Spectroscopy-Based Methods and Supervised Machine Learning Applications for Milk Chemical Analysis in Dairy Ruminants. Chemosensors 2024, 12, 263. [Google Scholar] [CrossRef]
- Lianou, D.T.; Kiouvrekis, Y.; Michael, C.K.; Vasileiou, N.G.C.; Psomadakis, I.; Politis, A.P.; Katsafadou, A.I.; Katsarou, E.I.; Bourganou, M.V.; Liagka, D.V.; et al. The Use of Explainable Machine Learning for the Prediction of the Quality of Bulk-Tank Milk in Sheep and Goat Farms. Foods 2024, 13, 4015. [Google Scholar] [CrossRef]
- Gelasakis, A.I.; Angelidis, A.S.; Giannakou, R.; Filioussis, G.; Kalamaki, M.S.; Arsenos, G. Bacterial Subclinical Mastitis and Its Effect on Milk Yield in Low-Input Dairy Goat Herds. J. Dairy Sci. 2016, 99, 3698–3708. [Google Scholar] [CrossRef]
- Getaneh, G.; Mebrat, A.; Wubie, A.; Kendie, H. Review on Goat Milk Composition and Its Nutritive Value. J. Nutr. Health Sci. 2016, 3, 401. [Google Scholar] [CrossRef]
- Babatunde, H.A.; McDougal, O.M.; Andersen, T. Automated Spectral Preprocessing via Bayesian Optimization for Chemometric Analysis of Milk Constituents. Foods 2025, 14, 2996. [Google Scholar] [CrossRef]
- Fizza, K.; Banerjee, A.; Georgakopoulos, D.; Jayaraman, P.P.; Yavari, A.; Dawod, A. An Inexpensive AI-Powered IoT Sensor for Continuous Farm-to-Factory Milk Quality Monitoring. Sensors 2025, 25, 4439. [Google Scholar] [CrossRef]
- Khanna, A.; Jain, S.; Burgio, A.; Bolshev, V.; Panchenko, V. Blockchain-Enabled Supply Chain Platform for Indian Dairy Industry: Safety and Traceability. Foods 2022, 11, 2716. [Google Scholar] [CrossRef] [PubMed]












| Variable | Threshold | Category |
|---|---|---|
| Milk Quality Index (MQI) Protein + Fat (%) | ≥12.0 | High quality vs. Low quality |
| Somatic Cell Count 1 (SCC 1) | ≥1 × 106 cells/mL | Subclinical mastitis vs. No subclinical mastitis |
| Somatic Cell Count 2 (SCC 2) | ≥400 × 103 cells/mL | Elevated vs. Normal SCC |
| Total Bacterial Count (TBC) | ≥2 × 104 CFU/mL | Elevated TBC vs. Normal TBC |
| Trait | Overall | 2y.o. | 3y.o. | 4y.o. | Over 5y.o. | Chios | Lesvos |
|---|---|---|---|---|---|---|---|
| SCC (cells/mL) | 1916 ± (3492) | 1451 ± (1673) | 1848 ± (3342) | 1496 ± (2679) | 2911 ± (5031) | 1893 ± (3927) | 1938 ± (3031) |
| TBC (CFU/mL) | 735 ± (4487) | 121 ± (332) | 669 ± (3403) | 450 ± (2240) | 1583 ± (8207) | 866 ± (5759) | 610 ± (2791) |
| Protein (%) | 4.52 ± (0.44) | 4.48 ± (0.36) | 4.51 ± (0.49) | 4.52 ± (0.39) | 4.54 ± (0.44) | 4.37 ± (0.40) | 4.66 ± (0.42) |
| Fat (%) | 6.43 ± (1.25) | 5.91 ± (1.21) | 6.42 ± (1.23) | 6.57 ± (1.27) | 6.43 ± (1.19) | 6.66 ± (1.26) | 6.21 ± (1.20) |
| Lactose (%) | 4.28 ± (0.42) | 4.25 ± (0.34) | 4.28 ± (0.48) | 4.29 ± (0.37) | 4.3 ± (0.42) | 4.14 ± (0.38) | 4.42 ± (0.40) |
| SNF (%) | 9.53 ± (0.92) | 9.45 ± (0.76) | 9.51 ± (1.04) | 9.55 ± (0.83) | 9.58 ± (0.92) | 9.21 ± (0.85) | 9.84 ± (0.89) |
| Density (kg/m3) | 32.1 ± (3.4) | 32.2 ± (2.7) | 32.0 ± (3.9) | 32.0 ± (3.1) | 32.3 ± (3.4) | 30.6 ± (3.1) | 33.4 ± (3.2) |
| Salts (%) | 0.68 ± (0.07) | 0.68 ± (0.05) | 0.68 ± (0.08) | 0.68 ± (0.06) | 0.68 ± (0.07) | 0.65 ± (0.06) | 0.71 ± (0.07) |
| Cond. (mS/cm) | 6.68 ± (2.60) | 7.51 ± (3.11) | 6.58 ± (2.61) | 6.76 ± (2.32) | 6.32 ± (2.78) | 6.92 ± (2.77) | 6.44 ± (2.41) |
| Fr. point (°C) | −0.55 ± (0.07) | −0.54 ± (0.05) | −0.55 ± (0.08) | −0.55 ± (0.06) | −0.56 ± (0.06) | −0.53 ± (0.06) | −0.57 ± (0.07) |
| pH | 6.72 ± (0.26) | 6.70 ± (0.27) | 6.71 ± (0.25) | 6.71 ± (0.25) | 6.78 ± (0.27) | 6.71 ± (0.26) | 6.73 ± (0.25) |
| Urea (mg/L) | 507 ± (95) | 530 ± (94) | 503 ± (102) | 504 ± (88) | 512 ± (92) | 487 ± (95) | 526 ± (90) |
| Casein (%) | 4.71 ± (0.61) | 4.66 ± (0.50) | 4.70 ± (0.65) | 4.71 ± (0.61) | 4.74 ± (0.59) | 4.62 ± (0.57) | 4.80 ± (0.63) |
| FFA (mmol/kg) | 0.37 ± (0.43) | 0.32 ± (0.47) | 0.41 ± (0.45) | 0.36 ± (0.38) | 0.34 ± (0.45) | 0.48 ± (0.40) | 0.29 ± (0.42) |
| Glucose (%) | 0.18 ± (0.21) | 0.21 ± (0.18) | 0.19 ± (0.20) | 0.17 ± (0.23) | 0.19 ± (0.22) | 0.16 ± (0.24) | 0.20 ± (0.19) |
| Component | Algorithm | Spectroscopy Type | Number of Samples | Training R2 | Training RMSE | Validation R2 | Validation RMSE |
|---|---|---|---|---|---|---|---|
| Protein | LR | UV/Vis | 335 | 0.39 | 0.34% | 0.34 | 0.35% |
| Protein | LR | NIR | 333 | 0.31 | 0.37% | 0.24 | 0.38% |
| Fat | LR | UV/Vis | 335 | 0.35 | 1.00% | 0.30 | 1.03% |
| Fat | LR | NIR | 333 | 0.56 | 0.83% | 0.51 | 0.87% |
| Fat | RF | NIR | 333 | 0.94 | 0.32% | 0.55 | 0.83% |
| Lactose | LR | UV/Vis | 335 | 0.39 | 0.32% | 0.34 | 0.33% |
| Lactose | LR | NIR | 333 | 0.31 | 0.35% | 0.24 | 0.36% |
| SNF | LR | UV/Vis | 335 | 0.39 | 0.72% | 0.34 | 0.74% |
| SNF | LR | NIR | 333 | 0.31 | 0.77% | 0.24 | 0.80% |
| Salts | LR | UV/Vis | 335 | 0.36 | 0.06% | 0.31 | 0.06% |
| pH | LR | UV/Vis | 335 | 0.42 | 0.19 | 0.36 | 0.20 |
| pH | RF | UV/Vis | 335 | 0.91 | 0.08 | 0.38 | 0.20 |
| pH | LR | NIR | 333 | 0.44 | 0.19 | 0.41 | 0.20 |
| Freezing point | LR | UV/Vis | 335 | 0.38 | 0.05 °C | 0.36 | 0.05 °C |
| Freezing point | LR | NIR | 333 | 0.31 | 0.05 °C | 0.25 | 0.06 °C |
| N = 333 | N = 275 | |||||
|---|---|---|---|---|---|---|
| Algorithm | Metric | SCC1 | SCC2 | TBC | MQI | |
| RF * | Accuracy | 0.69 ± 0.042 | 0.60 ± 0.063 | 0.87 ± 0.013 | 0.75 ± 0.055 | 0.73 ± 0.105 |
| F1 Score | 0.52 ± 0.103 | 0.70 ± 0.057 | 0.93 ± 0.007 | 0.24 ± 0.182 | 0.76 ± 0.087 | |
| ROC AUC | 0.66 ± 0.078 | 0.65 ± 0.079 | 0.63 ± 0.075 | 0.77 ± 0.091 | 0.75 ± 0.110 | |
| MCC | 0.33 ± 0.104 | 0.12 ± 0.139 | 0.00 ± 0.000 | 0.15 ± 0.227 | 0.45 ± 0.229 | |
| Kappa | 0.31 ± 0.103 | 0.11 ± 0.136 | 0.00 ± 0.000 | 0.12 ± 0.201 | 0.44 ± 0.220 | |
| SVM ** | Accuracy | 0.63 ± 0.073 | 0.61 ± 0.098 | 0.49 ± 0.079 | 0.72 ± 0.079 | 0.69 ± 0.095 |
| F1 Score | 0.51 ± 0.091 | 0.64 ± 0.110 | 0.62 ± 0.080 | 0.56 ± 0.121 | 0.72 ± 0.088 | |
| ROC AUC | 0.65 ± 0.097 | 0.65 ± 0.118 | 0.44 ± 0.111 | 0.79 ± 0.093 | 0.74 ± 0.099 | |
| MCC | 0.22 ± 0.143 | 0.25 ± 0.177 | −0.01 ± 0.160 | 0.40 ± 0.178 | 0.38 ± 0.195 | |
| Kappa | 0.21 ± 0.140 | 0.24 ± 0.172 | −0.01 ± 0.107 | 0.37 ± 0.170 | 0.38 ± 0.192 | |
| XGBoost *** | Accuracy | 0.65 ± 0.067 | 0.58 ± 0.115 | 0.72 ± 0.023 | 0.75 ± 0.088 | 0.69 ± 0.097 |
| F1 Score | 0.56 ± 0.094 | 0.63 ± 0.116 | 0.83 ± 0.040 | 0.51 ± 0.147 | 0.72 ± 0.089 | |
| ROC AUC | 0.69 ± 0.051 | 0.61 ± 0.116 | 0.63 ± 0.096 | 0.75 ± 0.115 | 0.74 ± 0.119 | |
| MCC | 0.28 ± 0.140 | 0.14 ± 0.227 | 0.04 ± 0.175 | 0.35 ± 0.205 | 0.38 ± 0.202 | |
| Kappa | 0.27 ± 0.139 | 0.14 ± 0.215 | 0.04 ± 0.158 | 0.34 ± 0.203 | 0.37 ± 0.203 | |
| N = 333 | N = 275 | ||||||
|---|---|---|---|---|---|---|---|
| Metrics | Algorithm | SCC1 | SCC2 | Algorithm | TBC | MQI | |
| Accuracy | 0.64 ± 0.073 | 0.57 ± 0.073 | 0.83 ± 0.067 | 0.84 ± 0.084 | 0.74 ± 0.042 | ||
| F1 Score | SVM * | 0.47 ± 0.128 | 0.57 ± 0.083 | RF **** | 0.90 ± 0.043 | 0.61 ± 0.199 | 0.77 ± 0.036 |
| ROC AUC | 0.66 ± 0.074 | 0.64 ± 0.108 | 0.62 ± 0.116 | 0.83 ± 0.118 | 0.82 ± 0.036 | ||
| MCC | 0.26 ± 0.197 | 0.12 ± 0.151 | 0.03 ± 0.165 | 0.50 ± 0.205 | 0.48 ± 0.090 | ||
| Kappa | 0.24 ± 0.188 | 0.12 ± 0.146 | 0.03 ± 0.133 | 0.49 ± 0.207 | 0.47 ± 0.090 | ||
| Accuracy | 0.69 ± 0.061 | 0.58 ± 0.091 | 0.46 ± 0.084 | 0.78 ± 0.066 | 0.74 ± 0.073 | ||
| F1 Score | LR ** | 0.54 ± 0.073 | 0.62 ± 0.079 | SVM * | 0.57 ± 0.093 | 0.62 ± 0.100 | 0.76 ± 0.075 |
| ROC AUC | 0.66 ± 0.086 | 0.64 ± 0.103 | 0.48 ± 0.127 | 0.85 ± 0.107 | 0.81 ± 0.049 | ||
| MCC | 0.24 ± 0.225 | 0.26 ± 0.161 | −0.04 ± 0.230 | 0.47 ± 0.160 | 0.49 ± 0.148 | ||
| Kappa | 0.23 ± 0.219 | 0.25 ± 0.156 | −0.03 ± 0.125 | 0.44 ± 0.160 | 0.48 ± 0.145 | ||
| Accuracy | 0.65 ± 0.087 | 0.53 ± 0.084 | 0.87 ± 0.040 | 0.81 ± 0.085 | 0.69 ± 0.058 | ||
| F1 Score | NB *** | 0.42 ± 0.172 | 0.45 ± 0.148 | XGBoost ***** | 0.93 ± 0.022 | 0.55 ± 0.199 | 0.75 ± 0.053 |
| ROC AUC | 0.62 ± 0.100 | 0.64 ± 0.098 | 0.50 ± 0.170 | 0.77 ± 0.140 | 0.77 ± 0.068 | ||
| MCC | 0.21 ± 0.202 | 0.24 ± 0.143 | 0.05 ± 0.175 | 0.38 ± 0.202 | 0.36 ± 0.125 | ||
| Kappa | 0.17 ± 0.192 | 0.19 ± 0.119 | 0.04 ± 0.143 | 0.37 ± 0.201 | 0.35 ± 0.123 | ||
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Agiomavriti, A.-A.; Saharidi, O.; Vasilaki, A.; Koulouvakou, S.; Nikolaou, E.; Papadimitriou, T.; Bartzanas, T.; Chorianopoulos, N.; Gelasakis, A.I. Exploring the Use of Spectral Technologies in Ovine Milk Analysis: A Preliminary Study. Spectrosc. J. 2026, 4, 2. https://doi.org/10.3390/spectroscj4010002
Agiomavriti A-A, Saharidi O, Vasilaki A, Koulouvakou S, Nikolaou E, Papadimitriou T, Bartzanas T, Chorianopoulos N, Gelasakis AI. Exploring the Use of Spectral Technologies in Ovine Milk Analysis: A Preliminary Study. Spectroscopy Journal. 2026; 4(1):2. https://doi.org/10.3390/spectroscj4010002
Chicago/Turabian StyleAgiomavriti, Aikaterini-Artemis, Olympiada Saharidi, Aikaterini Vasilaki, Stavroula Koulouvakou, Efstratios Nikolaou, Theodora Papadimitriou, Thomas Bartzanas, Nikos Chorianopoulos, and Athanasios I. Gelasakis. 2026. "Exploring the Use of Spectral Technologies in Ovine Milk Analysis: A Preliminary Study" Spectroscopy Journal 4, no. 1: 2. https://doi.org/10.3390/spectroscj4010002
APA StyleAgiomavriti, A.-A., Saharidi, O., Vasilaki, A., Koulouvakou, S., Nikolaou, E., Papadimitriou, T., Bartzanas, T., Chorianopoulos, N., & Gelasakis, A. I. (2026). Exploring the Use of Spectral Technologies in Ovine Milk Analysis: A Preliminary Study. Spectroscopy Journal, 4(1), 2. https://doi.org/10.3390/spectroscj4010002

