A target detection method based on adaptive feature enhancement and minimum point distance optimization

By employing an adaptive feature enhancement and minimum point distance optimization target detection method, the problems of inaccurate small target detection and positioning in agricultural harvesting robots in complex environments are solved, achieving high-precision and robust target detection suitable for complex farmland environments.

CN122223487APending Publication Date: 2026-06-16ANHUI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610286638.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-10
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

Existing agricultural harvesting robots suffer from low accuracy in detecting small targets and inaccurate positioning in complex natural environments. Their multi-scale fusion mechanisms are not sensitive to agricultural interference factors, and their positioning is inaccurate in densely occluded scenes, which seriously affects their practical application effectiveness.

Method used

A target detection method based on adaptive feature enhancement and minimum point distance optimization is adopted. Multi-scale features are extracted through backbone network, and a coordinate attention enhancement module is integrated for position calibration and noise suppression. Channel and spatial attention mechanisms are embedded in the detection head, and the positioning accuracy is optimized by combining the minimum point distance optimization loss function.

Benefits of technology

It significantly improves the feature representation ability and detection accuracy of small targets, enhances the model's understanding of the global context and the accuracy of target boundary localization, solves the problem of localization accuracy in complex scenarios, and achieves high-precision and high-robust target detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122223487A_ABST
    Figure CN122223487A_ABST
Patent Text Reader

Abstract

The application provides a target detection method based on adaptive feature enhancement and minimum point distance optimization, comprising: obtaining an original image and preprocessing; inputting the preprocessed image into a trained target detection model to obtain a detection result. The model comprises: a backbone network; a feature pyramid structure, at least one level of which is integrated with a coordinate attention enhancement module after a fusion node; a detection head comprising a parallel classification branch and a regression branch, the classification branch being embedded with a channel attention mechanism and the regression branch being embedded with a spatial attention mechanism; and a post-processing module for processing the output of the detection head to obtain the detection result. A minimum point distance optimization loss function is used as a boundary box regression loss during training. The application solves the semantic conflict and spatial misplacement problems in feature fusion, improves the small target detection precision and positioning accuracy, overcomes the bottleneck of small target feature loss and inaccurate positioning in a dense occlusion scene in the prior art, and realizes high-precision and high-robustness target detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and deep learning technology, and in particular to a target detection method based on adaptive feature enhancement and minimum point distance optimization. Background Technology

[0002] Against the backdrop of rapid development in agricultural automation and intelligence, computer vision-based harvesting robots have become a key research direction in the fields of precision agriculture and intelligent equipment. As its core perception technology, the performance of the target algorithm directly determines whether the robot can achieve stable and efficient fruit recognition and localization in unstructured farmland environments.

[0003] Currently, agricultural harvesting robots generally employ an advanced detection framework that balances speed and accuracy to achieve real-time, precise identification and localization of crop targets in natural environments. These models, by integrating lightweight components and multi-scale feature fusion strategies, improve adaptability to common disturbances in agricultural scenarios while maintaining computational efficiency. However, existing models still face three core bottlenecks in real, complex farmland: loss of small target features, insensitivity of multi-scale fusion mechanisms to agricultural disturbances, and inaccurate localization in densely occluded scenes. These bottlenecks severely limit their practical application effectiveness. Summary of the Invention

[0004] In view of the above-mentioned deficiencies of the prior art, the present invention provides a target detection method based on adaptive feature enhancement and minimum point distance optimization to solve the technical problems of low detection accuracy and inaccurate positioning of small targets in complex natural environments.

[0005] To achieve the above and other related objectives, this invention provides a target detection method based on adaptive feature enhancement and minimum point distance optimization, comprising: acquiring an original image to be processed and preprocessing it to adapt to model input; inputting the preprocessed original image into a trained target detection model to obtain a target detection result, wherein the target detection model comprises: a backbone network for extracting features from the input image to obtain multi-scale feature maps; a feature pyramid structure for fusing the multi-scale feature maps, wherein the feature pyramid structure integrates a coordinate attention enhancement module after at least one fusion node, the coordinate attention enhancement module being used to perform coordinate attention enhancement on the fused features. The system includes a location calibration and noise suppression module, which outputs a purified multi-scale feature map. A detection head receives the purified multi-scale feature map and includes parallel classification and regression branches. The classification branch incorporates a channel attention mechanism to enhance global contextual understanding, while the regression branch incorporates a spatial attention mechanism to enhance bounding box localization accuracy. A post-processing module processes the output of the detection head to obtain the target detection result. During the training of the target detection model, a minimum point distance optimization loss function is used as the bounding box regression loss. This minimum point distance optimization loss function optimizes localization accuracy by minimizing the geometric distance between corresponding points in the predicted and ground truth bounding boxes.

