Ewe oestrus identification method and system based on motion feature analysis, and electronic equipment
By using a motion feature analysis-based method combined with deep learning and machine learning algorithms, the estrus state of ewes can be identified, solving the problems of low efficiency and high false detection rate in existing technologies, and achieving high-precision estrus identification and management of ewes.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG UNIV
- Filing Date
- 2025-12-08
- Publication Date
- 2026-05-01
AI Technical Summary
Existing methods for identifying estrus in ewes suffer from low efficiency, high false positive rates, high costs, and a tendency to trigger stress in animals, making them unsuitable for modern farming practices.
A motion feature analysis-based approach is adopted, which combines YOLOv1 and ByteTrack algorithms to identify estrus behavior and calculate motion feature values through target detection, target tracking, and temporal motion feature analysis. A random forest classifier is then used for estrus classification.
It achieves high-precision, non-invasive intelligent recognition of estrus behavior in ewes, significantly reducing false alarm rates and improving the automation and precision of reproductive management.
Smart Images

Figure CN121963294A_ABST
Abstract
Description
Methods, systems, and electronic devices for identifying estrus in ewes based on motion feature analysis Technical Field
[0001] This invention belongs to the field of animal behavior recognition technology, specifically relating to a method and system for identifying estrus in ewes based on motion feature analysis, and electronic equipment. Background Technology
[0002] Accurately understanding the estrous cycle of ewes is crucial for achieving efficient reproduction. The average estrous cycle in sheep is 16 days, with each estrus cycle lasting approximately 30 hours. The optimal time for fertilization is within 24 hours; missing this period significantly reduces conception rates. Therefore, timely and accurate identification of estrus behavior in ewes helps achieve precise mating, effectively reducing the rates of non-pregnancy and return to estrus, thereby improving reproductive efficiency and the average number of lambs born per ewe annually, which is of great significance for enhancing the flock's reproductive capacity.
[0003] Currently, conventional methods for diagnosing estrus in ewes involve manual observation of their estrus activities and physiological conditions, including vulvar observation, behavioral observation, estrus detection, and vaginal examination. However, these manual methods are highly subjective, labor-intensive, and inefficient, making them unsuitable for large-scale, intensive ranching. With the development of electronic sensor and wireless network technologies, researchers in this field are using wearable devices with embedded sensors to collect estrus behavior data and diagnose estrus in ewes based on this data, thus reducing reliance on manual labor. Wearable sensor-based diagnostic methods are mainly divided into two types: one uses GNSS collars to monitor changes in the ewe's walking speed to identify estrus behavior, primarily used in large open ranches; the other involves installing accelerometers on rams and exposing them to the ewe flock, recording and analyzing mating behavior to identify the sheep's estrus status. Collecting estrus data in Hu sheep using contact sensors is relatively easy, but installing contact sensors can easily cause stress in the sheep and is susceptible to signal loss due to external factors. Furthermore, the high investment cost of large-scale wearable sensors hinders their widespread adoption in large-scale sheep farms. Therefore, there is an urgent need for an accurate, efficient, and low-cost technology to diagnose estrus behavior in ewes.
[0004] Computer vision technology, through non-invasive acquisition of video data of animals in their natural state, can accurately and efficiently monitor and analyze animal behavior patterns, and has become an important research tool for detecting abnormal animal behavior. Currently, related research mainly focuses on two types of methods: one is monitoring changes in the movement trajectory of ewes during estrus, and the other is detecting mounting behavior of rams on ewes. However, movement trajectory-based methods are easily affected by environmental interference (such as occlusion, changes in lighting), individual differences, and group aggregation, resulting in poor feature extraction stability. Furthermore, some ewes in estrus exhibit "standing estrus" without a significant increase in activity, leading to low sensitivity of these methods. Currently, they are mostly in the theoretical exploration stage and difficult to apply on a large scale. On the other hand, although mounting behavior is a significant external manifestation of estrus in ewes, existing research generally equates "being mounted" directly with "estrus," ignoring the complexity of behavior in group settings. In penned sheep pens, non-estrus mounting behavior often occurs due to resource competition, play, or ram misjudgment. If judgment is based solely on mounting events, false alarms are highly likely. Furthermore, existing methods lack the ability to discern the behavioral responses of ewes during mounting (such as whether they stand still or exhibit resistance), making it difficult to distinguish between genuine estrus and ineffective mounting. Therefore, there is an urgent need for an estrus identification method that integrates movement feature analysis and estrus intention assessment to improve the accuracy and reliability of reproductive management.
[0005] Based on the above existing technologies, their shortcomings can be summarized as follows: 1. Relying on manual inspection to manage sheep farms has problems such as low efficiency, high rate of missed inspections, and slow response, which makes it difficult to meet the needs of modern breeding.
[0006] 2. Estrus recognition methods based on wearable sensors are costly, prone to falling off, and can easily cause stress or cross-infection in animals, making them difficult to promote and apply in large-scale farming.
[0007] 3. The estrus detection method based on mounting behavior directly equates "being mounted" with "estrus" without considering non-estrus mounting behaviors caused by resource competition, play, or misjudgment by rams, resulting in a high false detection rate. Summary of the Invention
[0008] To overcome the shortcomings of existing technologies, such as reliance on manual labor, high false alarm rates, and inability to effectively utilize dynamic behavioral features, this invention provides a method for identifying estrus in ewes based on motion feature analysis. By integrating target detection, target tracking, and temporal motion feature analysis, it achieves automated, high-precision, and real-time identification of estrus behavior in ewes, providing technical support for intelligent breeding management of sheep flocks.
[0009] The present invention adopts the following technical solution: a method for identifying estrus in ewes based on motion feature analysis, the specific steps of which are as follows: S1, collect sheep activity videos and extract images of mounting behavior from the sheep activity videos; S2, identify mounting behavior based on the mounting behavior images and locate the position of the mounted ewe; S3, obtain the motion trajectory based on the mounting behavior of the sheep and the mounted ewe, and calculate the set of motion feature values based on the motion trajectory; S4, use an estrus classification algorithm based on the set of motion feature values to detect and classify estrus in ewes, and obtain the estrus identification result of ewes.
[0010] Preferably, in step S1, videos of the daily behavior of penned sheep are collected, and videos of sheep mounting are extracted from the sheep behavior videos, with each video segment ranging from 3 to 15 seconds.
[0011] Preferably, in step S2, the YOLOv11 algorithm is selected to train the constructed dataset to identify and locate the mounting behavior of sheep and the mounted ewes.
[0012] Preferably, in step S3, based on the identification results of step S2, the ewe corresponding to the non-sexual mounting event is determined to be in a non-estrus state; for sexual mounting behavior and the mounted ewe, the ByteTrack multi-target tracking algorithm is used for identity association and trajectory tracking.
[0013] Preferably, in step 3, the ByteTrack multi-target tracking algorithm is as follows: the detection boxes of the current frame are divided into high-scoring boxes and low-scoring boxes according to the confidence score; the IoU similarity between the high-scoring boxes and the predicted bounding boxes of the trajectory in the previous frame is calculated; and the high-scoring boxes are associated with the trajectory prediction boxes for the first time using the Hungarian algorithm; then, the trajectories that did not match in the first association are associated with the low-scoring detection boxes of the current frame for the second time.
[0014] Preferably, in step 3, based on the duration of the mounting behavior, a set of motion dynamic parameters are extracted to characterize the ewe's response to the mounting behavior, according to the movement trajectory of the ewe during this period. These parameters include the following five categories: (1) Velocity parameters: including the maximum, minimum, and average instantaneous velocity, as well as the static stability index (SSI) reflecting whether the ewe remains stationary; (2) Motion intensity parameters: including the average, maximum, and minimum velocity changes per unit time; (3) Head posture stability parameters: quantifying the change in the ewe's head orientation (HOV) during the mounting period; (4) Path morphology parameters: the trajectory straightness (TLI), used to measure the curvature of the movement path; and (5) Time domain parameters: including the temporal characteristics of the mounting behavior.
[0015] Preferably, in step 3, the geometric mean size of the target detection box is used as the scale normalization factor to perform relative normalization processing on the original pixel-level motion parameters; the formula for the scale factor is: Where t represents the sequence number of the current frame; k represents the loop variable for the sequence numbers of historical frames; S represents the average relative size of the target across the preceding m frames; t w represents the relative size of the target in frame t; t This represents the width of the detection box in that frame in pixels; h t The height pixel value of the detection box in this frame is represented; (1) The velocity parameters are: Where FPS represents the video frame rate, (x t ,y t (x) represents the center coordinates of the target bounding box in frame t; t-1 ,y t-1 The center coordinates of the target box in the previous frame t-1; Indicates the time interval between two frames; This represents the raw, unfiltered velocity; v t This indicates the corrected speed value after outlier filtering and upper limit limitation; v represents the sliding average velocity. max This represents the upper limit of the maximum effective velocity observed across all tracked trajectories; Indicates the anomaly detection threshold; Indicates the set coefficient; maximum speed: Where, "all mounted tracks" represents the set of all tracked mounted ewes, V max This represents the maximum speed value across all tracks where the ewe has been mounted; the minimum speed value is: Among them, V min This represents the minimum speed value across all tracks where the ewe has been mounted; the average speed value is: in, The average velocity represents the velocity over the entire trajectory or time period; M represents the total corrected velocity of all the ewes that were climbed; static stability index: Where T represents the detection duration; v th This represents the set threshold. The indicator function is 1 if the condition is met and 0 if the condition is not met; (2) The motion intensity parameters are: Where t represents the sequence number of the current frame; a represents the motion intensity; Indicates the raw motion intensity without filtering; A max This indicates the set exercise intensity threshold; a t This represents the motion intensity of frame t after outlier filtering and smoothing; median() represents the median value; mean() represents the average value; in, Indicates the motion intensity of target i; This represents the set of effective tracking times for target i; Represents the complete motion intensity sequence of target i; maximum motion intensity: in, The maximum motion intensity of target i during the entire detection period; minimum motion intensity: in, The minimum motion intensity of target i during the entire detection period; the average motion intensity: in, N represents the average motion intensity of target i during the entire detection period; N represents the number of valid frames successfully tracked by the mounted ewe during the entire detection period; (3) Head pose stability parameters are obtained from three key points on the front of the mounted ewe's body, including the top key point Ph(x). h ,y h ), Key point of the nose Pn(x) n ,y n ) and the key point of the neck Pe(x) e ,y e ), and generate candidate vectors based on the combination of three points; If only a single vector is available, use that single vector; if three vectors are available, use principal component analysis to calculate the eigenvector of the first principal component; the angle between adjacent frame vectors is used as follows: in, This represents the angle between the vectors of the f-th frame and the previous frame; STD() represents the standard deviation. (4) Path morphology parameters: (Indicates the vector direction of the f-th frame;) in, Indicates the ending position vector; Represents the starting position vector; Represents the position vector of the r-th frame; (5) The time domain parameters are: in, T represents the duration of the j-th climbing behavior event; d This represents the duration of a single climb; t e This represents the timestamp of the crawl's completion; t s The timestamp represents the start of the crawl; n represents the number of crawling actions detected; and T represents the total duration.
[0016] Preferably, in step S4, a machine learning algorithm is used to construct an estrus state diagnostic model. First, a ten-dimensional feature value is extracted from the processed motion dynamics parameters as the input of the classifier. This feature comprehensively covers information in five dimensions: velocity, acceleration, posture, trajectory, and time. Specifically, it includes: velocity features, motion intensity features, posture stability features, path morphology features, and time domain features. Then, this ten-dimensional feature vector is input into a pre-trained random forest classifier. The classifier votes on the input features through multiple decision trees and finally outputs a binary classification judgment result on the physiological state of the mounted ewe, namely, estrus or not estrus.
[0017] This invention also discloses a system for identifying estrus in ewes based on motion feature analysis, used to execute the above method, specifically including the following modules: an acquisition module for acquiring sheep activity videos and extracting mounting behavior images from the sheep activity videos; a positioning module for identifying mounting behavior based on the mounting behavior images and simultaneously locating the position of the mounted ewe; a tracking module for obtaining a movement trajectory based on the mounting behavior and the mounted ewe; a calculation module for calculating a set of motion feature values based on the mounting behavior and the movement trajectory of the mounted ewe; and a classification module for detecting and classifying estrus in ewes using an estrus classification algorithm based on the set of motion feature values, thereby obtaining the estrus identification result.
[0018] The present invention also discloses 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 steps or system of the above-described method for identifying estrus in ewes based on motion feature analysis.
[0019] This invention accurately locates mounting behavior and the mounted ewe using a deep learning model. It constructs an integrated analysis framework of "detection-tracking-feature value calculation-classification," achieving precise quantification of continuous behavioral sequences. This invention introduces a "testicular intention" discrimination mechanism for the first time, not only detecting "whether mounting has occurred," but also focusing on the behavioral response of the mounted ewe (such as whether she accepts mounting or resists), thereby effectively distinguishing between genuine estrus and ineffective mounting, significantly reducing the false alarm rate.
[0020] This invention achieves high-precision, non-invasive intelligent recognition of estrus behavior in ewes, effectively distinguishing between genuine estrus and invalid mounting, significantly reducing false alarm rates, and improving the automation and precision of reproductive management. Attached Figure Description
[0021] Figure 1 is a flowchart of a preferred embodiment of the present invention for identifying estrus in ewes based on motion feature analysis.
[0022] Figure 2 is a block diagram of a preferred embodiment of the present invention of an estrus recognition system for ewes based on motion feature analysis.
[0023] Figure 3 is a structural diagram of an electronic device according to a preferred embodiment of the present invention.
[0024] Figure 4 shows the differences in various behavioral parameters between ewes in estrus and ewes not in estrus.
[0025] Figure 5 is a structural diagram of the random forest classifier.
[0026] Figure 6 is a confusion matrix of the classification results on the test set. Detailed Implementation
[0027] The preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0028] As shown in Figure 1, this embodiment provides a method for identifying estrus in ewes based on motion feature analysis. This method addresses the problem of false positives and false negatives that easily occur in existing technologies that rely on single mounting behavior to identify estrus in ewes. The specific steps are as follows: S1. Video Acquisition: Acquire videos of sheep activities and extract mounting behavior images from these videos. Specifically, the video acquisition device is a standard color camera, and the acquisition location is a sheep pen. In this embodiment, each sheep pen is 4 meters long, 2 meters wide, and 0.85 meters high. To obtain high-quality behavioral image data, the camera is fixed on a support column 2.6 meters away from the sheep pen and 3 meters above the ground, used to film the sheep flocks in adjacent pens on both sides. The video data recorded by the camera is transmitted in real time via network cable and stored in a network video recorder. The recorder can generally be placed in a control room.
[0029] Videos of daily behavior of captive sheep were collected, and mounting videos were extracted from these videos, with each video ranging from 3 to 15 seconds. In intensive farming systems, animals exhibit complex social interactions. Besides sexual mounting behavior directly related to estrus, non-sexual mounting behaviors driven by non-reproductive motives are also common, such as inter-individual resource competition, social games, stress responses, or ewes mounting rams in reverse. Both of these behavioral patterns involve one animal placing its forelimbs on the back of another, supporting itself on its hind limbs while maintaining a forward-leaning posture. However, non-sexual mounting typically lacks pelvic thrusting movements, and its forelimb positioning is more arbitrary, primarily manifesting as one sheep pressing down on the back of another. This subtle difference allows for the classification of non-sexual mounting behaviors; therefore, in addition to distinguishing between the "mounted" category, two additional categories, "smounting" and "non-smounting," were added.
[0030] S2. Behavior Recognition: Based on video footage of sheep mounting behavior, this system automatically identifies sexual mounting and locates the spatial position of the mounted ewe. Specifically, it employs the YOLOv11 deep learning-based object detection algorithm to train the model end-to-end on a pre-constructed dataset of sheep mounting behavior containing labeled information. During training, video frames are used as input. Through adaptive anchor box calculation, mosaic data augmentation, and optimization using a multi-task loss function combining CIOU loss and classification loss, the model can accurately identify sexual and non-sexual mounting behaviors, locate the spatial position of the mounted ewe, and finally output its bounding box coordinates and corresponding confidence scores.
[0031] S3. Video tracking and feature extraction: Based on the mounting behavior of sheep and the mounted ewes, obtain the movement trajectory, and calculate the set of movement feature values based on the movement trajectory.
[0032] The video tracking is as follows: Based on the above recognition results, events identified as "non-sexual mounting" are directly determined to indicate that the corresponding ewe is not in estrus. For sexual mounting behavior and the mounted ewe, the ByteTrack multi-object tracking algorithm is used to achieve cross-frame identity association and trajectory tracking. Specifically: First, the algorithm divides the detection boxes into high-scoring boxes and low-scoring boxes based on the confidence score (the distinction between high-scoring and low-scoring boxes can be determined by setting a threshold). The IoU similarity between the high-scoring box in the current frame and the bounding box predicted from the trajectory in the previous frame is calculated, and the Hungarian algorithm is used to complete the first association based on the similarity. Then, the trajectory that did not match in the first association is associated with the low-scoring detection box in the current frame for the second time. Finally, the ByteTrack algorithm outputs a unique, spatiotemporally continuous, complete motion trajectory for each detected sexual mounting behavior and mounted ewe, providing a reliable data foundation for subsequent feature extraction.
[0033] The feature extraction (calculating a set of motion feature values based on the motion trajectory) is as follows: Based on the duration of the sexual mounting behavior (i.e., the time window from when the ram begins to contact the ewe to when the mounting ends), this embodiment extracts a set of motion dynamic parameters to characterize the ewe's response to the mounting behavior based on the motion trajectory of the ewe during this period. The parameters include the following five categories: (1) velocity parameters: including the maximum, minimum, and average instantaneous velocity, as well as the static stability index (SSI) reflecting whether the ewe remains stationary; (2) motion intensity parameters: including the average, maximum, and minimum velocity changes per unit time; (3) head posture stability parameters: quantifying the change in the ewe's head orientation (HOV) during the mounting period; (4) path morphology parameters: mainly trajectory straightness (TLI), used to measure the degree to which the motion path deviates from a straight line; (5) time domain parameters: including temporal features such as the duration of sexual mounting.
[0034] To eliminate target scale deviation caused by varying distances between sheep and the camera, the geometric mean size of the target detection box is used as a scale normalization factor to relatively normalize the original pixel-level motion parameters. The formula for the scale factor is: in, S represents the average relative size of the target across the preceding m frames; t w represents the relative size of the target in frame t; t This represents the width of the detection box in that frame in pixels; h t This represents the height of the detection box in that frame in pixels.
[0035] (1) The velocity parameters are: Among them, (x t ,y t (x) represents the center coordinates of the target bounding box in frame t; t-1 ,y t-1 The center coordinates of the target box in the previous frame (t-1); Indicates the time interval between two frames; This represents the raw, unfiltered velocity; v t This indicates the corrected speed value after outlier filtering and upper limit limitation; This represents the moving average velocity, which is the average velocity across several frames before and after the current moment, used to smooth out velocity fluctuations; v max This represents the upper limit of the maximum effective velocity observed across all tracked trajectories; Indicates the anomaly detection threshold; This indicates the set coefficient.
[0036] Maximum speed: Among them, V max This represents the maximum speed value across all tracks where the ewe has been mounted; the minimum speed value is: Among them, V min This represents the minimum speed value across all tracks where the ewe has been mounted; the average speed value is: in, The average velocity represents the velocity over the entire trajectory or time period; M represents the total number of corrected velocities across all "mounted" targets; static stability index: Where T represents the detection duration; v th The threshold value represents the set threshold. The threshold value used in this invention is dynamically calculated based on the height of the detection frame. It can be used as a reference or adjusted according to specific application requirements. It is an indicator function that returns 1 if the condition is true and 0 if the condition is false. The larger the value, the longer the static standing time; (2) The motion intensity parameters are: in, Indicates the raw motion intensity without filtering; A max This indicates the set exercise intensity threshold; a t This represents the motion intensity after outlier filtering and smoothing; median() represents the median value, used to suppress noise and enhance robustness against outliers; mean() represents the average value, used in the initial stage to avoid the influence of early anomalies; in, This represents the effective tracking time set of target i, i.e., in which frames the target was successfully detected; Represents the complete motion intensity sequence of target i; maximum motion intensity: in, The maximum motion intensity of target i during the entire detection period; minimum motion intensity: in, The minimum motion intensity of target i during the entire detection period; the average motion intensity: in, The average motion intensity of target i during the entire detection period is represented by N; N represents the number of valid frames that were successfully tracked during the entire detection period; (3) The head posture stability parameter is the change in head orientation. To avoid the loss of key points due to occlusion, three key points on the front of the body of the ewe being mounted are obtained, including the key point Ph(x) on the top of the head. h ,y h ), Key point of the nose Pn(x) n ,y n ) and the key point of the neck Pe(x) e ,y e Candidate vectors are generated based on the combination of three points. If only a single vector is available, use that vector; if three vectors are available, use principal component analysis (PCA) to extract their dominant orientation. Specifically: Assemble a data matrix from the vectors, center it, and calculate its covariance matrix. Then, perform eigenvalue decomposition on this covariance matrix and select the eigenvector corresponding to the largest eigenvalue as the first principal component. This principal component represents the dominant distribution trend of all original vectors and is used to estimate the stable orientation of the ewe's head. The angle between adjacent frame vectors is used as follows: Where STD() represents the standard deviation; This represents the angle between the vectors of the f-th frame and the previous frame. The smaller the value, the more stable the head.
[0037] (4) The path morphology parameter is the trajectory straightness: in, Represents the ending position vector; Represents the starting position vector; Represents the position vector of the r-th frame; The larger the value, the closer the trajectory is to a straight line.
[0038] (5) The time domain parameters are: Among them, T d This represents the duration of a single climb; t e This represents the timestamp of the crawl's completion; t s This represents the timestamp when the crawling started; n represents the number of crawling actions detected.
[0039] S4. Estrus Status Diagnosis: An estrus classification algorithm based on a set of motion feature values is used to detect and classify estrus in ewes, obtaining estrus identification results. Specifically: To transform the aforementioned quantitative features into a final physiological state judgment, this invention constructs an automatic estrus status classification module for ewes based on machine learning. First, a ten-dimensional feature value is extracted from the processed motion dynamics data as input to the classifier. This feature comprehensively covers five dimensions of information: velocity, acceleration, posture, trajectory, and time, specifically including: velocity features (4-dimensional), motion intensity features (3-dimensional), posture stability features (1-dimensional), path morphology features (1-dimensional), and time domain features (1-dimensional). The differences in behavioral parameters between ewes in estrus and those not in estrus are shown in Figure 4. Subsequently, this ten-dimensional feature vector is input into a random forest classifier, the structure of which is shown in Figure 5. This classifier uses multiple decision trees within it to vote on the input features, ultimately outputting a binary classification judgment result regarding the physiological state of the mounted ewe: "in estrus" or "not in estrus." It should be noted that the random forest classifier is trained under supervision using historical video data and its corresponding, expert-verified estrus state labels, thereby learning the precise mapping relationship from complex movement patterns to estrus states.
[0040] This example collected and labeled 300 video clips of ewe behavior, covering typical estrus and non-estrus behavior patterns. To verify the model's performance, the dataset was randomly divided into a training set (180 clips) and a test set (120 clips) in a 3:2 ratio. The test set contained 94 estrus samples and 26 non-estrus samples to reflect the transient nature of the estrus period in real-world farming environments. The model's classification results on the test set are shown in the confusion matrix in Figure 6, with a test set accuracy of 0.892.
[0041] As shown in Figure 2, this embodiment provides a system for identifying ewe estrus based on motion feature analysis, used to execute the above-described method embodiment. It includes the following modules: an acquisition module for acquiring videos of sheep activities and extracting images of mounting behavior from the videos; a positioning module for identifying mounting behavior based on the mounting behavior images and simultaneously locating the position of the mounted ewe; a tracking module for obtaining a movement trajectory based on the mounting behavior and the mounted ewe; a calculation module for calculating a set of motion feature values based on the mounting behavior and the movement trajectory of the mounted ewe; and an identification module for using an ewe estrus classification algorithm based on the set of motion feature values to detect and classify ewe estrus, obtaining an ewe estrus classification result.
[0042] Other aspects of this embodiment can be found in the above method embodiments.
[0043] As shown in Figure 3, an embodiment of the present invention provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps or system of any of the ewe estrus identification methods based on motion feature analysis.
[0044] A preferred embodiment of the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps or system of any of the ewe estrus identification methods based on motion feature analysis described in the present invention.
[0045] In summary, this invention provides a method and system for identifying estrus in ewes based on motion feature analysis. By employing and fusing a multimodal feature analysis algorithm for ewe estrus identification, it aims to construct an automated, high-precision, and non-invasive solution for monitoring ewe estrus status. This solution effectively addresses the false positives and false negatives caused by existing technologies that rely on single mounting behavior for judgment. It also avoids the stress and animal welfare problems caused to ewes by contact sensor methods, improves the accuracy of computer vision-based ewe estrus identification, and enables precise breeding management in large-scale sheep farms.
[0046] The above description is merely a detailed explanation of preferred embodiments and principles of the present invention. For those skilled in the art, there may be changes in specific implementation methods based on the ideas provided by the present invention, and these changes should also be considered within the scope of protection of the present invention.
Claims
1. A method for identifying estrus in ewes based on motion feature analysis, characterized in that, The specific steps are as follows: S1, collect videos of sheep activities and extract images of mounting behavior from the videos; S2, identify mounting behavior based on the mounting behavior images and locate the position of the mounted ewe; S3, obtain the movement trajectory based on the mounting behavior of the sheep and the mounted ewe, and calculate the set of motion feature values based on the movement trajectory; S4, use an estrus classification algorithm based on the set of motion feature values to detect and classify estrus in ewes, and obtain the estrus identification result.
2. The method for identifying estrus in ewes based on motion feature analysis as described in claim 1, characterized in that, step... In S1, videos of the daily behavior of penned sheep are collected, and videos of sheep mounting are extracted from the sheep behavior videos. Each video is between 3 and 15 seconds long.
3. The method for identifying estrus in ewes based on motion feature analysis as described in claim 1, characterized in that, In step S2, the YOLOv11 algorithm is selected to train the constructed dataset to identify and locate the mounting behavior of sheep and the ewes being mounted.
4. The method for identifying estrus in ewes based on motion feature analysis as described in any one of claims 1-3, characterized in that, In step S3, based on the identification results of step S2, the ewe identified as non-sexual mounting is determined to be in a non-estrus state. For sexual mounting behavior and mounted ewes, the ByteTrack multi-target tracking algorithm is used for identity association and trajectory tracking.
5. The method for identifying estrus in ewes based on motion feature analysis as described in claim 4, characterized in that, In step 3, the ByteTrack multi-target tracking algorithm is as follows: the detection boxes of the current frame are divided into high-scoring boxes and low-scoring boxes according to the confidence score. The IoU similarity between the high-scoring boxes and the predicted bounding boxes of the trajectory in the previous frame is calculated. The high-scoring boxes are then associated with the trajectory prediction boxes for the first time using the Hungarian algorithm. Then, the trajectories that did not match in the first association are associated with the low-scoring detection boxes of the current frame for the second time.
6. The method for identifying estrus in ewes based on motion feature analysis as described in claim 5, characterized in that, In step 3, based on the duration of the mounting behavior, a set of motion dynamic parameters are extracted to characterize the ewe's response to the mounting behavior, according to the movement trajectory of the ewe during this period. These parameters include the following five categories: (1) velocity parameters: including the maximum, minimum, and average instantaneous velocity, as well as the static stability index SSI, which reflects whether the ewe remains stationary; (2) motion intensity parameters: including the average, maximum, and minimum velocity changes per unit time; (3) head posture stability parameters: quantifying the change in the ewe's head orientation HOV during the mounting period. (4) Path morphology parameters: Trajectory straightness (TLI), used to measure the degree to which the motion path deviates from a straight line; (5) Time domain parameters: including the temporal characteristics of sexual climbing behavior.
7. The method for identifying estrus in ewes based on motion feature analysis as described in claim 6, characterized in that, In step 3, the geometric mean size of the target detection box is used as a scale normalization factor to relatively normalize the original pixel-level motion parameters; the formula for the scale factor is: Where t represents the sequence number of the current frame; k represents the loop variable for the sequence numbers of historical frames; S represents the average relative size of the target across the preceding m frames; t w represents the relative size of the target in frame t; t This represents the width of the detection box in that frame in pixels; h t The height pixel value of the detection box in this frame is represented; (1) The velocity parameters are: Where FPS represents the video frame rate, (x t ,y t (x) represents the center coordinates of the target bounding box in frame t; t-1 ,y t-1 The center coordinates of the target box in the previous frame t-1; Indicates the time interval between two frames; This represents the raw, unfiltered velocity; v t This indicates the corrected speed value after outlier filtering and upper limit limitation; v represents the sliding average velocity. max This represents the upper limit of the maximum effective velocity observed across all tracked trajectories; Indicates the anomaly detection threshold; Indicates the set coefficient; maximum speed: Where, "all mounted tracks" represents the set of all tracked mounted ewes, V max This represents the maximum speed value across all tracks where the ewe has been mounted; the minimum speed value is: Among them, V min This represents the minimum speed value across all tracks where the ewe has been mounted; the average speed value is: in, The average velocity represents the velocity over the entire trajectory or time period; M represents the total corrected velocity of all the ewes that were climbed; static stability index: Where T represents the detection duration; v th This represents the set threshold. The indicator function is 1 if the condition is met and 0 if the condition is not met; (2) The motion intensity parameters are: Where t represents the sequence number of the current frame; a represents the motion intensity; Indicates the raw motion intensity without filtering; A max This indicates the set exercise intensity threshold; a t This represents the motion intensity of frame t after outlier filtering and smoothing; median() represents the median value; mean() represents the average value; in, Indicates the motion intensity of target i; Indicate target The effective tracking time set; Represents the complete motion intensity sequence of target i; maximum motion intensity: in, The maximum motion intensity of target i during the entire detection period; minimum motion intensity: in, Indicate target Minimum exercise intensity during the entire testing period; average exercise intensity: in, Indicate target The average motion intensity during the entire detection period; N represents the number of valid frames that were successfully tracked during the entire detection period of the mounted ewe; (3) Head posture stability parameters are obtained from three key points on the front of the mounted ewe's body, including the top key point Ph(x). h ,y h ), Key point of the nose Pn(x) n ,y n ) and the key point of the neck Pe(x) e ,y e ), and generate candidate vectors based on the combination of three points; If only a single vector is available, use that single vector; if three vectors are available, use principal component analysis to calculate the eigenvector of the first principal component; the angle between adjacent frame vectors is used as follows: in, This represents the angle between the vectors of the f-th frame and the previous frame; STD() represents the standard deviation. (4) Path morphology parameters: (Indicates the vector direction of the f-th frame;) in, Indicates the ending position vector; Represents the starting position vector; Represents the position vector of the r-th frame; (5) The time domain parameters are: in, T represents the duration of the j-th climbing behavior event; d This represents the duration of a single climb; t e This represents the timestamp of the crawl's completion; t s The timestamp represents the start of the crawl; n represents the number of crawling actions detected; and T represents the total duration.
8. The method for identifying estrus in ewes based on motion feature analysis as described in claim 7, characterized in that, In step S4, a machine learning algorithm is used to construct an estrus state diagnostic model. First, a ten-dimensional feature value is extracted from the processed motion dynamics parameters as the input to the classifier. This feature comprehensively covers information in five dimensions: velocity, acceleration, posture, trajectory, and time. Specifically, it includes: velocity features, motion intensity features, posture stability features, path morphology features, and time domain features. Then, this ten-dimensional feature vector is input into a pre-trained random forest classifier. The classifier votes on the input features through multiple decision trees and finally outputs a binary classification judgment result on the physiological state of the mounted ewe, namely, estrus or not estrus.
9. A system for identifying estrus in ewes based on motion feature analysis, used to perform the method as described in any one of claims 1-8, characterized in that, Specifically, it includes the following modules: an acquisition module, used to acquire sheep activity videos and extract images of sheep mounting behavior from the sheep activity videos; a positioning module, used to identify mounting behavior based on the images of sheep mounting behavior and locate the position of the mounted ewe; and a tracking module, used to obtain the movement trajectory based on the sheep mounting behavior and the mounted ewe. The calculation module is used to calculate a set of motion feature values based on the mounting behavior of the sheep and the movement trajectory of the mounted ewe; the identification module is used to detect and classify the estrus of the ewe using an estrus classification algorithm based on the set of motion feature values, and obtain the estrus identification result of the ewe.
10. 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 steps of the ewe estrus identification method based on motion feature analysis as described in any one of claims 1-8 or the system as described in claim 9.