High-robustness target detection model and target detection method
By combining the backbone feature extraction network, feature fusion network and head network in the target detection model in the field of marine engineering, and using the bidirectional feature pyramid network and the enhanced attention module, the robustness of ship detection in the marine environment in the existing technology is solved. It solves the problem of shortcomings and achieves a balance between high precision and real-time performance.
Patent Information
- Application Number
- CN202410744728.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-09-03
AI Technical Summary
In the field of marine engineering, existing deep learning-based ship target detection technology is difficult to achieve a good balance between high accuracy and real-time performance in harsh marine environments, and multi-scale and multi-category ship detection increases the difficulty. The existing technology is rude and Not enough stickiness.
A highly robust target detection model is designed. Through the combination of the backbone feature extraction network, feature fusion network and head network, the bidirectional feature pyramid network is used for feature fusion, and the detection performance is improved by enhancing the attention module and post-processing operations. .
It improves the robustness and accuracy of target detection, can effectively identify multi-scale and multi-category ships in complex ocean environments, and achieves a good balance between high accuracy and real-time performance.
Smart Images

Figure CN118587501A
Abstract
Description
Technical Field
[0001] The present invention relates to a target detection model and a target detection method, in particular to a highly robust Background Art
[0002] In the field of marine engineering, ship detection plays a vital role.
[0003] In the existing technology, ship target detection technology based on deep learning can automatically extract data features.
[0004] First, the marine environment is more complex than land and is more susceptible to severe weather.
[0005] Secondly, ships of multiple sizes and categories further increase the difficulty of ship detection.
[0006] In addition, how to achieve a good performance balance between high precision and real-time performance is an important issue for actual deployment. Summary of the invention
[0007] The purpose of the present invention is to overcome the deficiencies in the prior art and provide a highly robust target detection system.
[0008] According to the technical solution provided by the present invention, a highly robust target detection model is provided, wherein the target detection
[0009] The backbone feature extraction network, feature fusion network, and head network are connected in sequence;
[0010] The backbone feature extraction network includes a feature extraction basic network and a network for improving feature extraction performance.
[0011] The different scale features extracted by the backbone feature extraction network are subjected to feature fusion network.
[0012] The feature fusion network performs feature fusion based on the feature fusion method of the bidirectional feature pyramid network.
[0013] The reasoning information output by the enhanced attention module is processed by the head network to
[0014] The network output information output by the head network is processed by the preset post-processing operation to output the target detection information.
[0015] The feature extraction basic network includes a first convolutional layer of the backbone, a second convolutional layer of the backbone, and
[0016] The fifth convolutional layer of the backbone of the feature extraction basic network is adaptively connected to the efficient feature extraction module;
[0017] The efficient feature extraction module is also adaptively connected to the backbone SPC module;
[0018] During feature extraction, the image to be recognized is sequentially connected through the first convolutional layer of the backbone, the second convolutional layer of the backbone, and the
[0019] The backbone second CSP feature extraction module and backbone third CSP feature extraction module in the feature extraction network
[0020] The efficient feature extraction module includes a first feature extraction branch and a second feature extraction branch.
[0021] Output of the first branch of feature extraction, the second branch of feature extraction, and the first convolutional layer in feature extraction
[0022] A cross-stage stacking unit is set on the second feature extraction branch, wherein the cross-stage stacking unit
[0023] For EMHSA modules in a cross-stage stacked unit, the first EMHSA module receives feature extraction
[0024] For each EMHSA module, including the first convolutional layer in the module, the second convolutional layer in the module, and
[0025] The first convolutional layer in the module is connected to the first MatMul
[0026] The second convolutional layer in the module is connected to the first MatMul
[0027] The third convolutional layer in the module is connected to the second MatMul
[0028] The first MatMul connection layer in the module is connected to the fourth volume in the module through the downscaling module.
[0029] The second MatMul connection layer in the module is connected to the fourth dimension transformation module in the module, and through the
[0030] For two stacked EMHSA modules, one EMHSA module
[0031] The backbone SPC module includes a first convolution block in the module, a second convolution block in the module, and
[0032] The third convolutional block in the module is also connected to the first maximum pooling layer in the module and the second pooling layer in the module.
[0033] The third convolutional block in the module, the first maximum pooling layer in the module, the second pooling layer in the module, and the module
[0034] The first feature connection block in the module is connected to the fifth convolution block in the module, and the fifth convolution block in the module is connected to
[0035] The sixth convolution block in the module and the fourth convolution block in the module are connected by the second feature connection block in the module.
[0036] The second feature connection block in the module is connected to the seventh convolution block in the module, and the seventh convolution block in the module is connected to
[0037] The feature fusion network includes a feature fusion first convolution layer, a feature fusion second convolution layer, a feature fusion
[0038] The first convolutional layer of feature fusion is adaptively connected to the backbone SPC module.
[0039] The first convolutional layer of feature fusion is connected with the third CSP feature of the backbone through the second concatenation connector of feature fusion.
[0040] The feature fusion second splicing connector is connected by the feature fusion CSP feature extraction module and the feature fusion second
[0041] The second convolutional layer of feature fusion is connected with the second CSP feature of the backbone through the first concatenation connector of feature fusion.
[0042] The output of the first feature fusion splicing connector is connected to the first EAM module in the enhanced attention module.
[0043] The output of the third feature fusion connector is connected to the second EAM module in the enhanced attention module.
[0044] The output of the fourth feature fusion connector is connected to the third EAM module in the enhanced attention module.
[0045] The first EAM module, the second EAM module and the third EAM module are all adapted to the head network
[0046] The first splicing connector of feature fusion, the second splicing connector of feature fusion, and the third splicing connector of feature fusion
[0048] in,
[0049] The first EAM module, the second EAM module and the third EAM module all include enhanced injection
[0050] The enhanced attention first branch includes a first branch convolution block;
[0051] The second branch of enhanced attention includes a second branch convolution block and a second branch convolution block suitable for
[0052] The first branch convolution block and the NAM channel attention module are connected via an enhanced attention feature connection block;
[0053] The enhanced attention feature connection block is output by the enhanced attention convolution block.
[0054] The NAM channel attention module includes a batch normalization layer and a weight layer, where:
[0055] The batch normalization layer is connected to the output of the second branch convolution block;
[0056] The batch normalization layer and the weight layer are multiplied channel by channel through the multiplier, and the output of the multiplier is Sigmoid
[0057] For the batch normalization layer, the BN scale factor is used to represent the importance of each channel in the batch normalization layer.
[0058] For the BN scaling factor, we have:
[0060] Among them, BN in is the output of the second branch convolution block, λ, β are affine transformation parameters, μ is the affine transformation
[0061] A highly robust target detection method, the target detection method comprising:
[0062] Provide a target detection terminal device for performing target detection, and in the target detection terminal device
[0063] Before deploying the target detection model in the target detection terminal device, at least
[0064] The target detection terminal device receives the image to be detected and uses the target detection model to detect the received image.
[0065] The advantages of the present invention are: the backbone feature extraction network uses an efficient feature extraction module to achieve downsampling and BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 A schematic diagram of an embodiment of the target detection model of the present invention.
[0067] Figure 2 A schematic diagram of an embodiment of an efficient feature extraction module of the present invention.
[0068] Figure 3 It is a schematic diagram of an embodiment of the backbone SPPCSPC module of the present invention.
[0069] Figure 4 The first EAM module, the second EAM module and the third EAM module of the present invention are
[0070] Figure 5 A schematic diagram of an embodiment of generating target category information during target detection according to the present invention.
[0071] Explanation of the accompanying drawings: 1-backbone feature extraction network, 2-feature fusion network, 3-head network. DETAILED DESCRIPTION
[0072] The present invention will be further described below in conjunction with specific drawings and embodiments.
[0073] In order to improve the robustness of target detection, for a highly robust target detection model, the present invention
[0074] The backbone feature extraction network 1, the feature fusion network 2, and the head network 3 are connected in sequence;
[0075] The backbone feature extraction network 1 includes a feature extraction basic network and a network for improving feature extraction.
[0076] The different scale features extracted by the backbone feature extraction network are then fused using feature fusion network 2.
[0077] Feature fusion network 2 performs feature fusion based on the feature fusion method of the bidirectional feature pyramid network.
[0078] The reasoning information output by the enhanced attention module is processed by the head network 3.
[0079] The network output information output by the head network 3 is output as target detection after the preset post-processing operation.
[0080] Figure 1 An embodiment of the target detection model is shown in FIG.
[0081] The backbone feature extraction network 1 is used to extract different scale features of the target detection image.
[0082] Feature fusion network 2 is used to aggregate the features extracted by backbone feature extraction network 1.
[0083] The reasoning information output by the enhanced attention module is processed by the head network 3.
[0084] The network output information output by the head network 3 is output as target detection after the preset post-processing operation.
[0085] In one embodiment of the present invention, the feature extraction basic network includes a backbone connected in sequence
[0086] The fifth convolutional layer of the backbone of the feature extraction basic network is adaptively connected to the efficient feature extraction module;
[0087] The efficient feature extraction module is also adaptively connected to the backbone SPC module;
[0088] During feature extraction, the image to be recognized is sequentially connected through the first convolutional layer of the backbone, the second convolutional layer of the backbone, and the
[0089] The backbone second CSP feature extraction module and backbone third CSP feature extraction module in the feature extraction network
[0090] Figure 1 An embodiment of the backbone feature extraction network 1 is shown in FIG. Figure 1 The main
[0091] For the above feature extraction basic network, the efficient feature extraction module is connected to the fifth convolutional layer of the backbone.
[0092] In specific implementation, the parameters of the first convolutional layer of the backbone can be: the size of the convolution kernel is 6×6, the convolution
[0093] In specific implementation, the first convolutional layer to the fifth convolutional layer of the backbone can also be configured with other parameters.
[0094] The first CSP feature extraction module of the trunk, the second CSP feature extraction module of the trunk and the
[0095] Figure 1 In the example, the first CSP feature extraction module of the backbone includes a CSP feature extraction module, the backbone
[0096] From the above-mentioned backbone feature network 1, we can see that when extracting features, deep learning
[0097] In one embodiment of the present invention, the efficient feature extraction module includes a first feature extraction branch
[0098] Output of the first branch of feature extraction, the second branch of feature extraction, and the first convolutional layer in feature extraction
[0099] A cross-stage stacking unit is set on the second feature extraction branch, wherein the cross-stage stacking unit
[0100] For EMHSA modules in a cross-stage stacked unit, the first EMHSA module receives feature extraction
[0101] Figure 2 An embodiment of an efficient feature extraction module is shown in FIG. 1 , where Conv10 is a feature
[0102] Figure 2 In the above example, the output of the first convolutional layer of feature extraction is directly combined with the feature extraction layer
[0103] The number of EMHSA modules in the cross-stage stacking unit can be selected according to needs. Figure 2 It is shown in
[0104] Figure 2 In the feature extraction first branch, the first EMHSA module, the second EMHSA module and
[0105] In one embodiment of the present invention, for each EMHSA module, including the first convolutional layer in the module,
[0106] The first convolutional layer in the module is connected to the first MatMul
[0107] The second convolutional layer in the module is connected to the first MatMul
[0108] The third convolutional layer in the module is connected to the second MatMul
[0109] The first MatMul connection layer in the module is connected to the fourth volume in the module through the downscaling module.
[0110] The second MatMul connection layer in the module is connected to the fourth dimension transformation module in the module, and through the
[0111] For two stacked EMHSA modules, one EMHSA module
[0112] In specific implementation, the EMHSA modules in the cross-stage stacking unit can generally adopt the same form.
[0113] In the multi-head self-attention mechanism, the input usually first passes through a linear layer and then needs to be divided into
[0114] Figure 2 In the example, the input and output features of each EMHSA module are N×C / 2×H×W.
[0115] In one embodiment of the present invention, the backbone SPC module includes modules connected in sequence.
[0116] The third convolutional block in the module is also connected to the first maximum pooling layer in the module and the second pooling layer in the module.
[0117] The third convolutional block in the module, the first maximum pooling layer in the module, the second pooling layer in the module, and the module
[0118] The first feature connection block in the module is connected to the fifth convolution block in the module, and the fifth convolution block in the module is connected to
[0119] The sixth convolution block in the module and the fourth convolution block in the module are connected by the second feature connection block in the module.
[0120] The second feature connection block in the module is connected to the seventh convolution block in the module, and the seventh convolution block in the module is connected to
[0121] Specifically, the backbone SPC module can increase the network's receptive field to adapt to different resolutions.
[0122] Figure 3 The parameters of the first convolution block in the module can be: the convolution kernel size is 1×1, the step size is
[0123] Figure 3 In the example, MP1 is the first maximum pooling layer in the module, and MP2 is the second pooling layer in the module.
[0124] Figure 3 In the module, Cat1 is the first characteristic connection block in the module, and Cat2 is the second characteristic connection block in the module.
[0125] Figure 3 The receptive field of the first maximum pooling layer in the module is RF: 15×15; the receptive field of the second pool in the module is
[0126] In one embodiment of the present invention, the feature fusion network 2 includes a feature fusion first convolutional layer,
[0127] The first convolutional layer of feature fusion is adaptively connected to the backbone SPC module.
[0128] The first convolutional layer of feature fusion is connected with the third CSP feature of the backbone through the second concatenation connector of feature fusion.
[0129] The feature fusion second splicing connector is connected by the feature fusion CSP feature extraction module and the feature fusion second
[0130] The second convolutional layer of feature fusion is connected with the second CSP feature of the backbone through the first concatenation connector of feature fusion.
[0131] The output of the first feature fusion splicing connector is connected to the first EAM module in the enhanced attention module.
[0132] The output of the third feature fusion connector is connected to the second EAM module in the enhanced attention module.
[0133] The output of the fourth feature fusion connector is connected to the third EAM module in the enhanced attention module.
[0134] The first EAM module, the second EAM module and the third EAM module are all adapted to the head network
[0135] Figure 1 An embodiment of the feature fusion network 2 is shown in FIG. 6 , where Conv6 is a feature fusion network.
[0136] In specific implementation, the parameters of the first convolutional layer of feature fusion can be: using a 1×1 convolution kernel,
[0137] For the feature fusion first splicing connector, the feature fusion second splicing connector, the feature fusion first
[0138] In one embodiment of the present invention, the first splicing connector of the feature fusion and the second splicing connector of the feature fusion are
[0140] in,
[0141] In specific implementation, the first splicing connector of feature fusion, the second splicing connector of feature fusion,
[0142] For the feature fusion second splicing connector, the feature fusion third splicing connector and the feature fusion
[0143] Depend on Figure 1 It can be seen that when feature fusion is performed, the direction of feature fusion includes the first volume of feature fusion
[0144] Based on the above feature fusion network 2, it can be seen that when performing feature fusion, it can be adaptively learned
[0145] Figure 1 The three EAM modules output three specifications of target reasoning information respectively.
[0146] In one embodiment of the present invention, the first EAM module, the second EAM module and the third EAM
[0147] The enhanced attention first branch includes a first branch convolution block;
[0148] The second branch of enhanced attention includes a second branch convolution block and a second branch convolution block suitable for
[0149] The first branch convolution block and the NAM channel attention module are connected via an enhanced attention feature connection block;
[0150] The enhanced attention feature connection block is output by the enhanced attention convolution block.
[0151] Figure 1 An embodiment of an enhanced attention module including three EAM modules is shown in FIG.
[0152] Figure 4 In the enhanced attention first branch, the first branch convolutional block is included. Figure 4 In the example, Conv23 is
[0153] The second branch of enhanced attention includes the second branch convolution block, Figure 4 In the example, Conv24 is the second
[0154] Figure 4 In the example, Cat3 is an enhanced attention feature connection block, where the enhanced attention feature connection block
[0155] From the above description and Figure 1 It can be seen that the first EAM module, the second EAM module and the third EAM
[0156] In one embodiment of the present invention, the NAM channel attention module includes a batch normalization layer and
[0157] The batch normalization layer is connected to the output of the second branch convolution block;
[0158] The batch normalization layer and the weight layer are multiplied channel by channel through the multiplier, and the output of the multiplier is Sigmoid
[0159] For the batch normalization layer, the BN scale factor is used to represent the importance of each channel in the batch normalization layer.
[0160] For the BN scaling factor, we have:
[0162] Among them, BN in is the output of the second branch convolution block, λ, β are affine transformation parameters, μ is the affine transformation
[0163] Figure 4 An embodiment of the NAM channel attention module is also shown in FIG. 1 , in which the batch normalization layer
[0164] Specifically, the batch normalization (BN) layer is a common layer in deep learning.
[0165] For the above NAM channel attention module, we have:
[0166] F C =sigmoid(W γ (BN(F1))
[0167] Among them, F C represents the output features of the NAM channel attention module, that is, Figure 4 Sigmoid activation
[0168] In specific implementation, for targets that do not require much attention in terms of space, use the NAM channel to inject
[0169] From the above description, we can see that the NAM channel attention module is a lightweight and efficient attention machine
[0170] Based on the above target detection model, a highly robust target detection method can be obtained.
[0171] Provide a target detection terminal device for performing target detection, and in the target detection terminal device
[0172] Before deploying the target detection model in the target detection terminal device, at least
[0173] The target detection terminal device receives the image to be detected and uses the target detection model to detect the received image.
[0174] Specifically, the target detection terminal device can be an existing commonly used computer device to meet the target
[0175] The following takes the target detection of ships in the ocean environment as an example to train the target detection model.
[0176] When training the target detection model, it is necessary to build a model training dataset.
[0177] In order to expand the number of samples and enhance the generalization and robustness of the target detection model,
[0178] In a feasible embodiment, after the sample quantity is expanded, the number of model training data sets can be
[0179] In addition, before training, you need to configure the necessary training parameters.
[0180] Specifically, after setting the training parameters, the target detection model is trained using the training data set.
[0181] It is understandable that when training and testing the target detection model, it is also necessary
[0182] During target detection, an image facing the ocean environment is provided and loaded into the target detection
[0183] In specific implementation, when it is necessary to detect other target objects, you can refer to the above process.
Claims
1. A highly robust target detection model, characterized by: The target detection model includes a backbone The backbone feature extraction network, feature fusion network, and head network are connected in sequence; The backbone feature extraction network includes a feature extraction basic network and a network for improving feature extraction performance. The different scale features extracted by the backbone feature extraction network are subjected to feature fusion network. The feature fusion network performs feature fusion based on the feature fusion method of the bidirectional feature pyramid network. The reasoning information output by the enhanced attention module is processed by the head network to The network output information output by the head network is processed by the preset post-processing operation to output the target detection information.
2. The highly robust target detection model according to claim 1, characterized in that: The features The fifth convolutional layer of the backbone of the feature extraction basic network is adaptively connected to the efficient feature extraction module; The efficient feature extraction module is also adaptively connected to the backbone SPC module; During feature extraction, the image to be recognized is sequentially connected through the first convolutional layer of the backbone, the second convolutional layer of the backbone, and the The backbone second CSP feature extraction module and backbone third CSP feature extraction module in the feature extraction network 3. The highly robust target detection model according to claim 2, characterized in that: The efficient Output of the first branch of feature extraction, the second branch of feature extraction, and the first convolutional layer in feature extraction A cross-stage stacking unit is set on the second feature extraction branch, wherein the cross-stage stacking unit For EMHSA modules in a cross-stage stacked unit, the first EMHSA module receives feature extraction 4. The highly robust target detection model according to claim 3, characterized in that: For each The first convolutional layer in the module is connected to the first MatMul The second convolutional layer in the module is connected to the first MatMul The third convolutional layer in the module is connected to the second MatMul The first MatMul connection layer in the module is connected to the fourth volume in the module through the downscaling module. The second MatMul connection layer in the module is connected to the fourth dimension transformation module in the module, and through the For two stacked EMHSA modules, one EMHSA module 5. The highly robust target detection model according to claim 2, characterized in that: The backbone The third convolutional block in the module is also connected to the first maximum pooling layer in the module and the second pooling layer in the module. The third convolutional block in the module, the first maximum pooling layer in the module, the second pooling layer in the module, and the module The first feature connection block in the module is connected to the fifth convolution block in the module, and the fifth convolution block in the module is connected to The sixth convolution block in the module and the fourth convolution block in the module are connected by the second feature connection block in the module. The second feature connection block in the module is connected to the seventh convolution block in the module, and the seventh convolution block in the module is connected to 6. The highly robust target detection model according to claim 2, characterized in that: The features The first convolutional layer of feature fusion is adaptively connected to the backbone SPC module. The first convolutional layer of feature fusion is connected with the third CSP feature of the backbone through the second concatenation connector of feature fusion. The feature fusion second splicing connector is connected by the feature fusion CSP feature extraction module and the feature fusion second The second convolutional layer of feature fusion is connected with the second CSP feature of the backbone through the first concatenation connector of feature fusion. The output of the first feature fusion splicing connector is connected to the first EAM module in the enhanced attention module. The output of the third feature fusion connector is connected to the second EAM module in the enhanced attention module. The output of the fourth feature fusion connector is connected to the third EAM module in the enhanced attention module. The first EAM module, the second EAM module and the third EAM module are all adapted to the head network 7. The highly robust target detection model according to claim 6, characterized in that: Feature Fusion in, 8. The highly robust target detection model according to claim 6 or 7, characterized in that: For The enhanced attention first branch includes a first branch convolution block; The second branch of enhanced attention includes a second branch convolution block and a second branch convolution block suitable for The first branch convolution block and NAM channel attention module are connected by the enhanced attention feature connection block; The enhanced attention feature connection block is output by the enhanced attention convolution block.
9. The highly robust target detection model according to claim 8, characterized in that: The NAM The batch normalization layer is connected to the output of the second branch convolution block; The batch normalization layer and the weight layer are multiplied channel by channel through the multiplier, and the output of the multiplier is Sigmoid For the batch normalization layer, the BN scale factor is used to represent the importance of each channel in the batch normalization layer. For the BN scaling factor, we have: Among them, BN in is the output of the second branch convolution block, λ, β are affine transformation parameters, μ is the affine transformation 10. A highly robust target detection method, characterized in that: The target detection method comprises: Provide a target detection terminal device for performing target detection, and in the target detection terminal device Before deploying the target detection model in the target detection terminal device, at least The target detection terminal device receives the image to be detected and uses the target detection model to detect the received image.
Citation Information
Patent Citations
Automatic driving road scene target detection method based on improved YOLOv7
CN117934816A