[0006] In one embodiment of the present invention, the feature pyramid structure is cascaded with a coordinate attention enhancement module after each feature fusion node, which is used to purify the fused features in real time, forming a multi-scale feature pyramid that is optimized step by step from deep to shallow.

[0007] In one embodiment of the present invention, the multi-scale feature map output by the backbone network is: ,in This is the shallowest feature map with the highest resolution. The deep feature map has the lowest resolution; the feature pyramid structure integrates the coordinate attention enhancement module in the following way: [The deep feature map is then used as the reference point]. Upsampled and adjacent second-deep feature maps The feature maps are fused to generate a first primary fused feature map; the first primary fused feature map is input into a first coordinate attention enhancement module for processing, and a first optimized feature map is output; the first optimized feature map is upsampled and then combined with a shallower feature map. The feature maps are fused to generate a second primary fused feature map. This second primary fused feature map is then input into a second coordinate attention enhancement module for processing, outputting a second optimized feature map. The fusion and optimization logic is repeated, sequentially generating optimized feature maps for all target scales along the feature pyramid construction path, and outputting the purified multi-scale feature maps. .

[0008] In one embodiment of the present invention, the coordinate attention enhancement module performs the following processing on the input feature map: the input feature map is divided into multiple sub-feature maps along the channel dimension; each sub-feature map is processed by a first branch and a second branch set in parallel, wherein the first branch is embedded with a coordinate attention mechanism to capture position information, and the second branch extracts local multi-scale features through depthwise separable convolution; the processing results of the first branch and the second branch are combined and fused to generate an enhanced sub-feature map; all sub-feature maps are concatenated along the channel dimension and cross-channel information is fused through a convolutional layer to output an optimized feature map.

[0009] In one embodiment of the present invention, the first branch embeds a coordinate attention mechanism in the following manner: global average pooling is performed on each sub-feature map along the height and width directions to generate a height direction feature code and a width direction feature code; the height direction feature code and the width direction feature code are concatenated and processed by convolution and activation function to generate attention weights containing position information; the attention weights are multiplied element-wise with the corresponding sub-feature map to achieve position calibration of the feature map.

[0010] In one embodiment of the present invention, the processing results of the first branch and the second branch are subjected to feature interaction and fusion, including: performing element-wise multiplication of the feature map of the second branch after depthwise separable convolution with the global feature vector obtained by global average pooling of the first branch to realize the interaction between global information and local features; and fusing the interactive feature map with the original output feature map of the first branch to generate the enhanced feature corresponding to the sub-feature map.

[0011] In one embodiment of the present invention, the second branch uses depthwise separable convolution to extract local multi-scale features. The depthwise separable convolution includes depthwise convolution and pointwise convolution, which is used to capture local spatial structural information while maintaining computational efficiency.

[0012] In one embodiment of the present invention, the detection head processes the purified multi-scale feature map in the following manner: after performing basic convolutional transformation on the input feature map, it is input to a classification branch and a regression branch set in parallel; in the classification branch, channel attention weights are generated through global average pooling and fully connected layers, and multiplied with the input feature map channel by channel to obtain classification features enhanced by global context; in the regression branch, spatial attention maps are generated through depthwise separable convolution and spatial attention mechanism, and multiplied with the input feature map element by element to obtain regression features enhanced by spatial location; the classification features and the regression features are input to the prediction convolutional layer to generate preliminary classification confidence and bounding box coordinates.

[0013] In one embodiment of the present invention, the method further includes: extracting a location confidence signal from the intermediate features of the regression branch; performing a matrix multiplication of the location confidence signal with the preliminary classification confidence output by the classification branch to dynamically adjust the classification score according to the location reliability; and using the adjusted classification confidence and the bounding box coordinates output by the regression branch as the final output of the detection head.

