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

By embedding the occlusion perception attention module and optimizing the occlusion loss function in the YOLOv8 model, the detection difficulties caused by occlusion and background complexity in dense scenes are solved, and the high-precision and high-efficiency target detection effect is achieved.

CN119763009AActive Publication Date: 2025-04-04SOUTH CHINA AGRICULTURAL UNIVERSITY

Patent Information

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

AI Technical Summary

Technical Problem

In dense broiler breeding environments, traditional image processing and deep learning methods are difficult to effectively identify and count detection difficulties caused by occlusion and background complexity, resulting in low detection accuracy and high resource consumption.

Method used

A broiler object detection method based on occlusion perception is designed. By embedding a multi-dimensional occlusion perception attention module in the YOLOv8 model, and combining the occlusion loss function of rejection loss and CIOU loss, the prediction accuracy of the target bounding box is optimized.

Benefits of technology

The accuracy and efficiency of target detection of broiler chickens was significantly improved, and the average average accuracy of 93.35% was achieved in dense scenarios, and the average detection time was maintained at a low level during the inference process without more than 2 seconds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119763009A_ABST
    Figure CN119763009A_ABST
Patent Text Reader

Abstract

The invention discloses a broiler target detection method, system and device based on occlusion perception and a medium, and the method comprises the steps: obtaining broiler images in various breeding scenes, and constructing a broiler image data set; designing a multi-dimensional occlusion perception attention module, embedding the occlusion perception attention module between a backbone network and a neck network of the YOLOv8 model, and constructing a broiler target detection model based on occlusion perception; training a broiler target detection model according to the broiler image data set, and optimizing the prediction precision of a target bounding box by using a shielding loss function combining rejection loss and CIOU loss for a dense shielding target during training; and applying the trained broiler target detection model to a broiler dense scene, and carrying out target detection. According to the method, the problem of difficulty in detection caused by blocking of the broiler targets can be effectively solved, so that the detection accuracy is improved, and reliable support is provided for an intelligent breeding scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a broiler target detection method, system, equipment and medium based on occlusion perception, belonging to the technical fields of computer vision, target detection, broiler breeding and application programs. Background Art

[0002] As an important part of the breeding industry, broiler breeding is an important source of high-quality protein for humans, with low costs, short production cycles, and high breeding efficiency. In the breeding process of broilers, individual monitoring and management are crucial, especially in intensive breeding environments, where the identification and counting of broilers becomes particularly complicated due to the narrow space and large number of broilers.

[0003] The existing methods are 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: first extract the target's texture, shape, color, size and other features from the image, then detect the object from the obtained features, and then perform the detection operation by using relevant image processing methods. Although traditional image processing methods have the advantages of fast computing speed and low resource consumption, their detection effects usually rely on manually designed feature extraction algorithms. When dealing with complex backgrounds, traditional methods are easily interfered, resulting in the inability to effectively extract broiler features, thereby affecting the overall detection accuracy. This method has the following shortcomings in dense chicken environments:

[0005] 1) Susceptible to background interference: The complex background in the chicken house environment (such as waterers, shadows and lighting changes) will interfere with feature extraction, and traditional methods are less adaptable 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 effect.

[0006] 2) Insufficient adaptability and generalization: Traditional methods usually rely on fixed feature extraction methods. When the environment or object features change (such as lighting conditions, feeding methods or chicken breeds), the algorithm features need to be manually redesigned or adjusted. Therefore, the application of traditional methods in different environments is very limited and difficult to adapt to diverse actual 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 broiler target detection. Target detection algorithms are mainly divided into two categories: one-stage and two-stage algorithms. The main representatives of the one-stage are SSD and YOLO. These methods predict the category and the position of the bounding box at the same time and have a faster detection speed. The target detection process of the two-stage method is divided into two stages. The first stage extracts the area of ​​interest, and the second stage performs classification and positioning. The representative algorithm is FasterR-CNN.

