Optimizing FTIR-Based Machine Learning Models from Cow Milk: A New Framework to Evaluate Sample Size, Farm Number, and Spectral Pre-Processing

• Four predictability classes identified with distinct sample size and performance • Using informative wavenumbers improves accuracy and reduces required sample size • Reaching optimal performance requires data from more than ten farms • Milk trait models reach a performance ceiling where more samples add no accuracy • We provide 4 regression trees to guide model development Machine learning has been used to predict multiple traits and milk components directly from individual cow milk samples using Fourier transform infrared (FTIR) spectroscopy. Over the years, numerous models have been developed using various configurations, including the number of farms, number of samples per farm, total sample size, and different spectral pre-processing methods. Evaluating how these choices impact model performance is critical for building robust models. In this study, we propose a framework to guide the selection of optimal configurations for FTIR-based machine learning (FTML) models. Using a dataset of 407,632 individual milk samples from 3,408 farms, we tested 144 training configurations that varied in the number of farms (2 to 100) and the number of samples per farm (10 to 100), resulting in training set sizes ranging from 20 to 10,000 samples. We further evaluated six spectral pre-processing strategies, including the use of first derivative and informative wavenumber selection, across 17 target variables (e.g., milk traits like fat, protein, fatty acids, SCC, and a noisy negative control). This yielded 14,688 FTML models, all tested on a common independent test set of 800 samples from 20 unseen farms. Our results revealed four distinct predictability classes of target variables, each with different optimal sample size requirements and performance. Selecting informative wavenumbers consistently improved R 2 by 0.10, 0.28, 0.32, and 0.05 in classes 1 to 4, respectively and reduced the number of samples needed across all classes to obtain maximal performance. We provide four regression trees to support FTML model development and show that using data from more than ten farms is necessary to achieve optimal performance.

Authors

Institutions

Publication Details

Journal
Smart Agricultural Technology
Published
2026-03-01
DOI
https://doi.org/10.1016/j.atech.2026.102043
Primary Topic
Milk Quality and Mastitis in Dairy Cows
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Optimizing FTIR-Based Machine Learning Models from Cow Milk: A New Framework to Evaluate Sample Size, Farm Number, and Spectral Pre-Processing

É R Paquet, T. Touil
Smart Agricultural Technology
Milk Quality and Mastitis in Dairy Cows
article

Optimizing FTIR-Based Machine Learning Models from Cow Milk: A New Framework to Evaluate Sample Size, Farm Number, and Spectral Pre-Processing

É R Paquet, T. Touil
article en

Abstract

• Four predictability classes identified with distinct sample size and performance • Using informative wavenumbers improves accuracy and reduces required sample size • Reaching optimal performance requires data from more than ten farms • Milk trait models reach a performance ceiling where more samples add no accuracy • We provide 4 regression trees to guide model development Machine learning has been used to predict multiple traits and milk components directly from individual cow milk samples using Fourier transform infrared (FTIR) spectroscopy. Over the years, numerous models have been developed using various configurations, including the number of farms, number of samples per farm, total sample size, and different spectral pre-processing methods. Evaluating how these choices impact model performance is critical for building robust models. In this study, we propose a framework to guide the selection of optimal configurations for FTIR-based machine learning (FTML) models. Using a dataset of 407,632 individual milk samples from 3,408 farms, we tested 144 training configurations that varied in the number of farms (2 to 100) and the number of samples per farm (10 to 100), resulting in training set sizes ranging from 20 to 10,000 samples. We further evaluated six spectral pre-processing strategies, including the use of first derivative and informative wavenumber selection, across 17 target variables (e.g., milk traits like fat, protein, fatty acids, SCC, and a noisy negative control). This yielded 14,688 FTML models, all tested on a common independent test set of 800 samples from 20 unseen farms. Our results revealed four distinct predictability classes of target variables, each with different optimal sample size requirements and performance. Selecting informative wavenumbers consistently improved R 2 by 0.10, 0.28, 0.32, and 0.05 in classes 1 to 4, respectively and reduced the number of samples needed across all classes to obtain maximal performance. We provide four regression trees to support FTML model development and show that using data from more than ten farms is necessary to achieve optimal performance.

Smart Agricultural Technology
Université Laval (CA)
Openalex Percentile: Top 7%
Milk Quality and Mastitis in Dairy Cows
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.