White feather chicken multi-behavior identification method based on deep learning
Through a dual-module execution model and lightweight design, the problems of high category similarity, large scale variation and low deployment efficiency in white-feathered chicken behavior recognition are solved, and high-precision, real-time multi-behavior recognition and stable model deployment are achieved, improving recognition accuracy and robustness.
Patent Information
- Application Number
- CN202510886091.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-10-17
AI Technical Summary
Existing technologies for white-feathered chicken behavior recognition have problems such as high similarity of behavior categories, large variations in target scales, and complex model structures leading to low deployment efficiency and complex data labeling, making it difficult to achieve efficient and accurate multi-behavior recognition.
A dual-module execution model is adopted, including RT-DETR-TEDS and Light-HGBlock-RT-DETR network structures, combined with the Swin Transformer backbone network, TEDS module and ECANet channel attention mechanism, to build an end-to-end behavior recognition system through multi-scale feature extraction, semantic enhancement and lightweight design.
It improves recognition accuracy and model inference speed, enhances the ability to recognize behaviors in complex backgrounds, enables real-time deployment on edge devices, reduces false positives and missed detections, and improves the robustness and generalization performance of the model.
Smart Images

Figure CN120808434A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of digital image recognition, and specifically relates to a white-feathered chicken multi-behavior recognition method based on deep learning. BACKGROUND
[0002] With the wide application of the large-scale and intensive breeding mode of white-feathered broilers, the breeding density is continuously improved, and higher requirements are put forward for individual behavior recognition and group health monitoring in the breeding process. As the main variety of broiler breeding in China, the behavior state of white-feathered chicken directly affects the growth cycle, feed conversion rate and disease early warning. The traditional manual inspection method has defects such as high labor intensity, strong subjectivity and low efficiency, and especially in the intensive breeding environment, there are problems such as serious occlusion, complex behavior mode and similar chicken movements, which significantly increase the difficulty of manual recognition. In order to improve the recognition efficiency and accuracy, computer vision technology is gradually applied to the breeding scene, and especially the target detection algorithm based on deep learning has become the current mainstream research direction. However, the existing mainstream target detection algorithms (such as YOLO, FCOS, DETR, etc.) still have the following problems when facing white-feathered chicken behavior recognition:
[0003] 1. High similarity of behavior categories: such as "standing" and "combing", "drinking water" and "eating", the behavior postures are overlapped, and the semantic features are small;
[0004] 2. Large target size variation: due to the difference in shooting angle and individual distance, the size of the target in the image is obviously different, which affects the feature extraction ability of the model;
[0005] 3. Low deployment efficiency: many high-precision model structures are complex and difficult to deploy on edge devices for real-time detection;
[0006] 4. Complex data labeling: there is currently a lack of public multi-behavior white-feathered chicken labeling dataset, and the construction of training samples is difficult.
[0007] Therefore, it is urgent to design a white-feathered chicken multi-behavior recognition method that integrates multi-scale semantic modeling, high-precision detection and edge deployment compatibility to meet the actual needs of modern intelligent breeding for "accuracy, efficiency and deployability". SUMMARY
[0008] In view of the problems of low recognition accuracy of white-feathered chicken behavior category, easy confusion of behavior mode and complex model structure leading to inability to deploy on edge in the intensive breeding scene mentioned in the background art, the application provides a white-feathered chicken multi-behavior recognition method based on deep learning, and the technical scheme comprises:
[0009] Step 1, preliminary processing of graphics;
[0010] Step 2, establishing a double-module execution model as a recognition framework and training, comprising:
[0011] Step 21, a dual-module execution model composed of an RT-DETR-TEDS white leghorn behavior recognition model and a Light-HGBlock-RT-DETR network structure model is established; wherein the RT-DETR-TEDS model with Swin Transformer as the backbone is used for high-precision recognition requirements, and the Light-HGBlock-RT-DETR network structure model is used for edge deployment requirements;
[0012] Step 22, training;
[0013] Step 3, deployment: after training is completed, the dual-module execution model is exported and deployed in the platform to build a complete real-time behavior recognition system.
[0014] In step 1, first, high-definition video cameras are arranged to obtain daily behavior videos of white leghorns, and frame rate and resolution are determined; then, representative frame images are manually selected, target labeling is performed for typical behaviors, and LabelMe tools are used to generate VOC format annotation files, which are then uniformly converted into COCO format to match the training data input requirements; finally, the diversity and robustness of the training samples are enhanced by using size normalization, pixel normalization, color disturbance, random cropping and horizontal flipping.
[0015] The RT-DETR-TEDS white leghorn behavior recognition model comprises:
[0016] In the feature extraction stage, the image frame is input into the backbone network with Swin Transformer, and four-stage multi-scale features are extracted;
[0017] In the feature enhancement stage, a TEDS module is introduced to perform multi-branch semantic enhancement on the output of the backbone, wherein the TEDS adopts a dual-path structure: the edge branch uses a Sobel operator to process the input image to obtain a gradient image, extracts boundary information, and then fuses it with the output of the semantic branch of the backbone;
[0018] After the TEDS output, an ECANet channel attention module is introduced, which realizes one-dimensional convolution with the convolution kernel as an adaptive parameter k, so that the model can focus on the target to be recognized before generating enhanced features, and the core operation form is:
[0019] w = σ (Conv1D (GAP (F)))
[0020] where F is the feature map, GAP represents the global average pooling, Conv1D represents the one-dimensional convolution layer, sigma is the Sigmoid activation function, and w is the channel weight; the final feature is sent to the RT-DETR decoder for detection and recognition of the behavior target;
[0021] In the design of the loss function of the trained model, the overall optimization target is composed of three parts: the behavior classification loss the bounding box regression loss and the GIoU overlap loss The weighted sum of the three forms the final optimization function as follows:
[0022]
[0023] where the empirical weight parameters are set as λ cls = 2.0, λ box = 5.0, and λ giou = 2.0.
[0024] The TEDS module uses 1x1 convolution for channel alignment to unify the channel dimension during the fusion process, and realizes the complementation of edge and semantic information through feature fusion to improve the boundary sensitivity; the addition of the TEDS module enhances the recognition ability of the model for the fine-grained behavior boundary difference.
[0025] The Light-HGBlock-RT-DETR network structure model includes a deep separable convolution and a Light-HGBlock module, and fuses a BatchNorm channel scoring mechanism for parameter compression;
[0026] The Light-HGBlock module uses a deep separable convolution structure to replace part of the convolution layer, and combines a BatchNorm layer scaling factor to sort and prune the channel importance, and the channel importance scoring function is:
[0027] S j = |BN c |
[0028] where S j is the importance score of the channel c, and is determined according to the absolute value of the scaling factor in the corresponding BatchNorm layer whether to retain the channel; when the channel score S j is less than the set threshold τ, it is considered as a low-importance redundant channel and is pruned, thereby realizing structure compression and acceleration, which can meet the deployment requirements of the embedded breeding system.
[0029] In the step 22, a channel scoring mechanism based on a BatchNorm scaling factor is adopted to clip low contribution channels and compress redundant network structures; an Adam optimizer and a cosine annealing scheduling strategy are adopted during training, and a Weight Decay is used to constrain the weight update stability.
[0030] The present application has the advantages of:
[0031] 1. Superior performance in terms of recognition accuracy, model inference speed, edge deployment capability, class distinction capability, and semantic expression capability, with good engineering adaptability and generalizability.
[0032] 2. The present application first uses an RT-DETR end-to-end detection framework as the overall invention framework, which does not rely on redundant candidate frame generation and NMS post-processing, simplifies the inference process, and improves the spatial accuracy of behavior positioning. In experiments, the overall inference process delay of the model is reduced by about 17%, the number of detection error frames is reduced by nearly 20%, especially in crowded or severely occluded scenes, the prediction stability is stronger and the inference process is simplified, which is beneficial to the integration of subsequent modules. Compared with traditional convolutional neural networks, SwinTransformer has the advantages of hierarchical modeling and sliding window attention mechanism, which can more effectively capture the spatial structure features between behaviors. Using Swin Transformer as the backbone network enhances the global modeling capability of the model, and exhibits stronger robustness in behavior recognition of distant and overlapping targets. Experiments show that after replacing the ResNet50 backbone network with Swin Transformer, the mAP is improved by about 3.8%, and the robustness of the model to target size changes is enhanced, especially in the recognition of dynamic behaviors such as "flapping wings", the recognition is more stable, and the generalization performance of the model to behavior posture changes is improved. In actual production tasks, it can enhance the perception ability of distant and small-scale white-feather chickens.
[0033] 3. The proposed TEDS (Target Enhancement Dual-Stream) module can fuse target edges and multi-scale high-level semantic information based on original features, significantly improve the semantic discrimination ability of the model and the perception ability of complex behavior boundaries, increase the mAP@0.5 index from 87.6% of the original model to 91.2%, and increase the Recall from 89.7% to 91.9%, effectively alleviating the semantic ambiguity problem between fine-grained behaviors of white-feather chickens. Especially in the behaviors of "drinking water" and "eating", "standing" and "grooming", the distinction is more accurate, and the false positives and false negatives under multi-target occlusion are also reduced.
[0034] 4. In order to improve channel responsiveness and compress the model size, the present invention introduces the ECANet attention mechanism and the Light-HGBlock lightweight module. The ECANet attention mechanism improves the channel selectivity of the model without significantly increasing the number of model parameters, thereby improving the specificity of behavior classification. After adding this to the original backbone network, the mAP increased by 1.3%, especially in the "feather combing" behavior, the Recall increased from 85.5% to 89.1%, reducing the impact of background noise interference on the classification results. The Light-HGBlock lightweight module replaces the traditional convolution with depthwise separable convolution (DWConv), and introduces channel pruning and residual path structure to achieve significant compression of the model volume without losing too much accuracy. Through experiments, the model parameters were compressed from 6.9MB to 3.5MB, with a compression rate of more than 49%. mAP@0.5 remained at 85.3%, only about 5.9% lower than the uncompressed model. The inference frame rate increased from 21.5 FPS to 36.1 FPS, maintaining deployment feasibility on edge devices like the Jetson TX2 while also ensuring stable behavior recognition under compressed conditions. During the model's lightweighting process, a channel scoring pruning strategy based on BatchNorm parameters was introduced to effectively remove redundant feature channels, avoiding information redundancy and memory waste. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 This is a structural schematic diagram of an embodiment of a method for multi-behavior recognition of white-feathered chickens based on deep learning according to the present invention.
[0036] Figure 2 This is a diagram showing the RT-DETR_TEDS recognition effect in an embodiment of the present invention.
[0037] Figure 3 This is the detection effect of Light-HGBlock-RT-DETR under different occlusion conditions in an embodiment of the present invention. DETAILED DESCRIPTION
[0038] The present invention will be further described in detail below with reference to the accompanying drawings.
[0039] like Figure 1 The illustrated embodiment of the present invention leverages a multi-scale feature fusion mechanism and lightweight structural compression design within a deep neural network to achieve high-precision perception of typical behaviors in complex farming scenarios. This implementation process includes multiple steps, including data collection and annotation, model structure design, training strategy setup, and model deployment. These steps include:
[0040] Step 1, preliminary processing of graphics: the present embodiment obtains the daily behavior video of white feather chicken through the layout of a high-definition video camera, the frame rate is 15 frames per second, the resolution is 1920x1080, and the image details are ensured to be complete. By manually selecting representative frame images, seven typical behaviors of "standing", "lying", "moving", "eating", "drinking", "combing", and "wing spreading" are labeled as targets, and a LabelMe tool is used to generate a VOC format label file, which is then uniformly converted into a COCO format to match the training data input requirements. In the image preprocessing process, size normalization (scaled to 640x640 pixels), pixel normalization, color disturbance, random cropping, horizontal flipping and other strategies are used to enhance the diversity and robustness of the training samples;
[0041] Step 2, establish a dual-module execution model as a recognition framework and train it, including:
[0042] Step 21, establish a dual-module execution model composed of an RT-DETR-TEDS white feather chicken behavior recognition model and a Light-HGBlock-RT-DETR network structure model; for high-precision recognition requirements, an RT-DETR-TEDS model with Swin Transformer as the backbone is used, which introduces a TEDS (Target Enhancement Dual-Stream) module to enhance the behavior semantic expression capability; the TEDS module extracts edge gradient features and global semantic features through a dual-path structure, and inputs the decoder after feature alignment and channel fusion, improving the model's ability to distinguish similar behaviors;
[0043] For edge deployment requirements, the present application uses a lightweight HGBlock module, uses a depth separable convolution and channel compression strategy to construct the backbone network Light-HGBlock-RT-DETR network structure model, ensuring the real-time running capability of the model on embedded platforms such as Jetson TX2; the RT-DETR decoder is connected after the backbone output to realize end-to-end target positioning and behavior classification.
[0044] Step 22, training; in the training stage, a channel scoring mechanism based on the scaling factor of BatchNorm is used to crop low-contribution channels and compress redundant network structures. Training is carried out in an environment based on NVIDIA RTX 4060, using the Adam optimizer and cosine annealing scheduling strategy, with a maximum iteration of 300 rounds, a batch size of 16, an initial learning rate of 1e-4, and using Weight Decay to constrain the weight update stability.
[0045] Step 3, deployment: to further improve the running efficiency of the model on low-resource platforms, after training is completed, the model is exported in.pth format and deployed on the Jetson TX2 embedded platform to build a complete real-time behavior recognition system; the process includes image acquisition, real-time preprocessing, forward inference, behavior judgment and visualization output. In actual operation, the model can maintain an accuracy of more than 85% while achieving an inference speed of 36.1 frames per second, meeting the needs of production scenarios for real-time and stability.
[0046] In step 21, the RT-DETR-TEDS white leghorn behavior recognition model is composed of a Swin Transformer backbone network, a TEDS semantic enhancement module, an ECANet channel attention module, and an RT-DETR decoder, realizing end-to-end detection and classification of multiple behaviors of white leghorn chickens; the RT-DETR-TEDS white leghorn behavior recognition model uses Swin Transformer as the backbone network of the end-to-end recognition framework, and embeds the TEDS multi-branch semantic enhancement module, the ECANet channel attention mechanism and the RT-DETR detection decoder. In order to meet the requirements of embedded deployment, a lightweight version is further constructed to improve the inference efficiency of the model by designing Light-HGBlock module and BatchNorm pruning strategy. This method improves the multi-behavior recognition accuracy and deployability in complex background.
[0047] In the feature extraction stage, the RT-DETR-TEDS white leghorn behavior recognition model inputs the image frame with Swin Transformer as the backbone network to extract four-stage multi-scale features; Swin Transformer uses a multi-head self-attention mechanism based on local window division, which uses a sliding window method to fuse cross-region information, effectively obtains long-range dependency structure, and makes up for the limited receptive field problem of traditional convolution structure. The feature map output by each stage is halved in size and increased in channel number, realizing feature encoding from local to global. This backbone can output multi-scale semantic representations for subsequent target behavior detection and classification.
[0048] In the feature enhancement stage, the TEDS module (Target Enhancement Dual-Stream) is introduced to enhance the multi-branch semantics of the backbone output. TEDS adopts a dual-path structure: the edge branch uses the Sobel operator to process the input image to obtain a gradient image, extracts boundary information, and then fuses it with the output of the semantic branch of the backbone. TEDS module uses 1x1 convolution for channel alignment to unify the channel dimension, and through feature fusion, it realizes the complementarity of edge and semantic information to improve the boundary sensitivity. The addition of the TEDS module enhances the model's ability to recognize the differences between fine-grained behaviors (such as wing spreading and feather combing).
[0049] To further enhance the selectivity of the behavior-related semantic dimension, the method introduces an ECANet channel attention module after the TEDS output. The ECANet channel attention module realizes one-dimensional convolution with the convolution kernel as an adaptive parameter k, allowing the model to focus on the target to be recognized before generating enhanced features, thereby modeling the cross-channel weight correlation through local one-dimensional convolution. The core operation form is:
[0050] w = σ(Conv1D(GAP(F)))
[0051] where F is the feature map, GAP represents global average pooling, Conv1D represents a one-dimensional convolution layer, σ is the Sigmoid activation function, and w is the channel weight. The final features are sent to the RT-DETR decoder for behavior target detection and recognition. RT-DETR is an anchor-free, end-to-end target detector that uses a learnable query vector to predict a fixed number of target bounding boxes and class labels. In the design of the loss function for training the model, the overall optimization objective consists of three parts: behavior classification loss bounding box regression loss and GIoU overlap loss The weighted sum of the three forms the final optimization function as follows:
[0052]
[0053] where the weight parameters are empirically set as λ cls = 2.0, λ box = 5.0, and λ giou = 2.0.
[0054] In step 21, the Light-HGBlock-RT-DETR network structure model is composed of deep separable convolution (DWConv) and Light-HGBlock modules, and integrates the BatchNorm channel scoring mechanism for parameter compression, suitable for edge device deployment. The Light-HGBlock-RT-DETR network structure model uses a lightweight Light-HGBlock module to further adapt to low-power devices. The module uses a deep separable convolution structure (Depthwise+PointwiseConv) to replace part of the convolution layers, and combines the BatchNorm layer scaling factor for channel importance sorting and pruning. The channel importance scoring function is:
[0055] S j = |BN c |
[0056] where S jScore the importance of the channel c, and determine whether to retain the channel according to the absolute value of the scaling factor in the corresponding BatchNorm layer. When the channel score S j Less than the set threshold τ, it is considered as a low importance redundant channel and is pruned, thereby realizing structural compression and acceleration, and being able to meet the deployment requirements of an embedded breeding system.
[0057] The platform actually applied by the present application establishes an image data set with a certain scale, which contains seven types of white-feathered chicken behaviors, a total of 2518 images and 8966 annotation boxes, and has good annotation consistency. The model can still maintain an mAP accuracy of about 85.3% under a non-standard posture, verifying its good generalization performance to actual complex scenes. Figure 2 As shown in the behavior recognition schematic diagram of the RT-DETR_TEDS model in the actual intensive breeding scene, the detection box and classification label of multiple behaviors such as standing, eating and drinking are displayed, verifying the recognition stability of the present application under the condition of complex target occlusion. Figure 3 As shown in the detection comparison schematic diagram of the Light-HGBlock-RT-DETR under different occlusion degrees, the white-feathered chicken behavior detection of the model under different occlusion conditions in the actual breeding field can achieve good accuracy, and has certain engineering practical value. Through system testing in high-occlusion, multi-target and behavior-fine-grained similar breeding scenes, the effectiveness of the RT-DETR-TEDS high-precision model and the Light-HGBlock-RT-DETR constructed by the present application is verified.
Claims
1. A method for multi-behavior recognition of white-feathered chickens based on deep learning, characterized in that: include: Step 1: Preliminary graphics processing; Step 2: Establish a dual-module execution model as the recognition framework and train it, including: Step 21: Establish a dual-module execution model consisting of the RT-DETR-TEDS white-feathered chicken behavior recognition model and the Light-HGBlock-RT-DETR network structure model. The RT-DETR-TEDS model with Swin Transformer as the backbone is used to meet high-precision recognition requirements, and the Light-HGBlock-RT-DETR network structure model is used to meet edge deployment requirements. Step 22: Conduct training; Step 3. Deployment: After training is completed, export the dual-module execution model and deploy it on the platform to build a complete real-time behavior recognition system.
2. The method for multi-behavior recognition of white-feathered chickens based on deep learning according to claim 1, characterized in that: In step 1, a high-definition video camera is deployed to obtain daily behavior videos of white-feathered chickens, and the frame rate and resolution are determined; representative frame images are manually selected, target annotations are performed for typical behaviors, and the LabelMe tool is used to generate annotation files in VOC format, which are then uniformly converted into COCO format to match the training data input requirements; finally, size normalization, pixel normalization, color perturbation, random cropping, and horizontal flipping are used to enhance the diversity and robustness of the training samples.
3. The method for multi-behavior recognition of white-feathered chickens based on deep learning according to claim 1, characterized in that: The RT-DETR-TEDS white-feather chicken behavior recognition model includes: In the feature extraction stage, the Swin Transformer backbone network is used as the input of the image frame to extract four-stage multi-scale features; In the feature enhancement stage, the TEDS module is introduced to perform multi-branch semantic enhancement on the backbone output. TEDS adopts a dual-path structure: the edge branch uses the Sobel operator to process the input image to obtain a gradient image, extract boundary information, and then fuse it with the output of the backbone semantic branch. The ECANet channel attention module is introduced after the TEDS output. The ECANet channel attention module is implemented through one-dimensional convolution with an adaptive parameter k as the convolution kernel, allowing the model to focus the network on the target to be identified before generating enhanced features. The core operation form is: w = σ(Conv1D(GAP(F))) Where F is the feature map, GAP represents global average pooling, Conv1D represents a one-dimensional convolutional layer, σ is the Sigmoid activation function, and w is the channel weight. The final feature is sent to the RT-DETR decoder for behavioral target detection and recognition. In the design of the loss function of the training model, the overall optimization goal consists of three items: behavior classification loss Bounding box regression loss And GIoU overlap loss The weighted sum of the three forms the final optimization function as follows: The weight parameters are empirically set to λ cls =2.0,λ box =5.0,λ giou =2.
0.
4. A method for multi-behavior recognition of white-feathered chickens based on deep learning according to claim 3, characterized in that: The TEDS module uses 1×1 convolution to perform channel alignment during the fusion process to unify the channel dimensions, and realizes the complementarity of edge and semantic information through feature fusion to improve boundary sensitivity; the addition of the TEDS module enhances the model's ability to identify fine-grained behavioral boundary differences.
5. The method for multi-behavior recognition of white-feathered chickens based on deep learning according to claim 1, characterized in that: The Light-HGBlock-RT-DETR network structure model includes: deep separable convolution and Light-HGBlock modules, and integrates the BatchNorm channel scoring mechanism for parameter compression; The Light-HGBlock module uses a depth-wise separable convolutional structure to replace some convolutional layers, and combines the BatchNorm layer scaling factor to perform channel importance sorting and pruning. The channel importance scoring function is: S j =|BN c | Among them S j Score the importance of channel c and decide whether to retain the channel based on the absolute value of the scaling factor in the corresponding BatchNorm layer; when the channel score S j When it is less than the set threshold τ, it is regarded as a low-importance redundant channel and is pruned, thereby achieving structural compression and acceleration, which can meet the deployment requirements of embedded aquaculture systems.
6. The method for multi-behavior recognition of white-feathered chickens based on deep learning according to claim 1, characterized in that: In step 22, a channel scoring mechanism based on the BatchNorm scaling factor is adopted to prune low-contribution channels and compress redundant network structures. During training, the Adam optimizer and the cosine annealing scheduling strategy are used, and Weight Decay is used to constrain the stability of weight updates.