Portable Protein and Fat Detector in Milk Based on Multi-Spectral Sensor and Machine Learning - Yanyan Wang; Kaikai Zhang; Shengzhe Shi; Qingqing Wang; Sheng Liu (Applied Sciences, 2023)
To address the challenges of a long measurement period, high testing cost, and environmental pollution of traditional milk composition detection methods, a portable detection instrument was developed by combining multi-spectral sensors, machine learning algorithms, and an embedded system to rapidly detect the main components of milk. A broadband near-infrared (NIR) LED constant-current driver circuit and multi-spectral sensor module were designed to obtain six NIR features of milk samples. Based on a comparison of several machine learning algorithms, the XGBoost model was selected for training, and the trained model was ported to a Raspberry Pi unit for sample detection. The validation results showed that the coefficients of determination (R2) for the investigated protein and fat models were 0.9816 and 0.9978, respectively, and the corresponding mean absolute errors (MAE) were 0.0086 and 0.0079. Accurate measurement of protein and fat contents of milk can be facilitated in a short time interval by using the proposed low-cost portable instrument.