Small target chicken positioning method based on dual-domain enhancement and dynamic prior

By employing a dual-domain enhancement and dynamic prior method for locating small targets like chickens, we have solved the problems of insufficient shallow feature representation and interference from complex backgrounds in the localization of small targets like chickens, achieving efficient target differentiation and improved localization accuracy.

CN122115819BActive Publication Date: 2026-07-21EAST CHINA JIAOTONG UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
EAST CHINA JIAOTONG UNIVERSITY
Filing Date
2026-04-29
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing technologies for locating small target chickens suffer from insufficient expression of shallow feature details, lack of explicit suppression of interference from complex backgrounds, and lack of dynamic location priors oriented towards the target region in the initialization of object queries in traditional DETR models, leading to missed detections, false detections, and insufficient positioning accuracy.

Method used

A small target chicken localization method based on dual-domain enhancement and dynamic prior is adopted. Multi-scale feature extraction is performed through a backbone network with shared parameters. Combined with dual-domain enhancement and semantic enhancement, cross-layer bidirectional fusion is performed, and chicken feature prototypes and background feature prototypes are constructed. By using similarity enhancement and background suppression, foreground targets are dynamically selected to generate refined location priors and perform DETR decoder input feature processing.

Benefits of technology

It improves the fine-grained feature representation ability of small target chickens, enhances the ability to distinguish and suppress complex backgrounds, improves the initialization quality of object queries, and improves the localization accuracy of small target chickens.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122115819B_ABST
    Figure CN122115819B_ABST
Patent Text Reader

Abstract

The application relates to a small target chicken positioning method based on double-domain enhancement and dynamic priori, which comprises the following steps: performing multi-scale feature extraction on a breeding image, a chicken image and a background image respectively, performing double-domain enhancement on shallow features and generating breeding coding features; prototype construction is performed on chicken image features and background image features to generate chicken feature prototypes and background feature prototypes, and similarity enhancement and background suppression are performed; based on foreground scores and foreground k A content embedding and refined position priori of an object query are generated by selecting a high response feature point, and are input into a DETR decoder to output the boundary box coordinates and the category score of the chicken target. The application can alleviate the small target missing detection problem caused by the smoothing of shallow features, reduce the false detection risk caused by background interference, improve the small target positioning ability of the traditional DETR model which is limited by the lack of target area position priori in object query initialization, and effectively improve the positioning detection precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of computer vision and deep learning technology, specifically to a method for locating small targets (chickens) based on dual-domain enhancement and dynamic priors. Background Technology

[0002] In modern large-scale poultry farming scenarios, individual chickens are typically small in size and subject to complex background interference, leading to problems such as missed detections, false detections, and inaccurate localization in real-world environments using existing detection methods. Currently, object detection methods based on convolutional neural networks and Transformers are widely used in the field of visual inspection, but when directly applied to the localization of small targets like chickens in farming scenarios, they still face the following challenges:

[0003] (1) The shallow features are insufficient in detail representation, making it difficult to effectively characterize the local structural information of small target chickens. The discrimination information of small target chickens is mainly concentrated in shallow visual features such as edge contours, local textures and fine-grained structures. Existing methods usually focus on deep semantic feature modeling, while shallow features are easily affected by the smoothing effect during conventional convolution extraction, which weakens the high-frequency detail information related to small target localization, reduces the distinguishability of individual chickens in complex backgrounds, and thus easily leads to missed detection of small target chickens.

[0004] (2) The lack of explicit modeling and suppression of complex backgrounds easily leads to false background responses. In real-world farming environments, background areas may resemble individual chickens in texture or local appearance. Existing methods typically only enhance the features of the target region, lacking explicit modeling of background interference regions, making it difficult to simultaneously establish the discriminative response relationship between individual chicken features and background interference features to the current farming image. Especially when chicken image features and background image features are not enhanced with similarity matching between the farming image and the model, the model is prone to generating high responses to easily confused background regions, leading to false detections. Therefore, how to enhance the target-related response using chicken image features and characterize the background interference response using background image features to further suppress the target response is an important technical problem for improving the accuracy of small target chicken localization in complex farming scenarios.

[0005] (3) Traditional DETR object query initialization lacks dynamic location priors for the target region, limiting the localization capability of small targets. Traditional DETR architectures typically use fixed, learnable object queries as decoder inputs. These object queries lack explicit spatial location information corresponding to the foreground region of the current image during the initialization phase and are not adaptively generated in conjunction with the foreground response distribution in the current image. For the small target chicken scene, due to the small target scale, limited foreground region, and susceptibility to occlusion interference, fixed queries struggle to focus on potential target regions in a timely manner, resulting in insufficient initial matching quality between the query and the target. Consequently, there are problems such as slow training convergence, limited foreground focusing capability, and insufficient localization accuracy of small targets.

[0006] Therefore, it is urgent to propose a new method for locating small target chickens, so as to enhance the ability to express shallow fine-grained features, improve the model's ability to distinguish and suppress individual chickens from complex backgrounds, and improve the initialization quality of object queries and the ability to focus on potential target regions in DETR-type models, thereby improving the accuracy of locating and detecting small target chickens in breeding scenarios. Summary of the Invention

[0007] The purpose of this invention is to provide a method for locating small targets (chickens) based on dual-domain enhancement and dynamic priors, in order to solve the problems of insufficient shallow feature detail representation leading to missed detection, lack of explicit suppression of complex background interference leading to false detection, and lack of dynamic position priors oriented towards the target region in the object query initialization of traditional DETR models, which result in insufficient accuracy in locating small targets (chickens).

[0008] The technical solution adopted in this invention is: a method for locating small target chickens based on dual-domain enhancement and dynamic prior, comprising the following steps: S1: Acquire and preprocess the breeding images, and crop N chicken image blocks containing chicken targets from the preprocessed breeding images based on manually labeled boxes, and simultaneously crop M background image blocks from the unlabeled areas; S2: Multi-scale feature extraction is performed on the preprocessed breeding image, chicken image patch and background image patch through the backbone network with shared parameters to obtain the corresponding shallow high-resolution features, intermediate features and deep features; dual-domain enhancement is performed on the shallow high-resolution features and semantic enhancement is performed on the deep features to obtain the enhanced multi-scale features of the breeding image, the multi-scale features of each chicken image patch and the multi-scale features of each background image patch. S3: Perform cross-layer bidirectional fusion on the enhanced multi-scale features of the breeding image to obtain a breeding feature map, and perform serialization and DETR encoder encoding on the breeding feature map to obtain breeding encoded features; perform the same cross-layer bidirectional fusion on the enhanced multi-scale features of each chicken image block and each background image block as on the enhanced multi-scale features of the breeding image to obtain a set of chicken feature maps and a set of background feature maps. S4: Serialize the chicken feature map set and background feature map set, and overlay image type embedding and spatial location encoding to construct chicken feature sequence and background feature sequence; input the chicken feature sequence, background feature sequence and the breeding coding feature into the prototype construction module, perform chicken feature intra-feature aggregation and background feature intra-feature aggregation respectively, perform chicken feature and background feature inter-feature aggregation and context alignment of breeding coding feature with chicken feature and background feature, and generate chicken feature prototype and background feature prototype; S5: The breeding coding features are enhanced with the chicken feature prototype and the background feature prototype respectively to obtain target enhancement features and background enhancement features; the target enhancement features and the background enhancement features are fused respectively, and the fused background enhancement features are used to suppress the background of the fused target enhancement features to obtain the DETR decoder input features; S6: Foreground scoring is performed on the input features of the DETR decoder, and k high-response feature points representing the foreground target are dynamically selected. Based on the k high-response feature points, a content embedding for the object query and a location prior for the target region are generated, and the location prior is offset and corrected to obtain a refined location prior. The content embedding, the refined location prior, and the input features of the DETR decoder are input into the DETR decoder for decoding. The classification head outputs the category score of the chicken target, and the bounding box regression head outputs the bounding box coordinates of the chicken target, thereby realizing the localization and detection of small target chickens in the breeding scene.