[0009] Although deep learning models have powerful feature learning capabilities, they still face many challenges when detecting broilers in complex chicken house environments. In chicken house environments, broilers are usually densely distributed and severely occlude each other, which makes it difficult for the model to effectively distinguish overlapping target objects. Although the improved non-maximum suppression (NMS) algorithm performs well in removing redundant detection boxes, in scenes with highly overlapping targets, NMS may mistakenly suppress the real target box, further exacerbating the problem of missed detection. Similarly, the existing attention mechanism design also has certain limitations. Many methods focus on improving the model's attention to high-level semantic features, but often ignore the importance of low-level detail features. This deficiency is particularly prominent in scenes with severe occlusion or complex backgrounds, which significantly limits the further improvement of model performance. In addition, computing resource requirements are also an important factor limiting the practical application of target detection models. Taking the Two Stage method as an example, this type of model usually relies on complex network structures and a large number of parameters, and has high requirements for computing resources. It is difficult to achieve efficient operation in edge devices or resource-limited environments. At the same time, in real-time detection scenarios, insufficient computing resources may cause detection delays, thereby reducing the real-time response capability of the system. Summary of the invention

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

[0011] The first object of the present invention is to provide a broiler target detection method based on occlusion perception.

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

[0013] A third object of the present invention is to provide a computer device.

[0014] A fourth object of the present invention is to provide a computer-readable storage medium.

[0015] The first object of the present invention can be achieved by adopting the following technical solutions:

[0016] A broiler target detection method based on occlusion perception, the method comprising:

[0017] Obtain broiler images in various breeding scenarios and build a broiler image dataset;

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

[0019] The broiler chicken target detection model is trained based on the broiler chicken image dataset. During the training, for densely occluded targets, the occlusion loss function, which is a combination of the exclusion loss and the CIOU loss, is used to optimize the prediction accuracy of the target bounding box.

[0020] The trained broiler target detection model is applied to the broiler dense scene for target detection.

[0021] Furthermore, the occlusion-aware 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 an 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 an 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, combine the initial low-level feature map and the initial high-level feature map, and generate a pixel-level attention map.

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

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

[0027] Among them, Sigmoid is an activation function that maps input values ​​to between 0 and 1, AvgPool represents the average pooling operation, MaxPool represents the maximum pooling operation, Concat is the concatenation operation of the outputs of the average pooling layer and the maximum pooling layer along the channel dimension, and F low represents the initial low-level feature map, F pa Represents the feature map adjusted by the position attention mechanism, that is, adjusting the low-level feature map.

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

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

[0030] Among them, ReLU is the rectified linear unit activation function, F high represents the initial low-level feature map, F ca Represents the feature map adjusted by the channel attention mechanism, that is, adjusting the high-level feature map.

[0031] Furthermore, the expression of 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 Indicates a 7×7 convolution operation, F low represents the initial low-level feature map, F high represents the initial low-level feature map, F pa represents the feature map adjusted by the position attention mechanism, that is, adjusting the low-level feature map, F ca represents the feature map adjusted by the channel attention mechanism, that is, adjusting the high-level feature map, F pixel represents the pixel-level attention map.

[0034] Furthermore, the pixel-level attention map is re-fused and output through a 1×1 convolution to adjust the channel, as shown in the following formula:

