Multi-scale feature enhancement and training methods and devices for small target detection in underwater sonar
By constructing a multi-scale feature pyramid network, utilizing sub-pixel skip connections and contextual enhancement, and combining an adaptive variance weighting method, the underwater sonar small target detection model is optimized, solving the problem of poor small target detection performance in traditional methods and achieving high accuracy and adaptive enhancement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- YICHANG TESTING TECHNIQUE RESEARCH INSTITUTE
- Filing Date
- 2022-11-16
- Publication Date
- 2026-05-26
AI Technical Summary
Traditional underwater sonar image target detection methods are not effective for detecting small targets and rely on manual feature design, which limits their versatility and detection performance, making them difficult to adapt to complex and ever-changing underwater environments.
A multi-scale target detection framework based on a feature pyramid network is constructed. The feature pyramid network is optimized through sub-pixel skip connections, context enhancement, and channel attention sharing. Combined with an adaptive variance weighting method, the accuracy of small-scale target detection is improved.
It improves the accuracy and adaptability of underwater sonar for small target detection, reduces the attenuation of high-altitude feature information, alleviates the fusion and aliasing effect, enhances the training effect of the detection model, and can be directly applied to computer equipment.
Smart Images

Figure CN116091908B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of sonar image processing, specifically relating to a multi-scale feature enhancement and training method and apparatus for underwater sonar small target detection. Background Technology
[0002] Synthetic Aperture Sonar (SAS) works similarly to Synthetic Aperture Radar (SAR), utilizing a uniformly moving acoustic array to replace the real aperture with a virtual aperture, significantly improving the sonar's lateral resolution. SAS is unaffected by weather, lighting, or water conditions, enabling all-weather, 24 / 7 underwater target detection, and is currently widely used in both civilian and military fields. my country has a long coastline and abundant waterways, requiring numerous detection and surveillance tasks. Relying on manual processing and analysis of massive amounts of image data is impractical due to extremely low efficiency and high costs; therefore, the need for target detection algorithms for underwater sonar is urgent.
[0003] Traditional sonar image target detection methods primarily rely on manual feature extraction. William et al. designed an unsupervised real-time target detection algorithm for large-scale SAS images, achieving rapid target detection through a cascaded architecture and integral feature representation of the image. They also designed a seabed depth-based sonar image target detection method, utilizing image context and seabed depth information for underwater target detection in complex environments. Groen proposed a detection method based on seabed acoustic wave intensity, using data from seabed echoes, clutter, and underwater vehicles to analyze environmental statistics and calculate the location of seabed targets. However, the feature information extracted by traditional methods is often limited to textures and contours, which are only applicable to specific scenarios, resulting in limited versatility and detection effectiveness. Furthermore, they require extensive professional experience and knowledge for manual design. Currently, various application environments are filled with many complex factors and interferences, rendering traditional methods inadequate, especially for detecting small targets in underwater sonar images.
[0004] In recent years, deep learning technology has developed rapidly, achieving remarkable results in the field of computer vision. For the challenge of small target detection in color images, multi-scale target detection frameworks, represented by Feature Pyramid Networks (FPNs), have achieved outstanding results. Among them, M2Det designs a multi-level joint feature pyramid network that can extract richer feature representations; AugFPN systematically analyzes and improves some shortcomings of FPNs, proposing a residual-based attention enhancement module; RCNet proposes a local bidirectional feature fusion method, further enhancing the expressive power of multi-scale features and improving the detection accuracy of small-scale targets. Although these methods have achieved good results in visible light images, they have not been specifically studied for the characteristics of SAS images, and their effectiveness in underwater small target detection tasks remains unclear. Therefore, it is necessary to design a multi-scale target detection algorithm suitable for underwater sonar small target detection tasks. Summary of the Invention
[0005] In view of this, the present invention provides a multi-scale feature enhancement and training method for underwater sonar small target detection. This method enables the expression of multi-scale features and improves the detection accuracy of small-scale targets. The method includes:
[0006] Step S1: Construct the backbone network of the multi-scale target detection framework based on Feature Pyramid Network (FPN). The backbone network includes a first combination of four layers of multi-scale features with different resolutions, labeled as {C2, C3, C4, C5}. The first combination includes a first-layer scale feature C2, a second-layer scale feature C3, a third-layer scale feature C4, and a fourth-layer scale feature C5.
[0007] Step S2: Based on subpixel skip connections, fuse the high-level features of the Feature Pyramid Network (FPN); based on subpixel context enhancement, fuse all scale features of the Feature Pyramid Network (FPN); implement channel attention sharing guidance to optimize the generated Feature Pyramid Network (FPN) and form an improved Feature Pyramid Network.
[0008] Step S3: Construct an overall target detection model based on the backbone network and the improved feature pyramid network, load the pre-trained overall target detection model and the sonar image dataset, and train it;
[0009] Step S4: Weight the multi-scale loss values, select the two scales with the highest variance reduction rate for enhancement, increase their weights, and keep the weights of the other scales unchanged;
[0010] Step S5: Weight and fuse the loss values at each scale, calculate the overall loss, and backpropagate to update the model parameters.
[0011] Specifically, step S1 further includes: a first combination of network outputs, whose length and width dimensions are progressively reduced by a factor of two, wherein the deformable convolution (DCN) uses a flexible and variable convolution window.
[0012] Specifically, step S2 implements subpixel-based skip connections to fuse high-level features of the Feature Pyramid Network (FPN). This includes: for features labeled {C4, C5} in the first combination with 1024 and 2048 channels, the fourth-layer scale feature C5 is first split into two parts along the channel dimension, and each part is upsampled twice via subpixel convolution. Then, the two parts are fused using pixel-level addition to obtain an intermediate feature with 256 channels. Next, the third-layer scale feature C4 is reduced in channel number through a 1×1 convolution, and then fused with the amplified intermediate feature of the fourth-layer scale feature C5 to finally obtain the feature labeled F4 in the second combination with 256 channels.
[0013] The first combination, denoted as {C3, C4}, consisting of a second-layer size feature C3 with 512 channels and a third-layer scale feature C4 with 1024 channels, is directly upsampled by a sub-pixel convolution to obtain an intermediate feature with 256 channels. Then, the second-layer size feature C3 is reduced in number of channels by a 1×1 convolution and then pixel-level additive fusion is performed with the upsampled intermediate feature of the third-layer scale feature C4 to obtain the feature denoted as F3 in the second combination with 256 channels.
[0014] For the first-level scale feature C2, the number of feature channels is already 256. It is directly copied to generate the feature labeled F2 in the second combination, thus completely generating the features in the second combination {F2, F3, F4}. The overall calculation process is shown in the following formula:
[0015]
[0016] in This indicates a 1×1 convolution to reduce channels, PS represents pixel rearrangement in subpixel convolution, and i is the index of the pyramid feature. The channel transformation is represented by operations such as 1×1 convolution or segmentation. If no channel transformation is required, it represents an identity mapping. Finally, the features in the second combination {F2, F3, F4} are fused down level by level to generate the features of the third combination {P2, P3, P4}.
[0017] Specifically, in step S2, the fusion of all scale features of the Feature Pyramid Network (FPN) based on sub-pixel context enhancement includes: for the features of the third combination {P2, P3, P4}, using the resolution of the features of P3 as a reference, performing bilinear interpolation upsampling on the features of P4, performing max pooling downsampling on the features of P2, and performing pixel-level addition fusion on the three-layer feature maps scaled to the same resolution to obtain feature map I; scaling feature map I through bilinear interpolation upsampling or max pooling downsampling, and adding it to the features of the third combination {P2, P3, P4} to generate feature pyramid {R2, R3, R4, R5}.
[0018] Specifically, in step S2, channel attention sharing guidance is implemented to optimize the generated Feature Pyramid Network (FPN) and form an improved Feature Pyramid Network. The feature is characterized in that: for the fused feature map I, global average pooling and global max pooling are performed independently in two branches to obtain two different spatial information vectors.
[0019] Specifically, step S3 includes: during detector training, the total number of iterations is fixed, and as training progresses, the loss values generated in each iteration form a time-ordered sequence, as shown below:
[0020]
[0021] Where m is the current iteration, T is the total number of iterations, and i represents the index of each scale level of the pyramid; in order to calculate the variance of the loss value, and to avoid the loss from a single iteration being L. i,m Outliers are identified, so an iteration step size constant α is introduced. The loss values within each step are summed to obtain a loss sequence based on time series t. The iteration step size α is set to 50. Each iteration step is equivalent to a time t, and the corresponding variance is calculated using the following formula:
[0022]
[0023] The variance reduction rate of the loss at each scale can then be obtained, as shown below:
[0024]
[0025] Where ∈ = 0.00001 to avoid the denominator being zero, Var i,t and r i,t The initial values are set to 1 and 0 respectively.
[0026] Specifically, step S4 includes: weighting the multi-scale loss values, selecting the two scales with the highest variance reduction rate for enhancement, increasing their weights, while keeping the weights of the remaining scales unchanged; the method of increasing the weights is shown in the following formula:
[0027]
[0028] Where j represents the indices of the two scale levels to be enhanced, λ is the amplification constant, simply set to 1.5; the weights w for the remaining scales i It was adjusted to 1.
[0029] Specifically, step S5 includes: weighting and fusing the loss values at each scale, calculating the overall loss, backpropagating to update the model parameters, and introducing a loss function with weighting factors as shown below:
[0030]
[0031] If the set number of iterations has not been reached, training continues; if it has been reached, training ends, and an end-to-end target detection model is generated, which can be directly used for underwater sonar small target detection tasks.
[0032] This invention also proposes a multi-scale feature enhancement and training device for underwater sonar small target detection, comprising:
[0033] The backbone network construction module is used to construct the backbone network of the multi-scale target detection framework based on the Feature Pyramid Network (FPN). The backbone network includes a first combination of four layers of multi-scale features with different resolutions, labeled as {C2, C3, C4, C5}. The first combination includes a first-layer scale feature C2', a second-layer scale feature C3, a third-layer scale feature C4, and a fourth-layer scale feature C5.
[0034] The Feature Pyramid Network (FPN) improvement module is used to fuse high-level features of the FPN based on sub-pixel skip connections; fuse all scale features of the FPN based on sub-pixel context enhancement; and optimize the generated FPN by implementing channel attention sharing guidance to form an improved feature pyramid network.
[0035] The model training module is used to construct an overall target detection model based on the backbone network and the improved feature pyramid network, load the pre-trained overall target detection model and the sonar image dataset, and perform training.
[0036] The scale weight setting module is used to weight the multi-scale loss values, select the two scales with the highest variance reduction rate for enhancement and increase their weights, while keeping the weight values of the other scales unchanged.
[0037] The overall loss calculation module is used to weight and fuse the loss values at each scale, calculate the overall loss, and backpropagate to update the model parameters.
[0038] Beneficial effects:
[0039] 1) In this invention, the subpixel-based skip connection utilizes subpixel convolution to perform feature upsampling while preserving channel information, thereby mitigating the problem of high-level feature information attenuation;
[0040] 2) In this invention, the sub-pixel-based context enhancement fuses contextual information with a larger receptive field in the highest-level features, and then enhances the features at each scale of the pyramid in the form of integrated feature maps, thereby improving the feature dilution phenomenon.
[0041] 3) In this invention, the channel attention sharing guidance extracts channel weights in a lightweight manner and optimizes each level of features after fusion, thereby mitigating the aliasing effect in the fusion process;
[0042] 4) In this invention, the adaptive variance weighting method weights the loss value upwards for scales that tend to stabilize, thereby enhancing the training effect of the detection model;
[0043] 5) The model trained in this invention can be directly used for underwater sonar small target detection tasks, improving the detection accuracy of small-scale targets, and can be directly deployed in computer equipment. Attached Figure Description
[0044] Figure 1 This is a flowchart of the multi-scale feature enhancement and training method for underwater sonar small target detection in this invention;
[0045] Figure 2 This is a framework diagram of the multi-scale underwater sonar small target detection model in this invention;
[0046] Figure 3 This is the improved feature pyramid network edge-node structure diagram in this invention;
[0047] Figures 4a-4b This is a structural diagram of the subpixel-based skip connection model implemented in this invention;
[0048] Figure 5 This is a structural diagram of the sub-pixel-based context enhancement model implemented in this invention;
[0049] Figure 6 This is a model structure diagram for implementing channel attention sharing guidance in this invention. Detailed Implementation
[0050] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0051] The present invention provides a technical solution which will be clearly and specifically described below with reference to the accompanying drawings.
[0052] like Figure 1 As shown, the specific implementation steps of the multi-scale feature enhancement and training method for underwater sonar small target detection are as follows:
[0053] Step S1: Construct the backbone network ResNet101-DCN for the object detection model. The network outputs the first combination of multi-scale features with four layers of different resolutions, labeled as {C2, C3, C4, C5}, with the length and width dimensions progressively reduced by a factor of two, as shown below. Figure 2 As shown. Deformable Convolution (DCN) uses flexible and variable convolution windows to enhance the expressive power of the backbone network. The number of deformable convolution groups is set to 1.
[0054] Step S2: Improve the feature pyramid network, specifically including:
[0055] Step S2.1: Implement subpixel-based skip connections, such as... Figure 3 As shown, high-level features of FPN are fused.
[0056] For the {C4, C5} features in the first combination with 1024 and 2048 channels, C5 is first split into two parts on an average basis according to the channel dimension, and subpixel convolution is performed on each part for upsampling by a factor of 2. Then, the two parts are fused by pixel-level addition to obtain an intermediate feature with 256 channels. Then, C4 is reduced in number of channels by 1×1 convolution and then fused with the amplified intermediate feature of C5 to finally obtain the F4 feature with 256 channels.
[0057] For the {C3, C4} features in the first combination with 512 and 1024 channels, C4 is directly upsampled by a factor of two through subpixel convolution to obtain an intermediate feature with 256 channels; then the C3 feature is reduced in number of channels through 1×1 convolution, and then fused with the upsampled intermediate feature of C4 through pixel-level additive fusion to obtain the F3 feature with 256 channels.
[0058] The overall calculation process is shown in the following formula:
[0059]
[0060] in denoted as 1×1 convolution to reduce channels, PS represents pixel rearrangement in subpixel convolution, and i is the index of the pyramid feature. This represents a channel transformation, using operations such as 1×1 convolution or segmentation. If no channel transformation is needed, it represents an identity mapping. The model structure diagram is as follows: Figures 4a-4b As shown.
[0061] Assuming the low-resolution image has dimensions W×H×C, and it needs to be enlarged r times to a high-resolution image with dimensions rW×rH×C, the first step is to use a 1×1 convolution to expand the channels, resulting in an intermediate image W×H×r. 2 C. Then perform subpixel rearrangement PS. The subpixel convolution operation is as follows:
[0062]
[0063] Where F represents the input feature, and (x, y, z) are the coordinates on the output HR feature map.
[0064] Since the C2 feature channel count is already 256, no adjustment is needed. Directly copy and generate the F2 feature. Finally, generate the second combination {P2, P3, P4}. Then, fuse the second combination {P2, P3, P4} features step-by-step downwards to generate the third combination {P2, P3, P4} features, as shown in the formula below:
[0065]
[0066] Step S2.2: Improve the feature pyramid network, such as... Figure 3 As shown, subpixel-based context enhancement is implemented, fusing all scale features of FPN.
[0067] For the features {P2, P3, P4} in the third combination, based on the resolution of feature P3, bilinear interpolation upsampling is performed on feature P4, and max pooling downsampling is performed on feature P2. The three feature maps scaled to the same resolution are then fused by pixel-level addition to obtain feature map I.
[0068] Assume feature C5 has dimensions of 2W×2H×8C, and integrated feature map I has dimensions of 4W×4H×C. Where C = 256, and W×H is determined by the resolution of the input image. Figure 5 As shown, C5 generates local features, local context features, and global context features through three independent paths:
[0069] a. 3×3 convolution is used to further refine the local features of C5, compressing its channel count to 4C while maintaining the same resolution. Then, subpixel convolution is used to perform a doubling upsampling operation.
[0070] b. First, 3×3 max pooling is used to extract local contextual information of C5. Then, 1×1 convolution is used to expand the number of channels to obtain an intermediate feature map of size W×H×16C. Next, subpixel convolution is performed to achieve four-fold upsampling. This process integrates local contextual information with a larger receptive field.
[0071] c. Perform global average pooling on C5 to obtain global context information. Then, compress the channels of the resulting 1×1×8C global features through a 1×1 convolution, and then globally copy them to a size of 4W×4H×C.
[0072] Finally, feature map I is scaled using bilinear interpolation upsampling or max pooling downsampling, and then added to the features {P2, P3, P4} to generate the feature pyramid {R2, R3, R4, R5}, calculated as follows:
[0073]
[0074] Here, ω represents the scaling operation. Since the semantic features of C5 are greatly enhanced by contextual information, the F5 and P5 nodes, which are the highest-level semantic features of FPN, become redundant. To ensure the efficiency of the model, these two nodes were removed.
[0075] Step S2.3: Improve the feature pyramid network, such as... Figure 3 As shown, channel attention is shared and guided to optimize the generated feature pyramid.
[0076] For the fused feature map I, two branches are used to independently perform global average pooling and global max pooling to obtain two different spatial information vectors with a size of 1×1×C. Since C=256 is a fixed value, a fully connected layer is directly used to process the spatial information vector, and then the channel weights are obtained by pixel-wise addition merging and the Sigmoid function. The channel weight values are shared and multiplied by {R2, R3, R4, R5}. The calculation formula is shown below:
[0077] CAG(x)=σ(fc1(AvgPool(x))+fc2(MaxPool(x)))
[0078] R i :=CAG(I)·R i
[0079] Where σ represents the Sigmoid function, AvgPool and MaxPool represent global average pooling and global max pooling operations, and fc1 and fc2 represent fully connected layers. The model structure diagram is shown below. Figure 6 As shown.
[0080] Step S3: Construct an overall target detection model based on the backbone network and feature pyramid network, load the pre-trained model and sonar image dataset, initialize all initial parameters for model training, set a certain number of iterations, and start training.
[0081] During detector training, the total number of iterations is fixed. As training progresses, the loss values generated in each iteration form a time-ordered sequence, as shown below:
[0082]
[0083] Where m is the current iteration, T is the total number of iterations, and i represents the index of each scale level of the pyramid. This is done to calculate the variance of the loss value, while avoiding a single iteration generating a loss of L. i,m Outliers are identified, so an iteration step size constant α is introduced. The loss values within each step are summed to obtain a loss sequence based on time series t. The iteration step size α is set to 50. Each iteration step is equivalent to a time t, and the corresponding variance is calculated using the following formula:
[0084]
[0085] The variance reduction rate of the loss at each scale can then be obtained, as shown below:
[0086]
[0087] Where ∈ = 0.00001 is used to avoid the denominator being zero. Var i,t and r i,t The initial values are set to 1 and 0 respectively.
[0088] Step S4: Weight the multi-scale loss values, select the two scales with the highest variance reduction rate for enhancement, and increase their weights, while keeping the weights of the remaining scales unchanged. The method for increasing the weights is shown in the following formula:
[0089]
[0090] Where j represents the indices of the two scale levels to be enhanced, and λ is the amplification constant, simply set to 1.5. The weights w for the remaining scales... i It was adjusted to 1.
[0091] Step S5: Weight and fuse the loss values at each scale, calculate the overall loss, and update the model parameters via backpropagation. The loss function incorporating weighting factors is shown below:
[0092]
[0093] If the set number of iterations has not been reached, training continues; if it has been reached, training ends, generating an end-to-end target detection model that can be directly used for underwater sonar small target detection tasks. This method implements an "input → model → result output" operating mode and can be directly deployed on computer equipment.
[0094] This invention also proposes a multi-scale feature enhancement and training device for underwater sonar small target detection, comprising:
[0095] The backbone network construction module is used to construct the backbone network of the multi-scale target detection framework based on the Feature Pyramid Network (FPN). The backbone network includes a first combination of four layers of multi-scale features with different resolutions, labeled as {C2, C3, C4, C5}. The first combination includes a first-layer scale feature C2, a second-layer scale feature C3, a third-layer scale feature C4, and a fourth-layer scale feature C5.
[0096] The Feature Pyramid Network (FPN) improvement module is used to fuse high-level features of the FPN based on sub-pixel skip connections; fuse all scale features of the FPN based on sub-pixel context enhancement; and optimize the generated FPN by implementing channel attention sharing guidance to form an improved feature pyramid network.
[0097] The model training module is used to construct an overall target detection model based on the backbone network and the improved feature pyramid network, load the pre-trained overall target detection model and the sonar image dataset, and perform training.
[0098] The scale weight setting module is used to weight the multi-scale loss values, select the two scales with the highest variance reduction rate for enhancement and increase their weights, while keeping the weight values of the other scales unchanged.
[0099] The overall loss calculation module is used to weight and fuse the loss values at each scale, calculate the overall loss, and backpropagate to update the model parameters.
[0100] This device corresponds one-to-one with the method features in the first embodiment, so it will not be described again.
[0101] The above are merely preferred embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0102] In summary, the above are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
[0103] It will be apparent to those skilled in the art that the embodiments of the present invention are not limited to the details of the exemplary embodiments described above, and that the embodiments of the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the embodiments of the present invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the embodiments of the present invention is defined by the appended claims rather than the foregoing description. Therefore, all variations falling within the meaning and scope of equivalents of the claims are intended to be encompassed within the embodiments of the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims. Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units, modules, or devices recited in the system, apparatus, or terminal claims may also be implemented by the same unit, module, or device through software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any particular order.
[0104] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention and are not intended to limit them. Although the embodiments of the present invention have been described in detail with reference to the above preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions to the technical solutions of the embodiments of the present invention should not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A multi-scale feature enhancement and training method for underwater sonar small target detection, characterized in that, include: Step S1: Construct the backbone network of a multi-scale object detection framework based on Feature Pyramid Network (FPN). This backbone network includes a first combination of four layers of multi-scale features with different resolutions, labeled as... The first combination includes a first layer of scale features. Second-level scale features Third-level scale features Fourth-level scale features ; Step S2: Based on subpixel skip connections, fuse the high-level features of the Feature Pyramid Network (FPN); based on subpixel context enhancement, fuse all scale features of the Feature Pyramid Network (FPN); implement channel attention sharing guidance to optimize the generated Feature Pyramid Network (FPN) and form an improved Feature Pyramid Network. Step S3: Construct an overall target detection model based on the backbone network and the improved feature pyramid network, load the pre-trained overall target detection model and the sonar image dataset, and train it; Step S4: Weight the multi-scale loss values, select the two scales with the highest variance reduction rate for enhancement, increase their weights, and keep the weights of the other scales unchanged; Step S5: Weight and fuse the loss values at each scale, calculate the overall loss, and backpropagate to update the model parameters; Step S2 implements sub-pixel-based skip connections to fuse high-level features of the Feature Pyramid Network (FPN), specifically including: for the first combination with 1024 channels and 2048 channels, marked as The features, firstly, the fourth layer scale features The feature is split into two parts according to the channel dimension, and each part is upsampled twice by sub-pixel convolution. Then, the two parts are fused by pixel-level addition to obtain an intermediate feature with 256 channels. Then, the third-layer scale feature is... The number of channels is reduced by 1×1 convolution, and then combined with the fourth layer scale feature. The magnified intermediate features were fused, ultimately resulting in a second combination with 256 channels, labeled as Features; For a second-layer size feature with 512 channels and the third-layer scale feature with 1024 channels The first combination is marked as Features, directly using the third-layer scale features After subpixel convolution and doubling upsampling, an intermediate feature with 256 channels is obtained; then the second layer size feature... The features are reduced in number by 1×1 convolution, and then combined with the third-layer scale features. The upsampled intermediate features are then fused using pixel-level addition to obtain the second combination with 256 channels, marked as... feature; For the first layer of scale features The feature channel count is already 256; simply copy and generate. Features, fully generated the second combination Medium characteristics; the overall calculation process is shown in the following formula: in This indicates a 1×1 convolution to reduce the number of channels. For pixel rearrangement in subpixel convolution, An index for the features of the pyramid; This represents a channel transformation, using operations such as 1×1 convolution or segmentation. If no channel transformation is needed, it represents an identity mapping. Finally, the second combination... The features in the middle are fused down level by level to generate a third combination. Its characteristics.
2. The multi-scale feature enhancement and training method for underwater sonar small target detection as described in claim 1, characterized in that, Step S1 further includes: a first combination of network outputs, whose length and width dimensions are progressively reduced by a factor of two, wherein the deformable convolution (DCN) uses a flexible and variable convolution window.
3. The multi-scale feature enhancement and training method for underwater sonar small target detection as described in claim 1, characterized in that, In step S2, fusing all scale features of the Feature Pyramid Network (FPN) based on sub-pixel context enhancement includes: for the third combination Features, in which Based on the resolution of the features, for Features are subjected to bilinear interpolation upsampling, for The feature maps are subjected to max pooling downsampling, and the three-layer feature maps scaled to the same resolution are fused pixel-level by addition to obtain feature map I. Feature map I is then scaled using bilinear interpolation upsampling or max pooling downsampling, and combined with the third feature map. Feature pyramid is generated by feature addition.
4. The multi-scale feature enhancement and training method for underwater sonar small target detection as described in claim 3, characterized in that, In step S2, channel attention sharing guidance is implemented to optimize the generated Feature Pyramid Network (FPN) and form an improved Feature Pyramid Network. The feature is characterized in that: for the fused feature map I, global average pooling and global max pooling are performed independently in two branches to obtain two different spatial information vectors.
5. The multi-scale feature enhancement and training method for underwater sonar small target detection as described in claim 1, characterized in that, Step S3 includes: During detector training, the total number of iterations is fixed. As training progresses, the loss values generated in each iteration form a time-ordered sequence, as shown below: s.t. in For the current iteration, This represents the total number of iterations. Indices representing the pyramid's various scale levels; to calculate the variance of the loss value, while avoiding the loss from being excessive in a single iteration. Outliers were identified, so an iteration step size constant was introduced. The loss values within each step are summed to obtain the time-series-based result. loss sequence Iteration step size The value is 50, and the step size of each iteration is one time step. The corresponding variance is calculated using the following formula: The variance reduction rate of the loss at each scale can then be obtained, as shown below: in To avoid the denominator being zero and The initial values are set to 1 and 0 respectively.
6. The multi-scale feature enhancement and training method for underwater sonar small target detection as described in claim 1, characterized in that, Step S4 includes: weighting the multi-scale loss values, selecting the two scales with the highest variance reduction rate for enhancement, increasing their weights, while keeping the weights of the remaining scales unchanged; the method of increasing the weights is shown in the following formula: in For the two scale-level indexes that need enhancement, The magnification constant is simply set to 1.5; the weights for the remaining scales... It was adjusted to 1.
7. The multi-scale feature enhancement and training method for underwater sonar small target detection as described in claim 1, characterized in that, Step S5 includes: weighting and fusing the loss values at each scale, calculating the overall loss, backpropagating to update the model parameters, and introducing a loss function with weighting factors as shown below: If the set number of iterations has not been reached, training continues; if it has been reached, training ends, and an end-to-end target detection model is generated, which can be directly used for underwater sonar small target detection tasks.
8. A multi-scale feature enhancement and training device for underwater sonar small target detection, characterized in that, include: The backbone network construction module is used to construct the backbone network of a multi-scale object detection framework based on Feature Pyramid Network (FPN). This backbone network comprises a first combination of four layers of multi-scale features with different resolutions, labeled as... The first combination includes a first layer of scale features. Second-level scale features Third-level scale features Fourth-level scale features ; The Feature Pyramid Network (FPN) improvement module is used to fuse high-level features of the FPN based on subpixel skip connections; fuse all scale features of the FPN based on subpixel context enhancement; and optimize the generated FPN by implementing channel attention sharing guidance to form an improved feature pyramid network. The model training module is used to construct an overall target detection model based on the backbone network and the improved feature pyramid network, load the pre-trained overall target detection model and the sonar image dataset, and perform training. The scale weight setting module is used to weight the multi-scale loss values, select the two scales with the highest variance reduction rate for enhancement and increase their weights, while keeping the weight values of the other scales unchanged. The overall loss calculation module is used to weight and fuse the loss values at each scale, calculate the overall loss, and backpropagate to update the model parameters; The improved Feature Pyramid Network module implements sub-pixel-based skip connections to fuse high-level features of the Feature Pyramid Network (FPN). Specifically, this includes fusing features marked as follows in the first combination with 1024 and 2048 channels: The features, firstly, the fourth layer scale features The feature is split into two parts according to the channel dimension, and each part is upsampled twice by sub-pixel convolution. Then, the two parts are fused by pixel-level addition to obtain an intermediate feature with 256 channels. Then, the third-layer scale feature is... The number of channels is reduced by 1×1 convolution, and then combined with the fourth layer scale feature. The magnified intermediate features were fused, ultimately resulting in a second combination with 256 channels, labeled as Features; For a second-layer size feature with 512 channels and the third-layer scale feature with 1024 channels The first combination is marked as Features, directly using the third-layer scale features After subpixel convolution and doubling upsampling, an intermediate feature with 256 channels is obtained; then the second layer size feature... The features are reduced in number by 1×1 convolution, and then combined with the third-layer scale features. The upsampled intermediate features are then fused using pixel-level addition to obtain the second combination with 256 channels, marked as... feature; For the first layer of scale features The feature channel count is already 256; simply copy and generate. Features, fully generated the second combination Medium characteristics; the overall calculation process is shown in the following formula: in This indicates a 1×1 convolution to reduce the number of channels. For pixel rearrangement in subpixel convolution, An index for the features of the pyramid; This represents a channel transformation, using operations such as 1×1 convolution or segmentation. If no channel transformation is needed, it represents an identity mapping. Finally, the second combination... The features in the middle are fused down level by level to generate a third combination. Its characteristics.