A method for identifying animal milk based on 10 fatty acids and its application

By constructing an animal milk identification model based on 10 characteristic fatty acids and combining a random forest algorithm, the problem of insufficient rapid and accurate identification of animal milk in the existing technology is solved, and low-cost and efficient identification of animal milk is achieved, with wide applications prospect.

CN118961956BActive Publication Date: 2025-02-07INSTITUTE OF ANIMAL SCIENCES OF CHINESE ACADEMY OF AGRICULTURAL SCIENCES
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411468035.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-21
Publication Date
2025-02-07
Estimated Expiration
2044-10-21

AI Technical Summary

Technical Problem

The prior art has problems such as missing identification methods, high analysis costs, small data volume and insufficient data mining in terms of animal milk identification, making it difficult to achieve fast and accurate identification of animal milk.

Method used

A method based on 10 characteristic fatty acids was used to derivatize through methyl esterification and isopropyl esterification, and gas chromatography-mass spectrometry detection was used to construct an animal milk identification model in combination with a random forest algorithm to achieve rapid and accurate animal milk identification.

Benefits of technology

It has achieved rapid and accurate identification of animal milk, reduced analysis costs, improved the depth and efficiency of data mining, and has broad application value and promotion prospects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118961956B_ABST
    Figure CN118961956B_ABST
Patent Text Reader

Abstract

The present invention discloses an animal milk identification method based on 10 kinds of fatty acids and its application, the identification method comprising: 1) obtaining the relative content of characteristic fatty acids from a sample to be tested, the characteristic fatty acids being C10:0, C23:0, C8:0, C7:0, anteiso C15:0, C18:3 c9c12c15, iso C4:0, C18:0, C18:1 t11, and C6:0; 2) based on an animal milk identification model, using the relative content of the obtained characteristic fatty acids to obtain an identification result indicating that the sample to be tested is Holstein cow milk, yak milk, buffalo milk, goat milk, sheep milk, camel milk, donkey milk, horse milk, and human milk. The present invention can quickly and accurately identify animal milk based on the constructed model through 10 kinds of differential fatty acids that contribute greatly to classification, is simple to operate, and has low cost, can provide technical support for animal milk identification, and is applied to quality control and traceability in the dairy industry.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of dairy product detection, and in particular to an animal milk identification method based on 10 fatty acids and an application thereof. Background Art

[0002] Animal milk is an important food source for mammals, especially their young individuals. Its rich and diverse nutrients play an irreplaceable role in the growth, development and health of animals. According to FAO data in 2024, dairy cow milk accounts for 81% of global milk production, buffalo milk accounts for 15%, and goat milk, sheep milk and camel milk account for 4% in total. In recent years, non-cow milk has attracted more and more attention due to its unique and rich nutritional value, and its consumer demand is also increasing. Due to factors such as supply and consumer demand, the market price of non-cow milk in most parts of the world is usually higher than cow milk. In many cases, one way for fraudsters to make extra profits is to sell low-value cow milk as high-value non-cow milk, which not only threatens food safety but may even endanger public health. Therefore, identifying animal milk in animal production and the food industry is crucial to prevent adulteration.

[0003] Existing identification methods include chemical analysis methods, sensory detection methods, molecular biology methods, etc. Among them, molecular biology methods, such as DNA barcoding technology, identify species by detecting DNA sequences in milk. This method has high accuracy, but it also has problems such as high cost and complex operation; while the sensory detection method identifies milk through sensory evaluation, such as smell, taste and color. This method relies on the experience of the tester and has the disadvantages of strong subjectivity and low accuracy. In contrast, chemical analysis methods: including gas chromatography (GC), liquid chromatography (HPLC) and mass spectrometry (MS) and other technologies, identify the source of milk by detecting specific components in milk, such as milk fat, milk protein, lactose, etc., precisely because these indicators are the indicators that consumers and nutritionists have always paid attention to. If these indicators can be used to establish identification methods, it will not only not increase the workload, but also effectively expand and apply the nutritional index data. Fatty acids are a type of metabolites in organisms, and fatty acid composition is a type of comprehensive metabolic marker that reflects the interaction of multiple factors such as breed, nutrition, lactation period, region, climate, etc. Although gas chromatography-mass spectrometry enables high-throughput determination of multiple fatty acids present in samples, complex data processing and interpretation remain a challenge. Previous studies have elucidated the application of fatty acids as potential markers in food discrimination. Based on the combination of fatty acid profiles with chemometric methods such as principal component analysis, partial least squares discriminant analysis, and linear discriminant analysis, vegetable oil identification, animal fat and vegetable fat identification, and lard and milk identification can be achieved. Compared with chemometrics, machine learning is a widely used artificial intelligence method that can automatically analyze complex data in many fields such as biological sciences and food sciences. It has unique advantages, especially in interpreting data, identifying biomarkers, and developing predictive models. Machine learning techniques such as random forest models and support vector machines have been applied to descriptive and predictive problems such as rapid classification of dairy products. However, the use of machine learning in selecting potential fatty acid markers to distinguish animal milk and developing discriminant models for different animal milks has not been fully explored, highlighting the great potential for further research. Each animal milk has its own unique fatty acid composition. Therefore, fully exploring the fatty acid information of different animal milks and effectively analyzing and processing the data has potential application value in animal milk discrimination. Summary of the invention