[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 so that the output F out Combines feature information at different levels.

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

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

[0039] Among them, L CIoU is an attraction term that forces the predicted bounding box to be close to its assigned ground-truth box, L RepGT and L RepBox is the exclusion term, and the coefficients α and β serve as weights to balance the auxiliary loss;

[0040] L CIoU The definition is as follows:

[0041]

[0042] Among them, IoU represents the intersection-over-union ratio of the target prediction box and the real box, ρ 2 (b,b gt ) represents the predicted box center point b and the real box center point b gt The Euclidean distance between them, c represents the length of the diagonal of the minimum enclosing rectangle containing the predicted box and the true box, It is a weight term to measure the consistency of aspect ratio, and v represents the difference in aspect ratio between the predicted box and the real box;

[0043] L RepGT The definition is as follows:

[0044]

[0045] Where P∈P + represents the set of all positive samples, It is the real target box with the largest IoU around the target, Smooth ln is a smooth ln function that is continuously differentiable in (0,1);

[0046] L RepBox The definition is as follows:

[0047]

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

[0049] The second object of the present invention can be achieved by adopting the following technical solutions:

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

[0051] The first construction unit is used to obtain broiler images in various breeding scenarios and construct a broiler image dataset;

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

[0053] A training unit is used to train a broiler chicken target detection model according to a broiler chicken image dataset. During the training, for densely occluded targets, an occlusion loss function combining a rejection loss and a 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 the broiler dense scene to perform target detection.

[0055] The third object of the present invention can be achieved by adopting the following technical solutions:

[0056] A computer device comprises a processor and a memory for storing a program executable by the processor, wherein when the processor executes the program stored in the memory, the above-mentioned broiler target detection method is implemented.

[0057] The fourth object of the present invention can be achieved by adopting the following technical solutions:

[0058] A computer-readable storage medium stores a program, and when the program is executed by a processor, the above-mentioned broiler chicken target detection method is implemented.

[0059] The present invention has the following beneficial effects compared with the prior art:

[0060] 1. The broiler target detection model of the present invention has significant advantages. By introducing the occlusion-aware attention module, it effectively solves the detection difficulties of broiler chickens in dense scenes due to overlap and occlusion, and significantly improves the detection accuracy. In addition, the optimized occlusion loss function is used to ensure that the target can still be accurately judged when broiler chickens are densely overlapped, reducing the risk of missed detection and false detection.

[0061] 2. In dense scenarios, the optimized target detection model of the present invention achieves a mean average precision (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 reasoning process, with an average detection time of no more than 2 seconds. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.

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

[0064] Figure 2a to Figure 2d These are images of broiler chickens collected under different breeding conditions in Example 1 of the present invention.

[0065] Figure 3 This is an architectural diagram of the broiler target detection model based on occlusion perception of Example 1 of the present invention.

[0066] Figure 4 This is a schematic diagram of the occlusion-aware attention module of Example 1 of the present invention.

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

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

[0069] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0070] Embodiment 1:

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

[0072] S101. Acquire broiler images in various breeding scenarios and construct a broiler image dataset.

[0073] The construction of the broiler image dataset in this embodiment includes three parts: image acquisition, data annotation, and dataset division, which are specifically described as follows:

[0074] Image collection: The real environment of multiple farms is collected to ensure the diversity and representativeness of the data. During the collection process, intelligent monitoring equipment is used to shoot from different angles to capture the performance of broilers in various states. In some scenes, broilers are relatively sparse, forming a clear field of view, making individual characteristics easy to identify; in other scenes, broilers appear to be more crowded and may gather near feed troughs or other activity areas. This sparse and dense situation truly reflects the behavior of broilers in the breeding environment. Some typical images taken are as follows: Figure 2a to Figure 2d As shown, these images lay the foundation for the subsequent data set preparation and are used for model training and evaluation to improve its effect in practical applications.

[0075] Data annotation: After completing the collection of broiler images, the images are selected, with priority given to clear and well-lit photos, ensuring that the images contain broilers from different angles and postures, such as eating and resting, while covering sparse and dense situations; open source CVAT software is used for image annotation. During the annotation process, the broilers in each picture are accurately marked to ensure that the bounding box of each individual is clearly visible. This process not only includes marking the appearance of the broilers, but also assigning corresponding category labels to each broiler to facilitate subsequent target detection tasks.

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

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

[0078] This example uses the YOLOv8 target detector as the baseline model. Figure 3As shown in the figure, 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 by the backbone network, which consists of multiple stages, each of which is responsible for effectively extracting features of different scales; in the neck network, the structure of the path aggregation network (PAN) is retained. In order to enhance the feature extraction ability of the model in dense occlusion environments, an occlusion-aware attention module (OPAM) is designed to fuse the features from the low-level feature C2 layer and the high-level feature F3 layer to enhance the ability to express the features of the occluded area; in the head network, the model generates diversified output information through three different resolutions (P3, P4, P5), which are respectively adapted to the detection capabilities of small scales, medium scales, and large scales.

[0079] Occlusion-aware attention module: Since the unique low-level features of the P2 layer contain rich details and spatial position information, it has certain advantages in detecting small targets and occluders; however, directly adding an additional xsmall detection head to the P2 layer can enhance the model's ability to handle occluded scenes, but this will significantly increase the computational complexity and fail to fully utilize the potential spatial information of the P2 layer; therefore, this embodiment proposes an occlusion-aware attention module OPAM, such as Figure 4 As shown in the figure, the 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 areas and suppress the interference of irrelevant information, thereby improving the accuracy of feature expression. First, the occlusion-aware attention module encodes low-level features and high-level features through a feature extraction network. The position attention module receives input from low-level features, which usually contain rich spatial position information and details. The position attention module enhances the spatial representation of features by capturing the spatial relationship between objects, especially the slight 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, so as to better distinguish the occluded targets and backgrounds. However, directly adding the features processed by the position attention and channel attention modules may lead to mismatch of receptive fields. To solve this problem, the initial low-level features, initial high-level features, and features processed by position and channel attention are input into the pixel attention module to calculate the weights, and then they are combined by weighted summation to improve the network’s discriminability of target features. Finally, 1×1 convolution is used to reduce the dimension to a suitable dimension.

[0080] The position attention module receives the initial low-level feature map F from the backbone network. low , and adjusted through the position attention mechanism to obtain the adjusted low-level feature map F pa , the expression is as follows:

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

[0082] Among them, Sigmoid is an activation function that maps input values ​​to between 0 and 1, AvgPool represents the average pooling operation, MaxPool represents the maximum pooling operation, Concat is a concatenation operation that combines the outputs of the average pooling layer and the maximum pooling layer along the channel dimension, so that the model can retain the average and maximum spatial information from the low-level features, F low represents the initial low-level feature map, F pa Represents the feature map adjusted by the position attention mechanism, that is, adjusting the low-level feature map.

[0083] The channel attention module receives the initial high-level feature map F from the pyramid attention network. high , and adjusted through the channel attention mechanism to obtain the adjusted high-level feature map F ca , the expression is as follows:

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

[0085] Among them, ReLU is the rectified linear unit activation function, F high represents the initial low-level feature map, F ca Represents the feature map adjusted by the channel attention mechanism, that is, adjusting 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, the expression is as follows:

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

[0088] Among them, Conv 7×7Indicates a 7×7 convolution operation, F low represents the initial low-level feature map, F high represents the initial low-level feature map, F pa represents the feature map adjusted by the position attention mechanism, that is, adjusting the low-level feature map, F ca represents the feature map adjusted by the channel attention mechanism, that is, adjusting the high-level feature map, F pixel Represents pixel-level attention maps to enhance the expressiveness of feature maps.

[0089] The pixel-level attention map is re-fused through a 1×1 convolution and output to adjust the channel 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 so that the output F out Combines feature information at different levels.

[0092] S103. According to the broiler chicken image dataset, the broiler chicken target detection model is trained. During the training, for densely occluded targets, an occlusion loss function combining the rejection loss and the CIOU loss is used to optimize the prediction accuracy of the target bounding box.

[0093] In target detection, the occlusion phenomenon often causes the model to be unable to accurately identify partially occluded targets. To optimize the detection effect, a combination of CIOU (Complete Intersection over Union) loss and repulsion loss (Repulsion Loss) is used in calculating the bounding box loss to form an occlusion loss function to address the problem of inaccurate bounding box regression in dense environments. In addition, the classification loss uses binary cross-entropy (BCE) to ensure the accuracy and stability of classification. The introduced repulsion loss is divided into two parts: RepGT and RepBox. Therefore, the occlusion loss function consists of 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 real box. CIoU is used here, L RepGT and L RepBox is the rejection term, and the coefficients α and β serve as weights to balance the auxiliary losses.

[0096] L CIoU The definition is as follows:

[0097]

[0098]

[0099] Among them, IoU represents the intersection-over-union ratio of the target prediction box and the real box, ρ 2 (b,b gt ) represents the predicted box center point b and the real box center point b gt The Euclidean distance between them, c represents the length of the diagonal of the minimum enclosing rectangle containing the predicted box and the true box, It is a weight term to measure the consistency of aspect ratio, and v represents the difference in aspect ratio between the predicted box and the real box.

[0100] L CIoU By comprehensively considering IoU, center point distance and aspect ratio, the regression process is made more robust, especially when objects are occluded or position shifted.

[0101] The role of RepGT is to make the current bounding box as far away from the surrounding real target box as possible. RepGT The definition is as follows:

[0102]

[0103] Where P∈P + represents the set of all positive samples, is the true target box with the largest IoU around the target, P and The overlap between them is defined as the intersection of ground-truth object boxes (IoG): and IoG(P,G)∈[0,1], Smooth ln 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 box as far away from the surrounding prediction boxes as possible and reduce the IOU between them, L RepBox The definition is as follows:

[0105]

[0106] Among them, 1 is the identity function, ∈ 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 indicators to comprehensively evaluate the performance of the broiler target detection model, mainly including precision, recall and mean average precision (mAP). The calculation of precision and recall is shown in formulas (12) and 13).

