Abnormal cow detection method and device, electronic equipment and medium

By expanding the data collected from dairy cows to form time-series monitoring and using self-encoding and time-series encoding modules to amplify abnormal data, the problem of inaccurate monitoring of individual dairy cows in sub-health or early stages of disease has been solved, enabling accurate identification and automated monitoring of abnormal dairy cows.

CN116680595BActive Publication Date: 2025-11-18BEIJING RES CENT FOR INFORMATION TECH & AGRI
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310499350.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-05
Publication Date
2025-11-18
Estimated Expiration
2043-05-05

AI Technical Summary

Technical Problem

Existing technologies cannot accurately identify abnormal states in individual dairy cows during sub-health or early stages of disease, resulting in inaccurate monitoring of abnormalities in dairy cows.

Method used

By expanding the collection of dairy cow data based on preset time periods to form time-series monitoring, data analysis is performed using an abnormal dairy cow detection model. By combining an autoencoder module and a time-series encoding module to amplify abnormal data, quantitative scoring is conducted to identify abnormal dairy cows.

Benefits of technology

It improves the accuracy of identifying abnormal dairy cows, reduces the impact of abnormal individuals on farms, and enables automated monitoring and accurate screening of individual dairy cows.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116680595B_ABST
    Figure CN116680595B_ABST
Patent Text Reader

Abstract

The application provides an abnormal cow detection method and device, electronic equipment and medium, and relates to the breeding field. The method comprises the following steps: expanding target collection data collected by all cows in a target period based on a preset period to obtain time series expansion data; inputting the time series expansion data into an abnormal cow detection model to obtain output data with significant abnormal data output by the abnormal cow detection model; determining abnormal cows in the target period according to the quantitative score of each cow in the output data with significant abnormal data; and the time series expansion data is a data set composed of target collection data in the target period, collected data in a preset period before the target period, and collected data in a preset period after the target period. The application can improve the judgment accuracy of abnormal cow individuals, provide effective basis for abnormal cow individual judgment, and reduce the influence of abnormal individuals on the farm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of animal husbandry, and more particularly to methods, devices, electronic equipment, and media for detecting abnormal dairy cows. Background Technology

[0002] Abnormal traits in individual dairy cows are not obvious enough in a sub-healthy or early-stage disease state to be determined by analyzing daily collected data in traditional abnormal dairy cow monitoring, resulting in inaccurate judgment and inability to accurately identify abnormal dairy cows. Summary of the Invention

[0003] This invention provides a method, device, electronic equipment, and medium for detecting abnormal dairy cows, to solve the technical problem of insufficient accuracy in existing dairy cow anomaly monitoring, and to provide a method utilizing...

[0004] A technical solution that uses daily data collection to generate time-series monitoring and amplify abnormal data from dairy cows, thereby identifying abnormal dairy cows.

[0005] In a first aspect, the present invention provides a method for detecting abnormal dairy cows, comprising:

[0006] Based on the preset time period, expand the target collection data of all dairy cows in the target time period to obtain time-series expanded data;

[0007] Input the time-series augmented data into the abnormal cow detection model, and obtain the output data of the abnormal cow detection model where the abnormal data is significant;

[0008] Based on the quantitative score of each cow in the output data of the abnormal data, the abnormal cows in the target time period are identified.

[0009] The time-series augmented data is a set of data consisting of target data collected during the target time period, data collected during a preset time period before the target time period, and data collected during a preset time period after the target time period.

[0010] According to the abnormal dairy cow detection method provided by the present invention, before expanding the target data collected from all dairy cows in the target time period based on a preset time period, the method further includes:

[0011] Acquire raw data, which includes individual information identified by electronic tags, time series of data collection, individual activity level information, cow physical appearance data, individual feeding duration, and milk production traits.

[0012] The raw data is processed to obtain the target data, which includes the activity entropy data, body size and appearance parameter growth, individual growth status description, basic individual movement, milk production data dispersion, standard milk production value, and number of ruminations of each cow during the target time period at different growth stages.

[0013] The individual activity data includes the number of steps taken by the ankle ring and the location of the neck ring; the cow's body conformation data includes chest width, loin strength, rump angle, hoof-heel depth, udder depth, teat length, rump width, bone quality, hind limb posterior view, central suspensory ligament, teat position, teat length, hind udder attachment height, hind udder attachment width, hind udder position, body depth, hoof angle, hind limb lateral view, hind udder attachment, and angularity; the individual feeding duration includes the neck ring data duration and rumination duration; the milk production traits include cumulative milk production, daily milk production, and milk production per feeding.

[0014] The different growth stages include the calf stage, dry period, production period, and disease period.

[0015] According to the abnormal cow detection method provided by the present invention, before processing the original collected data, the missing data of the original collected data is determined, the missing data is filled in, and the collected data after filling is obtained;

[0016] The process of processing the raw collected data to obtain the target collected data includes:

[0017] The data collected after filling is processed to obtain the target data.

[0018] According to the abnormal dairy cow detection method provided by the present invention, the abnormal dairy cow detection model includes a first autoencoder module, a time-series encoding module, and a second autoencoder module;

[0019] The step of inputting the time-series augmented data into the abnormal cow detection model and obtaining the output data of the abnormal cow detection model that shows significant abnormal data includes:

[0020] Input the timing augmentation data into the first autoencoder module and obtain the reconstructed timing data output by the first autoencoder module;

[0021] Input the reconstructed timing data into the timing coding module, and obtain the amplified abnormal data output by the timing coding module;

[0022] The amplified abnormal data is input to the second autoencoder module, and the output data of the second autoencoder module with significant abnormal data is obtained.

[0023] The significant output data of the abnormal data includes the abnormal data after reconstruction error amplification.

[0024] According to the abnormal dairy cow detection method provided by the present invention, the first autoencoder module is the same as the second autoencoder module;

[0025] The first autoencoder module includes an encoder of a predetermined number of levels, a dimension processing layer, and a decoder of a predetermined number of levels;

[0026] The step of inputting the timing augmentation data to the first autoencoder module and obtaining the reconstructed timing data output by the first autoencoder module includes:

[0027] Input the timing augmentation data into the encoder of the preset number of levels, and obtain the data after reducing the number of nodes output by the encoder of the preset number of levels;

[0028] Input the data after reducing the number of nodes into the dimension processing layer, and obtain the reconstructed data output by the dimension processing layer;

[0029] Input the reconstructed data into the decoder of the preset number of levels, and obtain the data with added nodes output by the decoder of the preset number of levels to obtain the reconstructed timing data;

[0030] The dimension processing layer is used to reduce the dimension of the data after the node reduction, and then increase the dimension of the data after the node reduction.

[0031] According to the abnormal cow detection method provided by the present invention, the step of inputting the reconstructed time-series data to the time-series coding module and obtaining the amplified abnormal data output by the time-series coding module includes:

[0032] The reconstructed timing data is input into the first layer of the timing coding module, and the average reconstructed data output by the first layer is obtained based on the reconstructed data corresponding to each timing sequence in the reconstructed timing data.

