Target detection model construction method, detection method and device

By improving the RT-DETR network and adopting RGCSP, DAttention, FDPN and Wise-IoU modules, the performance deficiencies and computational complexity of the DETR network in multi-scale target detection are solved, improving the accuracy and computational efficiency of small target detection, and making it suitable for aerial UAV detection.

CN119723271BActive Publication Date: 2025-11-07GUANGXI TEACHERS EDUCATION UNIV
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing DETR networks suffer from insufficient detection performance and computational complexity when dealing with multi-scale targets, especially for small targets, and have high computational resource requirements, which limits their application in real-world scenarios.

Method used

By replacing the backbone network in the RT-DETR network with the RGCSP module, utilizing the DAttention module to process the highest-dimensional feature map, replacing the CCFM module with the FDPN module, and adding the Wise-IoU module, the computational resource requirements are optimized and the detection performance is improved.

Benefits of technology

It improves the accuracy and generalization ability of target detection, reduces the computational resource requirements, is highly adaptable, and is suitable for resource-constrained environments, especially performing well in the detection of aerial drones.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119723271B_ABST
    Figure CN119723271B_ABST
Patent Text Reader

Abstract

The application discloses a target detection model construction method, comprising the following steps: replacing a backbone network in an RT-DETR network model by using an RGCSP module to obtain an improved RT-DETR network model; and training the improved RT-DETR network model by using a training set to obtain the target detection model. The application further provides a target detection method and device. The application can improve detection precision and reduce computational complexity.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of target detection. More particularly, the present application relates to a target detection model construction method, a detection method and an apparatus. BACKGROUND

[0002] Target detection algorithms have a wide range of applications in automatic driving, intelligent security, national defense and military fields, and are one of the hot research directions in the field of computer vision. The air unmanned aerial vehicle detection is full of targets of different scales, which puts higher requirements on the performance of target detection algorithms. In recent years, target detection frameworks based on Transformer (such as DETRs) have gradually become a new research hotspot. Compared with traditional convolutional neural networks, DETR extracts global features through Transformer, does not need non-maximum suppression (NMS), and directly realizes end-to-end target detection, thereby simplifying the detection process. However, although DETR has made significant progress in detection accuracy, it still faces certain bottlenecks in processing multi-scale targets. Specifically, the existing DETR network has insufficient detection ability for small targets, and due to the computational complexity of feature extraction, its inference speed is slow, which limits its application in practical scenarios. The emergence of RT-DETR solves this problem. RT-DETR improves the model detection speed by virtue of the redesigned encoder structure, but its detection performance for multi-scale targets is poor, and the computational complexity is still larger than that of other models.

[0003] Therefore, there is an urgent need to design a technical solution that can overcome the above-mentioned defects. SUMMARY

[0004] An object of the present application is to provide a target detection model construction method, a detection method and an apparatus, which can improve the target detection performance and reduce the demand for computing resources.

[0005] In order to achieve these objects and other advantages and in accordance with the purpose of the application, an object detection model construction method is provided according to one aspect of the present application, comprising: replacing a backbone network in an RT-DETR network model with an RGCSP module to obtain an improved RT-DETR network model; training the improved RT-DETR network model with a training set to obtain the object detection model; wherein the RGCSP module is used to process an input image and output feature maps P3, P4 and P5 with different dimensions, and the processing steps of the RGCSP module include: adjusting the channel number of the input through Conv1x1; splitting the input into two parts, denoted as M1 and M2 respectively; performing feature enhancement on M2 using RepConv to obtain M3; performing 3x3 convolution operation on M3 using Conv3x3 to generate M4; adjusting the channel of M4 using Conv1x1 to obtain M5; splicing M1, M3, M4 and M5 using Concat; and adjusting the channel number of the spliced part using Conv1x1 and outputting.

[0006] Further, the method further comprises replacing an AIFI module in the RT-DETR network model with a DAttention module; and processing the feature map P5 with the highest dimension using the DAttention module to output Y5.

