Target detection model construction method, target detection method and target detection device
By replacing the backbone network with RGCSP module in the DETR network, and combining DAttention, FDPN and Wise-IoU modules, the DETR network's performance and computing complexity problems in multi-scale object detection are solved, achieving more efficient object detection performance and lower computing resource requirements.
Patent Information
- Application Number
- CN202411902737.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-23
AI Technical Summary
When handling multi-scale targets, the existing DETR network has poor detection performance, especially the detection capability of small targets, and the computational complexity is high, which limits its application in actual scenarios.
By replacing the backbone network in the RT-DETR network as the RGCSP module, and combining DAttention, FDPN and Wise-IoU modules, the network structure is improved to improve object detection performance and reduce computing resource requirements.
The improved object detection model significantly improves the detection accuracy of small targets in the aerial environment, reduces the demand for computing resources, and facilitates deployment in resource-constrained environments.
Smart Images

Figure CN119723271A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field related to target detection, and more specifically, to a target detection model construction method, a detection method and a device. Background Art
[0002] Object detection algorithms are widely used in autonomous driving, intelligent security, national defense and military, and are one of the hot research directions in the field of computer vision. Aerial drone detection is full of targets of different scales, which puts high demands on the performance of target detection algorithms. In recent years, Transformer-based target detection frameworks (such as DETRs) have gradually become a new research hotspot. Compared with traditional convolutional neural networks, DETR extracts global features through Transformer, does not require non-maximum suppression (NMS), and directly implements 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 when dealing with multi-scale targets. Specifically, the existing DETR network has insufficient detection capabilities 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 amount of calculation is still larger than other models.
[0003] Therefore, it is urgent to design a technical solution that can overcome the above-mentioned defects. Summary of the invention
[0004] An object of the present invention is to provide a target detection model construction method, a detection method and a device, which can improve the target detection performance and reduce the demand for computing resources.
[0005] In order to achieve these purposes and other advantages of the present invention, according to one aspect of the present invention, the present invention provides a method for constructing a target detection model, comprising: replacing the backbone network in the 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; wherein the RGCSP module is used to process the input image and output feature maps P3, P4 and P5 of different dimensions, and the RGCSP module processes the input including: adjusting the number of input channels through Conv1x1; dividing the input into two parts through Split, respectively denoted as M1 and M2; performing feature enhancement on M2 using RepConv to obtain M3; performing a 3x3 convolution operation on M3 using Conv3x3 to generate M4; performing channel adjustment on M4 using Conv1x1 to obtain M5; splicing M1, M3, M4 and M5 using Concat; adjusting the number of spliced channels using Conv1x1 and outputting.
[0006] Furthermore, it also includes using a DAttention module to replace the AIFI module in the RT-DETR network model; using the DAttention module to process the feature map P5 with the highest dimension and output Y5.
[0007] Furthermore, it also includes replacing the 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 of different dimensions, and the specific steps include: P3, P4, and Y5 enter the FocusFeature module for feature fusion to obtain N1; N1 undergoes conv and upsample operations respectively, and performs concat operations with Y5 and P3 respectively to obtain N2 and N3; N2 and N3 are respectively input into the RepC3 module again for refinement processing to obtain N2' and N3'; N2', N3' and N1 are sent to the FocusFeature module again to obtain N1'; The step of feature fusion of the FocusFeature module includes: downsampling P3 through the ADOWN module, and adjusting the number of channels of P4 and P5 feature maps through the Conv convolution layer respectively; performing a concat operation on the processed P3, P4 and P5 to obtain a preliminary fused feature map; processing the preliminary fused feature map using 5x5, 7x7, 9x9 and 11x11 convolution kernels respectively, and retaining an identity mapping branch; fusing the outputs of all convolution kernel processing and identity mapping through an add operation, and then adjusting the number of channels using Conv1x1, and then performing an add operation with the preliminary fused feature map.
[0008] Furthermore, it also includes replacing the GIoU module in the RT-DETR network model with the Wise-IoU module.
[0009] Furthermore, it also includes adding a RepBN module.
[0010] According to another aspect of the present invention, a target detection method is also provided, comprising: constructing a target detection model using the construction method; acquiring an image to be detected; and detecting the image to be detected using the target detection model.
[0011] According to another aspect of the present invention, a target detection device is also provided, including: a construction module, used to construct a target detection model using the construction method; an acquisition module, used to acquire an image to be detected; and a detection module, used to detect the image to be detected using the target detection model.
[0012] According to another aspect of the present invention, there is also provided a target detection device, comprising a processor and a memory, wherein the memory is used to store program instructions, and the processor is used to call the program instructions to execute the target detection method.
[0013] According to another aspect of the present invention, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores a computer program, and the computer program implements the target detection method when executed by a processor.
[0014] The present invention has at least the following beneficial effects: The present invention improves the RT-DETR network model in the prior art, thereby having multiple advantages in target detection. First, the target detection network is improved by adopting feature extraction and fusion technologies such as RGCSP module and FPDN module, thereby improving the detection accuracy of small targets in aerial environments; second, computing resources are optimized based on lightweight network structure and efficient algorithm design, reducing the demand for them and facilitating deployment in resource-constrained environments; third, feature maps of different scales can be effectively processed, generalization ability is better, and adaptability is stronger than prior art, thereby improving the practicality and flexibility of the system.
[0015] Other advantages, objectives and features of the present invention will be embodied in part through the following description, and in part will be understood by those skilled in the art through study and practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is a network model architecture diagram of a method provided by an embodiment of the present application; Figure 2 This is a diagram of the RGCSP module architecture provided by an embodiment of the present application; Figure 3This is a diagram of the FocusFeature module architecture provided by an embodiment of the present application; Figure 4 This is a diffusion mechanism module architecture diagram provided by an embodiment of the present application. DETAILED DESCRIPTION
[0017] The present invention is further described in detail below in conjunction with the accompanying drawings so that those skilled in the art can implement the invention with reference to the description.
[0018] It should be understood that the terms such as "having", "including" and "comprising" used in the embodiments of the present application do not exclude the existence or addition of one or more other elements or their combinations. All directional indications (such as up, down, left, right, front, back...) in the embodiments of the present application are only used to explain the relative position relationship, movement, etc. between the components in a certain specific posture. If the specific posture changes, the directional indication will also change accordingly. When an element is referred to as "fixed on" or "set on" another element, it can be directly on the other element or there may be a centering element at the same time. When an element is referred to as "connecting" another element, it can be directly connected to another element or it can be indirectly connected to another element through a centering element. The description of "first", "second", etc. in the embodiments of the present application is only for descriptive purposes, and cannot be understood as indicating or implying its relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" can explicitly or implicitly include at least one of the features.
[0019] It should be noted that the technical solutions between the various embodiments of the present application can be combined with each other, but it must be based on the fact that ordinary technicians in the field can implement it. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0020] The embodiment of the present application provides a method for constructing a target detection model, including: replacing the backbone network in the 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 intrinsic mapping relationship between input data and target output, and accurately identifying the target object when facing an actual detection task, such as drone aerial detection; The RGCSP module is used to process the input image and output feature maps P3, P4 and P5 of different dimensions. The RGCSP module processes the input in the following steps: adjusting the number of input channels through Conv1x1 to meet the requirements of subsequent operations and data dimensions; dividing the input into two parts by average or proportion through Split, respectively recorded as M1 and M2, so that they can be processed separately in a targeted manner in the future to mine the unique feature information contained in different parts; using RepConv to enhance the features of M2 to obtain M3. As a special convolution method, RepConv has a unique convolution kernel structure and calculation mechanism. It can perform deep feature mining and enhancement on M2 by adjusting the connection weights between neurons and the parameters of the convolution kernel. Formula, so that the originally obscure or less prominent features in M2 become more significant and more recognizable; use Conv3x3 to perform 3x3 convolution operation on M3 to generate M4, and the 3x3 convolution kernel slides and scans on the data of M3 to capture the feature associations and changes between different positions and local areas. In this way, the feature information in M3 is further refined and integrated; use Conv1x1 to adjust the channels of M4 to obtain M5 to meet the requirements of subsequent operations and data dimensions; use Concat to splice M1, M3, M4 and M5, and integrate the feature information contained in each of them into a new data structure to achieve the aggregation of different feature information; use Conv1x1 to adjust the number of channels after splicing to meet the requirements of subsequent operations and data dimensions, and output.
[0021] The above embodiments focus on the transformation 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. This embodiment uses the RGCSP module to replace the original backbone network, replaces the backbone network for feature extraction and processing, and outputs feature maps P3, P4 and P5 of different dimensions. These feature maps of different dimensions carry feature information of different levels and scales in the image.
[0022] The highest dimensional feature map P5, after being processed by the DAttention module, contains rich global semantic information and is suitable for large target detection. The other dimensional feature maps P3 and P4 contain detailed information, and their high resolution characteristics make them suitable for small target detection.
[0023] Exemplarily, the RGCSP module performs feature extraction through the following steps: S1-1: through the conv convolution layer (3x3 convolution, 128 channels, downsampled by 2 times); S1-2: Enter the RGCSP module to obtain the P3 feature map, including channel adjustment, feature segmentation, feature enhancement and splicing; S1-3: The input passes through the Conv convolution layer (3x3 convolution, 256 channels) and is downsampled by 2 times; S1-4: Enter the RGCSP module and obtain the P4 feature map; S1-5: The input passes through the Conv convolution layer (3x3 convolution, 384 channels) and is downsampled by 2 times; S1-6: Enter the RGCSP module and obtain the P5 feature map.
[0024] Exemplarily, the RGCSP module specifically processes the following steps: Conv1x1 channel adjustment: The input first passes through a 1x1 convolution to adjust the number of channels of the feature map.
[0025] Split feature segmentation: After 1x1 convolution, the feature map is split into two parts, denoted as M1 and M2. Among them: M1 remains as it is and is directly used for the final splicing; M2 is used for further feature enhancement.
[0026] RepConv feature enhancement: Apply RepConv to M2 to perform feature enhancement and obtain a new feature map M3.
[0027] Conv3x3 feature extraction: Perform a 3x3 convolution operation on M3 to further extract local features and generate feature map M4.
[0028] Conv1x1 channel adjustment: Apply a 1x1 convolution to M4 and further adjust the number of channels to obtain feature map M5.
[0029] Concat feature concatenation: M1, M3, M4, and M5 are concatenated through the concat operation to aggregate feature information from different paths.
[0030] Final Conv 1x1 output: Finally, a 1x1 convolution is used to adjust the number of channels after splicing and output the final feature map.
[0031] Exemplarily, the calculation formula of the RGCSP module feature map is as follows: in: Represents the segmentation of features after the initial convolution; RepConv performs feature enhancement on the segmented part; F2 represents the feature map after RepConv enhancement; It is after multiple 3x3 convolutions.
[0032] In another embodiment, it further includes adding a RepBN module; In this embodiment, in the process of building a deep learning model, the normalization operation is a very critical 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 many fields such as natural language processing and computer vision, but the LayerNorm in it will introduce a high computational complexity problem to a certain extent. For example, in the inference stage, LayerNorm needs to calculate the corresponding statistics (such as mean and variance) for each sample in real time for normalization, which will consume additional computing resources and time costs, affecting the overall operation efficiency of the model.
[0033] The RepBN module was proposed to solve this problem. Through its clever design and mechanism, it can improve the model efficiency while avoiding negative impact on the model training performance, thereby optimizing the model's computing speed while ensuring the accuracy of tasks such as target detection. Specifically, S2-1: After being processed by the RepBN module, normalization operation is performed to calculate the mean and variance and standardize the input features; S2-2: First, generate query Q, key K, value V through convolution layer; calculate offset Δp through 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; S2-1-1: The above RepBN solves the computational complexity problem 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 degradation during training.
[0034] 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, and LayerNorm plays a major role. As training progresses, γ gradually decays to 0, and BatchNorm completely replaces LayerNorm.
[0035] S2-1-3: Inference phase: After reparameterization, the model only needs BatchNorm during inference and no longer needs to calculate statistics, thus reducing inference latency.
[0036] S2-1-4: The RepBN formula is expressed as: in: η is a learnable parameter that controls the fusion of BatchNorm and Linear layers.
[0037] In another embodiment, the AIFI module in the RT-DETR network model is replaced by a DAttention module; the feature map P5 with the highest dimension is processed by the DAttention module to output Y5; that is, the multi-head attention in the original AIFI module is replaced by DAttention, and the feature map P5 with the highest dimension is extracted to obtain the output F5, which can effectively reduce the amount of calculation, especially when processing high-resolution feature maps, DAttention can handle spatial changes more flexibly; Exemplarily, the above DA-AIFI formula is expressed as: in: Q: Query vector, used to select the features of interest; K: Key vector, which is used to calculate similarity with the query; V: Value vector, containing feature information; Δp: offset, used to dynamically adjust the sampling position.
[0038] In another embodiment, the CCFM module in the RT-DETR network model is replaced by an FDPN module; wherein the FDPN module is used to perform feature fusion on feature maps of different dimensions, and the specific steps include: P3, P4, and Y5 enter the FocusFeature module for feature fusion to obtain N1; N1 undergoes conv (convolution) and upsample (upsample) operations respectively, and concat operations are performed with Y5 and P3 respectively to obtain N2 and N3; N2 and N3 are respectively input into the RepC3 module again for refinement processing to obtain N2' and N3'; N2', N3' and N1 are then sent to the FocusFeature module. re module, and obtain N1'; the step of feature fusion in the FocusFeature module includes: downsampling P3 through the ADOWN module, and adjusting the number of channels of P4 and P5 feature maps through the Conv convolution layer respectively; performing a concat operation on the processed P3, P4 and P5 to obtain a preliminary fused feature map; using 5x5, 7x7, 9x9 and 11x11 convolution kernels to process the preliminary fused feature map respectively, and retaining an identity mapping branch; fusing the outputs of all convolution kernel processing and identity mapping through an add operation, and then adjusting the number of channels using Conv1x1, and then performing an add operation with the preliminary fused feature map; In this embodiment, P3, P4, and Y5 carry feature information of different scales and different abstract levels extracted from the previous processing stages. P3 focuses on reflecting the relatively detailed and local features of the target object, and the features contained in P4 are at the middle level. Y5 is obtained after a specific module (such as the DAttention module mentioned above processes the feature map with the highest dimension), which contains more abstract and high-level feature content. When they enter the FocusFeature module, the information in these feature maps of different dimensions is fully interacted and integrated, and finally a fused feature representation is obtained, which we record as N1.
[0039] For example, S3-1: takes feature maps of three scales as input through FocusFeature, which contains an Inception-Style module that uses a set of parallel deep convolutions to capture rich information across multiple scales; S3-2: Convolution 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; after the upsampling operation, the feature map P3 is concatenated with the output of the feature focusing module to generate the final fusion feature; S3-3: Perform diffusion operation on the feature map processed by the FocusFeature module, so that the features of each scale have detailed context information, which is more conducive to the detection and classification of subsequent targets; S3-4: After secondary diffusion, the feature map is sent to detection; S3-1-1: The above FocusFeature module and diffusion mechanism can enable the features of each scale to have detailed contextual information, which is more conducive to the detection and classification of subsequent targets.
[0040] S3-1-2: FocusFeature formula expression: in: DWConv stands for depthwise convolution; S3-3-1: The above diffusion mechanism uses the FocusFeature module to process the intermediate-scale features to enhance the key spatial information; upsamples the lower-scale features so that they can match the higher-scale spatial dimensions, thereby promoting fusion between multiple scales; concatenates the feature maps that have been upsampled and feature focused, and then compresses and fuses them through the RcpC3 recursive convolution module; through layer-by-layer concatenation and fusion, it ensures that the features of each scale contain the contextual information of other scales, thereby achieving feature diffusion, that is, the information is expanded from a single scale to multiple scales, thereby enhancing the feature expression capability.
[0041] S3-3-2: The diffusion mechanism is expressed as: The multi-scale features P3 and P4 are fused through FocusFeature, then concatenated with Y5, and finally recursively compressed using the RcpC3 module to generate the final output feature Fout. This process effectively realizes the deep fusion and compression of features and improves the model's ability to detect multi-scale targets.
[0042] In another embodiment, it also includes replacing the GIoU module in the RT-DETR network model with a Wise-IoU module; In this embodiment, the WISE-IOU module optimizes the overlap between the predicted frame and the real frame through the following steps, thereby further improving the accuracy of target positioning. Specifically: S4-1: In Wise-IoU, a distance attention mechanism is used to amplify the loss value of ordinary quality anchor boxes, improving the overall performance of the detector. This method reduces the competitiveness of high-quality anchor boxes while reducing the harmful gradients generated by low-quality examples without adding additional computational complexity. Defined as: in: L IoUis the standard IoU loss; R WIoU is the distance attention factor of the original Wise-IoU v1, and its calculation formula is: Among them: x, y are the center coordinates of the prediction box, and x gt ,y gt The center coordinate of the real box, W g , H g is the size of the minimum enclosing rectangle.
[0043] The embodiments of the present application also provide a target detection method, including: constructing a target detection model using the construction method; obtaining an image to be detected; detecting the image to be detected using the target detection model; after successfully constructing the target detection model through the above embodiments, the step of obtaining the image to be detected is followed. In actual application scenarios, the source of the image to be detected is very wide. It can be a monitoring screen obtained by real-time acquisition by a camera, such as a road scene image containing multiple target objects such as vehicles, pedestrians, and buildings taken by a traffic monitoring system or a drone; it can also be an image extracted from a stored image database for a specific detection task, such as an image of human tissue and organ selected from a case library in medical imaging diagnosis; when performing detection, a series of preprocessing operations are first performed on the image to be detected, such as adjusting the size of the image to a size that meets the model input requirements, normalizing the color of the image, etc., to ensure that the image data can be input into the model in the best state for feature extraction and analysis.
[0044] The embodiment of the present application also provides a target detection device, comprising: a construction module, used to construct a target detection model using the construction method; an acquisition module, used to acquire an image to be detected; a detection module, used to detect the image to be detected using the target detection model; This embodiment constructs a construction module, an acquisition module and a detection module through a computer program. The construction module is used to construct a target detection module using the method of the above embodiment. The acquisition module is used to acquire the image to be detected. The detection module gives the category information of the target object and the reliability of the detection based on the determination of the category to which the target object belongs by the target detection model and the corresponding confidence score, thereby achieving comprehensive and accurate target detection of the image to be detected.
[0045] An embodiment of the present application also provides a target detection device, including a processor and a memory, wherein the memory is used to store program instructions, and the processor is used to call the program instructions to execute the target detection method; the device of this embodiment can be a mobile phone, a laptop computer, a tablet computer, a vehicle-mounted terminal, an unmanned aerial vehicle, etc., which has a memory and a processor arranged therein to execute the target detection method of the above embodiment.
[0046] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, and the computer program implements the target detection method when executed by a processor; in this 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 of the above embodiment.
[0047] This application also provides a specific embodiment for description: like Figure 1 As shown in the figure, the entire Rep-RTDETR model is improved on the basis of the RT-DETR model, and realizes efficient detection of multi-scale targets. The network architecture of the entire model is shown in the figure. First, the input image is extracted through the backbone network (RGCSP). The backbone part gradually extracts features by alternating between convolutional layers (Conv) and RGCSP modules. Figure 2 As shown, RGCSP is calculated by formula (1): Enhance feature extraction capabilities and reduce computational complexity. The network starts with a lower number of channels, and increases the number of channels and downsampling strides layer by layer, thereby gradually extracting higher-level features in each layer. The initial convolutional layer increases the number of channels of the input data to 64 and reduces the resolution; then, through repeated stacking of each layer, the number of channels of the network increases to 128, 256, and 384, and the resolution is gradually halved, generating {P3, P4, P5} feature maps in turn as the input of the encoding layer.
[0048] Next, before the features enter the DA-AIFI module, the RepBN strategy is adopted. As the training progresses, BatchNorm completely replaces LayerNorm. After the model is trained, through formula (2): Reparameterize the BN layer into a convolutional layer or other linear transformation. Normalization helps stabilize the feature distribution and makes subsequent attention calculations more accurate. After that, DA-AIFI is calculated by formula (3): Attention features are extracted from the P5 feature map to obtain output Y5.
[0049] The features of {P3, P4, Y5} are fused through the FDPN network, such as Figure 3 As shown, the FocusFeature module in FDPN is calculated by formula (4): To fuse feature maps of different sizes, Figure 4 As shown, through the diffusion mechanism formula (5): .
[0050] By upsampling and concatenating multi-scale features, and using RepC3 to improve feature expression capabilities, the detection accuracy and the ability to recognize detailed targets are improved by combining multi-scale information and attention mechanisms.
[0051] The improved Wise-IoU increases the loss value of anchor boxes of normal quality by adding a distance attention mechanism, and introduces a dynamic weighting term based on IoU. It can adaptively focus on anchor boxes of different qualities during training. Through formula (6): The dynamic weighting term gives low IoU samples a higher loss weight, thereby improving the model's performance in positioning accuracy and detection effect.
[0052] This dataset is a public anti-UAV dataset, and the training set contains 1981 images. Using the anti-UAV dataset, this embodiment is compared with the RT-DETR model, and the results are shown in the following table.
[0053] In order to further prove the effectiveness of the present method, the present invention conducted relevant ablation experiments, where A is the RT-DETR model, B uses RGCSP in Backbone based on the A model, C uses the DA-AIFI module based on the A model, D uses the RGCSP network module in Backbone based on the A model and uses 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., an embodiment of the present application).
[0054] As can be seen from Table 1, the synergy of the RGCSP and FDPN modules in the embodiment of the present application can greatly reduce the training parameters of the model and the computational complexity of the model, and can also partially improve the accuracy, but only using the RGCSP or only using the FDPN module, although there are some improvements compared to the A model, it is impossible to fully achieve similar technical effects. Specifically, the Rep-RTDETR model (A in Table 1) has a 30.34% reduction in parameters, a 43.40% reduction in model complexity, and an increase of 2.4% in mAP50-95. It fully demonstrates that the RGCSP module and the FDPN network module have a good effect on the extraction and fusion of small target features, and can effectively reduce the overall network parameter amount and model complexity, that is, improve the detection accuracy of small targets in the aerial environment, optimize the computing resource requirements, and facilitate deployment in resource-constrained environments (such as drones).
[0055] Table 1: Ablation experiment of Rep-RTDETR At the same time, the REP-RTDETR proposed in Table 2 is compared with the current mainstream YOLO and the target detection network based on the DETR framework.
[0056] Compared with YOLOv8-L / RT-DETR (ResNet18) / RT-DETR (ResNet50) in the series, REP-RTDETR has improved mAP50-95 by 3.7%, 2.4%, and 1.1%, respectively, and the number of network parameters has been reduced by 68.27%, 30.34%, and 69.06%, respectively.
[0057] Table 2: Comparative experiments of mainstream models Because drone target images vary in size, the GIoU used in RT-DETR is not stable enough when processing small targets. The Rep-RTDETR model of the embodiment of the present application is combined with GIoU and Wise-IoU respectively. 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 problems of category imbalance or regional importance, the weights can be dynamically adjusted according to different tasks or data sets, which can more realistically reflect the detection effect of the model.
[0058] Table 3: Loss function comparison experiment Although the embodiments of the present invention have been disclosed as above, they are not limited to the applications listed in the specification and the implementation modes, and they can be fully applied to various fields suitable for the present invention. For those familiar with the art, additional modifications can be easily implemented. Therefore, without departing from the general concept defined by the claims and the scope of equivalents, the present invention is not limited to the specific details and the illustrations shown and described herein.
Claims
1. A method for constructing a target detection model, characterized in that: include: The backbone network in the RT-DETR network model is replaced by the RGCSP module to obtain an improved RT-DETR network model. Using the training set to train the improved RT-DETR network model to obtain the target detection model; Among them, the RGCSP module is used to process the input image and output feature maps P3, P4 and P5 of different dimensions. The RGCSP module processes the input including: adjusting the number of input channels through Conv1x1; dividing the input into two parts through Split, respectively recorded as M1 and M2; using RepConv to enhance the features of M2 to obtain M3; using Conv3x3 to perform a 3x3 convolution operation on M3 to generate M4; using Conv1x1 to adjust the channels of M4 to obtain M5; using Concat to splice M1, M3, M4 and M5; using Conv1x1 to adjust the number of channels after splicing, and output.
2. The target detection model construction method according to claim 1, characterized in that: It also includes replacing the AIFI module in the RT-DETR network model with a DAttention module; The DAttention module is used to process the feature map P5 with the highest dimension and output Y5.
3. The target detection model construction method according to claim 2, characterized in that: It also includes replacing the CCFM module in the RT-DETR network model with the FDPN module; The FDPN module is used to perform feature fusion on feature maps of different dimensions. The specific steps include: P3, P4, and Y5 enter the FocusFeature module for feature fusion to obtain N1; N1 undergoes conv and upsample operations respectively, and concats with Y5 and P3 respectively to obtain N2 and N3; N2 and N3 are respectively input into the RepC3 module again for refinement processing to obtain N2' and N3'; N2', N3' and N1 are sent to the FocusFeature module again to obtain N1'; The step of feature fusion of the FocusFeature module includes: downsampling P3 through the ADOWN module, and adjusting the number of channels of P4 and P5 feature maps through the Conv convolution layer respectively; performing a concat operation on the processed P3, P4 and P5 to obtain a preliminary fused feature map; processing the preliminary fused feature map using 5x5, 7x7, 9x9 and 11x11 convolution kernels respectively, and retaining an identity mapping branch; fusing the outputs of all convolution kernel processing and identity mapping through an add operation, and then adjusting the number of channels using Conv1x1, and then performing an add operation with the preliminary fused feature map.
4. The target detection model construction method according to claim 2, characterized in that: It also includes replacing the GIoU module in the RT-DETR network model with the Wise-IoU module.
5. The target detection model construction method according to claim 1, characterized in that: It also includes the addition of the RepBN module.
6. A target detection method, characterized in that: include: Constructing a target detection model using the construction method described in any one of claims 1 to 5; Acquire the image to be detected; The target detection model is used to detect the image to be detected.
7. A target detection device, characterized in that: include: A construction module, used to construct a target detection model using the construction method described in any one of claims 1 to 5; An acquisition module, used for acquiring an image to be detected; A detection module is used to detect the image to be detected using the target detection model.
8. A target detection device, characterized in that: It comprises a processor and a memory, wherein the memory is used to store program instructions, and the processor is used to call the program instructions to execute the target detection method according to claim 6.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the target detection method according to claim 6 is implemented.
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
Cited By
Helicopter blade flapping amount measuring method based on self-luminous mark point detection
CN120558097A
Intersection safety evaluation method based on unmanned aerial vehicle and large model
CN120766167A
Plateau meadow alopecia areata and degradation degree monitoring method based on improved YOLOv8
CN122200430A
A method for monitoring patchy alopecia and degradation in alpine meadows based on an improved YOLOv8
CN122200430B