[0033] The reconstructed average data is input to the second layer of the timing coding module. Based on the processing of the reconstructed average data and the reconstructed real data by the second layer, the reconstructed abnormal data output by the second layer is obtained.

[0034] The reconstructed abnormal data is input into the third layer of the timing coding module to obtain the amplified abnormal data output by the third layer.

[0035] According to the abnormal dairy cow detection method provided by the present invention, the step of determining the abnormal dairy cows in the target time period based on the quantitative score of each dairy cow in the output data of the abnormal data includes:

[0036] Based on a preset classification algorithm, the significant output data of the abnormal data is processed to identify all abnormal data.

[0037] For each abnormal data point, the abnormal data is quantified to obtain a quantitative score;

[0038] If the quantitative score is greater than a preset threshold, the cow corresponding to the quantitative score is determined to be a non-abnormal cow.

[0039] If the quantitative score is less than or equal to a preset threshold, the cow corresponding to the quantitative score is determined to be an abnormal cow.

[0040] Secondly, an abnormal dairy cow detection device is provided, comprising:

[0041] First acquisition unit: used to expand the target data collected from all dairy cows in the target time period based on a preset time period, and acquire time-series expanded data;

[0042] The second acquisition unit is used to input the time-series augmented data into the abnormal cow detection model and acquire the output data of the abnormal cow detection model where the abnormal data is significant.

[0043] Determination Unit: Used to determine the abnormal cows in the target time period based on the quantitative score of each cow in the output data of the abnormal data;

[0044] The time-series augmented data is a set of data consisting of target data collected during the target time period, data collected during a preset time period before the target time period, and data collected during a preset time period after the target time period.

[0045] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement any of the abnormal cow detection methods described above.

[0046] Fourthly, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the abnormal cow detection method as described above.

[0047] This invention provides a method, device, electronic equipment, and medium for detecting abnormal dairy cows. It involves fusing data collected from dairy cows over a continuous period and inputting it into an abnormal dairy cow detection model for data analysis. This process identifies abnormal data, amplifies it, and quantifies and scores it to ultimately determine the abnormal dairy cow. To improve the accuracy of identifying and inspecting individual abnormal dairy cows in real-world farming scenarios, this invention combines multimodal data aggregation to fuse multiple types of sensor data, utilizes feature analysis to extract identifying features, and employs an abnormal dairy cow detection model to detect individual abnormal dairy cows. This improves the accuracy of identifying abnormal dairy cows, provides a valid basis for determining abnormal dairy cows, and reduces the impact of abnormal individuals on farms. Attached Figure Description

[0048] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0049] Figure 1 This is one of the flowcharts of the abnormal dairy cow detection method provided by the present invention;

[0050] Figure 2 This is the second flowchart of the abnormal dairy cow detection method provided by the present invention;

[0051] Figure 3 This is a flowchart illustrating the process of obtaining significant output data from abnormal data provided by the present invention;

[0052] Figure 4 This is a schematic diagram of the process for obtaining reconstructed time-series data provided by the present invention;

[0053] Figure 5 This is a flowchart illustrating the process of obtaining amplified abnormal data provided by the present invention.

[0054] Figure 6 This is a schematic diagram of the process for identifying abnormal dairy cows provided by the present invention;

[0055] Figure 7 This is a schematic diagram of the abnormal dairy cow detection model provided by the present invention;

[0056] Figure 8 This is the third flowchart of the abnormal dairy cow detection method provided by the present invention;

[0057] Figure 9 This is a schematic diagram of the abnormal dairy cow detection device provided by the present invention;

[0058] Figure 10This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0059] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0060] With the rapid development of large-scale, intensive, and information-based dairy farming and breeding technologies, a massive amount of dairy production and breeding data has been accumulated. In recent years, due to the increase in various infectious diseases and the gradual improvement of human and animal biosecurity levels, the monitoring of abnormal dairy cows has become particularly important. However, since most dairy farming is still only at the disease prevention stage, the monitoring and management mechanism for abnormal individuals is not yet perfect, resulting in a high incidence of disease in dairy cows and seriously affecting the development of the dairy industry. The development of information technology and intelligent equipment technology provides a new entry point for identifying abnormal dairy cows.

[0061] Abnormal dairy cows refer to individuals that exhibit unusual behavior during normal production activities. These individuals may display abnormal behaviors such as illness, estrus, or pregnancy. Currently, the identification of abnormal dairy cows primarily focuses on two aspects: disease early warning and estrus monitoring. The main methods include routine inspections, cell sampling and analysis, activity monitoring, continuous remote body temperature monitoring, thermal imaging body temperature monitoring, and bioaerosol laser spectroscopy measurements. Each monitoring technique assesses certain abnormal responses from different perspectives, providing data support for the identification of abnormal individuals.

[0062] In traditional, small-scale dairy farms, farmers typically observe and record the growth and reproduction of dairy cows manually. However, as dairy farms expand and the farming environment changes, traditional methods become insufficient to detect the health status of dairy cows in a timely manner. Some farms use ear tags to identify dairy cows, providing a visual aid for distinguishing individual cows. In large-scale dairy farming, combining this with information management software enables the correlation and calculation of multiple data points for individual cows, providing support for comprehensive information-based monitoring.

[0063] Current monitoring of abnormal dairy cows primarily focuses on monitoring their behavioral traits, i.e., screening individuals exhibiting abnormal behaviors. However, these abnormal traits are often not readily apparent in cows in a sub-healthy or early-stage disease state, making it impossible to determine whether a cow is abnormal using traditional methods of analyzing routinely collected data. To address these technical issues, this invention provides a method, device, electronic equipment, and medium for detecting abnormal dairy cows. Figure 1This is one of the flowcharts of the abnormal dairy cow detection method provided by the present invention, which provides a method for detecting abnormal dairy cows, including:

[0064] Step 101: Expand the target data collected from all dairy cows during the target time period based on the preset time period to obtain time-series expanded data;

[0065] Step 102: Input the time-series augmented data into the abnormal cow detection model, and obtain the output data of the abnormal cow detection model where the abnormal data is significant;

[0066] Step 103: Based on the quantitative score of each cow in the output data of the abnormal data, determine the abnormal cows in the target time period;

[0067] The time-series augmented data is a set of data consisting of target data collected during the target time period, data collected during a preset time period before the target time period, and data collected during a preset time period after the target time period.

[0068] In step 101, the target time period can be a day. Further, the target time period can be a certain day in the historical time period or the current day. The target collection data collected by all dairy cows in the target time period is the collection data of all dairy cows obtained by each sensor on a certain day or the current day in the historical data.