[0007] Further, the method further comprises replacing a CCFM module in the RT-DETR network model with an FDPN module; wherein the FDPN module is used to perform feature fusion on feature maps with different dimensions, and the specific steps include: P3, P4 and Y5 enter a FocusFeature module for feature fusion to obtain N1; N1 respectively undergoes conv and upsample operations, and respectively performs concat operation with Y5 and P3 to obtain N2 and N3; N2 and N3 are respectively input into a RepC3 module again for refinement processing to obtain N2' and N3'; N2', N3' and N1 are sent into the FocusFeature module again to obtain N1';

[0008] The feature fusion step of the FocusFeature module includes: downsampling P3 through an ADOWN module, adjusting the channel number of P4 and P5 feature maps through a Conv convolution layer respectively; performing concat operation on the processed P3, P4 and P5 to obtain a preliminary fused feature map; processing the preliminary fused feature map using convolution kernels with sizes of 5x5, 7x7, 9x9 and 11x11 respectively, and reserving an identity mapping branch; fusing the outputs of all convolution kernels and the identity mapping through an add operation, and then adjusting the channel number using Conv1x1 and performing add operation with the preliminary fused feature map.

[0009] Further, the GIoU module in the RT-DETR network model is replaced by a Wise-IoU module.

[0010] Further, a RepBN module is added.

[0011] According to another aspect of the present application, a target detection method is also provided, comprising: constructing a target detection model by using the construction method; obtaining an image to be detected; and detecting the image to be detected by using the target detection model.

[0012] According to another aspect of the present application, a target detection device is also provided, comprising: a construction module configured to construct a target detection model by using the construction method; an obtaining module configured to obtain an image to be detected; and a detection module configured to detect the image to be detected by using the target detection model.

[0013] According to another aspect of the present application, a target detection device is also provided, comprising a processor and a memory, wherein the memory is configured to store program instructions, and the processor is configured to invoke the program instructions to execute the target detection method.

[0014] According to another aspect of the present application, a computer readable storage medium is also provided, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the target detection method.

[0015] The present application at least has the following beneficial effects:

[0016] The present application improves the RT-DETR network model in the prior art, thereby forming a target detection method with multiple advantages, including: first, the target detection network is improved by using feature extraction and fusion technologies such as the RGCSP module and the FPDN module, thereby improving the detection accuracy of small targets in the air environment; second, the calculation resources are optimized based on the lightweight network structure and the efficient algorithm, thereby reducing the demand for calculation resources and facilitating the deployment in a resource-limited environment; and third, different scale feature maps can be effectively processed, the generalization ability is better, the adaptability is stronger than that of the prior art, and the system practicability and flexibility are improved.

[0017] Other advantages, objects, and features of the present application will be partly embodied in the following description, and will be partly understood by those skilled in the art through research and practice of the present application. BRIEF DESCRIPTION OF DRAWINGS

[0018] Figure 1 is a network model architecture diagram of the method provided by an embodiment of the present application;

[0019] Figure 2is a RGCSP module architecture diagram provided by an embodiment of the present application;

[0020] Figure 3 is a FocusFeature module architecture diagram provided by an embodiment of the present application;

[0021] Figure 4 is a diffusion mechanism module architecture diagram provided by an embodiment of the present application. DETAILED DESCRIPTION

[0022] The present application will be further described below in conjunction with the accompanying drawings, so that those skilled in the art can implement the present application according to the description and the drawings.

[0023] It should be understood that the terms such as "have", "contain" and "include" used in the embodiments of the present application do not exclude the presence or addition of one or more other elements or combinations thereof. All directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present application are only used to explain the relative positional relationship, movement condition, etc. between the components in a certain posture, and if the certain posture changes, the directional indications also change accordingly. When an element is referred to as "fixed to" or "disposed on" another element, it can be directly on another element or can have a middle element. When an element is referred to as "connected to" another element, it can be directly connected to another element or indirectly connected to another element through a middle element. The descriptions of "first", "second" and the like in the embodiments of the present application are only for the purpose of description and cannot be understood as indicating or implying the relative importance of the indicated technical features or implying the number of the indicated technical features. Therefore, the features defined as "first", "second" can explicitly or implicitly include at least one of the features.

