Broiler target detection method, system, device and medium based on occlusion perception

By introducing an occlusion-aware attention module and optimizing the occlusion loss function into the YOLOv8 model, the problems of occlusion and background interference in broiler target detection are solved, achieving high-precision and efficient target detection, which is suitable for intensive farming environments.

CN119763009BActive Publication Date: 2026-01-13SOUTH CHINA AGRICULTURAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411805438.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2026-01-13
Estimated Expiration
2044-12-10

AI Technical Summary

Technical Problem

Existing target detection methods for broiler chickens are easily affected by occlusion and background interference in intensive farming environments, resulting in low detection accuracy. Furthermore, deep learning models are difficult to run efficiently in environments with limited computing resources.

Method used

We designed an occlusion-aware attention module and combined it with the occlusion loss function of repulsion loss and CIOU loss to optimize the YOLOv8 model and improve the accuracy of occluded target detection. We also enhanced feature representation and optimized bounding box prediction by using position, channel and pixel attention modules.

Benefits of technology

It significantly improves the accuracy and efficiency of target detection in broilers, with an average accuracy of 93.35% and an average detection time of no more than 2 seconds, making it adaptable to diverse environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119763009B_ABST
    Figure CN119763009B_ABST
Patent Text Reader

Abstract

The application discloses a broiler target detection method and system based on occlusion perception, equipment and a medium, and the method comprises the following steps: acquiring broiler images in various breeding scenes and constructing a broiler image dataset; designing a multi-dimensional occlusion perception attention module and embedding the occlusion perception attention module between the backbone network and the neck network of a YOLOv8 model to construct a broiler target detection model based on occlusion perception; training the broiler target detection model according to the broiler image dataset, and in the training, for densely occluded targets, an occlusion loss function combined by a repulsion loss and a CIOU loss is used to optimize the prediction accuracy of the target bounding box; and the trained broiler target detection model is applied to a broiler dense scene for target detection. The application can effectively solve the detection difficulty problem caused by the occlusion of broiler targets, thereby improving the detection accuracy and providing reliable support for intelligent breeding scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method, system, device, and medium for broiler target detection based on occlusion perception, belonging to the fields of computer vision, target detection, broiler farming, and application technology. Background Technology

[0002] Broiler farming, as an important part of the livestock industry, is characterized by low costs, short production cycles, and high feeding efficiency, making it a vital source of high-quality protein for humans. In the process of broiler farming, individual monitoring and management are crucial, especially in intensive farming environments where the limited space and large numbers of broilers make individual identification and counting particularly complex.

[0003] The existing methods can be mainly divided into methods based on traditional image processing and methods based on deep learning.

[0004] The general process of target detection using traditional image processing algorithms is as follows: First, extract features such as texture, shape, color, and size of the target from the image; then, detect the object from the obtained features; and finally, perform the detection operation using relevant image processing methods. Although traditional image processing methods have the advantages of high computational speed and low resource consumption, their detection performance usually relies on manually designed feature extraction algorithms. When dealing with complex backgrounds, traditional methods are easily affected by interference, leading to an inability to effectively extract the features of chickens, thus affecting the overall detection accuracy. This method has the following shortcomings in dense chicken flock environments:

[0005] 1) Susceptible to background interference: Complex backgrounds in the chicken coop environment (such as waterers, shadows, and changes in lighting) can interfere with feature extraction, and traditional methods are poorly adapted to these interferences. In particular, when the background texture is similar to the target, edge detection and shape features are difficult to effectively separate the chicken target, affecting the detection results.

[0006] 2) Insufficient adaptability and generalization ability: Traditional methods usually rely on fixed feature extraction methods. When the environmental or object characteristics change (e.g., changes in lighting conditions, feeding methods, or chicken breeds), the algorithm features need to be redesigned or adjusted manually. Therefore, traditional methods have significant limitations in application under different environments and are difficult to adapt to diverse practical situations.

[0007] 3) Cumbersome post-processing steps: Traditional methods usually require additional post-processing steps to improve detection accuracy. These steps may include threshold selection, region merging, etc., which increases the complexity and uncertainty of the algorithm.

[0008] In recent years, the rapid development of deep learning has provided new solutions for object detection in botnets. Object detection algorithms are mainly divided into two categories: one-stage and two-stage algorithms. One-stage algorithms are mainly represented by SSD and YOLO, which simultaneously predict the class and bounding box location, resulting in fast detection speeds. Two-stage object detection involves two phases: the first phase extracts the region of interest, and the second phase performs classification and localization; a representative algorithm is Faster R-CNN.