[0069] The time-series augmented data comprises the target data collected during the target time period, the data collected during a preset time period before the target time period, and the data collected during a preset time period after the target time period. To identify abnormal cows through abnormal data, this invention requires simultaneous acquisition of data collected over multiple days before and after the target time. For example, if the target time period is April 12th and the preset time period is 7 days, then the data collected during the preset time period before the target time period would be April 5th, April 6th, April 7th, April 8th, and April... The data collected during the target period includes 7 days of data from April 9th, 10th, and 11th, and 7 days of data collected during the preset period following the target period, namely April 13th, 14th, 15th, 16th, 17th, 18th, and 19th. Therefore, the time-series extended data corresponding to the target period is a dataset consisting of 15 days of collected data from April 5th to April 19th. This invention uses the time-series extended data corresponding to the target period as a data segment to identify abnormal cows during the target period.

[0070] In step 102, the time-series augmented data is input into the abnormal cow detection model to obtain the output data of the abnormal cow detection model with significant abnormal data. Those skilled in the art will understand that the abnormal cow detection model can be determined by training based on the sample time-series augmented data and sample output data. In the embodiments described in this invention, the abnormal cow detection model includes a first autoencoder module, a time-series encoding module, and a second autoencoder module. The time-series augmented data is sequentially input into the first autoencoder module, the time-series encoding module, and the second autoencoder module to obtain the output data with significant abnormal data. That is, the autoencoder and decoder of the individual identification data are realized through the continuous autoencoder. The trained encoder will reconstruct the error data in the process of use to amplify the abnormal error.

[0071] In step 103, the significant abnormal data output data includes the output data of all cows. The output data of each cow is quantified to obtain a quantitative score for each cow. Finally, based on the quantitative score of each cow, the abnormal cows in the target time period are determined.

[0072] The monitoring method proposed in this invention includes steps such as data acquisition and processing, individual identifier feature extraction, feature self-encoding, and anomaly scoring. Utilizing data mining techniques, it starts with multi-source sensor data and production and breeding data to achieve aggregated analysis of individual dairy cow monitoring data. Combining the occurrence and development patterns of abnormal behavior in individual dairy cows, and using data collected over consecutive days in conjunction with an abnormal dairy cow detection model, it monitors abnormal dairy cows in real time. This invention can be used in large-scale farms, aggregating multi-source quantitative sensor data, extracting core features, and conducting health monitoring of individual dairy cow activities. The algorithm feature index used in the abnormal dairy cow detection model has the advantages of fast calculation speed and strong interpretability. It can be customized to distinguish between abnormal and normal individuals, and when applied to dairy farming systems, it achieves automated monitoring of dairy farming.

[0073] This invention provides a method, device, electronic equipment, and medium for detecting abnormal dairy cows. It involves fusing data collected from dairy cows over a continuous period and inputting it into an abnormal dairy cow detection model for data analysis. This process identifies abnormal data, amplifies it, and quantifies and scores it to ultimately determine the abnormal dairy cow. To improve the accuracy of identifying and inspecting individual abnormal dairy cows in real-world farming scenarios, this invention combines multimodal data aggregation to fuse multiple types of sensor data, utilizes feature analysis to extract identifying features, and employs an abnormal dairy cow detection model to detect individual abnormal dairy cows. This improves the accuracy of identifying abnormal dairy cows, provides a valid basis for determining abnormal dairy cows, and reduces the impact of abnormal individuals on farms.

[0074] Figure 2This is a second flowchart illustrating the abnormal dairy cow detection method provided by the present invention. Before expanding the target data collected from all dairy cows during the target time period based on a preset time period, the method further includes:

[0075] Step 201: Obtain raw data, which includes individual information identified by electronic tags, time series of data collection, individual activity level information, cow physical appearance data, individual feeding duration, and milk production traits.

[0076] Step 202: Process the raw collected data to obtain the target collected data. The target collected data includes the activity entropy data, body size and appearance parameter growth, individual growth status description value, individual basic exercise volume, milk production data dispersion, standard milk production value, and number of ruminations of each dairy cow during the target time period at different growth stages.

[0077] The individual activity data includes the number of steps taken by the ankle ring and the location of the neck ring; the cow's body conformation data includes chest width, loin strength, rump angle, hoof-heel depth, udder depth, teat length, rump width, bone quality, hind limb posterior view, central suspensory ligament, teat position, teat length, hind udder attachment height, hind udder attachment width, hind udder position, body depth, hoof angle, hind limb lateral view, hind udder attachment, and angularity; the individual feeding duration includes the neck ring data duration and rumination duration; the milk production traits include cumulative milk production, daily milk production, and milk production per feeding.

[0078] The different growth stages include the calf stage, dry period, production period, and disease period.

[0079] Generally, the monitoring of individual dairy cow anomalies using intelligent technology falls into two main categories. The first is through a combination of sensor components to monitor specific indicators of an individual cow, requiring the cows to wear sensor devices. The second is visual monitoring, which uses depth or RGB cameras to identify individual cows. However, due to the complexity of the dairy farming environment, real-time monitoring of individual cows requires the installation and deployment of numerous cameras, necessitating significant modifications to the farm. The abnormal individual dairy cow identification method used in this invention includes data collection, data storage, and individual analysis. Based on the living habits and expected development patterns of individual and group cows, combined with an intelligent model, it makes judgments to quickly screen abnormal dairy cows.

[0080] In step 201, the acquisition of raw data refers to the collection of basic data of dairy cows, including data collected by basic individual information collection nodes in the farm, data collected by wearable sensors, or electronic records formed by manual collection by information officers. Specific data types include: individual information identified by electronic tags, time series of collected data, individual activity information, dairy cow physical appearance information data, individual feeding duration, and milk production traits.

[0081] Optionally, the individual activity information includes the number of steps taken by the ankle ring and the location of the neck ring; the cow's body conformation data includes chest width, waist strength, rump angle, hoof-heel depth, udder depth, teat length, rump width, bone quality, hind limb posterior view, central suspensory ligament, teat position, teat length, hind udder attachment height, hind udder attachment width, hind udder position, body depth, hoof angle, hind limb lateral view, hind udder attachment, and angularity; the individual feeding duration includes the neck ring data duration and rumination duration; the milk production traits include cumulative milk production, daily milk production, and milk production per feeding.

[0082] In step 202, the raw collected data is processed to obtain the target collected data. Step 202 is the step of extracting individual identification features. Since the collected data is basic data, the data needs to be quantified and processed to identify the time series data of individual dairy cows.

[0083] This invention uses individual cow codes, time series of collected data, and stage classification identifiers as carried identifiers in the input data, but not as entity data. It obtains the activity entropy data, body size and appearance parameter growth, individual growth status description value, basic individual exercise volume, milk production data dispersion, standard milk production value, and number of ruminations of each cow at different growth stages within the target time period. The activity entropy data, body size and appearance parameter growth, individual growth status description value, basic individual exercise volume, milk production data dispersion, standard milk production value, and number of ruminations of the cow will be used as input data for the abnormal cow detection model in this application.