[0004] In view of the problems existing in existing analysis methods, such as lack of identification methods, high analysis costs, small data volume, insufficient data mining, etc., the present invention provides an animal milk identification method based on 10 fatty acids and its application, so as to achieve rapid and accurate animal milk identification.

[0005] To achieve the above purpose, the technical solution adopted by the present invention is as follows:

[0006] An animal milk identification method based on 10 fatty acids comprises the following steps:

[0007] (1) Derivatizing animal milk fatty acids by methyl esterification and isopropyl esterification, detecting fatty acid derivatives by gas chromatography-mass spectrometry, and obtaining the relative content of characteristic fatty acids from the sample to be tested, wherein the characteristic fatty acids are C10:0, C23:0, C8:0, C7:0, anteiso C15:0, C18:3 c9c12c15, iso C4:0, C18:0, C18:1 t11, and C6:0;

[0008] (2) constructing an animal milk identification model, and using the relative contents of the acquired characteristic fatty acids to obtain an identification result indicating that the sample to be tested is Holstein cow milk, yak milk, buffalo milk, goat milk, sheep milk, camel milk, donkey milk, horse milk, or human milk; wherein the animal milk identification model is constructed using a random forest algorithm and the relative contents of C1-C24 fatty acids of multiple groups of samples of Holstein cow milk, yak milk, buffalo milk, goat milk, sheep milk, camel milk, donkey milk, horse milk, and human milk.

[0009] Furthermore, the method for determining the relative content of the characteristic fatty acid includes but is not limited to gas chromatography-mass spectrometry.

[0010] Furthermore, the method for constructing the animal milk identification model is:

[0011] (1) Feature screening: The fatty acid data obtained from the data, i.e., the first training data set, is subjected to dimensionality reduction processing using a combination of the lasso regression algorithm, the random forest algorithm, and the recursive feature elimination algorithm to obtain the second training data set, the third training data set, and the fourth training data set in turn;

[0012] The first training data set includes multiple sample data of 9 kinds of animal milk, and the sample data includes content data of a first number of types of fatty acids; specifically includes 88 kinds of fatty acids measured, namely C1:0, C2:0, C3:0, iso C4:0, C4:0, iso C5:0, anteiso C5:0, C5:0, iso C6:0, C6:0, C7:0, C8:0, C9:0, C10:0, C10:1 c4, C10:1 c3, C10:1 c9, C11:0, C12:0, C12:1 c5, C13:0 iso, C13:1 c11, anteisoC13:0, C13:0, iso C14:0, C14:0, iso C15:0, C15:1 t9, anteiso C15:0, C15:1 c9, C15:0, C16:0, C15:1 t10, C15:1 c10, C16:0, C16:1 t9, iso C17:0, C16:1 c7, C16:1 c9, anteiso C17:0, C17:0, C17:1 t10, iso C18:0, C17:1 c10, C18:0, C18:1 t6, C18:1 t9, C18:1 t11, C18:1 c6, C18:1 c9, C18:1 c11, C18:1 c12, C18:2 t9t12, C18:2 c9t12, C18:2t9c12, C19:1 t7, C19:1 t10, C18:2 c9c12, C19:1 c10, C20:0, C18:3 c6c9c12, C20:1 t11, C18:3 c9c12c15, C20:1 c8, C20:1 c11, C18:2 c9t11, C18:2 t10c12, C18:2 c9c11, C21:0, C18:4 c6c9c12c15, C18:2 t9t11, C20:2 c11c14, C22:0, C20:3 c8c11c14, C22:1 t13, C20:3 c11c14c17, C22:1 c13, C20:4 c5c8c11c14, C23:0, C22:2 c13c16, C20:5c5c8c11c14c17, C24:0, C22:3 c13c16c19, C24:1 c15, C22:4 c7c10c13c16, C22:5c4c7c10c13c16, C22:5 c7c10c13c16c19, C22:6 c4c7c10c13c16c19;

[0013] The second training data set includes sample data of a first number of types reduced in dimension by a lasso regression algorithm, and each of the reduced-dimensional sample data includes fatty acid data of a second number of types screened from the first number of types of fatty acids; specifically, it includes 60 characteristic fatty acids screened by the LASSO regression algorithm, namely C6:0, C15:0, C4:0, C10:0, anteiso C15:0, iso C4:0, C18:1 t6, C18:2 c9t11, C22:4 c7c10c13c16, C20:0, C18:1t11, C13:0, C20:2 c11c14, C5:0, C18:3 c9c12c15, C16:1 c7, C14:0, iso C17:0, iso C16:0, iso C6:0, C16:1 c9, C18:2 t9t12, C22:4 c7c10c13c16, t9, C8:0, iso C14:0, C20:1 c8, C7:0, C18:1c9, C18:1 c11, C14:1 c9, C18:1 c6, anteiso C13:0, C12:0, C22:3 c13c16c19, C16:0, isoC15:0, C17:0, C20:3 c8c11c14, C18:2 c9c11, C20:5 c5c8c11c14c17, C2:0, C20:1 t11, C22:5 c4c7c10c13c16, C1:0, anteiso C17:0, C18:3 c6c9c12, C15:1 t10, iso C5:0, C18:2t10c12, C18:0, C23:0, C9:0, C24:1 c15, C15:1 c10, C18:1 c12, C22:1 c13, C18:2 t9c12, C22:2 c13c16, iso C18:0, C3:0;