[0024] It should be noted that the technical solutions of the various embodiments of the present application can be combined with each other, but it must be based on the fact that a person skilled in the art can implement it, and when the combination of technical solutions appears contradictory or unimplementable, it should be considered that the combination of technical solutions does not exist and is not within the protection scope claimed by the present application.

[0025] The embodiments of the present application provide a target detection model construction method, comprising: replacing a backbone network in an RT-DETR network model with an RGCSP module to obtain an improved RT-DETR network model; training the improved RT-DETR network model with a training set to obtain the target detection model, that is, through the training process, learning the internal mapping relationship between the input data and the target output, accurately identifying the target object when facing the actual detection task, such as unmanned aerial vehicle aerial detection;

[0026] The RGCSP module is used for processing an input image, and outputs feature maps P3, P4 and P5 with different dimensions. The processing steps of the input by the RGCSP module include: adjusting the channel number of the input through Conv1x1 to meet the requirements of subsequent operations and data dimensions; splitting the input into two parts, M1 and M2, by Split, so that subsequent targeted processing can be performed on them to mine unique feature information contained in different parts; performing feature enhancement on M2 through RepConv to obtain M3. RepConv, as a special convolution method, has a unique convolution kernel structure and computing mechanism, which can perform deep feature mining and strengthening on M2. By adjusting the connection weights between neurons and the parameters of the convolution kernel, the features that are relatively implicit or not prominent enough in M2 become more prominent and more recognizable. M4 is generated by performing 3x3 convolution operation on M3 through Conv3x3. The 3x3 convolution kernel slides on the data of M3 to capture the feature correlation and changes between different positions and local regions. In this way, the feature information in M3 is further refined and integrated. M5 is obtained by adjusting the channel of M4 through Conv1x1 to meet the requirements of subsequent operations and data dimensions. M1, M3, M4 and M5 are spliced by Concat to integrate the feature information contained in each of them into a new data structure, realizing the convergence of different feature information. The channel number of the spliced data is adjusted through Conv1x1 to meet the requirements of subsequent operations and data dimensions, and the output is obtained.

[0027] The above embodiment focuses on the modification of the existing mature network model RT-DETR network model. The RT-DETR network model includes a backbone network, a hybrid encoder, an IoU module and a decoder. The hybrid encoder includes an AIFI module and a CCFM module. In this embodiment, the RGCSP module is used to replace the original backbone network to perform feature extraction and processing, and output feature maps P3, P4 and P5 with different dimensions. These feature maps with different dimensions carry feature information of different levels and different scales in the image.

[0028] After the highest dimension feature map P5 is processed by the DAttention module, it contains rich global semantic information and is suitable for large target detection. The other dimension feature maps P3 and P4 contain detailed information, and their high resolution characteristics make them suitable for small target detection.

[0029] By way of example, the RGCSP module completes feature extraction through the following steps:

[0030] S1-1: through a conv convolution layer (3x3 convolution, channel number 128, down sampling 2 times);

[0031] S1-2: Enter the RGCSP module to obtain P3 feature maps, including channel adjustment, feature segmentation, feature enhancement, and splicing;

[0032] S1-3: The input passes through a Conv convolutional layer (3x3 convolution, channel number 256), and is down-sampled by 2 times;

[0033] S1-4: Enter the RGCSP module to obtain P4 feature maps;

[0034] S1-5: The input passes through a Conv convolutional layer (3x3 convolution, channel number 384), and is down-sampled by 2 times;

[0035] S1-6: Enter the RGCSP module to obtain P5 feature maps.

[0036] Exemplarily, the RGCSP module specifically processes the following steps:

[0037] Conv1x1 channel adjustment: the input first passes through a 1x1 convolution to adjust the channel number of the feature map.

