Rotating target detection method and system based on phase shift coding and directional feature enhancement

By proposing a rotating target detection method based on phase-shift coding and directional feature enhancement, and utilizing an adaptive rotating convolutional network and a directional feature enhancement module, this method solves the accuracy and generalization problems of existing rotating target detection algorithms in complex backgrounds and high aspect ratio target detection, and achieves efficient and accurate rotating target detection.

CN119625281BActive Publication Date: 2025-11-11NANJING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411835313.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-11-11
Estimated Expiration
2044-12-13

AI Technical Summary

Technical Problem

Existing rotating target detection algorithms have low accuracy and poor generalization performance when detecting targets with complex backgrounds, varying orientations, dense distribution, and large aspect ratios. Furthermore, the convolution operation has limited ability to generalize to target rotation and scale changes, leading to inaccurate angle prediction and misaligned feature extraction.

Method used

A rotating target detection method based on phase-shift coding and directional feature enhancement is adopted. The target detection model is constructed by combining an adaptive rotating convolutional network (ARC network), a directional feature enhancement module (EMA module), an active rotation filter (ARF), and a rotation-invariant pooling layer with a phase-shift encoder. The Pareto optimization theory is used to adaptively weight each loss term to optimize the model parameters.

Benefits of technology

This improves the accuracy and efficiency of the model in detecting small objects in multiple directions, enhances the ability to identify target directions, ensures the robustness of the classification task, reduces the impact of target rotation, improves the continuity and accuracy of angle prediction, reduces redundant detection, and enhances the practicality and flexibility of the method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119625281B_ABST
    Figure CN119625281B_ABST
Patent Text Reader

Abstract

This invention discloses a rotating target detection method and system based on phase-shift coding and directional feature enhancement, belonging to the field of image recognition technology. The method includes: acquiring and enhancing an image dataset; inputting the dataset into an ARC network to extract features of targets in arbitrary directions; adaptively optimizing the features using an EMA module, encoding the optimized feature direction information using ARF to generate direction-sensitive features for bounding box regression, and then extracting directional features for classification using a rotation-invariant pooling layer; using a phase-shift encoder to linearly map the angle of the rotating box to the corresponding frequency phase, predicting the phase shift cosine value, and decoding to obtain the final phase; finally, applying a non-maximum suppression method to remove overlapping detection boxes and retain the best detection result. The method employs an adaptive weighted loss term based on Pareto optimization theory and updates the model parameters using a multi-gradient descent algorithm, resulting in a final model that improves the accuracy and efficiency of detecting small objects in multiple directions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image recognition technology, specifically relating to a rotating target detection method and system based on phase-shift coding and directional feature enhancement. Background Technology

[0002] Object detection is a crucial research area in computer vision. With the rapid development of computer hardware and deep learning methods, an increasing number of object detection algorithms based on deep learning have emerged, such as two-stage algorithms represented by the R-CNN series and single-stage algorithms represented by the RetinaNet and YOLO series. These algorithms have achieved great success in most natural scenes and are widely used in fields such as autonomous driving, medical image recognition, and security monitoring. However, all of these algorithms use horizontal bounding boxes (HBB) to locate objects, which often results in lower accuracy and poor generalization performance when detecting objects with complex backgrounds, varying orientations, dense distribution, and large aspect ratios.

[0003] In recent years, arbitrary-direction target detection has attracted increasing attention from the computer vision community in fields such as remote sensing image detection, scene text recognition, face detection, and retail scene detection. Currently, most rotating target detection algorithms detect rotating objects by introducing angle regression parameters to characterize the rotating bounding box.

[0004] However, regression-based angle prediction methods suffer a sharp increase in loss and discontinuity when the rotated bounding box is within the defined angle range. This leads to inconsistencies in the regression form between boundary and non-boundary cases, increasing the difficulty of model training and prediction under boundary conditions. For rotated bounding box detection, the accuracy of angle prediction is crucial; even slight angle deviations can cause a significant drop in IoU, resulting in inaccurate object detection, especially with large aspect ratios.

[0005] Secondly, since convolutional operations have limited generalization ability to target rotation and scale changes, and in applications of rotating target detection, target scale changes significantly and in various directions, it is necessary to ensure a certain degree of orientation and scale invariance during feature extraction. When dealing with densely arranged targets, especially those with large aspect ratios, it is crucial to extract rotation-invariant region features and eliminate the misalignment between region features and the target. Summary of the Invention

[0006] In view of the shortcomings of the prior art, the purpose of this invention is to provide a rotating target detection method and system based on phase shift coding and directional feature enhancement, which solves the problems in the prior art.

[0007] The objective of this invention can be achieved through the following technical solutions:

[0008] A rotating target detection method based on phase-shift coding and orientation feature enhancement includes the following steps:

[0009] Obtain the image dataset;

[0010] Data augmentation of image datasets;

[0011] The augmented image is input into the target detection model for training. The target detection model includes: an ARC network, an EMA module, an ARF, a rotation-invariant pooling layer, and a phase-shift encoder. The augmented image is input into the ARC network to extract features of targets in arbitrary directions. The EMA module performs adaptive feature optimization on the features. The ARF encodes the optimized feature orientation information to generate orientation-sensitive features for bounding box regression. The rotation-invariant pooling layer extracts orientation features from the orientation-sensitive features for classification. The phase-shift encoder linearly maps the angle of the rotated box to the phase of the corresponding frequency, predicts the phase-shift cosine value, and decodes to obtain the final phase.