[0084] Optionally, in large-scale dairy farming, independent individual identification and monitoring devices for dairy cows are typically used, such as neck bands and leg bands. These devices provide a unique cow number and can accumulate basic sensor data, such as activity levels, rumination frequency, and milk production. Combined with its supporting system, cumulative milk production, number of gestation periods, and estrus status can be obtained. This invention utilizes the aforementioned basic sensor data, combined with a large amount of existing accumulated production data, and uses the cumulative data of problematic dairy cows and normal dairy cows accumulated daily to form a time-series monitoring model to achieve real-time monitoring of abnormal individual dairy cows. For example, by default, milk production is collected in three shifts per day to obtain the cumulative milk production.

[0085] Optionally, the target data collection includes individual cow codes. To facilitate standardized management of dairy cows, different breeds and feeding methods are distinguished based on the Radio Frequency Identification (RFID) electronic tags worn by individual cows. Using an RFID rotary milking machine, the electronic ear tag information can be read by the RFID reader on the milking machine to confirm the individual cow's identity and determine which cows have been milked and which have not. The RFID electronic tag assigns a unique identifier to each dairy cow on the farm, and the individual cow code identifies the uniqueness of each cow, distinguishing different cows. It is not used as an input feature for the abnormal cow detection model in this invention.

[0086] Optionally, the target data collection also includes a data collection time series, which is the time of describing the individual characteristics of dairy cows. The data collection time series will be used as a time identifier and the basis for encoder slicing, but will not be used as the input feature of the abnormal dairy cow detection model in this invention.

[0087] Optionally, the target data collection also includes stage-based classification identifiers. The overall stage-based identifiers mainly include the following phases: calf stage, dry period, production period, and disease period. The calf stage includes lactation, weaning, rearing, and replacement. The production period includes low-yielding and high-yielding cows. Typically, farm personnel are most concerned with the milk production of dairy cows during the production period, which is also divided into low-yielding and high-yielding groups. This invention can group dairy cows in dairy farms and combine them with existing grouping gate systems to achieve separate breeding of high-yielding and low-yielding cows. Simultaneously, through farm observation and machine screening, diseases and abnormal individuals can be screened using the grouping gate, providing data support for the identification of abnormal individuals. The stage-based classification identifiers are dataset classification identifiers and are not used as input features for the abnormal dairy cow detection model in this invention.

[0088] Optionally, the target data collection also includes activity entropy, the activity entropy irrE (M,p) As the input feature of the abnormal dairy cow detection model in this invention, it is used to describe the fluctuation of the activity level of an individual dairy cow in the same time length dimension. The same time length can be freely divided, such as 12 hours or 24 hours, or set according to the breeding rules of the farm and the frequency of the collection sensor.

[0089] Its main description is the degree of influence of the increased activity level on its regular activity sequence, and the calculation method is as follows:

[0090]

[0091] In equation (1), M represents all preceding activity sequences, p represents the current activity sequence, and m represents a single sequence of preceding activity sequences, i.e., m∈M, where both m and p record the activity sequence of a certain individual. The representation is as follows:

[0092] p n ={p1,p2......,p n} (2)

[0093] In equation (2), p n This represents the amount of exercise at time n. This characteristic value is distributed between [0,1]. The value is closer to 1, the greater the fluctuation of the amount of exercise, and closer to 0, the smaller the fluctuation.

[0094] Optionally, the target data collection also includes the growth status of body size and appearance parameters. The growth status of body size and appearance parameters serves as the input feature of the abnormal dairy cow detection model in this invention, and is used to describe the development of an individual dairy cow during its growth process. Dairy cow appearance score is a commonly used tool to reflect the fat reserve level, nutritional status, and reproductive performance of dairy cows. By monitoring the appearance and condition scores of each dairy cow at different times, management strategies can be optimized in a timely manner, which can effectively reduce the occurrence of metabolic disorders and reproductive problems in dairy cows, thereby improving production efficiency and increasing breeding benefits. The growth of the body size and morphology parameters is described using paired descriptions of morphological growth stability to monitor individual abnormalities. This involves monitoring the growth rate of individual dairy cows. Each individual is coded based on morphology test data from each period. The parameters include chest width, loin strength, rump angle, hoof-heel depth, udder depth, teat length, rump width, bone quality, hind limb posterior view, central suspensory ligament, teat position, teat length, hind udder attachment height, hind udder attachment width, hind udder position, body depth, hoof angle, hind limb lateral view, teat attachment, and angularity, forming C... (i,t) ={x1,x2,x3,x4...x n}, where C (i,t) Let x represent the physical appearance data collected at time t for the i-th individual. n This represents the appearance data of the nth individual.

[0095] Growth stability is calculated using the following formula:

[0096]

[0097] The growth stability measures the growth stability of an individual dairy cow. The smaller the value, the smaller the individual dairy cow's variation. In equation (3), T is the total number of times the dairy cow's physical appearance was collected, t is a single data node, N is the traits listed above, and C is the total number of times the cow's physical appearance was collected. i,t,n This represents the nth trait data collected from cow i in t subsequent collections.

[0098] Optionally, the target data collection also includes individual growth status description values, which serve as input features of the abnormal dairy cow detection model in this invention. These values ​​describe the growth status of an individual dairy cow at each stage compared to other individuals, as shown in the following formula:

[0099]

[0100] In formula (4), F represents the characteristics of each individual, including chest width, waist strength, rump angle, hoof heel depth, udder depth, anterior teat length, rump width, bone quality, hind limb posterior view, central suspensory ligament, anterior teat position, anterior teat length, hind udder attachment height, hind udder attachment width, hind teat position, body depth, hoof angle, hind limb lateral view, anterior udder attachment, and angularity. J represents the individuals of other dairy cows at the same time except for the i-th cow. C represents the individual's physical appearance. t represents the collection time.

[0101] This value is normalized using the exponential operator form, i.e.

[0102]

[0103] In equation (5), δ is the power average operator.

[0104] Optionally, the target data collection also includes basic individual movement data, which serves as the input feature of the abnormal cow detection model in this invention, i.e., the raw step count data obtained by the sensor.

[0105] Optionally, the target data collection also includes the dispersion of milk production data. This dispersion serves as an input feature of the abnormal dairy cow detection model in this invention, used to record the degree of dispersion of dairy cows at different times, as shown in the following formula:

[0106]

[0107] In equation (6), N represents different parities, T represents different collection times, i represents the individual cow number, and C i C represents the number of milk samples collected in this batch. stu This represents the standard milk production curve. This value depicts the deviation from the standard production level. The standard milk production curve values ​​are shown in Table 1 below:

[0108] Table 1

[0109]

[0110]

[0111] Optionally, the target data to be collected also includes a standard value of milk production, which serves as an input feature of the abnormal dairy cow detection model in this invention. The standard value of milk production is in kg as the standard unit and will be based on the standard value of milk production recorded in the standard milk production software.

[0112] Optionally, the target data collection also includes the number of times the cow ruminates, which serves as an input feature of the abnormal cow detection model in this invention, i.e., the original number of times the cow ruminates as monitored.

