Rapid Analysis of Fresh Cow Milk Chemical Composition by Using Portable NIR Spectrometer Coupled with Machine Learning
DOI:
https://doi.org/10.19028/jtep.014.1.144-161Keywords:
chemometrics, machine learning, milk composition, portable NIRS, rapid analysisAbstract
Analysis of milk composition is essential for quality assurance and compliance with regulations related to quality standards, yet current tools lack of rapid analysis capability especially for field application. This study investigated the potential use of portable near-infrared spectroscopy (NIRS) combined with chemometrics and machine learning to predict fat, protein and lactose content of fresh cow milk. Spectral data were collected from fresh cow milk samples using a portable device working in the short-wave NIR (740–1070 nm). Samples were obtained from five farms at two locations in the Bogor area during morning and evening milking times. As a reference to develop the predictive model, the fat, protein, and lactose contents were measured using Milkotester Master Eco, which is a standard widely accepted by farmers and the milk industry. Two predictive methods were applied: Partial Least Squares Regression (PLS-R) and machine learning algorithms (i.e. Artificial Neural Network (ANN) and Random Forest (RF)) with various data pre-treatments. The best PLS-R models achieved determination coefficient of prediction (R²p) values of 0.828 (fat), 0.397 (protein), and 0.384 (lactose). Machine learning models further improved R²p to 0.901, 0.562, and 0.444, respectively. These findings demonstrate that portable NIRS combined with machine learning enables fast and reliable milk composition analysis, particularly for fat content. However, the prediction performance for protein and lactose is still limited and needs to be further improved.
Downloads
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Jurnal Keteknikan Pertanian

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Authors submitting manuscripts should understand and agree that copyright of manuscripts of the article shall be assigned/transferred to Jurnal Keteknikan Pertanian. This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA) where Authors and Readers can copy and redistribute the material in any medium or format, as well as remix, transform, and build upon the material for any purpose, but they must give appropriate credit (cite to the article or content), provide a link to the license, and indicate if changes were made. If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
Jurnal Keteknikan Pertanian is an open access journal.



