[0038] Split feature segmentation: after 1x1 convolution, the feature map is divided into two parts, denoted as M1 and M2. M1 remains unchanged and is directly used for final splicing; M2 is used for further feature enhancement.

[0039] RepConv feature enhancement: RepConv is applied to M2 for feature enhancement to obtain a new feature map M3.

[0040] Conv3x3 feature extraction: a 3x3 convolution operation is performed on M3 to further extract local features and generate a feature map M4.

[0041] Conv1x1 channel adjustment: a 1x1 convolution is applied to M4 to further adjust the channel number to obtain a feature map M5.

[0042] Concat feature splicing: M1, M3, M4, and M5 are spliced through concat operation to collect feature information from different paths.

[0043] Final Conv 1x1 output: finally, a 1x1 convolution is used to adjust the channel number of the spliced feature map, and the final feature map is output.

[0044] Exemplarily, the calculation formula of the RGCSP module feature map is as follows:

[0045]

[0046] Wherein:

[0047] the segmentation of the feature after initial convolution;

[0048] RepConv is a feature enhancement on the segmented part;

[0049] F2 represents the feature map after RepConv enhancement;

[0050] is after multiple 3x3 convolutions.

[0051] In another embodiment, a RepBN module is also included;

[0052] In this embodiment, during the construction of the deep learning model, the normalization operation is a very key link, and its purpose is to standardize the input data or the features of the intermediate layer, so that the distribution of the data is more stable and appropriate, which helps to improve the efficiency of model training and the final performance. Common normalization methods include LayerNorm (layer normalization) and BatchNorm (batch normalization). The Transformer architecture is widely used in natural language processing and computer vision, but the LayerNorm in it will introduce a higher computational complexity problem to some extent. For example, during the inference stage, LayerNorm needs to calculate the corresponding statistics (such as mean and variance) for each sample in real time to perform normalization, which will consume additional computing resources and time cost, affecting the overall operation efficiency of the model.

[0053] The RepBN module is proposed to solve this problem. Through ingenious design and mechanism, it can improve the efficiency of the model while avoiding negative effects on the training performance of the model, thereby optimizing the operation speed of the model while ensuring the accuracy of tasks such as target detection;

[0054] Specifically, S2-1: After processing by the RepBN module, the normalization operation is performed, the mean and variance are calculated, and the input features are standardized;

[0055] S2-2: First, generate query Q, key K, and value V through the convolution layer; calculate the offset Δp through the offset convolution, which is used to adjust the sampling position; adjust the sampling position according to the offset Δp. DAttention uses the offset key K(p+Δp) to calculate the attention weight;

[0056] S2-1-1: The above RepBN solves the problem of computational complexity introduced by LayerNorm in Transformer. Compared with LayerNorm, BatchNorm does not need to calculate statistics in real time during inference, so it is more efficient; through RepBN, Transformer can use BatchNorm to improve efficiency while avoiding the problem of performance decline during training.

[0057] S2-1-2: Training phase: the model gradually replaces LayerNorm with RepBN while ensuring the stability of the training process. This process is controlled by the hyperparameter γ, initially γ=1, LayerNorm plays a major role; as training progresses, γ gradually decays to 0, BatchNorm completely replaces LayerNorm.

[0058] S2-1-3: Inference phase: after reparameterization, the model only needs BatchNorm during inference, and no longer needs to calculate statistics, thereby reducing inference delay.

[0059] S2-1-4: The RepBN formula is expressed as:

[0060]

[0061] Where:

[0062] η is a learnable parameter that controls the fusion of BatchNorm and linear layers.

[0063] In another embodiment, it also includes replacing the AIFI module in the RT-DETR network model with a DAttention module; using the DAttention module to process the feature map P5 with the highest dimension, output Y5; that is, using DAttention to replace the multi-head attention in the original AIFI module, and performing attention feature extraction on the highest dimension feature map P5 to obtain the output F5, which can effectively reduce the computational complexity, especially when processing high-resolution feature maps, DAttention can more flexibly handle spatial changes;