[0009] Furthermore, the chicken image patch is an image patch containing chicken targets cropped from the image based on manually labeled bounding boxes, used to extract chicken target features and construct chicken feature prototypes; the background image patch is an easily confused background interference image patch cropped from the unlabeled area, used to extract background interference features and construct background feature prototypes. The preprocessing includes: converting the breeding image into tensor form and normalizing it based on preset channel mean and standard deviation; during the training phase of the small target chicken localization method based on dual-domain enhancement and dynamic prior, performing one or more enhancement operations on the breeding image, including random horizontal flipping, random color perturbation, multi-scale random scaling, and random size cropping; during the inference phase of the small target chicken localization method based on dual-domain enhancement and dynamic prior, performing scale adjustment and normalization on the breeding image.

[0010] Furthermore, step S2 specifically includes: S201: Perform convolution, batch normalization, and max pooling downsampling on the input poultry farming image, chicken image patch, and background image patch to obtain the initial feature map. The specific expression is: ; in, Indicates the kernel size as Convolution operations; This indicates batch normalization processing; Represents a linear rectified function; This represents the max pooling operation; This represents the input image of the farm, a block of chicken images, and a block of background images; S202: Using a ResNet-101 network as the backbone network, the initial feature map... Multi-stage feature extraction is performed, outputting shallow high-resolution features P2 and P3, intermediate layer features P4, and deep layer features P5; among them, the multi-scale features corresponding to the aquaculture image are denoted as... The multi-scale features corresponding to the chicken image patch are denoted as , The multi-scale features corresponding to each chicken image patch are denoted as and the multi-scale features corresponding to the background image patch are denoted as . , This represents the multi-scale features corresponding to each background image patch; steps S203 and S204 perform the same enhancement processing on the livestock image, chicken image patch, and background image patch, respectively. For simplicity, the shallow high-resolution features corresponding to the current input are denoted as... and The intermediate layer features are denoted as Deep features are denoted as ; S203: Fuse the shallow high-resolution features P2 and P3 corresponding to the current input to obtain the shallow fused features corresponding to the input. and the shallow fusion features Input dual-domain enhancement module; the dual-domain enhancement module first performs shallow fusion features Perform convolutional dimensionality reduction, then divide the computation into branches according to the ratio of 1 / 4 channel count and 3 / 4 channel count. and maintain branches ; Under the spatial path, for the computation branch Convolution and Gaussian error linear unit processing are performed sequentially to extract local spatial geometric features. In the frequency domain, local spatial geometric features are represented by the Fast Fourier Transform. After mapping to the frequency domain and performing spectral modulation, the system is then restored to the spatial domain through an inverse transform to obtain global detailed features. ; the global detail features and the local spatial geometric features The computational branches are then merged and superimposed. The residual characteristics, and then the preservation branches By concatenating and fusion, the enhanced shallow features corresponding to the current input are obtained. ; S204: Preserve the original feature information of the intermediate layer feature P4 corresponding to the current input; input the deep feature P5 corresponding to the current input into the multi-head self-attention semantic enhancement module to model the long-distance dependency relationship between pixels in the low-resolution feature space, and output the semantically enhanced deep feature. ; and will enhance shallow features Intermediate layer features and semantically enhanced deep features Together, they constitute the enhanced multi-scale feature representation corresponding to the current input, which is used for subsequent cross-layer fusion and localization detection; wherein, the current input is a breeding image, a chicken image patch, and a background image patch.

[0011] Furthermore, step S3 specifically includes: S301: Employ a bidirectional feature pyramid fusion network to enhance the shallow features. Intermediate layer features P4 and semantically enhanced deep features Cross-layer fusion is performed; the bidirectional feature pyramid fusion network includes a top-down path and a bottom-up path, wherein the top-down path is used to inject high-level semantic information into low-level features, and the bottom-up path is used to feed back shallow localization details to high-level features. S302: In the top-down path, the semantically enhanced deep features After convolution and upsampling, the features are fused with the intermediate layer feature P4, and then convolution is performed to obtain the intermediate layer downlink feature. The intermediate layer downlink characteristics After convolution and upsampling, shallow features are enhanced. The features are fused and then convolved to obtain shallow downlink features. ; S303: In the bottom-up path, shallow downward features After convolution and downsampling, the downlink features of the intermediate layer after convolution transformation The intermediate layer enhancement features are obtained by fusion. The intermediate layer enhancement features Deep features after further downsampling and semantic enhancement By fusing the features, deep enhancement features are obtained. ; S304: Enhance the intermediate layer features using bilinear interpolation. and the deep enhancement features Upsampling to the shallow downlink features Same spatial resolution, and with the shallow downlink features Feature concatenation is performed along the channel dimension, followed by fusion and dimensionality reduction via convolutional layers to adjust the number of channels to the preset dimension. The fused aquaculture feature map was obtained. The enhanced chicken image patches were fused using a bidirectional feature pyramid fusion process corresponding to the breeding images, resulting in a set of chicken feature maps. The enhanced background image patches are then fused using a bidirectional feature pyramid fusion process corresponding to the aquaculture images at multiple scales to obtain a set of background feature maps. ; S305: The fused aquaculture feature map Flattening the sequence in the spatial dimension yields the aquaculture characteristic sequence. And construct a sinusoidal spatial location code consistent with its dimension. Encode the sinusoidal spatial position. With the breeding characteristic sequence By adding elements one by one, we obtain the aquaculture feature sequence with location information. The sinusoidal spatial position encoding The mid-space position is The element in the channel dimension and The encoded values ​​of each component are: ; ; in, This indicates the position index of the feature point in the expanded sequence; Indicates the index of the channel dimension, with a value range of 0 to 1. ; The preset dimension refers to the fused aquaculture feature map. Channel dimension; Indicates the position index is Feature points in the first Position encoding values ​​on an even number of channel dimensions Indicates the position index is Feature points in the first Positional encoded values ​​on an odd number of channel dimensions; S306: Transfer the aquaculture feature sequence with location information Input the DETR encoder to perform global context modeling, and output aquaculture coding features. .