[0014] The third training data set includes sample data of a second number of types reduced in dimension by a random forest algorithm, and each of the reduced in dimension sample data includes fatty acid data of a third number of types screened from the second number of types of fatty acids; specifically includes 30 characteristic fatty acids screened by the random forest algorithm, namely iso C4:0, C10:0, C7:0, C23:0, C8:0, C18:0, C18:3 c9c12c15, C17:0, anteiso C15:0, C16:1 c9, C15:0, C20:1t11, iso C14:0, C9:0, C18:1 t11, C14:1 c9, C18:1 c12, C6:0, C3:0, C16:1 t9, anteiso C17:0, C12:0, C4:0, C16:1 c7, C5:0, iso C17:0, iso C18:0, C22:5 c4c7c10c13c16, C15:1t10, C20:2 c11c14;

[0015] The fourth training data set includes a third number of types of sample data reduced in dimension by a recursive feature elimination algorithm, and each of the reduced-dimensional sample data includes a fourth number of types of fatty acid data screened from the third number of types of fatty acids; specifically, it includes 10 characteristic fatty acids screened by the recursive feature algorithm, namely C10:0, C23:0, C8:0, C7:0, anteiso C15:0, C18:3 c9c12c15, iso C4:0, C18:0, C18:1 t11, and C6:0;

[0016] (2) Model construction: Utilizing the random forest algorithm, a plurality of decision trees are trained using the fourth training data set to construct a random forest model as an animal milk identification model.

[0017] Furthermore, in the feature screening method, the fatty acid abundance data in the first training data set is preliminarily screened using a lasso regression algorithm, and a group of characteristic fatty acids with non-zero coefficients are screened out by introducing L1 regularization, thereby reducing the feature dimension, obtaining a second number of types of fatty acid data, and generating a second training data set;

[0018] On the basis of the second training data set, the random forest algorithm is further used through the SelectFromModel method to retain fatty acids with feature importance scores above the median, further refine the data dimension, ensure that the characteristic metabolites finally retained have a high classification contribution, obtain the third number of types of fatty acid data, and generate the third training data set;

[0019] On the basis of the third training data set, a recursive feature elimination algorithm is further applied to gradually remove fatty acids with lower contribution, and finally a fourth number of types of fatty acid data are retained to generate a fourth training data set.

[0020] Furthermore, in the model construction, in the fourth training data set, a fourth number of types of fatty acid data are selected with replacement for training each decision tree by randomly selecting a sample data each time, and 154 decision trees are obtained by repeating the training multiple times through bootstrap resampling. The 154 decision trees are used to form a random forest model as an animal milk identification model, wherein the animal milk identification model evaluates the decision results of all decision trees and outputs the final identification result based on the majority principle.

[0021] Furthermore, in the model construction, for each decision tree, a fourth number of types of fatty acid data are selected with replacement as samples at the root node of the decision tree, all available 10 characteristic fatty acids are used for evaluation when each node of the decision tree needs to be split, and the fatty acid that minimizes the node Gini coefficient is selected as the splitting condition of the node of the decision tree; based on the selected characteristic fatty acids, a splitting operation is performed on each node so that each child node contains a portion of the sample data; this process is repeated until each leaf node contains at least 7 samples and reaches a maximum tree depth of 38 or satisfies the condition of a minimum number of samples of 14.

[0022] Furthermore, the sample data of multiple animal milks obtained by data collection are divided into data according to a certain ratio, wherein 70% of the data are used as a training set, 15% of the data are used as a validation set, and 15% of the data are used as a test set; stratified sampling is used to ensure that the proportion of each category in the training set, validation set and test set is reasonable; the synthetic minority oversampling technique (SMOTE) is applied to the training set to deal with the category imbalance problem and maintain the original data distribution of the validation set and the test set; the training set and validation set data are used for feature screening, model construction and optimization, and the constructed animal milk identification model is tested using the test set to evaluate the accuracy and other performance of the animal milk identification model on an independent data set.

[0023] From the principle point of view:

[0024] The fatty acids screened by the present invention have efficient classification performance, which can be explained from the advantages of the calculation method and the types of fatty acids screened. The combination of multiple feature screening methods: This study comprehensively adopts multiple advanced statistical and machine learning methods such as LASSO regression, random forest feature importance and recursive feature elimination for feature selection. These methods each have different advantages and disadvantages, and a single method may lead to the omission of important features or the introduction of noise. The present invention improves the accuracy and reliability of feature selection by combining multiple methods. These 10 fatty acids are complementary to each other, not only covering short-chain fatty acids, medium-chain fatty acids, long-chain fatty acids, saturated fatty acids, monounsaturated fatty acids, polyunsaturated fatty acids, and odd-chain branched fatty acids; there may be a synergistic effect between these 10 fatty acids, and they work together to improve the performance of the classification model. Partial or complete replacement of other fatty acids may break this synergistic relationship, thereby reducing the overall effectiveness of the model.

[0025] Analyzed from the perspective of actual data: see the table below for specific results.

[0026] Performance of the model under different characteristic fatty acids

[0027] Group A Group B Group C Accuracy 1.0 0.9966 1.0 F1 value 1.0 0.9966 1.0 Accuracy 1.0 0.9973 1.0 Recall 1.0 0.9966 1.0 AUC value 1.0 1.0 1.0 Kappa value 1.0 0.9962 1.0