[0012] The Pareto optimization theory is used to adaptively weight each loss term to construct the total loss function of the object detection model, and the object detection model parameters are updated by the multi-gradient descent algorithm.

[0013] The position, size, and rotation angle of each target are predicted using a trained target detection model, and the final phase is obtained by decoding the cosine values ​​of multiple different phase shifts.

[0014] Based on the final phase, a non-maximum suppression method is applied to remove overlapping detection boxes and retain the best detection results.

[0015] Furthermore, the ARC network includes an ARConv module and an ARC-C2f module;

[0016] The ARConv module replaces the standard 2D convolutions in the Conv module with adaptive rotational convolutions, while retaining its batch normalization layers and SiLU activation function layers.

[0017] The ARC-C2f module replaces the 3×3 convolutional modules in the bottleneck network of the C2f module with ARConv modules with convolutional kernels of the same size, while retaining the 1×1 convolutional modules for its input and output.

[0018] Furthermore, the EMA module uses a multi-scale attention structure composed of parallel branches of convolutions with two different receptive fields, and captures pixel-level attention of the input feature map without reducing the channel dimension through feature grouping and cross-scale feature fusion; for any given input features The multi-scale attention module divides X into G groups of sub-features according to the channel dimension. After the division, the input feature representation is as follows:

[0019]

[0020] In the formula, GAP w and GAP h F1 and F3 represent global average pooling on the x and y axes, respectively. F1 represents a 1×1 convolution function, F3 represents a 3×3 convolution function, and σ(·) is the Sigmoid function.

[0021] 1×1 branch output and the output of the 3×3 branch The form of expression is as follows:

[0022]

[0023] Wherein, GAP represents global average pooling across the entire plane;

[0024] The final output Y of the EMA module i for:

[0025]

[0026] Furthermore, the phase-shift encoder includes a mapping process, an encoding process, and a decoding process;

[0027] The mapping process is as follows:

[0028]

[0029] Where θ is the rotation angle of the bounding box. Its corresponding phase;

[0030] The encoding process encodes the phase into cosine values ​​with different phase shifts. The encoding formula is as follows:

[0031]

[0032] Where, x n This represents a series of cosine values ​​calculated during the encoding process, N. step This represents the number of phase shift steps.

[0033] The decoding process involves inversely deriving the phase from the cosine values ​​of multiple phase shifts. The calculation formula is as follows:

[0034]

[0035] Furthermore, the total loss function L of the object detection model is:

[0036] L=ω1L cls+ω2L box +ω3L ang

[0037]

[0038] L ang =|f p -f t |

[0039] Where ω1, ω2, ω3 are hyperparameters that adjust the loss weights of each task; L cls For classification loss, L is the binary cross-entropy loss; box For bounding box coordinate regression loss L box L ang θ is the angle loss for phase-shift coding; IOU is the intersection-over-union ratio between the predicted and ground truth boxes, (x1,y1) and (x2,y2) are the center coordinates of the predicted and ground truth boxes respectively, d is the distance between the center points of the predicted and ground truth boxes, w1,h1 and w2,h2 are the width and height of the predicted and ground truth boxes respectively, and α is a hyperparameter used to balance aspect ratio differences; f t For rotation angle θ t Encode to obtain; f p The cosine value of the predicted phase shift.

[0040] Furthermore, the process of removing overlapping detection boxes using the nonmaximum suppression method includes:

[0041] The detection boxes are sorted according to their confidence scores, and the detection box with the highest confidence score is selected as the reference box. The intersection-union ratio (IUU) of the reference box with the other detection boxes is calculated.

[0042] If the intersection-union ratio of other detection boxes with the reference box exceeds a preset threshold, they are considered to have detected the same target, and these detection boxes are suppressed. After iteration, until all detection boxes have been processed, the detection box with the highest confidence and which has not been suppressed is output as the final result.

[0043] A rotating target detection system based on phase-shift coding and orientation feature enhancement includes:

[0044] Image data acquisition unit: Acquires image datasets;

[0045] Data augmentation unit: Performs data augmentation on the image dataset;

[0046] Model Training Unit: The data-augmented image is input into the target detection model for training. The target detection model includes: ARC network, EMA module, ARF, rotation-invariant pooling layer, and phase-shift encoder. The data-augmented image is input into the ARC network to extract features of targets in arbitrary directions. The EMA module performs adaptive feature optimization on the features. The ARF encodes the optimized feature orientation information to generate orientation-sensitive features for bounding box regression. The rotation-invariant pooling layer extracts orientation features from the orientation-sensitive features for classification. The phase-shift encoder linearly maps the angle of the rotated box to the phase of the corresponding frequency, predicts the phase shift cosine value, and decodes to obtain the final phase.

[0047] Model optimization unit: Using Pareto optimization theory to adaptively weight each loss term, construct the total loss function of the object detection model, and update the object detection model parameters through a multi-gradient descent algorithm;

[0048] Phase prediction unit: It uses a trained target detection model to predict the position, size and rotation angle of each target, and decodes the final phase by predicting the cosine values ​​of multiple different phase shifts.