[0012] Furthermore, step S4 specifically includes: S401: The set of chicken feature maps obtained in step S304 and background feature map set Flattening the images in the spatial dimension yields chicken feature sequences and background feature sequences; a learnable chicken image type embedding is defined. and background image type embedding And embed the chicken image type respectively and background image type embedding The corresponding chicken feature sequences and background feature sequences are superimposed to generate feature sequences with image type attributes; then, sinusoidal spatial location codes are superimposed on each feature sequence. This yields an enhanced feature sequence that integrates image type information and spatial location information. S402: Concatenate and splice all enhanced chicken feature sequences and enhanced background feature sequences along the sequence length dimension to form the prototype feature sequence. Simultaneously, the breeding coding features are... Flattening it out in the spatial dimension yields the aquaculture memory sequence. ; S403: The total sequence of the prototype features... The breeding memory sequence will be used as the target sequence. As a memory sequence, it is input into the prototype construction module for feature evolution; the prototype construction module first processes the prototype feature sequence. Intra-image self-attention aggregation and inter-image self-attention aggregation are performed to extract stable features within chicken images and background images, as well as common features across images. These features are then compared with the breeding memory sequence. Cross-attention achieves context alignment between the farm images, chicken images, and background images, outputting the evolved prototype feature sequence. ; S404: The evolved prototype feature sequence The image is re-decomposed according to its dimensions and reconstructed into a two-dimensional feature map, resulting in the evolved set of chicken feature prototypes. and the evolved set of background feature prototypes ,in, Indicates the first A prototype of evolved chicken characteristics. ; Indicates the first An evolved prototype of background features. .

[0013] Furthermore, step S5 specifically includes: S501: The aquaculture coding features are... With each evolved chicken's characteristic prototype Input similarity enhancement module; in the similarity enhancement module, the chicken feature prototype is... As a convolution kernel, it is used in conjunction with the aquaculture coding features. Perform correlation convolution operations to enhance the response features in the breeding coding features that are similar to the corresponding chicken feature prototypes, to obtain the result from the first... Enhanced features guided by individual chicken characteristics ,in, Simultaneously, the breeding coding features are... With each evolved background feature prototype Input similarity enhancement module; in the similarity enhancement module, the background feature prototype is... As a convolution kernel, it is used in conjunction with the aquaculture coding features. Perform correlation convolution operations to enhance the response features in the aquaculture coding features that are similar to the corresponding background feature prototypes, to obtain the result from the first... Enhanced features guided by a prototype of a background feature. ,in, ; S502: Yes An augmented feature guided by a chicken-related feature prototype. Element-wise aggregation is performed along the prototype dimension to obtain the target's basic features. ;right An enhancement feature guided by a background feature prototype. Element-wise aggregation is performed along the prototype dimension to obtain the basic background features. ; S503: For each augmented feature guided by the chicken feature prototype The corresponding channel response weights are obtained by sequentially performing global pooling, fully connected layer mapping, ReLU activation, fully connected layer mapping, and Sigmoid normalization. ; weight the channel response With corresponding enhanced features Element-wise multiplication along the channel dimension yields the corresponding channel recalibration features. ; Recalibrate all channels features The data is stitched together along the channel dimension and then nonlinearly compressed using a multilayer perceptron to generate target fusion weights. For each augmentation feature guided by the background feature prototype The corresponding channel response weights are obtained by sequentially performing global pooling, fully connected layer mapping, ReLU activation, fully connected layer mapping, and Sigmoid normalization. ; weight the channel response With corresponding enhanced features Element-wise multiplication along the channel dimension yields the corresponding channel recalibration features. ; Recalibrate all channels features The data is stitched together along the channel dimension and then nonlinearly compressed using a multilayer perceptron to generate background fusion weights. The target fusion weights are respectively... With the target basic features The background fusion weights With the aforementioned background basic features Element-wise multiplication along the channel dimension yields the target fusion feature. Background blending features ; S504: Utilizing the background blending features For the target fusion features Pixel-level weighted suppression is performed to weaken the responses in easily confused background regions, resulting in background-suppressed DETR decoder input features. .

[0014] Furthermore, step S6 specifically includes: S601: Input the DETR decoder with features Flattening the sequence in the spatial dimension yields a flattened feature sequence. The flattened feature sequence Input the foreground scoring network and output a foreground confidence score for each feature point. ; S602: Confidence score for the foreground Sort and select the top The index corresponding to each high-scoring feature point, from the flattened feature sequence Extract the corresponding feature vectors to form the selected foreground feature set. ; S603: Based on the foreground feature set Generate the content embedding and location prior of the object query; specifically, utilize a feedforward neural network to process the foreground feature set. Perform mapping to generate a query content vector. ; Obtain the foreground feature set Normalized coordinates of each feature point on the original feature map The initial normalized width and height are set in conjunction with the feature map step size. This constitutes the initial position prior. Then, a feedforward network is used to predict the offset relative to the prior initial position. and the offset Superimposed on the initial position prior, a refined position prior is obtained. ;in, Represents the set of foreground features The Middle The x-coordinate of each feature point in the normalized spatial coordinates of the original feature map. Represents the set of foreground features The Middle The ordinate of the normalized spatial coordinates of each feature point in the original feature map. Represents the set of foreground features The Middle The normalized width of the prior initial position corresponding to each feature point. Represents the set of foreground features The Middle The normalized height of the prior a priori position corresponding to each feature point; S604: The flattened feature sequence As the key vector and value vector in the cross-attention of the DETR decoder, the query content vector As an object query, fine-grained location priors will be used. As an initial reference point; using a sinusoidal position coding function to refine the position prior. Mapped to position embeddings with dimensions consistent with the query content vector. and embed the position With query content vector The object query with fused location information is obtained by fusing the location information and then inputting the object query with fused location information into the DETR decoder. S605: Flatten the feature sequence The object query input, which incorporates location information, is iteratively decoded in a DETR decoder consisting of multiple layers of self-attention, cross-attention, and feedforward neural networks to obtain the final output feature sequence. The final output feature sequence Input a classification header, output category scores The final output feature sequence Input regression head, output bounding box coordinates According to category score By setting a threshold and filtering out candidates with low confidence, the final location and detection results of small target chickens in the breeding image are obtained.

[0015] The beneficial effects of this invention are as follows: (1) The present invention adopts a shallow feature extraction strategy with dual-domain enhancement, which can improve the fine-grained feature expression ability of small target chickens. In view of the problem that chickens in the breeding scene are small in size, have weak edge contours and are easily interfered by complex backgrounds, the present invention introduces a dual-domain enhancement module in the shallow high-resolution features. It uses the spatial domain path to retain local geometric structure and texture information, and uses the frequency domain path to enhance the high-frequency detail response, thereby enhancing the distinguishability of small target chickens in the feature space, alleviating the problem of target detail weakening caused by shallow feature smoothing, and reducing the risk of missing small target chickens. (2) This invention achieves explicit background suppression for complex breeding backgrounds by collaborative modeling of chicken feature prototypes and background feature prototypes. This invention not only uses the evolved chicken feature prototypes and breeding coding features to perform correlation convolution matching to enhance the target-related response, but also uses the evolved background feature prototypes and breeding coding features to perform correlation convolution matching to enhance the background-related response. Furthermore, it uses background fusion features to perform pixel-level weighted suppression of target fusion features, thereby effectively weakening the false detection caused by easily confused background areas and improving the ability to distinguish chicken targets from background areas in complex breeding environments. (3) The present invention constructs a dynamic prior query initialization mechanism based on foreground scoring and high response feature screening, which can improve the object query initialization quality of the DETR decoder. Compared with the traditional DETR method of using fixed learnable object queries, the present invention generates the content embedding and refined position prior of the object query by scoring the input features of the decoder and screening high response feature points. This enables the decoder to have foreground semantic information and spatial reference information that match the current image content in the initialization stage, which is conducive to improving the initial matching quality between the query and the target, enhancing the ability to focus on potential target areas, and improving the positioning accuracy of small target chickens. (4) This invention achieves local detail enhancement, foreground-background differentiation and query initialization optimization through a collaborative technical route of “shallow dual-domain enhancement - bidirectional feature fusion - prototype construction - similarity enhancement and background suppression - dynamic prior query initialization - DETR localization detection”, thereby improving the localization detection effect of small target chickens in the breeding scenario. Attached Figure Description

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