[0009] Despite the powerful feature learning capabilities of deep learning models, they still face numerous challenges in detecting broiler chickens in complex environments like chicken coops. In these environments, chickens are typically densely packed and heavily occluded, making it difficult for models to effectively distinguish overlapping targets. While improved non-maximum suppression (NMS) algorithms perform well in removing redundant bounding boxes, they may falsely suppress true bounding boxes in scenarios with highly overlapping targets, further exacerbating the missed detection problem. Similarly, existing attention mechanisms also have limitations. Many methods focus on enhancing the model's attention to high-level semantic features, often neglecting the importance of low-level detailed features. This deficiency is particularly pronounced in scenarios with severe occlusion or complex backgrounds, significantly limiting further performance improvements. Furthermore, computational resource requirements are a significant factor limiting the practical application of object detection models. For example, Two-Stage methods typically rely on complex network structures and a large number of parameters, demanding substantial computational resources. They are difficult to run efficiently on edge devices or in resource-constrained environments. Simultaneously, in real-time detection scenarios, insufficient computational resources can lead to detection latency, thereby reducing the system's real-time responsiveness. Summary of the Invention

[0010] In view of this, the present invention provides a method, system, computer device and storage medium for broiler target detection based on occlusion perception. By designing an occlusion perception attention module and optimizing the occlusion loss function, it can effectively solve the problem of difficult detection of broiler targets caused by occlusion, thereby improving the accuracy of recognition and providing reliable support for intelligent farming scenarios.

[0011] The first objective of this invention is to provide a method for detecting broiler targets based on occlusion perception.

[0012] The second objective of this invention is to provide a broiler target detection system based on occlusion perception.

[0013] A third objective of this invention is to provide a computer device.

[0014] A fourth objective of this invention is to provide a computer-readable storage medium.

[0015] The first objective of this invention can be achieved by adopting the following technical solution:

[0016] A method for detecting broiler targets based on occlusion perception, the method comprising:

[0017] Acquire images of broilers in various farming scenarios and construct a broiler image dataset;

[0018] Design a multi-dimensional occlusion perception attention module and embed the occlusion perception attention module between the backbone network and the neck network of the YOLOv8 model to build a broiler target detection model based on occlusion perception.

[0019] Based on the broiler chicken image dataset, a broiler chicken target detection model was trained. During training, for densely occluded targets, an occlusion loss function combining repulsion loss and CIOU loss was used to optimize the prediction accuracy of the target bounding box.

[0020] The trained broiler target detection model was applied to broiler-dense scenes to perform target detection.

[0021] Furthermore, the occlusion perception attention module includes a position attention module, a channel attention module, and a pixel attention module;

[0022] The position attention module is used to receive the initial low-level feature map from the backbone network and adjust it through the position attention mechanism to obtain the adjusted low-level feature map.

[0023] The channel attention module is used to receive the initial high-level feature map from the pyramid attention network and adjust it through the channel attention mechanism to obtain the adjusted high-level feature map.

[0024] The pixel attention module is used to sum the adjusted low-level feature map and the adjusted high-level feature map, and combine the initial low-level feature map and the initial high-level feature map to generate a pixel-level attention map.

[0025] Furthermore, the location attention module is represented as follows:

[0026] F pa =F low ⊙Sigmoid(Conv 7×7 (Concat(AvgPool(F low ),MaxPool(F low ))))

[0027] Here, Sigmoid is an activation function that maps input values ​​to the range between 0 and 1, AvgPool represents average pooling, MaxPool represents max pooling, Concat is a concatenation operation that combines the outputs of average pooling and max pooling layers along the channel dimension, and F... low F represents the initial low-level feature map. pa This refers to the feature map adjusted through the positional attention mechanism, i.e., the low-level feature map is adjusted.

[0028] Furthermore, the channel attention module is represented as follows:

[0029] F ca =Conv 1×1 (ReLU(Conv 1×1 (AvgPool(F high ))))

[0030] Where ReLU is the modified linear unit activation function, F high F represents the initial high-level feature map. ca This refers to the feature map adjusted through the channel attention mechanism, i.e., the high-level feature map.

[0031] Furthermore, the expression for the pixel attention module is as follows:

[0032] F pixel =Sigmoid(Conv 7×7 (Concat(F low ,F high ,F pa +F ca )))

[0033] Among them, Conv 7×7 This indicates a 7×7 convolution operation, F low F represents the initial low-level feature map. high F represents the initial high-level feature map. pa This refers to the feature map adjusted through the positional attention mechanism, i.e., the low-level feature map is adjusted, F ca This refers to the feature map adjusted through the channel attention mechanism, i.e., the high-level feature map, F. pixel This represents a pixel-level attention map.