[0113] Optionally, before processing the original collected data, the missing data in the original collected data is determined, the missing data is filled in, and the filled collected data is obtained.

[0114] The process of processing the raw collected data to obtain the target collected data includes:

[0115] The data collected after filling is processed to obtain the target data.

[0116] Optionally, before processing the original collected data, data may be missing due to sensor failure, power outage, or discontinuous data acquisition. The present invention aims to complete the missing data by processing the missing data in the original collected data and filling in all the missing data.

[0117] Optionally, the data filling includes two cases: one is data missing, which can be filled using the following methods:

[0118] When a data point is missing, it can be filled by its nearest neighbor. Combining the nearest neighbor principle and the individual similarity theory, when a data point is missing (such as exercise data), the remaining feature vectors are used to find their nearest child node on the hyperplane.

[0119] According to Euclidean distance Take the k nearest nodes. The value of k can be determined according to the actual situation. In this invention, k can be 3. However, if the nearest neighbor data is empty in the actual situation, the value of k can be appropriately increased. Take the weighted average of the missing fields corresponding to the k nearest child nodes and use it as the missing value to supplement.

[0120] Another scenario involves data supplementation. Since the physical appearance data of dairy cows in dairy farms is not obtained every day, this invention can fill the missing data with the previous physical appearance data to ensure data integrity.

[0121] Those skilled in the art will understand that after acquiring the target data and before inputting the time-series augmented data into the abnormal dairy cow detection model, the method further includes data sharding of the target data, that is, expanding the target data into the time-series augmented data. The data sharding is performed based on the individual characteristic values ​​of each dairy cow. Data sharding is performed using a sliding time window of length k to shard the data, that is, dividing the entire time series into multiple regions. In this invention, k is a preset time period, and the initial value of the preset time period is 7.

[0122] The purpose of data sharding is to reduce the overall input of individual cow data by dividing all cow data into multivariate time series X = {X1, X2, X3, ..., Xn} of a preset length n. n}, where the observation at time t is an m-dimensional vector X. t ={x1,x2,x3......x m}, 1≤t≤n, which records the current cow status information. This invention judges whether the segment sequence is abnormal based on time-series augmented data. At the same time, during the application process, new data will be continuously added to the time-series segment corresponding to the new data to realize the judgment of the time-series segment.

[0123] Figure 3 This is a flowchart illustrating the process of obtaining significant output data from abnormal data provided by the present invention. The abnormal dairy cow detection model includes a first autoencoder module, a time-series encoding module, and a second autoencoder module.

[0124] The step of inputting the time-series augmented data into the abnormal cow detection model and obtaining the output data of the abnormal cow detection model that shows significant abnormal data includes:

[0125] Step 301: Input the timing augmentation data into the first autoencoder module and obtain the reconstructed timing data output by the first autoencoder module;

[0126] Step 302: Input the reconstructed timing data into the timing coding module, and obtain the amplified abnormal data output by the timing coding module;

[0127] Step 303: Input the amplified abnormal data into the second autoencoder module, and obtain the output data of the second autoencoder module where the abnormal data is significant;

[0128] The significant output data of the abnormal data includes the abnormal data after reconstruction error amplification.

[0129] Optionally, since the input of individual cow data is processing data from a real-world scenario, i.e., the time-series augmented data, in order to enable the anomaly classifier to better classify the data, this invention uses an autoencoder to uniformly process the data, so that the abnormal data will show a large abnormal reaction after passing through the encoder, thereby helping the classifier to classify better.

[0130] The abnormal dairy cow detection model in this invention consists of three parts: a first autoencoder module, a temporal encoding module, and a second autoencoder module. Figure 7 This is a schematic diagram of the abnormal dairy cow detection model provided by the present invention, as shown below. Figure 7 As shown, this invention adds a time-series coding module to the two autoencoder modules (AE). The time-series coding module is a Long Short-Term Memory (LSTM) network. Since the LSTM network can process time-series data well, this invention combines the three-gate characteristics to add a connection to the data state.

[0131] In step 301, the timing augmentation data is input to the first autoencoder module, and the reconstructed timing data output by the first autoencoder module is obtained. The first autoencoder module is used to process the timing augmentation data to obtain the reconstructed timing data.

[0132] This invention quantifies the data features in the time-series augmented data into a simple index. This index enables the LSTM network to learn and fuse the correlations between different features, restoring the original dimension from low to high dimensionality, ensuring that input and output are in one dimension, and better highlighting anomalous data. Those skilled in the art will understand that anomalous data has low correlation among different features, leading to a larger weight coefficient corresponding to the anomalous data. The scheme of the first autoencoder module can identify anomalous data based on the change in the increased weight coefficient corresponding to the anomalous data.

[0133] In step 302, the reconstructed timing data is input to the timing encoding module, and the amplified abnormal data output by the timing encoding module is obtained. The timing encoding module is used to perform abnormal data amplification processing on the reconstructed timing data to obtain the amplified abnormal data.

[0134] The autoencoder used in this invention utilizes a neural network model to input data into the temporal coding model. The output result must ensure that the data values ​​of the original features remain unchanged while amplifying the features corresponding to the abnormal data. This invention uses multiple temporal augmented data and the health score corresponding to each temporal augmented data as training samples to determine the model parameters of the abnormal cow detection model. This invention uses a supervised training method to train the abnormal cow detection model, while in practical applications, the abnormal cow detection model is used in an unsupervised manner.

[0135] In step 303, the amplified abnormal data is input to the second autoencoder module, and the output data of the second autoencoder module with significant abnormal data is obtained. In order to make the abnormal data more obvious, the present invention uses a continuous encoder to realize the autoencoding and decoding of individual identification data. The trained encoder will reconstruct the error data in the process of use to amplify the abnormal error. The core of the use of nested encoders in the present invention is to amplify the reconstruction error of abnormal data.

[0136] Figure 4 This is a flowchart illustrating the process of acquiring reconstructed time-series data provided by the present invention, wherein the first autoencoder module is the same as the second autoencoder module;

[0137] The first autoencoder module includes an encoder of a predetermined number of levels, a dimension processing layer, and a decoder of a predetermined number of levels;

[0138] The step of inputting the timing augmentation data to the first autoencoder module and obtaining the reconstructed timing data output by the first autoencoder module includes:

[0139] Step 401: Input the timing augmentation data into the encoder of the preset number of levels, and obtain the data after reducing the number of nodes output by the encoder of the preset number of levels;

[0140] Step 402: Input the data after reducing nodes into the dimension processing layer, and obtain the reconstructed data output by the dimension processing layer;

[0141] Step 403: Input the reconstructed data into the decoder of the preset number of levels, and obtain the data after adding nodes output by the decoder of the preset number of levels to obtain the reconstructed timing data;

[0142] The dimension processing layer is used to reduce the dimension of the data after the node reduction, and then increase the dimension of the data after the node reduction.