[0017] Figure 1 This is a schematic diagram of the overall network of the small target chicken localization method based on dual-domain enhancement and dynamic prior in an embodiment of the present invention; Figure 2 This is a schematic diagram of the dual-domain enhancement module in an embodiment of the present invention; Figure 3 This is a schematic diagram of the dynamic prior query initialization structure in an embodiment of the present invention; Figure 4 This is a schematic diagram of the visual detection results of an embodiment of the present invention. Detailed Implementation

[0018] To better understand the above-described objects, features, and advantages of the present invention, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Many specific details are set forth in the following description to provide a thorough understanding of the invention; however, the invention may be practiced in other ways different from those described herein, and therefore, the invention is not limited to the specific embodiments disclosed below.

[0019] This invention provides a method for locating small targets (chickens) based on dual-domain enhancement and dynamic priors, comprising the following steps: S1: Acquire and preprocess the breeding images, and crop N chicken image blocks containing chicken targets from the preprocessed breeding images based on manually labeled bounding boxes, while cropping M background image blocks from the unlabeled areas.

[0020] The chicken image patch is an image patch containing chicken targets cropped from the image based on manually labeled bounding boxes, used to extract chicken target features and construct chicken feature prototypes; the background image patch is an easily confused background interference image patch cropped from the unlabeled area, used to extract background interference features and construct background feature prototypes. In this embodiment of the invention, the original image data can be chicken flock image data collected in a real breeding environment, which includes small targets, occlusion, complex lighting, and complex backgrounds, to verify the applicability and robustness of the method of the present invention for locating small target chickens.

[0021] The specific preprocessing method is as follows: the breeding image is converted into tensor form and normalized based on the preset channel mean and standard deviation; during the training phase of the small target chicken localization method based on dual-domain enhancement and dynamic prior, one or more enhancement operations are performed on the breeding image, including random horizontal flipping, random color perturbation, multi-scale random scaling, and random size cropping; during the inference phase of the small target chicken localization method based on dual-domain enhancement and dynamic prior, the breeding image is scaled and normalized.

[0022] S2: Multi-scale feature extraction is performed on the preprocessed poultry image, chicken image patch, and background image patch using a backbone network with shared parameters, obtaining corresponding shallow high-resolution features, intermediate layer features, and deep features; dual-domain enhancement is performed on the shallow high-resolution features, and semantic enhancement is performed on the deep features, resulting in enhanced multi-scale features of the poultry image, multi-scale features of each chicken image patch, and multi-scale features of each background image patch. The specific process is as follows: S201: Perform convolution, batch normalization, and max pooling downsampling on the input farm image, chicken image, and background image to obtain the initial feature map. The specific expression is: ; in, Indicates the kernel size as Convolution operation with a stride of 2; This indicates batch normalization processing; Represents a linear rectified function; This represents the max pooling operation; This represents the input images of the farm, chickens, and background.

[0023] S202: Using a ResNet-101 network as the backbone network, the initial feature map... Multi-stage feature extraction is performed, outputting shallow high-resolution features P2 and P3, intermediate layer features P4, and deep layer features P5; among them, the multi-scale features corresponding to the aquaculture image are denoted as... The multi-scale features corresponding to the chicken image patch are denoted as , The multi-scale features corresponding to each chicken image patch are denoted as and the multi-scale features corresponding to the background image patch are denoted as . , This represents the multi-scale features corresponding to each background image patch. In this embodiment of the invention, the feature size of the shallow high-resolution feature P2 is... The feature size of shallow high-resolution feature P3 is The feature size of the intermediate layer feature P4 is The feature size of deep feature P5 is Where H represents the height of the input image and W represents the width of the input image.

[0024] S203: Fuse the shallow high-resolution features P2 and P3 corresponding to the current input to obtain the shallow fused features corresponding to the input. and the shallow fusion features Input as follows Figure 2 The dual-domain enhancement module shown; the dual-domain enhancement module first enhances the shallow fusion features. Perform convolutional dimensionality reduction, then divide the computation into branches according to the ratio of 1 / 4 channel count and 3 / 4 channel count. and maintain branches ; Under the spatial path, for the computation branch Convolution and Gaussian error linear unit processing are performed sequentially to extract local spatial geometric features. In the frequency domain, local spatial geometric features are represented by the Fast Fourier Transform. After mapping to the frequency domain and performing spectral modulation, the system is then restored to the spatial domain through an inverse transform to obtain global detailed features. ; the global detail features and the local spatial geometric features The computational branches are then merged and superimposed. The residual characteristics, and then the preservation branches By concatenating and fusion, the enhanced shallow features corresponding to the current input are obtained. .

[0025] In this embodiment of the invention, the dual-domain enhancement module utilizes spatial domain paths to preserve local geometric structures and texture details, and utilizes frequency domain paths to enhance high-frequency global detail responses, thereby improving the localization and detection of small targets such as chickens. The specific expression is as follows: ; ; in, This indicates the computational branch of the joint feature of two domains. Represents the frequency domain characteristic modulation coefficients, Represents the spatial domain characteristic modulation coefficients, This represents the convolution operation. This indicates a splicing operation at the channel level. This represents the linear rectification function.

[0026] S204: Preserve the original feature information of the intermediate layer feature P4 corresponding to the current input; input the deep feature P5 corresponding to the current input into the multi-head self-attention semantic enhancement module to model the long-distance dependency relationship between pixels in the low-resolution feature space, and output the semantically enhanced deep feature. ; and will enhance shallow features Intermediate layer features and semantically enhanced deep features Together, they constitute the enhanced multi-scale feature representation corresponding to the current input, which is used for subsequent cross-layer fusion and localization detection; wherein, the current input is a farm image, a chicken image patch, or a background image patch.

[0027] S3: Perform cross-layer bidirectional fusion on the enhanced multi-scale features of the poultry image to obtain a poultry feature map, and then perform serialization and DETR encoder encoding on the poultry feature map to obtain poultry coded features; perform the same cross-layer bidirectional fusion on the enhanced multi-scale features of each chicken image patch and each background image patch as on the enhanced multi-scale features of the poultry image to obtain a set of chicken feature maps and a set of background feature maps. The specific process is as follows: S301: Employ a bidirectional feature pyramid fusion network to enhance the shallow features. Intermediate layer features P4 and semantically enhanced deep features Cross-layer fusion is performed; the bidirectional feature pyramid fusion network includes a top-down path and a bottom-up path, wherein the top-down path is used to inject high-level semantic information into low-level features, and the bottom-up path is used to feed back shallow localization details to high-level features.

[0028] S302: In the top-down path, the semantically enhanced deep features After convolution and upsampling, the features are fused with the intermediate layer feature P4, and then convolution is performed to obtain the intermediate layer downlink feature. The intermediate layer downlink characteristics After convolution and upsampling, shallow features are enhanced. The features are fused and then convolved to obtain shallow downlink features. .

[0029] S303: In the bottom-up path, shallow downward features After convolution and downsampling, the downlink features of the intermediate layer after convolution transformation The intermediate layer enhancement features are obtained by fusion. The intermediate layer enhancement features Deep features after further downsampling and semantic enhancement By fusing the features, deep enhancement features are obtained. .