[0108]

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

[0110]

[0111] The mean average precision (mAP) of the broiler target detection model of this embodiment is as high as 93.35%, which is significantly higher than the performance of other target detection models; at the same time, the model shows excellent efficiency in the reasoning process, and the average detection time does not exceed 2 seconds.

[0112] S104: Apply the trained broiler target detection model to the broiler dense scene to perform target detection.

[0113] It should be noted that although the above method operations are described in a particular order in the accompanying drawings, this does not require or imply that these operations must be performed in this particular order, or that all of the operations shown must be performed to achieve the desired results. On the contrary, the steps depicted may be performed in a different order. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0114] Embodiment 2:

[0115] like Figure 5 As shown, this embodiment provides a broiler target detection system based on occlusion perception, which 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 construction unit 501 is used to obtain broiler images in various breeding scenarios and construct a broiler image dataset;

[0117] The second construction unit 502 is used to design a multi-dimensional occlusion-aware attention module, and embed the occlusion-aware attention module between the backbone network and the neck network of the YOLOv8 model to construct a broiler target detection model based on occlusion-awareness;

[0118] A training unit 503 is used to train a broiler chicken target detection model according to a broiler chicken image dataset. During the training, for densely occluded targets, an occlusion loss function combining a rejection loss and a CIOU loss is used to optimize the prediction accuracy of the target bounding box;