[0028] Note: Group A: indicates that the random forest classification model was constructed based on 88 fatty acids without feature value screening; Group B: indicates that the random forest classification model was constructed based on only 10 fatty acids (C18:1 t11, C22:4 c7c10c13c16, C18:2 c9t11, C18:1 t6, iso C4:0, anteiso C15:0, C10:0, C4:0, C15:0, C6:0) screened by LASSO regression; Group C: indicates that the random forest classification model was constructed based on 10 fatty acids (C10:0, C23:0, C8:0, C7:0, anteiso C15:0, C18:3 c9c12c15, iso C4:0, C18:0, C18:1 t11, C6:0) screened by three algorithms: LASSO regression, random forest feature importance, and recursive feature elimination.

[0029] On the one hand, all fatty acids are used for model construction without screening. The six indicators including accuracy, F1 value, precision, recall rate, AUC value and Kappa value in the training set are all 1, which can achieve good classification effect, but it increases the complexity of calculation.

[0030] On the other hand, the present invention only uses 10 fatty acids (C18:1 t11, C22:4c7c10c13c16, C18:2 c9t11, C18:1 t6, iso C4:0, anteiso C15:0, C10:0, C4:0, C15:0, C6:0) screened by LASSO regression to construct a random forest classification model. At this time, the six indicators of accuracy, F1 value, precision, recall rate, AUC value, and Kappa value on the training set are 0.9966, 0.9966, 0.9973, 0.9966, 1.0, and 0.9962, respectively. At the same time, the 10 fatty acids (C10:0, C23:0, C8:0, C7:0, anteiso C15:0, C18:3 c9c12c15, iso C4:0, C18:0, C18:1 t11, C6:0) to construct a random forest classification model. In the training set, the accuracy, F1 value, precision, recall rate, AUC value, Kappa value and other six indicators are all 1, which can achieve good classification effect, which is consistent with the model effect constructed by all fatty acids, and is better than the effect of constructing a model with characteristic indicators screened by a single method. Two aspects demonstrate that the 10 fatty acids screened by our method are specific and irreplaceable. The 10 fatty acids can represent the full picture of fatty acids and simplify calculations to achieve identification; the 10 fatty acids are irreplaceable, and the characteristic values ​​screened by a single method are different from those of the comprehensive method. Replacing them with a combination of other fatty acids leads to a significant decrease in the performance of the classification model, and the identification effect of the model is not as good as the model constructed by the comprehensive method indicators.

[0031] Compared with the prior art, the outstanding effects of the present invention are:

[0032] (1) There are few studies on animal milk identification based on fatty acids in traditional methods, and the sample size is small and the instrument technology is limited, resulting in a small number and type of fatty acids detected, affecting the robustness and accuracy of the model. The identification method of the present invention is based on the results of a previous study on 88 fatty acid data from 221 samples of 9 animal milks, which guarantees the accuracy of the results to a certain extent.

[0033] (3) Previous studies often used a single feature screening method for feature selection, while the present invention uses 10 characteristic fatty acids that contribute more to classification, ensuring that the screened fatty acid indicators are more representative and can be used to accurately identify samples. These 10 characteristic fatty acids that contribute more to classification were obtained by the research team of the present invention in previous studies by combining LASSO regression, random forest feature importance, and recursive feature elimination for feature selection, and a large number of exploratory experiments have confirmed that they can be accurately and efficiently used for animal milk identification.

[0034] (3) The present invention constructs a random forest algorithm model based on 10 fatty acids to identify animal milk. The results of cross-validation and learning curves show that the model is reliable and does not have overfitting. Through the structure of the validation set and the test set, it provides highly accurate identification results and can achieve accurate identification of animal milk.

[0035] (4) The animal milk identification method based on fatty acids combined with machine learning of the present invention makes full use of machine learning technology and fatty acid composition data, is simple to operate and has low cost. It provides certain technical support for animal milk identification and can be applied to quality control and traceability in the dairy industry. It has significant application value and promotion prospects.

[0036] The animal milk identification method based on 10 kinds of fatty acids and its application according to the present invention are further described below in conjunction with the accompanying drawings and specific examples. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 Schematic diagram of the process of animal milk identification based on 10 fatty acids.

[0038] Figure 2 is the confusion matrix of the test set.

[0039] Figure 3 is the model performance of the training set, validation set, and test set.

[0040] Figure 4 is the contribution of the feature variables to the random forest model.

[0041] Figure 5 are the learning curves for the training set and the validation set. DETAILED DESCRIPTION

[0042] like Figure 1 As shown, a method for identifying animal milk based on 10 fatty acids comprises the following steps:

[0043] 1. Collect milk samples from different animals

[0044] A total of 221 milk samples were collected, including breast milk (n=21) donated by mothers who gave birth to healthy full-term infants and had no metabolic diseases; 200 raw milk samples from eight lactating dairy animals were milk tank milk (4℃) collected when loading from the farm to the dairy factory, Holstein milk (n=28) was collected from 17 provinces or autonomous regions in China, yak milk (n=13) was collected from Gansu Province, buffalo milk (n=41) was collected from Guangxi Zhuang Autonomous Region, goat milk (n=38) was collected from Shandong Province and Shaanxi Province, sheep milk (n=9) was collected from Inner Mongolia Autonomous Region, camel milk (n=49) and horse milk (n=7) were collected from Xinjiang Uygur Autonomous Region, and donkey milk (n=15) was collected from Shandong and Xinjiang, respectively. Tank milk samples can more comprehensively represent the milk quality characteristics of the entire dairy herd, help reduce the influence of individual animal differences, and thus provide more stable and reliable data. All samples were frozen and stored at -20℃ immediately after collection.

