A method for detecting milk yield anomaly of a dairy cow based on big data analysis
By using big data analysis and neural network models, abnormal milk production in dairy cows can be detected automatically, solving the problems of low efficiency and poor accuracy of manual detection, and achieving efficient and accurate detection of abnormal milk production in dairy cows.
Patent Information
- Application Number
- CN202311142170.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-05
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2043-09-05
AI Technical Summary
Current methods for detecting abnormal milk production in dairy cows rely on manual statistics, which are costly, inefficient, and inaccurate, and cannot provide in-depth data analysis, resulting in low detection accuracy.
By employing a big data analytics approach, a big data model is constructed by tracking historical vital signs and milk production data of dairy cows. The model is then trained using neural network algorithms to detect abnormalities in dairy cow health and milk production. This is combined with principal component analysis, K-means clustering, and neural network algorithms to achieve automated detection.
It reduces labor costs, improves the accuracy and efficiency of detection, and is suitable for automated anomaly detection in large-scale farms.
Smart Images

Figure CN117093574B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of dairy farming technology, specifically relating to a method for detecting abnormal milk production in dairy cows based on big data analysis. Background Technology
[0002] As a commercially raised animal with mature breeding techniques, dairy cows have evolved into a large-scale industry encompassing systematic insemination, reproduction, raising, and milk production, with strict management at every stage from birth to death. Healthy cows produce high-quality milk, constantly influencing the economic performance of dairy farms.
[0003] Milk production is a key metric for dairy farm managers, as it not only affects the farm's revenue for the current quarter but also its breeding plans for the next quarter. Therefore, accurately analyzing and monitoring milk production has become a key research area in this field.
[0004] Existing methods for detecting abnormal milk production in dairy cows mostly rely on staff to manually collect and analyze the milk production data of each cow based on their experience. This method involves high labor costs, a large workload, and low detection efficiency. Furthermore, this method only analyzes the surface information of the data and cannot accurately detect abnormal data. It is also prone to misjudging normal data, resulting in poor accuracy and low practicality in detecting abnormal milk production in dairy cows. Summary of the Invention
[0005] To address the problems of high labor costs, poor accuracy, and low practicality in existing technologies, this invention aims to provide a method for detecting abnormal milk production in dairy cows based on big data analysis.
[0006] The technical solution adopted in this invention is as follows:
[0007] A method for detecting abnormal milk yield in dairy cows based on big data analysis includes the following steps:
[0008] We tracked and collected historical vital signs data and corresponding historical milk yield data of several dairy cows at each milk production stage, and constructed dairy cow health monitoring big data and dairy cow milk yield abnormality detection big data with time sequence based on the historical basic information data, historical vital signs data and historical milk yield data of several dairy cows.
[0009] Clustering and screening of big data on dairy cow health monitoring and big data on abnormal milk yield monitoring were performed to construct training sample sets for dairy cow health monitoring and abnormal milk yield monitoring.
[0010] A dairy cow health detection model was constructed by training a neural network algorithm based on a training sample set of dairy cow health detection.
[0011] Based on the sample set of abnormal milk production in dairy cows, a neural network algorithm was used to train and construct an abnormal milk production detection model for dairy cows.
[0012] Based on the real-time basic information data, real-time vital signs data and real-time milk production data of the target dairy cow at the current milk production stage, real-time dairy cow health monitoring data and real-time dairy cow milk production abnormality detection data are constructed.
[0013] Real-time dairy cow health monitoring data is input into the dairy cow health monitoring model to monitor dairy cow health and obtain the real-time health monitoring results of the target dairy cow.
[0014] Add the real-time health monitoring results of the target cow to the corresponding real-time abnormal milk production monitoring data to obtain the updated real-time abnormal milk production monitoring data.
[0015] The updated real-time abnormal milk yield detection data of dairy cows is input into the abnormal milk yield detection model of dairy cows to detect abnormal milk yield and obtain the real-time abnormal milk yield detection results of the target dairy cows.
[0016] Visualize the health prediction results and abnormal milk production detection results of the target dairy cows.
[0017] Furthermore, the types of historical / real-time basic information data include the breed, age, and milk production stage of the dairy cows; the types of historical / real-time vital signs data include the pulse, body temperature, blood pressure, activity level, and health status of the dairy cows; and the types of historical / real-time milk production data include total milk production, single milk production, and milk production details.
[0018] Furthermore, historical vital sign data and corresponding historical milk yield data of several dairy cows at each milk production stage are tracked and collected. Based on the historical basic information data, historical vital sign data, and historical milk yield data of several dairy cows, a big data system for dairy cow health monitoring and a big data system for detecting abnormal milk yields with time-series relationships are constructed, including the following steps:
[0019] The historical basic information data of each dairy cow at each milk production stage is added to the corresponding historical vital sign data to obtain several historical dairy cow health test data. Based on the several historical dairy cow health test data, a historical dairy cow health test data group with time sequence relationship is obtained.
[0020] By traversing the historical vital signs data of all dairy cows at each milk production stage, a large dataset of dairy cow health testing data is obtained, consisting of several historical dairy cow health testing data sets.
[0021] Add the historical basic information data and historical health status tags of each cow at each milk production stage to the corresponding historical milk production data to obtain several historical milk production data. Based on these historical milk production data, obtain a group of historical cow milk production anomaly detection data with time sequence relationship.
[0022] By iterating through the historical milk production data of all dairy cows at each milk production stage, a large dataset of abnormal milk production detection for dairy cows is obtained, consisting of several sets of historical abnormal milk production detection data.
[0023] Furthermore, the historical dairy cow health monitoring data set with temporal relationships includes several historical dairy cow health monitoring data sets sorted according to milk production stage;
[0024] Historical dairy cow health monitoring data includes historical breed data, historical age data, historical milk production stage labels, historical pulse data, historical body temperature data, historical blood pressure data, historical exercise data, and historical health status labels.
[0025] The historical dairy cow milk yield anomaly detection data set with time sequence relationship includes several historical dairy cow milk yield anomaly detection data sorted by milk production stage;
[0026] Historical data on abnormal milk production from dairy cows includes historical breed data, historical age data, historical milk production stage labels, historical health status labels, historical total milk production data, historical single-yield milk production data, and historical milk production status labels.
[0027] Furthermore, clustering and filtering are performed on the big data from dairy cow health monitoring and the big data from abnormal milk yield detection to construct training sample sets for dairy cow health monitoring and abnormal milk yield detection, including the following steps:
[0028] Principal component analysis was used to reduce the dimensionality of each historical dairy cow health test data set in the dairy cow health test big data, resulting in a dimensionality-reduced dairy cow health test big data set consisting of several dimensionality-reduced historical dairy cow health test data sets and the corresponding dairy cow health test principal component factors.
[0029] The K-means clustering algorithm was used to cluster several groups of historical dairy cow health test data in the dimensionality-reduced dairy cow health test big data to obtain several first cluster centers.
[0030] Within a preset distance threshold range for each first cluster center, the same number of historical dairy cow health test data groups are selected as corresponding dairy cow health test training samples to obtain the dairy cow health test training sample set.
[0031] The K-means clustering algorithm was used to cluster several historical abnormal milk production detection data sets of dairy cows to obtain several secondary cluster centers;
[0032] The historical milk yield anomaly detection data group outside the preset distance threshold range of each second cluster center is regarded as outlier, and the historical milk yield anomaly detection data group within the preset distance threshold range is regarded as cluster point;
[0033] Collect all outliers, label the historical milk production data of the outliers as abnormal, and filter the clusters with the same number of outliers based on the number of outliers, label the historical milk production data of the outliers as normal.
[0034] All outliers and selected cluster points were used as training samples for detecting abnormal milk production in dairy cows, thus obtaining the training sample set for detecting abnormal milk production in dairy cows.
[0035] Furthermore, based on the training sample set for dairy cow health monitoring, a neural network algorithm is used to train and construct a dairy cow health monitoring model, including the following steps:
[0036] Normalize several sets of historical dairy cow health test data after dimensionality reduction from the training sample set of dairy cow health test to obtain the first normalized training sample set.
[0037] Based on the normalized first training sample set, the DBN-Dropout algorithm is used to train and obtain the dairy cow health detection model.
[0038] Furthermore, based on the sample set of abnormal milk yield detection in dairy cows, a neural network algorithm is used for training to construct an abnormal milk yield detection model in dairy cows, including the following steps:
[0039] Normalize several historical abnormal milk production detection data sets of dairy cows in the abnormal milk production detection sample set to obtain the normalized second training sample set.
[0040] Based on the normalized second training sample set, the BiGRU-Attention algorithm is used for training to obtain a sub-model for predicting abnormal milk production in dairy cows, as well as the corresponding set of original historical milk production label prediction values and the set of original historical prediction errors.
[0041] Based on the original set of predicted values for historical milk production and the original set of historical prediction errors, the KELM algorithm is used to train and obtain a prediction error correction sub-model.
[0042] By integrating the sub-model for predicting abnormal milk production in dairy cows and the sub-model for correcting prediction errors, an abnormal milk production detection model for dairy cows is obtained.
[0043] Furthermore, the real-time dairy cow health monitoring data includes the target dairy cow's real-time breed data, real-time age data, real-time milk production stage label, real-time pulse data, real-time body temperature data, real-time blood pressure data, and real-time exercise data;
[0044] Real-time abnormal milk production detection data for dairy cows includes real-time breed data, real-time age data, real-time milk production stage label, real-time total milk production data, and real-time single milk production data for the target dairy cow.
[0045] The updated real-time abnormal milk production detection data for dairy cows includes the original real-time abnormal milk production detection data and the corresponding real-time health detection results.
[0046] Furthermore, real-time dairy cow health monitoring data is input into the dairy cow health monitoring model to perform dairy cow health monitoring, obtaining the real-time health monitoring results of the target dairy cow, including the following steps:
[0047] The real-time dairy cow health monitoring data was dimensionality reduced based on the principal component factors of the dairy cow health monitoring data to obtain the dimensionality-reduced real-time dairy cow health monitoring data.
[0048] The dimensionality-reduced real-time dairy cow health monitoring data is input into the dairy cow health monitoring model to monitor the dairy cow's health and obtain the real-time health status label prediction value, which is the real-time health monitoring result of the target dairy cow.
[0049] Furthermore, the updated real-time milk yield anomaly detection data of dairy cows is input into the dairy cow milk yield anomaly detection model to detect anomalies in milk yield, and the real-time milk yield anomaly detection results of the target dairy cows are obtained, including the following steps:
[0050] The updated real-time abnormal milk yield detection data of dairy cows is input into the abnormal milk yield prediction sub-model of the abnormal milk yield detection model to predict abnormal milk yield, and the original real-time milk yield label prediction value and the original real-time prediction error are obtained.
[0051] The original real-time milk yield label prediction value and the original real-time prediction error are input into the prediction error correction sub-model of the dairy cow milk yield anomaly detection model to correct the prediction error and obtain the corrected real-time prediction error.
[0052] Based on the original real-time milk yield label prediction value and the corrected real-time prediction error, the final real-time milk yield label prediction value is obtained, which is the real-time milk yield anomaly detection result of the target dairy cow.
[0053] The beneficial effects of this invention are as follows:
[0054] This invention provides a method for detecting abnormal milk production in dairy cows based on big data analysis. By learning and analyzing massive amounts of data through big data analysis technology, it avoids manual data detection, reduces labor costs and workload, and takes into account the potential impact of factors such as breed, age, lactation stage, and health status of dairy cows on milk production. It uses a neural network model to mine the deep relationship between data and milk production data, improving the accuracy, automation, detection efficiency, and practicality of anomaly detection, making it more suitable for large-scale farm applications.
[0055] Other beneficial effects of the present invention will be further explained in the specific embodiments. Attached Figure Description
[0056] Figure 1 This is a flowchart of the method for detecting abnormal milk production in dairy cows based on big data analysis in this invention. Detailed Implementation
[0057] The present invention will be further explained below with reference to the accompanying drawings and specific embodiments.
[0058] Example 1:
[0059] like Figure 1 As shown in the figure, this embodiment provides a method for detecting abnormal milk production in dairy cows based on big data analysis, including the following steps:
[0060] We tracked and collected historical vital signs data and corresponding historical milk yield data of several dairy cows at each milk production stage, and constructed dairy cow health monitoring big data and dairy cow milk yield abnormality detection big data with time sequence based on the historical basic information data, historical vital signs data and historical milk yield data of several dairy cows.
[0061] The types of historical basic information data include the breed, age, and milk production stage of the dairy cows; the types of historical vital signs data include the pulse, body temperature, blood pressure, activity level, and health status of the dairy cows; and the types of historical milk production data include total milk production, single milk production, and milk production details.
[0062] Taking into account the impact of factors such as cow breed, age, milk production stage, and health condition on milk production, and setting the time series of data according to milk production stage, the data ensures the temporal continuity between data, which can more accurately reflect the changes in the health condition and milk production of cows, and closely reflect the real individual differences and overall trends.
[0063] Includes the following steps:
[0064] The historical basic information data of each dairy cow at each milk production stage is added to the corresponding historical vital sign data to obtain several historical dairy cow health test data. Based on the several historical dairy cow health test data, a historical dairy cow health test data group with time sequence relationship is obtained.
[0065] The historical dairy cow health monitoring data set with time sequence includes several historical dairy cow health monitoring data sorted by milk production stage;
[0066] Historical dairy cow health monitoring data includes historical breed data, historical age data, historical milk production stage labels, historical pulse data, historical body temperature data, historical blood pressure data, historical exercise data, and historical health status labels.
[0067] By traversing the historical vital signs data of all dairy cows at each milk production stage, a large dataset of dairy cow health testing data is obtained, consisting of several historical dairy cow health testing data sets.
[0068] Add the historical basic information data and historical health status tags of each cow at each milk production stage to the corresponding historical milk production data to obtain several historical milk production data. Based on these historical milk production data, obtain a group of historical cow milk production anomaly detection data with time sequence relationship.
[0069] The historical dairy cow milk yield anomaly detection data set with time sequence relationship includes several historical dairy cow milk yield anomaly detection data sorted by milk production stage;
[0070] Historical abnormal milk production data for dairy cows includes historical breed data, historical age data, historical milk production stage labels, historical health status labels, historical total milk production data, historical single milk production data, and historical milk production status labels.
[0071] By iterating through the historical milk production data of all dairy cows at each milk production stage, a large dataset of abnormal milk production detection of dairy cows is obtained, consisting of several sets of historical abnormal milk production detection data.
[0072] Clustering and filtering of big data from dairy cow health monitoring and abnormal milk yield detection to construct training sample sets for dairy cow health monitoring and abnormal milk yield detection includes the following steps:
[0073] Principal component analysis was used to reduce the dimensionality of each historical dairy cow health monitoring dataset in the dairy cow health monitoring big data, resulting in a dimensionality-reduced dairy cow health monitoring big data consisting of several dimensionality-reduced historical dairy cow health monitoring datasets and corresponding principal component factors of dairy cow health monitoring. The steps included:
[0074] The historical dairy cow health monitoring data is grouped into a historical dairy cow health monitoring data matrix X = [Xi [i = 1, 2, ..., n] T X i Let X be a row vector containing the historical health monitoring data of the i-th cow, where X... i ={x i (k), i=1,2,...,n,k=1,2,...,m}, where n is the total number of historical dairy cow health test data sets, i is the dairy cow indicator, k is the data factor indicator in the historical dairy cow health test data, representing the historical breed data, historical age data, historical milk production stage label, historical pulse data, historical body temperature data, historical blood pressure data, historical exercise data, and historical health status label of the dairy cow, respectively, and m is the total number of data factors;
[0075] The transformation matrix P for constructing the historical dairy cow health monitoring data matrix is given by the following formula:
[0076]
[0077] In the formula, D is the covariance matrix of the principal component matrix Y; Y is the principal component matrix; P is the transformation matrix; and E is the unit eigenvector matrix.
[0078] Based on the historical dairy cow health monitoring data matrix X and the corresponding transformation matrix P, obtain the principal component matrix Y = [Y]. i [i = 1, 2, ..., n] T Y i The formula for the row vectors of the candidate principal components is:
[0079] Y = PX
[0080] Based on the cumulative variance contribution rate of all candidate principal components, if it exceeds 85%, then the corresponding b≤n candidate principal components are selected as principal components, as shown in the formula:
[0081]
[0082] In the formula, λ i ρ represents the variance of the candidate principal components; L represents the cumulative contribution rate of variance; b represents the number of principal components.
[0083] By using principal component analysis to remove non-critical data factors from historical dairy cow health monitoring data, data dimensionality reduction was achieved, improving model building efficiency and anomaly detection efficiency.
[0084] Based on principal components, dimensionality reduction is performed on each historical dairy cow health monitoring dataset in the big data of dairy cow health monitoring, resulting in several dimensionality-reduced historical dairy cow health monitoring datasets X'. i ={x' iThe dimension-reduced big data for dairy cow health monitoring, consisting of {(k), i=1,2,...,n-1,k=1,2,...,b}, is X'={X' i The data consists of b principal component factors for cow health testing, i = 1, 2, ..., n.
[0085] The K-means clustering algorithm was used to cluster several groups of historical dairy cow health test data in the dimensionality-reduced dairy cow health test big data to obtain several first cluster centers.
[0086] Within a preset distance threshold range for each first cluster center, the same number of historical dairy cow health test data groups are selected as corresponding dairy cow health test training samples to obtain the dairy cow health test training sample set.
[0087] Because the health status types corresponding to the health monitoring data set are diverse, in order to balance the learning effect among samples, the sample data of all health status types are unified to ensure that the subsequent model can accurately learn the data features of each health status type, thereby improving the prediction accuracy of the dairy cow health monitoring model.
[0088] The K-means clustering algorithm was used to cluster several historical abnormal milk production detection data sets of dairy cows to obtain several secondary cluster centers;
[0089] The historical milk yield anomaly detection data group outside the preset distance threshold range of each second cluster center is regarded as outlier, and the historical milk yield anomaly detection data group within the preset distance threshold range is regarded as cluster point;
[0090] Collect all outliers, label the historical milk production data of the outliers as abnormal, and filter the clusters with the same number of outliers based on the number of outliers, label the historical milk production data of the outliers as normal.
[0091] All outliers and selected cluster points were used as training samples for detecting abnormal milk production in dairy cows, thus obtaining the training sample set for detecting abnormal milk production in dairy cows.
[0092] Since there are few samples of abnormal milk production data for dairy cows, and most of them are outliers, in order to balance the learning effect between samples and avoid the abnormal milk production data of normal dairy cows affecting the model's learning of abnormal milk production data, all milk production data types are unified, which improves the prediction accuracy of the subsequent abnormal milk production detection model.
[0093] Based on the training sample set for dairy cow health monitoring, a dairy cow health monitoring model is constructed using a neural network algorithm, including the following steps:
[0094] Normalize several sets of historical dairy cow health test data after dimensionality reduction from the training sample set of dairy cow health test to obtain the first normalized training sample set.
[0095] Based on the normalized first training sample set, the Deep Belief Networks (DBN)-Dropout algorithm was used to train and obtain the dairy cow health detection model.
[0096] As a deep learning algorithm, the DBN model can uncover the deep relationship between dairy cow health monitoring data and health status categories. By changing the structure of the hidden layer, it can learn from the data and accurately output the corresponding health status label prediction value when new dairy cow health monitoring data is input.
[0097] Based on the sample set of abnormal milk production detection in dairy cows, a neural network algorithm is used to train and construct a model for detecting abnormal milk production in dairy cows, including the following steps:
[0098] Normalize several historical abnormal milk production detection data sets of dairy cows in the abnormal milk production detection sample set to obtain the normalized second training sample set.
[0099] Based on the normalized second training sample set, the Bidirectional Recurrent Neural Network (BiGRU)-Attention algorithm is used for training to obtain a dairy cow milk production anomaly prediction sub-model, as well as the corresponding original set of historical milk production label prediction values and the original set of historical prediction errors.
[0100] BiGRU networks utilize forward and backward BiGRU networks to learn the features of abnormal milk production detection data from dairy cows. By constructing a two-layer BiGRU structure, the extracted features are fully learned, capturing the bidirectional information flow of the dataset and learning the dynamic change patterns of the features.
[0101] The Attention mechanism mimics the intrinsic process of biological observation activities. It is a mechanism that imitates cognitive attention, quickly filtering out high-value information from a large amount of information. Its core idea is to rationally allocate weights, that is, to give greater weight to important information in order to more rationally change external attention to information, ignore irrelevant information, and amplify the information needed. The Attention mechanism is introduced to assign weights to the hidden layer outputs of the BiGRU network, reducing information loss caused by excessive time sequence, and highlighting the influence of strongly correlated features while reducing the influence of weakly correlated features.
[0102] Based on the original set of predicted values for historical milk production and the original set of historical prediction errors, the Kernel Based Extreme Learning Machine (KELM) algorithm is used to train a prediction error correction sub-model.
[0103] The KELM model is an improved algorithm based on Extreme Learning Machine (ELM) and combined with kernel functions. The KELM model can improve the prediction performance of the model while retaining the advantages of the ELM model, optimize the prediction error, and improve the accuracy of the predicted values of milk production labels.
[0104] By integrating the abnormal milk yield prediction sub-model and the prediction error correction sub-model, an abnormal milk yield detection model for dairy cows is obtained.
[0105] Based on the real-time basic information data, real-time vital signs data and real-time milk production data of the target dairy cow at the current milk production stage, real-time dairy cow health monitoring data and real-time dairy cow milk production abnormality detection data are constructed.
[0106] The types of real-time basic information data include the breed, age, and milk production stage of the dairy cow; the types of real-time vital signs data include the pulse, body temperature, blood pressure, activity level, and health status of the dairy cow; and the types of real-time milk production data include total milk production, single milk production, and milk production details.
[0107] Real-time dairy cow health monitoring data includes real-time breed data, real-time age data, real-time milk production stage label, real-time pulse data, real-time body temperature data, real-time blood pressure data, and real-time exercise data of the target dairy cow;
[0108] Real-time abnormal milk production detection data for dairy cows includes real-time breed data, real-time age data, real-time milk production stage label, real-time total milk production data, and real-time single milk production data for the target dairy cow.
[0109] Real-time dairy cow health monitoring data is input into the dairy cow health monitoring model to monitor dairy cow health and obtain the real-time health monitoring results of the target dairy cow.
[0110] Add the real-time health monitoring results of the target cow to the corresponding real-time abnormal milk production monitoring data to obtain the updated real-time abnormal milk production monitoring data.
[0111] The updated real-time abnormal milk production detection data for dairy cows includes the original real-time abnormal milk production detection data for dairy cows and the corresponding real-time health detection results;
[0112] The updated real-time milk yield anomaly detection data of dairy cows is input into the dairy cow milk yield anomaly detection model to detect anomalies in milk yield, and the real-time milk yield anomaly detection results of the target dairy cows are obtained, including the following steps:
[0113] The real-time dairy cow health monitoring data was dimensionality reduced based on the principal component factors of the dairy cow health monitoring data to obtain the dimensionality-reduced real-time dairy cow health monitoring data.
[0114] The dimensionality-reduced real-time dairy cow health monitoring data is input into the dairy cow health monitoring model to perform dairy cow health monitoring, and the real-time health status label prediction value is obtained, which is the real-time health monitoring result of the target dairy cow. The process includes the following steps:
[0115] The updated real-time abnormal milk yield detection data of dairy cows is input into the abnormal milk yield prediction sub-model of the abnormal milk yield detection model to predict abnormal milk yield, and the original real-time milk yield label prediction value and the original real-time prediction error are obtained.
[0116] The original real-time milk yield label prediction value and the original real-time prediction error are input into the prediction error correction sub-model of the dairy cow milk yield anomaly detection model to correct the prediction error and obtain the corrected real-time prediction error.
[0117] Based on the original real-time milk yield label prediction value and the corrected real-time prediction error, the final real-time milk yield label prediction value is obtained, which is the result of the real-time milk yield anomaly detection for the target dairy cow. The formula is:
[0118] S i =s i +ε i
[0119] In the formula, S i The final real-time milk production status is labeled with a predicted value, corresponding to either a normal or abnormal milk production status; s i The original real-time milk production data is tagged with predicted values; ε i The corrected real-time prediction error; i is the target number of dairy cows indicated.
[0120] Visualize the health prediction results and abnormal milk production detection results of the target dairy cows.
[0121] This invention provides a method for detecting abnormal milk production in dairy cows based on big data analysis. By learning and analyzing massive amounts of data through big data analysis technology, it avoids manual data detection, reduces labor costs and workload, and takes into account the potential impact of factors such as breed, age, lactation stage, and health status of dairy cows on milk production. It uses a neural network model to mine the deep relationship between data and milk production data, improving the accuracy, automation, detection efficiency, and practicality of anomaly detection, making it more suitable for large-scale farm applications.
[0122] This invention is not limited to the optional embodiments described above, and anyone can derive other various forms of products based on the inspiration of this invention. The specific embodiments described above should not be construed as limiting the scope of protection of this invention; the scope of protection of this invention should be determined by the claims, and the specification can be used to interpret the claims.
Claims
1. A method for detecting abnormal milk production in dairy cows based on big data analysis, characterized in that: Includes the following steps: We tracked and collected historical vital signs data and corresponding historical milk yield data of several dairy cows at each milk production stage, and constructed dairy cow health monitoring big data and dairy cow milk yield abnormality detection big data with time sequence based on the historical basic information data, historical vital signs data and historical milk yield data of several dairy cows. Clustering and screening of big data on dairy cow health monitoring and big data on abnormal milk yield monitoring were performed to construct training sample sets for dairy cow health monitoring and abnormal milk yield monitoring. A dairy cow health detection model was constructed by training a neural network algorithm based on a training sample set of dairy cow health detection. Based on the sample set of abnormal milk production in dairy cows, a neural network algorithm was used to train and construct an abnormal milk production detection model for dairy cows. Based on the real-time basic information data, real-time vital signs data, and real-time milk yield data of the target dairy cow at the current milk production stage, real-time dairy cow health monitoring data and real-time dairy cow milk yield abnormality detection data are constructed. Among them, the data types of historical / real-time basic information data include the breed, age, and milk production stage of the dairy cow; the data types of historical / real-time vital signs data include the pulse, body temperature, blood pressure, activity level, and health status of the dairy cow; and the data types of historical / real-time milk yield data include total milk yield, single milk yield, and milk yield details. Real-time dairy cow health monitoring data is input into the dairy cow health monitoring model to monitor dairy cow health and obtain the real-time health monitoring results of the target dairy cow. Add the real-time health monitoring results of the target cow to the corresponding real-time abnormal milk production monitoring data to obtain the updated real-time abnormal milk production monitoring data. The updated real-time abnormal milk yield detection data of dairy cows is input into the abnormal milk yield detection model of dairy cows to detect abnormal milk yield and obtain the real-time abnormal milk yield detection results of the target dairy cows. Visualize the health prediction results and abnormal milk production detection results of the target dairy cows.
2. The method for detecting abnormal milk yield in dairy cows based on big data analysis according to claim 1, characterized in that: The process involves tracking and collecting historical vital sign data and corresponding historical milk yield data for several dairy cows at each milk production stage. Based on the historical basic information, historical vital sign data, and historical milk yield data of these cows, a big data platform for dairy cow health monitoring and a big data platform for detecting abnormal milk yield are constructed, including the following steps: The historical basic information data of each dairy cow at each milk production stage is added to the corresponding historical vital sign data to obtain several historical dairy cow health test data. Based on the several historical dairy cow health test data, a historical dairy cow health test data group with time sequence relationship is obtained. By traversing the historical vital signs data of all dairy cows at each milk production stage, a large dataset of dairy cow health testing data is obtained, consisting of several historical dairy cow health testing data sets. Add the historical basic information data and historical health status tags of each cow at each milk production stage to the corresponding historical milk production data to obtain several historical milk production data. Based on these historical milk production data, obtain a group of historical cow milk production anomaly detection data with time sequence relationship. By iterating through the historical milk production data of all dairy cows at each milk production stage, a large dataset of abnormal milk production detection for dairy cows is obtained, consisting of several sets of historical abnormal milk production detection data.
3. The method for detecting abnormal milk yield in dairy cows based on big data analysis according to claim 2, characterized in that: The aforementioned historical dairy cow health monitoring data set with temporal relationship includes several historical dairy cow health monitoring data sets sorted according to milk production stage; The historical dairy cow health monitoring data includes historical breed data, historical age data, historical milk production stage labels, historical pulse data, historical body temperature data, historical blood pressure data, historical exercise data, and historical health status labels. The aforementioned historical dairy cow milk yield anomaly detection data set with time sequence includes several historical dairy cow milk yield anomaly detection data sorted according to milk production stage; The historical abnormal milk production data of dairy cows includes historical breed data, historical age data, historical milk production stage labels, historical health status labels, historical total milk production data, historical single milk production data, and historical milk production status labels.
4. The method for detecting abnormal milk yield in dairy cows based on big data analysis according to claim 3, characterized in that: Clustering and filtering of big data from dairy cow health monitoring and abnormal milk yield detection to construct training sample sets for dairy cow health monitoring and abnormal milk yield detection includes the following steps: Principal component analysis was used to reduce the dimensionality of each historical dairy cow health test data set in the dairy cow health test big data, resulting in a dimensionality-reduced dairy cow health test big data set consisting of several dimensionality-reduced historical dairy cow health test data sets and the corresponding dairy cow health test principal component factors. The K-means clustering algorithm was used to cluster several groups of historical dairy cow health test data in the dimensionality-reduced dairy cow health test big data to obtain several first cluster centers. Within a preset distance threshold range for each first cluster center, the same number of historical dairy cow health test data groups are selected as corresponding dairy cow health test training samples to obtain the dairy cow health test training sample set. The K-means clustering algorithm was used to cluster several historical abnormal milk production detection data sets of dairy cows to obtain several secondary cluster centers; The historical milk yield anomaly detection data group outside the preset distance threshold range of each second cluster center is regarded as outlier, and the historical milk yield anomaly detection data group within the preset distance threshold range is regarded as cluster point; Collect all outliers, label the historical milk production data of the outliers as abnormal, and filter the clusters with the same number of outliers based on the number of outliers, label the historical milk production data of the outliers as normal. All outliers and selected cluster points were used as training samples for detecting abnormal milk production in dairy cows, thus obtaining the training sample set for detecting abnormal milk production in dairy cows.
5. The method for detecting abnormal milk yield in dairy cows based on big data analysis according to claim 4, characterized in that: Based on the training sample set for dairy cow health monitoring, a dairy cow health monitoring model is constructed using a neural network algorithm, including the following steps: Normalize several sets of historical dairy cow health test data after dimensionality reduction from the training sample set of dairy cow health test to obtain the first normalized training sample set. Based on the normalized first training sample set, the DBN-Dropout algorithm is used to train and obtain the dairy cow health detection model.
6. The method for detecting abnormal milk yield in dairy cows based on big data analysis according to claim 5, characterized in that: Based on the sample set of abnormal milk production detection in dairy cows, a neural network algorithm is used to train and construct a model for detecting abnormal milk production in dairy cows, including the following steps: Normalize several historical abnormal milk production detection data sets of dairy cows in the abnormal milk production detection sample set to obtain the normalized second training sample set. Based on the normalized second training sample set, the BiGRU-Attention algorithm is used for training to obtain a sub-model for predicting abnormal milk production in dairy cows, as well as the corresponding set of original historical milk production label prediction values and the set of original historical prediction errors. Based on the original set of predicted values for historical milk production and the original set of historical prediction errors, the KELM algorithm is used to train and obtain a prediction error correction sub-model. By integrating the sub-model for predicting abnormal milk production in dairy cows and the sub-model for correcting prediction errors, an abnormal milk production detection model for dairy cows is obtained.
7. The method for detecting abnormal milk yield in dairy cows based on big data analysis according to claim 6, characterized in that: The real-time dairy cow health monitoring data includes the target dairy cow's real-time breed data, real-time age data, real-time milk production stage label, real-time pulse data, real-time body temperature data, real-time blood pressure data, and real-time exercise data. The real-time abnormal milk yield detection data of the target dairy cow includes real-time breed data, real-time age data, real-time milk production stage label, real-time total milk yield data, and real-time single milk yield data. The updated real-time abnormal milk production detection data for dairy cows includes the original real-time abnormal milk production detection data for dairy cows and the corresponding real-time health detection results.
8. The method for detecting abnormal milk yield in dairy cows based on big data analysis according to claim 7, characterized in that: Real-time dairy cow health monitoring data is input into a dairy cow health monitoring model to perform dairy cow health monitoring, obtaining the real-time health monitoring results of the target dairy cow, including the following steps: The real-time dairy cow health monitoring data was dimensionality reduced based on the principal component factors of the dairy cow health monitoring data to obtain the dimensionality-reduced real-time dairy cow health monitoring data. The dimensionality-reduced real-time dairy cow health monitoring data is input into the dairy cow health monitoring model to monitor the dairy cow's health and obtain the real-time health status label prediction value, which is the real-time health monitoring result of the target dairy cow.
9. The method for detecting abnormal milk yield in dairy cows based on big data analysis according to claim 8, characterized in that: The updated real-time milk yield anomaly detection data of dairy cows is input into the dairy cow milk yield anomaly detection model to detect anomalies in milk yield, and the real-time milk yield anomaly detection results of the target dairy cows are obtained, including the following steps: The updated real-time abnormal milk yield detection data of dairy cows is input into the abnormal milk yield prediction sub-model of the abnormal milk yield detection model to predict abnormal milk yield, and the original real-time milk yield label prediction value and the original real-time prediction error are obtained. The original real-time milk yield label prediction value and the original real-time prediction error are input into the prediction error correction sub-model of the dairy cow milk yield anomaly detection model to correct the prediction error and obtain the corrected real-time prediction error. Based on the original real-time milk yield label prediction value and the corrected real-time prediction error, the final real-time milk yield label prediction value is obtained, which is the real-time milk yield anomaly detection result of the target dairy cow.
Citation Information
Patent Citations
Cow recessive mastitis risk assessment method and device based on regression model
CN115619221A
Dairy cow behavior sign monitoring system and method, electronic equipment and storage medium
CN116616952A
Cited By
Method and system for analyzing diagnosis data of nutritional imbalance of dairy cow daily ration based on milk urea nitrogen
CN122369877A