[0034] Furthermore, the pixel-level attention maps are re-fused and output using 1×1 convolutions to adjust the channels, as follows:

[0035] F out =Conv 1×1 (F low ⊙F pixel +F high ⊙(1-Fpixel ))

[0036] Among them, F low and F high respectively with F pixel and 1-F pixel Perform element-wise multiplication to make the output F out It combines feature information from different levels.

[0037] Furthermore, the occlusion loss function is as follows:

[0038] L = L CIoU +α×L RepGT +β×L RepBox

[0039] Among them, L CIoU It is an attraction term that forces the predicted bounding box to be close to its specified ground truth box. RepGT and L RepBox These are exclusion terms, with coefficients α and β serving as weights to balance the auxiliary loss;

[0040] L CIoU The definition is as follows:

[0041]

[0042] Where IoU represents the intersection-union ratio between the predicted target bounding box and the ground truth bounding box, ρ 2 (b,b gt () represents the center point b of the predicted bounding box and the center point b of the ground truth bounding box. gt The Euclidean distance between them, where c represents the length of the diagonal of the smallest bounding rectangle containing the predicted and ground truth boxes. It is a weighted term that measures the consistency of aspect ratio, where v represents the difference in aspect ratio between the predicted box and the ground truth box;

[0043] L RepGT The definition is as follows:

[0044]

[0045] in, Represents the set of all positive samples. It is the true bounding box with the largest IoU around the target, Smooth ln It is a smooth ln function that is continuously differentiable in (0,1);

[0046] L RepBox The definition is as follows:

[0047]

[0048] Where 1 is the identity function, and ∈ is a very small constant (with a value of 10).-6 ), and For different groups P i and P j The prediction boxes between.

[0049] The second objective of this invention can be achieved by adopting the following technical solution:

[0050] A broiler target detection system based on occlusion perception, the system comprising:

[0051] The first building unit is used to acquire broiler images under various farming scenarios and construct a broiler image dataset;

[0052] The second building unit is used to design a multi-dimensional occlusion perception attention module and embed the occlusion perception attention module between the backbone network and the neck network of the YOLOv8 model to build a broiler target detection model based on occlusion perception.

[0053] The training unit is used to train the broiler target detection model based on the broiler image dataset. During training, for densely occluded targets, the occlusion loss function, which combines repulsion loss and CIOU loss, is used to optimize the prediction accuracy of the target bounding box.

[0054] The detection unit is used to apply the trained broiler target detection model to broiler-dense scenes for target detection.

[0055] The third objective of this invention can be achieved by adopting the following technical solution:

[0056] A computer device includes a processor and a memory for storing a processor-executable program, characterized in that when the processor executes the program stored in the memory, it implements the above-described broiler target detection method.

[0057] The fourth objective of this invention can be achieved by adopting the following technical solution:

[0058] A computer-readable storage medium storing a program that, when executed by a processor, implements the above-described method for detecting broiler targets.

[0059] The present invention has the following advantages over the prior art:

[0060] 1. The target detection model of the present invention has significant advantages. By introducing an occlusion perception attention module, it effectively solves the detection difficulties caused by overlapping and occlusion of chickens in dense scenes, and significantly improves the detection accuracy. In addition, by adopting an optimized occlusion loss function, it ensures that the target can still be accurately judged when chickens are densely overlapping, reducing the risk of missed detection and false detection.

[0061] 2. In dense scenes, the optimized target detection model of this invention achieves a mean average accuracy (mAP) of up to 93.35%, which is significantly higher than the performance of other target detection models. At the same time, the model exhibits superior efficiency in the inference process, with an average detection time of no more than 2 seconds. Attached Figure Description

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

[0063] Figure 1 This is a flowchart of the broiler target detection method based on occlusion perception according to Embodiment 1 of the present invention.

[0064] Figures 2a to 2d Images of broilers collected under different farming conditions in Embodiment 1 of the present invention.

[0065] Figure 3 This is an architecture diagram of the broiler target detection model based on occlusion perception according to Embodiment 1 of the present invention.

[0066] Figure 4 This is a schematic diagram of the occlusion perception attention module in Embodiment 1 of the present invention.

[0067] Figure 5 This is a structural block diagram of the broiler target detection system based on occlusion perception according to Embodiment 2 of the present invention.

[0068] Figure 6 This is a structural block diagram of the computer device according to Embodiment 3 of the present invention. Detailed Implementation