[0045] 2. Determination of fatty acid composition of different animal milks

[0046] Animal milk fatty acids were derivatized by methyl esterification and isopropyl esterification, and the fatty acid derivatives were detected by gas chromatography-mass spectrometry to obtain 88 fatty acid data from C1 to C24 of 221 samples of 9 animal milks. The determination was carried out using the method in ZL 202410078865.3 "A method for determining the content of 88 fatty acids in milk and its application".

[0047] 3. Preprocess fatty acid composition data

[0048] The sample data of multiple animal milks obtained by data collection were divided into data according to a certain ratio, of which 70% of the data were used as training sets, 15% of the data were used as validation sets, and 15% of the data were used as test sets. Stratified sampling was used to ensure that the proportion of each category in the training set, validation set, and test set was reasonable. The synthetic minority oversampling technique (SMOTE) was applied to the training set to deal with the class imbalance problem and maintain the original data distribution of the validation set and test set. The training set and validation set data were used for feature screening, model construction and optimization, and the constructed animal milk identification model was tested using the test set to evaluate the accuracy and other performance of the animal milk identification model on an independent data set.

[0049] In this embodiment, the training set (306 sample data, including 34 Holstein cow milk, 34 yak milk, 34 buffalo milk, 34 goat milk, 34 sheep milk, 34 camel milk, 34 donkey milk, 34 horse milk, and 34 human milk), the validation set (34 sample data, including 4 Holstein cow milk, 2 yak milk, 6 buffalo milk, 6 goat milk, 1 sheep milk, 8 camel milk, 3 donkey milk, 1 horse milk, and 3 human milk), and the test set (34 sample data, including 4 Holstein cow milk, 2 yak milk, 6 buffalo milk, 6 goat milk, 1 sheep milk, 8 camel milk, 3 donkey milk, 1 horse milk, and 3 human milk). It should be noted that in this embodiment, the number of samples and the number of fatty acids are only used for illustrative purposes, not for limiting the quantity.

[0050] 4. Use the preprocessed fatty acid data to screen characteristic fatty acids

[0051] In order to establish a model for identifying animal milk, it is first necessary to select important fatty acids for classification and identification from 88 fatty acids. Because at the beginning of model establishment, in order to minimize the model deviation caused by the lack of important independent variables, as many independent variables as possible are usually selected. However, the modeling process needs to find the independent variable set with the strongest explanatory power for the dependent variable, that is, to improve the interpretability and prediction accuracy of the model through independent variable selection. Indicator selection is an extremely important issue in the statistical modeling process. This embodiment selects the lasso regression algorithm (LASSO), the random forest algorithm (RF), and the recursive feature elimination algorithm (RFE) to screen important fatty acids.

[0052] First use LASSO regression: By introducing the L1 regularization term, the number of features is effectively reduced, the stability and interpretability of the model are improved, and it is used for preliminary screening to reduce the dimension of the features. LASSO will apply L1 regularization to the features. A smaller λ value will complicate the model and may lead to overfitting, while a larger λ value will simplify the model and may lead to underfitting. This particular value (about 0.00215) indicates that the regularization strength is weak, allowing the model to retain most of the features instead of shrinking completely to zero. As a result, only those features with non-zero coefficients are retained. Then use random forest feature importance: further evaluate the contribution of the screened features and confirm the most important fatty acids.

[0053] Table 1 Characteristic fatty acids selected by LASSO regression algorithm

[0054]

[0055] Then use random forest: Based on the features selected by LASSO, use random forest to calculate feature importance. Random forest parameters bootstrap: Use the bootstrap sampling method. True means that samples will be drawn with replacement during training. cp_alpha: Minimum complexity pruning parameter, which controls the complexity of the model. A value of 0.0 means no pruning. class_weight: Class weight, used to deal with unbalanced data. None means no class weight is used. criterion: Division criterion, 'gini' means using Gini impurity. max_depth: Maximum depth of the tree. None means that the tree can grow continuously until all leaf nodes are pure. max_features: The number of features considered when splitting each decision node. Here, set it to 'sqrt' to use the square root of the number of features. n_estimators: The number of trees in the forest. Here, set it to 100, which means building 100 trees. random_state: Random seed to ensure the reproducibility of the results. Random forest further selects features by feature importance scores. Here, the SelectFromModel method is used to retain important features above the median.

[0056] Table 2 Characteristic fatty acids selected by random forest algorithm

[0057]

[0058] Finally, recursive feature elimination is applied: Recursive feature elimination is used to fine-tune the feature set to ensure that the features retained are the most helpful to the model. Recursive feature elimination (RFE) parameters: estimator: The base learner used, here is RandomForestClassifier, which is the same as the random forest configuration above. n_features_to_select: The number of features to select, here is 10, which means that only the 10 most important features are retained. step: The number of features to remove in each iteration, here is set to 1, which means that one of the least important features is removed in each iteration. importance_getter: How to get the importance of the feature, set to 'auto' to use the model's default method. The goal of RFE is to improve the performance of the model by repeatedly training and eliminating features to find the most important features for model prediction. Finally, recursive feature elimination is used to perform further feature selection based on the features selected by random forest. By recursively training the model and removing the least important features, the top 10 most important features are finally retained.

