Pasture behavior monitoring method based on image recognition

By using image recognition technology and deep learning models, real-time and automated tracking and behavior recognition of ranch animals have been achieved, solving the problems of low efficiency in traditional manual observation and insufficient analysis in existing systems, improving monitoring efficiency and accuracy, and supporting scientific management decisions.

CN121121652APending Publication Date: 2025-12-12HENAN UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511409117.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-29
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

In traditional ranch management, manual observation of animal behavior is inefficient, costly, and highly subjective. Existing monitoring systems cannot achieve real-time, accurate analysis of complex behaviors and detection of anomalies around the clock.

Method used

Image recognition technology is used to perform target detection through the YOLOv8 model, and animal tracking and behavior recognition are performed by combining multi-target tracking algorithms and deep learning models (such as ResNet, HRNet, TCN, and isolated forest models) to achieve abnormal behavior detection.

Benefits of technology

It enables real-time, automated tracking and behavior recognition of ranch animals, improving monitoring efficiency and accuracy, timely detection of health problems, providing objective data to support management decisions, reducing labor costs, adapting to different environments, and ensuring the continuity and accuracy of behavior recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121121652A_ABST
    Figure CN121121652A_ABST
Patent Text Reader

Abstract

The invention relates to a pasture behavior monitoring method based on image recognition, and the method comprises the steps: collecting pasture image data, and carrying out the animal tracking; in the animal tracking process, behavior characteristic data of animals are extracted; identifying animal behaviors based on the behavior feature data; and carrying out abnormal behavior detection on an animal behavior recognition result. According to the invention, real-time and automatic tracking and behavior identification of pasture animals can be realized, the monitoring efficiency and accuracy are significantly improved, and the labor cost is reduced; animal behaviors are accurately analyzed by using the deep learning model, various behavior states can be quickly identified, abnormal behaviors can be early warned in time, and objective data support is provided for pasture management.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of modern animal husbandry, and in particular to a pasture behavior monitoring method based on image recognition. BACKGROUND

[0002] With the development of modern animal husbandry in scale and intensification, pasture managers are facing unprecedented challenges. The traditional pasture management method mainly relies on manual patrol, which is not only inefficient, but also cannot realize real-time monitoring all day round. The behavior monitoring of pasture animals is a key link for animal welfare guarantee and disease prevention. Through monitoring the behavior changes of animals, the health problems of animals can be found in time, such as abnormal behavior in early stage of disease, injury and breeding behavior, so that appropriate measures can be taken to reduce economic losses and improve production efficiency.

[0003] However, manual observation of animal behavior has many limitations. On the one hand, manual observation consumes a lot of manpower and time, especially in large pastures, where the number of animals is large and the distribution range is wide, making it difficult for manual observation to observe each animal in detail. On the other hand, manual observation is subjective, different observers may have different judgments on the same behavior, and is easily affected by environmental factors and observer experience. In addition, manual observation cannot realize continuous and quantitative analysis of animal behavior, and it is difficult to capture small changes and long-term trends of behavior. Some existing pasture monitoring systems can realize basic image acquisition and storage functions, but have limited ability to identify and analyze animal behavior, and often can only provide simple motion detection or preset behavior alarm, and cannot classify and analyze complex animal behavior in detail, nor can they realize automatic detection and early warning of abnormal behavior. Therefore, it is of great practical significance to develop a monitoring method that can efficiently and accurately identify and analyze the behavior of pasture animals. SUMMARY

[0004] The purpose of the present application is to provide a pasture behavior monitoring method based on image recognition to solve the problems existing in the prior art.

[0005] To achieve the above purpose, the present application provides the following solutions:

[0006] A pasture behavior monitoring method based on image recognition, comprising:

[0007] Collecting pasture image data and tracking animals;

[0008] Extracting behavior feature data of animals during animal tracking;

[0009] Identifying animal behavior based on the behavior feature data;

[0010] Detecting abnormal behavior based on the animal behavior identification result.

[0011] Optionally, the animal tracking comprises:

[0012] inputting the pasture image data into the pre-trained YOLOv8 model to perform target detection and obtain the bounding box coordinates, confidence and category of the animals;

[0013] based on the target detection result, using a multi-target tracking algorithm to complete animal tracking.

[0014] Optionally, using a multi-target tracking algorithm to complete animal tracking comprises:

[0015] cropping the image region corresponding to each target detection result and extracting the appearance feature vector of the cropped region through a pre-trained ResNet model;

[0016] using a Kalman filter to predict the motion state of each historical tracking target to obtain their predicted positions in the current frame;

[0017] based on the appearance feature vector and the predicted position of the current frame, calculating the association degree between the newly detected target detection result and the historical tracking target to determine the matching relationship between the detection box and the historical target;

[0018] updating the state information of the target with a successful association degree, including position and appearance feature; initializing the target with a failed association as a new tracking target and assigning a new unique ID; at the same time, removing the historical target that is not matched to the detection box for consecutive multiple frames from the tracking list.

[0019] Optionally, using a multi-target tracking algorithm, based on the appearance feature vector and the predicted position of the current frame, calculating the association degree between the newly detected target detection result and the historical tracking target comprises:

[0020] collecting the appearance feature vector and the current position of the newly detected target, and the appearance feature vector and the predicted position of the historical tracking target;

[0021] using the cosine similarity formula to calculate the similarity between the appearance feature vectors of the newly detected target and the historical tracking target to obtain an appearance similarity matrix;

[0022] using the Mahalanobis distance formula to measure the difference between the current position of the newly detected target and the predicted position of the historical tracking target to calculate a motion similarity matrix;

[0023] normalizing the appearance similarity matrix and the motion similarity matrix to the same interval, weighting and fusing according to the set weight coefficient to generate a comprehensive similarity matrix;

[0024] The Hungarian algorithm is used to match the comprehensive similarity matrix to determine the correlation between newly detected targets and historically tracked targets, and the matching results are output.

[0025] Optionally, the extracted animal behavioral characteristic data includes:

[0026] Based on the coordinates of the tracking box, crop out the region of interest (ROI) of a single animal from the original image;

[0027] The cropped animal ROI image is scaled to a fixed size and input into a pre-trained HRNet model to obtain the coordinates and confidence scores of predefined key points;

[0028] Normalize the coordinates of the key points;

[0029] A fixed-length sliding window is used to process the normalized keypoint data, adding the keypoint data of the latest frame and removing the oldest frame, and combining the T frames of data in the window into a mathematical tensor; the tensor represents the continuous posture changes of the animal in the most recent T frames, i.e. a behavioral segment.

[0030] Optionally, identifying animal behavior based on the behavioral characteristic data includes:

[0031] The behavioral feature data is input into a pre-trained temporal convolutional network model, where convolution operations are performed on the behavioral feature data to capture temporal dependencies. Finally, a probability distribution vector is output through a Softmax layer, and the behavior with the highest probability is taken as the animal behavior classification result for the current segment.

[0032] Optionally, abnormal behavior detection may be performed on the animal behavior recognition results, including:

[0033] Abnormal features are extracted from the animal behavior recognition results, including: the proportion of lying down behavior within a preset time period, the average symmetry of gait, and the number of feedings.

[0034] The extracted anomaly features are input into a pre-trained isolated forest model to score the anomaly features;

[0035] The score of the abnormal feature is compared with a preset threshold. If the score exceeds the threshold, an abnormality flag is triggered.

[0036] Optionally, the flags that trigger the exception include:

[0037] Send anomaly alerts to ranch managers, including: animal ID, time, anomaly type, confidence level, and relevant evidence fragments.

[0038] The beneficial effects of this invention are as follows:

[0039] This invention enables real-time, automated tracking and behavior recognition of ranch animals, significantly improving monitoring efficiency and accuracy, reducing labor costs, and enabling timely detection of animal health problems. Utilizing a deep learning model for precise analysis of animal behavior, it can quickly identify various behavioral states and provide timely warnings of abnormal behavior, offering objective data support for ranch management. The model, trained on extensive data, performs stably under different environmental conditions, effectively addressing image noise and occlusion issues to ensure accurate behavior recognition. The multi-target tracking algorithm, combining appearance and motion features, effectively avoids target confusion and loss, ensuring the continuity of behavior recognition. The accumulated behavioral data helps ranch managers optimize feeding management strategies, disease prevention measures, and breeding plans, improving production efficiency and animal welfare. Attached Figure Description

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

[0041] Figure 1 This is a schematic diagram of a ranch behavior monitoring method based on image recognition according to an embodiment of the present invention. Detailed Implementation

[0042] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0043] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0044] like Figure 1 As shown in the figure, this embodiment proposes a pasture behavior monitoring method based on image recognition, including:

[0045] Collect pasture image data for animal tracking;

[0046] During animal tracking, behavioral characteristic data of the animals are extracted;

[0047] Based on the behavioral characteristic data, animal behavior is identified;

[0048] Abnormal behavior detection is performed on the animal behavior recognition results.

[0049] Specifically, in this embodiment, pasture image data is collected: high-definition cameras deployed on the pasture are used to collect image data in real time;

[0050] For camera selection: Choose a high-definition network smart camera that supports PTZ (Pan-Tilt-Zoom) functionality. The resolution should be at least 1080p (1920x1080), preferably 4K to capture animal details at greater distances. The frame rate should be no less than 25fps to ensure smooth movement. It must have an IP66 or higher protection rating to withstand the harsh outdoor environment of the ranch (wind, rain, dust, temperature fluctuations).

[0051] Deployment Strategy: A combination of "key area coverage" and "wide-angle patrol" will be employed. Fixed-angle cameras will be deployed in key areas such as drinking points, feeding troughs, rest areas, and passageways. A small number of high-performance PTZ cameras will be deployed in open areas, covering a large area through preset position patrol or automatic tracking modes.

[0052] Edge computing nodes: Select based on the number of cameras and computing needs. For small to medium-sized ranches, one Jetson AGX Orin is sufficient to handle 4-6 high-definition video streams. Nodes need to be equipped with large-capacity solid-state drives (SSDs) for offline caching;

[0053] Network and Power: A solar power supply + battery solution is used, or nearby cable wiring is employed. The network utilizes 4G / 5G CPE or a wireless bridge to ensure stable data transmission. Edge nodes and cameras are connected via a gigabit switch to guarantee stable video stream transmission.

[0054] Animal tracking: Use object detection algorithms (such as YOLOv8) to detect animals in image data, obtain the bounding box coordinates, confidence scores and categories of the animals; then use multi-object tracking algorithms (such as DeepSORT) to track the animals, and assign a unique ID to each animal;

[0055] Extract behavioral feature data: Based on the coordinates of the tracking box, crop out the image region (ROI) of a single animal from the original image; scale the ROI image to a fixed size and input it into the pre-trained HRNet model to obtain the coordinates and confidence scores of key points; normalize the coordinates of the key points.

[0056] Animal behavior identification: Input behavioral feature data into a pre-trained Temporal Convolutional Network (TCN) model to capture temporal dependencies, output a probability distribution vector through a Softmax layer, and take the behavior with the highest probability as the animal behavior classification result for the current segment;

[0057] Abnormal behavior detection: Extract abnormal features from animal behavior recognition results, including the proportion of lying down behavior within a preset time period, the average symmetry of gait, and the number of feedings; input the extracted abnormal features into a pre-trained isolated forest model to score the abnormal features; compare the scores of the abnormal features with preset thresholds, and trigger an abnormal flag if the scores exceed the thresholds.

[0058] Furthermore, animal tracking includes:

[0059] The pasture image data is input into a pre-trained YOLOv8 model for object detection, and the bounding box coordinates, confidence scores, and categories of animals are obtained.

[0060] Based on the target detection results, a multi-target tracking algorithm is used to complete animal tracking.

[0061] Furthermore, using multi-target tracking algorithms to complete animal tracking includes:

[0062] For each target detection result, the corresponding image region is cropped, and the appearance feature vector of the cropped region is extracted by a pre-trained ResNet model;

[0063] The motion state of each historical tracked target is predicted using a Kalman filter to obtain their predicted position in the current frame;

[0064] Based on the appearance feature vector and the predicted position of the current frame, the correlation between the newly detected target detection result and the historical tracked target is calculated, and the matching relationship between the detection box and the historical target is determined.

[0065] Update the status information of targets that are successfully matched in terms of correlation, including their location and appearance features; initialize targets that fail to match as new tracking targets and assign them a new unique ID; and remove historical targets that have not matched the detection box for multiple consecutive frames from the tracking list.

[0066] Furthermore, using a multi-target tracking algorithm, based on the appearance feature vector and the predicted position of the current frame, the correlation between the newly detected target detection result and the historically tracked targets is calculated, including:

[0067] Collect the appearance feature vectors and current positions of newly detected targets, as well as the appearance feature vectors and predicted positions of historically tracked targets;

[0068] Using the cosine similarity formula, the similarity between the appearance feature vectors of newly detected targets and historically tracked targets is calculated to obtain the appearance similarity matrix;

[0069] The Mahalanobis distance formula is used to measure the difference between the current position of a newly detected target and the predicted position of a historically tracked target, and a motion similarity matrix is ​​calculated.

[0070] The appearance similarity matrix and motion similarity matrix are normalized to the same interval, and then weighted and fused according to the set weight coefficients to generate a comprehensive similarity moment.

[0071] The Hungarian algorithm is used to match the comprehensive similarity matrix to determine the correlation between newly detected targets and historically tracked targets, and the matching results are output.

[0072] Specifically, in this embodiment, achieving precise tracking of pasture animals includes the following steps:

[0073] The first step involves inputting real-time collected pasture image data into a pre-trained YOLOv8 model for object detection. This model excels at quickly and accurately identifying objects in images. The model analyzes the image, labels the bounding box coordinates of each animal, and determines its specific location within the image. It also provides a confidence score for each detection result, indicating the model's confidence in the outcome, as well as the animal's category; common pasture animals like cows and sheep can be accurately classified.

[0074] The second step involves continuously tracking the animal using a multi-target tracking algorithm. Here, the image region involved in each target detection result is cropped to focus on the animal itself. The cropped image is then input into a pre-trained ResNet model to extract the animal's appearance feature vector, which describes its physical characteristics. Simultaneously, a Kalman filter is used to predict the motion state of each historically tracked target, inferring their predicted position in the current frame based on their previous velocity and orientation.

[0075] The third step involves calculating the correlation between newly detected targets and historically tracked targets based on the extracted appearance feature vectors and the predicted current frame position. This determines whether the detection box and the historical target belong to the same animal. If the correlation matches successfully, the target's state information is updated, including its new position in the image and its latest appearance features. If the match fails, the newly detected target is treated as a new tracking target, assigned a unique ID, and a new round of tracking begins. If a historical target fails to match a new detection box for several consecutive frames, it is considered to have left the current field of view and is removed from the tracking list.

[0076] The fourth step details how the multi-target tracking algorithm calculates the correlation. First, the appearance feature vectors and current positions of newly detected targets, as well as relevant information about historically tracked targets, are collected. Using the cosine similarity formula, the similarity between the appearance feature vectors of the new and old targets is calculated, constructing an appearance similarity matrix. Next, the Mahalanobis distance formula is used to measure the difference between the current position of the newly detected target and the predicted position of historically tracked targets, generating a motion similarity matrix. Then, both similarity matrices are normalized to the same interval, typically [0, 1], and then weighted and fused according to set weight coefficients (e.g., appearance similarity weight set to 0.4, motion similarity weight set to 0.6) to synthesize a comprehensive similarity matrix. Finally, the classic Hungarian algorithm is used to match and calculate the comprehensive similarity matrix, yielding the optimal correlation between the newly detected target and historically tracked targets, and outputting the corresponding matching results. This enables continuous, stable, and accurate tracking of multiple animals in a pasture, laying a solid foundation for subsequent research on animal behavior patterns and monitoring their health.

[0077] Furthermore, the extraction of animal behavioral characteristic data includes:

[0078] Based on the coordinates of the tracking box, crop out the region of interest (ROI) of a single animal from the original image;

[0079] The cropped animal ROI image is scaled to a fixed size and input into a pre-trained HRNet model to obtain the coordinates and confidence scores of predefined key points;

[0080] Normalize the coordinates of the key points;

[0081] A fixed-length sliding window is used to process the normalized keypoint data, adding the keypoint data of the latest frame and removing the oldest frame, and combining the T frames of data in the window into a mathematical tensor; the tensor represents the continuous posture changes of the animal in the most recent T frames, i.e. a behavioral segment.

[0082] Specifically, in this embodiment, extracting behavioral characteristic data of pasture animals includes the following steps:

[0083] Image cropping: Based on the coordinates of the animal tracking box, the image region (ROI) of a single animal is precisely cropped from the original image to ensure that only the part of the animal that needs to be analyzed is retained.

[0084] Image scaling: The cropped animal ROI image is adjusted to a fixed size required by the HRNet model, usually 256x256 or 384x288 pixels, to meet the model input requirements.

[0085] Keypoint detection: The scaled animal ROI image is input into the pre-trained HRNet model. The model analyzes the animal's pose and outputs predefined keypoint coordinates (such as the animal's joint positions) and the confidence score of each keypoint, indicating the reliability of the detection results.

[0086] Key point coordinate normalization: The obtained key point coordinates are normalized and mapped to the [0, 1] interval to eliminate the influence of image scale differences on subsequent analysis.

[0087] Sliding window data processing: A fixed-length sliding window mechanism is used to process the normalized keypoint data. The latest frame of keypoint data is added to the window, while the oldest frame is removed, ensuring that the window retains data from the most recent T frames. These T frames are then combined into a tensor that represents the animal's continuous pose changes within the most recent T frames, forming a complete behavioral segment and providing a data foundation for subsequent behavior recognition and analysis.

[0088] Furthermore, based on the behavioral characteristic data, identifying animal behavior includes:

[0089] The behavioral feature data is input into a pre-trained temporal convolutional network model, where convolution operations are performed on the behavioral feature data to capture temporal dependencies. Finally, a probability distribution vector is output through a Softmax layer, and the behavior with the highest probability is taken as the animal behavior classification result for the current segment.

[0090] Specifically, in this embodiment, the steps for identifying animal behavior are as follows:

[0091] Animal behavioral feature data (i.e., behavioral segment tensors, representing the continuous pose changes of the animal within the most recent T frames) are input into a pre-trained Temporal Convolutional Network (TCN) model;

[0092] The TCN model performs convolution operations on behavioral feature data to capture the temporal dependencies, that is, to analyze the changing patterns of animal posture over time.

[0093] Finally, the TCN model outputs a probability distribution vector through its Softmax layer, which represents the probability that the current segment belongs to different behavior categories.

[0094] The behavior with the highest probability is taken as the animal behavior classification result for the current segment, thereby achieving accurate identification of animal behavior.

[0095] Furthermore, abnormal behavior detection based on animal behavior recognition results includes:

[0096] Abnormal features are extracted from the animal behavior recognition results, including: the proportion of lying down behavior within a preset time period, the average symmetry of gait, and the number of feedings.

[0097] The extracted anomaly features are input into a pre-trained isolated forest model to score the anomaly features;

[0098] The score of the abnormal feature is compared with a preset threshold. If the score exceeds the threshold, an abnormality flag is triggered.

[0099] Furthermore, the flags that trigger exceptions include:

[0100] Send anomaly alerts to ranch managers, including: animal ID, time, anomaly type, confidence level, and relevant evidence fragments.

[0101] Specifically, in this embodiment, abnormal behavior detection of animal behavior recognition results includes the following steps:

[0102] Anomaly feature extraction:

[0103] First, abnormal features are extracted from the animal behavior recognition results. These features include the percentage of lying-down behaviors within a preset time period, the average symmetry of gait, and the number of feedings.

[0104] The percentage of lying-down behavior can be determined by calculating the ratio of the time an animal spends lying down to the total time within a preset time period.

