CN114239692B - Method and device for identifying fresh milk fat adulteration - Google Patents
Method and device for identifying fresh milk fat adulteration Download PDFInfo
- Publication number
- CN114239692B CN114239692B CN202111401454.6A CN202111401454A CN114239692B CN 114239692 B CN114239692 B CN 114239692B CN 202111401454 A CN202111401454 A CN 202111401454A CN 114239692 B CN114239692 B CN 114239692B
- Authority
- CN
- China
- Prior art keywords
- sample
- model
- raw milk
- adulteration
- fat
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 27
- 235000021243 milk fat Nutrition 0.000 title claims description 13
- 235000020185 raw untreated milk Nutrition 0.000 claims abstract description 81
- 238000012706 support-vector machine Methods 0.000 claims abstract description 27
- 238000013145 classification model Methods 0.000 claims abstract description 26
- 238000012360 testing method Methods 0.000 claims abstract description 17
- 235000013336 milk Nutrition 0.000 claims abstract description 16
- 239000008267 milk Substances 0.000 claims abstract description 16
- 210000004080 milk Anatomy 0.000 claims abstract description 16
- 238000005457 optimization Methods 0.000 claims abstract description 12
- 230000006870 function Effects 0.000 claims description 36
- 238000013507 mapping Methods 0.000 claims description 20
- 230000014759 maintenance of location Effects 0.000 claims description 12
- 238000012549 training Methods 0.000 claims description 12
- 230000001419 dependent effect Effects 0.000 claims description 8
- 238000011156 evaluation Methods 0.000 claims description 6
- 239000011159 matrix material Substances 0.000 claims description 6
- 238000007781 pre-processing Methods 0.000 claims description 5
- 238000010276 construction Methods 0.000 claims description 2
- 238000001514 detection method Methods 0.000 abstract description 10
- 238000012544 monitoring process Methods 0.000 abstract description 4
- 235000019197 fats Nutrition 0.000 description 35
- 230000008676 import Effects 0.000 description 6
- 239000000126 substance Substances 0.000 description 6
- 235000015112 vegetable and seed oil Nutrition 0.000 description 6
- 239000008158 vegetable oil Substances 0.000 description 6
- 238000002347 injection Methods 0.000 description 4
- 239000007924 injection Substances 0.000 description 4
- 239000007789 gas Substances 0.000 description 3
- UFHFLCQGNIYNRP-UHFFFAOYSA-N Hydrogen Chemical compound [H][H] UFHFLCQGNIYNRP-UHFFFAOYSA-N 0.000 description 2
- 239000012159 carrier gas Substances 0.000 description 2
- 238000004587 chromatography analysis Methods 0.000 description 2
- 230000001066 destructive effect Effects 0.000 description 2
- ZUOUZKKEUPVFJK-UHFFFAOYSA-N diphenyl Chemical compound C1=CC=CC=C1C1=CC=CC=C1 ZUOUZKKEUPVFJK-UHFFFAOYSA-N 0.000 description 2
- 238000010438 heat treatment Methods 0.000 description 2
- 239000001257 hydrogen Substances 0.000 description 2
- 229910052739 hydrogen Inorganic materials 0.000 description 2
- 238000011534 incubation Methods 0.000 description 2
- 230000000630 rising effect Effects 0.000 description 2
- 238000001228 spectrum Methods 0.000 description 2
- OYHQOLUKZRVURQ-NTGFUMLPSA-N (9Z,12Z)-9,10,12,13-tetratritiooctadeca-9,12-dienoic acid Chemical compound C(CCCCCCC\C(=C(/C\C(=C(/CCCCC)\[3H])\[3H])\[3H])\[3H])(=O)O OYHQOLUKZRVURQ-NTGFUMLPSA-N 0.000 description 1
- 239000002028 Biomass Substances 0.000 description 1
- 238000004566 IR spectroscopy Methods 0.000 description 1
- 229930182558 Sterol Natural products 0.000 description 1
- 235000010290 biphenyl Nutrition 0.000 description 1
- 239000004305 biphenyl Substances 0.000 description 1
- 150000001875 compounds Chemical class 0.000 description 1
- 238000002790 cross-validation Methods 0.000 description 1
- -1 cyanopropyl-phenyl Chemical group 0.000 description 1
- 235000013365 dairy product Nutrition 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 235000014113 dietary fatty acids Nutrition 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000000839 emulsion Substances 0.000 description 1
- 235000004626 essential fatty acids Nutrition 0.000 description 1
- 229930195729 fatty acid Natural products 0.000 description 1
- 239000000194 fatty acid Substances 0.000 description 1
- 150000004665 fatty acids Chemical class 0.000 description 1
- 235000013305 food Nutrition 0.000 description 1
- 238000004817 gas chromatography Methods 0.000 description 1
- 238000004128 high performance liquid chromatography Methods 0.000 description 1
- 230000002427 irreversible effect Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 239000002245 particle Substances 0.000 description 1
- 150000003904 phospholipids Chemical class 0.000 description 1
- 229920001296 polysiloxane Polymers 0.000 description 1
- 239000004810 polytetrafluoroethylene Substances 0.000 description 1
- 229920001343 polytetrafluoroethylene Polymers 0.000 description 1
- 238000003908 quality control method Methods 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 235000020183 skimmed milk Nutrition 0.000 description 1
- 150000003432 sterols Chemical class 0.000 description 1
- 235000003702 sterols Nutrition 0.000 description 1
- 238000003756 stirring Methods 0.000 description 1
- 238000004809 thin layer chromatography Methods 0.000 description 1
- 150000003626 triacylglycerols Chemical class 0.000 description 1
Abstract
本发明公开了一种鉴别生鲜乳脂肪掺假的方法及装置。方法为:构建基于支持向量机的分类模型,对所述分类模型进行训练、测试和评价,得到最优生鲜乳脂肪掺假判别模型;采集待测生鲜乳样品的色谱图数据,将其导入到所述最优生鲜乳脂肪掺假判别模型中,对待测生鲜乳样品进行鉴别,确定所述待测生鲜乳是否脂肪掺假。装置包括优化模块及判别模块。本发明能够高效、快速、简单鉴别生鲜乳脂肪掺假,从而达到早期对牛奶品质在线监测的目的,检测效率高,检测结果准确。
The invention discloses a method and device for identifying raw milk fat adulteration. The method is: construct a classification model based on support vector machine, train, test and evaluate the classification model to obtain the optimal raw milk fat adulteration discrimination model; collect the chromatogram data of the raw milk sample to be tested, and It is introduced into the optimal raw milk fat adulteration discrimination model to identify the raw milk sample to be tested and determine whether the raw milk to be tested is adulterated with fat. The device includes an optimization module and a judgment module. The invention can efficiently, quickly and simply identify raw milk fat adulteration, thereby achieving the purpose of early online monitoring of milk quality, with high detection efficiency and accurate detection results.
Description
技术领域Technical field
本发明涉及一种鉴别生鲜乳脂肪掺假的方法及装置,属于食品检测技术领域。The invention relates to a method and device for identifying raw milk fat adulteration, and belongs to the technical field of food testing.
背景技术Background technique
生鲜乳中脂肪含量约为3.1%~4.0%,其主要成分是甘油三酯(约98%),磷脂,固醇类等,富含人体需要的必需脂肪酸亚油酸,以较小的微粒状的脂肪球分散在乳液中,易被人体吸收,是一种优质脂肪,同时具有良好的气味,使牛乳呈现出一种令人愉悦的香气。近年来,随着乳脂的需求不断增长,乳脂的价格已呈上涨趋势。有些不法制造商看到这一商机,用便宜的植物油脂掺假,以降低生产成本提高利润率。The fat content in raw milk is about 3.1% to 4.0%. Its main components are triglycerides (about 98%), phospholipids, sterols, etc. It is rich in essential fatty acids needed by the human body, linoleic acid, in the form of smaller particles. The fat globules are dispersed in the emulsion and are easily absorbed by the human body. They are a high-quality fat and have a good smell, giving the milk a pleasant aroma. In recent years, as the demand for milk fat has continued to grow, the price of milk fat has been on an upward trend. Some unscrupulous manufacturers see this business opportunity and adulterate it with cheap vegetable oils to reduce production costs and increase profit margins.
目前,用于检测牛奶脂肪中外来脂肪的方法包括确定其理化性质,检测不皂化物的成分,水溶性或非水溶挥发性脂肪酸的鉴定等。此外,还包括基于其化学性质的薄层色谱、气相色谱、高效液相色谱以及红外光谱等方法。这些方法虽然已被证明其检测牛奶脂肪的有效性,但大多数检测方法只有在掺假物含量足够多时才能保证其有效性,且这些通常需要较为复杂的样品前处理手段,且会对待测样品造成不可逆的损害,因此,亟需开发一种能够进行无损、高通量的检测生鲜乳脂肪掺假的方法,从而达到早期对牛奶品质在线监测的目的。Currently, methods used to detect foreign fat in milk fat include determining its physical and chemical properties, detecting the composition of unsaponifiable matter, and identifying water-soluble or non-water-soluble volatile fatty acids. In addition, methods such as thin layer chromatography, gas chromatography, high performance liquid chromatography, and infrared spectroscopy based on their chemical properties are also included. Although these methods have been proven to be effective in detecting milk fat, most detection methods can only guarantee their effectiveness when the adulterant content is high enough, and these usually require more complex sample pre-processing methods and will affect the samples to be tested. Causes irreversible damage. Therefore, there is an urgent need to develop a non-destructive, high-throughput method for detecting raw milk fat adulteration, so as to achieve the purpose of early online monitoring of milk quality.
发明内容Contents of the invention
本发明所要解决的技术问题是:一种鉴别生鲜乳脂肪掺假的方法。The technical problem to be solved by the present invention is: a method for identifying adulterated raw milk fat.
为了解决上述技术问题,本发明提供了一种鉴别生鲜乳脂肪掺假的方法,包括以下步骤:In order to solve the above technical problems, the present invention provides a method for identifying raw milk fat adulteration, which includes the following steps:
步骤1):构建基于支持向量机的分类模型,对所述分类模型进行训练、测试和评价,得到最优生鲜乳脂肪掺假判别模型;Step 1): Construct a classification model based on support vector machines, train, test and evaluate the classification model to obtain the optimal raw milk fat adulteration discrimination model;
步骤2):采集待测生鲜乳样品的色谱图数据,将其导入到所述最优生鲜乳脂肪掺假判别模型中,对待测生鲜乳样品进行鉴别,确定所述待测生鲜乳是否脂肪掺假。Step 2): Collect the chromatogram data of the raw milk sample to be tested, import it into the optimal raw milk fat adulteration discrimination model, identify the raw milk sample to be tested, and determine the raw milk sample to be tested. Is milk adulterated with fat?
优选地,所述步骤1)中分类模型的构建方法为:采用快速气相型电子鼻对不同的生鲜乳样品进行检测,得到不同生鲜乳样品的色谱图,以不同保留时间的峰面积为自变量、不同生鲜乳样品的种类为因变量构建不同生鲜乳样品的数据集,对所述数据集进行预处理,按预定的比例将预处理后的数据集分为训练集和测试集。Preferably, the construction method of the classification model in step 1) is as follows: using a fast gas-phase electronic nose to detect different raw milk samples to obtain chromatograms of different raw milk samples. The peak areas at different retention times are The independent variables and the types of different raw milk samples are the dependent variables to construct a data set of different raw milk samples. The data set is preprocessed and the preprocessed data set is divided into a training set and a test set according to a predetermined ratio. .
更优选地,所述分类模型为使用Python语言构建的支持向量机SVM分类模型,通过非线性映射函数将输入向量映射到高维特征空间,所述非线性映射函数为:k(xi,x)=exp(-γ{|x-xi|})2,其中,γ为核函数参数,xi为第i个样本向量,x为支持向量。More preferably, the classification model is a support vector machine (SVM) classification model built using Python language. The input vector is mapped to a high-dimensional feature space through a nonlinear mapping function. The nonlinear mapping function is: k( xi ,x )=exp(-γ{|xx i |}) 2 , where γ is the kernel function parameter, xi is the i-th sample vector, and x is the support vector.
进一步地,在所述高维特征空间中寻找最优回归超平面,使得目标损失函数最小,所述最优回归超平面的表达式为:Further, the optimal regression hyperplane is found in the high-dimensional feature space to minimize the target loss function. The expression of the optimal regression hyperplane is:
通过求解下述二次凸规划问题确定和b:It is determined by solving the following quadratic convex programming problem and b:
约束条件为:The constraints are:
上式中:为权值系数矩阵;b为阈值;/>为映射函数;x为支持向量;ξi、/>为松驰变量;C为惩罚因子,C>0;ε为容许误差;xi为第i个样本向量;yi为xi的输出值;/>为第i个样本向量的损失值。In the above formula: is the weight coefficient matrix; b is the threshold;/> is the mapping function; x is the support vector; ξ i ,/> is the slack variable; C is the penalty factor, C>0; ε is the allowable error; x i is the i-th sample vector; y i is the output value of x i ;/> is the loss value of the i-th sample vector.
优选地,所述步骤1)中评价的方法是对得到的最优生鲜乳脂肪掺假判别模型进行评价采用判别正确率Accuracy和F1分数为指标,其中:Preferably, the evaluation method in step 1) is to evaluate the obtained optimal raw milk fat adulteration discrimination model and use the discrimination accuracy rate Accuracy and F1 score as indicators, where:
式中:TP为被模型预测为正类的正样本,TN为被模型预测为负类的负样本,FP为被模型预测为正类的负样本,FN为被模型预测为负类的正样本。In the formula: TP is a positive sample predicted by the model as a positive class, TN is a negative sample predicted by the model as a negative class, FP is a negative sample predicted by the model as a positive class, and FN is a positive sample predicted by the model as a negative class. .
本发明还提供了一种鉴别生鲜乳脂肪掺假的装置,其包括:The invention also provides a device for identifying raw milk fat adulteration, which includes:
优化模块:构建基于支持向量机的分类模型,对所述分类模型进行训练、测试和评价,得到最优生鲜乳脂肪掺假判别模型;Optimization module: Construct a classification model based on support vector machines, train, test and evaluate the classification model to obtain the optimal raw milk fat adulteration discrimination model;
判别模块:采集待测生鲜乳样品的色谱图数据,将其导入到所述最优生鲜乳脂肪掺假判别模型中,对待测生鲜乳样品进行鉴别,确定所述待测生鲜乳是否脂肪掺假。Identification module: Collect the chromatogram data of the raw milk sample to be tested, import it into the optimal raw milk fat adulteration discrimination model, identify the raw milk sample to be tested, and determine the raw milk to be tested Whether fat is adulterated.
上述每个模块采用单片机运行。Each of the above modules is run by a microcontroller.
优选地,所述优化模块采用快速气相型电子鼻对不同的生鲜乳样品进行检测,得到不同生鲜乳样品的色谱图,以不同保留时间的峰面积为自变量、不同生鲜乳样品的种类为因变量构建不同生鲜乳样品的数据集,对所述数据集进行预处理,按预定的比例将预处理后的数据集分为训练集和测试集。Preferably, the optimization module uses a fast gas-phase electronic nose to detect different raw milk samples to obtain chromatograms of different raw milk samples. The peak areas of different retention times are used as independent variables. A data set of different raw milk samples is constructed with the category as the dependent variable, the data set is preprocessed, and the preprocessed data set is divided into a training set and a test set according to a predetermined ratio.
更优选地,所述优化模块使用Python语言构建的支持向量机SVM分类模型,通过非线性映射函数将输入向量映射到高维特征空间,所述非线性映射函数为:k(xi,x)=exp(-γ{|x-xi|})2,其中,γ为核函数参数,xi为第i个样本向量,x为支持向量。More preferably, the optimization module uses the support vector machine SVM classification model built in Python language to map the input vector to the high-dimensional feature space through a nonlinear mapping function. The nonlinear mapping function is: k( xi ,x) =exp(-γ{|xx i |}) 2 , where γ is the kernel function parameter, xi is the i-th sample vector, and x is the support vector.
进一步地,所述优化模块在所述高维特征空间中寻找最优回归超平面,使得目标损失函数最小,所述最优回归超平面的表达式为:Further, the optimization module searches for the optimal regression hyperplane in the high-dimensional feature space to minimize the target loss function. The expression of the optimal regression hyperplane is:
通过求解下述二次凸规划问题确定和b:It is determined by solving the following quadratic convex programming problem and b:
约束条件为:The constraints are:
上式中:为权值系数矩阵;b为阈值;/>为映射函数;x为支持向量;ξi、/>均为松驰变量;C为惩罚因子,C>0;ε为容许误差;xi为第i个样本向量;yi为xi的输出值;/>为第i个样本向量的损失值。In the above formula: is the weight coefficient matrix; b is the threshold;/> is the mapping function; x is the support vector; ξ i ,/> All are slack variables; C is the penalty factor, C>0; ε is the allowable error; x i is the i-th sample vector; y i is the output value of x i ;/> is the loss value of the i-th sample vector.
优选地,还包括评估模块,所述评估模块用于以判别正确率Accuracy和F1分数为指标对得到的最优生鲜乳脂肪掺假判别模型进行评价,判别正确率Accuracy和F1分数为指标,其中:Preferably, it also includes an evaluation module, which is used to evaluate the optimal raw milk fat adulteration discrimination model using the accuracy of discrimination and F1 score as indicators, and the accuracy of discrimination and F1 score as indicators, in:
式中:TP为被模型预测为正类的正样本,TN为被模型预测为负类的负样本,FP为被模型预测为正类的负样本,FN为被模型预测为负类的正样本。In the formula: TP is a positive sample predicted by the model as a positive class, TN is a negative sample predicted by the model as a negative class, FP is a negative sample predicted by the model as a positive class, and FN is a positive sample predicted by the model as a negative class. .
本发明通过创建并训练基于支持向量机的分类模型,得到最优生鲜乳脂肪掺假判别模型;然后采集待测生鲜乳样品的色谱图数据,将其导入到所述最优生鲜乳脂肪掺假判别模型中,对待测生鲜乳样品进行鉴别,确定所述待测生鲜乳是否脂肪掺假,能够高效、快速、简单鉴别生鲜乳脂肪掺假,从而达到早期对牛奶品质在线监测的目的,检测效率高,检测结果准确。The present invention obtains the optimal raw milk fat adulteration discrimination model by creating and training a classification model based on a support vector machine; then collects the chromatogram data of the raw milk sample to be tested and imports it into the optimal raw milk In the fat adulteration discrimination model, the raw milk sample to be tested is identified to determine whether the raw milk to be tested is fat adulterated, which can efficiently, quickly and simply identify the fat adulteration of raw milk, thereby achieving early online monitoring of milk quality. The purpose of monitoring is to ensure high detection efficiency and accurate detection results.
附图说明Description of the drawings
图1为本发明提供的鉴别生鲜乳脂肪掺假的方法的流程图;Figure 1 is a flow chart of a method for identifying raw milk fat adulteration provided by the present invention;
图2为本发明提供的鉴别生鲜乳脂肪掺假的装置的模块连接图。Figure 2 is a module connection diagram of a device for identifying raw milk fat adulteration provided by the present invention.
具体实施方式Detailed ways
为使本发明更明显易懂,兹以优选实施例,并配合附图作详细说明如下。In order to make the present invention more obvious and understandable, preferred embodiments are described in detail below along with the accompanying drawings.
实施例1Example 1
如图1所示,为本发明提供的一种鉴别生鲜乳脂肪掺假的方法:As shown in Figure 1, a method for identifying adulteration of raw milk fat provided by the present invention:
S1:构建基于支持向量机的分类模型,对所述分类模型进行训练、测试和评价,得到最优生鲜乳脂肪掺假判别模型。S1: Construct a classification model based on support vector machine, train, test and evaluate the classification model to obtain the optimal raw milk fat adulteration discrimination model.
本步骤中,首先获取新鲜的生鲜乳样品和制备掺有不同植物油的生鲜乳样品;然后构建不同生鲜乳样品的数据集,对所述数据集进行预处理,按预定的比例将预处理后的数据集分为训练集和测试集。在一个实施例中,预定的比例为7:3。In this step, fresh raw milk samples are first obtained and raw milk samples mixed with different vegetable oils are prepared; then a data set of different raw milk samples is constructed, the data set is preprocessed, and the preprocessed milk samples are preprocessed according to a predetermined ratio. The processed data set is divided into training set and test set. In one embodiment, the predetermined ratio is 7:3.
预处理方法采用min-max标准化(归一化),具体公式:The preprocessing method uses min-max standardization (normalization), the specific formula:
式中:xi为第i个样本特征值,xmax、xmin,分别为样本特征的最大值、最小值和平均值,x'为预处理后的样本特征值。In the formula: x i is the eigenvalue of the i-th sample, x max , x min , are the maximum value, minimum value and average value of the sample features respectively, and x' is the preprocessed sample feature value.
优选地,使用Python语言构建支持向量机SVM分类模型,通过非线性映射函数将输入向量映射到高维特征空间,所述非线性映射函数为:Preferably, the Python language is used to construct a support vector machine (SVM) classification model, and the input vector is mapped to the high-dimensional feature space through a nonlinear mapping function. The nonlinear mapping function is:
k(xi,x)=exp(-γ{|x-xi|})2 k(x i ,x)=exp(-γ{|xx i |}) 2
其中,γ为核函数参数,xi为第i个样本向量,x为支持向量。Among them, γ is the kernel function parameter, xi is the i-th sample vector, and x is the support vector.
SVM通过核函数定义的非线性变化将输入样本数据转换到高维特征空间,并在这个高维空间中寻找输入变量和输出变量的线性关系,本实施例选择常用于处理非线性问题的径向基函数(RBF)作为映射函数。SVM converts the input sample data into a high-dimensional feature space through the nonlinear changes defined by the kernel function, and searches for the linear relationship between the input variables and the output variables in this high-dimensional space. In this embodiment, the radial feature commonly used to deal with nonlinear problems is selected. Basis functions (RBF) serve as mapping functions.
优选地,在所述高维特征空间中寻找最优回归超平面,使得目标损失函数最小,所述最优回归超平面的表达式为:Preferably, the optimal regression hyperplane is found in the high-dimensional feature space to minimize the target loss function. The expression of the optimal regression hyperplane is:
通过求解下述二次凸规划问题确定和b:It is determined by solving the following quadratic convex programming problem and b:
约束条件为:The constraints are:
上式中:为权值系数矩阵;b为阈值;/>为映射函数;x为支持向量;ξi、/>均为松驰变量;C为惩罚因子,C>0;ε为容许误差;xi为第i个样本向量;yi为xi的输出值;/>为第i个样本向量的损失值。In the above formula: is the weight coefficient matrix; b is the threshold;/> is the mapping function; x is the support vector; ξ i ,/> All are slack variables; C is the penalty factor, C>0; ε is the allowable error; x i is the i-th sample vector; y i is the output value of x i ;/> is the loss value of the i-th sample vector.
在寻找最优超平面过程中,通过最小化权值系数平方和保证函数关系的平滑,同时容许小于ε的误差。In the process of finding the optimal hyperplane, the smoothness of the functional relationship is ensured by minimizing the sum of squares of the weight coefficients, while allowing an error less than ε.
优选地,确定的关键参数中,惩罚因子C为1.3、容许误差ε为0.001。Preferably, among the determined key parameters, the penalty factor C is 1.3 and the allowable error ε is 0.001.
优选地,以判别正确率Accuracy和F1分数为指标对所述最优生鲜乳脂肪掺假判别模型进行评价,其中:Preferably, the optimal raw milk fat adulteration discrimination model is evaluated using the discrimination accuracy rate Accuracy and F1 score as indicators, where:
式中:TP为被模型预测为正类的正样本,TN为被模型预测为负类的负样本,FP为被模型预测为正类的负样本,FN为被模型预测为负类的正样本。In the formula: TP is a positive sample predicted by the model as a positive class, TN is a negative sample predicted by the model as a negative class, FP is a negative sample predicted by the model as a positive class, and FN is a positive sample predicted by the model as a negative class. .
在模型训练过程中,采用10折交叉验证法评估参数特定组合的判别效果,据此选择最优参数组合。During the model training process, the 10-fold cross-validation method was used to evaluate the discriminative effect of a specific combination of parameters, and the optimal parameter combination was selected accordingly.
S2:采集待测生鲜乳样品的色谱图数据,将其导入到所述最优生鲜乳脂肪掺假判别模型中,对待测生鲜乳样品进行鉴别,确定所述待测生鲜乳是否脂肪掺假。S2: Collect the chromatogram data of the raw milk sample to be tested, import it into the optimal raw milk fat adulteration discrimination model, identify the raw milk sample to be tested, and determine whether the raw milk to be tested is Fat adulteration.
具体地,采用快速气相型电子鼻对不同的生鲜乳样品进行检测,得到不同生鲜乳样品的色谱图,以不同保留时间的峰面积为自变量,不同生鲜乳样品的种类为因变量构建不同生鲜乳样品的数据集,对所述数据集进行预处理,按预定的比例将预处理后的数据集分为训练集和测试集。Specifically, a fast gas-phase electronic nose was used to detect different raw milk samples, and chromatograms of different raw milk samples were obtained. The peak areas of different retention times were used as independent variables, and the types of different raw milk samples were used as dependent variables. Construct a data set of different raw milk samples, preprocess the data set, and divide the preprocessed data set into a training set and a test set according to a predetermined ratio.
快速气相型电子鼻的型号为法国Alpha MOS公司的Herales II,其采用的色谱柱型号分别为MXT-5和MXT-1701;相应地,构建数据集时采用如下方法:将从型号分别为MXT-5和MXT-1701的色谱柱获得的谱图进行合并并根据保留时间排列,将响应值峰面积不同但保留时间相近的物质视为同一物质,以不同保留时间的峰面积为自变量,不同生鲜乳样品的种类为因变量建立数据集。The model of the fast gas-phase electronic nose is Herales II of French Alpha MOS Company, and the chromatographic column models used are MXT-5 and MXT-1701 respectively; accordingly, the following method is used when constructing the data set: from the model to MXT- The spectra obtained from the chromatographic columns of 5 and MXT-1701 are combined and arranged according to the retention time. Substances with different response value peak areas but similar retention times are regarded as the same substance. The peak areas of different retention times are used as independent variables, and different products are generated. The type of fresh milk sample creates a data set for the dependent variable.
采用快速气相型电子鼻检测的条件为:The conditions for using rapid gas phase electronic nose detection are:
样品量:5g;样品孵育温度:50℃;样品孵育时间:20min;进样体积:5000μL;进样速度:125μL/s;进样方式:顶空注入;Tenax捕集阱收集温度:40℃;Tenax捕集阱收集时间:50s;载气:氢气;分流:10mL/min;取样器温度:200℃;升温程序:80℃恒温0s,3℃/s升温至250℃,250℃恒温21s;检测器温度:260℃;FID增益:FID1/FID2。Sample volume: 5g; sample incubation temperature: 50℃; sample incubation time: 20min; injection volume: 5000μL; injection speed: 125μL/s; injection method: headspace injection; Tenax trap collection temperature: 40℃; Tenax trap collection time: 50s; carrier gas: hydrogen; split flow: 10mL/min; sampler temperature: 200℃; temperature rising program: 80℃ constant temperature for 0s, 3℃/s temperature rise to 250℃, 250℃ constant temperature for 21s; detection Device temperature: 260℃; FID gain: FID1/FID2.
以下给出本实施例的一个具体实验过程。A specific experimental process of this embodiment is given below.
掺假生鲜乳样品的模拟:Simulation of adulterated raw milk samples:
取适量脱脂乳样品于烧杯中,单一地加入不同的植物油样品(3.1%,w/w),进行充分搅拌并均质,从而获得均一的掺有不同植物油的牛奶样品。Take an appropriate amount of skim milk sample in a beaker, add different vegetable oil samples (3.1%, w/w) singly, stir thoroughly and homogenize to obtain a uniform milk sample mixed with different vegetable oils.
快速气相型电子鼻的检测:Rapid gas phase electronic nose detection:
准确称取5g待测样品于20mL样品瓶中,然后有顺序地置于仪器自带的样品架上,供其机械臂有序准确地检测样品,通过软件设置取样顺序,利用快速气相型电子鼻检测待测样品的挥发性化合物,检测条件如下:样品瓶用防漏盖封闭,并用硅/聚四氟乙烯隔膜覆盖。样品在50℃下孵育20min,然后自动进样器以125μL/s的速率从顶空向GC注入5000μL样品,并在Tenax捕集阱中在40℃下收集分析物50s。快速加热后,分析物被分离并转移到两个平行的短GC色谱柱:非极性色谱柱(MXT-5:5%联苯,95%甲基聚硅氧烷,10m×0.180mm×0.4μm)和弱极性色谱柱(MXT-1701:14%氰丙基-苯基,86%甲基聚硅氧烷,10m×0.180mm×0.4μm)。氢气用作载气。系统在80kPa的恒压下运行,柱头分流流速为10mL/min。温度条件为:取样器温度为200℃;升温程序包括80℃恒温0s,3℃/s升温至250℃,250℃恒温21s;260℃火焰离子化检测(FID1/FID2)。每个样品一式六份进行检测以获得更好的平行效果与模型性能。Accurately weigh 5g of the sample to be tested into a 20mL sample bottle, and then place it in an orderly manner on the sample rack that comes with the instrument for its robotic arm to detect the sample in an orderly and accurate manner. Set the sampling sequence through the software and use a fast gas phase electronic nose. The volatile compounds of the sample to be tested are detected under the following conditions: the sample bottle is closed with a leak-proof cap and covered with a silicone/PTFE septum. The sample was incubated at 50°C for 20 min, then the autosampler injected 5000 μL of sample from the headspace into the GC at a rate of 125 μL/s, and the analytes were collected in a Tenax trap at 40°C for 50 s. After rapid heating, the analytes are separated and transferred to two parallel short GC columns: non-polar column (MXT-5: 5% biphenyl, 95% methylpolysiloxane, 10m × 0.180mm × 0.4 μm) and weakly polar chromatography column (MXT-1701: 14% cyanopropyl-phenyl, 86% methylpolysiloxane, 10m×0.180mm×0.4μm). Hydrogen was used as carrier gas. The system was operated at a constant pressure of 80 kPa, and the head-column split flow rate was 10 mL/min. The temperature conditions are: the sampler temperature is 200°C; the temperature rising program includes constant temperature at 80°C for 0s, 3°C/s heating to 250°C, constant temperature at 250°C for 21s; 260°C flame ionization detection (FID1/FID2). Each sample was tested in six replicates to obtain better parallelism and model performance.
数据预处理及数据集的建立:Data preprocessing and data set creation:
将从两根快速色谱柱获得的谱图合并并根据保留时间排列,将响应值不同但保留时间相近的物质视为同一物质,以不同保留时间的峰面积为自变量,不同生鲜乳样品的种类为因变量建立数据集,对数据集进行预处理,然后随机地将数据集以7:3的比例分为训练集和测试集。The spectra obtained from the two fast chromatography columns were combined and arranged according to the retention time. Substances with different response values but similar retention times were regarded as the same substance. Using the peak areas of different retention times as independent variables, the values of different raw milk samples were Category creates a data set for the dependent variable, preprocesses the data set, and then randomly divides the data set into a training set and a test set in a ratio of 7:3.
判别模型的建立:Establishment of discriminant model:
在Pycharm(版本:2021.2.1)平台使用Python语言构建支持向量机(SVM)分类模型,SVM基于结构风险最小化原则,通过非线性映射将输入向量映射到高维特征空间,在这个空间中寻找最优回归超平面,使得目标损失函数最小。Use the Python language to build a support vector machine (SVM) classification model on the Pycharm (version: 2021.2.1) platform. SVM is based on the principle of structural risk minimization and maps the input vector to a high-dimensional feature space through nonlinear mapping to find in this space The optimal regression hyperplane minimizes the target loss function.
SVM建模结果:SVM modeling results:
确定的关键参数为:惩罚因子C为1.3、容许误差ε为0.001和核函数参数γ为RBF。优化之后的SVM判别模型的对测试集的判别准确率为95.65%,F1分数为0.9778,结果说明模型的判别性能优良。The key parameters determined are: penalty factor C is 1.3, allowable error ε is 0.001 and kernel function parameter γ is RBF. The optimized SVM discriminant model has a discrimination accuracy of 95.65% on the test set and an F1 score of 0.9778. The results show that the model has excellent discriminative performance.
生鲜乳脂肪掺假判别模型的应用:Application of the raw milk fat adulteration identification model:
随机制备30个含有不同植物油的生鲜乳样品,使用电子鼻对其进行检测,获得盲样数据集,导入到前期构建的SVM判别中生鲜乳样品的种类进行判别,结果显示,SVM判别模型的对盲样数据集的判别准确率为93.47%,F1分数为0.9523。Randomly prepare 30 raw milk samples containing different vegetable oils, use an electronic nose to detect them, obtain a blind sample data set, and import it into the SVM discrimination built in the early stage to identify the types of raw milk samples. The results show that the SVM discrimination model The discrimination accuracy on the blind sample data set is 93.47%, and the F1 score is 0.9523.
本实施例利用快速气相型电子鼻(FGC E-nose)结合化学计量学实现快速鉴别生鲜乳脂肪掺假,无需复杂的样品前处理步骤,测定过程简单、快速,具有很好的实际应用价值;本实施例能够进行无损、高通量的鉴别生鲜乳中是否掺有植物油及其种类,可用于生鲜乳中脂肪掺假的快速检测,为乳品行业的生鲜乳质量控制提供参考。This example uses a fast gas-phase electronic nose (FGC E-nose) combined with chemometrics to quickly identify raw milk fat adulteration without complicated sample pre-processing steps. The determination process is simple and fast, and has good practical application value. ; This embodiment can perform non-destructive, high-throughput identification of whether raw milk is adulterated with vegetable oil and its type, and can be used for rapid detection of fat adulteration in raw milk, providing a reference for raw milk quality control in the dairy industry.
实施例2Example 2
如图2所示,为本发明提供的一种鉴别生鲜乳脂肪掺假的装置,其包括:As shown in Figure 2, a device for identifying raw milk fat adulteration provided by the present invention includes:
优化模块,用于构建基于支持向量机的分类模型,对所述分类模型进行训练、测试和评价,得到最优生鲜乳脂肪掺假判别模型;An optimization module, used to construct a classification model based on support vector machines, train, test and evaluate the classification model to obtain an optimal raw milk fat adulteration discrimination model;
判别模块,用于采集待测生鲜乳样品的色谱图数据,将其导入到所述最优生鲜乳脂肪掺假判别模型中,对待测生鲜乳样品进行鉴别,确定所述待测生鲜乳是否脂肪掺假。The identification module is used to collect the chromatogram data of the raw milk sample to be tested, import it into the optimal raw milk fat adulteration discrimination model, identify the raw milk sample to be tested, and determine the raw milk sample to be tested. Is fresh milk adulterated with fat?
上述每个模块采用单片机运行。Each of the above modules is run by a microcontroller.
优选地,所述优化模块用于:Preferably, the optimization module is used for:
采用快速气相型电子鼻对不同的生鲜乳样品进行检测,得到不同生鲜乳样品的色谱图,以不同保留时间的峰面积为自变量,不同生鲜乳样品的种类为因变量构建不同生鲜乳样品的数据集,对所述数据集进行预处理,按预定的比例将预处理后的数据集分为训练集和测试集。A rapid gas-phase electronic nose was used to detect different raw milk samples, and the chromatograms of different raw milk samples were obtained. The peak areas of different retention times were used as independent variables, and the types of different raw milk samples were used as dependent variables to construct different biomass. A data set of fresh milk samples is prepared, and the data set is preprocessed, and the preprocessed data set is divided into a training set and a test set according to a predetermined ratio.
优选地,所述优化模块用于:Preferably, the optimization module is used for:
使用Python语言构建支持向量机SVM分类模型,通过非线性映射函数将输入向量映射到高维特征空间,所述非线性映射函数为:Use Python language to build a support vector machine SVM classification model, and map the input vector to a high-dimensional feature space through a nonlinear mapping function. The nonlinear mapping function is:
k(xi,x)=exp(-γ{|x-xi|})2 k(x i ,x)=exp(-γ{|xx i |}) 2
其中,γ为核函数参数,xi为第i个样本向量,x为支持向量。Among them, γ is the kernel function parameter, xi is the i-th sample vector, and x is the support vector.
优选地,所述优化模块用于:Preferably, the optimization module is used for:
在所述高维特征空间中寻找最优回归超平面,使得目标损失函数最小,所述最优回归超平面的表达式为:Find the optimal regression hyperplane in the high-dimensional feature space to minimize the target loss function. The expression of the optimal regression hyperplane is:
通过求解下述二次凸规划问题确定和b:It is determined by solving the following quadratic convex programming problem and b:
约束条件为:The constraints are:
上式中:为权值系数矩阵;b为阈值;/>为映射函数;x为支持向量;ξi、/>均为松驰变量;C为惩罚因子,C>0;ε为容许误差;xi为第i个样本向量;yi为xi的输出值;/>为第i个样本向量的损失值。In the above formula: is the weight coefficient matrix; b is the threshold;/> is the mapping function; x is the support vector; ξ i ,/> All are slack variables; C is the penalty factor, C>0; ε is the allowable error; x i is the i-th sample vector; y i is the output value of x i ;/> is the loss value of the i-th sample vector.
优选地,所述装置还包括评估模块,所述评估模块用于:Preferably, the device further includes an evaluation module, the evaluation module is used for:
以判别正确率Accuracy和F1分数为指标对所述最优生鲜乳脂肪掺假判别模型进行评价,其中:The optimal raw milk fat adulteration discrimination model was evaluated using the discrimination accuracy rate Accuracy and F1 score as indicators, where:
式中:TP为被模型预测为正类的正样本,TN为被模型预测为负类的负样本,FP为被模型预测为正类的负样本,FN为被模型预测为负类的正样本。In the formula: TP is a positive sample predicted by the model as a positive class, TN is a negative sample predicted by the model as a negative class, FP is a negative sample predicted by the model as a positive class, and FN is a positive sample predicted by the model as a negative class. .
本实施例2中各个模块所实现的功能的具体实施过程与实施例1中的各个步骤的实施过程相同,在此不再赘述。The specific implementation process of the functions implemented by each module in Embodiment 2 is the same as the implementation process of each step in Embodiment 1, and will not be described again here.
Claims (2)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111401454.6A CN114239692B (en) | 2021-11-24 | Method and device for identifying fresh milk fat adulteration |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111401454.6A CN114239692B (en) | 2021-11-24 | Method and device for identifying fresh milk fat adulteration |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114239692A CN114239692A (en) | 2022-03-25 |
CN114239692B true CN114239692B (en) | 2023-09-22 |
Family
ID=
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102590128A (en) * | 2012-01-10 | 2012-07-18 | 上海市兽药饲料检测所 | Method for discriminating adulterated raw and fresh milk by using near infrared spectrum |
CN105588925A (en) * | 2015-12-16 | 2016-05-18 | 新希望双喜乳业(苏州)有限公司 | Method for quickly identifying and detecting milk adulteration |
CN107543838A (en) * | 2017-09-20 | 2018-01-05 | 北京市食品安全监控和风险评估中心(北京市食品检验所) | A kind of adulterated magnetic resonance detection method for planting butter cream in dilute cream |
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102590128A (en) * | 2012-01-10 | 2012-07-18 | 上海市兽药饲料检测所 | Method for discriminating adulterated raw and fresh milk by using near infrared spectrum |
CN105588925A (en) * | 2015-12-16 | 2016-05-18 | 新希望双喜乳业(苏州)有限公司 | Method for quickly identifying and detecting milk adulteration |
CN107543838A (en) * | 2017-09-20 | 2018-01-05 | 北京市食品安全监控和风险评估中心(北京市食品检验所) | A kind of adulterated magnetic resonance detection method for planting butter cream in dilute cream |
Non-Patent Citations (2)
Title |
---|
张鑫;顾欣;倪力军;张立国;韩奕奕.基于近红外光谱技术的掺假生鲜乳识别平台的研发.中国奶牛.2012,(第13期),全文. * |
褚璇;王伟;赵昕;姜洪喆;王伟;刘声泉.近红外光谱和特征光谱的山茶油掺假鉴别方法研究.光谱学与光谱分析.2017,(第01期),全文. * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Yan et al. | Maternal serum metabolome and traffic-related air pollution exposure in pregnancy | |
Karami et al. | Comparison of chemometrics and AOCS official methods for predicting the shelf life of edible oil | |
Aghili et al. | Detection of fraud in sesame oil with the help of artificial intelligence combined with chemometrics methods and chemical compounds characterization by gas chromatography–mass spectrometry | |
Tian et al. | Rapid identification and quantification of vegetable oil adulteration in raw milk using a flash gas chromatography electronic nose combined with machine learning | |
Piravi‐Vanak et al. | The influence of growing region on fatty acids and sterol composition of Iranian olive oils by unsupervised clustering methods | |
Jurado et al. | Differentiation of certified brands of origins of Spanish white wines by HS-SPME-GC and chemometrics | |
Gandhi et al. | Detection of coconut oil in ghee using ATR-FTIR and chemometrics | |
González-Pereira et al. | State-of-the-art of analytical techniques to determine food fraud in olive oils | |
Jiang et al. | Qualitative identification of the edible oil storage period using a homemade portable electronic nose combined with multivariate analysis | |
CN109991324A (en) | A method of identifying Duolang mutton | |
CN113406249B (en) | A method for predicting the types of adulterated oils in camellia oil | |
CN106709506A (en) | Method for identifying and classifying species and different origins of Chinese herbal medicine | |
Li et al. | Fish meal freshness detection by GBDT based on a portable electronic nose system and HS-SPME–GC–MS | |
Huang et al. | Identification of adulterated extra virgin olive oil by colorimetric sensor array | |
CN114239692B (en) | Method and device for identifying fresh milk fat adulteration | |
Costa et al. | Evaluating an e-nose ability to detect biogas plant efficiency: A case study | |
CN103575764A (en) | Honey detection method based on support vector machine algorithm optimization | |
CN103592256A (en) | Mid-infrared spectroscopic method for distinguishing normal edible vegetable oil from refined hogwash oil based on Fourier transform | |
CN110398472A (en) | A method for identification and classification of vegetable oil based on two-dimensional correlation spectrum quantification | |
CN110823966B (en) | A rapid determination method of SO2 concentration in wine based on electronic nose | |
Dehan et al. | Classification of Chinese Herbal medicines based on SVM | |
CN106770477A (en) | One kind optimization sensing data and pattern-recognition differentiate and adulterated fast detecting method to nectar source | |
Hosseini et al. | A dedicated electronic nose combined with chemometric methods for detection of adulteration in sesame oil | |
CN114239692A (en) | Method and device for identifying adulteration of fresh milk fat | |
CN118169272A (en) | Method for measuring volatile components of Kazakhstan grease and application thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant |