Method, system, device, processor and storage medium for realizing intelligent monitoring of livestock and poultry based on multi-scale detection and time sequence behavior analysis

By employing multi-scale detection and temporal behavior analysis, the system has solved the challenges of individual detection and health analysis of livestock and poultry in densely shaded environments, achieving efficient, individual-level intelligent monitoring with early warning capabilities, thus improving the system's real-time performance and accuracy.

CN122176757APending Publication Date: 2026-06-09HAINAN TIANSHANG SECURITY TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HAINAN TIANSHANG SECURITY TECH CO LTD
Filing Date
2026-03-04
Publication Date
2026-06-09

Smart Images

  • Figure CN122176757A_ABST
    Figure CN122176757A_ABST
Patent Text Reader

Abstract

The present application relates to a kind of method for realizing livestock intelligent monitoring based on multiscale detection and timing behavior analysis, comprising the following steps: obtaining the video stream data of farm;Animal individual detection is carried out to video frame;For each individual, generate unique and continuous space-time trajectory;Continuous video segment is cropped with the individual as center, and fine-grained behavior recognition is carried out by double-branch space-time network;Counting, identity recognition or health state inference is carried out by integrated state decision engine.The method, system, device, processor and computer readable storage medium thereof for realizing livestock intelligent monitoring based on multiscale detection and timing behavior analysis of the present application have high detection precision, improve the detection and differentiation ability of animal individual in dense occlusion environment, combined with the tracking algorithm of strong appearance feature association, ensure the continuity of individual identity in video sequence;Analysis dimension is deep, realizes the correlation analysis of behavior and health, meets the demand of server side real-time processing multiple video streams.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision, and more particularly to the fields of artificial intelligence and smart agriculture technology. Specifically, it refers to a method, system, device, processor, and computer-readable storage medium for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis. Background Technology

[0002] In modern livestock and poultry farming, real-time, accurate, and non-contact monitoring of herd dynamics and individual health status is crucial for improving farming efficiency and animal welfare. Current technologies mainly face the following challenges: 1. Detection challenges under dense occlusion: In caged or floor-raised environments, severe occlusion between animals causes a sharp drop in the accuracy of general object detection algorithms based on single-frame images (such as YOLO and Faster R-CNN), making it difficult to achieve accurate counting and individual localization.

[0003] 2. Limitations of Behavior and Health Analysis: Traditional methods typically separate "detection" from "behavior / health analysis." Behavior analysis often relies on global video classification or simple temporal models, making it difficult to associate specific behaviors with specific individuals in dense scenes, and also unable to achieve early health warnings based on subtle posture changes.

[0004] 3. Insufficient multi-task collaboration: Tasks such as counting, recognition, and health monitoring are usually completed by independent systems. There is a lack of an end-to-end framework that can share underlying features and perform collaborative reasoning, resulting in system redundancy, low efficiency, and poor real-time performance.

[0005] Existing patent CN117197727A proposes a global spatiotemporal feature learning method based on 3DSF-FPN and Transformer for complex behavior recognition. Patent CN113869235A utilizes multi-temporal-scale convolutional modules to extract video behavior features. These methods are effective for general behavior recognition, but none offer a solution to the specific challenge of "individual-level" detection and continuous behavior tracking in dense animal scenes. Summary of the Invention

[0006] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method, system, device, processor and computer-readable storage medium for intelligent monitoring of livestock and poultry based on multi-scale detection and time-series behavior analysis that meets the requirements of high precision, high efficiency and wide applicability.

[0007] To achieve the above objectives, the present invention provides a method, system, device, processor, and computer-readable storage medium for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis, as well as the following: The main feature of this method for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis is that the method includes the following steps: (1) Obtain video stream data from the farm; (2) Input the image frames of the video stream into the multi-scale fusion detection module, and perform animal individual detection on the video frames through the improved YOLO architecture, and output the bounding box, confidence and appearance feature vector of each animal individual in each frame image; (3) Input the serialized detection results output by the multi-scale fusion detection module into the trajectory association module based on appearance and motion to generate a unique and continuous spatiotemporal trajectory for each animal individual; (4) For each stable tracking trajectory, cut out continuous video segments centered on the individual and perform fine-grained behavior recognition through a dual-branch spatiotemporal network; (5) Based on the individual's spatiotemporal trajectory and the identified individual behavior category, the comprehensive status decision engine is used to count, identify or infer health status, and output the monitoring results.

[0008] Preferably, the multi-scale fusion detection module is based on an improved YOLO architecture as the detector, introducing Transformer encoding layers in the deep paths of its feature pyramid network and integrating deformable convolutions in the shallow paths.

[0009] Preferably, the trajectory association module uses the ByteTrack or DeepSORT algorithm for multi-target tracking, and uses the appearance feature vector extracted by the multi-scale fusion detection module to calculate and perform cross-frame data association through cosine similarity.

[0010] Preferably, the dual-branch spatiotemporal network includes a slow branch and a fast branch. The slow branch analyzes the static pose features of an individual with low frame rate and high spatial resolution input. The fast branch captures the rapid motion changes of an individual with high frame rate and low spatial resolution input. The features extracted by the slow branch and the fast branch are fused in a later stage and the behavior category is identified by a classifier.

[0011] Preferably, the behavioral categories include at least one of: active feeding, resting quietly, lameness, fighting, and neck-stretching breathing.

[0012] Preferably, the health status inference specifically refers to: The health status is logically judged by the rule engine based on the combination of duration, frequency and appearance characteristics of individual behavior categories; if a specific combination of behaviors is detected and the duration exceeds the threshold, it is marked as an abnormal health status.

[0013] This system for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis is characterized by the following features: The video stream input module is used to receive video image frames; The multi-scale fusion detection module is connected to the video stream input module and is used to output the bounding box, confidence score and appearance feature vector of each animal individual in each frame. The trajectory association module, connected to the multi-scale fusion detection module, is used to receive serialized detection results and generate continuous spatiotemporal trajectories for each individual by matching motion and appearance features. The temporal behavior analysis module, connected to the trajectory association module, is used to cut continuous video segments based on individual spatiotemporal trajectories and to identify individual behavior categories using a dual-branch spatiotemporal network. The integrated status decision engine, connected to the aforementioned time-series behavior analysis module, is used to count, identify, or infer health status based on individual trajectories and behavior categories, and output the results.

[0014] Preferably, the multi-scale fusion detection module includes a detector based on the YOLO architecture, wherein the feature pyramid network of the detector integrates a deep Transformer coding layer and a shallow deformable convolutional layer.

[0015] Preferably, the dual-branch spatiotemporal network in the temporal behavior analysis module includes a slow branch for analyzing static poses and a fast branch for capturing fast actions, and the output features of the slow branch and the fast branch are fused and then input into the classifier.

[0016] The main feature of this device for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis is that the device includes: A processor is configured to execute computer-executable instructions; The memory stores one or more computer-executable instructions, which, when executed by the processor, implement the various steps of the above-described method for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis.

[0017] The processor for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis is characterized in that the processor is configured to execute computer-executable instructions, and when the computer-executable instructions are executed by the processor, the various steps of the above-mentioned method for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis are realized.

[0018] The main feature of this computer-readable storage medium is that it stores a computer program thereon, which can be executed by a processor to implement the various steps of the above-described method for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis.

[0019] This invention employs a method, system, device, processor, and computer-readable storage medium for intelligent livestock and poultry monitoring based on multi-scale detection and temporal behavior analysis. It achieves high detection accuracy, and through Transformer-enhanced multi-scale feature fusion, significantly improves the detection and differentiation capabilities of individual animals in densely occluded environments, laying a solid foundation for all subsequent analyses. The identity verification of this invention is consistently stable. Combined with a tracking algorithm that strongly correlates appearance features, it ensures the continuity of each individual's identity in the video sequence, achieving true "individual-level" monitoring. The analysis dimensions of this invention are deep, moving beyond simple "existence" to "what they are doing" and "what their status is," enabling correlation analysis between behavior and health, and possessing early warning potential. The system efficiency of this invention is high. Its cascaded design allows for modular deployment and optimization, and tools such as TensorRT can be used to accelerate each module, meeting the server's requirements for real-time processing of multiple video streams. Attached Figure Description

[0020] Figure 1 This is a schematic diagram of the overall architecture of the intelligent monitoring system for livestock and poultry based on multi-scale detection and temporal behavior analysis according to the present invention.

[0021] Figure 2 This is a detailed diagram of the network structure of the multi-scale fusion detection module of the system for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis according to the present invention.

[0022] Figure 3 This is a dual-branch network structure diagram of the individual spatiotemporal behavior analysis module of the intelligent monitoring system for livestock and poultry based on multi-scale detection and temporal behavior analysis of the present invention.

[0023] Figure 4 This is a demonstration diagram showing the processing effect of the method for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis of the present invention on a typical chicken farm video frame.

[0024] Figure 5 This is a comparison curve of the detection accuracy (mAP) of the method for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis of the present invention with that of traditional methods in dense scenes. Detailed Implementation

[0025] To more clearly describe the technical content of the present invention, the following description is provided in conjunction with specific embodiments.

[0026] The present invention provides a method for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis, comprising the following steps: (1) Obtain video stream data from the farm; (2) Input the image frames of the video stream into the multi-scale fusion detection module, and perform animal individual detection on the video frames through the improved YOLO architecture, and output the bounding box, confidence and appearance feature vector of each animal individual in each frame image; (3) Input the serialized detection results output by the multi-scale fusion detection module into the trajectory association module based on appearance and motion to generate a unique and continuous spatiotemporal trajectory for each animal individual; (4) For each stable tracking trajectory, cut out continuous video segments centered on the individual and perform fine-grained behavior recognition through a dual-branch spatiotemporal network; (5) Based on the individual's spatiotemporal trajectory and the identified individual behavior category, the comprehensive status decision engine is used to count, identify or infer health status, and output the monitoring results.

[0027] As a preferred embodiment of the present invention, the multi-scale fusion detection module is based on an improved YOLO architecture as the detector, introducing a Transformer encoding layer in the deep path of its feature pyramid network and integrating deformable convolutions in the shallow path.

[0028] In a preferred embodiment of the present invention, the trajectory association module uses the ByteTrack or DeepSORT algorithm for multi-target tracking, and uses the appearance feature vector extracted by the multi-scale fusion detection module to calculate and perform cross-frame data association through cosine similarity.

[0029] In a preferred embodiment of the present invention, the dual-branch spatiotemporal network includes a slow branch and a fast branch. The slow branch analyzes the static pose features of an individual with low frame rate and high spatial resolution input. The fast branch captures the rapid movement changes of an individual with high frame rate and low spatial resolution input. The features extracted by the slow branch and the fast branch are fused in a later stage and the behavior category is identified by a classifier.

[0030] In a preferred embodiment of the present invention, the behavioral categories include at least one of the following: active feeding, resting quietly, lameness, fighting, and neck-stretching breathing.

[0031] In a preferred embodiment of the present invention, the health status inference specifically refers to: The health status is logically judged by the rule engine based on the combination of duration, frequency and appearance characteristics of individual behavior categories; if a specific combination of behaviors is detected and the duration exceeds the threshold, it is marked as an abnormal health status.

[0032] The present invention discloses a system for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis, wherein the system comprises: The video stream input module is used to receive video image frames; The multi-scale fusion detection module is connected to the video stream input module and is used to output the bounding box, confidence score and appearance feature vector of each animal individual in each frame. The trajectory association module, connected to the multi-scale fusion detection module, is used to receive serialized detection results and generate continuous spatiotemporal trajectories for each individual by matching motion and appearance features. The temporal behavior analysis module, connected to the trajectory association module, is used to cut continuous video segments based on individual spatiotemporal trajectories and to identify individual behavior categories using a dual-branch spatiotemporal network. The integrated status decision engine, connected to the aforementioned time-series behavior analysis module, is used to count, identify, or infer health status based on individual trajectories and behavior categories, and output the results.

[0033] In a preferred embodiment of the present invention, the multi-scale fusion detection module includes a detector based on the YOLO architecture. In the feature pyramid network of the detector, a Transformer coding layer is integrated at a deep layer and a deformable convolutional layer is integrated at a shallow layer.

[0034] In a preferred embodiment of the present invention, the dual-branch spatiotemporal network in the temporal behavior analysis module includes a slow branch for analyzing static postures and a fast branch for capturing fast actions. The output features of the slow branch and the fast branch are fused and then input into the classifier.

[0035] The present invention relates to a device for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis, wherein the device comprises: A processor is configured to execute computer-executable instructions; The memory stores one or more computer-executable instructions, which, when executed by the processor, implement the various steps of the above-described method for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis.

[0036] The processor of the present invention for realizing intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis is configured to execute computer-executable instructions. When the computer-executable instructions are executed by the processor, the various steps of the above-mentioned method for realizing intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis are implemented.

[0037] The computer-readable storage medium of the present invention stores a computer program thereon, which can be executed by a processor to implement the various steps of the above-described method for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis.

[0038] This invention relates to the fields of computer vision, artificial intelligence, and smart agriculture, specifically to an intelligent video monitoring algorithm and system that combines multi-scale target detection with fine-grained temporal behavior analysis. This algorithm is particularly suitable for accurate counting, identification, behavior analysis, and health status monitoring of individual animals in intensive livestock farms (such as chicken farms).

[0039] This invention discloses an intelligent monitoring method and system for livestock and poultry based on multi-scale detection and temporal behavior analysis. The method solves the problem of individual localization under dense occlusion by integrating a multi-scale detection network of Transformer and deformable convolution; it achieves continuous and stable tracking of individual identity through multi-target tracking that strengthens the association of appearance features; and finally, it performs fine-grained analysis of continuous individual behavior through a dual-branch spatiotemporal network. This invention realizes end-to-end intelligent analysis from group counting to individual health monitoring, significantly improving the accuracy and efficiency of intensive livestock farming management.

[0040] The purpose of this invention is to provide an algorithm and system to solve the difficulties in individual detection caused by severe shading in intensive farming scenarios, as well as the resulting problems of inaccurate counting and difficulty in correlating behavior with health status. This invention aims to achieve high-precision and high-efficiency continuous monitoring at the individual level.

[0041] The core of this invention lies in proposing a cascaded collaborative analysis framework of "multi-scale detection - individual trajectory maintenance - temporal behavior analysis". This framework deeply integrates target detection, multi-target tracking (MOT), and fine-grained behavior recognition.

[0042] The system of this invention achieves the entire process from video input to individual-level state judgment through the cascaded collaboration of multi-scale detection, continuous tracking and temporal analysis.

[0043] The main process of this invention is as follows: video stream input → multi-scale fusion detection module → trajectory association module based on appearance and motion → individual-level temporal behavior analysis module → comprehensive state decision and output.

[0044] 1. Multi-scale fusion detection module: An improved YOLO architecture is used as the base detector, and a Transformer encoding layer is introduced deep into its Feature Pyramid Network (FPN). This layer enhances the model's ability to perceive semantic differences between different individuals within densely occluded regions through a self-attention mechanism, thereby improving the recall rate of occluded targets.

[0045] Meanwhile, by integrating deformable convolutions into the shallow paths of the feature pyramid, the network can adaptively focus on the irregularly shaped animal outlines, enhancing its feature extraction capabilities for small-scale (distant) targets.

[0046] This module outputs the bounding boxes, confidence scores, and preliminary appearance feature vectors of all detected animals in each frame of the image.

[0047] 2. Trajectory association module based on appearance and motion: The serialized results output by the receiving detection module are used for multi-target tracking using either the ByteTrack or DeepSORT algorithm.

[0048] The key innovation lies in not only utilizing motion consistency (Kalman filter prediction) but also strengthening the weight of appearance feature matching. By using the appearance feature vectors extracted by the detection module, cross-frame data association is performed through cosine similarity calculation, effectively solving the identity switching problem caused by similar animal appearances, sudden cessation of movement, or overlap, and generating a unique and continuous spatiotemporal trajectory for each individual.

[0049] 3. Individual-level temporal behavior analysis module: For each stable tracking trajectory, a continuous video segment centered on that individual is cropped out, such as 16 frames.

[0050] Construct a lightweight, two-branch spatiotemporal network (e.g., an improved SlowFast network) for analysis: Slow branch: Input at low frame rate and high spatial resolution, focusing on analyzing the static pose features of an individual, such as head orientation and body posture.

[0051] Fast Branch: Input at high frame rate and low spatial resolution, focusing on capturing subtle and rapid changes in individual movements, such as pecking frequency and leg tremors.

[0052] The features of the two branches are fused in the later stage, and the preset key behaviors, such as "active feeding", "resting", "limping", "fighting" and "stretching neck to breathe", are identified by a classifier.

[0053] 4. Comprehensive Status Decision Engine: Establish decision-making logic that combines rules and models. For example: Count: Directly count the number of unique IDs of the tracked trajectory.

[0054] Variety / Identity Recognition: Clustering or comparing appearance feature vectors in the trajectory with a database.

[0055] Health status inference: The rule engine makes a comprehensive judgment, for example: IF (behavior includes lying still and the duration exceeds the threshold) AND (appearance features show fluffy feathers) THEN is marked as "suspected disease".

[0056] In a specific embodiment of the present invention, an application deployed on a chicken farm server is taken as an example: 1. Data preparation: Collect videos of the farm and label individual bounding boxes and behavior categories.

[0057] 2. Model Training: Phase 1: Training the improved multi-scale fusion detection module using labeled data.

[0058] Phase 2: Freeze the weights of the detection module and train the appearance feature extraction sub-network using tracking data.

[0059] Phase 3: Using cropped individual behavior video clips, train the temporal behavior analysis module.

[0060] 3. System Deployment: Convert the trained model to TensorRT or ONNXRuntime format and deploy it on a server.

[0061] The video stream is accessed via the RTSP protocol, and after being extracted by the streaming media server, it is sent to the processing pipeline.

[0062] The processing results (counts, behavioral events, alarm information) are stored in a time-series database and provided in real time via API or WebSocket.

[0063] 4. Example: The system identifies that a chicken (ID:015) exhibits "limping" behavior for multiple consecutive frames and its feeding behavior frequency decreases. Based on this, the system judges that the chicken's health status is abnormal, automatically generates an early warning report, and notifies the breeder.

[0064] This invention presents a complete causal analysis chain from pixel to individual behavior understanding, aiming to solve a series of interconnected technical challenges in the accurate localization, continuous identity tracking, and behavior decoding of individual targets in dense environments. The core innovation of this invention lies in its design and integration of a full-stack innovative architecture from front-end perception to high-level cognition for the specific scenario of "continuous monitoring of individual animals in dense environments," generating a synergistic effect of "1+1>2."

[0065] This invention starts from the original video pixels and solves the basic perception problems of "seeing, distinguishing, and following".

[0066] A three-tiered cascade model of "detection-tracking-behavioral analysis": 1. Multi-scale fusion detection (YOLO + Transformer + Deformable Convolution) 2. Individual trajectory association (appearance + motion matching) 3. Temporal Behavior Recognition (Dual-Branch Spatiotemporal Network) Input: Raw video frame sequence. Output: Precise bounding box, unique ID, continuous trajectory, and specific behavior category (e.g., feeding, lameness) for each animal.

[0067] This invention is designed for detection heads with dense occlusion. It introduces both Transformer (global relation) and deformable convolution (geometric deformation) into the YOLO architecture to improve the ability to distinguish densely packed and adhered animals.

[0068] This invention addresses the continuous tracking strategy for livestock and poultry by strengthening the weight of appearance feature re-identification (Re-ID) in matching, thus resolving ID switching caused by occlusion of animals with similar appearances, which is the core challenge in livestock and poultry tracking.

[0069] This invention features a personalized, fine-grained behavior analysis framework. Based on tracking results, individual video segments are cropped and fed into a dual-branch network to simultaneously analyze posture details (slow branch) and motion changes (fast branch), achieving accurate behavior classification.

[0070] The purpose of this invention is to achieve the localization, identification, and movement understanding of individual animals. Its "multi-scale detection" extracts features at different spatial resolutions for a single visual modality to better identify targets of different sizes and degrees of occlusion. "Temporal behavior analysis" performs temporal modeling on continuous image segments of a single target to identify its movement patterns.

[0071] Suppose that a ventilation malfunction in a poultry farm causes a general increase in temperature, leading to widespread restlessness among the chickens. This invention can track the individual chicken using visual detection and accurately identify "limping" behavior by analyzing video clips of its walking.

[0072] This invention achieves individual-level, continuous, and interpretable monitoring through this customized architecture, ultimately producing fine-grained data consisting of "individual ID + spatiotemporal trajectory + precise behavior." This end-to-end parsing capability, from raw video to detailed individual behavior, is an effect that is difficult to reliably achieve by simply stacking existing general-purpose components (conventional methods), especially in dense, heavily obscured aquaculture scenarios.

[0073] The technical improvements of this invention are purposeful, non-obvious, systematic innovations made to achieve the specific goal of "precise, continuous, and interpretable monitoring of individual animals in dense populations." They produce a technical effect where the whole is greater than the sum of its parts, and do not belong to conventional technical means in this field.

[0074] For the specific implementation scheme of this embodiment, please refer to the relevant descriptions in the above embodiments, which will not be repeated here.

[0075] It is understood that the same or similar parts in the above embodiments can be referred to each other, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.

[0076] It should be noted that in the description of this invention, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this invention, unless otherwise stated, "a plurality of" means at least two.

[0077] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.

[0078] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution device. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0079] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The corresponding program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.

[0080] Furthermore, the functional units in the various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0081] The storage media mentioned above can be read-only memory, disk, or optical disk, etc.

[0082] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0083] This invention employs a method, system, device, processor, and computer-readable storage medium for intelligent livestock and poultry monitoring based on multi-scale detection and temporal behavior analysis. It achieves high detection accuracy, and through Transformer-enhanced multi-scale feature fusion, significantly improves the detection and differentiation capabilities of individual animals in densely occluded environments, laying a solid foundation for all subsequent analyses. The identity verification of this invention is consistently stable. Combined with a tracking algorithm that strongly correlates appearance features, it ensures the continuity of each individual's identity in the video sequence, achieving true "individual-level" monitoring. The analysis dimensions of this invention are deep, moving beyond simple "existence" to "what they are doing" and "what their status is," enabling correlation analysis between behavior and health, and possessing early warning potential. The system efficiency of this invention is high. Its cascaded design allows for modular deployment and optimization, and tools such as TensorRT can be used to accelerate each module, meeting the server's requirements for real-time processing of multiple video streams.

[0084] In this specification, the invention has been described with reference to specific embodiments thereof. However, it will be apparent that various modifications and variations can be made without departing from the spirit and scope of the invention. Therefore, the specification and drawings should be considered illustrative rather than restrictive.

