An underwater target detection method and apparatus
By introducing a multi-scale feature fusion path and multi-branch feature extraction, the problem of feature quality heterogeneity in underwater target detection is solved, achieving higher detection accuracy and robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHANGSHA UNIVERSITY OF SCIENCE AND TECHNOLOGY
- Filing Date
- 2026-02-02
- Publication Date
- 2026-06-05
AI Technical Summary
Existing underwater target detection models suffer from semantic conflicts and noise issues due to feature quality heterogeneity when processing underwater images, which affects detection accuracy.
A cascaded backbone network, neck network, and head network structure is adopted. Multiple upsampling blocks, downsampling blocks, and fusion blocks are introduced into the neck network. By combining local feature extraction branches, large kernel feature extraction branches, and global feature extraction branches, a multi-scale feature fusion path is constructed to achieve flexible interaction and integration of features.
It effectively alleviates the quality heterogeneity problem in underwater images, improves the accuracy and robustness of target detection, and can capture more comprehensive detailed and global information, thereby enhancing detection precision.
Smart Images

Figure CN122156943A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of target detection technology, and in particular to an underwater target detection method and apparatus. Background Technology
[0002] In the field of underwater target detection, the development of existing technologies reflects the continuous exploration of underwater image degradation problems. Early research mainly focused on image preprocessing techniques, such as color correction, contrast enhancement, and dehazing algorithms, to improve the visual quality of underwater images in order to provide clearer input for subsequent detection. With the popularization of deep learning technology, researchers have turned to directly applying and fine-tuning general target detection models, such as region-based convolutional neural networks and single-stage detectors. However, these models perform poorly in underwater scenarios because they do not fully consider the unique challenges of the underwater environment.
[0003] The FPN (Feature Pyramid Network) and PAN (Path Aggregation Network) structures and their variants, which are widely used in current detector models, have inherent defects in constructing multi-scale feature representations: their cross-scale feature fusion largely depends on preset linear operations and fixed interpolation algorithms. This mechanism assumes that features at different levels are consistent in semantic clarity and spatial alignment. However, in underwater images, due to the degree of degradation changing with depth, shallow features are significantly noisy while deep features are semantically ambiguous. Directly fusing these "heterogeneous" features will introduce semantic conflicts and noise, thereby reducing the accuracy of underwater image target detection. Summary of the Invention
[0004] The following is an overview of the subject matter described in detail herein. This overview is not intended to limit the scope of the claims.
[0005] The main objective of this disclosure is to propose an underwater target detection method and apparatus that can simultaneously address the characteristics of easily damaged detailed information and easily blurred global information in underwater images, effectively alleviate the problem of quality heterogeneity in underwater images, and improve the accuracy of target detection.
[0006] A first aspect of this application provides an underwater target detection method, the method comprising:
[0007] In response to detection commands in underwater images, acquire underwater images of the target; The underwater image of the target is input into the target detection model to obtain the target underwater image detection result output by the target detection model; wherein, the target detection model includes a cascaded backbone network, a neck network and a head network; The neck network includes a cascaded first upsampling block, a first fusion block, a first first feature extraction block, a second upsampling block, a second fusion block, a second feature extraction block, a second first feature extraction block, a second downsampling block, a third fusion block, a third first feature extraction block, a second downsampling block, a fourth fusion block, and a fourth first feature extraction block. The input feature of the first upsampling block is the first output feature of the backbone network. The first fusion block fuses the output feature of the first upsampling block with the second output feature of the backbone network. The second fusion block fuses the output feature of the second upsampling block with the third output feature of the backbone network. The third fusion block fuses the output feature of the first first feature extraction block with the output feature of the first downsampling block. The fourth fusion block fuses the first output feature with the output feature of the second downsampling block. The output features are fused, and the first, second, and third output features are the output features of the backbone network, with the scale gradually increasing. The head network is connected to the output ends of the second, third, and fourth first feature extraction blocks. The first, second, third, and fourth first feature extraction blocks are all used for feature extraction. The second feature extraction block includes a local feature extraction branch, a large kernel feature extraction branch, and a global feature extraction branch, to extract the local features, large kernel features, and global features of the output features of the second fusion block according to the local feature extraction branch, large kernel feature extraction branch, and global feature extraction branch, respectively, and fuse the local features, large kernel features, and global features as the output features of the second feature extraction block.
[0008] The underwater target detection method provided in this application has at least the following beneficial effects: This embodiment introduces a neck network with a specific structure, incorporating multiple upsampling, downsampling, and fusion blocks to construct a refined multi-scale feature fusion path. This allows features of different scales and qualities extracted by the backbone network to interact and integrate fully. Compared to simple linear fusion or fixed interpolation algorithms in existing technologies, this provides a more flexible feature fusion mechanism that is more adaptable to the underwater environment. Crucially, the second feature extraction block includes local feature extraction branches, large-kernel feature extraction branches, and global feature extraction branches. The local feature extraction branch captures subtle local details such as pipe cracks, which is essential for accurately identifying small targets or fine target structures. The large-kernel feature extraction branch acquires contextual information surrounding the target, helping to distinguish the target from the background and reduce false detections. The global feature extraction branch grasps the overall semantics of the image. This multi-branch parallel extraction and fusion of features from different receptive fields allows the model to simultaneously address the issues of easily damaged detail information and blurred global information in underwater images, effectively mitigating the problem of quality heterogeneity in underwater images and improving the accuracy of target detection.
[0009] A second aspect of this application provides an underwater target detection device, the device comprising: The command response module is used to acquire the target underwater image in response to the detection command in the underwater image; An image detection module is used to input the underwater image of the target into a target detection model to obtain the target underwater image detection result output by the target detection model; wherein, the target detection model includes a cascaded backbone network, a neck network, and a head network; The neck network includes a cascaded first upsampling block, a first fusion block, a first first feature extraction block, a second upsampling block, a second fusion block, a second feature extraction block, a second first feature extraction block, a second downsampling block, a third fusion block, a third first feature extraction block, a second downsampling block, a fourth fusion block, and a fourth first feature extraction block. The input feature of the first upsampling block is the first output feature of the backbone network. The first fusion block fuses the output feature of the first upsampling block with the second output feature of the backbone network. The second fusion block fuses the output feature of the second upsampling block with the third output feature of the backbone network. The third fusion block fuses the output feature of the first first feature extraction block with the output feature of the first downsampling block. The fourth fusion block fuses the first output feature with the output feature of the second downsampling block. The output features are fused, and the first, second, and third output features are the output features of the backbone network, with the scale gradually increasing. The head network is connected to the output ends of the second, third, and fourth first feature extraction blocks. The first, second, third, and fourth first feature extraction blocks are all used for feature extraction. The second feature extraction block includes a local feature extraction branch, a large kernel feature extraction branch, and a global feature extraction branch, to extract the local features, large kernel features, and global features of the output features of the second fusion block according to the local feature extraction branch, large kernel feature extraction branch, and global feature extraction branch, respectively, and fuse the local features, large kernel features, and global features as the output features of the second feature extraction block.
[0010] A third aspect of this application provides an electronic device including at least one controller and a memory for communicatively connecting to the controller; the memory stores instructions executable by the at least one controller to cause the at least one controller to perform an underwater target detection method as described in the first aspect of this application.
[0011] A fourth aspect of this application provides a computer-readable storage medium storing computer-executable instructions for causing a computer to perform an underwater target detection method as described in the first aspect of this application.
[0012] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0013] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0014] Figure 1 This is a flowchart of an underwater target detection method provided in an embodiment of this application; Figure 2 This is a structural diagram of the target detection model provided in the embodiments of this application; Figure 3 yes Figure 2 Structure diagram of the C3F3 module; Figure 4 yes Figure 2 Structure diagram of the EMKF module; Figure 5 This is a structural diagram of an underwater target detection device provided in an embodiment of this application; Figure 6 This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0015] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0016] In the description of this application, the use of terms such as "first," "second," etc., is for the purpose of distinguishing technical features only and should not be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated or the order of the technical features indicated.
[0017] In the description of this application, it should be understood that the orientation descriptions, such as up, down, etc., are based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed or function in a specific orientation, and therefore should not be construed as a limitation of this application.
[0018] like Figure 1 As shown, this application provides an underwater target detection method, the method comprising: Step S110: In response to the detection command in the underwater image, acquire the target underwater image; Step S120: Input the underwater image of the target into the target detection model to obtain the target underwater image detection result output by the target detection model; wherein, the target detection model includes a cascaded backbone network, neck network and head network; The neck network comprises a cascaded first upsampling block, a first fusion block, a first first feature extraction block, a second upsampling block, a second fusion block, a second feature extraction block, a second first feature extraction block, a first downsampling block, a third fusion block, a third first feature extraction block, a second downsampling block, a fourth fusion block, and a fourth first feature extraction block. The input feature of the first upsampling block is the first output feature of the backbone network. The first fusion block fuses the output feature of the first upsampling block with the second output feature of the backbone network. The second fusion block fuses the output feature of the second upsampling block with the third output feature of the backbone network. The third fusion block fuses the output feature of the first first feature extraction block with the output feature of the first downsampling block. The fourth fusion block fuses the first output feature with the second downsampling block. The output features of the sample blocks are fused. The first, second, and third output features are the output features of the backbone network, and their scales gradually increase. The head network is connected to the output ends of the second, third, and fourth first feature extraction blocks. The first, second, third, and fourth first feature extraction blocks are all used for feature extraction. The second feature extraction block includes a local feature extraction branch, a large kernel feature extraction branch, and a global feature extraction branch. The local features, large kernel features, and global features of the output features of the second fusion block are extracted according to the local feature extraction branch, the large kernel feature extraction branch, and the global feature extraction branch, respectively. The local features, large kernel features, and global features are then fused as the output features of the second feature extraction block.
[0019] In this embodiment, the method first responds to a detection command in the underwater image and acquires the target underwater image. In practical applications, the response to the detection command can be varied. For example, a timed triggering mechanism can be used to automatically acquire images from the underwater camera at preset intervals; or, a manual triggering method can be used, where the operator clicks an interface button to start the image acquisition process when needed. The target underwater image can be acquired by directly capturing it in real time from the connected camera, or by reading pre-recorded images or video frames from a local storage device.
[0020] Subsequently, the acquired underwater image of the target is input into the target detection model to obtain the target underwater image detection result output by the target detection model. The target detection model, as the core processing unit, receives the raw image data and performs a series of complex calculations, ultimately outputting the location of the target in the image (usually represented by a bounding box) and its corresponding category label. The model can be a pre-trained general-purpose model, such as the YOLO series models or Faster R-CNN models based on convolutional neural networks (CNNs). These models perform well on general datasets but may require fine-tuning for the underwater environment.
[0021] The object detection model comprises a cascaded backbone network, a neck network, and a head network. The backbone network extracts features at different levels from the input image. For example, classic image classification networks such as ResNet and VGG can be used as the backbone, progressively extracting low-level texture features, mid-level shape features, and high-level semantic features through multiple convolutional and pooling operations. The neck network fuses and enhances the multi-scale features extracted by the backbone network to generate a feature representation more suitable for object detection. The head network then performs final object classification and bounding box regression based on the features output by the neck network.
[0022] like Figure 2 As shown, the neck network comprises a cascaded first upsampling block, a first fusion block (represented by Concat in the figure), a first first feature extraction block, a second upsampling block, a second fusion block, a second feature extraction block (represented by EMKF in the figure), a second first feature extraction block, a first downsampling block, a third fusion block, a third first feature extraction block, a second downsampling block, a fourth fusion block, and a fourth first feature extraction block. This cascaded structure aims to construct a multi-scale feature pyramid to effectively handle the problem of large variations in the size of underwater targets. For example, the upsampling block can use simple bilinear interpolation or nearest neighbor interpolation methods to increase the resolution of the feature map; the downsampling block can use max pooling or stride convolution to reduce the resolution of the feature map. The fusion block can then concatenate or element-wise add feature maps of different scales to integrate information.
[0023] Specifically, the input features of the first upsampling block are the first output features of the backbone network (as shown in the C2PSA output features in the figure). The first fusion block is used to fuse the output features of the first upsampling block with the second output features of the backbone network (as shown in the third C3CF block from top to bottom in the figure). The second fusion block is used to fuse the output features of the second upsampling block with the third output features of the backbone network (as shown in the second C3CF block from top to bottom in the figure). The third fusion block is used to fuse the output features of the first feature extraction block with the output features of the first downsampling block. The fourth fusion block is used to fuse the first output features with the output features of the second downsampling block. This feature flow design in this embodiment enables the neck network to fully utilize the features extracted by the backbone network at different depths, and to exchange information through top-down and bottom-up paths, thereby generating feature maps containing rich semantic and spatial information.
[0024] The head network is connected to the outputs of the second, third, and fourth first feature extraction blocks. This connection allows the head network to extract features from the outputs of the neck network at different scales, thus enabling it to detect targets of different sizes. For example, for small targets, the head network can use high-resolution feature maps for detection; for large targets, it can use low-resolution feature maps with richer semantic information for detection.
[0025] The first, second, third, and fourth feature extraction blocks are all used for feature extraction. These feature extraction blocks can be constructed by stacking standard convolutional layers, batch normalization layers, and activation functions to perform non-linear transformations and adjust the channel dimensions of the input features, thereby enhancing the expressive power of the features. For example, each feature extraction block can contain one or more residual-connected convolutional units to alleviate the gradient vanishing problem in deep networks.
[0026] A key innovation of this application lies in the second feature extraction block (represented by EMKF in the figure). This second feature extraction block includes a local feature extraction branch, a large kernel feature extraction branch, and a global feature extraction branch. These branches extract local, large kernel, and global features from the output features of the second fusion block, respectively, and then fuse these features as the output features of the second feature extraction block. The local feature extraction branch can use small-sized convolutional kernels to capture detailed information in the image; the large kernel feature extraction branch can use large-sized convolutional kernels or dilated convolutions to obtain broader contextual information; the global feature extraction branch can use global average pooling followed by a fully connected layer, or a self-attention mechanism to capture the global dependencies of the entire feature map. Finally, these features at different scales are fused through concatenation or element-wise addition to generate a comprehensive feature representation that simultaneously considers local details, moderate-range context, and global semantic information.
[0027] In this embodiment, after the system acquires the underwater image of the target, it is input into a pre-trained target detection model. The model first performs preliminary processing on the image through a backbone network. The backbone network extracts multi-scale feature maps from the underwater image, for example, generating three output features with progressively decreasing resolution but progressively richer semantic information: the first output feature (high resolution, low semantics), the second output feature (medium resolution, medium semantics), and the third output feature (low resolution, high semantics).
[0028] Subsequently, the output features of these backbone networks are fed into the neck network for refinement and fusion. The first upsampling block in the neck network receives the first output features of the backbone network and upsamples them to improve their resolution. The upsampled features are then fused with the second output features of the backbone network in the first fusion block, thus combining high-resolution detail information with medium-resolution semantic information. Similarly, the second upsampling block upsamples a feature, and its output features are fused with the third output features of the backbone network in the second fusion block, further integrating information at different scales.
[0029] In the neck network, the output features of the second fusion block are input to the second feature extraction block, which is crucial for addressing the heterogeneity of underwater image quality. It initiates local feature extraction, large kernel feature extraction, and global feature extraction branches in parallel. The local feature extraction branch focuses on capturing subtle texture and edge information from the output features of the second fusion block, such as the tentacles of underwater organisms or the details of cracks in pipes. The large kernel feature extraction branch focuses on acquiring broader contextual information, such as the surrounding aquatic environment or the general outline of the target, which helps distinguish the target from the background. The global feature extraction branch extracts global semantic information from the entire feature map, such as determining the presence of large targets or the category of the overall scene. Through this multi-branch parallel extraction approach, the second feature extraction block can comprehensively capture information about underwater targets at different scales and semantic levels, effectively addressing the challenge of both blurred local details and unclear global semantics in underwater images. The extracted local features, large kernel features, and global features are then fused within the second feature extraction block. This fusion is not a simple superposition, but rather a carefully designed mechanism that allows features of different scales to complement and enhance each other, thereby generating a comprehensive feature that contains rich details and has strong semantic expressive power. The comprehensive feature is then passed to subsequent modules of the neck network as the output of the second feature extraction block.
[0030] Other first feature extraction blocks in the neck network (the first, second, third, and fourth first feature extraction blocks) also extract and refine features. Simultaneously, the first and second downsampling blocks downsample the features to generate feature maps at different resolutions. These feature maps are further fused in the third and fourth fusion blocks to ensure effective flow and integration of information across different scales.
[0031] Finally, the head network is connected to the outputs of feature extraction blocks (the second, third, and fourth first feature extraction blocks) at specific locations in the neck network. The head network receives these fused multi-scale features and performs final target classification and bounding box regression based on these features. In this way, the underwater target detection method can output accurate underwater image detection results.
[0032] In existing technologies, when processing underwater images, structures such as FPN and PAN suffer from feature quality heterogeneity caused by the water medium (i.e., shallow features are noisy while deep features are semantically ambiguous). Simply performing cross-scale feature fusion can easily introduce semantic conflicts and noise, thus affecting detection accuracy. This embodiment introduces a neck network with a specific structure, in which multiple upsampling blocks, downsampling blocks, and fusion blocks are set up to construct a fine multi-scale feature fusion path. This allows features of different scales and qualities extracted by the backbone network to fully interact and integrate. Compared with the simple linear fusion or fixed interpolation algorithms that may exist in the prior art, this provides a more flexible feature fusion mechanism that is more adapted to the underwater environment. More importantly, the second feature extraction block includes a local feature extraction branch, a large kernel feature extraction branch, and a global feature extraction branch. The local feature extraction branch can capture subtle local details such as pipe cracks, which is crucial for accurately identifying small targets or fine structures of targets. The large kernel feature extraction branch can obtain contextual information around the target, which helps to distinguish the target from the background and reduce false detections. The global feature extraction branch can grasp the overall semantics of the image. This design of multi-branch parallel extraction and fusion of features from different receptive fields allows the model to simultaneously take into account the characteristics of underwater images where detailed information is easily damaged and global information is easily blurred, effectively alleviating the problem of "quality heterogeneity" in underwater images.
[0033] Compared with existing technologies that may use single receptive field feature extraction or simple multi-scale feature fusion, this embodiment's method, through this comprehensive feature extraction and fusion strategy, can generate more robust and discriminative feature representations, and can more comprehensively capture the features of underwater targets, thereby significantly improving the accuracy and robustness of underwater target detection.
[0034] like Figure 3 As shown, in some embodiments of this application, the second feature extraction block specifically includes a cascaded first convolutional layer (represented by Conv in the figure), a second convolutional layer, a feature extraction sub-block, a third convolutional layer, and a fourth convolutional layer. The feature extraction sub-block includes a first deep convolutional layer (represented by DConv in the figure), a second deep convolutional layer, a third deep convolutional layer, a fourth deep convolutional layer, and a dual-domain feature extraction sub-block arranged in parallel; wherein, the kernel of the first deep convolutional layer is 1x1, the kernel of the second deep convolutional layer is 31x1, the kernel of the third deep convolutional layer is 31x31, and the kernel of the fourth deep convolutional layer is 1x31; The dual-domain feature extraction sub-block includes a cascaded first dual-domain feature extraction sub-block (represented by DCAM in the figure) and a second dual-domain feature extraction sub-block (represented by FSAM in the figure); The first dual-domain feature extraction sub-block includes a fifth convolutional layer, a first fast Fourier layer (represented by FFT in the figure), a first inverse fast Fourier layer (represented by IFFT in the figure), and a sixth convolutional layer. The fifth convolutional layer is used to convolve the features obtained by global average pooling (represented by GAP in the figure) based on the output features of the second convolutional layer to obtain the first sub-feature. The first fast Fourier layer is used to perform fast Fourier transform on the output features of the second convolutional layer to obtain the second sub-feature. The first inverse fast Fourier layer is used to perform inverse fast Fourier transform on the third sub-feature obtained by multiplying the first and second sub-features pixel by pixel to obtain the fourth sub-feature. The sixth convolutional layer is used to convolve the features obtained by global average pooling based on the fourth sub-feature to obtain the fifth sub-feature. The sixth sub-feature obtained by multiplying the fifth sub-feature and the fourth sub-feature pixel by pixel is used as the output feature of the first dual-domain feature extraction sub-block. The second dual-domain feature extraction sub-block includes a seventh convolutional layer, an eighth convolutional layer, a second fast Fourier transform layer, and a second inverse fast Fourier transform layer. The seventh convolutional layer is used to convolve the sixth sub-feature to obtain the seventh sub-feature. The eighth convolutional layer is used to convolve the sixth sub-feature to obtain the eighth sub-feature. The second fast Fourier transform layer is used to perform fast Fourier transform on the seventh sub-feature to obtain the ninth sub-feature. The second inverse fast Fourier transform layer is used to perform inverse fast Fourier transform on the tenth sub-feature obtained by multiplying the eighth and ninth sub-features pixel by pixel to obtain the output feature of the second dual-domain feature extraction sub-block.
[0035] In this embodiment, the feature extraction sub-block integrates parallel multi-branching, mainly including: a local feature extraction branch that extracts local texture using lightweight convolution; a large kernel feature extraction branch that obtains contextual information with a large receptive field using decomposed strip convolutions (such as 1×31, 31×1, and 31×31 depth convolutions); and a global feature extraction branch that utilizes a dual-domain attention mechanism combining the frequency and spatial domains. Through this embodiment, the second feature block can effectively capture local features and large kernel features of different directions and scales in underwater images through multi-branch, multi-scale depth convolutions, significantly enhancing the model's ability to perceive target shape and texture. More importantly, the introduced feature extraction sub-block, especially the frequency domain processing mechanism combining FFT and IFFT, enables the model to not only extract features in the spatial domain but also analyze the global texture and periodicity information of the image in the frequency domain, cleverly fusing features from the spatial and frequency domains. This fusion strategy can more comprehensively capture the subtle features and global contextual information of underwater targets in complex environments, effectively overcoming the feature degradation problem caused by factors such as uneven illumination, scattering, and blurring in underwater images, thereby significantly improving the accuracy and robustness of underwater target detection.
[0036] In some embodiments of this application, a first Split layer (represented by Split in the figure) is further provided between the first convolutional layer and the second convolutional layer in the second feature extraction block, and a first fusion layer is provided between the third convolutional layer and the fourth convolutional layer in the second feature extraction block; The first Split layer is used to split the first output sub-feature and the second output sub-feature from the output features of the first convolutional layer, and output the second output sub-feature to the second convolutional layer, wherein the proportion of the first output sub-feature to the output features of the first convolutional layer is greater than that of the second output feature. The first fusion layer is used to concatenate the output features of the third convolutional layer with the first output sub-features, and then input the concatenated features into the fourth convolutional layer.
[0037] A split layer is a module used to decompose input features. Based on a preset strategy, the split layer divides the input feature map into two or more sub-feature maps along the channel dimension. For example, channel grouping can be used to divide the number of channels of the input feature according to a certain ratio, forming a first output sub-feature and a second output sub-feature. The channel proportion of the first output sub-feature can be greater than that of the second output sub-feature to distinguish feature information of different importance or scale. The role of the split layer is to perform preliminary filtering and splitting of features, allowing different types of features to be processed along different paths, avoiding information loss or redundancy caused by all features undergoing the same processing flow.
[0038] In this embodiment, a Split layer and a first fusion layer are set in the second feature block, which can perform fine-grained management of the features output by the first convolutional layer. The Split layer decomposes the features into sub-features of different proportions, so that the first output sub-features with a larger proportion are retained, avoiding excessive dilution or loss in subsequent deep processing, while the second output sub-features with a smaller proportion can focus on detail extraction. Subsequently, the first fusion layer concatenates the finely processed features with the retained first output sub-features, effectively integrating feature information from different processing paths. This multi-path feature processing and recombination mechanism based on cross-stage partial connectivity (CSP) ensures that the second feature block can capture and utilize more comprehensive feature information, including macro context and micro details, thereby significantly enhancing the feature expression capability of the second feature block, improving the recognition accuracy and robustness of the target detection model for target features in complex underwater environments, and thus improving the accuracy of underwater target detection.
[0039] In some embodiments of this application, the backbone network includes a cascaded first convolutional block (represented by Conv in the figure), a second convolutional block, a first hybrid sensing feature extraction block, a third convolutional block, a second hybrid sensing feature extraction block, a fourth convolutional block, a third hybrid sensing feature extraction block, a fifth convolutional block, a fourth hybrid sensing feature extraction block, an SPPF block, and a C2PSA block; the output feature of the C2PSA block is the first output feature, the output feature of the third hybrid sensing feature extraction block is the second output feature, and the output feature of the second hybrid sensing feature extraction block is the third output feature. Any hybrid sensing feature extraction block includes a cascaded ninth convolutional layer, a second split layer, n third feature extraction sub-blocks, a second fusion layer, and a tenth convolutional layer; the second split layer is used to separate the third output sub-feature and the fourth output sub-feature from the ninth convolutional layer, and input the fourth output sub-feature into the first third feature extraction sub-block among the n third feature extraction sub-blocks; the second fusion layer is used to fuse the third output sub-feature and the output features of each third feature extraction sub-block. The third feature extraction sub-block includes a cascaded eleventh convolutional layer, a twelfth convolutional layer, a convolutional attention feedforward block, a third fusion layer, and a twelfth convolutional layer; the twelfth convolutional layer is used to convolve the features obtained by the residual connection of the output features of the eleventh convolutional layer and the input features of the third feature extraction sub-block; the third fusion layer is used to fuse the output features of the convolutional attention feedforward block and the output features of the eleventh convolutional layer.
[0040] The backbone network is a fundamental component in deep learning models used to extract multi-scale features from input images. Its role is to progressively reduce the spatial resolution of feature maps through a series of convolutional and pooling layers, while simultaneously increasing the number of channels in the feature maps, thereby capturing semantic information at different levels. The backbone network can employ various mature architectures, such as ResNet, Darknet, and EfficientNet, or it can be a network structure optimized for a specific task.
[0041] The first, second, third, fourth, and fifth convolutional blocks are the basic processing units in the backbone network. They typically consist of one or more convolutional layers, batch normalization layers, and activation function layers, responsible for extracting and transforming local features from the input feature map. For example, a convolutional block can contain a 3x3 convolutional layer, a batch normalization layer, and a ReLU activation function.
[0042] The first, second, third, and fourth hybrid sensing feature extraction blocks are core components of the backbone network, designed to enhance feature extraction capabilities, especially when processing complex underwater images. They combine different types of sensing mechanisms, such as local sensing, global sensing, or attention mechanisms, to more effectively capture key information in the image.
[0043] The SPPF block is a fast version of the Spatial Pyramid Pooling module, used to pool feature maps at different scales into fixed-size feature vectors. This allows the network to process input images of arbitrary sizes and extract features with multi-scale contextual information. SPPF blocks are typically implemented by using multiple max-pooling operations of different sizes in parallel and then concatenating the results. The C2PSA block is a specific convolutional module designed to further optimize feature representations. It may combine convolutional operations with some form of attention mechanism or feature recalibration mechanism to enhance the discriminative power of the features. For example, a C2PSA block might contain a channel attention module to learn the importance of different channels, or a spatial attention module to focus on key regions in the feature maps.
[0044] The first, second, and third output features are feature maps output by the backbone network at different stages, representing image information at different levels of abstraction and scales. The first output feature is usually the output of the deepest C2PSA block in the backbone network, possessing high semantic information and low spatial resolution. The second and third output features come from earlier layers or modules in the backbone network (such as the third and second hybrid sensing feature extraction blocks), possessing relatively low semantic information and high spatial resolution, and are used to provide multi-scale contextual information.
[0045] like Figure 4 As shown, the following describes the hybrid sensing feature extraction block: The ninth, tenth, eleventh, and twelfth convolutional layers are the basic operational units in the hybrid perceptual feature extraction block and the third feature extraction sub-block. They perform a sliding window operation on the input feature map through convolutional kernels to extract local patterns. For example, these convolutional layers can use 1x1, 3x3, or 5x5 convolutional kernels and can be selectively paired with batch normalization and activation functions.
[0046] The n third feature extraction sub-blocks are repeating units within the hybrid perceptual feature extraction block, used to further refine the feature extraction process. By stacking multiple third feature extraction sub-blocks, the network depth and receptive field can be increased, thereby capturing more complex feature patterns.
[0047] The second and third fusion layers are used to combine feature maps from different paths or stages. Fusion operations can be performed in various ways, such as element-wise addition, concatenation, or weighted summation. The aim is to integrate the advantages of different features and provide a more comprehensive information representation.
[0048] The convolutional attention feedforward block (represented by CFBlock in the diagram) is a module that combines convolutional operations and attention mechanisms. It can dynamically adjust the weights of features by learning the importance of different positions or channels in the input feature map, thereby enabling the hybrid sensing feature extraction block to focus more on key information in the image and suppress irrelevant or noisy information.
[0049] In this embodiment, the backbone network is endowed with more powerful feature extraction capabilities. When processing complex and ever-changing underwater images, a convolutional attention feedforward block is added to the multiple hybrid sensing feature extraction blocks introduced. This creatively combines the local prior of convolution with the global dynamic modeling capability of attention. A set of learnable convolutional kernels is used to achieve efficient attention computation, replacing the fixed weight mode of standard convolution. This allows the network to adaptively focus on long-range contextual information related to the target, effectively addressing challenges such as uneven underwater lighting, blurring, and occlusion, and improving the overall performance of underwater target detection.
[0050] In some embodiments of this application, the neck network further includes a spatial-to-depth convolutional block; the spatial-to-depth convolutional block is connected to the output of the first hybrid sensing feature extraction block and the input of the second fusion block, for performing structured downsampling on the output features of the first hybrid sensing feature extraction block, and inputting the structured downsampled features into the second fusion block; the second fusion block is specifically used to fuse the output features of the second upsampling block, the output features of the spatial-to-depth convolutional block and the third output features.
[0051] Among them, the spatial-to-depth convolutional block performs structured downsampling of high-resolution features, encoding spatial details losslessly to the channel dimension, thereby explicitly preserving and enhancing the fine target texture and edge information that is crucial for detection. This can significantly improve the detection accuracy and robustness of underwater target detection models for targets of different scales in complex underwater environments, especially when dealing with small or blurry targets, providing stronger discriminative power.
[0052] In some embodiments of this application, the first first feature extraction block, the second first feature extraction block, the third first feature extraction block and the fourth first feature extraction block are all hybrid sensing feature extraction blocks.
[0053] The first, second, third, and fourth feature blocks are key components in the neck network used for processing and refining features. They operate on the feature map at different scales or processing stages to extract more discriminative information. The hybrid sensing feature extraction block can capture richer and more comprehensive feature information by integrating multiple sensing mechanisms. In this embodiment, the key feature extraction module in the neck network is replaced with the hybrid sensing feature extraction block, enabling the model to extract robust and discriminative features more effectively from low-quality underwater images. This enhanced feature extraction capability helps overcome image degradation problems caused by the underwater environment, such as blurring, low contrast, and color distortion, thereby significantly improving the accuracy and recall of underwater target detection. Especially during feature fusion and downsampling, the hybrid sensing feature extraction block can ensure that key target information is not lost and can better suppress background interference, making the final detection results more accurate and reliable.
[0054] In some embodiments of this application, the first upsampling block and the second upsampling block both use soft nearest neighbor interpolation for feature upsampling; the first downsampling block and the second downsampling block both use enhanced group convolution for feature downsampling.
[0055] Specifically, soft nearest neighbor interpolation is an optimization method based on nearest neighbor interpolation. When selecting the nearest neighbor pixel, it may consider not only the single nearest pixel but also the weighted information of its neighboring pixels, or reduce the jagged artifacts generated during the interpolation process through some smoothing mechanism. This method aims to generate smoother and more natural feature maps while maintaining computational efficiency, avoiding the blocky effect and information distortion that may be caused by traditional nearest neighbor interpolation. Enhanced group convolution is an improved convolution operation based on traditional group convolution. Traditional group convolution divides the input channels into several groups and performs convolution independently within each group. Although this reduces the amount of computation, it may lead to insufficient information exchange between groups. Enhanced group convolution introduces additional mechanisms to promote information interaction between different groups, thereby improving the richness and diversity of feature extraction while maintaining computational efficiency.
[0056] This method effectively addresses the information loss and artifact issues that traditional upsampling and downsampling operations may cause in underwater image processing. The use of soft nearest neighbor interpolation makes the feature maps generated during the upsampling process smoother and more accurate, providing high-quality input for subsequent feature fusion. Enhanced group convolution, while efficiently downsampling, promotes information exchange between different feature groups, avoids feature isolation, and thus extracts more discriminative multi-scale features. These improvements work together to significantly enhance the target detection model's accuracy and robustness in complex underwater environments for various targets, especially targets of different sizes.
[0057] like Figures 2 to 4 One embodiment of this application provides an underwater target detection method, which includes the following: Step S910: Construct the target detection model; it mainly consists of three parts: 1. Backbone network; 2. Neck network; 3. Head network; Existing networks lack an effective global context modeling mechanism, making it impossible to fully understand the target morphology from the overall scene semantics and accurately suppress complex background interference. This results in limited discriminative power of extracted features, becoming a major cause of false positives and false negatives. Therefore, this embodiment systematically addresses this problem by designing the C3CF block. The C3CF block integrates the CFBlock block, which implements an efficient channel and spatial attention mechanism through convolution. While retaining the local prior advantages of convolution, it explicitly models long-distance dependencies, enabling the network to dynamically focus on key regions and integrate global information, thereby significantly improving the discriminative power for blurred targets and complex backgrounds.
[0058] Unlike YOLOv11, the neck network provided in this embodiment has the following main improvements: (1) An explicit small target information enhancement path was designed, and SPD-Conv was used to perform structured downsampling of high-resolution features to encode spatial details to the channel dimension without loss. (2) An EMKF block was designed. The existing fusion nodes are usually just convolution or simple feature map operations. EMKF adopts a cross-stage partial connection structure and integrates parallel multi-branch (31x1 and 1x31 local branches, 31x31 large kernel branch, and 1x1 global branch) to collaboratively model information at different scales; and also integrates a dual-domain attention mechanism. (3) SNI was used for upsampling; and GSConvE was used for downsampling.
[0059] Step S920: Detect underwater images using the model; The input underwater image first enters a backbone network composed of stacked C3CF blocks. This network, through its internal CFBlock convolutional attention mechanism, simultaneously extracts local details and models the global context during layer-by-layer downsampling, outputting a set of multi-scale feature maps (i.e., the first to fourth output features mentioned above). These features are then fed into the neck network for fusion and enhancement: First, the fourth output feature, with the highest resolution, passes through a small target information enhancement path, undergoes structured downsampling by SPD-Conv to preserve details, and is then concatenated with the third output feature as input. Subsequently, the features flow and fuse in both top-down and bottom-up bidirectional pathways, and in the core fusion stage, the EMKF block deeply integrates and enhances the detailed features from the enhancement path with the mid-to-high-level semantic features from the backbone network (i.e., the first and second output features). During this process, the network employs soft nearest neighbor interpolation (SNI) and enhanced group convolution (GSConvE) to achieve high geometric fidelity upsampling and downsampling. Finally, the neck network outputs a set of refined and enhanced multi-scale features. These features are processed in parallel by the decoupled detection head to predict the target category and precise bounding box at each location, thereby completing end-to-end underwater target detection.
[0060] The method provided in this embodiment has at least the following beneficial effects: (1) Existing technologies (such as YOLOv11) generally use C3 or C3K2 blocks as basic feature extraction units in their backbone networks. Their core is based on local operations and residual connections of standard convolution, which lacks the ability to explicitly model the global semantics of images. This embodiment proposes a novel hybrid sensing feature extraction block (C3CF) as the core building block of the backbone network. The core innovation of this block is that it embeds CFBlock, which creatively combines the local prior of convolution with the global dynamic modeling ability of attention. Specifically, CFBlock uses a set of learnable convolution kernels to achieve efficient attention calculation, replacing the fixed weight mode of standard convolution. This allows the network to adaptively focus on long-distance contextual information related to the target, thereby significantly enhancing the ability to distinguish between blurred targets and complex backgrounds in the feature extraction stage.
[0061] (2) Existing technologies typically use a structure combining FPN (Feature Pyramid Network) and PAN (Path Aggregation Network) as the neck network, performing feature fusion through simple top-down and bottom-up paths. This structure suffers from problems such as discarding high-resolution shallow features and overly rigid fusion operations (such as splicing or addition). This embodiment introduces a novel neck network. First, it introduces an explicit small target information enhancement path. Unlike existing technologies that directly discard high-resolution features, the neck network sets up a path that uses SPD-Conv to perform structured downsampling of high-resolution features, encoding spatial details losslessly to the channel dimension, thereby explicitly preserving and enhancing the fine target texture and edge information that is crucial for detection. Then, it designs an efficient multi-scale feature integration block (EMKF) as the fusion core. Existing technologies typically use only convolution or simple feature map operations for fusion nodes. This embodiment uses a cross-stage partial connection structure through the EMKF block, only performing partial connection on the input features. The above multi-branch transformation is applied to 25% of the channels, while the remaining 75% of the channels are directly passed through identity mapping. This mechanism significantly reduces the number of parameters and computational load while preserving almost all multi-scale perception capabilities. Moreover, the EMKF block integrates parallel multi-branch (local branches use lightweight convolutions to extract local textures, large kernel branches obtain contextual information of a large receptive field through decomposed strip convolutions (such as 1×31, 31×1, and 31×31 depth convolutions), and global branches use a dual-domain attention mechanism combining frequency and spatial domains) to collaboratively model information at different scales. This enables adaptive and deep integration of detailed features from the enhancement path with semantic features of the backbone network, solving the feature conflict problem caused by traditional linear fusion. Finally, to address the distortion caused by conventional interpolation and strided convolution in blurred images, a customized SNI is used for upsampling to soften the contribution of high-level blurred features; and GSConvE is used for downsampling, improving efficiency while better preserving information.
[0062] This application also provides a set of experimental examples: To verify the effectiveness of the target detection model proposed in this embodiment, rigorous comparative experiments and ablation studies were conducted on a publicly available underwater fish detection dataset.
[0063] The entire implementation process was completed in the following experimental environment: the server was configured with an NVIDIA RTX 1080 GPU, the operating system was Ubuntu 20.04.1, and all models were implemented, trained, and evaluated using the CUDA 12.1, Python 3.10, and PyTorch deep learning framework.
[0064] Two representative and widely used underwater target detection datasets were selected for validation: The DeepFish dataset, collected from Australian waters, contains approximately 40,000 images. It focuses on fine-grained detection in scenes with dense schools of fish, characterized by small-scale, densely distributed fish against diverse backgrounds. According to the official dataset structure, approximately 80% of the images are used as the training set, and the remaining 20% as the validation set.
[0065] The RUOD dataset (Real-world Underwater Object Detection) covers real-world marine scenes and contains 14,000 images (9,800 for training and 4,200 for testing). Its annotations cover 10 common aquatic categories (such as algae, corals, various fish species, divers, starfish, jellyfish, etc.) and include various typical underwater environmental degradation challenges such as turbidity, low light, and color distortion.
[0066] In this embodiment, the proposed complete model is compared with the baseline model YOLOv11 under the same conditions. Experimental results show that on the DeepFish and RUOD datasets, the object detection model provided in this embodiment significantly outperforms the original YOLOv11 model in core evaluation metrics such as mean accuracy (mAP@0.5), especially on the RUOD dataset with its variable target scale and complex backgrounds, where its performance advantage is even more pronounced. The model shows particularly significant improvements in recall and localization accuracy for small targets (such as small fish and small corals), which directly verifies the effectiveness of the C3CF block and the neck network in preserving and fusing detailed information. At the same time, thanks to the efficient design of innovative blocks (such as the CFBlock block and the CSP structure of EMKF), the model maintains a similar inference speed and memory usage to the baseline model while significantly improving accuracy, demonstrating good practicality.
[0067] Furthermore, through systematic ablation experiments, the independent contributions and synergistic effects of the C3CF block and the MFE-Neck network on the final performance were verified. Experimental data confirmed that introducing only the C3CF block or replacing it only with the MFE-Neck both bring stable performance gains. When the two are integrated to form a complete model, they achieve optimal performance on all key indicators, especially exhibiting the strongest robustness when dealing with blurred and small-sized targets, fully demonstrating the necessity of the core innovations of this embodiment and the superiority of their synergistic work.
[0068] This embodiment addresses solutions for image degradation, small targets, and complex backgrounds, and can be extended to other underwater vision tasks, such as underwater facility (pipeline, cable) inspection, search and rescue target location, and monitoring of various marine organisms (coral, algae). Its technical concept is also applicable to fields with similar imaging challenges, such as smog security monitoring, remote sensing small target detection, and medical microscopic image analysis.
[0069] like Figure 5 As shown in one embodiment of this application, an underwater target detection device includes: The instruction response module 1001 is used to acquire the target underwater image in response to a detection instruction in the underwater image; The image detection module 1002 is used to input the underwater image of the target into the target detection model to obtain the target underwater image detection result output by the target detection model; wherein, the target detection model includes a cascaded backbone network, neck network and head network; The neck network comprises a cascaded first upsampling block, a first fusion block, a first first feature extraction block, a second upsampling block, a second fusion block, a second feature extraction block, a second first feature extraction block, a first downsampling block, a third fusion block, a third first feature extraction block, a second downsampling block, a fourth fusion block, and a fourth first feature extraction block. The input feature of the first upsampling block is the first output feature of the backbone network. The first fusion block fuses the output feature of the first upsampling block with the second output feature of the backbone network. The second fusion block fuses the output feature of the second upsampling block with the third output feature of the backbone network. The third fusion block fuses the output feature of the first first feature extraction block with the output feature of the first downsampling block. The fourth fusion block fuses the first output feature with the second downsampling block. The output features of the sample blocks are fused. The first, second, and third output features are the output features of the backbone network, and their scales gradually increase. The head network is connected to the output ends of the second, third, and fourth first feature extraction blocks. The first, second, third, and fourth first feature extraction blocks are all used for feature extraction. The second feature extraction block includes a local feature extraction branch, a large kernel feature extraction branch, and a global feature extraction branch. The local features, large kernel features, and global features of the output features of the second fusion block are extracted according to the local feature extraction branch, the large kernel feature extraction branch, and the global feature extraction branch, respectively. The local features, large kernel features, and global features are then fused as the output features of the second feature extraction block.
[0070] It should be noted that the underwater target detection device provided in this embodiment is based on the same inventive concept as the underwater target detection method described above. Therefore, the content of the underwater target detection method described above is also applicable to the content of the underwater target detection device in this embodiment, and will not be repeated here.
[0071] like Figure 6 One embodiment of this application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the aforementioned underwater target detection method. The electronic device includes: At least one battery; At least one memory; At least one processor; At least one program; The program is stored in memory, and the processor executes at least one program to implement the underwater target detection method described above in this disclosure.
[0072] This electronic device can be any smart terminal, including mobile phones, tablets, personal digital assistants (PDAs), and in-vehicle computers.
[0073] The electronic devices according to embodiments of this application will now be described in detail.
[0074] The processor 1600 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this disclosure. The memory 1700 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 1700 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 1700 and is called and executed by the processor 1600 to implement an underwater target detection method according to an embodiment of this disclosure.
[0075] The input / output interface 1800 is used to implement information input and output. The communication interface 1900 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 2000 transmits information between various components of the device (e.g., processor 1600, memory 1700, input / output interface 1800, and communication interface 1900); The processor 1600, memory 1700, input / output interface 1800 and communication interface 1900 are connected to each other within the device via bus 2000.
[0076] This disclosure also provides a storage medium, which is a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the above-described underwater target detection method.
[0077] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0078] The embodiments described in this disclosure are for the purpose of more clearly illustrating the technical solutions of this disclosure and do not constitute a limitation on the technical solutions provided by this disclosure. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by this disclosure are also applicable to similar technical problems.
[0079] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this disclosure, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0080] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated; that is, they may be located in one place or distributed across multiple network units. Some or all of the blocks can be selected to achieve the purpose of this embodiment according to actual needs.
[0081] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional blocks / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0082] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0083] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0084] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0085] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0086] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0087] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0088] The above is a detailed description of the preferred embodiments of this application. However, the embodiments of this application are not limited to the above-described implementation methods. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the embodiments of this application. All such equivalent modifications or substitutions are included within the scope defined by the claims of the embodiments of this application.
Claims
1. A method for detecting underwater targets, characterized in that, The method includes: In response to detection commands in underwater images, acquire underwater images of the target; The underwater image of the target is input into the target detection model to obtain the target underwater image detection result output by the target detection model; wherein, the target detection model includes a cascaded backbone network, a neck network and a head network; The neck network includes a cascaded first upsampling block, a first fusion block, a first first feature extraction block, a second upsampling block, a second fusion block, a second feature extraction block, a second first feature extraction block, a second downsampling block, a third fusion block, a third first feature extraction block, a second downsampling block, a fourth fusion block, and a fourth first feature extraction block. The input feature of the first upsampling block is the first output feature of the backbone network. The first fusion block fuses the output feature of the first upsampling block with the second output feature of the backbone network. The second fusion block fuses the output feature of the second upsampling block with the third output feature of the backbone network. The third fusion block fuses the output feature of the first first feature extraction block with the output feature of the first downsampling block. The fourth fusion block fuses the first output feature with the output feature of the second downsampling block. The output features are fused, and the first, second, and third output features are the output features of the backbone network, with the scale gradually increasing. The head network is connected to the output ends of the second, third, and fourth first feature extraction blocks. The first, second, third, and fourth first feature extraction blocks are all used for feature extraction. The second feature extraction block includes a local feature extraction branch, a large kernel feature extraction branch, and a global feature extraction branch, to extract the local features, large kernel features, and global features of the output features of the second fusion block according to the local feature extraction branch, large kernel feature extraction branch, and global feature extraction branch, respectively, and fuse the local features, large kernel features, and global features as the output features of the second feature extraction block.
2. The underwater target detection method according to claim 1, characterized in that, The second feature extraction block specifically includes a cascaded first convolutional layer, a second convolutional layer, a feature extraction sub-block, a third convolutional layer, and a fourth convolutional layer; The feature extraction sub-block includes a first deep convolutional layer, a second deep convolutional layer, a third deep convolutional layer, a fourth deep convolutional layer, and a dual-domain feature extraction sub-block arranged in parallel; wherein, the convolution kernel of the first deep convolutional layer is 1x1, the convolution kernel of the second deep convolutional layer is 31x1, the convolution kernel of the third deep convolutional layer is 31x31, and the convolution kernel of the fourth deep convolutional layer is 1x31; The dual-domain feature extraction sub-block includes a cascaded first dual-domain feature extraction sub-block and a second dual-domain feature extraction sub-block; The first dual-domain feature extraction sub-block includes a fifth convolutional layer, a first fast Fourier layer, a first inverse fast Fourier layer, and a sixth convolutional layer. The fifth convolutional layer is used to convolve the features obtained by global average pooling based on the output features of the second convolutional layer to obtain a first sub-feature. The first fast Fourier layer is used to perform fast Fourier transform on the output features of the second convolutional layer to obtain a second sub-feature. The first inverse fast Fourier layer is used to perform inverse fast Fourier transform on the third sub-feature obtained by multiplying the first sub-feature and the second sub-feature pixel by pixel to obtain a fourth sub-feature. The sixth convolutional layer is used to convolve the features obtained by global average pooling based on the fourth sub-feature to obtain a fifth sub-feature, so that the sixth sub-feature obtained by multiplying the fifth sub-feature and the fourth sub-feature pixel by pixel is used as the output feature of the first dual-domain feature extraction sub-block. The second dual-domain feature extraction sub-block includes a seventh convolutional layer, an eighth convolutional layer, a second fast Fourier transform layer, and a second inverse fast Fourier transform layer. The seventh convolutional layer is used to convolve the sixth sub-feature to obtain the seventh sub-feature. The eighth convolutional layer is used to convolve the sixth sub-feature to obtain the eighth sub-feature. The second fast Fourier transform layer is used to perform a fast Fourier transform on the seventh sub-feature to obtain the ninth sub-feature. The second inverse fast Fourier transform layer is used to perform an inverse fast Fourier transform on the tenth sub-feature obtained by multiplying the eighth and ninth sub-features pixel by pixel to obtain the output feature of the second dual-domain feature extraction sub-block.
3. The underwater target detection method according to claim 2, characterized in that, The second feature extraction block further includes a first split layer between the first convolutional layer and the second convolutional layer, and a first fusion layer between the third convolutional layer and the fourth convolutional layer. The first Split layer is used to split the first output sub-feature and the second output sub-feature from the output features of the first convolutional layer, and output the second output sub-feature to the second convolutional layer, wherein the proportion of the first output sub-feature to the output features of the first convolutional layer is greater than that of the second output sub-feature. The first fusion layer is used to concatenate the output features of the third convolutional layer with the first output sub-features, and input the concatenated features into the fourth convolutional layer.
4. The underwater target detection method according to claim 1, characterized in that, The backbone network includes a cascaded first convolutional block, a second convolutional block, a first hybrid sensing feature extraction block, a third convolutional block, a second hybrid sensing feature extraction block, a fourth convolutional block, a third hybrid sensing feature extraction block, a fifth convolutional block, a fourth hybrid sensing feature extraction block, an SPPF block, and a C2PSA block; the output feature of the C2PSA block is the first output feature, the output feature of the third hybrid sensing feature extraction block is the second output feature, and the output feature of the second hybrid sensing feature extraction block is the third output feature; Any hybrid perceptron feature extraction block includes a cascaded ninth convolutional layer, a second split layer, n third feature extraction sub-blocks, a second fusion layer, and a tenth convolutional layer; the second split layer is used to separate the third output sub-feature and the fourth output sub-feature from the ninth convolutional layer, and input the fourth output sub-feature into the first third feature extraction sub-block among the n third feature extraction sub-blocks; the second fusion layer is used to fuse the third output sub-feature and the output features of each third feature extraction sub-block. The third feature extraction sub-block includes a cascaded eleventh convolutional layer, a twelfth convolutional layer, a convolutional attention feedforward block, a third fusion layer, and a twelfth convolutional layer; the twelfth convolutional layer is used to convolve the features obtained by the residual connection of the output features of the eleventh convolutional layer and the input features of the third feature extraction sub-block; the third fusion layer is used to fuse the output features of the convolutional attention feedforward block and the output features of the eleventh convolutional layer.
5. The underwater target detection method according to claim 4, characterized in that, The neck network further includes a spatial-to-depth convolutional block; the spatial-to-depth convolutional block is connected to the output of the first hybrid sensing feature extraction block and the input of the second fusion block, for performing structured downsampling on the output features of the first hybrid sensing feature extraction block, and inputting the structured downsampled features into the second fusion block; the second fusion block is specifically used to fuse the output features of the second upsampling block, the output features of the spatial-to-depth convolutional block and the third output features.
6. The underwater target detection method according to claim 4, characterized in that, The first first feature extraction block, the second first feature extraction block, the third first feature extraction block, and the fourth first feature extraction block are all hybrid sensing feature extraction blocks.
7. The underwater target detection method according to claim 1, characterized in that, Both the first upsampling block and the second upsampling block use soft nearest neighbor interpolation for feature upsampling; both the first downsampling block and the second downsampling block use enhanced group convolution for feature downsampling.
8. An underwater target detection device, characterized in that, The device includes: The command response module is used to acquire the target underwater image in response to the detection command in the underwater image; An image detection module is used to input the underwater image of the target into a target detection model to obtain the target underwater image detection result output by the target detection model; wherein, the target detection model includes a cascaded backbone network, a neck network, and a head network; The neck network includes a cascaded first upsampling block, a first fusion block, a first first feature extraction block, a second upsampling block, a second fusion block, a second feature extraction block, a second first feature extraction block, a second downsampling block, a third fusion block, a third first feature extraction block, a second downsampling block, a fourth fusion block, and a fourth first feature extraction block. The input feature of the first upsampling block is the first output feature of the backbone network. The first fusion block fuses the output feature of the first upsampling block with the second output feature of the backbone network. The second fusion block fuses the output feature of the second upsampling block with the third output feature of the backbone network. The third fusion block fuses the output feature of the first first feature extraction block with the output feature of the first downsampling block. The fourth fusion block fuses the first output feature with the output feature of the second downsampling block. The output features are fused, and the first, second, and third output features are the output features of the backbone network, with the scale gradually increasing. The head network is connected to the output ends of the second, third, and fourth first feature extraction blocks. The first, second, third, and fourth first feature extraction blocks are all used for feature extraction. The second feature extraction block includes a local feature extraction branch, a large kernel feature extraction branch, and a global feature extraction branch, to extract the local features, large kernel features, and global features of the output features of the second fusion block according to the local feature extraction branch, large kernel feature extraction branch, and global feature extraction branch, respectively, and fuse the local features, large kernel features, and global features as the output features of the second feature extraction block.
9. An electronic device, characterized in that, It includes at least one controller and a memory for communicatively connecting with the controller; the memory stores instructions executable by the at least one controller, which, when executed by the at least one controller, causes the at least one controller to perform an underwater target detection method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions for causing a computer to perform an underwater target detection method as described in any one of claims 1 to 7.