[0049] Detection result filtering unit: Based on the final phase, the non-maximum suppression method is applied to remove overlapping detection boxes and retain the best detection results.

[0050] A computer storage medium storing a readable program that, when the program is run, can execute the aforementioned rotating target detection method based on phase-shift coding and orientation feature enhancement.

[0051] An electronic device includes: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus;

[0052] The memory is used to store at least one executable instruction, which causes the processor to perform the operation corresponding to the rotating target detection method based on phase shift coding and orientation feature enhancement described above.

[0053] A computer program product includes computer instructions that instruct a computing device to perform operations corresponding to the aforementioned rotating target detection method based on phase-shift coding and orientation feature enhancement.

[0054] The beneficial effects of this invention are:

[0055] 1. This invention achieves feature extraction and optimization for targets in any direction by using an adaptive rotational convolutional network (ARC network) and a directional feature enhancement module, thereby improving the accuracy and efficiency of the model in detecting small objects in multiple directions.

[0056] 2. This invention utilizes a multi-scale attention module (EMA module) to adaptively optimize input features, enhancing the model's ability to capture key features while suppressing irrelevant features and improving detection accuracy.

[0057] 3. This invention encodes the optimized feature orientation information using an Active Rotation Filter (ARF) to generate orientation-sensitive features for bounding box regression, thereby enhancing the model's ability to identify target orientations and improving the accuracy of rotating target detection.

[0058] 4. This invention uses rotation-invariant pooling layers to extract orientation-invariant features from orientation-sensitive features for classification, ensuring the robustness of the classification task and reducing the impact of target rotation.

[0059] 5. This invention introduces a phase shift encoder to linearly map the angle of the rotating frame to the phase of the corresponding frequency, and obtains the final phase by predicting the cosine values ​​of multiple different phase shifts. This solves the problem of discontinuity at the boundary of the rotating frame and improves the continuity and accuracy of angle prediction.

[0060] 6. This invention applies Pareto optimization theory to adaptively weighted loss terms and updates model parameters through a multi-gradient descent algorithm, enabling the model to balance the weights of different loss functions in a multi-task learning framework and optimize the overall performance of the model.

[0061] 7. Based on the final phase, this invention applies a non-maximum suppression method to remove overlapping detection boxes, retaining the best detection results, reducing redundant detection, and improving detection efficiency.

[0062] 8. Implementing the method of the present invention through electronic devices enables rotating target detection to be deployed on various hardware platforms, enhancing the practicality and flexibility of the method. Attached Figure Description

[0063] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0064] Figure 1 This is an overall flowchart of the target detection method of the present invention;

[0065] Figure 2 This is a network structure diagram of the target detection method of the present invention;

[0066] Figure 3 This is a structural diagram of the ARC-C2f of the present invention;

[0067] Figure 4 This is a flowchart of the rotation process of the convolution kernel in this invention;

[0068] Figure 5 This is a flowchart of the reasoning process for the phase shift encoder of the present invention;

[0069] Figure 6 This is an improved regression branch diagram of the phase shift encoding of the present invention;

[0070] Figure 7 This is a visualization of the model features of the present invention;

[0071] Figure 8 This is a comparison chart of the detection results of the present invention and the baseline model. Detailed Implementation

[0072] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0073] Example 1

[0074] like Figure 1 As shown, the rotating target detection method based on phase-shift coding and orientation feature enhancement includes the following steps:

[0075] S1, Obtain the image dataset;

[0076] For the DOTA dataset, the training, validation, and test images are segmented into 1024×1024 sub-images with an overlap of 200 pixels. The segmented DOTA dataset has 15749 images in the training set, 5297 images in the validation set, and 10833 images in the test set.

[0077] For the HRSC2016 dataset, each image was scaled to 800×800 for both training and testing.

[0078] S2, perform data augmentation on the image dataset;

[0079] Data augmentation strategies included HSV augmentation, RandomFlip augmentation, and Mosaic augmentation. Mosaic augmentation was disabled during the last 10 training epochs. To ensure fairness, random rotation augmentation (RR), multi-scale training and testing (MS), and test-time data augmentation (TTA) were not used in any of the experiments.

[0080] S3, the data-augmented image is input into the target detection model for training; the target detection model includes: an adaptive rotation convolutional network (ARC network), a directional feature enhancement module, and a phase-shift encoder; the directional feature enhancement module includes: a multi-scale attention module (EMA module), an active rotation filter (ARF), and a rotation-invariant pooling layer;

[0081] The data-augmented image is input into an adaptive rotation convolutional network to extract features of targets in arbitrary directions. Then, an efficient multi-scale attention module is used to adaptively optimize these features. An active rotation filter is used to encode the orientation information of the optimized features, generating orientation-sensitive features for bounding box regression. A rotation-invariant pooling layer is then used to extract orientation features from the orientation-sensitive features for classification. A phase-shift encoder is introduced to linearly map the angle of the rotated box to the phase of the corresponding frequency, predict the phase-shift cosine value, and decode to obtain the final phase.

[0082] 1) Adaptive Rotational Convolutional Network