[0059] Table 3 Characteristic fatty acids screened by recursive feature elimination algorithm

[0060]

[0061] Accordingly, in this embodiment, 10 important fatty acids (C10:0, C23:0, C8:0, C7:0, anteiso C15:0, C18:3 c9c12c15, iso C4:0, C18:0, C18:1 t11, C6:0) were selected from 88 fatty acid features in the training set according to the lasso regression algorithm (LASSO), random forest algorithm (RF), and recursive feature elimination algorithm (RFE) for construction of the identification model.

[0062] 5. Use the selected characteristic fatty acid data to train and optimize the machine learning model

[0063] After determining the characteristic fatty acids, the present embodiment uses the random forest algorithm to construct an identification model for animal milk based on the relative abundance of these 10 important fatty acids. Through Bayesian optimization, a 5-fold cross-validation is performed on the validation set. By evaluating the model on different subsets and selecting the next search direction according to the results of each tuning, the optimal hyperparameter combination is determined to establish an identification model for 9 kinds of animal milk. Among them, during Bayesian optimization, a set of hyperparameter spaces is defined, where n_estimators: the number of trees in the random forest. Increasing the number of trees usually improves the performance of the model, but also increases the computational cost. The range set here is 50 to 300. max_depth: the maximum depth of each tree. Limiting the depth of the tree can prevent overfitting. The range is 5 to 50. The greater the depth, the higher the complexity of the model and the potential risk of overfitting.

[0064] min_samples_split: Minimum number of samples required to split at an internal node. Higher values ​​prevent the tree from growing too complex and generally help reduce overfitting. The range is 2 to 20. min_samples_leaf: Minimum number of samples required for each leaf node. Increasing this value will make the model more conservative and help avoid overfitting. The range is 1 to 20. ax_features: Maximum number of features considered at each split. Choosing fewer features can help reduce model complexity and improve generalization. Optional values ​​include 'sqrt' (square root of the number of features), 'log2' (logarithm of the number of features), or unlimited (None). bootstrap: Whether to use bootstrap sampling when training the tree. When set to True, each tree will be trained on a random subset of the original data, which generally improves the stability of the model. The results of Bayesian optimization show that the best parameter combinations for the random forest model are bootstrap: use the bootstrap method (True); max_depth: the maximum tree depth is 38; max_features: all features are used for each split (None); min_samples_leaf: the minimum number of samples for each leaf node is 7; min_samples_split: the minimum number of samples required for internal splits is 14; n_estimators: 154 trees. These parameters are the settings that the model performs best in cross-validation.

[0065] Therefore, the specific training process of the random forest model can be described as follows: there are 306 sample data in the training set, and 306 sample data are randomly selected with replacement for training each decision tree by randomly selecting one sample data each time. For each decision tree, 306 sample data are selected with replacement as the sample at the root node of the decision tree, and all 10 available characteristic fatty acids are used for evaluation when each node of the decision tree needs to be split, and the fatty acid with the smallest node Gini coefficient is selected as the splitting condition of the node of the decision tree. According to the selected characteristic fatty acid, a split operation is performed on each node so that each child node contains a part of the sample data. This process is repeated until each leaf node contains at least 7 samples and reaches a maximum tree depth of 38 or satisfies the condition of a minimum number of samples of 14. Repeat the training multiple times by the self-help resampling method to obtain 154 decision trees, and use the 154 decision trees to form a random forest model as an animal milk identification model, wherein the animal milk identification model evaluates the decision results of all decision trees and outputs the final identification results based on the majority principle.

[0066] 6. Identification of animal milk

[0067] In order to evaluate the accuracy of the model on the test set, this example uses the trained random forest model based on 10 fatty acids to identify and predict the animal milk source of samples in the test set. The identification results are as follows: Figure 2 The confusion matrix of the test set shows that the classification accuracy of the nine animal milks reaches 100%.

[0068] 7. Model performance evaluation

[0069] In order to further ensure the robustness of the model, this embodiment uses the trained random forest model on the training set, performs 5-fold cross validation, tests the performance of the random forest model on the validation set and the test set, and statistically evaluates the accuracy, F1 value, Kappa value, Precision value, Recall value, and ROC_AUC value for model evaluation. The specific model performance results are shown in Figure 3 shown.

[0070] The results of cross-validation of the training set show that the accuracy, F1-score, Kappa, precision, recall, and AUC values ​​all reach 100%, indicating that the constructed model is stable and has good generalization ability ( Figure 3 ). indicates that the model fits the training set perfectly. This means that the model can predict the training data well, but there is also a potential risk of overfitting. Therefore, we plotted a learning curve showing how the training error and validation error change with the number of training samples ( Figure 5 ). The results show that when the training set is small, the validation error is significantly higher than the training error, but as the amount of data increases, the gap between the two is narrowing and eventually becoming close. This shows that the model does not have serious overfitting. Further, we evaluated the model on the validation set and the test set. The evaluation results of the validation set also performed very well. Although not as perfect as the training set, they are still very close, especially the accuracy is 0.97, the F1 score is 0.97, the precision is 0.98, the recall rate is 0.97, and the AUC reaches 1.0 ( Figure 3 ). This shows that the model has extremely high generalization ability on the validation set. Although the performance is slightly lower than the training set, it does not show obvious overfitting. Further, we evaluated the model on the test set. The evaluation results of the test set are exactly the same as those of the training set, indicating that the model also performs very well on the independent test set and can predict new data well. All indicators of the test set also reach 1.0, which further shows that the overall performance of the model is very robust ( Figure 3 ).