[0014] In one embodiment of the present invention, the total loss function L during the training of the target detection model is... total Calculated using the following formula: , In the formula, λ1, λ2, and λ3 are preset weighting coefficients for balancing the contributions of different tasks, and L cls and L obj These are the target classification loss and the confidence loss, respectively. MPDIoU The loss for optimizing the minimum point distance is calculated using the following formula: , In the formula, IoU is the intersection-union ratio of the predicted bounding box and the ground truth bounding box. This represents the squared Euclidean distance between the center points of the predicted bounding box and the ground truth bounding box. and Let represent the squares of the difference in width between the predicted bounding box and the squares of the difference in height between the predicted bounding box and the ground truth bounding box, respectively, and let c be the diagonal length of the smallest bounding rectangle containing both the predicted bounding box and the ground truth bounding box.

[0015] The beneficial effects of this invention are as follows: This invention proposes a target detection method based on adaptive feature enhancement and minimum point distance optimization. This method extracts multi-scale features through a backbone network and integrates a coordinate attention enhancement module into the feature pyramid structure to perform position calibration and noise suppression on the fused features, effectively solving the semantic conflict and spatial misalignment problems in the feature fusion process, and significantly improving the feature representation ability and detection accuracy of small targets. At the same time, the detection head adopts a parallel classification branch and a regression branch, embedding channel attention mechanism and spatial attention mechanism respectively, which enhances the model's ability to understand the global context and the accuracy of target boundary localization. In addition, a minimum point distance optimization loss function is introduced in the training phase. By directly minimizing the geometric distance between the corresponding points of the predicted box and the ground truth box, the localization accuracy of the model in complex scenes is greatly improved. While maintaining computational efficiency, this invention systematically solves the three major technical bottlenecks in the prior art: loss of small target features, insensitivity of multi-scale fusion to interference, and inaccurate localization in densely occluded scenes, achieving high-precision and high-robustness target detection. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. The accompanying drawings are incorporated in and constitute a part of this specification, illustrating embodiments consistent with this application, and are used together with the description to explain the principles of this application. Obviously, the drawings described below are merely some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without creative effort.

[0017] Figure 1 This is an architecture diagram of the backbone network and feature pyramid structure of a target detection model provided in an embodiment of the present invention; Figure 2 This is an architecture diagram of a coordinate attention enhancement module provided in an embodiment of the present invention; Figure 3 This is a flowchart illustrating the processing of the detection head of a target detection model provided in an embodiment of the present invention. Detailed Implementation

[0018] The following specific embodiments illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. It should be noted that, unless otherwise specified, the following embodiments and features can be combined with each other. In addition to the specific methods, equipment, and materials used in the embodiments, based on the knowledge of the prior art and the description of the present invention by those skilled in the art, any prior art methods, equipment, and materials similar to or equivalent to the methods, equipment, and materials in the embodiments of the present invention can be used to implement the present invention.

[0019] It should be understood that the terminology used in the embodiments of this invention is for describing specific particular implementations and not for limiting the scope of protection of this invention. Unless otherwise defined, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art.

[0020] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the invention. However, it will be apparent to those skilled in the art that embodiments of the invention may be practiced without these specific details. In some embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the invention.

[0021] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functions, and operations that may be implemented in the methods and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0022] An embodiment of the present invention provides a target detection method based on adaptive feature enhancement and minimum point distance optimization, comprising: (1) acquiring the original image to be processed and preprocessing it to adapt to the model input; (2) inputting the preprocessed original image into the trained target detection model to obtain the target detection result. The target detection model includes a backbone network, a feature pyramid structure, a detection head, and a post-processing module. The present invention is based on the classic architecture of the YOLO series networks. Traditional YOLO networks typically consist of three parts: a backbone network responsible for feature extraction, a feature pyramid structure for multi-scale feature fusion, and an output module for prediction and post-processing. The backbone network in this invention is the same as the backbone network and output processing in the YOLO series networks; other structures are improvements based on the structures in the YOLO series. By modifying the YOLO series networks, we construct the required network structure, and then by training the network, we can obtain the target detection model in this invention. These modules are further explained below.