[0030] S304: As Figure 1 As shown in the bidirectional feature pyramid fusion network, the intermediate layer enhanced features are enhanced through bilinear interpolation. and the deep enhancement features Upsampling to the shallow downlink features Same spatial resolution, and with the shallow downlink features Feature concatenation is performed along the channel dimension, followed by fusion and dimensionality reduction via convolutional layers to adjust the number of channels to the preset dimension. The fused aquaculture feature map was obtained. The enhanced chicken image patches were fused using a bidirectional feature pyramid fusion process corresponding to the breeding images, resulting in a set of chicken feature maps. The enhanced background image patches are then fused using a bidirectional feature pyramid fusion process corresponding to the aquaculture images at multiple scales to obtain a set of background feature maps. . Figure 1 "in "Indicates feature splicing operation, " " indicates an upsampling operation.

[0031] S305: Transfer the aquaculture feature map Flattening the sequence in the spatial dimension yields the aquaculture characteristic sequence. And construct a sinusoidal spatial location code consistent with its dimension. Encode the sinusoidal spatial position. With the breeding characteristic sequence By adding elements one by one, we obtain the aquaculture feature sequence with location information. The sinusoidal spatial position encoding The mid-space position is The element in the channel dimension and The encoded values ​​of each component are: ; ; in, This indicates the position index of the feature point in the expanded sequence; Indicates the index of the channel dimension, with a value range of 0 to 1. ; The preset dimension refers to the channel dimension of the fused aquaculture feature map; Indicates the position index is Feature points in the first Position encoding values ​​on an even number of channel dimensions Indicates the position index is Feature points in the first Positional encoding values ​​on an odd number of channel dimensions.

[0032] S306: Transfer the aquaculture feature sequence with location information Input the DETR encoder to perform global context modeling, and output aquaculture coding features. .

[0033] S4: The chicken feature map and background feature map are serialized, and image type embedding and spatial location encoding are superimposed to construct chicken feature sequence and background feature sequence; the chicken feature sequence, background feature sequence and the breeding coding feature are input into the prototype construction module, and chicken feature intra-feature aggregation and background feature intra-feature aggregation are performed respectively, as well as chicken feature and background feature inter-aggregation and context alignment of breeding coding feature with chicken feature and background feature, to generate chicken feature prototype and background feature prototype. The specific process is as follows: S401: The set of chicken feature maps obtained in step S302 and background feature map set Flattening them in the spatial dimension respectively, we obtain the chicken feature sequences. and background feature sequences Define learnable chicken image type embeddings. and background image type embedding And embed the chicken image type respectively and the background image type embedding Superimposed onto the corresponding chicken feature sequence and background feature sequences The above steps generate feature sequences with image type attributes; then, sinusoidal spatial location codes are superimposed on each feature sequence. An enhanced chicken feature sequence was obtained by fusing image type information and spatial location information. and enhanced background feature sequences .

[0034] S402: Combine all enhanced chicken feature sequences and enhanced background feature sequences Concatenate and splice the sequences along their length to form the prototype feature sequence. At the same time, the characteristics of aquaculture coding will be included. Flattening it out in the spatial dimension yields the aquaculture memory sequence. .

[0035] S403: Transform the prototype feature sequence As the target sequence, the culture memory sequence As a memory sequence, it is input into the prototype construction module for feature evolution; the prototype construction module first processes the prototype feature sequence. Perform intra-image self-attention aggregation and inter-image self-attention aggregation to extract stable features within chicken images and background images, as well as common features across images. The specific calculation formula is as follows: ; in, is the scaling factor for the attention head.

[0036] Then through the breeding memory sequence Cross-attention achieves context alignment between the farm images, chicken images, and background images, outputting the evolved prototype feature sequence. The specific calculation formula is as follows: .

[0037] S404: The evolved prototype feature sequence The image is re-decomposed according to its dimensions and reconstructed into a two-dimensional feature map, resulting in the evolved set of chicken feature prototypes. and the evolved set of background feature prototypes ,in, Indicates the first A prototype of evolved chicken characteristics. ; Indicates the first An evolved prototype of background features. .

[0038] S5: The breeding coding features are enhanced with the chicken feature prototype and the background feature prototype respectively to obtain target enhancement features and background enhancement features; the target enhancement features and the background enhancement features are fused respectively, and the fused background enhancement features are used to suppress the background of the fused target enhancement features to obtain the DETR decoder input features, so as to reduce false detections caused by background interference. The specific process is as follows: S501: Incorporate aquaculture coding features With each evolved chicken's characteristic prototype Input similarity enhancement module; in the similarity enhancement module, the chicken feature prototype is... As a convolution kernel, it is used in conjunction with the aquaculture coding features. Perform correlation convolution operations to enhance the response features in the breeding coding features that are similar to the corresponding chicken feature prototypes, and obtain the result from the first... Enhanced features guided by individual chicken characteristics ,in, At the same time, the characteristics of aquaculture coding will be included. With each evolved background feature prototype Input similarity enhancement module; in the similarity enhancement module, the background feature prototype is... As a convolution kernel, it is used in conjunction with the aquaculture coding features. Perform correlation convolution operations to enhance the response features in the aquaculture coding features that are similar to the corresponding background feature prototypes, resulting in the form of the first... Enhanced features guided by a prototype of a background feature. ,in, The correlation convolution operation can be expressed as: ; ; in, This means using the evolved chicken feature prototype or background feature prototype as the convolution kernel to perform a correlation convolution matching operation on the breeding encoded features; Indicates by the first Enhanced features guided by individual chicken characteristic prototypes; Indicates by the first Enhanced features guided by a background feature prototype.

[0039] S502: Yes An augmented feature guided by a chicken-related feature prototype. Element-wise aggregation is performed along the prototype dimension to obtain the target's basic features. ;right An enhancement feature guided by a background feature prototype. Element-wise aggregation is performed along the prototype dimension to obtain the basic background features. The specific calculation formula is as follows: ; ; in, Indicates the basic characteristics of the target. Indicates the basic features of the background.

[0040] S503: For each augmented feature guided by the chicken feature prototype The corresponding channel response weights are obtained by sequentially performing global pooling, fully connected layer mapping, ReLU activation, fully connected layer mapping, and Sigmoid normalization. ; weight the channel response With corresponding enhanced features Element-wise multiplication along the channel dimension yields the corresponding channel recalibration features. The specific expression is: ; ; in, This represents a global pooling operation, used to compress input features in the spatial dimension to obtain channel-level statistical information; and These represent the weight parameters of the two fully connected layers, respectively. and These represent the bias parameters of the corresponding fully connected layers; Represents the linear rectification activation function; This represents the Sigmoid normalization function; This represents the element-wise multiplication operation along the channel dimension.

[0041] Recalibrate all channels features The data is stitched together along the channel dimension and then nonlinearly compressed using a multilayer perceptron to generate target fusion weights. Specifically, it can be expressed as: .

[0042] Similarly, for each augmentation feature guided by the background feature prototype... The corresponding channel response weights are obtained by sequentially performing global pooling, fully connected layer mapping, ReLU activation, fully connected layer mapping, and Sigmoid normalization. ; weight the channel response With corresponding enhanced features Element-wise multiplication along the channel dimension yields the corresponding channel recalibration features. ; Recalibrate all channels features The data is stitched together along the channel dimension and then nonlinearly compressed using a multilayer perceptron to generate background fusion weights. The specific expression is: .