[0105] The average symmetry of gait is assessed by analyzing the coordination of the limbs when the animal walks. Low symmetry may indicate problems such as lameness.

[0106] The number of feeding sessions is the frequency of animal feeding behavior recorded within a preset time period.

[0107] Feature input and scoring:

[0108] The extracted anomaly features are input into a pre-trained Isolation Forest model. The Isolation Forest model is an effective anomaly detection algorithm that identifies anomalies by identifying isolated feature points.

[0109] The model analyzes the abnormal features of the input and gives an abnormality score, which reflects the degree of abnormality in the animal's behavior.

[0110] Threshold comparison and anomaly detection:

[0111] The abnormality score is compared with a preset threshold. This threshold is trained based on normal behavior data and is used to distinguish between normal and abnormal behavior.

[0112] If the abnormal score exceeds a preset threshold, the animal's behavior is considered abnormal, triggering an abnormality flag. This flag prompts ranch managers to pay attention to the animal and conduct further inspections and actions.

[0113] By following the steps outlined above, ranch managers can effectively monitor abnormal animal behavior, identify problems promptly, and thus improve ranch management efficiency and animal welfare.

[0114] The image recognition-based ranch behavior monitoring method provided by this invention has many significant advantages. First, it enables real-time, automated tracking and behavior recognition of ranch animals, greatly improving monitoring efficiency and accuracy. Compared to traditional manual observation methods, this invention allows for continuous, 24 / 7 monitoring of animals in the ranch, eliminating the need for individual manual checks and significantly saving labor and time costs. Through precise analysis of animal behavior using a deep learning model, it can quickly identify various behavioral states, such as standing, walking, lying down, and feeding, and promptly detect abnormal behaviors, such as lameness, stereotyped behaviors, and aggressive behaviors. This provides ranch managers with detailed and objective animal behavior data, facilitating timely intervention and ensuring animal health and productivity.

[0115] Secondly, this invention possesses strong environmental adaptability and robustness. The deep learning model employed has been trained on a large amount of data and maintains stable performance under different lighting conditions, weather conditions, and complex pasture environments. Through data augmentation techniques and model optimization methods, the model can effectively address issues such as image noise and occlusion, ensuring accurate identification of animal behavior in practical applications. Furthermore, the multi-target tracking algorithm combines appearance and motion features, enabling accurate differentiation and tracking of each animal even when they are densely packed or occluded, avoiding target confusion and loss, and ensuring the continuity and accuracy of behavior recognition.

[0116] Furthermore, this invention provides strong data support for ranch management decisions. Through long-term accumulation and analysis of animal behavior data, ranch managers can gain a deep understanding of animal behavior patterns and health conditions, providing a basis for scientifically formulating feeding and management strategies, disease prevention and control measures, and breeding plans. For example, feed feeding programs can be optimized based on animal feeding behavior data, animal comfort and health status can be assessed based on lying behavior data, and potential limb diseases can be detected in advance based on gait analysis. At the same time, the abnormal behavior detection function can provide timely warnings of animal health problems, controlling disease risks at the nascent stage, reducing economic losses caused by disease transmission, and improving the overall production efficiency and animal welfare level of the ranch.

[0117] Finally, this invention boasts excellent scalability and compatibility. The system adopts a cloud-edge-device collaborative architecture, allowing for flexible configuration of hardware and computing resources based on the actual scale and needs of the ranch. At the algorithm level, it supports continuous optimization and upgrades of the deep learning model. As training data increases, the model's performance continuously improves, adapting to ever-changing ranch environments and monitoring requirements. Furthermore, this invention can be seamlessly integrated with other ranch management systems, such as animal growth monitoring systems, environmental control systems, and feed management systems, achieving comprehensive intelligent and information-based ranch management and promoting the development of modern animal husbandry towards efficiency, precision, and sustainability.

[0118] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.

Claims

1. A method for monitoring ranch behavior based on image recognition, characterized in that, include: Collect pasture image data for animal tracking; During animal tracking, behavioral characteristic data of the animals are extracted; Based on the behavioral characteristic data, animal behavior is identified; Abnormal behavior detection is performed on the animal behavior recognition results.