[0071] 8. Ranking of contribution of characteristic variables in the model

[0072] The contribution of the 10 characteristic fatty acids in the model is ranked as follows: C10:0, C23:0, C8:0, C7:0, anteiso C15:0, C18:3 c9c12c15, iso C4:0, C18:0, C18:1 t11, and C6:0; among them, the contribution of each fatty acid to this classification prediction model is relatively uniform, among which C10:0, C23:0, and C8:0 are the three fatty acids with the most significant contributions ( Figure 4 ).

[0073] In summary, the present invention uses LASSO regression, random forest feature importance and recursive feature elimination in turn in the previous study, and finally selects 10 key fatty acids for distinguishing 9 kinds of animal milk, including C10:0, C23:0, C8:0, C7:0, anteiso C15:0, C18:3 c9c12c15, iso C4:0, C18:0, C18:1 t11, C6:0. Then, the 10 key features are used to train the random forest model to build a classifier through Bayesian optimization, and an identification model for 9 kinds of animal milk is established. The results show that the present invention screens out 10 differential fatty acids that contribute more to the classification, and the constructed model can quickly and accurately identify animal milk, which is simple to operate and low in cost, and provides certain technical support for animal milk identification, which is suitable for quality control and traceability in the dairy production process, and has broad application prospects.

[0074] The embodiments described above are merely descriptions of preferred implementation modes of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.

Claims