[0043] The target fusion weights are respectively With the target basic features The background fusion weights With the aforementioned background basic features Element-wise multiplication along the channel dimension yields the target fusion feature. Background blending features ,Right now: ; .

[0044] S504: Utilizing background blending features Target fusion features Pixel-level weighted suppression is performed to weaken the responses in easily confused background regions, resulting in background-suppressed DETR decoder input features. The specific calculation formula is as follows: ; in, The inhibition coefficient is adjustable. This indicates element-wise multiplication. This is used to impose non-negative constraints on the background fusion features, preventing negative responses from entering the suppression term and negatively enhancing the target fusion features. The above formula, by explicitly suppressing the target fusion features using background fusion features, reduces the response intensity of easily confused background regions, thereby enhancing the model's foreground-background separation capability.

[0045] In this embodiment of the invention, the similarity enhancement and background suppression module not only uses chicken feature prototypes to enhance the response of regions similar to chicken targets, but also uses background feature prototypes to enhance the response of regions related to background interference, thereby explicitly increasing the distance between the foreground and background at the feature level and improving the foreground-background separation capability in complex breeding environments.

[0046] S6: As Figure 3 As shown, the DETR decoder input features are used for foreground scoring, and k high-response feature points representing the foreground target are dynamically selected. Based on the k high-response feature points, a content embedding for the object query and a location prior for the target region are generated, and the location prior is offset-corrected to obtain a refined location prior. The content embedding, the refined location prior, and the DETR decoder input features are input into the DETR decoder for decoding. The classification head outputs the category score of the chicken target, and the bounding box regression head outputs the bounding box coordinates of the chicken target, realizing the localization and detection of small target chickens in the breeding scene. The specific method is as follows: S601: Input features to the DETR decoder Flattening the sequence in the spatial dimension yields a flattened feature sequence. Flatten the feature sequence Input the foreground scoring network and output a foreground confidence score for each feature point. .

[0047] S602: Confidence score for the foreground Sort and select the top The index corresponding to each high-scoring feature point, from the flattened feature sequence Extract the corresponding feature vectors to form the selected foreground feature set. ,Right now: ; ; in, Indicates before selection The operation corresponding to the index of the maximum score. Indicates prospect confidence score Center front The set of indices corresponding to each high-scoring feature point This indicates the operation of extracting the corresponding feature vector by index.

[0048] S603: Based on foreground feature set Generate content embeddings and location priors for object queries; specifically, utilize a feedforward neural network to process the foreground feature set. Perform mapping to generate a query content vector. ,Right now: ; in, This represents the feedforward neural network mapping operation used to generate object query content embeddings.

[0049] Obtain the foreground feature set Normalized coordinates of each feature point on the original feature map The initial normalized width and height are set in conjunction with the feature map step size. This constitutes the initial position prior. Then, a feedforward network is used to predict the offset relative to the prior initial position. and the offset Superimposed on the initial position prior, a refined position prior is obtained. ;in, Represents the set of foreground features The Middle The x-coordinate of each feature point in the normalized spatial coordinates of the original feature map. Represents the set of foreground features The Middle The ordinate of the normalized spatial coordinates of each feature point in the original feature map. Represents the set of foreground features The Middle The normalized width of the prior initial position corresponding to each feature point. Represents the set of foreground features The Middle The normalized height of the prior a priori position corresponding to each feature point.

[0050] S604: The flattened feature sequence As the key vector and value vector in the cross-attention of the DETR decoder, the query content vector As an object query, fine-grained location priors will be used. As an initial reference point; using a sinusoidal position coding function to refine the position prior. Mapped to position embeddings with dimensions consistent with the query content vector. and embed the position With query content vector The object query with fused location information is obtained by fusing the location information and then inputting the object query with fused location information into the DETR decoder.

[0051] S605: Flatten the feature sequence The object query input, which incorporates location information, is iteratively decoded in a DETR decoder consisting of multiple layers of self-attention, cross-attention, and feedforward neural networks to obtain the final output feature sequence. The final output feature sequence Input a classification header, output category scores The final output feature sequence Input regression head, output bounding box coordinates ,Right now: ; ; in, This represents the classification head mapping function, used to map the final output feature sequence. Mapped to category scores ; This represents the bounding box regression head mapping function, used to map the final output feature sequence. Mapped to bounding box coordinates According to category score By setting a threshold and filtering out candidates with low confidence, the final localization and detection results of chicken targets in the breeding images are obtained.

[0052] In this embodiment of the invention, the dynamic prior query initialization strategy enables the DETR decoder to focus on potential target regions in the image more quickly through foreground scoring and Top-k high-response feature screening, and provides the decoder with clear spatial references through refined position priors, thereby improving the problems of traditional DETR object query initialization lacking dynamic position priors for target regions, slow convergence speed, and limited small target localization capabilities.

[0053] Experimental results show that introducing the dual-domain enhancement module and the bidirectional feature pyramid fusion network into the method described in this embodiment improves the model's localization performance for small targets like chickens. Using the basic detection model without the dual-domain enhancement module and the bidirectional feature pyramid fusion network as a baseline, the results show that after adding these two modules, the model's average accuracy (AP50) at IoU=0.50 improves by approximately 19%, and the average accuracy (APs) for small targets improves by approximately 8%. These results demonstrate that this embodiment effectively improves the overall localization and detection accuracy of chicken targets, especially enhancing the localization and detection capabilities for small-scale chicken targets. This is because the dual-domain enhancement module strengthens the edge contours and fine-grained texture information in shallow features, alleviating the weakening of small target features caused by conventional convolution smoothing effects; the bidirectional feature pyramid fusion network achieves a full fusion of high-level semantic information and shallow localization details, thereby improving target recognition and localization performance. Figure 4 As shown, even in the presence of interfering objects such as pipelines, the embodiments of the present invention can still accurately locate the bounding box of the chicken target, indicating that the embodiments of the present invention have good robustness and application effect under small targets.