[0119] The detection unit 504 is used to apply the trained broiler target detection model to the broiler dense scene to perform target detection.

[0120] The specific implementation of each unit in this embodiment can refer to the above-mentioned embodiment 1, and will not be described one by one here; it should be noted that the system provided in this embodiment is only illustrated by the division of the above-mentioned functional units. In actual applications, the above-mentioned 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] Embodiment 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 through a device bus 601. The processor is used to provide computing and control capabilities. The memory includes a non-volatile storage medium 606 and an internal memory 607. The non-volatile storage medium 606 stores an operating device, a computer program and a database. The internal memory 607 provides an environment for the operation of the operating device and the computer program in the non-volatile storage medium. When the processor 602 executes the computer program stored in the memory, the broiler target detection method of the above-mentioned embodiment 1 is implemented as follows:

[0123] Broiler images in various breeding scenarios are obtained, and a broiler image dataset is constructed. A multi-dimensional occlusion-aware attention module is designed, and the occlusion-aware attention module is embedded between the backbone network and the neck network of the YOLOv8 model to construct a broiler target detection model based on occlusion awareness. The broiler target detection model is trained according to the broiler image dataset. During the training, the occlusion loss function combining the rejection loss and the CIOU loss is used to optimize the prediction accuracy of the target bounding box for densely occluded targets. The trained broiler target detection model is applied to broiler dense scenes for target detection.