[0064] Exemplarily, the DA-AIFI formula is expressed as:

[0065]

[0066] Where:

[0067] Q: Query (Query) vector, used to select the features to focus on;

[0068] K: Key (Key) vector, similarity calculation with query;

[0069] V: Value vector, containing feature information;

[0070] Ap: offset, used for dynamic adjustment of sampling position.

[0071] In another embodiment, the CCFM module in the RT-DETR network model is also replaced with an FDPN module; wherein the FDPN module is used for feature fusion of feature maps with different dimensions, and the specific steps include: P3, P4, and Y5 enter the FocusFeature module for feature fusion to obtain N1; N1 is subjected to conv (convolution) and upsample (upsampling) operations, and is subjected to concat operations with Y5 and P3, respectively, to obtain N2 and N3; N2 and N3 are input into the RepC3 module again for refinement processing to obtain N2' and N3'; N2', N3', and N1 are sent into the FocusFeature module again to obtain N1'; the steps of feature fusion performed by the FocusFeature module include: P3 is downsampled by the ADOWN module, and P4 and P5 feature maps are subjected to channel number adjustment by the Conv convolution layer; P3, P4, and P5 after processing are subjected to concat operation to obtain a preliminary fused feature map; the preliminary fused feature map is processed using convolution kernels of 5x5, 7x7, 9x9, and 11x11, respectively, and an identity mapping branch is retained; the outputs of all convolution kernels and the identity mapping are fused by add operation, and then the channel number is adjusted by Conv1x1, and then add operation is performed with the preliminary fused feature map;

[0072] In this embodiment, P3, P4, and Y5 carry different scales and different levels of abstract feature information extracted from previous processing stages, P3 focuses on reflecting relatively detailed and local features of target objects, P4 contains intermediate-level features, and Y5 is obtained after processing the highest-dimensional feature map by a specific module (such as the DAttention module mentioned above), and contains more abstract and high-level feature content. When they enter the FocusFeature module, the information in these different-dimensional feature maps is fully interacted and integrated, and finally a fused feature representation is obtained, which is denoted as N1.

[0073] By way of example, S3-1: three scale feature maps are input into the FocusFeature, which contains an Inception-Style module inside, which uses a set of parallel deep convolutions to capture rich information across multiple scales;

[0074] S3-2: Convolution processing is performed on the feature map using a 3x3 convolution kernel with a step size of 2 to increase the feature representation capability and adapt the scale; the feature map P3 is upsampled and spliced with the output of the feature focusing module to generate the final fused feature;

[0075] S3-3: Diffusion operation is performed on the feature map processed by the FocusFeature module to allow each scale of feature to have detailed context information, which is more conducive to subsequent target detection and classification;

[0076] S3-4: After the second diffusion, the feature map is sent to the detection;

[0077] S3-1-1: The above FocusFeature module and diffusion mechanism allow each scale of feature to have detailed context information, which is more conducive to subsequent target detection and classification.

[0078] S3-1-2: FocusFeature formula expression:

[0079]

[0080] Wherein:

[0081]

[0082] DWConv represents deep convolution;

[0083] S3-3-1: The above diffusion mechanism uses the FocusFeature module to process the intermediate scale feature to strengthen the key spatial information; the lower scale feature is upsampled to match the spatial size of the higher scale, thereby promoting the fusion between multiple scales; the feature map after upsample and feature focusing processing is spliced, and then compressed and fused through the RcpC3 recursive convolution module; through layer-by-layer splicing and fusion, it is ensured that each scale of feature contains the context information of other scales, realizing the diffusion of features, i.e. information from single scale to multi-scale, thereby enhancing the feature expression capability.

[0084] S3-3-2: The formula expression of the diffusion mechanism is:

[0085]

[0086] By fusing multi-scale features P3, P4 through FocusFeature, and then splicing with Y5, finally using RcpC3 module to realize recursive compression, the final output feature Fout is generated, which effectively realizes the deep fusion and compression of features, and improves the detection capability of the model for multi-scale targets.