[0083] Because convolutional operations have limited generalization ability to target rotation and scale changes, traditional backbone feature extraction networks cannot extract high-quality features from oriented targets, resulting in severe feature misalignment. Recent works have attempted to alleviate this problem by designing Feature Alignment Modules (FAM), Feature Selection Modules (FSM), or Feature Refinement Modules (FRM). While these efforts have been effective, they only perform secondary corrections on the features extracted by the backbone network and do not truly address the inaccuracy of backbone network feature extraction. Therefore, to improve the backbone network's ability to extract features from targets in arbitrary orientations, it is necessary to use a more efficient feature extraction network (adaptive rotational convolutional network).

[0084] Adaptive rotational convolutional networks such as Figure 2 As shown in the blue dashed box below, the original YOLOv8 backbone network was reconstructed using adaptive rotational convolution, including the ARConv module and the ARC-C2f module;

[0085] The ARConv module replaces the standard 2D convolutions in the Conv module with adaptive rotational convolutions (ARC), while retaining its batch normalization layers and SiLU activation function layers.

[0086] The structural diagram of the ARC-C2f module is shown below. Figure 3 As shown, the ARC-C2f module replaces the 3×3 convolutional module in the bottleneck network of the C2f module with the ARConv module with convolutional kernels of the same size, while retaining its 1×1 convolutional modules for input and output.

[0087] In Adaptive Rotation Convolution (ARC), the convolution kernel adaptively rotates to extract target features from different orientations in different images, and a routing function is introduced to adapt to large changes in the orientation of objects in the image, enabling the network to flexibly detect objects from different orientations. ARC has n weights [W1, ..., W... n The convolution kernels are defined as follows: [C] out C in For a given input feature x, the routing function f outputs a set of rotation angles [θ1,…,θ]. n ] and their corresponding combined weights [λ1,…,λ n ], as shown below:

[0088] θ,λ=f(x)#(1)

[0089] The n convolutional kernels in the ARConv module are first rotated according to the predicted rotation angle θ = [θ1, θ2, ..., θ...]. n Rotate individually:

[0090] W′ i =Rotate(W i ;θ i ), i = 1, 2, ..., n#(2)

[0091] Where, θ i For convolution kernel W i The rotation angle, W' i The rotated convolution kernel, Rotate(·) is Figure 4 The rotation process. Figure 4 The rotation process of the 3×3 convolution kernel is shown. Figure 4 In the diagram, (a) represents the initial convolution kernel, (b) represents the mapping of the kernel in the convolution space, (c) represents adjusting the coordinate axes to adapt to the rotation, (d) represents sampling parameters from the new space, and (e) represents obtaining the rotation-adjusted convolution kernel.

[0092] A simple use of these rotation kernels is to convolve them separately with the input feature maps and then append the output feature maps together element-wise. For a given input feature x, the output feature y of the ARConv module is calculated as follows:

[0093]

[0094] x″=BN(x')

[0095]

[0096] The number of rotated convolutional kernels in ARC is controlled by the hyperparameter n. In the ARConv module, all ARC convolutional kernels have a count of 4; while in the ARC-C2f module, the number of rotated convolutional kernels in all ARC convolutional kernels is set to 1.

[0097] 2) Targeted Feature Enhancement Module

[0098] After high-quality features of targets in arbitrary directions are extracted by the backbone network and fused through the bottleneck layer, this invention proposes a directional feature enhancement module to further optimize and partition the features, providing task-differentiated features for bounding box regression and classification tasks, thereby improving the model's detection performance. The directional feature enhancement module includes: a multi-scale attention module (EMA module), an active rotation filter (ARF), and a rotation-invariant pooling layer;

[0099] An EMA module is introduced to adaptively optimize the input features. The EMA module uses a multi-scale attention structure composed of parallel branches of convolutions with two different receptive fields. It captures pixel-level attention of the input feature map without reducing channel dimensionality through feature grouping and cross-scale feature fusion, thereby enhancing important features while suppressing irrelevant features. For any given input features... EMA divides X into G sub-features according to the channel dimension. After the division, the input features can be represented in the following form:

[0100]

[0101] In the formula, GAP w and GAP h F1 and F3 represent global average pooling on the x and y axes, respectively. F1 represents a 1×1 convolution function, F3 represents a 3×3 convolution function, and σ(·) is the Sigmoid function.

[0102] Therefore, the output of the 1×1 branch and the output of the 3×3 branch It can be expressed in the following form:

[0103]

[0104] Wherein, GAP represents global average pooling across the entire plane;

[0105] The final output Y of the EMA module i It can be represented as:

[0106]

[0107] Considering cross-spatial information aggregation methods, precise location information is embedded into the EMA while modeling long-range dependencies. Fusing contextual information at different scales enables the CNN to achieve better pixel-level attention to high-level feature maps. Subsequently, by using cross-spatial learning methods, parallelizing the convolutional kernels appears to be a more robust architecture for handling both short-term and long-term dependencies. In contrast to the gradual behavior formed by finite receptive fields, parallel use of 3×3 and 1×1 convolutions in intermediate feature maps yields more contextual information.

[0108] Active rotation filters (ARFs) are used to explicitly encode the orientation information of the input features. An ARF is a k×k×N filter that actively rotates N-1 times during convolution to produce a feature map with N orientation channels, and explicitly encodes its position and orientation into a single feature map with multiple orientation channels.

[0109] Orientation-sensitive features activated by ARF are used for bounding box regression. Simultaneously, rotation-invariant pooling layers are used to aggregate these features, yielding rotation-invariant features for classification. This is achieved by selecting the direction channel with the strongest response from the orientation-sensitive features as the output feature. For a given input feature x, the output of the orientation feature enhancement module is calculated as follows:

[0110] x′=EMA(x),

[0111]

[0112] Here, EMA(·) represents the calculation process of the EMA module, which is described in detail in formulas (4) to (6). The active rotating filter F is rotated clockwise by θ i The variants obtained later, and x' (n) Filters and feature map x' (n) The nth direction channel, max(·) is the operation of taking the maximum value in the direction channel, Y cls Y is the input feature for the classification branch of the detection head. reg Input features for detecting head regression branches (including bounding box branches and phase shift branches).

[0113] 3) Phase shift encoder

[0114] The true angle of the rotating frame is linearly mapped to the phase of the corresponding frequency by using a phase shift encoder; the final phase is obtained by decoding the cosine values ​​of multiple different phase shifts. This continuous and differentiable angle encoding method solves the problem of discontinuity at the boundary of the rotating frame.

[0115] like Figure 5As shown, the core process of a phase-shift encoder consists of three parts: mapping, encoding, and decoding.

[0116] 3.1) Mapping process

[0117] A single sine or cosine value cannot be decoded because the period of a sine or cosine is 2π, and multiple angles may correspond to one period. However, the period of the angle of a rectangle is usually defined as π (in the long side representation), so a mapping is needed for matching.

[0118] φ=2θ#(9)

[0119] Where θ is the rotation angle of the bounding box, and φ is its corresponding phase. Taking the long-side representation as an example, the definition range of θ is... The range of φ is [-π, π).

[0120] 3.2) Encoding process

[0121] The encoding process encodes the phase into cosine values ​​with different phase shifts; the encoding formula is as follows:

[0122]

[0123] Where, x n This represents a series of cosine values ​​calculated during the encoding process. N step N is the number of phase shift steps, a hyperparameter that controls the encoding length. Theoretically, two phase shift steps are sufficient to determine a phase, but in practice, training instability occurs when using two phase shift steps. Therefore, three or more phase shift steps are generally chosen, i.e., N. step ≥3.

[0124] 3.3) Decoding process

[0125] The decoding process involves inversely calculating the phase from the cosine values ​​of multiple phase shifts, and the calculation formula is as follows:

[0126]

