Aircraft rotating frame detection method and system based on cyclic angle coding
By using the method of cyclic angle encoding and rotation constraint, the problems of angle misalignment and accuracy degradation in aircraft rotation frame detection are solved, and a more accurate rotation frame detection effect is achieved.
Patent Information
- Application Number
- CN202510782877.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-09-16
AI Technical Summary
Existing methods have difficulty in accurately detecting rotating frames of aircraft in visible light remote sensing images. In particular, the accuracy drops significantly when dealing with dense small targets and targets with extreme aspect ratios, and there is a problem of misalignment between the feature space and the rotation angle.
A method based on cyclic angle coding is used to encode the angle domain and generate cyclic angle coding values. The target angle coding values are generated by the initial angle coding values and the residual coding values, and are decoded into target angle values. Feature extraction is performed in combination with rotation constraints, and the DETR neural network model is used for training and adjustment.
A topologically strictly isomorphic encoding space is achieved, which avoids boundary breakage problems, improves the accuracy of aircraft rotation frame detection and feature space alignment capabilities, and significantly improves the accuracy of angle estimation.
Smart Images

Figure CN120655984A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and more specifically, to a method and system for detecting an aircraft rotation frame based on cyclic angle coding. Background Art
[0002] In the task of object detection in visible light remote sensing images, it is necessary to detect the rotated frame of aerial vehicles. For example, regression- or classification-based rotated target detection methods perform rotated frame detection on aerial vehicles. However, existing methods struggle to achieve an effective balance between the continuity of angle representation, computational efficiency, and geometric constraint preservation. In particular, accuracy drops significantly when dealing with densely packed small targets or targets with extreme aspect ratios. Furthermore, existing rotated target detection methods generally suffer from the inherent defect of misalignment between feature space and rotation angle. This feature misalignment problem is particularly prominent for targets with large aspect ratio differences and densely packed targets, severely restricting the accuracy of angle estimation.
[0003] In summary, how to accurately perform rotating frame detection on an aircraft is a problem that currently needs to be solved urgently by those skilled in the art. Summary of the Invention
[0004] The purpose of this application is to provide a method for detecting an aircraft's rotating frame based on cyclic angle coding, which can, to a certain extent, solve the technical problem of how to accurately detect an aircraft's rotating frame. This application also provides a system for detecting an aircraft's rotating frame based on cyclic angle coding.
[0005] In order to achieve the above objectives, this application provides the following technical solutions:
[0006] A method for detecting an aircraft rotation frame based on cyclic angle coding, comprising:
[0007] Acquire a target image of the aircraft to be detected;
[0008] Performing cyclic angle coding on the angle domain to obtain a cyclic angle coding value;
[0009] Performing angle prediction on the target image based on the cyclic angle code value to obtain an initial angle code value and an angle residual code value of the aircraft to be detected;
[0010] Generate a target angle code value of the aircraft to be detected according to the initial angle code value and the angle residual code value;
[0011] Decoding the target angle encoded value into a target angle value;
[0012] A sampling frame is rotationally constrained based on the target angle value to obtain a target frame, so as to perform feature extraction on the target image based on the target frame.
[0013] In an exemplary embodiment, performing cyclic angle encoding on the angle field to obtain a cyclic angle encoding value includes:
[0014] Determine the encoding length value;
[0015] Dividing the angle domain into interval angles corresponding to the encoding length values, and determining an interval index value for each interval angle;
[0016] Convert the interval index value to obtain a standard binary code with a number of bits equal to the code length value;
[0017] The straight binary is mapped into a cyclic angle encoded value.
[0018] In an exemplary embodiment, mapping the straight binary value to a cyclic angle coded value comprises:
[0019] Shifting the standard binary code right by one bit and padding the high bit with zero to obtain a right-shifted binary code;
[0020] Perform bit-by-bit XOR on the standard binary code and the right-shifted binary code to obtain a cyclic angle code value.
[0021] In an exemplary embodiment, determining the interval index value of each interval angle includes:
[0022] Determine the interval index value of each interval angle through the interval index value generation formula;
[0023] The interval index value generation formula includes:
[0024] ;
[0025] in, Represents the interval index value; Indicates the interval angle; Indicates the encoding length value; Indicates rounding down.
[0026] In an exemplary embodiment, converting the interval index value to obtain a standard binary code having a number of bits equal to the code length value includes:
[0027] Convert the interval index value using a conversion formula to obtain a standard binary code with the same number of bits as the code length value;
[0028] The conversion formula includes:
[0029] ; ;
[0030] in, Indicates the encoding length; represents the standard binary code; Represents the modulo operation.
[0031] In an exemplary embodiment, generating the target angle code value of the aircraft to be detected according to the initial angle code value and the angle residual code value includes:
[0032] Get the set weight value;
[0033] Multiplying the angle residual encoding value by the set weight value to obtain an angle residual calculation value;
[0034] The sum of the initial angle code value and the angle residual calculation value is determined as the target angle code value of the aircraft to be detected.
[0035] In an exemplary embodiment, performing a rotation constraint on the sampling frame based on the target angle value to obtain a target frame includes:
[0036] The sampling frame is subjected to rotation constraint based on the target angle value by a rotation constraint formula to obtain a target frame;
[0037] The rotation constraint formula includes:
[0038] ;
[0039] in, Information representing the target frame; Represents query input features; express location; Input features representing keys and values; Indicates the number of the attention head; represents the total number of attention heads; Indicates the number of the sampling point in the sampling frame; Indicates the total number of sampling points; represents the weight matrix; represents the weight matrix; represents the attention weight; Indicates the In the attention head The query of sampling points can learn the sampling offset; Represents the rotation constraint matrix.
[0040] In an exemplary embodiment, before acquiring the target image of the aircraft to be detected, the method further includes:
[0041] Get training images;
[0042] Marking a training frame of the training image;
[0043] Training an initial DETR neural network model based on the training image and the training frame;
[0044] Generate the loss value of the DETR neural network model;
[0045] The DETR neural network model is adjusted based on the loss value to obtain a trained DETR neural network model, and the target image is processed based on the trained DETR neural network model to obtain the target frame.
[0046] In an exemplary embodiment, generating a loss value of the DETR neural network model includes:
[0047] Generate the loss value of the DETR neural network model through the loss function generation formula;
[0048] The loss function generation formula includes:
[0049] ;
[0050] ;
[0051] ;
[0052] in, represents the loss value; Indicates setting weight value; represents the coding loss; Represents the predicted coding value output by the DETR neural network model; represents the true coded value; Indicates setting weight value; represents the regression loss; represents the continuous angle estimate decoded from the predictive coded value; Represents a continuous angle value decoded from a true encoded value.
[0053] An aircraft rotation frame detection system based on cyclic angle coding, comprising:
[0054] A target image acquisition module is used to acquire a target image of the aircraft to be detected;
[0055] A cyclic encoding module, used for performing cyclic angle encoding on the angle domain to obtain a cyclic angle encoding value;
[0056] An angle prediction module, configured to perform angle prediction on the target image based on the cyclic angle code value to obtain an initial angle code value and an angle residual code value of the aircraft to be detected;
[0057] An angle generating module, configured to generate a target angle code value of the aircraft to be detected according to the angle initial code value and the angle residual code value;
[0058] A decoding module, configured to decode the target angle code value into a target angle value;
[0059] The target frame detection module is used to perform rotation constraints on the sampling frame based on the target angle value to obtain a target frame, so as to perform feature extraction on the target image based on the target frame.
[0060] The present application provides a method for detecting an aircraft rotation frame based on cyclic angle coding, which obtains a target image of an aircraft to be detected; performs cyclic angle coding on an angle domain to obtain a cyclic angle coding value; performs angle prediction on the target image based on the cyclic angle coding value to obtain an initial angle coding value and an angle residual coding value of the aircraft to be detected; generates a target angle coding value of the aircraft to be detected based on the initial angle coding value and the angle residual coding value; decodes the target angle coding value into a target angle value; and performs rotation constraint on a sampling frame based on the target angle value to obtain a target frame, so as to perform feature extraction on the target image based on the target frame. In the present application, the angle domain is encoded as a cyclic angle encoding value, which can satisfy the angle adjacent continuity and has the end-to-end closure. This feature makes the encoding space strictly isomorphic with the physical angle space in topological structure, avoiding the boundary break problem caused by the discretization method; and the angle residual between the current predicted value and the true value is predicted and the target angle encoding value is corrected based on this, which can ensure the accuracy of the target angle encoding value; finally, the target angle value decoded from the target angle encoding value is integrated into the rotation constraint, which can improve the feature space alignment accuracy when the aircraft rotates, thereby more accurately detecting the rotation frame of the aircraft. The aircraft rotation frame detection system based on cyclic angle encoding provided by the present application also solves the corresponding technical problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0062] Figure 1 A flowchart of a method for detecting an aircraft rotation frame based on cyclic angle coding provided in an embodiment of the present application;
[0063] Figure 2 This is a schematic diagram for comparing angle encoding effects;
[0064] Figure 3 Schematic diagram of the cyclic angle encoding method;
[0065] Figure 4 This is a schematic diagram of the rotation constraint effect;
[0066] Figure 5 This is the overall framework diagram of the visible light aerial vehicle rotating target detection model;
[0067] Figure 6 This is a schematic diagram of the angle prediction process;
[0068] Figure 7 A schematic diagram of the structure of an aircraft rotation frame detection system based on cyclic angle coding provided in an embodiment of the present application;
[0069] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0070] Figure 9 Another structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0071] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0072] See also Figure 1 , Figure 1 A flowchart of a method for detecting an aircraft rotation frame based on cyclic angle coding is provided in an embodiment of the present application.
[0073] An embodiment of the present application provides a method for detecting an aircraft rotation frame based on cyclic angle coding, which may include the following steps:
[0074] Step S101: Acquire a target image of an aircraft to be detected.
[0075] In practical applications, a target image of the aircraft to be classified can be obtained first. The target image can be an image of an aircraft in flight. The format, size, and aircraft type of the target image can be determined based on the application scenario. For example, the aircraft can be an airplane or a drone.
[0076] In an exemplary embodiment, in the process of obtaining a target image of an aircraft to be detected, an initial image of the aircraft to be detected can be obtained first, and then feature extraction is performed on the initial image to obtain a target image, so that the features in the aircraft image are exposed through feature extraction, which facilitates subsequent processing of the target image.
[0077] Step S102: performing cyclic angle coding on the angle domain to obtain a cyclic angle coding value.
[0078] In practical applications, when detecting rotating frames of aircraft, the angle domain needs to be encoded to quickly process the angles. In this process, the angle domain can be encoded with the help of one-hot encoding. By mapping each category to an orthogonal basis vector in the dimensional space, that is, a binary vector with a single position of 1 and the rest of the positions of 0, the false order relationship between categories is effectively eliminated, ensuring that the machine learning model processes the classification features fairly. However, Figure 2 As shown in the figure, one-hot encoding has limitations in the representation of continuous annular data, such as angles and azimuths, such as boundary discontinuity, geometric distortion, and sensitivity to quantization errors. Boundary discontinuity refers to the first and last angles, such as 0° and 359° are modeled as mutually exclusive categories in the encoding space, which violates the physical continuity in reality; geometric distortion refers to the inability of Euclidean distance to reflect the periodic characteristics of the angle space, such as 10° and 350° are actually 20° apart, but the linear distance is 340°; sensitivity to quantization errors refers to the loss of angular resolution caused by the discretization process, which is difficult to compensate by conventional classification losses; therefore, one-hot encoding is not suitable for rotating frame detection of aircraft. In order to avoid the limitations of one-hot encoding, considering that cyclic angular encoding (CAE) embeds the continuous angle space into a binary encoding space with periodic symmetry through a dual mapping mechanism, as shown in the figure. Figure 3 As shown, the geometric constraints can be explicitly encoded into the feature representation while retaining the classification learning advantages of the deep learning model. Therefore, this application performs cyclic angle encoding on the angle domain to obtain cyclic angle encoding values, so that the rotation frame detection of the aircraft can be performed based on the cyclic angle encoding values.
[0079] In an exemplary embodiment, the angle domain is cyclically encoded, and in the process of obtaining the cyclic angle encoding value, the encoding length value can be determined; the angle domain is divided into interval angles corresponding to the encoding length value, for example, the angle domain [0°, 360°) is evenly divided into intervals, Represents the code length value and determines the interval index value of each interval angle; converts the interval index value to obtain a standard binary code with the number of bits of the code length value; then maps the standard binary code to a cyclic angle code value, for example, shifts the standard binary code right by one bit and fills the high bit with zero to obtain a right-shifted binary code, performs bit-by-bit XOR on the standard binary code and the right-shifted binary code to obtain a cyclic angle code value, which can be expressed as , the encoding satisfies the following properties: This property ensures that adjacent angle codes differ by only one bit, and that both the first and last codes, k=N and k=0, maintain cyclic continuity. This property ensures that the coding space is strictly topologically isomorphic to the physical angle space, fundamentally avoiding the boundary breakage problem caused by traditional discretization methods. Furthermore, by adjusting the code length, a dynamic trade-off between angular resolution and computational complexity can be achieved, providing flexible options for engineering deployments under varying computing resource constraints.
[0080] In specific application scenarios, the interval index value of each interval angle can be determined through binary search, that is, the interval index value of each interval angle can be determined through the interval index value generation formula; the interval index value generation formula includes:
[0081] ;
[0082] in, Represents the interval index value; Indicates the interval angle; Indicates the encoding length value; In this way, the operation converts the regression problem into a multi-classification problem. The angular resolution can be controlled by the encoding length value. For example, when the encoding length value is 8, the resolution is .
[0083] In a specific application scenario, in the process of converting the interval index value to obtain a standard binary code whose number of bits is the code length value, the interval index value can be converted by a conversion formula to obtain a standard binary code whose number of bits is the code length value;
[0084] The conversion formula includes:
[0085] ; ;
[0086] in, Indicates the encoding length; Represents standard binary encoding; Represents the modulo operation.
[0087] Step S103: performing angle prediction on the target image based on the cyclic angle code value to obtain the angle initial code value and angle residual code value of the aircraft to be detected.
[0088] Step S104: Generate a target angle code value of the aircraft to be detected according to the initial angle code value and the angle residual code value.
[0089] In practical applications, after obtaining the target image and cyclic angle encoding values, if the rotation angle is directly predicted, the following problems will occur: First, there is periodic error. The model may confuse the angle boundaries. For example, predicting 355° when the actual value is 5°, the absolute error is 10°, but it will be penalized as 350° in the loss function. Second, prediction instability. When the angle is predicted as a continuous value, the loss function is sensitive to small errors, which can easily lead to training oscillations. To avoid these problems, the angle of the target image can be predicted based on the cyclic angle encoding values to obtain the initial angle encoding value and angle residual encoding value of the aircraft to be detected. Based on the initial angle encoding value and the angle residual encoding value, the target angle encoding value of the aircraft to be detected is generated to improve the angle prediction capability.
[0090] In an exemplary embodiment, in the process of generating the target angle code value of the aircraft to be detected according to the initial angle code value and the angle residual code value, a set weight value can be obtained; the angle residual code value and the set weight value are multiplied to obtain the angle residual operation value; the sum of the initial angle code value and the angle residual operation value is determined as the target angle code value of the aircraft to be detected, that is, , Indicates the target angle encoding value, Indicates the initial encoding value of the angle, Indicates setting weight value, Represents the angle residual encoding value.
[0091] Step S105: Decode the target angle code value into a target angle value.
[0092] Step S105: performing rotation constraints on the sampling frame based on the target angle value to obtain a target frame, so as to perform feature extraction on the target image based on the target frame.
[0093] In practical applications, to better incorporate angle information into the detection process of a rotated frame and ensure alignment of features with sampling points, the target angle encoding value can be decoded into a target angle value. The sampling frame is then rotated based on the target angle value to obtain a target frame, which can then be used to extract features from the target image. This allows feature sampling to be restricted to the rotated local coordinate system, effectively enhancing feature alignment capabilities for directionally sensitive targets.
[0094] In an exemplary embodiment, in the process of performing rotation constraint on the sampling frame based on the target angle value to obtain the target frame, the rotation constraint formula can be used to perform rotation constraint on the sampling frame based on the target angle value to obtain the target frame;
[0095] The rotation constraint formula includes:
[0096] ;
[0097] in, Information representing the target box; Represents query input features; express location; Input features representing keys and values; Indicates the number of the attention head; represents the total number of attention heads; Indicates the number of the sampling point in the sampling frame; Indicates the total number of sampling points; represents the weight matrix; represents the weight matrix; Represents the attention weight, the value range can be [0,1], and the sum after normalization is 1; Indicates the In the attention head The query of sampling points can learn the sampling offset; Represents the rotation constraint matrix, which can be calculated as: .
[0098] It should be noted that the core of this embodiment is to embed angle information into the attention module and construct a rotation-constrained sampling mechanism. In this way, the feature sampling area is constrained by rigid rotation transformation. While achieving spatial alignment, the angle prediction is implicitly integrated into the rotation box detection, thereby improving the feature space alignment accuracy of rotation-sensitive targets such as airplanes. Figure 4 This integration has two advantages: first, it guides feature sampling by rotation constraints, enhancing adaptability to angle changes; second, it leverages the parameter sharing mechanism of the existing attention module, eliminating the need for additional network modules or complex structural adjustments. This embodiment improves the ability to process rotated data while effectively maintaining the simplicity and computational efficiency of the method.
[0099] The present application provides a method for detecting an aircraft rotation frame based on cyclic angle coding, which obtains a target image of an aircraft to be detected; performs cyclic angle coding on an angle domain to obtain a cyclic angle coding value; performs angle prediction on the target image based on the cyclic angle coding value to obtain an initial angle coding value and an angle residual coding value of the aircraft to be detected; generates a target angle coding value of the aircraft to be detected based on the initial angle coding value and the angle residual coding value; decodes the target angle coding value into a target angle value; and performs rotation constraint on a sampling frame based on the target angle value to obtain a target frame, so as to perform feature extraction on the target image based on the target frame. In this application, the angle domain is encoded as a cyclic angle encoding value, which can meet the angle adjacent continuity and has the end-to-end closure. This feature makes the encoding space strictly isomorphic with the physical angle space in topological structure, avoiding the boundary break problem caused by the discretization method; and the angle residual between the current predicted value and the true value is predicted and the target angle encoding value is corrected based on this, which can ensure the accuracy of the target angle encoding value; finally, the target angle value decoded from the target angle encoding value is integrated into the rotation constraint, which can improve the feature space alignment accuracy when the aircraft rotates, thereby more accurately detecting the rotating frame of the aircraft.
[0100] On the basis of the aircraft rotation frame detection method based on cyclic angle encoding provided in the above embodiment, the present application scheme can also be executed through a neural network model, for example, the present application scheme can be executed through a DETR neural network model. This process is as follows Figure 5 As shown, that is, the multi-scale feature map of the initial image is extracted through the Transformer-based backbone network to obtain the target image; the angle domain is cyclically encoded through the DETR neural network model to obtain a cyclic angle encoding value; the angle of the target image is predicted based on the cyclic angle encoding value through the DETR neural network model to obtain the angle initial encoding value and the angle residual encoding value of the aircraft to be detected, and the target angle encoding value of the aircraft to be detected is generated according to the angle initial encoding value and the angle residual encoding value; the target angle encoding value is decoded into the target angle value through the DETR neural network model, and the sampling frame is rotationally constrained based on the target angle value to obtain the target frame, so as to extract features of the target image based on the target frame.
[0101] In an exemplary embodiment, the angle of the target image is predicted based on the cyclic angle code value through the DETR neural network model to obtain the angle initial code value and the angle residual code value of the aircraft to be detected, and the target angle code value of the aircraft to be detected is generated according to the angle initial code value and the angle residual code value. The target angle code value is decoded into the target angle value through the DETR neural network model, and the sampling frame is rotationally constrained based on the target angle value. In the process of obtaining the target frame, the rotation perception capability can be deeply embedded in the feature representation space through the angle-aware enhancement module (AAEM), such as Figure 6 As shown, the module consists of two parts: the angle prediction network and the rotation constraint unit. The angle prediction network adopts a lightweight fully connected architecture and predicts the angle encoding through a three-layer fully connected neural network. Its mathematical expression is ,in, is the input feature, The cyclic angle encoding prediction value output by the angle prediction network has a length of Afterwards, an angle residual prediction branch is added after each transformer block. The final angle is obtained by adding the initial coarse prediction value and the corrected angle residual. The rotation constraint unit is used to integrate the angle information into the deformable attention mechanism to generate the target box to extract the rotation alignment feature.
[0102] In specific application scenarios, the cyclic angle encoding method not only provides flexibility in adjusting the accuracy, but also solves the problem of discontinuous angle boundaries. However, since coding loss is inevitably introduced in the encoding process, in order to solve the quantization error and boundary effect in the encoding process, a dual-structure composite angle loss function is provided to supplement the coding loss and guide the training process to converge faster, that is, before obtaining the target image of the aircraft to be detected, a training image can also be obtained; the training frame of the training image is marked; the initial DETR neural network model is trained based on the training image and the training frame; the loss value of the DETR neural network model is generated, such as by generating a formula through a loss function to generate the loss value of the DETR neural network model; the DETR neural network model is adjusted based on the loss value to obtain a trained DETR neural network model, and the target image is processed based on the trained DETR neural network model to obtain a target frame;
[0103] Among them, the loss function generation formula includes:
[0104] ;
[0105] ;
[0106] ;
[0107] Indicates the loss value; Indicates setting weight value; represents the encoding loss, which forces the model to learn the ring topology in the encoding space, so that the model can better understand the actual physical situation of the angle; Represents the predicted coding value output by the DETR neural network model; represents the true coded value; Indicates setting weight value; Represents the regression loss, using the periodically corrected smooth L1 loss to eliminate the boundary mutation of the angle difference and the loss error caused by the encoding process; represents the continuous angle estimate decoded from the predictive coded value; Represents a continuous angle value decoded from a true encoded value.
[0108] It should be noted that in the loss function provided by this application, the coding loss constrains the discrete coding space and uses the normalized difference metric to predict the matching degree between the cyclic binary code and the real code; the angle regression loss anchors the continuous angle space and directly calculates the absolute deviation between the predicted angle and the real value, especially at the 360° cycle boundary, such as the numerical mutation scene of 359° and 1°, and corrects the discrete error in the coding space through continuous numerical gradients. The coupling effect of the two forms a two-way feedback, that is, the coding loss drives the model to capture the discrete pattern characteristics of the angle distribution, and the regression loss forces the geometric consistency of the continuous angle space to be maintained. Through complementary optimization, the information dissipation in the angle representation conversion is significantly reduced, and finally a dynamic balance between coding accuracy and numerical accuracy is achieved.
[0109] In specific application scenarios, It can be expressed as:
[0110] ;
[0111] represents the predicted value, Represents the true value; of course, there may be other determination methods, which are not specifically limited in this application.
[0112] It's also worth noting that DETR (Detection Transformer) is an end-to-end Transformer-based object detection model. The DETR model eliminates some of the manual design and post-processing steps in the traditional object detection pipeline, such as anchor generation and non-maximum suppression (NMS). By treating the object detection problem as a collective prediction problem, DETR achieves an end-to-end detection process. The DETR algorithm mainly includes the following key steps:
[0113] 1) Feature Extraction: The input image is first passed through a convolutional neural network (CNN) backbone for feature extraction. This is usually a pre-trained model such as ResNet, which is used to generate a low-dimensional feature representation of the image.
[0114] 2) Position encoding: The extracted feature map will be position-encoded. This step is to allow the model to take into account the position information of the pixels in the image.
[0115] 3) Transformer Encoder: The feature map is flattened and passed through a Transformer Encoder. The Encoder uses a self-attention mechanism to encode global context information so that each pixel can take into account other pixels in the image.
[0116] 4) Transformer Decoder: The Decoder receives the output from the Encoder and a set of learnable Object Queries. These Queries serve as input to the Decoder to generate predictions for the target object.
[0117] 5) Ensemble Prediction: The decoder outputs a set of predictions, each corresponding to a target object. These predictions include bounding box coordinates and category labels.
[0118] 6) Hungarian Algorithm Matching: The predicted bounding boxes are optimally matched to the ground-truth bounding boxes using the Hungarian algorithm. This process ensures that each ground-truth object has the best possible prediction, while also assigning background classification to unmatched predictions.
[0119] 7) Loss calculation: Calculate the loss function based on the matching results, which usually includes bounding box regression loss and category prediction loss. This loss is used to update the model weights through gradient descent.
[0120] 8) Iterative optimization: Repeat the above steps to optimize the model parameters through multiple iterations until a predetermined stopping condition is reached, such as the maximum number of iterations or the loss no longer decreases significantly.
[0121] Through these steps, DETR achieves end-to-end object detection without relying on traditional post-processing steps such as anchor boxes or non-maximum suppression (NMS). This design simplifies the object detection process and improves the performance and generalization ability of the model to a certain extent.
[0122] Transformer is a deep learning architecture based on the self-attention mechanism, which has achieved great success in fields such as natural language processing (NLP). Transformer has efficient parallel computing capabilities. Since the calculation of the attention mechanism can be performed in parallel, the Transformer model has extremely high computing efficiency and parallel processing capabilities. In addition to its powerful representation capabilities, the Transformer model can effectively capture the global information of the input data, and therefore has achieved significant performance improvements in the field of natural language processing, such as language modeling and translation. The Transformer model has been widely used in various tasks, including but not limited to: language translation, text generation, dialogue systems, language models, image processing, recommendation systems, etc. In summary, Transformer is a powerful deep learning model, and its emergence has greatly promoted the development of natural language processing and other fields. The core concepts of Transformer include attention mechanism, encoder-decoder architecture, and multi-head attention. The following is an introduction to Transformer:
[0123] 1) The attention mechanism is a key concept in neural networks, allowing the model to focus on certain parts of an input sequence while ignoring others. The Transformer specifically uses the self-attention mechanism, also known as internal attention. This mechanism enables the model to automatically highlight important words or phrases to understand the meaning of a sentence.
[0124] 2) The Transformer consists of two parts: an encoder and a decoder. The encoder processes the input sequence, while the decoder generates the target sequence based on the encoder's output. Each encoder and decoder is composed of multiple identical layers (blocks), typically six layers in total.
[0125] 3) Multi-head attention is a key innovation in Transformer, which allows the model to learn attention distribution in different representation subspaces. This means that the model can simultaneously focus on different positions of the input sequence, thereby capturing richer contextual information.
[0126] To facilitate understanding of the effectiveness of the aircraft classification method based on cyclic angle encoding in this application, we assume that the aircraft is an airplane, and conduct a systematic comparison with various cutting-edge detection frameworks in the field of oriented target detection on a remote sensing image aerial aircraft dataset to reflect the effectiveness of this application. The experiments cover representative methods in the fields of general target detection, remote sensing image target detection, and small target detection, including RoI Transformer, Gliding Vertex, CSL, DCL, S2Anet, ReDet, GWD, KLD, Oriented RCNN, CFA, DAFNet, SASM, ARS-DETR, and Oriented-DETR. These comparison models not only cover regression-based and classification-based methods, distribution modeling-based methods, but also include Transformer-based architectures. In addition, the selected comparison algorithms have been verified on datasets such as DIOR, DOTA, and HRSC2016, ensuring the persuasiveness of the comparison experiments as much as possible. The comparison results are shown in Table 1.
[0127] Table 1 Performance comparison test results
[0128]
[0129] The experimental data in Table 1 shows that the proposed method significantly outperforms existing methods in core metrics such as AP50 (95.4%), AP50:95 (89.1%), and F1 score (0.928). This performance advantage stems from the synergy between the recurrent angle encoding and the angle-aware enhancement module. The introduction of these two modules effectively addresses the model's inherent shortcomings in angle representation and feature alignment.
[0130] See also Figure 7 , Figure 7 A schematic structural diagram of an aircraft rotation frame detection system based on cyclic angle encoding provided in an embodiment of the present application.
[0131] An embodiment of the present application provides an aircraft rotation frame detection system based on cyclic angle coding, which may include:
[0132] The target image acquisition module 101 is used to acquire a target image of the aircraft to be detected;
[0133] The cyclic encoding module 102 is used to perform cyclic angle encoding on the angle domain to obtain a cyclic angle encoding value;
[0134] An angle prediction module 103 is used to predict the angle of the target image based on the cyclic angle code value to obtain the angle initial code value and angle residual code value of the aircraft to be detected;
[0135] Angle generating module 104, configured to generate a target angle code value of the aircraft to be detected based on the initial angle code value and the angle residual code value;
[0136] A decoding module 105 is used to decode the target angle code value into a target angle value;
[0137] The target frame detection module 106 is configured to perform rotation constraints on the sampling frame based on the target angle value to obtain a target frame, so as to perform feature extraction on the target image based on the target frame.
[0138] The embodiment of the present application provides an aircraft rotation frame detection system based on cyclic angle coding. The cyclic coding module may include:
[0139] A code length determining unit, configured to determine a code length value;
[0140] An interval division unit, configured to divide the angle domain into interval angles corresponding to the encoding length values, and determine an interval index value for each interval angle;
[0141] An interval conversion unit, used to convert the interval index value to obtain a standard binary code with a number of bits corresponding to the code length value;
[0142] A mapping unit for mapping straight binary to cyclic angle coded values.
[0143] An embodiment of the present application provides an aircraft rotation frame detection system based on cyclic angle coding, in which a mapping unit can be used to: shift the standard binary code right by one bit and fill the high bit with zero to obtain a right-shifted binary code; perform bit-by-bit XOR on the standard binary code and the right-shifted binary code to obtain a cyclic angle coding value.
[0144] In an aircraft rotation frame detection system based on cyclic angle coding provided by an embodiment of the present application, the interval division unit can be used to: determine the interval index value of each interval angle by generating a formula for the interval index value;
[0145] The interval index value generation formula includes:
[0146] ;
[0147] in, Represents the interval index value; Indicates the interval angle; Indicates the encoding length value; Indicates rounding down.
[0148] In an aircraft rotation frame detection system based on cyclic angle coding provided by an embodiment of the present application, an interval conversion unit can be used to: convert the interval index value through a conversion formula to obtain a standard binary code with a number of bits being a coding length value;
[0149] The conversion formula includes:
[0150] ; ;
[0151] in, Indicates the encoding length; represents standard binary encoding; Represents the modulo operation.
[0152] An embodiment of the present application provides an aircraft rotation frame detection system, wherein the angle generation module may include:
[0153] A weight value obtaining unit, used to obtain a set weight value;
[0154] A product unit is used to multiply the angle residual coding value and the set weight value to obtain an angle residual calculation value;
[0155] The summing unit is used to determine the sum of the initial angle code value and the angle residual calculation value as the target angle code value of the aircraft to be detected.
[0156] The embodiment of the present application provides an aircraft rotation frame detection system based on cyclic angle coding, and the target frame detection module includes:
[0157] A target frame detection unit is used to perform rotation constraints on the sampling frame based on the target angle value using a rotation constraint formula to obtain a target frame;
[0158] The rotation constraint formula includes:
[0159] ;
[0160] in, Information representing the target box; Represents query input features; express location; Input features representing keys and values; Indicates the number of the attention head; represents the total number of attention heads; Indicates the number of the sampling point in the sampling frame; Indicates the total number of sampling points; represents the weight matrix; represents the weight matrix; represents the attention weight; Indicates the In the attention head The query of sampling points can learn the sampling offset; Represents the rotation constraint matrix.
[0161] The embodiment of the present application provides an aircraft rotation frame detection system based on cyclic angle coding, which may also include:
[0162] The training image acquisition module is used to acquire a training image before the target image acquisition module acquires the target image of the aircraft to be detected;
[0163] A labeling module, used to label the training frames of training images;
[0164] The training module is used to train the initial DETR neural network model based on training images and training frames;
[0165] The loss value generation module is used to generate a formula through the loss function to generate the loss value of the DETR neural network model;
[0166] An adjustment module is used to adjust the DETR neural network model based on the loss value to obtain a trained DETR neural network model, and to process the target image based on the trained DETR neural network model to obtain a target frame;
[0167] Among them, the loss function generation formula includes:
[0168] ;
[0169] ;
[0170] ;
[0171] Indicates the loss value; Indicates setting weight value; represents the coding loss; Represents the predicted coding value output by the DETR neural network model; represents the true coded value; Indicates setting weight value; represents the regression loss; represents the continuous angle estimate decoded from the predictive coded value; Represents a continuous angle value decoded from a true encoded value.
[0172] The present application also provides an electronic device and a computer-readable storage medium, both of which have the corresponding effects of the aircraft rotation frame detection method based on cyclic angle coding provided in the embodiment of the present application. Figure 8 , Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0173] An electronic device provided in an embodiment of the present application includes a memory 201 and a processor 202. The memory 201 stores a computer program. When the processor 202 executes the computer program, the steps of the aircraft rotation frame detection method based on cyclic angle coding as described in any of the above embodiments are implemented.
[0174] See also Figure 9 Another electronic device provided in an embodiment of the present application may further include: an input port 203 connected to the processor 202 for transmitting commands inputted from the outside to the processor 202; a display unit 204 connected to the processor 202 for displaying the processing results of the processor 202 to the outside world; and a communication module 205 connected to the processor 202 for enabling communication between the electronic device and the outside world. The display unit 204 may be a display panel, a laser scanning display, etc. The communication method adopted by the communication module 205 includes but is not limited to Mobile High-Definition Link (MHL), Universal Serial Bus (USB), High-Definition Multimedia Interface (HDMI), wireless connection: Wireless Fidelity (WiFi), Bluetooth communication technology, Bluetooth low energy communication technology, and communication technology based on IEEE802.11s.
[0175] An embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the aircraft rotation frame detection method based on cyclic angle coding as described in any of the above embodiments are implemented.
[0176] The computer-readable storage medium involved in this application includes random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs (Compact Disc Read-Only Memory), or any other form of storage medium known in the technical field.
[0177] For the description of the relevant parts of the aircraft rotating frame detection system based on cyclic angle coding, the electronic device, and the computer-readable storage medium provided in the embodiments of the present application, please refer to the detailed description of the corresponding parts of the aircraft rotating frame detection method based on cyclic angle coding provided in the embodiments of the present application, and no further description is given here. In addition, the parts of the above-mentioned technical solutions provided in the embodiments of the present application that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive elaboration.
[0178] It should also be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0179] The above description of the disclosed embodiments will enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting an aircraft rotation frame based on cyclic angle coding, characterized in that: include: Acquire a target image of the aircraft to be detected; Performing cyclic angle coding on the angle domain to obtain a cyclic angle coding value; Performing angle prediction on the target image based on the cyclic angle code value to obtain an initial angle code value and an angle residual code value of the aircraft to be detected; Generate a target angle code value of the aircraft to be detected according to the initial angle code value and the angle residual code value; Decoding the target angle encoded value into a target angle value; A sampling frame is rotationally constrained based on the target angle value to obtain a target frame, so as to perform feature extraction on the target image based on the target frame.
2. The method according to claim 1, characterized in that The cyclic angle encoding is performed on the angle domain to obtain a cyclic angle encoding value, including: Determine the encoding length value; Dividing the angle domain into interval angles corresponding to the encoding length values, and determining an interval index value for each interval angle; Convert the interval index value to obtain a standard binary code with a number of bits equal to the code length value; The straight binary is mapped into a cyclic angle encoded value.
3. The method according to claim 2, characterized in that Mapping the standard binary value to a cyclic angle coded value includes: Shifting the standard binary code right by one bit and padding the high bit with zero to obtain a right-shifted binary code; Perform bit-by-bit XOR on the standard binary code and the right-shifted binary code to obtain a cyclic angle code value.
4. The method according to claim 2, characterized in that Determining the interval index value of each interval angle includes: Determine the interval index value of each interval angle through the interval index value generation formula; The interval index value generation formula includes: ; in, Represents the interval index value; Indicates the interval angle; Indicates the encoding length value; Indicates rounding down.
5. The method according to claim 4, characterized in that The converting of the interval index value to obtain a standard binary code having a number of bits equal to the code length value includes: Convert the interval index value using a conversion formula to obtain a standard binary code with the same number of bits as the code length value; The conversion formula includes: ; ; in, Indicates the encoding length; represents the standard binary code; Represents the modulo operation.
6. The method according to claim 1, characterized in that Generating the target angle code value of the aircraft to be detected according to the initial angle code value and the angle residual code value includes: Get the set weight value; Multiplying the angle residual encoding value by the set weight value to obtain an angle residual calculation value; The sum of the initial angle code value and the angle residual calculation value is determined as the target angle code value of the aircraft to be detected.
7. The method according to claim 1, characterized in that The step of constraining the sampling frame to rotate based on the target angle value to obtain a target frame includes: The sampling frame is subjected to rotation constraint based on the target angle value by a rotation constraint formula to obtain a target frame; The rotation constraint formula includes: ; in, Information representing the target frame; Represents query input features; express location; Input features representing keys and values; Indicates the number of the attention head; represents the total number of attention heads; Indicates the number of the sampling point in the sampling frame; Indicates the total number of sampling points; represents the weight matrix; represents the weight matrix; represents the attention weight; Indicates the In the attention head The query of sampling points can learn the sampling offset; Represents the rotation constraint matrix.
8. The method according to claim 1, characterized in that Before acquiring the target image of the aircraft to be detected, the method further includes: Get training images; Marking a training frame of the training image; Training an initial DETR neural network model based on the training image and the training frame; Generate the loss value of the DETR neural network model; The DETR neural network model is adjusted based on the loss value to obtain a trained DETR neural network model, and the target image is processed based on the trained DETR neural network model to obtain the target frame.
9. The method according to claim 8, characterized in that The loss value of the DETR neural network model is generated, including: Generate the loss value of the DETR neural network model through the loss function generation formula; The loss function generation formula includes: ; ; ; in, represents the loss value; Indicates setting weight value; represents the coding loss; Represents the predicted coding value output by the DETR neural network model; represents the true coded value; Indicates setting weight value; represents the regression loss; represents the continuous angle estimate decoded from the predictive coded value; Represents a continuous angle value decoded from a true encoded value.
10. An aircraft rotation frame detection system based on cyclic angle coding, characterized in that: include: A target image acquisition module is used to acquire a target image of the aircraft to be detected; A cyclic encoding module, used for performing cyclic angle encoding on the angle domain to obtain a cyclic angle encoding value; An angle prediction module, configured to perform angle prediction on the target image based on the cyclic angle code value to obtain an initial angle code value and an angle residual code value of the aircraft to be detected; An angle generating module, configured to generate a target angle code value of the aircraft to be detected according to the angle initial code value and the angle residual code value; A decoding module, configured to decode the target angle code value into a target angle value; The target frame detection module is used to perform rotation constraints on the sampling frame based on the target angle value to obtain a target frame, so as to perform feature extraction on the target image based on the target frame.