[0143] In step 401, the autoencoder module is an unsupervised neural network structure whose main function is to extract data features and reconstruct the data. It mainly consists of two parts: an encoder and a decoder with symmetrical structure. The encoder can reduce the dimensionality of the input time series, and the decoder can decode the dimensionality-reduced data to realize the reconstruction of the data. For example, if the process from X to Z is the dimensionality reduction encoding, the process from Z to Y is the decoding and reconstruction process.

[0144] The encoding process can be understood as:

[0145]

[0146] The decoding process can be understood as:

[0147]

[0148] In equations (7) and (8), E is the encoder, D is the decoder, W corresponds to the weights, and b corresponds to the bias. It is an activation function.

[0149] Optionally, the first autoencoder module includes an encoder of a preset number of levels, a dimension processing layer, and a decoder of a preset number of levels. The input of the encoder of the preset number of levels is a segment of the individual cow sequence, and the output of the decoder of the preset number of levels is a segment of the individual cow sequence of the same size as the input.

[0150] Optionally, the purpose of inputting the time-series augmented data to the first autoencoder module and obtaining the reconstructed time-series data output by the first autoencoder module is to achieve data reconstruction by reducing dimensionality. The first autoencoder module in this invention has 13 layers, with the first 6 layers being encoders, the last 6 layers being decoders, and the middle layer being a dimensionality-reduced data group. In the first 6 layers of the encoder in step 401, two connection nodes are reduced in each layer. Then, after passing through the dimensionality-reduced data group in step 402, the data after the node reduction is input to the dimensionality processing layer to obtain the reconstructed data output by the dimensionality processing layer. Finally, in the decoder of the last 6 layers in step 403, two connection points are added in each layer to obtain the reconstructed time-series data.

[0151] Optionally, since the L2 normal form is better able to highlight the anomalies in the data, the L2 normal form is used to label the data, where || || labels the L2 data as: The L2 normal form is the sum of the squares of the elements of a variable and then the square root. The L2 normal form can prevent overfitting and improve the generalization ability of the model.

[0152] Figure 5This is a flowchart illustrating the process of obtaining amplified abnormal data provided by the present invention. The step of inputting the reconstructed time-series data to the time-series coding module and obtaining the amplified abnormal data output by the time-series coding module includes:

[0153] Step 501: Input the reconstructed timing data into the first layer of the timing coding module, and obtain the average reconstructed data output by the first layer based on the reconstructed data corresponding to each timing sequence in the reconstructed timing data.

[0154] Step 502: Input the reconstructed average data into the second layer of the timing coding module, process the reconstructed average data and the reconstructed real data according to the second layer, and obtain the reconstructed abnormal data output by the second layer;

[0155] Step 503: Input the reconstructed abnormal data into the third layer of the timing coding module, and obtain the amplified abnormal data output by the third layer.

[0156] In step 501, the timing coding module consists of an LSTM network. The reconstructed timing data is input to the first layer of the timing coding module. Based on the reconstructed data corresponding to each timing sequence in the reconstructed timing data, the average reconstructed data output by the first layer is obtained, which can be referred to by the following formula:

[0157]

[0158] In equation (9), X lstm,avg To reconstruct the average data, the input of the first layer of the time-series coding module is the output of the first autoencoder module. The reconstructed time-series data is a weighted average of the reconstructed data corresponding to each time series, y. i It is the output of the first autoencoder module.

[0159] In step 502, the reconstructed average data is input to the second layer of the timing coding module. Based on the processing of the reconstructed average data and the reconstructed real data by the second layer, the reconstructed anomaly data output by the second layer is obtained, which can be referred to by the following formula:

[0160] X lstm =X lstm,avg -X (10)

[0161] In equation (10), X lstm X represents reconstructing abnormal data, while X represents reconstructing real data.

[0162] In step 503, the reconstructed abnormal data is input into the third layer of the timing coding module to obtain the amplified abnormal data output by the third layer.

[0163] Optionally, the first autoencoder module in this invention outputs an array of {15,7}, where 15 represents 15 days of data and 7 represents a preset time period. After entering the time-series encoding module, in order to increase the continuity verification of time-series data, the input and output of the time-series encoding module are also arrays of {15,7}. However, the input of the time-series encoding module is the difference between the average value of the output of the previous encoder and the true value. The larger the abnormal data, the larger the difference.

[0164] Optionally, the output of the timing coding module is quantized data of the same size as the input. The present invention may introduce a temporary storage array to receive all the output results of the first autoencoder module and provide a timing guide sequence for the timing storage module.

[0165] Optionally, the objective function of the time-series coding module is to minimize the original gap in the output, where X is the original data of the network, i.e. the original dataset. The purpose of this loss function is to minimize the initial input and the final output to ensure the originality of the data. At the same time, the L2 paradigm can also be used to highlight outlier data.

[0166]

[0167] The formula for the timing coding module is as follows:

[0168] enter:

[0169]

[0170] Forgetting:

[0171]

[0172]

[0173] Output:

[0174]

[0175] Long memory:

[0176]

[0177] Short memory:

[0178]

[0179] Tanh function:

[0180]

[0181] Sigmod function:

[0182]

[0183] Among them, X t The feature data, C, is generated by autoencoder 1. t Encode the state to be passed to the next LSTM, H t Represents the output characteristics of LSTM units, operators This represents the dot product operation, where W is the weight coefficient. The output of LSTM is the same array as the input.

[0184] Optionally, after inputting the reconstructed time-series data to the time-series encoding module and obtaining the amplified abnormal data output by the time-series encoding module, the amplified abnormal data is input to the second autoencoder module to obtain the output data with significant abnormal data output by the second autoencoder module. The purpose of using continuous autoencoder in this invention is to amplify the reconstruction error of abnormal data. Since the first autoencoder module and the second autoencoder module are the same, the second autoencoder module includes an encoder of a preset number of levels, a dimension processing layer, and a decoder of a preset number of levels. The input is the overall output of the LSTM module, and the output content is the autoencoded data after being encoded by the encoder.

[0185] Optionally, the objective function of the timing coding module can refer to the following formula:

[0186] Loss = X - AE2(LSTM(AE1))(20)

[0187] The overall optimization strategy for the timing coding module can refer to the following formula:

[0188] min||AE1(X)-X+LSTM(AE1(X)-X)+AE2(LSTM(AE1(X))-X|| (21)

[0189] This invention discloses a method for detecting abnormal dairy cows based on continuous autoencoders. In the implementation process, individual dairy cows are monitored by collecting individual characteristic data. The main indicators collected are essential fields for dairy cow farming, including individual information identified by electronic tags, time series of collected data, individual movement information (steps from leg rings, neck ring positioning), dairy cow physical information data, milk production information, and feeding information. The data is fused to form information features that identify the individual. Then, the individual identification data is self-encoded and decoded by a continuous autoencoder. The trained encoder will reconstruct the error data during the process to amplify the abnormal error.

[0190] Figure 6This is a flowchart illustrating the process of identifying abnormal dairy cows provided by the present invention. The step of determining abnormal dairy cows within a target time period based on the quantitative score of each cow in the significant output data of the abnormal data includes:

[0191] Step 601: Process the significant output data of the abnormal data based on the preset classification algorithm to identify all abnormal data;

[0192] Step 602: For each abnormal data point, quantify the abnormal data and obtain a quantitative score;

[0193] Step 603: If the quantitative score is greater than a preset threshold, determine that the cow corresponding to the quantitative score is a non-abnormal cow;

[0194] Step 604: If the quantitative score is less than or equal to a preset threshold, determine that the cow corresponding to the quantitative score is an abnormal cow.

[0195] In step 601, the output data of the abnormal data is processed based on the preset classification algorithm to determine all abnormal data. The present invention obtains the same feature sequence as the input through the autoencoder structure in the abnormal dairy cow detection model. This sequence will explain the breeding characteristics of individual dairy cows from multiple dimensions.

[0196] Optionally, the preset classification algorithm is the One-Class classification method. This invention combines the One-Class classification method to quickly classify data. The main idea of ​​the One-Class classification method is to create a hyperplane based on multi-dimensional features, divide the hyperplane by thresholds, and combine the thresholds to identify abnormal individuals.

[0197]

[0198] Assuming the generated hypersphere parameters are that the center o and the corresponding hypersphere radius r are greater than 0, the hypersphere volume V(r) is minimized, and the center o is a linear combination; similar to the traditional Support Vector Machine (SVM) method, all training data points X are required to be minimized. i The distance to the center is strictly less than r. However, a slack variable with a penalty coefficient of C is constructed simultaneously. The optimization problem is as follows:

[0199] ||x i -o||≤r+ζ,i=1,2,3...m,ζ>0 (23)

[0200] In step 602, all abnormal data are scored for abnormality. This invention uses a binary classification method, and individuals exceeding a defined threshold are considered abnormal individuals, as shown in the following formula:

[0201]

[0202] In equation (24), Score(x) describes the distance between the marker point in the hyperplane and the two hyperplanes, o1 is the positive class center point, o2 is the center point of the negative class, and κ is a constant value used to reduce the influence of the negative center point. In the process of using this invention, the production data of individual dairy cows are added to the overall dataset to form a single data structure, which is then input into the judgment algorithm to evaluate abnormal individuals based on the abnormal scores.

[0203] In step 603, if the quantitative score is greater than a preset threshold, the cow corresponding to the quantitative score is determined to be a non-abnormal cow. In step 604, if the quantitative score is less than or equal to a preset threshold, the cow corresponding to the quantitative score is determined to be an abnormal cow. The preset threshold can be 0.3, 0.5, or 0.8.

[0204] Optionally, the quantitative score can indicate the degree of normality. A quantitative score close to 1 indicates that the individual data is normal, while a quantitative score close to 0 indicates that the individual has strong abnormality.

[0205] Figure 8 This is the third flowchart of the abnormal dairy cow detection method provided by the present invention, as shown below. Figure 8 As shown, this invention is divided into two parts: model application and model training. In the model training part, data is first collected. Based on the cow's physical appearance information, time series information, milk production information, movement information, etc., the data is stored and collected. After the data is segmented and classified in time series, different class models are trained according to the classification model. Automatic encoding is achieved using encoders and decoders. One-Class classification anomaly judgment is performed. If the model does not converge under supervised verification, the process returns to the step of automatic encoding using encoders and decoders. If the model converges under supervised verification, the model is extracted and the model parameters and model weight parameters are saved.

[0206] In the model application section, the data collection framework based on DATAX, an open-source software heterogeneous data source offline synchronization tool, is used to realize data processing and model parameter loading. With the continuous addition of the latest data, the data sequence is segmented, and the scores are calculated through positive and negative judgments to finally determine the abnormal cow detection results.

[0207] Figure 9 This is a schematic diagram of the abnormal dairy cow detection device provided by the present invention. The present invention provides an abnormal dairy cow detection device, including a first acquisition unit 1: used to expand the target collection data of all dairy cows collected in the target time period based on a preset time period, and acquire time-series expanded data. The working principle of the first acquisition unit 1 can be referred to the aforementioned step 101, and will not be repeated here.

[0208] The abnormal cow detection device further includes a second acquisition unit 2: used to input the time-series augmented data into the abnormal cow detection model and acquire the output data of the abnormal cow detection model with significant abnormal data. The working principle of the second acquisition unit 2 can be referred to the aforementioned step 102, and will not be repeated here.

[0209] The abnormal dairy cow detection device further includes a determination unit 3: used to determine the abnormal dairy cows in the target time period based on the quantitative score of each dairy cow in the output data of the abnormal data. The working principle of the determination unit 3 can be referred to the aforementioned step 103, and will not be repeated here.

[0210] The time-series augmented data is a set of data consisting of target data collected during the target time period, data collected during a preset time period before the target time period, and data collected during a preset time period after the target time period.

[0211] This invention provides a method, device, electronic equipment, and medium for detecting abnormal dairy cows. It involves fusing data collected from dairy cows over a continuous period and inputting it into an abnormal dairy cow detection model for data analysis. This process identifies abnormal data, amplifies it, and quantifies and scores it to ultimately determine the abnormal dairy cow. To improve the accuracy of identifying and inspecting individual abnormal dairy cows in real-world farming scenarios, this invention combines multimodal data aggregation to fuse multiple types of sensor data, utilizes feature analysis to extract identifying features, and employs an abnormal dairy cow detection model to detect individual abnormal dairy cows. This improves the accuracy of identifying abnormal dairy cows, provides a valid basis for determining abnormal dairy cows, and reduces the impact of abnormal individuals on farms.

[0212] Figure 10 This is a schematic diagram of the structure of the electronic device provided by the present invention. For example... Figure 10As shown, the electronic device may include a processor 110, a communication interface 120, a memory 130, and a communication bus 140, wherein the processor 110, the communication interface 120, and the memory 130 communicate with each other through the communication bus 140. The processor 110 can call logical instructions in the memory 130 to execute an abnormal cow detection method. The method includes: expanding the target acquisition data of all cows collected in the target time period based on a preset time period to obtain time-series expanded data; inputting the time-series expanded data into an abnormal cow detection model to obtain the output data of the abnormal cow detection model that shows significant abnormal data; determining the abnormal cows in the target time period based on the quantitative score of each cow in the output data that shows significant abnormal data; the time-series expanded data is a data set consisting of the target acquisition data of the target time period, the data collected in the preset time period before the target time period, and the data collected in the preset time period after the target time period.

[0213] Furthermore, the logical instructions in the aforementioned memory 130 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0214] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the abnormal cow detection method provided by the above methods. The method includes: expanding the target collection data of all cows collected in the target time period based on a preset time period to obtain time-series expanded data; inputting the time-series expanded data into an abnormal cow detection model to obtain the output data of the abnormal cow detection model that shows significant abnormal data; determining the abnormal cows in the target time period based on the quantitative score of each cow in the output data that shows significant abnormal data; the time-series expanded data is a data set consisting of the target collection data of the target time period, the data collected in the preset time period before the target time period, and the data collected in the preset time period after the target time period.

