Protein,fat,and lactose content are the main indicators to evaluate the quality of raw milk.Differences in individual dairy cows and different levels of feeding management result in large differences in the quality of fresh milk produced,and due to the lack of on-site evaluation methods,on-site evaluation of raw milk is not possible.This paper investigates the method of assessing the main nutritional indicators of raw milk on-site with a portable NIR instrument and provides technical support for the implementation of raw milk pre-processing according to quality and classification storage and transportation.The main contents of this research include:(1)NIR spectra were affected by many factors,such as the settings parameter of the instrument,external factors,and internal factors.The collection parameters of spectra were optimized resulting in the sample volume of 75 ml or more,the integration time if 50 ms,and the average number of times is 10 times.The spectral difference of raw milk with different protein content was located near the wavelengths of 936 nm and 970 nm.And the spectral difference of raw milk with different fat content was located near the wavelengths of 842 nm.A good linear relationship between spectra and temperature was obtained using the wavelengths of 740 nm,842 nm,and 970 nm.The sample temperature has a significant influence on the spectrum,and temperature correction is required.Whether the homogenization process has little effect on the spectrum,so you only need to shake it manually before collecting the spectrum.(2)A optimal hybrid pretreatment method was obtained by the root mean square error cross-validation values,resulting in the second derivative(2D)and Savitzky-Golay smoothing(SG)with 25 data points.(3)Random frog(RF)and competitive adaptive re-weighted sampling(CARS)algorithms were proposed to select key variables for partial least squares(PLS)calculation.The root means squared errors in the prediction set(RMSEP)values of protein,fat,and lactose in the raw milk were 0.1004,0.0876,and 0.0659(RF-PLS),and 0.1295,0.0698,and 0.0674(CARS-PLS),respectively.(4)The temperature compensation models were developed using all samples collected at different temperature conditions.The best models were calculated by the PLS method using all spectral variables.The root means squared errors in the calibration set were 0.1381,0.5825,and 0.1101,and the RMSEP were 0.1284,0.5789,and 0.1364 for protein,fat,and lactose,respectively.In addition,a temperature correction based on a single characteristic wavelength is proposed.The linear and exponential regression statistics between the absorbance value and the temperature were carried out,and the correction equations for the characteristic wavelength of protein and fat in the range of 5-40℃ were obtained(based on 40℃). |