[0087] In another embodiment, a Wise-IoU module is further included to replace the GIoU module in the RT-DETR network model;

[0088] In this embodiment, the WISE-IOU module specifically optimizes the degree of overlap between the predicted frame and the real frame through the following steps, thereby further improving the accuracy of target positioning. Specifically:

[0089] S4-1: In Wise-IoU, a distance attention mechanism is used to amplify the loss value of ordinary quality anchor frames; the overall performance of the detector is improved. This method reduces the competitiveness of high-quality anchor frames while reducing harmful gradients generated by low-quality examples without increasing additional computational complexity. is defined as:

[0090]

[0091] Wherein:

[0092] L IoU is the standard IoU loss;

[0093] R WIoU is the distance attention factor of the original Wise-IoU v1, and its calculation formula is:

[0094]

[0095] Wherein: x, y are the center coordinates of the predicted frame, and x gt , y gt are the center coordinates of the real frame, W g , H g are the dimensions of the minimum bounding rectangle.

[0096] Embodiments of the present application also provide a target detection method, comprising: constructing a target detection model using the construction method; obtaining a to-be-detected image; detecting the to-be-detected image using the target detection model; after successfully constructing the target detection model through the above embodiments, the next step is to obtain the to-be-detected image. In actual application scenarios, the source of the to-be-detected image is very extensive. It can be a monitoring picture obtained by a camera in real time, such as a traffic monitoring system, a road scene image containing vehicles, pedestrians, buildings and other target objects taken by a drone; it can also be a picture extracted from a stored image database for a specific detection task, such as a human tissue organ image picture selected from a case library in medical image diagnosis; when detecting, a series of preprocessing operations are first performed on the to-be-detected image, such as adjusting the size of the image to meet the model input requirements, normalizing the color of the image, etc., to ensure that the image data can be input to the model in the best state for feature extraction and analysis.

[0097] The embodiment of the present application also provides a target detection device, comprising: a construction module configured to construct a target detection model by using the construction method; an acquisition module configured to acquire a to-be-detected image; and a detection module configured to detect the to-be-detected image by using the target detection model.

[0098] The embodiment constructs the construction module, the acquisition module and the detection module by using a computer program, the construction module is configured to construct a target detection model by using the method in the above embodiment, the acquisition module is configured to acquire a to-be-detected image, and the detection module is configured to give the category information of the target object and the reliable degree of detection according to the determination of the category of the target object and the corresponding confidence score of the target detection model, so that comprehensive and accurate target detection of the to-be-detected image is realized.

[0099] The embodiment of the present application also provides a target detection device, comprising a processor and a memory, the memory is configured to store program instructions, and the processor is configured to call the program instructions to execute the target detection method; the device of the embodiment can be a mobile phone, a notebook computer, a tablet computer, a vehicle-mounted terminal, a drone, etc., which is internally provided with a memory and a processor to execute the target detection method in the above embodiment.

[0100] The embodiment of the present application also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the target detection method; in the embodiment, the computer readable medium can be a portable computer disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device, etc., which can store a computer program to execute the target detection method in the above embodiment.

[0101] The present application also provides a specific embodiment for the description:

[0102] As shown in Figure 1 The entire Rep-RTDETR model is improved on the basis of the RT-DETR model, realizes efficient detection of multi-scale targets, and the network architecture of the entire model is as shown in the figure. First, the backbone network (RGCSP) is used to extract the features of the input image, and the backbone part gradually extracts the features by alternately using the convolution layer (Conv) and the RGCSP module. As shown in Figure 2 The RGCSP uses formula (1):

[0103]

[0104] The network starts with a lower number of channels and increases the number of channels and down-sampling step by step, so that higher-level features are gradually extracted in each layer. The initial convolutional layer increases the number of channels of the input data to 64 and reduces the resolution; then, through the repeated stacking of each layer, the number of channels of the network is sequentially increased to 128, 256, 384, and the resolution is gradually halved, sequentially generating {P3, P4, P5} feature maps as the input of the encoding layer.