[0215] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the abnormal cow detection method provided by the above methods. The method includes: expanding the target collection data of all cows collected in a target time period based on a preset time period to obtain time-series expanded data; inputting the time-series expanded data into an abnormal cow detection model to obtain output data with significant abnormal data output by the abnormal cow detection model; determining the abnormal cows in the target time period based on the quantitative score of each cow in the output data with significant abnormal data; wherein the time-series expanded data is a data set consisting of the target collection data of the target time period, the data collected in a preset time period before the target time period, and the data collected in a preset time period after the target time period.

[0216] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0217] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0218] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting abnormal dairy cows, characterized in that, include: Based on the preset time period, expand the target collection data of all dairy cows in the target time period to obtain time-series expanded data; Input the time-series augmented data into the abnormal cow detection model, and obtain the output data of the abnormal cow detection model where the abnormal data is significant; Based on the quantitative score of each cow in the output data of the abnormal data, the abnormal cows in the target time period are identified. The time-series augmented data is a data set consisting of target acquisition data for the target time period, data acquired during a preset time period before the target time period, and data acquired during a preset time period after the target time period. The abnormal dairy cow detection model includes a first autoencoder module, a time-series encoding module, and a second autoencoder module; The step of inputting the time-series augmented data into the abnormal cow detection model and obtaining the output data of the abnormal cow detection model that shows significant abnormal data includes: Input the timing augmentation data into the first autoencoder module and obtain the reconstructed timing data output by the first autoencoder module; Input the reconstructed timing data into the timing coding module, and obtain the amplified data of the abnormal data output by the timing coding module; The amplified abnormal data is input to the second autoencoder module, and the output data of the second autoencoder module with significant abnormal data is obtained. The significant output data of the abnormal data includes the abnormal data after reconstruction error amplification.

2. The method for detecting abnormal dairy cows according to claim 1, characterized in that, Before expanding the target data collected from all dairy cows during the target time period based on a preset time period, the method further includes: Acquire raw data, which includes individual information identified by electronic tags, time series of data collection, individual activity level information, cow physical appearance data, individual feeding duration, and milk production traits. The raw data is processed to obtain the target data, which includes the activity entropy data, body size and appearance parameter growth, individual growth status description, basic individual movement, milk production data dispersion, standard milk production value, and number of ruminations of each cow during the target time period at different growth stages. The individual activity data includes the number of steps taken by the ankle ring and the location of the neck ring; the cow's body conformation data includes chest width, loin strength, rump angle, hoof-heel depth, udder depth, teat length, rump width, bone quality, hind limb posterior view, central suspensory ligament, teat position, teat length, hind udder attachment height, hind udder attachment width, hind udder position, body depth, hoof angle, hind limb lateral view, hind udder attachment, and angularity; the individual feeding duration includes the neck ring data duration and rumination duration; the milk production traits include cumulative milk production, daily milk production, and milk production per feeding. The different growth stages include the calf stage, dry period, production period, and disease period.

3. The method for detecting abnormal dairy cows according to claim 2, characterized in that, Before processing the original collected data, the missing data in the original collected data is determined, the missing data is filled in, and the collected data after filling is obtained; The process of processing the raw collected data to obtain the target collected data includes: The data collected after filling is processed to obtain the target data.

4. The method for detecting abnormal dairy cows according to claim 1, characterized in that, The first autoencoder module is the same as the second autoencoder module; The first autoencoder module includes an encoder of a predetermined number of levels, a dimension processing layer, and a decoder of a predetermined number of levels; The step of inputting the timing augmentation data to the first autoencoder module and obtaining the reconstructed timing data output by the first autoencoder module includes: Input the timing augmentation data into the encoder of the preset number of levels, and obtain the data after reducing the number of nodes output by the encoder of the preset number of levels; Input the data after reducing the number of nodes into the dimension processing layer, and obtain the reconstructed data output by the dimension processing layer; Input the reconstructed data into the decoder of the preset number of levels, and obtain the data with added nodes output by the decoder of the preset number of levels to obtain the reconstructed timing data; The dimension processing layer is used to reduce the dimension of the data after the node reduction, and then increase the dimension of the data after the node reduction.

5. The method for detecting abnormal dairy cows according to claim 1, characterized in that, The process of inputting the reconstructed timing data to the timing coding module and obtaining the amplified abnormal data output by the timing coding module includes: The reconstructed timing data is input into the first layer of the timing coding module, and the average reconstructed data output by the first layer is obtained based on the reconstructed data corresponding to each timing sequence in the reconstructed timing data. The reconstructed average data is input to the second layer of the timing coding module. Based on the processing of the reconstructed average data and the reconstructed real data by the second layer, the reconstructed abnormal data output by the second layer is obtained. The reconstructed abnormal data is input into the third layer of the timing coding module to obtain the amplified abnormal data output by the third layer.

6. The method for detecting abnormal dairy cows according to claim 1, characterized in that, The step of determining the abnormal cows in the target time period based on the quantitative score of each cow in the output data of the abnormal data includes: Based on a preset classification algorithm, the significant output data of the abnormal data is processed to identify all abnormal data. For each abnormal data point, the abnormal data is quantified to obtain a quantitative score; If the quantitative score is greater than a preset threshold, the cow corresponding to the quantitative score is determined to be a non-abnormal cow. If the quantitative score is less than or equal to a preset threshold, the cow corresponding to the quantitative score is determined to be an abnormal cow.

7. An abnormal dairy cow detection device, characterized in that, include: First acquisition unit: used to expand the target data collected from all dairy cows in the target time period based on a preset time period, and acquire time-series expanded data; The second acquisition unit is used to input the time-series augmented data into the abnormal cow detection model and acquire the output data of the abnormal cow detection model where the abnormal data is significant. Determination Unit: Used to determine the abnormal cows in the target time period based on the quantitative score of each cow in the output data of the abnormal data; The time-series augmented data is a data set consisting of target acquisition data for the target time period, data acquired during a preset time period before the target time period, and data acquired during a preset time period after the target time period. The abnormal dairy cow detection model includes a first autoencoder module, a time-series encoding module, and a second autoencoder module; The step of inputting the time-series augmented data into the abnormal cow detection model and obtaining the output data of the abnormal cow detection model that shows significant abnormal data includes: Input the timing augmentation data into the first autoencoder module and obtain the reconstructed timing data output by the first autoencoder module; Input the reconstructed timing data into the timing coding module, and obtain the amplified data of the abnormal data output by the timing coding module; The amplified abnormal data is input to the second autoencoder module, and the output data of the second autoencoder module with significant abnormal data is obtained. The significant output data of the abnormal data includes the abnormal data after reconstruction error amplification.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the abnormal cow detection method as described in any one of claims 1-6.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the abnormal cow detection method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Abnormality detecting system

    US20230102979A1