[0054] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for locating small targets (chickens) based on dual-domain enhancement and dynamic priors, characterized in that, Includes the following steps: S1: Acquire and preprocess the breeding images, and crop N chicken image blocks containing chicken targets from the preprocessed breeding images based on manually labeled boxes, and simultaneously crop M background image blocks from the unlabeled areas; S2: Multi-scale feature extraction is performed on the preprocessed breeding images, chicken image blocks and background image blocks through a backbone network with shared parameters to obtain the corresponding shallow high-resolution features, intermediate features and deep features. A dual-domain enhancement is performed on the shallow high-resolution features, that is, the shallow high-resolution features corresponding to the current input are fused to obtain the shallow fused features corresponding to the input, and the shallow fused features are input into the dual-domain enhancement module. The dual-domain enhancement module first performs convolutional dimensionality reduction on the shallow fused features, and then divides them into computation branches and preservation branches according to the proportion of the number of channels. In the spatial domain path, the computation branches are sequentially processed by convolution and Gaussian error linear units to extract local spatial geometric features. In the frequency domain path, local spatial geometric features are mapped to the frequency domain and spectrally modulated using Fast Fourier Transform, and then restored to the spatial domain using inverse transform to obtain global detail features. The global detail features and the local spatial geometric features are fused, and the residual features of the computation branch are superimposed. Then, they are concatenated and fused with the preservation branch to obtain the enhanced shallow features corresponding to the current input. Semantic enhancement is performed on the deep features to obtain enhanced multi-scale features of the breeding image, multi-scale features of each chicken image patch, and multi-scale features of each background image patch. S3: Perform cross-layer bidirectional fusion on the multi-scale features of the enhanced aquaculture image to obtain an aquaculture feature map, and then perform serialization and DETR encoder encoding on the aquaculture feature map to obtain aquaculture coded features; The enhanced multi-scale features of each chicken image patch and the multi-scale features of each background image patch are subjected to cross-layer bidirectional fusion, which is the same as the enhanced multi-scale features of the breeding image, to obtain a set of chicken feature maps and a set of background feature maps. S4: The chicken feature map set and the background feature map set are serialized, and image type embedding and spatial location encoding are superimposed to construct the chicken feature sequence and the background feature sequence; The chicken feature sequence, background feature sequence, and breeding coding feature are input into the prototype construction module. The chicken feature intra-feature aggregation and background feature intra-feature aggregation are performed respectively. The chicken feature and background feature aggregation and the breeding coding feature are context-aligned with the chicken feature and background feature to generate chicken feature prototype and background feature prototype. S5: The breeding coding features are similar to the chicken feature prototype and the background feature prototype respectively to obtain target enhancement features and background enhancement features; The target enhancement feature and the background enhancement feature are fused separately, and the fused background enhancement feature is used to suppress the background of the fused target enhancement feature to obtain the DETR decoder input feature; S6: Foreground scoring is performed on the input features of the DETR decoder, and k high-response feature points representing the foreground target are dynamically selected. Based on the k high-response feature points, a content embedding for the object query and a location prior for the target region are generated, and the location prior is offset and corrected to obtain a refined location prior. The content embedding, the refined location prior, and the input features of the DETR decoder are input into the DETR decoder for decoding. The classification head outputs the category score of the chicken target, and the bounding box regression head outputs the bounding box coordinates of the chicken target, thereby realizing the localization and detection of small target chickens in the breeding scene.

2. The method for locating small target chickens based on dual-domain enhancement and dynamic prior as described in claim 1, characterized in that, The chicken image patch is an image patch containing chicken targets that is cropped from the image according to manually labeled boxes, and is used to extract chicken target features and construct chicken feature prototypes; The background image patch is an easily confused background interference image patch cropped from the unlabeled area, used to extract background interference features and construct a background feature prototype; The preprocessing includes: converting the aquaculture image into tensor form and normalizing it based on preset channel mean and standard deviation; During the training phase of the small target chicken localization method based on dual-domain enhancement and dynamic prior, one or more enhancement operations are performed on the breeding image, including random horizontal flipping, random color perturbation, multi-scale random scaling, and random size cropping. During the inference phase of the small target chicken localization method based on dual-domain enhancement and dynamic prior, the breeding image is subjected to scale adjustment and normalization processing.

3. The method for locating small target chickens based on dual-domain enhancement and dynamic prior as described in claim 2, characterized in that, Step S2 specifically includes: S201: Perform convolution, batch normalization, and max pooling downsampling on the input poultry farming image, chicken image patch, and background image patch to obtain the initial feature map. The specific expression is: ; in, Indicates the kernel size as Convolution operations; This indicates batch normalization processing; Represents a linear rectified function; This represents the max pooling operation; This represents the input image of the farm, a block of chicken images, and a block of background images; S202: Using a ResNet-101 network as the backbone network, the initial feature map... Multi-stage feature extraction is performed, outputting shallow high-resolution features P2 and P3, intermediate layer features P4, and deep layer features P5; among them, the multi-scale features corresponding to the aquaculture image are denoted as... The multi-scale features corresponding to the chicken image patch are denoted as , The multi-scale features corresponding to each chicken image patch are denoted as and the multi-scale features corresponding to the background image patch are denoted as . , This represents the multi-scale features corresponding to each background image patch; steps S203 and S204 perform the same enhancement processing on the livestock image, chicken image patch, and background image patch, respectively. For simplicity, the shallow high-resolution features corresponding to the current input are denoted as... and The intermediate layer features are denoted as Deep features are denoted as ; S203: Fuse the shallow high-resolution features P2 and P3 corresponding to the current input to obtain the shallow fused features corresponding to the input. and the shallow fusion features Input dual-domain enhancement module; the dual-domain enhancement module first performs shallow fusion features Perform convolutional dimensionality reduction, then divide the computation into branches according to the ratio of 1 / 4 channel count and 3 / 4 channel count. and maintain branches ; Under the spatial path, for the computation branch Convolution and Gaussian error linear unit processing are performed sequentially to extract local spatial geometric features. In the frequency domain, local spatial geometric features are represented by the Fast Fourier Transform. After mapping to the frequency domain and performing spectral modulation, the system is then restored to the spatial domain through an inverse transform to obtain global detailed features. ; the global detail features and the local spatial geometric features The computational branches are then merged and superimposed. The residual characteristics, and then the preservation branches By concatenating and fusion, the enhanced shallow features corresponding to the current input are obtained. ; S204: Preserve the original feature information of the intermediate layer feature P4 corresponding to the current input; input the deep feature P5 corresponding to the current input into the multi-head self-attention semantic enhancement module to model the long-distance dependency relationship between pixels in the low-resolution feature space, and output the semantically enhanced deep feature. ; and will enhance shallow features Intermediate layer features and semantically enhanced deep features Together, they constitute the enhanced multi-scale feature representation corresponding to the current input, which is used for subsequent cross-layer fusion and localization detection; wherein, the current input is a breeding image, a chicken image patch, and a background image patch.

4. The method for locating small target chickens based on dual-domain enhancement and dynamic prior as described in claim 3, characterized in that, Step S3 specifically includes: S301: Employ a bidirectional feature pyramid fusion network to enhance the shallow features. Intermediate layer features P4 and semantically enhanced deep features Cross-layer fusion is performed; the bidirectional feature pyramid fusion network includes a top-down path and a bottom-up path, wherein the top-down path is used to inject high-level semantic information into low-level features, and the bottom-up path is used to feed back shallow localization details to high-level features. S302: In the top-down path, the semantically enhanced deep features After convolution and upsampling, the features are fused with the intermediate layer feature P4, and then convolution is performed to obtain the intermediate layer downlink feature. The intermediate layer downlink characteristics After convolution and upsampling, shallow features are enhanced. The features are fused and then convolved to obtain shallow downlink features. ; S303: In the bottom-up path, shallow downward features After convolution and downsampling, the downlink features of the intermediate layer after convolution transformation The intermediate layer enhancement features are obtained by fusion. The intermediate layer enhancement features Deep features after further downsampling and semantic enhancement By fusing the features, deep enhancement features are obtained. ; S304: Enhance the intermediate layer features using bilinear interpolation. and the deep enhancement features Upsampling to the shallow downlink features Same spatial resolution, and with the shallow downlink features Feature concatenation is performed along the channel dimension, followed by fusion and dimensionality reduction via convolutional layers to adjust the number of channels to the preset dimension. The fused aquaculture feature map was obtained. The enhanced chicken image patches were fused using a bidirectional feature pyramid fusion process corresponding to the breeding images, resulting in a set of chicken feature maps. The enhanced background image patches are then fused using a bidirectional feature pyramid fusion process corresponding to the aquaculture images at multiple scales to obtain a set of background feature maps. ; S305: The fused aquaculture feature map Flattening the sequence in the spatial dimension yields the aquaculture characteristic sequence. And construct a sinusoidal spatial location code consistent with its dimension. Encode the sinusoidal spatial position. With the breeding characteristic sequence By adding elements one by one, we obtain the aquaculture feature sequence with location information. The sinusoidal spatial position encoding The mid-space position is The element in the channel dimension and The encoded values ​​of each component are: ; ; in, This indicates the position index of the feature point in the expanded sequence; Indicates the index of the channel dimension, with a value range of 0 to 1. ; The preset dimension refers to the fused aquaculture feature map. Channel dimension; Indicates the position index is Feature points in the first Position encoding values ​​on an even number of channel dimensions Indicates the position index is Feature points in the first Positional encoded values ​​on an odd number of channel dimensions; S306: Transfer the aquaculture feature sequence with location information Input the DETR encoder to perform global context modeling, and output aquaculture coding features. .