[0023] Please see Figure 1 The backbone network is used to extract features from the input image, obtaining multi-scale feature maps. The backbone network in this invention is the same as that of the YOLO series networks, which typically employ a CSPDarknet structure. Through cross-stage local network design, gradient flow and feature reuse capabilities are enhanced while maintaining computational efficiency. The backbone network consists of multiple stacked convolutional blocks and CSP modules, generating feature maps of different resolutions through progressive downsampling. Shallow feature maps have high resolution but weak semantic information, while deep feature maps have low resolution but rich semantic information. This multi-scale feature map provides rich spatial structure and semantic information for subsequent feature pyramid fusion.

[0024] The feature pyramid structure is used to fuse multi-scale feature maps. The feature pyramid structure integrates a coordinate attention enhancement module after at least one fusion node. The coordinate attention enhancement module is used to perform position calibration and noise suppression on the fused features and output a purified multi-scale feature map.

[0025] In one specific embodiment of the present invention, a coordinate attention enhancement module is cascaded after each feature fusion node in the feature pyramid structure. This module is used to refine the fused features in real time, forming a multi-scale feature pyramid that is optimized step-by-step from deep to shallow layers. By cascading the coordinate attention enhancement module after each feature fusion node, real-time refinement of the fused features is achieved, effectively suppressing semantic conflicts and spatial misalignment noise introduced during feature fusion, enhancing the semantic consistency of the feature pyramid, and providing higher-quality multi-scale features for subsequent detection heads.

[0026] In a specific embodiment of the present invention, the multi-scale feature map output by the backbone network is as follows: ,in This is the shallowest feature map with the highest resolution. The deep feature map has the lowest resolution. The feature pyramid structure integrates the coordinate attention enhancement module in the following ways: (1) the deep feature map is... Upsampled and adjacent second-deep feature maps The feature maps are fused to generate the first primary fused feature map F. temp1 (2) Input the first primary fusion feature map into the first coordinate attention enhancement module for processing, and output the first optimized feature map F. 45 (3) The first optimized feature map is upsampled and then fused with the shallower feature map C3 to generate the second primary fused feature map F. temp2 (4) Input the second primary fusion feature map into the second coordinate attention enhancement module for processing, and output the second optimized feature map F. 345 (5) Repeat the above fusion and optimization logic, and generate optimized and purified multi-scale feature maps of all target scales in sequence along the feature pyramid construction path. Specifically, P5=C5, P4=F 45 P3=F 345 P2=F 2345 F 2345 Right now Figure 1 The output feature of the bottommost coordinate attention enhancement module is not shown in the figure.

[0027] This embodiment details the specific construction process of the feature pyramid structure, using the output of YOLO series networks. , , , Based on four layers of feature maps, this invention fuses deep semantic information and shallow spatial details step-by-step through a top-down path. Unlike traditional FPN, this invention introduces a coordinate attention enhancement module after each fusion level to perform position calibration and noise suppression on the initial fused features. Specifically, After upsampling and The fusion and processing by the first CAEM are obtained ; After upsampling and The fusion and subsequent second CAEM processing yielded the following results. ; and so on. This design allows each level of output features to be purified through an attention mechanism, effectively mitigating the dilution problem during the propagation of deep semantic information to shallower layers, while suppressing background noise interference and significantly improving the feature response intensity of small targets. Experiments show that this structure improves the small target detection accuracy by 3-5 percentage points while maintaining computational efficiency.

[0028] Please see Figure 2 In a specific embodiment of the present invention, the coordinate attention enhancement module performs steps 2.1 to 2.4 on the input feature map.

[0029] Step 2.1: Input feature map Segmented into multiple sub-feature maps along the channel dimension , where each sub-feature .

[0030] Step 2.2: For each sub-feature map, process it separately through the first branch (i.e., 1×1 branch) and the second branch (i.e., 3×3 branch) set in parallel. The first branch is embedded with a coordinate attention mechanism to capture position information, and the second branch extracts local multi-scale features through depthwise separable convolution.

[0031] In a specific embodiment of the present invention, the first branch embeds a coordinate attention mechanism in the following manner: (1) Perform global average pooling on each sub-feature map along the height direction and the width direction respectively to generate a height direction feature code. and width direction feature encoding It can be expressed by the formula: , .

