Livestock three-dimensional behavior detection method

Through the combination of multi-view camera system and deep learning algorithms, 3D convolutional neural network and RT-DETRv3 Transformer were integrated to build a domestic animal stereo behavior detection system, solving the problem of difficult detection accuracy and speed in the existing technology, and realizing the Accurate identification and efficient detection of the three-dimensional behavior of livestock.

CN119445615AActive Publication Date: 2025-02-14ANHUI AGRICULTURAL UNIVERSITY +1

Patent Information

Application Number
CN202411471779.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-22
Publication Date
2025-02-14
Estimated Expiration
2044-10-22

AI Technical Summary

Technical Problem

It is difficult for the prior art to accurately match the two-dimensional and three-dimensional images of domestic livestock while taking into account the accuracy and speed of behavior detection, and to comprehensively and three-dimensionally detect various domestic livestock behaviors.

Method used

A multi-view camera system combined with deep learning algorithm is used to integrate 3D convolutional neural network and RT-DETRv3 Transformer to build a stereoscopic behavior detection system for livestock, and output different behaviors of livestock through real-time detection models for classification and analysis, and generate visual statistical reports.

Benefits of technology

It realizes accurate identification of the three-dimensional behavior of domestic animals, improves the accuracy and efficiency of detection, reduces the consumption of computing resources, and is suitable for real-time monitoring of various domestic animals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119445615A_ABST
    Figure CN119445615A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of video processing, and discloses a livestock three-dimensional behavior detection method, which comprises the following steps: S1, establishing a livestock three-dimensional behavior detection system for shooting livestock behavior videos; s2, constructing a livestock three-dimensional behavior real-time detection model, namely an RT-DETRv3 model; and S3, according to a livestock shot video acquired by the behavior detection system, outputting different behaviors of the livestock by using the real-time detection model for classification and analysis, and generating a visual livestock behavior statistical report. According to the invention, through combination of the multi-view camera system and the deep learning algorithm, especially integration of the 3D convolutional neural network and the RT-DETRv3Transformer, three-dimensional behaviors of livestock can be captured in real time. Compared with the prior art which only depends on two-dimensional monitoring of a single visual angle, the method can achieve the precise recognition of the complex three-dimensional postures of standing, lying, walking and the like of the livestock, and greatly improves the detection accuracy and precision. In addition, attitude key point detection and a multi-target supervision mechanism are used.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of video processing, and in particular to a method for detecting the three-dimensional behavior of livestock. Background Art

[0002] Livestock play a vital role in human society. They are not only an important guarantee of food sources, but also have an irreplaceable position in agricultural production, ecological cycle, cultural heritage and economic development. Common livestock include pigs, cattle, sheep, etc. Behavioral testing of livestock and evaluating their health status, welfare level and production performance are of great practical significance for food safety, public health and agricultural sustainability.

[0003] The eating, drinking, walking and resting behaviors of livestock are key indicators for assessing their health status. Abnormalities in these basic habits may indicate health problems or discomfort. By monitoring these behaviors, health problems can be detected and resolved early, the spread of diseases can be reduced, and the production efficiency and living standards of livestock can be improved. Traditional manual methods of detecting livestock behaviors generally have problems such as high labor intensity, strong subjectivity, poor real-time performance, and low efficiency. Artificial intelligence technology uses contact and non-contact monitoring methods to monitor and analyze livestock's eating, drinking, exercise, and resting behaviors. It can enhance the degree of automation, ensure accuracy and objectivity, monitor in real time, and improve breeding efficiency, and has gradually become the mainstream method in the industry. For example, Pan Zhixin et al. published a paper on postpartum behavior recognition of sows based on wearable devices in the Journal of the Chinese Society of Agricultural Engineering, which mentioned the use of contact sensors to identify the living habits of postpartum sows. However, wearable devices are easy to lose, which will bring inconvenience to subsequent tracking and management. Fu Chenfu et al. published a method for identifying and tracking cattle behavior based on improved YOLO v8 in the Journal of the Chinese Society of Agricultural Machinery, which studied the identification of cattle standing, lying, eating, drinking and licking behaviors. However, this method has the problems of inaccurate positioning, difficulty in handling dense targets, and only obtaining two-dimensional spatial information of cattle. Geng Yanli et al. published a paper on the study of group pig target detection algorithm based on Transformer and adaptive spatial feature fusion in the Journal of Northeast Agricultural University. The method used in the paper has improved detection accuracy and obtained the spatial characteristics of group pigs, but the detection speed is still slow. Therefore, it is still challenging to effectively balance the accuracy and speed of behavior detection, accurately match the two-dimensional and three-dimensional images of livestock, and comprehensively and three-dimensionally detect various livestock behaviors. Summary of the invention

[0004] In order to solve the technical problems raised in the background technology, the present invention provides a method for detecting three-dimensional behavior of livestock.

[0005] The present invention is implemented by the following technical solution: A method for detecting the three-dimensional behavior of livestock comprises the following steps:

[0006] Step S1, building a livestock three-dimensional behavior detection system for shooting livestock behavior videos;

[0007] Step S2, constructing a real-time detection model for livestock stereoscopic behavior, namely, the RT-DETRv3 model;

[0008] Step S3: Based on the livestock video captured by the behavior detection system, the different behaviors of the livestock are classified and analyzed using the real-time detection model output, and a visualized statistical report of the livestock behaviors is generated.

[0009] Preferably, the workflow of RT-DETRv3 in step S2 is as follows:

[0010] Collect livestock behavior video samples and send them to a computer; the video samples include video information from different perspectives, such as frontal, oblique, and top-down perspectives. Use Social LEAP Estimates Animal Poses (SLEAP) and LabelImg software to annotate the coordinates of livestock posture key points and livestock behavior rectangular frames, assign corresponding label categories, and store the annotated data as CSV files and TXT files respectively;

[0011] Import and fuse the labeled data; import the labeled SLEAP data (CSV file containing posture key points) and LabelImg labeled data (TXT file containing bounding boxes) into the computer, and perform feature fusion through the adaptive attention mechanism, dynamically adjust the video feature weights of each view, extract useful posture and behavior information from different camera perspectives (front, side, top view), improve the stereoscopic recognition effect of livestock behavior, combine multi-perspective video streams, rely on posture estimation and bounding box detection to capture the fine movements and overall behavior patterns of livestock;

[0012] Feature processing: 3D Convolutional Neural Network (3D-CNN) is used to process the fused features. 3D Convolutional Neural Network is used to analyze the behavioral changes of livestock in time series and identify their action patterns. By performing convolution operations on the time dimension, it can extract the continuous behavioral features of livestock from multiple frames and capture the dynamic changes of actions.

[0013] Real-Time Detection Transformer Version 3 (RT-DETRv3) is used for stereo behavior detection. Based on the fusion of SLEAP and LabelImg data, RT-DETRv3 is used to detect the three-dimensional behavior of livestock end-to-end. The one-to-many dense supervision mechanism of RT-DETRv3 can simultaneously capture the posture changes and overall behavior information of livestock, and perform efficient feature extraction through a hierarchical convolutional network to ensure real-time detection with low computing resources.

[0014] Preferably, the classification analysis of different behaviors of livestock in step 3 includes 3D posture estimation, stereoscopic behavior bounding box, behavior category and management suggestions of livestock, and management suggestions such as abnormal livestock behavior alarms or management reminders of specific behavior frequencies assist users in intervention and management.

[0015] Preferably, when collecting the livestock behavior video samples, the front, side and top view cameras are turned on at the same time; the livestock behavior video sample collection frequency is 30 frames per second, the recording video duration of each camera is 24 hours, and the samples include various behavior patterns of livestock; when using SLEAP to mark the key points of the posture, the key joints of the livestock (such as the head, front legs, hind legs, tail, etc.) are marked to ensure the accuracy of the posture estimation; each livestock posture information is saved in the form of 2D coordinates, and the 2D coordinates are converted into 3D coordinates using multi-view annotation, and the process is achieved by the triangulation method of multi-view geometry, and the calculation formula is:

[0016] X 3D =Triangulate(x f ,x s ,x t ,P f ,P s ,P t )

[0017] Where: X 3D Indicates the position of the key points of livestock posture in 3D space; Triangulate represents the triangulation function; x f 、x s and x t Respectively represent the 2D posture key point coordinates of livestock taken from the front, side and top view; P f , P s and P t Represent the projection moments of the front, side and top view cameras respectively.

[0018] Preferably, LabelImg software is used to label the behavior rectangles of livestock in the video, and the behavior categories (such as eating, walking, resting, socializing, etc.) are labeled. Each frame of data contains the behavior boundary box and label information; during the labeling process, the behavior and posture information of each view are synchronized, and the video frame labeling frequency is strictly aligned with the timestamp; multi-view fusion is used to integrate the three-view 2D behavior rectangles of livestock into a complete 3D boundary box, and the calculation formula is:

[0019] B 3D =Fuse(B f ,B s ,B t ,P f ,P s ,P t )

[0020] Where: B 3D represents the final fused 3D bounding box of livestock behavior; Fuse represents the geometric (feature) fusion function; B f , B s and B t Respectively represent the 2D bounding box data of livestock behavior under the front view, side view and top view, and the calculation formula is:

[0021]

[0022] Where: represents the 2D coordinates of the i-th corner point of the 2D bounding box of the livestock behavior under the normal viewing angle, i = 1, 2, 3, 4; each corner point Contains two components, which are the horizontal coordinates on the image plane of the normal view and the vertical coordinate Similarly, the 2D bounding box data B of livestock behavior under side and top view can be derived s , B t .

[0023] Preferably, an adaptive attention mechanism involving multi-view feature fusion and adaptive weight allocation is used, and the adaptive convolution feature fusion calculation formula is:

[0024]

[0025] Where: F final represents the final fusion feature combining the convolution features of the front view, side view and top view; n = 1, 2, 3, representing the front view, side view and top view respectively; α i Represents the adaptive attention weight under the corresponding view; Conv represents the convolution operation; I i represents the input image or video frame of the corresponding view; W i Represents the weight of the convolution layer used to process the corresponding view;

[0026] Preferably, the 3D convolutional neural network is used to process time series features and extract the action changes of livestock at different time points, and the calculation formula is:

[0027]

[0028] Where: F t Represents the 3D features at time t; Conv3D represents the 3D convolution operation; V t:t+n represents the n-frame video sequence starting from time t; W 3D represents the 3D convolution kernel weight; λ represents the adjustment parameter used to balance the 3D convolution and fusion features

[0029] Preferably, a posture key point loss function is introduced in the process of using RT-DETRv3 for stereoscopic behavior detection to optimize the posture key points of the target livestock so that the model can accurately locate the key points of the livestock in the multi-view video. The calculation formula is:

[0030]

[0031] Where: L keypoints represents the posture key point loss function; K represents the total number of posture key points; Represents the predicted k-th pose key point coordinates; Represents the true k-th pose key point coordinates

[0032] In the process of using RT-DETRv3 for stereoscopic behavior detection, a 3D convolutional network feature loss function is introduced to optimize the spatiotemporal behavior characteristics of livestock extracted by the 3D convolutional network, ensuring that the model can learn accurate 3D behavior characteristics of livestock from multi-view temporal data. The calculation formula is:

[0033] L 3D-conv =||F 3D-pred -F 3D-true ||2

[0034] Where: L 3D-conv represents the 3D convolutional network feature loss function; F 3D-pred represents the 3D behavior characteristics of livestock predicted by 3D convolutional network; F 3D-true Represents realistic 3D behavior characteristics of livestock.

[0035] The present invention also proposes a livestock stereoscopic behavior detection system, which includes a fixed bracket, a pan / tilt head, three night-vision cameras and a computer; the three night-vision cameras are respectively installed at the upper ends of the fixed bracket, and are used to simultaneously obtain videos of livestock activity areas, wherein the front-view camera is used to directly face the livestock to shoot videos, observe expressions, facial movements and social behaviors, such as sniffing, interaction, etc.; the side-view camera is used to shoot side videos of livestock, observe the body movements and walking postures of livestock, and facilitate capturing limb movements and interactions between each other; the top-view camera is used to shoot videos of the backs of livestock, observe the movement trajectories and behavior patterns of livestock in a specific space, and facilitate analysis of the behavior and relative positions of livestock groups; the three cameras are all equipped with night vision functions and are connected to the computer to facilitate the acquisition of livestock video data throughout the day and analysis of their stereoscopic behavior.

[0036] Compared with the prior art, the present invention has the following beneficial effects:

[0037] The present invention combines a multi-view camera system and a deep learning algorithm, especially integrating a 3D convolutional neural network and RT-DETRv3 Transformer, to capture the three-dimensional behavior of livestock in real time. Compared with the existing technology that only relies on two-dimensional monitoring from a single perspective, the present invention can accurately identify complex three-dimensional postures of livestock such as standing, lying, and walking, greatly improving the accuracy and precision of detection. In addition, with the help of posture key point detection and multi-target supervision mechanism, the present invention can still maintain high detection accuracy in multiple livestock groups, solving the detection problems caused by occlusion and overlap.

[0038] While maintaining high detection accuracy, the present invention significantly reduces the consumption of computing resources by optimizing the algorithm structure. The optimization algorithm of RT-DETRv3 not only reduces computational redundancy during the detection process, but also improves the reasoning speed. Compared with traditional detection methods, the present invention does not require too many post-processing steps, avoids the computational burden of non-maximum suppression (NMS), and further improves the operating efficiency of the system. This optimization enables the present invention to operate efficiently in low-power devices or resource-limited environments, reduces the farm's dependence on high-performance hardware, and reduces hardware and operation and maintenance costs.

[0039] The multi-view system of the present invention can be flexibly deployed according to different breeding environments and is suitable for real-time monitoring of various livestock behaviors. The system can operate stably in both large open farms and small closed pens. Through the adaptive attention mechanism, the present invention can dynamically adjust the detection accuracy of different livestock behavior patterns and maintain consistent detection effects in various environments, thereby improving the applicability and flexibility of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1A flowchart of the workflow for three-dimensional behavior of livestock;

[0041] Figure 2 A three-dimensional diagram of the installation and distribution of the livestock three-dimensional behavior detection system;

[0042] Figure 3 It is a three-dimensional rendering of livestock's posture and behavior integrated from three perspectives. DETAILED DESCRIPTION

[0043] The present invention is further described below in conjunction with the accompanying drawings and specific implementation methods. It should be noted that, under the premise of no conflict, the various embodiments or technical features described below can be arbitrarily combined to form a new embodiment.

[0044] Embodiment 1:

[0045] Reference Figure 1-Figure 3 ,This scheme proposes a livestock stereo behavior detection method, including the following steps:

[0046] Step S1, building a livestock three-dimensional behavior detection system for shooting livestock behavior videos;

[0047] Step S2, constructing a real-time detection model for livestock stereoscopic behavior, namely, the RT-DETRv3 model;

[0048] Step S3: Based on the livestock video captured by the behavior detection system, the different behaviors of the livestock are classified and analyzed using the real-time detection model output, and a visualized statistical report of the livestock behaviors is generated.

[0049] In this scheme, the workflow of RT-DETRv3 in step S2 is as follows:

[0050] Collect livestock behavior video samples and send them to a computer; the video samples include video information from different perspectives, such as frontal, oblique, and top-down perspectives. Use Social LEAP Estimates Animal Poses (SLEAP) and LabelImg software to annotate the coordinates of livestock posture key points and livestock behavior rectangular frames, assign corresponding label categories, and store the annotated data as CSV files and TXT files respectively;

[0051] Import and fuse the labeled data; import the labeled SLEAP data (CSV file containing posture key points) and LabelImg labeled data (TXT file containing bounding boxes) into the computer, and perform feature fusion through the adaptive attention mechanism, dynamically adjust the video feature weights of each view, extract useful posture and behavior information from different camera perspectives (front, side, top view), improve the stereoscopic recognition effect of livestock behavior, combine multi-perspective video streams, rely on posture estimation and bounding box detection to capture the fine movements and overall behavior patterns of livestock;

[0052] Feature processing: 3D Convolutional Neural Network (3D-CNN) is used to process the fused features. 3D Convolutional Neural Network is used to analyze the behavioral changes of livestock in time series and identify their action patterns. By performing convolution operations on the time dimension, it can extract the continuous behavioral features of livestock from multiple frames and capture the dynamic changes of actions.

[0053] It should be noted that this scheme uses Real-Time Detection Transformer Version 3 (RT-DETRv3) for three-dimensional behavior detection. Based on the fusion of SLEAP and LabelImg data, RT-DETRv3 is used to detect the three-dimensional behavior of livestock end-to-end. The one-to-many dense supervision mechanism of RT-DETRv3 can simultaneously capture the posture changes and overall behavior information of livestock, and perform efficient feature extraction through a hierarchical convolutional network to ensure real-time detection with low computing resources.

[0054] Specifically, the classification analysis of different behaviors of livestock in step 3 includes 3D posture estimation of livestock, stereoscopic behavior bounding box, behavior category and management suggestions. Management suggestions such as abnormal livestock behavior alarms or management reminders for specific behavior frequencies assist users in intervention and management.

[0055] In this solution, when collecting livestock behavior video samples, the front, side and top view cameras are turned on at the same time; the livestock behavior video sample collection frequency is 30 frames per second, the recording video duration of each camera is 24 hours, and the samples include various behavior patterns of livestock; when using SLEAP to mark the key points of the posture, the key joints of the livestock (such as the head, front legs, hind legs, tail, etc.) are marked to ensure the accuracy of the posture estimation; each livestock posture information is saved in the form of 2D coordinates, and the 2D coordinates are converted into 3D coordinates using multi-view annotation. The process is achieved through the triangulation method of multi-view geometry, and the calculation formula is:

[0056] X 3D =Triangulate(xf ,x s ,x t ,P f ,P s ,P t )

[0057] Where: X 3D Indicates the position of the key points of livestock posture in 3D space; Triangulate represents the triangulation function; x f 、x s and x t Respectively represent the 2D posture key point coordinates of livestock taken from the front, side and top view; P f , P s and P t Represent the projection moments of the front, side and top view cameras respectively.

[0058] It is worth mentioning that the LabelImg software is used to annotate the behavior rectangles of livestock in the video, annotate the behavior categories (such as eating, walking, resting, socializing, etc.), and each frame of data contains the behavior boundary box and label information; during the annotation process, the behavior and posture information of each perspective are ensured to be synchronized, and the video frame annotation frequency and timestamp are strictly aligned; multi-perspective fusion is used to integrate the three-perspective 2D behavior rectangles of livestock into a complete 3D boundary box, and the calculation formula is:

[0059] B 3D =Fuse(B f ,B s ,B t ,P f ,P s ,P t )

[0060] Where: B 3D represents the final fused 3D bounding box of livestock behavior; Fuse represents the geometric (feature) fusion function; B f , B s and B t Respectively represent the 2D bounding box data of livestock behavior under the front view, side view and top view, and the calculation formula is:

[0061]

[0062] Where: represents the 2D coordinates of the i-th corner point of the 2D bounding box of the livestock behavior under the normal viewing angle, i = 1, 2, 3, 4; each corner point Contains two components, which are the horizontal coordinates on the image plane of the normal view and the vertical coordinate Similarly, the 2D bounding box data B of livestock behavior under side and top view can be derived s, B t .

[0063] In this scheme, an adaptive attention mechanism involving multi-view feature fusion and adaptive weight allocation is used, and the adaptive convolution feature fusion calculation formula is:

[0064]

[0065] Where: F final represents the final fusion feature combining the convolution features of the front view, side view and top view; n = 1, 2, 3, representing the front view, side view and top view respectively; α i Represents the adaptive attention weight under the corresponding view; Conv represents the convolution operation; I i represents the input image or video frame of the corresponding view; W i Represents the weight of the convolution layer used to process the corresponding view;

[0066] The 3D convolutional neural network is used to process time series features and extract the action changes of livestock at different time points. The calculation formula is:

[0067]

[0068] Where: F t Represents the 3D features at time t; Conv3D represents the 3D convolution operation; V t:t+n represents the n-frame video sequence starting from time t; W 3D represents the 3D convolution kernel weight; λ represents the adjustment parameter used to balance the 3D convolution and fusion features

[0069] In the process of using RT-DETRv3 for stereo behavior detection, the posture key point loss function is introduced to optimize the posture key points of the target livestock, so that the model can accurately locate the key points of the livestock in the multi-view video. The calculation formula is:

[0070]

[0071] Where: L keypoints represents the posture key point loss function; K represents the total number of posture key points; Represents the predicted k-th pose key point coordinates; Represents the true k-th pose key point coordinates

[0072] In the process of using RT-DETRv3 for stereoscopic behavior detection, a 3D convolutional network feature loss function is introduced to optimize the spatiotemporal behavior characteristics of livestock extracted by the 3D convolutional network, ensuring that the model can learn accurate 3D behavior characteristics of livestock from multi-view temporal data. The calculation formula is:

[0073] L3D-conv =||F 3D-pred -F 3D-true ||2

[0074] Where: L 3D-conv represents the 3D convolutional network feature loss function; F 3D-pred represents the 3D behavior characteristics of livestock predicted by 3D convolutional network; F 3D-true Represents realistic 3D behavior characteristics of livestock.

[0075] The present invention combines a multi-view camera system with a deep learning algorithm, especially a 3D convolutional neural network and RT-DETRv3 Transformer, to capture the three-dimensional behavior of livestock in real time. The optimization algorithm of RT-DETRv3 not only reduces computational redundancy during the detection process, but also improves the inference speed.

[0076] The above-mentioned embodiments are only preferred embodiments of the present invention and cannot be used to limit the scope of protection of the present invention. Any non-substantial changes and substitutions made by technicians in this field on the basis of the present invention shall fall within the scope of protection required by the present invention.

Claims

1. A method for detecting three-dimensional behavior of livestock, characterized in that: The steps include: Step S1, building a livestock three-dimensional behavior detection system for shooting livestock behavior videos; Step S2, constructing a real-time detection model for livestock stereoscopic behavior, namely, the RT-DETRv3 model; Step S3: Based on the livestock video captured by the behavior detection system, the different behaviors of the livestock are classified and analyzed using the real-time detection model output, and a visualized statistical report of the livestock behaviors is generated.

2. A method for detecting three-dimensional behavior of livestock as claimed in claim 1, characterized in that: The workflow of the RT-DETRv3 model in step S2 is as follows: Collect livestock behavior video samples and send them to a computer; the video samples include video information from different perspectives, such as frontal, oblique, and overhead perspectives; use social action to estimate animal posture and LabelImg software to mark the key point coordinates of livestock posture and livestock behavior rectangular boxes, assign corresponding label categories, and store the labeled data as CSV files and TXT files respectively; Import and fuse the annotated data; import the annotated CSV file containing posture key points and the TXT file containing bounding boxes into the computer, and perform feature fusion through the adaptive attention mechanism, dynamically adjust the video feature weights of each view, extract useful posture and behavior information from different camera views, improve the stereoscopic recognition effect of livestock behavior, combine multi-view video streams, rely on posture estimation and bounding box detection to capture the fine movements and overall behavior patterns of livestock; Feature processing; A 3D convolutional neural network is used to process the fused features; the 3D convolutional neural network is used to analyze the behavioral changes of livestock in time series and identify their action patterns. By performing convolution operations on the time dimension, it can extract the continuous behavioral features of livestock from multiple frames and capture the dynamic changes of actions.

3. A method for detecting three-dimensional behavior of livestock as claimed in claim 1, characterized in that: The classification analysis of different behaviors of livestock in step 3 includes 3D posture estimation, stereo behavior bounding box, behavior category and management suggestions of livestock.

4. A method for detecting three-dimensional behavior of livestock as claimed in claim 1, characterized in that: When collecting the livestock behavior video samples, the front, side and top view cameras in the detection system are turned on at the same time; the livestock behavior video sample collection frequency is 30 frames per second, the recording video duration of each camera is 24 hours, and the samples include various behavior patterns of livestock; when using SLEAP to mark the key points of the posture, the key joints of the livestock are marked to ensure the accuracy of the posture estimation; each livestock posture information is saved in the form of 2D coordinates, and the 2D coordinates are converted into 3D coordinates using multi-view annotation. The process is achieved by the triangulation method of multi-view geometry, and the calculation formula is: X 3D =Triangulate(x f ,x s ,x t ,P f ,P s ,P t ) Where: X 3D Indicates the position of the key points of livestock posture in 3D space; Triangulate represents the triangulation function; x f 、x s and x t Respectively represent the 2D posture key point coordinates of livestock taken from the front, side and top view; P f , P s and P t Represent the projection moments of the front, side and top view cameras respectively.