5. The method for locating small target chickens based on dual-domain enhancement and dynamic prior as described in claim 4, characterized in that, Step S4 specifically includes: S401: The set of chicken feature maps obtained in step S304 and background feature map set Flattening the images in the spatial dimension yields chicken feature sequences and background feature sequences; a learnable chicken image type embedding is defined. and background image type embedding And embed the chicken image type respectively and background image type embedding The corresponding chicken feature sequences and background feature sequences are superimposed to generate feature sequences with image type attributes; then, sinusoidal spatial location codes are superimposed on each feature sequence. This yields an enhanced feature sequence that integrates image type information and spatial location information. S402: Concatenate and splice all enhanced chicken feature sequences and enhanced background feature sequences along the sequence length dimension to form the prototype feature sequence. Simultaneously, the breeding coding features are... Flattening it out in the spatial dimension yields the aquaculture memory sequence. ; S403: The total sequence of the prototype features... The breeding memory sequence will be used as the target sequence. As a memory sequence, it is input into the prototype construction module for feature evolution; the prototype construction module first processes the prototype feature sequence. Intra-image self-attention aggregation and inter-image self-attention aggregation are performed to extract stable features within chicken images and background images, as well as common features across images. These features are then compared with the breeding memory sequence. Cross-attention achieves context alignment between the farm images, chicken images, and background images, outputting the evolved prototype feature sequence. ; S404: The evolved prototype feature sequence The image is re-decomposed according to its dimensions and reconstructed into a two-dimensional feature map, resulting in the evolved set of chicken feature prototypes. and the evolved set of background feature prototypes ,in, Indicates the first A prototype of evolved chicken characteristics. ; Indicates the first An evolved prototype of background features. .

6. The method for locating small target chickens based on dual-domain enhancement and dynamic prior as described in claim 5, characterized in that, Step S5 specifically includes: S501: The aquaculture coding features are... With each evolved chicken's characteristic prototype Input similarity enhancement module; in the similarity enhancement module, the chicken feature prototype is... As a convolution kernel, it is used in conjunction with the aquaculture coding features. Perform correlation convolution operations to enhance the response features in the breeding coding features that are similar to the corresponding chicken feature prototypes, to obtain the result from the first... Enhanced features guided by individual chicken characteristics ,in, Simultaneously, the breeding coding features are... With each evolved background feature prototype Input similarity enhancement module; in the similarity enhancement module, the background feature prototype is... As a convolution kernel, it is used in conjunction with the aquaculture coding features. Perform correlation convolution operations to enhance the response features in the aquaculture coding features that are similar to the corresponding background feature prototypes, to obtain the result from the first... Enhanced features guided by a prototype of a background feature. ,in, ; S502: Yes An augmented feature guided by a chicken-related feature prototype. Element-wise aggregation is performed along the prototype dimension to obtain the target's basic features. ;right An enhancement feature guided by a background feature prototype. Element-wise aggregation is performed along the prototype dimension to obtain the basic background features. ; S503: For each augmented feature guided by the chicken feature prototype The corresponding channel response weights are obtained by sequentially performing global pooling, fully connected layer mapping, ReLU activation, fully connected layer mapping, and Sigmoid normalization. ; weight the channel response With corresponding enhanced features Element-wise multiplication along the channel dimension yields the corresponding channel recalibration features. ; Recalibrate all channels features The data is stitched together along the channel dimension and then nonlinearly compressed using a multilayer perceptron to generate target fusion weights. For each augmentation feature guided by the background feature prototype The corresponding channel response weights are obtained by sequentially performing global pooling, fully connected layer mapping, ReLU activation, fully connected layer mapping, and Sigmoid normalization. ; weight the channel response With corresponding enhanced features Element-wise multiplication along the channel dimension yields the corresponding channel recalibration features. ; Recalibrate all channels features The data is stitched together along the channel dimension and then nonlinearly compressed using a multilayer perceptron to generate background fusion weights. The target fusion weights are respectively... With the target basic features The background fusion weights With the aforementioned background basic features Element-wise multiplication along the channel dimension yields the target fusion feature. Background blending features ; S504: Utilizing the background blending features For the target fusion features Pixel-level weighted suppression is performed to weaken the responses in easily confused background regions, resulting in background-suppressed DETR decoder input features. .

7. The method for locating small target chickens based on dual-domain enhancement and dynamic prior as described in claim 6, characterized in that, Step S6 specifically includes: S601: Input the DETR decoder with features Flattening the sequence in the spatial dimension yields a flattened feature sequence. The flattened feature sequence Input the foreground scoring network and output a foreground confidence score for each feature point. ; S602: Confidence score for the foreground Sort and select the top The index corresponding to each high-scoring feature point, from the flattened feature sequence Extract the corresponding feature vectors to form the selected foreground feature set. ; S603: Based on the foreground feature set Generate the content embedding and location prior of the object query; specifically, utilize a feedforward neural network to process the foreground feature set. Perform mapping to generate a query content vector. ; Obtain the foreground feature set Normalized coordinates of each feature point on the original feature map The initial normalized width and height are set in conjunction with the feature map step size. This constitutes the initial position prior. Then, a feedforward network is used to predict the offset relative to the prior initial position. and the offset Superimposed on the initial position prior, a refined position prior is obtained. ;in, Represents the set of foreground features The Middle The x-coordinate of each feature point in the normalized spatial coordinates of the original feature map. Represents the set of foreground features The Middle The ordinate of the normalized spatial coordinates of each feature point in the original feature map. Represents the set of foreground features The Middle The normalized width of the prior initial position corresponding to each feature point. Represents the set of foreground features The Middle The normalized height of the prior a priori position corresponding to each feature point; S604: The flattened feature sequence As the key vector and value vector in the cross-attention of the DETR decoder, the query content vector As an object query, fine-grained location priors will be used. As an initial reference point; using a sinusoidal position coding function to refine the position prior. Mapped to position embeddings with dimensions consistent with the query content vector. and embed the position With query content vector The object query with fused location information is obtained by fusing the location information and then inputting the object query with fused location information into the DETR decoder. S605: Flatten the feature sequence The object query input, which incorporates location information, is iteratively decoded in a DETR decoder consisting of multiple layers of self-attention, cross-attention, and feedforward neural networks to obtain the final output feature sequence. The final output feature sequence Input a classification header, output category scores The final output feature sequence Input regression head, output bounding box coordinates According to category score By setting a threshold and filtering out candidates with low confidence, the final location and detection results of small target chickens in the breeding image are obtained.