1. A method for identifying animal milk based on 10 fatty acids, characterized in that: The following steps are involved: (1) Derivatizing animal milk fatty acids by methyl esterification and isopropyl esterification, detecting fatty acid derivatives by gas chromatography-mass spectrometry, and obtaining the relative content of characteristic fatty acids from the sample to be tested, wherein the characteristic fatty acids are C10:0, C23:0, C8:0, C7:0, anteiso C15:0, C18:3 c9c12c15, iso C4:0, C18:0, C18:1 t11, and C6:0; (2) constructing an animal milk identification model, using the relative contents of the acquired characteristic fatty acids to obtain an identification result indicating that the sample to be tested is Holstein cow milk, yak milk, buffalo milk, goat milk, sheep milk, camel milk, donkey milk, horse milk, or human milk; wherein the animal milk identification model is constructed using a random forest algorithm using the relative contents of C1 to C24 fatty acids of multiple groups of samples of Holstein cow milk, yak milk, buffalo milk, goat milk, sheep milk, camel milk, donkey milk, horse milk, and human milk; The method for constructing the animal milk identification model is: ① Feature screening: The fatty acid data obtained from the data, i.e., the first training data set, is subjected to dimensionality reduction processing using a combination of the lasso regression algorithm, the random forest algorithm, and the recursive feature elimination algorithm to obtain the second training data set, the third training data set, and the fourth training data set in turn; The fatty acid abundance data in the first training data set is preliminarily screened using the lasso regression algorithm, and a group of characteristic fatty acids with non-zero coefficients are screened out by introducing L1 regularization, thereby reducing the characteristic dimension, obtaining a second number of types of fatty acid data, and generating a second training data set; On the basis of the second training data set, the random forest algorithm is further used through the SelectFromModel method to retain fatty acids with feature importance scores above the median, further simplify the data dimension, ensure that the characteristic metabolites finally retained have a high classification contribution, obtain the third number of types of fatty acid data, and generate the third training data set; On the basis of the third training data set, a recursive feature elimination algorithm is further applied to gradually remove fatty acids with lower contribution, and finally a fourth number of types of fatty acid data are retained to generate a fourth training data set; The first training data set includes multiple sample data of 9 kinds of animal milk, and the sample data includes content data of a first number of types of fatty acids; specifically includes 88 kinds of fatty acids measured, namely C1:0, C2:0, C3:0, isoC4:0, C4:0, iso C5:0, anteiso C5:0, C5:0, iso C6:0, C6:0, C7:0, C8:0, C9:0, C10:0, C10:1c4, C10:1 c3, C10:1 c9, C11:0, C12:0, C12:1 c5, C13:0 iso, C13:1 c11, anteiso C13:0, C13:0, iso C14:0, C14:0, iso C15:0, C15:1 t9, anteiso C15:0, C14:1 c9, C15:0, isoC16:0, C15:1 t10, C15:1 c10, C16:0, C16:1 t9, iso C17:0, C16:1 c7, C16:1 c9, anteisoC17:0, C17:0, C17:1 t10, iso C18:0, C17:1 c10, C18:0, C18:1 t6, C18:1 t9, C18:1 t11, C18:1 c6, C18:1 c9, C18:1 c11, C18:1 c12, C18:2 t9t12, C18:2 c9t12, C18:2 t9c12, C19:1 t7, C19:1 t10, C18:2 c9c12, C19:1 c10, C20:0, C18:3 c6c9c12, C20:1 t11, C18:3c9c12c15, C20:1 c8, C20:1 c11, C18:2 c9t11, C18:2 t10c12, C18:2 c9c11, C21:0, C18:4c6c9c12c15, C18:2 t9t11, C20:2 c11c14, C22:0, C20:3 c8c11c14, C22:1 t13, C20:3c11c14c17, C22:1 c13, C20:4 c5c8c11c14, C23:0, C22:2 c13c16, C20:5 c5c8c11c14c17, C24:0, C22:3 c13c16c19, C24:1 c15, C22:4 c7c10c13c16, C22:5 c4c7c10c13c16, C22:5c7c10c13c16c19, C22:6 c4c7c10c13c16c19; The second training data set includes sample data of a first number of types reduced in dimension by a lasso regression algorithm, and each of the reduced-dimensional sample data includes fatty acid data of a second number of types screened from the first number of types of fatty acids; specifically, it includes 60 characteristic fatty acids screened by the LASSO regression algorithm, namely C6:0, C15:0, C4:0, C10:0, anteiso C15:0, iso C4:0, C18:1 t6, C18:2 c9t11, C22:4 c7c10c13c16, C20:0, C18:1t11, C13:0, C20:2 c11c14, C5:0, C18:3 c9c12c15, C16:1 c7, C14:0, iso C17:0, iso C16:0, iso C6:0, C16:1 c9, C18:2 t9t12, C22:4 c7c10c13c16, t9, C8:0, iso C14:0, C20:1 c8, C7:0, C18:1c9, C18:1 c11, C14:1 c9, C18:1 c6, anteiso C13:0, C12:0, C22:3 c13c16c19, C16:0, isoC15:0, C17:0, C20:3 c8c11c14, C18:2 c9c11, C20:5 c5c8c11c14c17, C2:0, C20:1 t11, C22:5 c4c7c10c13c16, C1:0, anteiso C17:0, C18:3 c6c9c12, C15:1 t10, iso C5:0, C18:2t10c12, C18:0, C23:0, C9:0, C24:1 c15, C15:1 c10, C18:1 c12, C22:1 c13, C18:2 t9c12, C22:2 c13c16, iso C18:0, C3:0; The third training data set includes sample data of a second number of types reduced in dimension by a random forest algorithm, and each of the reduced in dimension sample data includes fatty acid data of a third number of types screened from the second number of types of fatty acids; specifically includes 30 characteristic fatty acids screened by the random forest algorithm, namely iso C4:0, C10:0, C7:0, C23:0, C8:0, C18:0, C18:3 c9c12c15, C17:0, anteiso C15:0, C16:1 c9, C15:0, C20:1 t11, iso C14:0, C9:0, C18:1 t11, C14:1 c9, C18:1 c12, C6:0, C3:0, C16:1 t9, anteiso C17:0, C12:0, C4:0, C16:1 c7, C5:0, iso C17:0, C18:0, C22:5 c4c7c10c13c16, C15:1 t10, C20:2 c11c14; The fourth training data set includes a third number of types of sample data reduced in dimension by a recursive feature elimination algorithm, and each of the reduced-dimensional sample data includes a fourth number of types of fatty acid data screened from the third number of types of fatty acids; specifically, it includes 10 characteristic fatty acids screened by the recursive feature algorithm, namely C10:0, C23:0, C8:0, C7:0, anteiso C15:0, C18:3 c9c12c15, iso C4:0, C18:0, C18:1 t11, and C6:0; ② Model construction: using the random forest algorithm, using the fourth training data set to train multiple decision trees to construct a random forest model as an animal milk identification model; In the fourth training data set, a fourth number of types of fatty acid data are selected with replacement for training each decision tree by randomly selecting a sample data each time, and 154 decision trees are obtained by repeating the training multiple times by bootstrap resampling, and a random forest model is formed using the 154 decision trees as an animal milk identification model, wherein the animal milk identification model evaluates the decision results of all decision trees and outputs a final identification result based on the majority principle; For each decision tree, the fourth number of types of fatty acid data are selected with replacement as the samples at the root node of the decision tree, all available 10 characteristic fatty acids are used for evaluation when each node of the decision tree needs to be split, and the fatty acid that minimizes the node Gini coefficient is selected as the splitting condition of the node of the decision tree; according to the selected characteristic fatty acids, a splitting operation is performed on each node so that each child node contains a part of the sample data; this process is repeated until each leaf node contains at least 7 samples and reaches a maximum tree depth of 38 or meets the condition of a minimum number of samples of 14.

2. The animal milk identification method based on 10 fatty acids according to claim 1, characterized in that: The sample data of multiple animal milks obtained during data collection are divided into data according to a certain ratio, wherein 70% of the data are used as a training set, 15% of the data are used as a validation set, and 15% of the data are used as a test set; stratified sampling is used to ensure that the proportion of each category in the training set, validation set, and test set is reasonable; the synthetic minority group oversampling technique is applied to the training set to deal with the category imbalance problem and maintain the original data distribution of the validation set and the test set; the training set and validation set data are used for feature screening, model construction and optimization, and the constructed animal milk identification model is tested using the test set to evaluate the accuracy of the animal milk identification model on an independent data set.

3. Application of the animal milk identification method based on 10 fatty acids according to claim 1 or 2 in animal milk identification.

Citation Information

Patent Citations

  • Method for determining contents of 88 fatty acids in milk and application of method

    CN117607320A

  • Identification model and method for identifying camel milk based on Raman spectrum and machine learning algorithm

    CN115586172A

  • Method for identifying whether other animal milk is doped in counterfeit camel milk or camel milk

    CN116660443A