[0105] Then, before the features enter the DA-AIFI module, the RepBN strategy is adopted, and BatchNorm completely replaces LayerNorm as the training progresses. After the model is trained, the formula (2) is used:

[0106]

[0107] The BN layer is re-parameterized as a convolutional layer or other linear transformation. Standardization helps to stabilize the feature distribution, making the subsequent attention calculation more accurate. Then, DA-AIFI uses formula (3):

[0108]

[0109] The attention feature extraction is performed on the P5 feature map to obtain the output Y5.

[0110] The feature fusion is performed on {P3, P4, Y5} through the FDPN network, as shown in Figure 3 The FocusFeature module in FDPN uses formula (4):

[0111]

[0112] The fusion of feature maps of different sizes is performed, and as shown in Figure 4 The diffusion mechanism formula (5) is used:

[0113] .

[0114] The multi-scale features are fused through up-sampling and splicing, and the RepC3 is used to improve the feature expression capability. The detection accuracy and the recognition ability of the details of the target are improved by combining multi-scale information and attention mechanism.

[0115] The improved Wise-IoU increases the distance attention mechanism to amplify the loss value of ordinary quality anchor boxes, and introduces an IoU-based dynamic weighting term. It can adaptively focus on anchor boxes of different qualities during training. Through formula (6):

[0116]

[0117] The dynamic weighting term gives low IoU samples a higher loss weight, thereby improving the model's performance in positioning accuracy and detection effect.

[0118] The dataset is an anti-UAV drone public dataset, and the training set has 1981 pictures. By using the anti-UAV dataset, the present embodiment is compared with the RT-DETR model, and the results are as shown in the following table.

[0119] In order to further prove the effectiveness of the present method, the present application carries out relevant ablation experiments. A is the RT-DETR model, B uses RGCSP for the backbone based on the A model, C uses the DA-AIFI module based on the A model, D uses the RGCSP network module for the backbone based on the A model and uses the FDPN in the feature fusion module, E uses the FDPN module alone based on the A model, and F is the Rep-RTDETR model (i.e. the embodiment of the present application).

[0120] As can be seen from Table 1, the RGCSP and FDPN modules in the embodiment of the present application cooperate to greatly reduce the training parameters of the model and the computational complexity of the model, and also partially improve the accuracy, but only using RGCSP or only using FDPN module, although there is some improvement compared with the A model, but cannot completely realize similar technical effects. Specifically, the Rep-RTDETR reduces the parameter amount by 30.34% compared with the RT-DETR model (A in Table 1), the model complexity is also reduced by 43.40%, and the mAP50-95 is improved by 2.4%. It fully shows that the RGCSP module and the FDPN network module have good effect on the extraction and fusion of small target features, which can effectively reduce the overall network parameter amount and model complexity, that is, improve the detection accuracy of small targets in the air environment, optimize the demand for computing resources, and facilitate deployment in resource-constrained environments (such as unmanned aerial vehicles).

[0121] Table 1: Ablation experiment of Rep-RTDETR

[0122]

[0123] At the same time, the REP-RTDETR proposed in Table 2 is compared with the current mainstream YOLO and target detection network based on the DETR framework.

[0124] The REP-RTDETR compared with the YOLOv8-L / RT-DETR(ResNet18) / RT-DETR(ResNet50) in the series respectively improves the mAP50-95 by 3.7%, 2.4%, and 1.1%, and reduces the network parameter amount by 68.27%, 30.34%, and 69.06%, respectively.

[0125] Table 2: Comparison experiment of mainstream models

[0126]

[0127] Since the target images of the UAV are of different sizes, the GIoU used in the RT-DETR is not stable enough when processing small targets. The Rep-RTDETR model of the embodiments of the present application is combined with GIoU and Wise-IoU respectively, and the results are shown in Table 3. It can be seen that Wise-IoU is more suitable for the detection task of small targets in natural scenes. Considering the problem of class imbalance or region importance, the weight can be dynamically adjusted according to different tasks or data sets, and the detection effect of the model can be more truly reflected.