[0124] Embodiment 4:

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

[0126] Broiler images in various breeding scenarios are obtained, and a broiler image dataset is constructed. A multi-dimensional occlusion-aware attention module is designed, and the occlusion-aware attention module is embedded between the backbone network and the neck network of the YOLOv8 model to construct a broiler target detection model based on occlusion awareness. The broiler target detection model is trained according to the broiler image dataset. During the training, the occlusion loss function combining the rejection loss and the CIOU loss is used to optimize the prediction accuracy of the target bounding box for densely occluded targets. The trained broiler target detection model is applied to broiler dense scenes for target detection.

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

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

[0129] The computer readable storage medium can be written in one or more programming languages ​​or a combination thereof to execute the computer program of the present embodiment, and the programming language includes an object-oriented programming language, such as Java, Python, C++, and a conventional procedural programming language, such as C or a similar programming language. The program can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., using an Internet service provider to connect through the Internet).

[0130] In summary, the method of the present invention can directly identify broilers without stress and harm, which not only reduces the interference and pressure on broilers, ensures their health and well-being, but also improves the accuracy and reliability of identification; in the prior art, although the traditional image processing method can provide higher efficiency, it usually has strict requirements on the lighting and background of the shooting environment. The present invention is not limited by specific shooting conditions and can operate stably in a variety of environments, greatly reducing the shooting requirements; compared with the method of broiler identification in the prior art that needs to rely on complex equipment, the high-precision detection method designed by the present invention can directly use image information to automatically identify and count broilers in dense scenes, avoiding dependence on traditional weighing or manual counting; the existing target detection method is prone to missed detection when dealing with the broiler occlusion problem, affecting the accuracy of recognition. The present invention can effectively solve the problem of difficult detection of broiler targets caused by occlusion by designing an occlusion perception module and optimizing the occlusion loss function, thereby improving the accuracy of recognition and providing reliable support for intelligent breeding scenarios.

[0131] The above is only a preferred embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical solution and inventive concept of the present invention within the scope disclosed by the present invention, which shall fall within the protection scope of the present invention.

Claims

1. A broiler target detection method based on occlusion perception, characterized in that: The method comprises: Obtain broiler images in various breeding scenarios and build a broiler image dataset; Design a multi-dimensional occlusion-aware attention module and embed it between the backbone network and the neck network of the YOLOv8 model to build a broiler target detection model based on occlusion awareness. The broiler chicken target detection model is trained based on the broiler chicken image dataset. During the training, the occlusion loss function, which is a combination of the exclusion loss and the CIOU loss, is used to optimize the prediction accuracy of the target bounding box for densely occluded targets. The trained broiler target detection model is applied to the broiler dense scene for target detection.

2. The broiler target detection method according to claim 1, characterized in that: The occlusion-aware attention module includes a position attention module, a channel attention module and a pixel attention module; 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 an adjusted low-level feature map; 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 an adjusted high-level feature map; The pixel attention module is used 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 target detection method according to claim 2, characterized in that: The position attention module is represented as follows: F pa =F low ⊙Sigmoid(Conv 7×7 (Concat(AvgPool(F low ),MaxPool(F low )))) Among them, Sigmoid is an activation function that maps input values ​​to between 0 and 1, AvgPool represents the average pooling operation, MaxPool represents the maximum pooling operation, Concat is the concatenation operation of the outputs of the average pooling layer and the maximum pooling layer along the channel dimension, and F low represents the initial low-level feature map, F pa Represents the feature map adjusted by the position attention mechanism, that is, adjusting the low-level feature map.