[0032] (2) The height-direction feature encoding and the width-direction feature encoding are concatenated and processed by convolution and activation functions to generate attention weights containing positional information. (3) The attention weights are multiplied element-wise with the corresponding sub-feature maps to achieve positional calibration of the feature maps. In this embodiment, the obtained features are concatenated, convolved, and activated by Sigmoid to generate an attention weight map that encodes precise positional information. This map is then multiplied element-wise with the atomic feature maps. First, the GroupNorm module is used to perform a normalization operation to stabilize the numerical distribution of the fused features. Then, the spatial dimension is compressed using AvgPool to obtain a dimension of eigenvectors.

[0033] In a specific embodiment of the present invention, the second branch uses depthwise separable convolution to extract local multi-scale features. Depthwise separable convolution includes depthwise convolution and pointwise convolution, which is used to capture local spatial structural information while maintaining computational efficiency.

[0034] Step 2.3: Perform feature interaction and fusion on the processing results of the first branch and the second branch to generate an enhanced sub-feature map.

[0035] In a specific embodiment of the present invention, the processing results of the first branch and the second branch are subjected to feature interaction and fusion, including: (1) performing element-wise multiplication of the feature map of the second branch after depthwise separable convolution with the global feature vector obtained by the first branch after global average pooling, so as to realize the interaction between global information and local features; (2) fusing the feature map after interaction with the original output feature map of the first branch to generate the enhanced feature corresponding to the sub-feature map.

[0036] This step achieves the organic fusion of global contextual information and local spatial features. The first branch captures precise location information and generates a global feature vector through a coordinate attention mechanism, while the second branch extracts rich local detail features through depthwise separable convolution. Performing a dot product between the two ensures that each spatial location is aware of the global channel importance while preserving local structural information, effectively enhancing the spatial consistency and semantic richness of the features and providing higher-quality input features for subsequent detection tasks.

[0037] Step 2.4: Concatenate all sub-feature maps along the channel dimension, and fuse cross-channel information through a convolutional layer to output the optimized feature map.

[0038] The detection head is used to receive purified multi-scale feature maps and includes a classification branch and a regression branch set in parallel. The classification branch is embedded with a channel attention mechanism to enhance global context understanding, and the regression branch is embedded with a spatial attention mechanism to enhance bounding box localization accuracy.

[0039] Please see Figure 3In a specific embodiment of the present invention, the detection head processes the purified multi-scale feature map in the following ways: (1) After performing basic convolution transformation on the input feature map, it is input to the classification branch and regression branch set in parallel respectively; (2) In the classification branch, channel attention weights are generated by global average pooling and fully connected layers, and multiplied with the input feature map channel by channel to obtain classification features enhanced by global context; (3) In the regression branch, spatial attention maps are generated by depthwise separable convolution and spatial attention mechanism, and multiplied with the input feature map element by element to obtain regression features enhanced by spatial location; (4) The classification features and regression features are input to the prediction convolution layer respectively to generate preliminary classification confidence and bounding box coordinates. This step realizes differentiated feature enhancement for classification and regression tasks. The classification branch models the global dependency relationship between channels through global average pooling and fully connected layers, so that the model can make full use of the scene context of the entire image when judging the target category, which significantly improves the classification robustness in occlusion and complex backgrounds. The regression branch adaptively highlights key regions in the feature map that are related to the target boundary and center point through depthwise separable convolution and spatial attention mechanisms, suppresses irrelevant background interference, provides more accurate geometric information for bounding box regression, and directly improves localization accuracy.

[0040] In a specific embodiment of the present invention, the above steps further include: (1) extracting the location confidence signal from the intermediate features of the regression branch; (2) performing matrix multiplication of the location confidence signal with the preliminary classification confidence output by the classification branch to dynamically adjust the classification score according to the location reliability; and (3) using the adjusted classification confidence and the bounding box coordinates output by the regression branch as the final output of the detection head. This step, by introducing a location gating mechanism, realizes collaborative reasoning between classification and regression tasks. The location confidence signal extracted from the regression branch reflects the reliability of the current location. Multiplying it with the classification confidence can effectively suppress high-scoring false detections in ambiguous location areas while retaining high-confidence predictions in accurate location areas, significantly improving the overall quality and consistency of the detection results.