[0127] The phase-shift coding detection head regression branch of YOLO-PO is an improvement on the regression branch of the baseline model YOLOv8. The original YOLOv8 regression branch predicts a discretized representation of the offset from each position to the four sides of the bounding box in the regression feature map, and then uses the formula... After calculating the expectation, we obtain the value of (l, t, r, b), where l, t, r, and b are the offsets from the left, top, right, and bottom edges of the bounding box, respectively. We then convert these offsets to the form of the center point and dimensions, i.e., (x, y, w, h). For a feature map with coordinates (x... a ,y aThe predicted bounding box at position 'a' is transformed as follows:

[0128] x p =x a +(rl) / 2

[0129] y p =y a +(bt) / 2

[0130] w p =l+r

[0131] h p =t+b#(12)

[0132] Figure 6 In the figure, (a) and (b) represent the YOLO-PO and YOLOv8 regression branches, respectively. As can be seen from the figure, YOLO-PO adds a phase-shift regression sub-branch on the basis of the YOLOv8 regression branch, which is used to predict multi-step phase-shift cosine values. After decoding, the angle value θ of the rotating frame is obtained. p Then (l,t,r,b,θ) p The coordinates (x, y, w, h, θ) in the feature map are transformed into a rotated frame representation using the five-parameter method. a ,y a The rotation prediction box transformation method associated with position a is as follows:

[0133]

[0134] w p =l+r

[0135] h p =t+b#(13)

[0136] Where, N step The number of encoding phase shift steps, i.e., the hyperparameter controlling the encoding length, is set to 3 here. Although θ is used when transforming the output form of the bounding box. p However, during training, θ is not affected. p When calculating the loss, we do not calculate its gradient, but treat it as a constant. The angle loss is only related to the phase shift cosine value before decoding.

[0137] S4. Using Pareto optimization theory to adaptively weight each loss term, the total loss function of the object detection model is constructed, and the parameters of the object detection model are updated through a multi-gradient descent algorithm.

[0138] The process of constructing the total loss function is as follows:

[0139] S41, The orientation-sensitive features containing target position and orientation information generated by the active rotation filter are used for bounding box regression, and the bounding box coordinate regression loss L is calculated. box Orientation-invariant features are extracted using rotation-invariant pooling layers for classification, and the classification loss L is calculated. cls ;

[0140] Classification loss L cls Consistent with the classification loss of YOLOv8, BCE Loss, or Binary Cross-Entropy Loss, is used.

[0141] The regression loss is also consistent with YOLOv8, using CIOU Loss, with bounding box coordinate regression loss L. box The calculation formula is as follows:

[0142]

[0143] Where IOU is the intersection-union ratio between the predicted bounding box and the ground truth bounding box, (x1,y1) and (x2,y2) are the center coordinates of the predicted bounding box and the ground truth bounding box, respectively, d is the distance between the center points of the predicted bounding box and the ground truth bounding box, w1,h1 and w2,h2 are the width and height of the predicted bounding box and the ground truth bounding box, respectively, and α is a hyperparameter used to balance aspect ratio differences.

[0144] S42 introduces an implicit coding method, utilizing the predicted phase shift cosine value output by the phase shift regression sub-branch, and calculating the angle loss L of the phase shift coding using the encoded angle value. ang ;

[0145] Using the encoded angle values ​​for loss calculation is called implicit encoding. Conversely, directly embedding the decoding function into the feedforward network of the detection head and using angle values ​​for regression loss calculation is called explicit encoding. Implicit encoding is currently the mainstream approach for angle-encoded rotating target methods.

[0146] As shown in formula (10), the output of the encoding function is the cosine value of the phase shift, with a range of [-1, 1]. To make the training more stable, the output of the phase shift regression sub-branch is transformed:

[0147] f p = 2 × sigmoid(X feat )-1#(14)

[0148] Among them, X feat The feature map output from the last convolutional layer of the phase-shift regression sub-branch is scaled to the range [-1, 1] using the formula f. p The cosine value of the predicted phase shift.

[0149] For the truth (GT) box, its rotation angle is θ. t , for θ t Encode to obtain f t Then, the L1 Loss is used to calculate the loss for both, as shown in the following formula:

[0150] L ang =|f p -f t |#(15)

[0151] In the initial attempt to calculate the loss using explicit encoding, the loss was highly unstable during training, oscillating continuously without convergence, resulting in a significant drop in accuracy. Therefore, during training, the decoded angle value θ was... p Treat it as a constant, use it only for output transformation, and do not calculate its gradient.

[0152] S43, as Figure 2 As shown on the right, the total loss function of the object detection model is constructed by adaptively weighting the loss terms using Pareto optimization theory:

[0153] L=ω1L cls +ω2L box +ω3L ang #(16)

[0154] Where (ω1,ω2,ω3) are hyperparameters that adjust the loss weights of each task; L cls For classification loss, L box For bounding box coordinate regression loss L box L ang The angle loss is phase-shift encoded; the classification loss is consistent with YOLOv8's classification loss, using BCE Loss. The regression loss is also consistent with YOLOv8, using CIOU Loss. Angle loss L ang This is the added loss, used to optimize the phase-shift regression task.

[0155] This invention relates to a multi-objective learning framework, comprising three loss functions, {L cls L box L angThe losses vary significantly across different detection tasks. Since all detection tasks rely on the same feature extractor, this can lead to conflicts between objectives. To overcome the model parameter optimization challenge caused by this multi-objective conflict, this invention employs a multi-gradient descent optimization algorithm based on Pareto optimization theory, which combines a Pareto genetic algorithm to optimize the total loss function. The algorithm first determines the weight of each loss term, then generates a set of solutions, each corresponding to a different weight combination; these solutions constitute the Pareto front. At the Pareto front, an equilibrium point is selected to determine the weights, and then these loss terms are dynamically weighted, ultimately achieving the update and optimization of the model parameters.

[0156] S5 uses a trained target detection model to predict the position, size, and rotation angle of each target, and decodes the final phase by predicting the cosine values ​​of multiple different phase shifts.

[0157] The core of the phase-shift encoder in the object detection model can be summarized as the encoding function f(·) and the decoding function f -1 (·), the input and output of the decoding function are the opposite. Its calculation method is as follows:

[0158]

[0159] In the formula, the input to the encoding function is the angle θ, and the output is N. step The cosine value Ps of the phase shift.

[0160] Based on the final phase, a non-maximum suppression method is applied to remove overlapping detection boxes and retain the best detection results.

[0161] The detected bounding boxes are sorted according to their confidence scores. The box with the highest confidence score is then selected as the reference, and its Intersection over Union (IoU) with all other boxes is calculated. If the IoU of other boxes with the reference box exceeds a preset threshold, they are considered to have detected the same target, and these boxes are suppressed. This process is iterated until all detected boxes have been processed, and the final output is the detected box with the highest confidence score that has not been suppressed.

[0162] During the testing phase, 0.7 was used as the threshold for NMS. For each detection result, the distinction between positive and negative samples was determined by whether the IoU score between the sample and the ground truth bounding box was greater than the IoU threshold, and whether the prediction was correct or incorrect was determined by whether the predicted class matched the true class.

[0163] Based on a similar inventive concept, embodiments of the present invention also provide a computer storage medium storing a readable program that, when the program is run, can execute the above-described rotating target detection method based on phase-shift coding and directional feature enhancement.

[0164] Based on a similar inventive concept, this invention provides an electronic device, including: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus;

[0165] The memory is used to store at least one executable instruction, which causes the processor to perform the operation corresponding to the rotating target detection method based on phase shift coding and orientation feature enhancement described above.

[0166] Based on a similar inventive concept, embodiments of the present invention also provide a computer program product, including computer instructions, which instruct a computing device to perform the operations corresponding to the above-described rotating target detection method based on phase-shift coding and directional feature enhancement.

[0167] Example 2

[0168] In this embodiment, in order to verify the effectiveness of the target detection method of the present invention, it is tested and verified.

[0169] The verification process is as follows:

[0170] 1. Dataset preparation: Select the DOTA and HRSC2016 datasets, which contain targets of various orientations and sizes, making them suitable for evaluating rotating target detection algorithms.

[0171] 2. Preprocessing: Standardize the dataset by performing preprocessing, including image scaling, normalization, and data augmentation, to match the data processing flow during the training phase.

[0172] 3. Model Loading: Load the trained YOLO-PO model, which includes a directional feature enhancement module and key components such as a phase-shift encoder.

[0173] 4. Feature Map Visualization: To verify the effectiveness of the targeted feature enhancement module, feature maps of the baseline model and the YOLO-PO model are generated and visualized. The response strength of both models at the target detection location is observed and compared.

[0174] 5. Object detection execution: Input the preprocessed test data into the YOLO-PO model, perform object detection, and collect the prediction results output by the model.

[0175] 6. Non-maximum suppression: Apply the non-maximum suppression (NMS) step to remove overlapping detection boxes and retain the best detection results.

[0176] 7. Performance Evaluation: The detection performance of the YOLO-PO model is quantitatively evaluated using evaluation metrics such as mean average accuracy (mAP).

[0177] 8. Visualization of Detection Results: Displays a comparison of the detection results of the YOLO-PO model and the baseline model for the same image. Analyzes and demonstrates the advantages of the YOLO-PO model in small target recall and rotation angle prediction accuracy.

[0178] 9. Ablation Study: Conduct ablation experiments to separately evaluate the impact of the directional feature enhancement module and phase-shift encoder on model performance. Based on the comprehensive test results, analyze the performance of the YOLO-PO model in different scenarios to verify its effectiveness and superiority.

[0179] To more intuitively illustrate the effectiveness of the targeted feature enhancement module, Figure 7 This paper compares the feature map visualization results between the baseline model and the model using the targeted feature augmentation module. The upper layer shows the feature map visualization result of the baseline model, and the lower layer shows the feature map visualization result of the model using the targeted feature augmentation module. Figure 7 It can be seen that, compared with the baseline model, the feature map of the model using targeted feature enhancement has a stronger response at the target detection location, which obviously helps to improve the detection accuracy of the model.

[0180] Furthermore, to more intuitively illustrate the effectiveness and superiority of the present invention, in Figure 8 The detection results of the YOLO-PO model and the baseline model for the same image were compared. Figure 8 As can be seen, the YOLO-PO model not only has a higher recall rate for small targets, but also predicts the rotation angle of the target bounding box more accurately.

[0181] Example 3

[0182] Based on the target detection method proposed in Example 1, this example proposes a rotating target detection system based on phase-shift coding and directional feature enhancement, specifically including:

[0183] Image data acquisition unit: Acquires image datasets;

[0184] Data augmentation unit: Performs data augmentation on the image dataset;

[0185] Model training unit: The data-augmented image is input into the object detection model for training; the object detection model includes: an adaptive rotation convolutional network, a directional feature enhancement module, and a phase-shift encoder; the directional feature enhancement module includes: a multi-scale attention module, an active rotation filter, and a rotation-invariant pooling layer;

[0186] Model optimization unit: Using Pareto optimization theory to adaptively weight each loss term, construct the total loss function of the object detection model, and update the object detection model parameters through a multi-gradient descent algorithm;

[0187] Phase prediction unit: It uses the position, size and rotation angle of each target predicted in the trained target detection model, and decodes the final phase by predicting the cosine values ​​of multiple different phase shifts;

[0188] Detection result filtering unit: Based on the final phase, the non-maximum suppression method is applied to remove overlapping detection boxes and retain the best detection results.

[0189] The methods of the present invention can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code originally stored on a remote recording medium or a non-transitory machine-readable medium and subsequently stored on a local recording medium, downloaded via a network. Thus, the methods described herein can be processed by software stored on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an ASIC or FPGA). It is understood that the computer, processor, microprocessor controller, or programmable hardware includes storage components (e.g., RAM, ROM, flash memory, etc.) capable of storing or receiving software or computer code that, when accessed and executed by the computer, processor, or hardware, implements the methods described herein. Furthermore, when a general-purpose computer accesses the code used to implement the methods shown herein, the execution of the code transforms the general-purpose computer into a dedicated computer for performing the methods shown herein.

[0190] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention.

Claims

1. A rotating target detection method based on phase-shift coding and directional feature enhancement, characterized in that, Includes the following steps: Obtain the image dataset; Data augmentation of image datasets; The data-augmented image is input into the target detection model for training; The object detection model includes: an adaptive rotation convolutional network (ARC), a multi-scale attention module (EMA), an active rotation filter (ARF), a rotation-invariant pooling layer, and a phase-shift encoder. The augmented image is input to the ARC to extract features of targets in any orientation. The EMA performs adaptive feature optimization on these features. The ARF encodes the optimized feature orientation information to generate orientation-sensitive features for bounding box regression. The rotation-invariant pooling layer extracts directional features from the orientation-sensitive features for classification. The phase-shift encoder linearly maps the angle of the rotated box to the corresponding frequency phase, predicts the phase-shift cosine value, and decodes to obtain the final phase. The Pareto optimization theory is used to adaptively weight each loss term to construct the total loss function of the object detection model, and the object detection model parameters are updated by the multi-gradient descent algorithm. The position, size, and rotation angle of each target are predicted using a trained target detection model, and the final phase is obtained by decoding the cosine values ​​of multiple different phase shifts. Based on the final phase, a non-maximum suppression method is applied to remove overlapping detection boxes and retain the best detection results; The ARC network includes an ARConv module and an ARC-C2f module; The ARConv module replaces the standard 2D convolutions in the Conv module with adaptive rotational convolutions, while retaining its batch normalization layers and SiLU activation function layers. The ARC-C2f module replaces the 3×3 convolutional modules in the bottleneck network of the C2f module with ARConv modules with convolutional kernels of the same size, while retaining the 1×1 convolutional modules for its input and output. The EMA module uses a multi-scale attention structure composed of parallel branches of convolutions with two different receptive fields, and captures pixel-level attention of the input feature map without reducing the channel dimension through feature grouping and cross-scale feature fusion; for any given input features The multi-scale attention module divides X into G groups of sub-features according to the channel dimension. After the division, the input feature representation is as follows: In the formula, GAP w and GAP h F1 and F3 represent global average pooling on the x and y axes, respectively. F1 represents a 1×1 convolution function, F3 represents a 3×3 convolution function, and σ(·) is the Sigmoid function. 1×1 branch output and the output of the 3×3 branch The form of expression is as follows: Wherein, GAP represents global average pooling across the entire plane; The final output Y of the EMA module i for:

2. The rotating target detection method based on phase-shift coding and directional feature enhancement according to claim 1, characterized in that, The phase-shift encoder includes a mapping process, an encoding process, and a decoding process; The mapping process is as follows: Where θ is the rotation angle of the bounding box. Its corresponding phase; The encoding process encodes the phase into cosine values ​​with different phase shifts. The encoding formula is as follows: Where, x n This represents a series of cosine values ​​calculated during the encoding process, N. step This represents the number of phase shift steps. The decoding process involves inversely deriving the phase from the cosine values ​​of multiple phase shifts. The calculation formula is as follows:

3. The rotating target detection method based on phase-shift coding and directional feature enhancement according to claim 1, characterized in that, The total loss function L of the object detection model is: L=ω1L cls +ω2L box +ω3L ang L ang =|f p -f t | Where ω1, ω2, ω3 are hyperparameters that adjust the loss weights of each task; L cls For classification loss, L is the binary cross-entropy loss; box For bounding box coordinate regression loss L box L ang θ is the angle loss for phase-shift coding; IOU is the intersection-over-union ratio between the predicted and ground truth boxes, (x1,y1) and (x2,y2) are the center coordinates of the predicted and ground truth boxes respectively, d is the distance between the center points of the predicted and ground truth boxes, w1,h1 and w2,h2 are the width and height of the predicted and ground truth boxes respectively, and α is a hyperparameter used to balance aspect ratio differences; f t For rotation angle θ t Encode to obtain; f p The cosine value of the predicted phase shift.

4. The rotating target detection method based on phase-shift coding and directional feature enhancement according to claim 1, characterized in that, The process of removing overlapping detection boxes using the nonmaximum suppression method includes: The detection boxes are sorted according to their confidence scores, and the detection box with the highest confidence score is selected as the reference box. The intersection-union ratio (IUU) of the reference box with the other detection boxes is calculated. If the intersection-union ratio of other detection boxes with the reference box exceeds a preset threshold, they are considered to have detected the same target, and these detection boxes are suppressed. After iteration, until all detection boxes have been processed, the detection box with the highest confidence and which has not been suppressed is output as the final result.

5. A rotating target detection system based on phase-shift coding and directional feature enhancement, performing the detection method according to any one of claims 1-4, characterized in that, include: Image data acquisition unit: Acquires image datasets; Data augmentation unit: Performs data augmentation on the image dataset; Model training unit: The data-augmented image is input into the target detection model for training; The target detection model includes: an ARC network, an EMA module, an ARF, a rotation-invariant pooling layer, and a phase-shift encoder. The augmented image is input into the ARC network to extract features of targets in any orientation. The EMA module performs adaptive feature optimization on the features. The ARF encodes the optimized feature orientation information to generate orientation-sensitive features for bounding box regression. The rotation-invariant pooling layer extracts directional features from the orientation-sensitive features for classification. The phase-shift encoder linearly maps the angle of the rotated box to the corresponding frequency phase, predicts the phase-shift cosine value, and decodes to obtain the final phase. Model optimization unit: Using Pareto optimization theory to adaptively weight each loss term, construct the total loss function of the object detection model, and update the object detection model parameters through a multi-gradient descent algorithm; Phase prediction unit: It uses a trained target detection model to predict the position, size and rotation angle of each target, and decodes the final phase by predicting the cosine values ​​of multiple different phase shifts. Detection result filtering unit: Based on the final phase, the non-maximum suppression method is applied to remove overlapping detection boxes and retain the best detection results.

6. A computer storage medium storing a readable program, characterized in that, When the program runs, it can execute the rotating target detection method based on phase shift coding and orientation feature enhancement as described in any one of claims 1-4.

7. An electronic device, characterized in that, include: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction, which causes the processor to perform the operation corresponding to the rotating target detection method based on phase shift coding and orientation feature enhancement as described in any one of claims 1-4.

8. A computer program product comprising computer instructions, characterized in that, The computer instructions instruct the computing device to perform the operations corresponding to the rotating target detection method based on phase shift coding and orientation feature enhancement as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Remote sensing ship target detection method based on deformation attention pyramid

    CN115115601A

  • Ocean ship directed detection method and system

    CN118134870A