[0128] Table 3: Comparison experiment of loss functions

[0129]

[0130] Although the embodiments of the present application have been disclosed as above, they are not limited to the application listed in the specification and the embodiments, and can be fully applied to various fields suitable for the present application. For those skilled in the art, other modifications can be easily realized, and therefore the present application is not limited to specific details and the figures shown and described herein.

Claims

1. A method for constructing a target detection model, characterized in that, The method comprises the following steps: An improved RT-DETR network model is obtained by replacing a backbone network in the RT-DETR network model with an RGCSP module; The target detection model is obtained by training the improved RT-DETR network model using a training set. The RGCSP module is used to process an input image and output feature maps P3, P4 and P5 with different dimensions, and the processing steps of the RGCSP module include: adjusting the channel number of the input through Conv1x1; splitting the input into two parts, denoted as M1 and M2; performing feature enhancement on M2 using RepConv to obtain M3; performing 3x3 convolution operation on M3 using Conv3x3 to generate M4; adjusting the channel of M4 using Conv1x1 to obtain M5; splicing M1, M3, M4 and M5 using Concat; and adjusting the channel number of the spliced result using Conv1x1 and outputting the result. The method further comprises replacing an AIFI module in the RT-DETR network model with a DAttention module; and processing the feature map P5 with the highest dimension using the DAttention module to output Y5. The method further comprises replacing a CCFM module in the RT-DETR network model with a FDPN module. The FDPN module is used to perform feature fusion on feature maps with different dimensions, and the specific steps include: P3, P4 and Y5 enter a FocusFeature module for feature fusion to obtain N1; N1 is subjected to conv and upsample operations respectively, and is subjected to concat operations with Y5 and P3 respectively to obtain N2 and N3; N2 and N3 are input into a RepC3 module again for refinement processing to obtain N2' and N3'; N2', N3' and N1 are sent into the FocusFeature module again to obtain N1'; The steps of the FocusFeature module for feature fusion include: downsampling P3 through an ADOWN module, adjusting the channel number of P4 and P5 feature maps through a Conv convolution layer; performing concat operation on the processed P3, P4 and P5 to obtain a preliminary fused feature map; processing the preliminary fused feature map using convolution kernels with sizes of 5x5, 7x7, 9x9 and 11x11 respectively, and retaining an identity mapping branch; fusing the outputs of all convolution kernels and the identity mapping through an add operation, adjusting the channel number using Conv1x1, and then performing add operation with the preliminary fused feature map. 2.The target detection model construction method of claim 1, wherein, The method further comprises replacing a GIoU module in the RT-DETR network model with a Wise-IoU module. 3.The target detection model construction method of claim 1, wherein, The method further comprises adding a RepBN module.

4. A target detection method characterized by, The method comprises the following steps: Constructing a target detection model using the construction method of any one of claims 1-3; Obtaining a to-be-detected image; Detecting the to-be-detected image using the target detection model.

5. The object detection apparatus characterized by, The method comprises the following steps: A construction module is configured to construct a target detection model using the construction method of any one of claims 1-3. An acquisition module is configured to acquire a to-be-detected image; A detection module is configured to detect the to-be-detected image by using the target detection model.

6. The object detection apparatus characterized by, The target detection method of claim 4 is executed by a processor calling program instructions stored in a memory.

7. A computer readable storage medium characterized by, The computer program stored in the computer readable storage medium is executed by a processor to implement the target detection method of claim 4. The computer program stored in the computer readable storage medium is executed by a processor to implement the target detection method of claim 4.

Citation Information

Patent Citations

  • Target detection method based on a dense connection characteristic pyramid network

    CN109614985A

  • Lightweight infrared target detection algorithm based on improved YOLOv8

    CN117636111A