[0041] In a specific embodiment of the present invention, the specific processing procedure of the detection head can be as follows: Each scale's feature map undergoes preliminary feature transformation and dimensionality reduction through a shared basic convolutional layer, preparing for subsequent task-specific processing. The feature map after basic convolution processing is then input to the classification branch. In this branch, the input feature map... Global average pooling is performed along the spatial dimension H×W to aggregate global information and generate a channel feature vector. . Vector The input is fed into a multilayer perceptron consisting of two fully connected layers. The first fully connected layer is used to compress the number of channels, and the second fully connected layer is used to restore the original number of channels. A sigmoid activation function is used to generate channel attention weights. Channel attention weights Compared with the original input feature map Perform channel-by-channel multiplication to obtain a feature map enhanced with global context information. This module models global dependencies between channels, enabling the classification branch to effectively utilize the entire image's scene context when determining the target category, significantly improving classification robustness under occlusion and complex backgrounds. In parallel, another set of features is input to the regression branch, where the input feature map is processed... First, depthwise separable convolution is used for efficient spatial feature extraction to obtain feature maps. .Will A 1×1 convolutional layer is fed in to compress the number of channels to 1, and then a sigmoid activation function is passed through to generate a spatial attention map. Its value range is [0,1]. The spatial attention map... Compared with the original input feature map Element-wise multiplication yields a spatially attention-weighted feature map. This module adaptively highlights key regions in the feature map related to the target boundary and center point, suppressing irrelevant background interference, thus providing more accurate geometric information for bounding box regression and directly contributing to improved localization accuracy. The feature maps processed by the two branches are fed into the prediction convolutional layer to generate preliminary classification confidence and bounding box coordinates, respectively. To further improve the consistency of the outputs of the two tasks, a lightweight localization confidence signal is extracted from the intermediate features of the regression branch. .Will As a gating mechanism, the classification score is multiplied by the initial classification confidence score. This operation dynamically adjusts the classification score based on the reliability of the localization, effectively suppressing high-scoring false positives in ambiguous localization regions. The output is the optimized, final target category prediction, confidence score, and bounding box parameter set. .

[0042] The post-processing module is used to process the output of the detection head to obtain the target detection result.

[0043] Meanwhile, when training the object detection model, the minimum point distance optimization loss function is used as the bounding box regression loss. The minimum point distance optimization loss function optimizes the localization accuracy by minimizing the geometric distance between the corresponding points of the predicted box and the ground truth box.

[0044] In a specific embodiment of the present invention, the total loss function L during the training of the object detection model is... totalCalculated using the following formula: , In the formula, λ1, λ2, and λ3 are preset weighting coefficients for balancing the contributions of different tasks, and L cls and L obj These are the target classification loss and the confidence loss, respectively. MPDIoU The loss for minimizing point distance is calculated using the following formula: , In the formula, IoU is the intersection-union ratio between the predicted box and the ground truth box, which is used to measure the degree of overlap between the predicted box and the ground truth box; This represents the squared Euclidean distance between the center points of the predicted bounding box and the ground truth bounding box, directly optimizing the position alignment. and represents the squares of the width difference and the squares of the height difference between the predicted and ground truth bounding boxes, respectively, precisely constraining shape matching; c is the diagonal length of the smallest bounding rectangle containing both the predicted and ground truth bounding boxes, providing a normalization baseline. This loss function forces the model to generate bounding boxes that are highly consistent with the real target in position and shape by minimizing center point offset and size difference, making it particularly suitable for solving localization error problems in complex scenes.

[0045] In this embodiment, for each prediction box, the parameters include the center point coordinates. And width and height Obtain the corresponding set of real target bounding box parameters from the training sample annotations. Its parameters are Then, a loss function based on the minimum point distance intersection-union ratio (MPDIoU) is constructed using the above formula. Used to calculate prediction boxes With real frame The difference between them. Minimize L using the gradient descent algorithm. total The error signal propagates back to the detection network, driving the network parameters to be updated in the direction of reducing localization error and improving classification accuracy, thereby achieving systematic optimization of the bounding box prediction capability.

[0046] It should be noted that the steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they contain the same logical relationship, they are all within the scope of protection of this application. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but without changing the core design of the algorithm and process, are also within the scope of protection of this patent.