Claims

1. A method for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis, characterized in that, The method includes the following steps: (1) Obtain video stream data from the farm; (2) Input the image frames of the video stream into the multi-scale fusion detection module, and perform animal individual detection on the video frames through the improved YOLO architecture, and output the bounding box, confidence and appearance feature vector of each animal individual in each frame image; (3) Input the serialized detection results output by the multi-scale fusion detection module into the trajectory association module based on appearance and motion to generate a unique and continuous spatiotemporal trajectory for each animal individual; (4) For each stable tracking trajectory, cut out continuous video segments centered on the individual and perform fine-grained behavior recognition through a dual-branch spatiotemporal network; (5) Based on the individual's spatiotemporal trajectory and the identified individual behavior category, the comprehensive status decision engine is used to count, identify or infer health status, and output the monitoring results.

2. The method for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis according to claim 1, characterized in that, The multi-scale fusion detection module is based on an improved YOLO architecture detector, which introduces Transformer encoding layers in the deep paths of its feature pyramid network and integrates deformable convolutions in the shallow paths.

3. The method for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis according to claim 1, characterized in that, The trajectory association module uses ByteTrack or DeepSORT algorithms for multi-target tracking, and utilizes the appearance feature vectors extracted by the multi-scale fusion detection module to calculate and perform cross-frame data association through cosine similarity.

4. The method for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis according to claim 1, characterized in that, The dual-branch spatiotemporal network includes a slow branch and a fast branch. The slow branch analyzes the static pose features of an individual with low frame rate and high spatial resolution input. The fast branch captures the rapid movement changes of an individual with high frame rate and low spatial resolution input. The features extracted by the slow branch and the fast branch are fused in the later stage and the behavior category is identified by a classifier.

5. The method for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis according to claim 4, characterized in that, The behavioral categories mentioned include at least one of the following: active feeding, resting quietly, limping, fighting, and neck-stretching breathing.

6. The method for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis according to claim 1, characterized in that, The aforementioned health status inference specifically refers to: The health status is logically judged by the rule engine based on the combination of duration, frequency and appearance characteristics of individual behavior categories; if a specific combination of behaviors is detected and the duration exceeds the threshold, it is marked as an abnormal health status.

7. A system for implementing the method described in any one of claims 1 to 6, based on multi-scale detection and temporal behavior analysis, to achieve intelligent monitoring of livestock and poultry, characterized in that, The system includes: The video stream input module is used to receive video image frames; The multi-scale fusion detection module is connected to the video stream input module and is used to output the bounding box, confidence score and appearance feature vector of each animal individual in each frame. The trajectory association module, connected to the multi-scale fusion detection module, is used to receive serialized detection results and generate continuous spatiotemporal trajectories for each individual by matching motion and appearance features. The temporal behavior analysis module, connected to the trajectory association module, is used to cut continuous video segments based on individual spatiotemporal trajectories and to identify individual behavior categories using a dual-branch spatiotemporal network. The integrated status decision engine, connected to the aforementioned time-series behavior analysis module, is used to count, identify, or infer health status based on individual trajectories and behavior categories, and output the results.

8. The system for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis according to claim 1, characterized in that, The multi-scale fusion detection module includes a detector based on the YOLO architecture. In the feature pyramid network of the detector, a Transformer coding layer is integrated at a deep level, and a deformable convolutional layer is integrated at a shallow level.

9. The system for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis according to claim 1, characterized in that, The dual-branch spatiotemporal network in the temporal behavior analysis module includes a slow branch for analyzing static poses and a fast branch for capturing fast actions. The output features of the slow branch and the fast branch are fused and then input into the classifier.

10. A computer-readable storage medium, characterized in that, It stores a computer program that can be executed by a processor to implement the various steps of the method for intelligent monitoring of livestock and poultry based on multi-scale detection and temporal behavior analysis as described in any one of claims 1 to 6.