4. The broiler target detection method according to claim 2, characterized in that: The channel attention module is represented as follows: F ca =Conv 1×1 (ReLU(Conv 1×1 (AvgPool(F high )))) Among them, ReLU is the rectified linear unit activation function, F high represents the initial low-level feature map, F ca Represents the feature map adjusted by the channel attention mechanism, that is, adjusting the high-level feature map.

5. The broiler target detection method according to claim 2, characterized in that: The expression of the pixel attention module is as follows: F pixel =Sigmoid(Conv 7×7 (Concat(F low ,F high ,F pa +F ca ))) Among them, Conv 7×7 Indicates a 7×7 convolution operation, F low represents the initial low-level feature map, F high represents the initial low-level feature map, F pa represents the feature map adjusted by the position attention mechanism, that is, adjusting the low-level feature map, F ca represents the feature map adjusted by the channel attention mechanism, that is, adjusting the high-level feature map, F pixel represents the pixel-level attention map.

6. The broiler target detection method according to claim 5, characterized in that: The pixel-level attention map is re-fused through a 1×1 convolution and output to adjust the channel as follows: F out =Conv 1×1 (F low ⊙F pixel +F high ⊙(1-F pixel )) Among them, F low and F high Respectively with F pixel and 1-F pixel Perform element-wise multiplication so that the output F out Combines feature information at different levels.

7. The broiler target detection method according to claim 1, characterized in that: The occlusion loss function is as follows: L=L CIoU +α×L RepGT +β×L RepBox Among them, L CIoU is an attraction term that forces the predicted bounding box to be close to its assigned ground-truth box, L RepGT and L RepBox is the exclusion term, and the coefficients α and β serve as weights to balance the auxiliary loss; L CIoU The definition is as follows: Among them, IoU represents the intersection-over-union ratio of the target prediction box and the real box, ρ 2 (b,b gt ) represents the center point b of the predicted box and the center point b of the real box gt The Euclidean distance between them, c represents the length of the diagonal of the minimum enclosing rectangle containing the predicted box and the true box, It is a weight term to measure the consistency of aspect ratio, and v represents the difference in aspect ratio between the predicted box and the real box; L RepGT The definition is as follows: Where P∈P + represents the set of all positive samples, It is the real target box with the largest IoU around the target, Smooth ln is a smooth ln function that is continuously differentiable in (0,1); L RepBox The definition is as follows: Among them, 1 is the identity function, ∈ is a small constant, and For different groups P i and P j The predicted box between .

8. A broiler target detection system based on occlusion perception, characterized in that: The system comprises: The first construction unit is used to obtain broiler images in various breeding scenarios and construct a broiler image dataset; The second construction unit is used to design a multi-dimensional occlusion-aware attention module and embed the occlusion-aware attention module between the backbone network and the neck network of the YOLOv8 model to build a broiler target detection model based on occlusion awareness; A training unit is used to train a broiler chicken target detection model according to a broiler chicken image dataset. During the training, for densely occluded targets, an occlusion loss function combining a rejection loss and a CIOU loss is used to optimize the prediction accuracy of the target bounding box; The detection unit is used to apply the trained broiler target detection model to the broiler dense scene to perform target detection.

9. A computer device comprising a processor and a memory for storing a program executable by the processor, characterized in that: When the processor executes the program stored in the memory, the broiler target detection method described in any one of claims 1-7 is implemented.

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

Citation Information

Patent Citations

  • Chicken farm raised chicken recognition algorithm based on Yolov4

    CN113221853A

  • Method for detecting densely shielded fishes based on YOLOv5 network

    CN114782759A

  • Wheat scab spore target detection method in shielding scene

    CN118823773A

  • Target detection network construction optimization method, apparatus and device, and medium and product

    WO2022236824A1

Cited By

  • Visual identification-based intelligent decision-making control method and system for body

    CN120279536A

  • Pork pig quantity statistical method and device, electronic equipment and storage medium

    CN121190810A