2. The pasture behavior monitoring method based on image recognition according to claim 1, characterized in that, Animal tracking includes: The pasture image data is input into a pre-trained YOLOv8 model for object detection, and the bounding box coordinates, confidence scores, and categories of animals are obtained. Based on the target detection results, a multi-target tracking algorithm is used to complete animal tracking.

3. The pasture behavior monitoring method based on image recognition according to claim 2, characterized in that, Using multi-target tracking algorithms to track animals includes: For each target detection result, the corresponding image region is cropped, and the appearance feature vector of the cropped region is extracted by a pre-trained ResNet model; The motion state of each historical tracked target is predicted using a Kalman filter to obtain their predicted position in the current frame; Based on the appearance feature vector and the predicted position of the current frame, the correlation between the newly detected target detection result and the historical tracked target is calculated, and the matching relationship between the detection box and the historical target is determined. Update the status information of targets that are successfully matched in terms of correlation, including their location and appearance features; initialize targets that fail to match as new tracking targets and assign them a new unique ID; and remove historical targets that have not matched the detection box for multiple consecutive frames from the tracking list.

4. The pasture behavior monitoring method based on image recognition according to claim 3, characterized in that, Using a multi-target tracking algorithm, based on the appearance feature vector and the predicted position of the current frame, the correlation between the newly detected target detection result and the historically tracked targets is calculated, including: Collect the appearance feature vectors and current positions of newly detected targets, as well as the appearance feature vectors and predicted positions of historically tracked targets; Using the cosine similarity formula, the similarity between the appearance feature vectors of newly detected targets and historically tracked targets is calculated to obtain the appearance similarity matrix; The Mahalanobis distance formula is used to measure the difference between the current position of a newly detected target and the predicted position of a historically tracked target, and a motion similarity matrix is ​​calculated. The appearance similarity matrix and motion similarity matrix are normalized to the same interval, and then weighted and fused according to the set weight coefficients to generate a comprehensive similarity moment. The Hungarian algorithm is used to match the comprehensive similarity matrix to determine the correlation between newly detected targets and historically tracked targets, and the matching results are output.

5. The pasture behavior monitoring method based on image recognition according to claim 1, characterized in that, The extraction of animal behavioral data includes: Based on the coordinates of the tracking box, crop out the region of interest (ROI) of a single animal from the original image; The cropped animal ROI image is scaled to a fixed size and input into a pre-trained HRNet model to obtain the coordinates and confidence scores of predefined key points; Normalize the coordinates of the key points; A fixed-length sliding window is used to process the normalized keypoint data, adding the keypoint data of the latest frame and removing the oldest frame, and combining the T frames of data in the window into a mathematical tensor; the tensor represents the continuous posture changes of the animal in the most recent T frames, i.e. a behavioral segment.

6. The pasture behavior monitoring method based on image recognition according to claim 1, characterized in that, Based on the aforementioned behavioral characteristic data, identifying animal behavior includes: The behavioral feature data is input into a pre-trained temporal convolutional network model, where convolution operations are performed on the behavioral feature data to capture temporal dependencies. Finally, a probability distribution vector is output through a Softmax layer, and the behavior with the highest probability is taken as the animal behavior classification result for the current segment.

7. The pasture behavior monitoring method based on image recognition according to claim 1, characterized in that, Abnormal behavior detection based on animal behavior recognition results includes: Abnormal features are extracted from the animal behavior recognition results, including: the proportion of lying down behavior within a preset time period, the average symmetry of gait, and the number of feedings. The extracted anomaly features are input into a pre-trained isolated forest model to score the anomaly features; The score of the abnormal feature is compared with a preset threshold. If the score exceeds the threshold, an abnormality flag is triggered.

8. The pasture behavior monitoring method based on image recognition according to claim 7, characterized in that, The flags that trigger exceptions include: Send anomaly alerts to ranch managers, including: animal ID, time, anomaly type, confidence level, and relevant evidence fragments.