5. A method for detecting three-dimensional behavior of livestock as claimed in claim 1, characterized in that: The LabelImg software is used to mark the behavior rectangles of livestock in the video, mark the behavior categories, and each frame of data contains the behavior boundary box and label information; during the marking process, the behavior and posture information of each perspective are ensured to be synchronized, and the video frame marking frequency and timestamp are strictly aligned; multi-perspective fusion is used to integrate the three-perspective 2D behavior rectangles of livestock into a complete 3D boundary box, and the calculation formula is: B 3D =Fuse(B f ,B s ,B t ,P f ,P s ,P t ) Where: B 3D represents the final fused 3D bounding box of livestock behavior; Fuse represents the geometric feature fusion function; B f , B s and B t Respectively represent the 2D bounding box data of livestock behavior under the front view, side view and top view, and the calculation formula is: Where: represents the 2D coordinates of the i-th corner point of the 2D bounding box of the livestock behavior under the normal viewing angle, i = 1, 2, 3, 4; each corner point Contains two components, which are the horizontal coordinates on the image plane of the normal view and the vertical coordinate Similarly, the 2D bounding box data B of livestock behavior under side and top view can be derived s , B t .

6. A method for detecting three-dimensional behavior of livestock as claimed in claim 1, characterized in that: Using the adaptive attention mechanism involving multi-view feature fusion and adaptive weight allocation, the adaptive convolution feature fusion calculation formula is: Where: F final represents the final fusion feature combining the convolution features of the front view, side view and top view; n =1, 2, 3, representing front, side, and top view, respectively; α i Represents the adaptive attention weight under the corresponding perspective; Conv represents the convolution operation; I i represents the input image or video frame of the corresponding view; W i Represents the weights of the convolutional layer used to process the corresponding view.

7. A method for detecting three-dimensional behavior of livestock as claimed in claim 1, characterized in that: The 3D convolutional neural network is used to process time series features and extract the action changes of livestock at different time points. The calculation formula is: Where: F t Represents the 3D features at time t; Conv3D represents the 3D convolution operation; V t:t+n W represents the n-frame video sequence starting from time t; 3D represents the 3D convolution kernel weight; λ represents the adjustment parameter used to balance the 3D convolution and fusion features.

8. A method for detecting three-dimensional behavior of livestock as claimed in claim 1, characterized in that: The pose key point loss function is introduced in RT-DETRv3, and its calculation formula is: Where: L keypoints represents the posture key point loss function; K represents the total number of posture key points; Represents the predicted k-th pose key point coordinates; Represents the true k-th pose key point coordinates The RT-DETRv3 model introduces a 3D convolutional network feature loss function in the process of stereoscopic behavior detection to optimize the spatiotemporal behavior characteristics of livestock extracted by the 3D convolutional network, ensuring that the model can learn accurate 3D behavior characteristics of livestock from multi-view temporal data. The calculation formula is: L 3D-conv =||F 3D-pred -F 3D-true ||2 Where: L 3D-conv represents the 3D convolutional network feature loss function; F 3D-pred Represents the 3D behavior characteristics of livestock predicted by 3D convolutional network; F 3D-true Represents realistic 3D behavior characteristics of livestock.

9. A livestock three-dimensional behavior detection system, characterized in that: The detection system includes a fixed bracket, a pan / tilt head, three night vision cameras and a computer; the three night vision cameras are respectively installed at the upper ends of the fixed bracket to simultaneously obtain videos of livestock activity areas, wherein the front view camera is used to directly face the livestock to shoot videos and observe expressions, facial movements and social behaviors; The side-view camera is used to shoot videos of livestock from the side, observe the body movements and walking postures of livestock, and facilitate the capture of limb movements and interactions between them; the top-view camera is used to shoot videos of livestock from the back, observe the movement trajectories and behavior patterns of livestock in a specific space, and facilitate the analysis of the behavior and relative positions of livestock groups.

Citation Information

Patent Citations

  • Systems and methods for stereoscopic field of view of multiple animal behavioral characteristics

    CN102282570A

  • Group pig posture recognition method based on generative adversarial network

    CN115713780A

  • User posture recognition method and device, electronic equipment and storage medium

    CN117765564A

  • Safflower target detection method and device based on optimized RT-DETR model

    CN117853918A

  • Remote sensing image target detection method and system based on improved RT-DETR algorithm

    CN118196640A

Cited By

  • Canine behavior recognition method and system based on multi-view skeleton analysis and video understanding

    CN121011017A