[0069] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0070] Example 1:

[0071] like Figure 1 As shown, this embodiment provides a broiler target detection method based on occlusion perception, which includes the following steps:

[0072] S101. Obtain broiler images under various breeding scenarios and construct a broiler image dataset.

[0073] The construction of the broiler chicken image dataset in this embodiment includes three parts: image acquisition, data annotation, and dataset partitioning, as detailed below:

[0074] Image Acquisition: Real-world images were captured from multiple farms to ensure data diversity and representativeness. During the acquisition process, intelligent monitoring equipment was used to capture images from different angles, showing the behavior of broilers in various states. In some scenes, the broilers were relatively sparse, creating a clear field of vision and making individual features easily identifiable; in other scenes, the broilers appeared more crowded, possibly clustered near feed troughs or other activity areas. This sparseness and density accurately reflects the behavior of broilers in the farming environment. Some typical images captured include... Figures 2a to 2d As shown, these images lay the foundation for the subsequent creation of datasets and are used for model training and evaluation, improving their performance in practical applications.

[0075] Data annotation: After acquiring images of broiler chickens, the images were selected, prioritizing clear and well-lit photos to ensure that the images included chickens from different angles and postures, such as feeding and resting, and covered both sparse and dense areas. The open-source CVAT software was used for image annotation. During the annotation process, each chicken in the image was accurately labeled to ensure that the bounding box of each individual was clearly visible. This process not only included labeling the shape of the chickens but also assigning a corresponding category label to each chicken to facilitate subsequent target detection tasks.

[0076] Dataset partitioning: After labeling, the dataset will be partitioned in a 6:2:2 ratio. 60% of the images will be used as the training set for model learning; 20% of the images will be used as the validation set to evaluate model performance and tune hyperparameters; and the remaining 20% ​​of the images will be used as the test set for final model performance testing.

[0077] S102. Design a multi-dimensional occlusion perception attention module and embed the occlusion perception attention module between the backbone network and the neck network of the YOLOv8 model to construct a broiler target detection model based on occlusion perception.

[0078] In this embodiment, the YOLOv8 object detector is selected as the baseline model, such as Figure 3As shown, the macroscopic architecture of the model can be decomposed into three main parts: the backbone network, the neck network, and the detection head. The input image is first processed through the backbone network, which consists of multiple stages, each responsible for effectively extracting features at different scales. In the neck network, the structure of the path aggregation network (PAN) is retained. To enhance the model's feature extraction capability in densely occluded environments, an occlusion-aware attention module (OPAM) is designed, which fuses features from the low-level feature layer C2 and the high-level feature layer F3 to enhance the ability to represent features in occluded regions. In the head network, the model generates diverse output information at three different resolutions (P3, P4, P5) to adapt to small-scale, medium-scale, and large-scale detection capabilities, respectively.

[0079] Occlusion Awareness Attention Module: The P2 layer's unique low-level features contain rich details and spatial location information, giving it an advantage in detecting small targets and occlusions. However, while adding an additional xsmall detector head directly to the P2 layer can enhance the model's ability to handle occluded scenes, this significantly increases computational complexity and fails to fully utilize the potential spatial information of the P2 layer. Therefore, this embodiment proposes an Occlusion Awareness Attention Module (OPAM), such as... Figure 4 As shown, this module can enhance feature representation without adding new detection heads. The occlusion-aware attention module introduces a multi-dimensional attention mechanism to adaptively identify dense regions and suppress interference from irrelevant information, thereby improving the accuracy of feature representation. First, the occlusion-aware attention module encodes low-level and high-level features through a feature extraction network. The position attention module receives input from low-level features, which typically contain rich spatial location information and details. This position attention module enhances the spatial representation of features by capturing spatial relationships between targets, especially subtle changes in occluded scenes. On the other hand, the channel attention module... The block takes high-level features as input, which contain more semantic information. The channel attention module improves the target features by assigning adaptive weights to different channels, thereby better distinguishing occluded targets from the background. However, directly adding the features processed by the positional attention and channel attention modules may lead to a mismatch in the receptive field. To solve this problem, the initial low-level features, the initial high-level features, and the features processed by positional and channel attention are input into the pixel attention module to calculate weights. Then, they are combined by weighted summation to improve the network's discriminative ability to target features. Finally, 1×1 convolution is used to reduce the dimensionality to an appropriate dimension.

[0080] The positional attention module receives the initial low-level feature map F from the backbone network. low And by adjusting it through a positional attention mechanism, an adjusted low-level feature map F is obtained. pa The expression is as follows:

[0081] F pa =F low ⊙Sigmoid(Conv 7×7 (Concat(AvgPool(F low ),MaxPool(F low )))) (1)

[0082] Here, Sigmoid is an activation function that maps input values ​​to the range of 0 and 1, AvgPool represents average pooling, MaxPool represents max pooling, and Concat is a concatenation operation that combines the outputs of average pooling and max pooling layers along the channel dimension, allowing the model to retain the average and max spatial information from low-level features. low F represents the initial low-level feature map. pa This refers to the feature map adjusted through the positional attention mechanism, i.e., the low-level feature map is adjusted.

[0083] The channel attention module receives the initial high-level feature map F from the pyramid attention network. high And by adjusting through a channel attention mechanism, an adjusted high-level feature map F is obtained. ca The expression is as follows:

[0084] F ca =Conv 1×1 (ReLU(Conv 1×1 (AvgPool(F high (2)

[0085] Where ReLU is the modified linear unit activation function, F high F represents the initial high-level feature map. ca This refers to the feature map adjusted through the channel attention mechanism, i.e., the high-level feature map.

[0086] The pixel attention module sums the low-level feature map with the adjusted high-level feature map F. pa +F ca Combined with the initial low-level feature map F low and the initial high-level feature map F high Generate a pixel-level attention map, expressed as follows:

[0087] F pixel =Sigmoid(Conv 7×7 (Concat(F low ,F high ,F pa +F ca ))) (3)

[0088] Among them, Conv 7×7This indicates a 7×7 convolution operation, F low F represents the initial low-level feature map. high F represents the initial high-level feature map. pa This refers to the feature map adjusted through the positional attention mechanism, i.e., the low-level feature map is adjusted, F ca This refers to the feature map adjusted through the channel attention mechanism, i.e., the high-level feature map, F. pixel Represents pixel-level attention maps to enhance the expressive power of feature maps.

[0089] The pixel-level attention map is re-fused and output using a 1×1 convolution to adjust the channels, as follows:

[0090] F out =Conv 1×1 (F low ⊙F pixel +F high ⊙(1-F pixel (4)

[0091] Among them, F low and F high respectively with F pixel and 1-F pixel Perform element-wise multiplication to make the output F out It combines feature information from different levels.

[0092] S103. Based on the broiler chicken image dataset, train the broiler chicken target detection model. During training, for densely occluded targets, use an occlusion loss function that combines repulsion loss and CIOU loss to optimize the prediction accuracy of the target bounding box.

[0093] In this embodiment, occlusion often prevents the model from accurately identifying partially occluded targets during object detection. To optimize detection performance, a combination of CIOU (Complete Intersection over Union) loss and repulsion loss is used to calculate the bounding box loss, forming the occlusion loss function to address the problem of inaccurate bounding box regression in dense environments. Furthermore, binary cross-entropy (BCE) is used for classification loss to ensure accuracy and stability. The introduced repulsion loss consists of two parts: RepGT and RepBox. Therefore, the occlusion loss function comprises three parts:

[0094] L = L CIoU +α×L RepGT +β×L RepBox (5)

[0095] Among them, L CIoUIt is an attraction term that forces the predicted bounding box to be close to its specified ground truth box; here, CIoU and L are used. RepGT and L RepBox These are exclusion terms, with coefficients α and β serving as weights to balance the auxiliary loss.

[0096] L CIoU The definition is as follows:

[0097]

[0098]

[0099] Where IoU represents the intersection-union ratio between the predicted target bounding box and the ground truth bounding box, ρ 2 (b,b gt () represents the center point b of the predicted bounding box and the center point b of the ground truth bounding box. gt The Euclidean distance between them, where c represents the length of the diagonal of the smallest bounding rectangle containing the predicted and ground truth boxes. It is a weighted term that measures the consistency of aspect ratio, where v represents the difference in aspect ratio between the predicted box and the ground truth box.

[0100] L CIoU By comprehensively considering IoU, center point distance, and aspect ratio, the regression process becomes more robust, especially in cases of object occlusion or positional shift.

[0101] The purpose of RepGT is to move the current bounding box as far away as possible from the surrounding ground truth bounding boxes. RepGT The definition is as follows:

[0102]

[0103] in, Represents the set of all positive samples. The true bounding box with the largest IoU around the target, P and The overlap between them is defined as the intersection (IoG) of the ground truth bounding boxes: And IoG(P,G)∈[0,1], Smooth ln It is a smooth ln function that is continuously differentiable in (0,1) and is used to adjust the sensitivity of the loss to outliers.

[0104] The purpose of RepBox is to make the prediction boxes as far away as possible from the surrounding prediction boxes and reduce the IOU between them. RepBox The definition is as follows:

[0105]

[0106] Where 1 is the identity function, and ∈ is a very small constant (with a value of 10). -6 ), and For different groups P i and P j The smaller the overlap area between the prediction boxes, the better.

[0107] This embodiment uses a variety of evaluation metrics to comprehensively evaluate the performance of the broiler target detection model, mainly including precision, recall and mean average precision (mAP). Precision and recall are calculated as shown in equations (12) and (13).

[0108]

[0109] TP is the number of correctly predicted bounding boxes, FP is the number of incorrectly predicted positive samples, FN is the number of undetected targets, mean precision (AP) is the average accuracy of the model, mean average precision (mAP) is the average of AP, and n is the number of classes. The calculation of mean precision and mean average precision is shown in equations (14) and (15).

[0110]

[0111] The target detection model for broiler chickens in this embodiment has a mean average accuracy (mAP) of up to 93.35%, which is significantly higher than the performance of other target detection models. At the same time, the model shows superior efficiency in the inference process, with an average detection time of no more than 2 seconds.

[0112] S104. Apply the trained broiler target detection model to broiler-dense scenes to perform target detection.

[0113] It should be noted that although the above-described method operations are depicted in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the illustrated operations must be performed to achieve the desired result. On the contrary, the order of execution of the depicted steps can be changed. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0114] Example 2:

[0115] like Figure 5 As shown, this embodiment provides a broiler target detection system based on occlusion perception. The system includes a first construction unit 501, a second construction unit 502, a training unit 503, and a detection unit 504. The specific functions of each unit are as follows:

[0116] The first building unit 501 is used to acquire broiler images under various breeding scenarios and build a broiler image dataset;

[0117] The second building unit 502 is used to design a multi-dimensional occlusion perception attention module and embed the occlusion perception attention module between the backbone network and the neck network of the YOLOv8 model to build a broiler target detection model based on occlusion perception.

[0118] Training unit 503 is used to train the broiler target detection model based on the broiler image dataset. During training, for densely occluded targets, the prediction accuracy of the target bounding box is optimized by using an occlusion loss function that combines repulsion loss and CIOU loss.

[0119] The detection unit 504 is used to apply the trained broiler target detection model to broiler-dense scenes for target detection.

[0120] The specific implementation of each unit in this embodiment can be found in Embodiment 1 above, and will not be repeated here. It should be noted that the system provided in this embodiment is only illustrated by the division of the above functional units. In practical applications, the above functions can be assigned to different functional units as needed, that is, the internal structure can be divided into different functional units to complete all or part of the functions described above.

[0121] Example 3:

[0122] This embodiment provides a computer device, such as... Figure 6 As shown, it includes a processor 602, a memory, an input device 603, a display device 604, and a network interface 605 connected via a device bus 601. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium 606 and internal memory 607. The non-volatile storage medium 606 stores operating devices, computer programs, and a database. The internal memory 607 provides an environment for the operation of the operating devices and computer programs in the non-volatile storage medium. When the processor 602 executes the computer program stored in the memory, it implements the broiler target detection method of Embodiment 1 described above, as follows:

[0123] Images of broilers in various farming scenarios were acquired, and a broiler image dataset was constructed. A multi-dimensional occlusion-aware attention module was designed and embedded between the backbone network and the neck network of the YOLOv8 model to construct an occlusion-aware broiler target detection model. The broiler target detection model was trained based on the broiler image dataset. During training, for densely occluded targets, an occlusion loss function combining repulsion loss and CIOU loss was used to optimize the prediction accuracy of the target bounding box. The trained broiler target detection model was applied to dense broiler scenes for target detection.

[0124] Example 4:

[0125] This embodiment provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the broiler target detection method of Embodiment 1 above, as follows:

[0126] Images of broilers in various farming scenarios were acquired, and a broiler image dataset was constructed. A multi-dimensional occlusion-aware attention module was designed and embedded between the backbone network and the neck network of the YOLOv8 model to construct an occlusion-aware broiler target detection model. The broiler target detection model was trained based on the broiler image dataset. During training, for densely occluded targets, an occlusion loss function combining repulsion loss and CIOU loss was used to optimize the prediction accuracy of the target bounding box. The trained broiler target detection model was applied to dense broiler scenes for target detection.

[0127] It should be noted that the computer-readable storage medium in this embodiment can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.

[0128] In this embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this embodiment, the computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable program. This propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable storage medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable storage medium can be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0129] The aforementioned computer-readable storage medium can be used to write computer programs for executing this embodiment in one or more programming languages ​​or combinations thereof. These programming languages ​​include object-oriented programming languages—such as Java, Python, and C++—and conventional procedural programming languages—such as C or similar programming languages. The program can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0130] In summary, the method of this invention can directly identify broilers without stress or harm, reducing interference and stress on the chickens, ensuring their health and well-being, and improving the accuracy and reliability of identification. While traditional image processing methods offer high efficiency, they are typically subject to strict requirements regarding lighting and background conditions. This invention is not limited by specific shooting conditions and can operate stably in various environments, significantly reducing shooting requirements. Compared to existing methods that rely on complex equipment for broiler identification, the high-precision detection method designed in this invention can directly utilize image information for automatic identification and counting of broilers in dense scenes, avoiding reliance on traditional weighing or manual counting. Existing target detection methods are prone to missed detections when dealing with broiler occlusion, affecting identification accuracy. This invention, by designing an occlusion perception module and optimizing the occlusion loss function, effectively solves the problem of difficult detection of broiler targets due to occlusion, thereby improving identification accuracy and providing reliable support for intelligent farming scenarios.

[0131] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope disclosed in the present invention, based on the technical solution and inventive concept of the present invention, shall fall within the scope of protection of the present invention.

Claims

1. A broiler target detection method based on occlusion perception, characterized in that, The method comprises: acquiring broiler chicken images under various breeding scenes and constructing a broiler chicken image dataset; designing a multi-dimensional occlusion perception attention module and embedding the occlusion perception attention module between a backbone network and a neck network of a YOLOv8 model to construct a broiler chicken target detection model based on occlusion perception; training the broiler chicken target detection model according to the broiler chicken image dataset, wherein, in the training, for densely occluded targets, an occlusion loss function combining a repulsion loss and a CIOU loss is used to optimize the prediction accuracy of target bounding boxes; applying the trained broiler chicken target detection model to a broiler chicken dense scene for target detection; in the broiler chicken target detection model, an input image is first processed by a backbone network, the backbone network is composed of multiple stages, and each stage is responsible for extracting features of different scales; in the neck network, the structure of a preserved path aggregation network is retained, an occlusion perception attention module is designed, and features from a low-level feature C2 layer and a high-level feature F3 layer are fused to enhance the ability of the occlusion region feature expression; in the head network, diversified output information is generated through three different resolutions to adapt to the detection capabilities of small, medium and large scales respectively; the occlusion perception attention module encodes low-level features and high-level features through a feature extraction network, a position attention module receives input from the low-level features, the position attention module enhances the spatial representation of the features by capturing the spatial relationship between targets, a channel attention module takes the high-level features as input, the channel attention module improves the target features by assigning adaptive weights to different channels to distinguish between occluded targets and backgrounds, an initial low-level feature, an initial high-level feature and the features subjected to position and channel attention are input into a pixel attention module to calculate weights, and then the features are combined through weighted summation to improve the discriminability of the network to the target features; finally, the features are reduced to a suitable dimension through 1x1 convolution.

2. The broiler chicken target detection method according to claim 1, characterized in that, The occlusion perception attention module comprises a position attention module, a channel attention module and a pixel attention module; the position attention module is configured to receive an initial low-level feature map from the backbone network and adjust the initial low-level feature map through a position attention mechanism to obtain an adjusted low-level feature map; the channel attention module is configured to receive an initial high-level feature map from the pyramid attention network and adjust the initial high-level feature map through a channel attention mechanism to obtain an adjusted high-level feature map; the pixel attention module is configured to sum the adjusted low-level feature map and the adjusted high-level feature map, combine the initial low-level feature map and the initial high-level feature map, and generate a pixel-level attention map.

3. The broiler chicken target detection method according to claim 2, wherein, The position attention module is represented as follows: F pa = F low ⊙ Sigmoid(Conv 7×7 (Concat(AvgPool(F low ), MaxPool(F low )))) wherein Sigmoid is an activation function mapping input values between 0 and 1, AvgPool represents an average pooling operation, MaxPool represents a maximum pooling operation, Concat is a concatenation operation combining the outputs of the average pooling layer and the maximum pooling layer along the channel dimension, and F low represents an initial low-level feature map, F pa represents a feature map adjusted by the position attention mechanism, i.e., an adjusted low-level feature map.

4. The broiler chicken target detection method according to claim 2, wherein, The channel attention module is represented as follows: F ca = Conv 1×1 (ReLU(Conv 1×1 (AvgPool(F high )))) where ReLU is a rectified linear unit activation function, F high represents an initial high-level feature map, F ca represents a feature map adjusted by a channel attention mechanism, i.e., an adjusted high-level feature map.

5. The broiler chicken target detection method according to claim 2, wherein, The pixel attention module is expressed as follows: F pixel = Sigmoid(Conv 7×7 (Concat(F low , F high , F pa + F ca ))) where Conv 7×7 denotes a 7x7 convolution operation, F low denotes the initial low-level feature map, F high denotes the initial high-level feature map, F pa denotes the feature map adjusted by the position attention mechanism, i.e., the adjusted low-level feature map, F ca denotes the feature map adjusted by the channel attention mechanism, i.e., the adjusted high-level feature map, F pixel denotes the pixel-level attention map.

6. The broiler chicken target detection method according to claim 5, wherein, The pixel-level attention map is re-fused and output through 1x1 convolution to adjust the channel, as follows: F out = Conv 1×1 (F low ⊙F pixel +F high ⊙(1-F pixel )) where F low and F high are respectively multiplied by F pixel and 1-F pixel to make the output F out combine the feature information of different levels.

7. The broiler chicken target detection method according to claim 1, wherein, The occlusion loss function is as follows: L = L CIoU + a x L RepGT + β x L RepBox where L CIoU is an attractive term that forces the predicted bounding box to be close to its designated ground truth box, L RepGT and L RepBox are repulsive terms, and the coefficients a and b serve as weights to balance the auxiliary loss. L CIoU are defined as follows: wherein, IoU represents the intersection over union of the target prediction box and the real box, ρ 2 (b, b gt ) represents the Euclidean distance between the prediction box center point b and the real box center point b gt , c represents the length of the diagonal line of the minimum circumscribed rectangle containing the prediction box and the real box, is a weight term for measuring the consistency of the aspect ratio, v represents the aspect ratio difference between the prediction box and the real box. L RepGT are defined as follows: wherein, denotes the set of all positive samples, is the ground truth bounding box with the largest surrounding IoU, Smooth ln is a smooth ln function that is continuously differentiable in (0, 1); L RepBox are defined as follows: where 1 is the identity function and ∈ is a small constant, and are the predicted boxes between different groups P i and P j .

8. A broiler target detection system based on occlusion-aware, characterized in that, The system comprises: a first construction unit configured to acquire broiler chicken images under various breeding scenes and construct a broiler chicken image dataset; The second construction unit is used for designing a multi-dimensional occlusion perception attention module, embedding the occlusion perception attention module between a backbone network and a neck network of a YOLOv8 model, and constructing an occlusion perception-based broiler target detection model. The training unit is used for training the broiler target detection model according to a broiler image dataset, and in the training, the prediction accuracy of the target bounding box is optimized by using an occlusion loss function combined by a repulsion loss and a CIOU loss for the densely occluded target. The detection unit is used for applying the trained broiler target detection model to a broiler dense scene for target detection. In the broiler target detection model, an input image is first processed by a backbone network, the backbone network is composed of multiple stages, and each stage is responsible for extracting features of different scales; in the neck network, the structure of the preserved path aggregation network is retained, the occlusion perception attention module is designed, and the features from the low-level feature C2 layer and the high-level feature F3 layer are fused to enhance the ability of the occlusion region feature expression; in the head network, diversified output information is generated through three different resolutions to adapt to the detection ability of small, medium and large scales respectively. The occlusion perception attention module encodes the low-level features and the high-level features through a feature extraction network, a position attention module receives input from the low-level features, the position attention module enhances the spatial representation of the features by capturing the spatial relationship between the targets, a channel attention module takes the high-level features as input, the channel attention module improves the target features by assigning adaptive weights to different channels to distinguish the occluded targets and the background, the initial low-level features, the initial high-level features and the features subjected to the position and channel attentions are input into a pixel attention module to calculate weights, and then the features are combined through weighted summation to improve the discriminability of the network to the target features; finally, the features are reduced to a suitable dimension through 1×1 convolution.

9. A computer device comprising a processor and a memory for storing a processor executable program, characterized in that, The processor executes the program stored in the memory to implement the broiler target detection method of any one of claims 1-7.

10. A computer-readable storage medium storing a program, characterized in that, The program is executed by the processor to implement the broiler target detection method of any one of claims 1-7.

Citation Information

Patent Citations

  • Method for detecting densely shielded fishes based on YOLOv5 network

    CN114782759A

  • Wheat scab spore target detection method in shielding scene

    CN118823773A