[0047] In summary, this invention systematically constructs an efficient small target detector from four levels: feature extraction, information fusion, collaborative enhancement, and regression optimization, and has the following beneficial effects: (1) The coordinate attention enhancement module is integrated into the feature pyramid structure. Through the dual functions of position calibration and noise suppression, the feature misalignment and semantic conflict problems in the feature fusion process of traditional feature pyramid are solved. The semantic consistency and spatial accuracy of multi-scale features are significantly improved, and the information loss of small target features during the propagation process is effectively alleviated.

[0048] (2) The detection head adopts a parallel design of classification branch and regression branch, embedding channel attention mechanism and spatial attention mechanism respectively, to achieve task-specific feature enhancement. The classification branch improves the classification robustness in occlusion and complex backgrounds through global context understanding ability, while the regression branch improves the bounding box localization accuracy through spatial position enhancement ability. The two work together to achieve accurate detection in complex scenes.

[0049] (3) Introducing a positioning gating mechanism in the regression branch, multiplying the positioning confidence signal with the classification confidence, and dynamically adjusting the classification score according to the positioning reliability, effectively suppressing high-scoring false detections in positioning ambiguity areas and improving the consistency between the output of classification and regression tasks.

[0050] (4) The minimum point distance optimization loss function based on geometric prior is introduced. By directly minimizing the Euclidean distance and the difference in width and height between the center point of the predicted box and the real box, the spatial position discrimination and regression accuracy of the model in complex scenes is systematically enhanced. It is especially suitable for solving the positioning deviation problem in densely occluded scenes.

[0051] (5) All the improved modules of the present invention are based on the lightweight design concept. The coordinate attention enhancement module adopts grouped convolution and depth separable convolution. The attention mechanism in the detection head also adopts efficient fully connected layer and depth separable convolution. While significantly improving the detection accuracy, it maintains the computational efficiency of the model and is suitable for edge deployment scenarios with high real-time requirements, such as picking robots.

[0052] In summary, this invention significantly improves the accuracy and robustness of target detection while maintaining computational efficiency, especially demonstrating outstanding advantages in small target detection that is sensitive to spatial location and in densely occluded scenes, and has good engineering application value.

[0053] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.

Claims

1. A target detection method based on adaptive feature enhancement and minimum point distance optimization, characterized in that, include: Obtain the original image to be processed and preprocess it to fit the model input; The preprocessed original image is input into a trained object detection model to obtain object detection results, wherein the object detection model includes: The backbone network is used to extract features from the input image to obtain multi-scale feature maps; A feature pyramid structure is used to fuse the multi-scale feature maps. The feature pyramid structure integrates a coordinate attention enhancement module after at least one fusion node. The coordinate attention enhancement module is used to perform position calibration and noise suppression on the fused features and output a purified multi-scale feature map. The detection head is used to receive the purified multi-scale feature map and includes a classification branch and a regression branch set in parallel. The classification branch is embedded with a channel attention mechanism to enhance global context understanding, and the regression branch is embedded with a spatial attention mechanism to enhance bounding box localization accuracy. The post-processing module is used to process the output of the detection head to obtain the target detection result; In training the target detection model, the minimum point distance optimization loss function is used as the bounding box regression loss. The minimum point distance optimization loss function optimizes the localization accuracy by minimizing the geometric distance between the corresponding points of the predicted box and the ground truth box.

2. The target detection method based on adaptive feature enhancement and minimum point distance optimization according to claim 1, characterized in that, The feature pyramid structure cascades a coordinate attention enhancement module after each feature fusion node to perform real-time purification of the fused features, forming a multi-scale feature pyramid that is optimized step by step from deep to shallow layers.

3. The target detection method based on adaptive feature enhancement and minimum point distance optimization according to claim 2, characterized in that, The multi-scale feature map output by the backbone network is ,in This is the shallowest feature map with the highest resolution. This is the deep feature map with the lowest resolution; The feature pyramid structure integrates the coordinate attention enhancement module in the following way: deep feature map Upsampled and adjacent second-deep feature maps The features are fused to generate a first primary fused feature map. The first primary fused feature map is input into the first coordinate attention enhancement module for processing, and the first optimized feature map is output. The first optimized feature map is upsampled and then fused with the shallower feature map C3 to generate a second primary fused feature map; The second primary fused feature map is input into the second coordinate attention enhancement module for processing, and the second optimized feature map is output. Repeat the above fusion and optimization logic. The purified multi-scale feature map is output after generating optimized feature maps of all target scales sequentially along the feature pyramid construction path. .

4. The target detection method based on adaptive feature enhancement and minimum point distance optimization according to claim 1, characterized in that, The coordinate attention enhancement module performs the following processing on the input feature map: The input feature map is segmented into multiple sub-feature maps along the channel dimension; For each sub-feature map, it is processed by a first branch and a second branch set in parallel. The first branch is embedded with a coordinate attention mechanism to capture position information, and the second branch extracts local multi-scale features through depthwise separable convolution. The processing results of the first branch and the second branch are combined and fused to generate an enhanced sub-feature map; All sub-feature maps are concatenated along the channel dimension, and cross-channel information is fused through a convolutional layer to output an optimized feature map.

5. The target detection method based on adaptive feature enhancement and minimum point distance optimization according to claim 4, characterized in that, The first branch embeds a coordinate attention mechanism in the following way: For each sub-feature map, global average pooling is performed along the height and width directions respectively to generate feature codes in the height and width directions; The height direction feature encoding and the width direction feature encoding are concatenated and then processed by convolution and activation functions to generate attention weights containing positional information. The attention weights are multiplied element-wise with the corresponding sub-feature maps to achieve position calibration of the feature maps.

6. The target detection method based on adaptive feature enhancement and minimum point distance optimization according to claim 4, characterized in that, The processing results of the first branch and the second branch are subjected to feature interaction and fusion, including: The feature map of the second branch after depthwise separable convolution is multiplied element-wise with the global feature vector obtained by global average pooling of the first branch to achieve the interaction between global information and local features. The interactive feature map is fused with the original output feature map of the first branch to generate the enhanced feature corresponding to the sub-feature map.

7. The target detection method based on adaptive feature enhancement and minimum point distance optimization according to claim 4, characterized in that, The second branch uses depthwise separable convolution to extract local multi-scale features. The depthwise separable convolution includes depthwise convolution and pointwise convolution, which is used to capture local spatial structural information while maintaining computational efficiency.

8. The target detection method based on adaptive feature enhancement and minimum point distance optimization according to claim 1, characterized in that, The detection head processes the purified multi-scale feature map in the following manner: After performing basic convolutional transformations on the input feature maps, they are fed into the classification and regression branches, which are set up in parallel. In the classification branch, channel attention weights are generated through global average pooling and fully connected layers, and then multiplied channel by channel with the input feature map to obtain classification features enhanced by global context. In the regression branch, a spatial attention map is generated through depthwise separable convolution and spatial attention mechanism, and then multiplied element-wise with the input feature map to obtain the spatially enhanced regression features. The classification features and regression features are respectively input into the prediction convolutional layer to generate preliminary classification confidence and bounding box coordinates.

9. The target detection method based on adaptive feature enhancement and minimum point distance optimization according to claim 8, characterized in that, Also includes: Extract location confidence signals from the intermediate features of the regression branch; The location confidence signal is matrix-multiplied with the preliminary classification confidence output by the classification branch to dynamically adjust the classification score based on the location reliability. The adjusted classification confidence score and the bounding box coordinates of the regression branch output are used as the final output of the detection head.

10. The target detection method based on adaptive feature enhancement and minimum point distance optimization according to claim 1, characterized in that, The total loss function L during the training of the object detection model total Calculated using the following formula: , In the formula, λ1, λ2, and λ3 are preset weighting coefficients for balancing the contributions of different tasks, and L cls and L obj These are the target classification loss and the confidence loss, respectively. MPDIoU The loss for optimizing the minimum point distance is calculated using the following formula: , In the formula, IoU is the intersection-union ratio of the predicted bounding box and the ground truth bounding box. This represents the squared Euclidean distance between the center points of the predicted bounding box and the ground truth bounding box. and Let represent the squares of the difference in width between the predicted bounding box and the squares of the difference in height between the predicted bounding box and the ground truth bounding box, respectively, and let c be the diagonal length of the smallest bounding rectangle containing both the predicted bounding box and the ground truth bounding box.