An underwater small target detection algorithm based on improved YOLOv8

By improving the YOLOv8 algorithm, constructing a small target optimization detection module, a spatial depth convolution feature extraction module, and an adaptive feature fusion head, the problems of information loss and noise interference in underwater small target detection are solved, achieving efficient and accurate underwater small target detection.

CN122176490APending Publication Date: 2026-06-09JIANGSU OCEAN UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIANGSU OCEAN UNIV
Filing Date
2026-03-06
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing deep learning models struggle to effectively detect small targets in underwater environments, primarily due to poor underwater imaging quality, feature sparsity, and information loss. Traditional algorithms also struggle to distinguish target signals from noise in complex environments and consume excessive computational resources.

Method used

By constructing an improved YOLOv8 algorithm, a small target optimization detection module, a spatial depth convolution feature extraction module, a multi-receptive field attention feature enhancement module, and an adaptive spatial feature fusion head are introduced to optimize the feature extraction and fusion mechanism, reduce computational redundancy, and enhance detection accuracy and robustness.

Benefits of technology

It significantly improves the accuracy and robustness of underwater small target detection, reduces the number of model parameters, improves detection efficiency, adapts to different underwater environmental conditions, and meets real-time detection requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122176490A_ABST
    Figure CN122176490A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of target detection, in particular to an underwater small target detection algorithm based on an improved YOLOv8, and aims to solve the information loss problem caused by the sparse characteristics of underwater small targets. The algorithm is characterized in that: a small target optimization detection module containing a shallow high-resolution P1 branch is constructed; an SPDPro-Conv module composed of spatial depth convolution and depth separable convolution is designed to replace the cross-step convolution, and the spatial information is reserved; a C2f-RFSE structure integrating multi-receptive field attention and channel attention is introduced into the backbone network; and an adaptive spatial feature fusion head is adopted to dynamically adjust the contribution proportion of multi-scale features. Through the above technical scheme, the detection accuracy and robustness of small targets in a complex underwater environment are significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of target detection technology, and in particular to an underwater small target detection algorithm based on an improved YOLOv8. Background Technology

[0002] With the deepening of global marine resource development and marine scientific research, underwater target detection technology, as a core means of perceiving the deep-sea environment and realizing the automation of underwater operations, has demonstrated irreplaceable application value in key areas such as marine biodiversity monitoring, seabed resource exploration, and marine ecological restoration. In the complex and ever-changing underwater environment, accurately identifying and locating various biological targets and man-made structures is a prerequisite for the intelligent perception and decision-making of autonomous underwater vehicles. In recent years, deep learning technologies, represented by convolutional neural networks, have made significant progress in the field of computer vision. Among them, single-stage target detection algorithms, especially the YOLO series framework, have gradually become the mainstream choice for real-time detection tasks in industry and academia due to their excellent inference speed and end-to-end detection performance. Advanced algorithms, represented by YOLOv8, have demonstrated excellent detection robustness in general land scenarios by constructing an integrated feature extraction backbone and a multi-scale feature fusion neck.

[0003] However, the unique physical characteristics and complex imaging mechanisms of the underwater environment pose significant challenges to general detection algorithms that can be directly applied to land or air environments. The strong absorption and scattering of light by water not only results in significant color casts and low contrast in images but also introduces substantial backscattering noise, causing underwater images to exhibit noticeable blurring and distortion of texture details. Under these constraints, underwater small target detection presents extremely high technical difficulties, with underlying technical challenges manifesting in several dimensions: First, existing deep learning models, in order to balance computational overhead and semantic representation capabilities, typically employ strided convolutions or pooling operations for spatial downsampling during feature extraction. While this mechanism effectively expands the receptive field and extracts high-level abstract features, for small underwater targets that occupy a very small portion of the image and have a very limited pixel distribution, frequent downsampling operations amount to irreversible information loss. This causes the fine-grained geometric features of the small targets to be filtered out by the deep network before reaching the detection head, leading to serious missed detections.

[0004] Secondly, existing multi-scale feature fusion architectures (such as FPN and PAN structures) often employ fixed splicing or weighted summation methods when handling the collaborative work of shallow and deep features. In terrestrial environments with high signal-to-noise ratios, this approach can effectively combine spatial positioning information with semantic classification information; however, in underwater scenarios, due to the presence of numerous suspended objects, chaotic seabed textures, and artifacts caused by non-uniform lighting, shallow feature maps are often mixed with massive amounts of background noise. If traditional integrated fusion logic is used, the model struggles to effectively distinguish weak target signals from strong background noise amidst massive amounts of information, causing the saliency of small target features to be submerged by noise, resulting in a significant decrease in positioning accuracy. Furthermore, the design philosophy of general detection frameworks typically tends to accommodate the detection needs of targets at all scales. Their pre-set large receptive field branches, when processing single and dense groups of small targets, not only generate unnecessary computational redundancy but are also prone to introducing negative feature interference due to severe mismatch between the receptive field and the target scale, limiting the upper limit of feature expression of the detector in extremely complex environments.

[0005] At its core, there is a profound inherent conflict between the degraded imaging characteristics of underwater environments and the feature loss mechanisms inherent in traditional deep learning models. While existing improvement schemes attempt to enhance performance by adding attention mechanisms or increasing network depth, they still struggle to achieve accurate capture and noise suppression of small underwater targets without significantly increasing computational resources, especially given the feature sparsity and environmental complexity inherent in such targets. Specifically, reconstructing the underlying downsampling operators to preserve high-fidelity spatial information without sacrificing real-time performance, and establishing an intelligent architecture capable of perceiving feature importance and dynamically adjusting fusion weights, has become a crucial, albeit non-obvious, technological challenge in the field of underwater vision. Therefore, developing a novel detection algorithm specifically optimized for underwater environments, capable of deeply mining weak features, and designed for lightweight deployment is of profound significance for improving the intelligence level of underwater resource detection in my country. Summary of the Invention

[0006] To address the technical problems mentioned in the background, such as low underwater environment imaging quality, sparse features of small targets, and information loss caused by frequent downsampling in traditional deep learning models, this invention provides an underwater small target detection algorithm based on an improved YOLOv8. The aim is to significantly improve the detection accuracy and robustness of small targets in complex underwater environments while maintaining the model's lightweight nature by reconstructing feature extraction operators, optimizing the detection head architecture, and establishing an adaptive spatial feature fusion mechanism.

[0007] To achieve the above-mentioned objectives, the present invention adopts the following technical solution: an underwater small target detection algorithm based on improved YOLOv8, the specific implementation steps of which include the construction of an underwater small target detection dataset, the construction of a small target optimized detection module, the construction of a spatial depth convolutional feature extraction module, the construction of a multi-receptive field attention feature enhancement module, the construction of an adaptive spatial feature fusion head, the assembly and training of the detection network, and the inference test of the model.

[0008] In the construction of the underwater small target detection dataset, this invention employs an open-source dataset containing various underwater scenes and small targets. This dataset encompasses underwater images with varying degrees of occlusion, non-uniform illumination variations, and complex background features. Image annotation tools are used to precisely calibrate and annotate the images within the dataset, establishing the association between target bounding box coordinates and category information, generating corresponding annotation files. Subsequently, the original images are normalized and resized, with the input image resolution uniformly set to 640×640 pixels to adapt to the improved network architecture. The processed dataset is then divided into training, validation, and test sets in an 8:1:1 ratio.

[0009] In the construction steps of the small target optimization detection module, to address the issue of feature annihilation of small underwater targets in deep networks, this invention reconstructs the original YOLOv8 detection architecture. The small target optimization detection module constructs a detection head oriented towards a 160×160 resolution feature map by introducing a detection branch of a shallow high-resolution feature map P1 into the feature extraction network. This branch enhances the model's geometric perception capability for small targets by fusing fine-grained spatial features extracted by shallow convolutional modules. Simultaneously, to reduce computational redundancy and suppress interference from large-scale underwater background noise, the small target optimization detection module removes the detection layer and corresponding feature extraction branch for large targets from the original architecture. This asymmetric detection head layout tilts computational resources towards the feature regions of small targets, ensuring improved capture efficiency for small underwater targets while reducing the number of model parameters.

[0010] In the construction step of the spatial depth convolutional feature extraction module, this invention designs and introduces the SPDPro-Conv module to replace the traditional strided convolutional layer. The SPDPro-Conv module consists of a spatial depth convolutional layer and a depthwise separable convolutional layer, aiming to eliminate the spatial information loss caused by convolutional operations with a stride greater than 1. Specifically, for the input feature map... The module first performs a slicing operation, uniformly dividing the input feature map into four sub-feature maps along the height and width directions, with the spatial size of each sub-feature map reduced to [value missing]. The number of channels remains at Its slicing logic is expressed as follows:

[0011] ;

[0012] ;

[0013] ;

[0014] ;

[0015] Furthermore, the four sub-feature maps are concatenated along the channel dimension to generate a new feature map. The concatenated feature maps are then input into a depthwise separable convolutional layer. This layer first extracts spatial features using a channel-wise convolution operator without changing the feature map depth, and then uses a pointwise convolution operator to perform inter-channel information fusion. The stride of the depthwise separable convolution operation is set to 1. In this way, the spatial resolution of the feature map is preserved during downsampling through channel dimension expansion, and its output feature map... The calculation process is as follows:

[0016] ;

[0017] in, Represents depthwise convolution. This indicates pointwise convolution. Through this mechanism, the network can preserve the edge and texture details of small underwater targets to the greatest extent while reducing computational density.

[0018] In the construction step of the multi-receptive-field attention feature enhancement module, this invention strengthens feature representation by introducing a C2f-RFSE structure into the backbone network. The C2f-RFSE module is implemented by embedding multi-receptive-field attention convolution and channel attention mechanisms into the C2f structure. Specifically, the module uses a multi-receptive-field attention convolution operator to replace standard convolution. By calculating the receptive field weights of spatial pixels, the convolution kernel can dynamically adjust its sampling area according to the local features of the underwater image, thereby alleviating image blurring caused by underwater scattering. Simultaneously, the cascaded channel attention mechanism calculates the importance weights of each channel through global average pooling and nonlinear mapping, performing enhancement operations on key feature channels and suppression operations on noisy background channels. This combination of dual attention mechanisms enables the model to accurately extract discriminative features of targets from cluttered underwater backgrounds.

[0019] In the construction step of the adaptive spatial feature fusion head, this invention employs an adaptive spatial feature fusion module instead of the traditional fixed-weight fusion mechanism. The adaptive spatial feature fusion module receives multi-scale feature maps from different layers of the detection network and performs upsampling or downsampling on each layer's feature maps to ensure consistent spatial resolution. Furthermore, the module dynamically adjusts the spatial contribution ratio from shallow, mid-layer, and deep feature maps by introducing a set of learnable weight parameters. During the fusion process, for each spatial location, the network automatically learns the fusion weights for features at different scales, and the fused feature representation is obtained by weighted summation of features at each scale. This mechanism effectively filters conflicting information during cross-scale feature transmission, particularly suppressing the localization bias introduced when deep semantic features are transmitted to shallow layers, thus ensuring that the model achieves optimal feature fusion results under different underwater visibility conditions.

[0020] In the assembly and training steps of the detection network, the aforementioned improved modules are integrated into the YOLOv8 framework according to a preset topology. During the training phase, the network's input resolution, batch size, initial learning rate, and optimizer strategy are configured. The experimental environment relies on a computing platform with a high-performance graphics processing unit (GPU) of at least 32GB of video memory and a core processor clock frequency of at least 3.0GHz, equipped with a corresponding deep learning computing framework and acceleration library. During training, a loss function is used to constrain the positional bias of the predicted bounding boxes, class confidence, and overlap of small objects. The network weights are iteratively updated using the backpropagation algorithm until the model's average accuracy on the validation set stabilizes.

[0021] In the inference testing step of the model, the trained weight parameters are loaded into the optimal network model, and target detection is performed on underwater images within the test set. The model output includes the target category and the coordinates of the predicted bounding box.

[0022] Furthermore, as a preferred embodiment of the present invention, during the construction of the small target optimization detection module, the number of convolutional layers and channels of the P1 branch are finely configured to ensure that the generated feature map has sufficient feature discriminative power while retaining the original spatial information. Specifically, the P1 branch performs feature processing through a series of convolutional layers with small-sized convolutional kernels, and its output channel number is set to match the specifications of the subsequent feature fusion layer, thereby achieving efficient cascading with mid-to-deep features.

[0023] Furthermore, in a preferred embodiment of the present invention, in the spatial depth convolutional feature extraction module, a batch normalization layer and a nonlinear activation function layer are connected after the depth-separable convolutional layer. The nonlinear activation function adopts a function form with a negative half-axis derivative to enhance the network's ability to nonlinearly model low-contrast regions in underwater images and prevent gradient vanishing during depth propagation.

[0024] Furthermore, in a preferred embodiment of the present invention, in the multi-receptive-field attention feature enhancement module, the multi-receptive-field attention convolution operator adjusts the geometry of the receptive field by learning spatial offset. For the irregular morphological features of small underwater targets, this dynamic receptive field can better cover the actual contour of the target, significantly reducing detection box drift caused by environmental disturbances.

[0025] Furthermore, in a preferred embodiment of the present invention, in the adaptive spatial feature fusion module, the weight parameters are predicted by a lightweight convolutional neural network. This prediction network takes cascaded multi-scale features as input and outputs a weight matrix with the same size as the feature map space. The weight matrix is ​​normalized to ensure that the sum of the weights at each pixel position is 1, thereby achieving strict feature flow energy allocation.

[0026] The present invention has the following significant technical effects:

[0027] 1. This invention introduces a small target optimization detection module, utilizes shallow high-resolution feature branches and removes large target detection layers to achieve accurate feature capture for small underwater targets, effectively solving the technical problem of small targets being easily lost in deep networks, while significantly reducing the parameter scale of the model and improving the running speed on underwater embedded devices.

[0028] 2. The SPDPro-Conv module designed in this invention replaces the traditional strided convolution downsampling with a spatial depth transformation mechanism. Without increasing additional computational overhead, it fully preserves the fine-grained spatial information of the image during the scaling process. For small underwater targets with weak features, this greatly enhances the original signal strength that the back-end detection head can obtain.

[0029] 3. This invention enhances the model's feature extraction capability in complex noisy environments by constructing a C2f-RFSE module and utilizing the synergistic effect of multi-receptive field attention and channel attention. This design not only adapts to the varied shapes of underwater targets but also automatically suppresses false features generated by water scattering and suspended matter, improving the model's discrimination accuracy in low-contrast environments.

[0030] 4. The adaptive spatial feature fusion mechanism introduced in this invention breaks the limitations of the traditional fixed feature pyramid fusion mode, realizing dynamic and optimal combination of cross-scale features. Through learnable weight allocation, the model can automatically identify and strengthen the feature level most beneficial to small target detection, effectively solving the feature conflict problem in multi-scale fusion and improving the algorithm's generalization ability under different underwater depths and lighting conditions.

[0031] In summary, the underwater small target detection algorithm based on the improved YOLOv8 described in this invention constructs an underwater visual perception framework that balances lightweight design and high precision through systematic innovation in the low-level convolution operator, the mid-level feature enhancement module, and the high-level fusion strategy. This provides reliable technical support for tasks such as marine life monitoring and underwater resource surveys. Attached Figure Description

[0032] Figure 1 This is a schematic diagram of the overall process of the algorithm of this invention;

[0033] Figure 2 This is a schematic diagram of the improved network architecture of the present invention;

[0034] Figure 3 This is a schematic diagram of the SPDPro-Conv module in this invention;

[0035] Figure 4 This is a schematic diagram of the C2f-RFSE module in this invention;

[0036] Figure 5 This is a logical structure diagram of the adaptive spatial feature fusion module in this invention;

[0037] Figure 6 This is a detailed structural diagram of the P1 branch in the small target optimization detection module of the present invention. Detailed Implementation

[0038] The implementation process of an underwater small target detection algorithm based on an improved YOLOv8 begins with the construction of a high-performance computing environment, which provides hardware support for subsequent complex convolution operations and large-scale matrix gradient backpropagation. Regarding the computing platform configuration, this invention preferably uses an NVIDIA A100 Tensor Processing Unit (TPU) graphics card with 32GB of HBM2 memory, an Intel Xeon Scalable processor with a clock speed of 3.5GHz, and at least 128GB of DDR4 RAM. The software environment is built on an Ubuntu 20.04 LTS operating system, using PyTorch version 1.12.1 as the deep learning framework, and integrating the CUDA 11.3 acceleration library and the CUDNN 8.2 neural network acceleration engine to ensure computational efficiency during tensor slicing and adaptive feature fusion.

[0039] In the data preparation phase, the underwater small target detection dataset constructed in this invention integrates typical samples from publicly available academic resources such as URPC and DUO, covering typical small underwater organisms such as scallops, sea cucumbers, sea urchins, and crabs. Figure 1 As shown, the overall process encompasses data preparation, network construction, training, and inference. To simulate the complexity of the real seabed environment, the dataset specifically includes images with suspended particle scattering, non-uniform blue-green light backgrounds, and deep-sea low-light environments. All original images underwent rigorous screening and preprocessing. The LabelImg tool was used to accurately annotate the bounding boxes of targets smaller than 32×32 pixels in the images, and the annotation information was stored in YOLO format. During preprocessing, the input image size was uniformly resampled to 640×640 pixels, and pixel value normalization was performed, mapping the pixel range to [0,1]. Furthermore, to enhance the model's generalization robustness, HSV color space transformation, random rotation, horizontal flipping, and Mosaic-4 data augmentation strategies were employed in the early stages of training. By dynamically combining four images of different scales in the training batch, the network's perception frequency of the spatial distribution of small targets was increased.

[0040] The core architecture of an underwater small target detection algorithm based on an improved YOLOv8 has been deeply reconstructed on the original YOLOv8 framework. For example... Figure 2 The diagram shown illustrates the overall network architecture of this invention, illustrating the various modules from input to output. The overall network topology consists of four main parts: the input end, the spatial depth convolutional feature extraction backbone, the multi-receptive field attention enhancement neck, and the adaptive spatial feature fusion detection head. Addressing the technical challenge of extremely sparse feature representation for small underwater targets, this invention first introduces a spatial depth convolutional feature extraction module, namely the SPDPro-Conv module, at the beginning stage of the feature extraction backbone. Its structure is as follows... Figure 3 As shown. The design logic of this module is to completely abandon the traditional strided convolution operation with a stride of 2, because strided convolution will irreversibly lose tiny texture details during the downsampling process of underwater blurred images.

[0041] Specifically, the SPDPro-Conv module in the spatial depth convolutional feature extraction module performs a spatial-to-depth transformation mechanism. For an input four-dimensional tensor... Its dimension is represented as ,in For batch size, Input the number of channels. For spatial resolution, the SPDPro-Conv module first samples the feature map every pixel in both the height and width dimensions using a slicing operator, generating four sub-feature maps. These four sub-feature maps correspond to the sets of pixels in the original image with coordinates (even, even), (odd, even), (even, odd), and (odd, odd), respectively. The generated four sub-feature maps have dimensions of [missing information - likely dimensionality]. Subsequently, these four sub-images are spliced ​​along the channel axis to form a dimension of The new feature map is generated. Through this transformation, the spatial information of the image is completely transferred to the channel dimension, avoiding the direct loss of information. To further extract features and control the channel dimension, the concatenated feature map is fed into a depthwise separable convolutional layer, which consists of a cascade of channel-wise convolution operators and pointwise convolution operators. The channel-wise convolution operator uses a 3×3 convolution kernel, and the number of its groups is set to the same as the number of input channels. The equal convolutional operator is responsible for extracting spatial features within each channel; the pointwise convolutional operator uses a 1×1 convolutional kernel to handle information exchange between channels and map dimensions to the preset target number of channels. Each convolutional operator is followed by a batch normalization layer and a SiLU nonlinear activation function layer to enhance the network's nonlinear fitting capability.

[0042] In the feature enhancement stage of the backbone network, this invention introduces a multi-receptive-field attention feature enhancement module, namely the C2f-RFSE module, such as... Figure 4 As shown, the C2f-RFSE structure details the integration of multi-receptive field attention and channel attention. This module is an innovative improvement on the original C2f structure by embedding a convolutional operator with dynamic receptive field adjustment capabilities into the residual learning path. In specific implementation, the C2f-RFSE module first reduces the dimensionality of the input feature map through an initial 1×1 convolution, then splits the feature flow into two branches. One branch passes through a series of cascaded bottleneck layers, each integrating a multi-receptive field attention convolutional operator. This operator calculates the offset parameters at various points in space, allowing the sampling position of the convolutional kernel to be offset according to the actual geometric contour of the underwater target. For soft-bodied organisms or elongated small targets deformed by ocean currents, this dynamic receptive field can capture more compact discriminative features. Simultaneously, a channel attention branch is concatenated at the output of each bottleneck layer. This branch compresses the spatial features into a global descriptor through global average pooling, and then calculates the weight coefficients of each channel through two fully connected layers. These weighting coefficients, after being activated by the Sigmoid algorithm, are multiplied with the original feature map to achieve recalibration of key feature channels, effectively suppressing interference noise generated by underwater light spots and suspended matter.

[0043] Regarding the construction of the detection head, this invention optimizes the architecture asymmetrically for small target detection tasks. Traditional YOLOv8 typically uses three detection layers (P3, P4, and P5) to handle small, medium, and large targets respectively. However, in an underwater small target detection algorithm based on an improved YOLOv8, this invention constructs an optimized small target detection module. This module introduces a P1 branch, specifically a dedicated detection branch for high-fidelity feature maps with a resolution of 160×160. The P1 branch structure is as follows... Figure 6 As shown, this diagram illustrates the module's configuration for high-resolution shallow feature processing. Since layer P1 is located in the very shallow layer of the network, it contains far richer geometric localization information than deep features. Simultaneously, this invention removes layer P5 and its associated downsampling paths from the original architecture used for detecting large-scale targets. This strategy frees computational resources from redundant large-target detection tasks, allowing for complete focus on high-resolution shallow feature processing. To achieve efficient feature fusion across layers, this invention designs an adaptive spatial feature fusion head at the front of the detection head, its module structure as shown... Figure 5 The diagram illustrates the weight calculation and feature fusion process. The adaptive spatial feature fusion head employs the ASFF mechanism, where for any layer's feature output, it receives feature information from all other layers. For example, during the fusion process at layer P1, features from layers P2 and P3 are first adjusted to a resolution of 160×160 using bilinear interpolation or stride convolution. Then, a set of learnable parameter matrices is used to calculate the weights of each layer's features at each spatial location. These weights are normalized using the Softmax function to ensure that the sum of the contributions of the three layers' features is always equal to 1 at each pixel. This adaptive fusion mechanism effectively resolves semantic conflicts during cross-scale feature transfer, ensuring a balance between localization accuracy and semantic discriminability for small targets.

[0044] In the network assembly and training phases, the model initialization employed the Kaiming normal distribution method. The training process used a momentum-driven stochastic gradient descent optimizer, with a momentum factor set to 0.937 and a weight decay coefficient set to 0.0005. Cosine annealing was used for learning rate scheduling, with an initial learning rate set to 0.01 and a total of 300 training epochs. The loss function consisted of three parts:

[0045] The localization loss uses CIoU Loss, which aims to optimize the overlap between the predicted bounding box and the ground truth bounding box, the distance between the center points, and the aspect ratio.

[0046] The classification loss uses binary cross-entropy loss;

[0047] The distributed focal length loss is used to further refine the probability distribution of the bounding box, thereby improving the localization accuracy of targets with blurred edges.

[0048] After each round of training, the model's performance is evaluated using the validation set, and the weight file with the best average accuracy is retained as the deployment model for the inference phase.

[0049] Furthermore, in specific engineering implementations, the slicing logic of the SPDPro-Conv module is implemented through slicing indices of high-dimensional tensors. At the Python code implementation level, four tensors are obtained through four step extraction methods: x[...,::2,::2], x[...,1::2,::2], x[...,::2,1::2], and x[...,1::2,1::2]. This operation has extremely high memory parallel access efficiency on existing GPU architectures. Subsequently, the torch.cat function is used to concatenate the tensors along dimension 1. In the feature transformation after concatenation, the introduction of depthwise separable convolutional layers significantly reduces the number of parameters. If the number of parameters in a regular convolution is... The improved depth-separable formal parameter quantity is only When processing high-resolution underwater feature maps, this design greatly reduces the computational burden on mobile underwater detection equipment while maintaining the receptive field.

[0050] Furthermore, in the multi-receptive-field attention feature enhancement module, the multi-receptive-field attention convolution operator, in its implementation, introduces a parallel convolution branch to learn the offset field. The offset field has the following number of channels: , representing each sampling point at and Directional bias. To ensure gradient continuity, bilinear interpolation is used to handle non-integer coordinates during sampling. This design allows the model to adaptively ignore areas with extremely low contrast in underwater images, focusing instead on target regions with edge gradients.

[0051] Furthermore, the weight prediction network of the adaptive spatial feature fusion head is an extremely lightweight module, consisting of two 1×1 convolutional layers: the first convolutional layer reduces the dimensionality of the concatenated multi-scale features, and the second convolutional layer outputs a three-channel weight map. These three channels correspond to the contribution ratios at the three scales, respectively. Through this end-to-end learning approach, the network automatically discovers during training that for extremely small targets (such as scallop shells in the distance), the model assigns extremely high weights (typically >0.8) to the P1 layer; while for background interference regions, the model utilizes the deep semantic information of the P2 or P3 layers to filter out false positive samples.

[0052] To verify the technical superiority of the underwater small target detection algorithm based on the improved YOLOv8 described in this invention, a quantitative analysis is conducted below through specific embodiments and comparative examples.

[0053] This embodiment employs the complete technical solution described in this invention. The input image resolution on the URPC dataset is 640×640. The backbone network adopts an improved architecture integrating the SPDPro-Conv module, the neck network uses a C2f-RFSE enhancement structure, and is configured with a P1 high-resolution detection branch and an ASFF adaptive fusion head. During training, the batch size is set to 16, the learning rate uses the cosine annealing algorithm, and the training period is 300 epochs. The hardware platform uses a single NVIDIA A100 graphics card.

[0054] Comparative Example 1

[0055] Comparative Example 1 uses the original YOLOv8n model, which employs traditional strided convolution for downsampling, uses the standard C2f module, and has a standard three-layer P3, P4, and P5 detector head, excluding the P1 branch and ASFF module. All other training parameters remain consistent with Example 1.

[0056] Comparative Example 2

[0057] Comparative Example 2, based on the original YOLOv8n, only introduced the P1 small target detection branch, but retained the P5 layer, and did not use the SPDPro-Conv module and C2f-RFSE module.

[0058] Comparative Example 3

[0059] Comparative Example 3, based on the original YOLOv8n, only introduced the SPDPro-Conv module to replace all the strided convolutional layers, without reconstructing the detection head.

[0060] The experimental data comparison results are shown in Table 1 below:

[0061] Table 1: Performance Comparison of Different Models on Underwater Small Target Dataset

[0062]

[0063] Analysis of the experimental data in Table 1 shows that Example 1 achieved an average accuracy (mAP@0.5) of 89.7%, an improvement of 11.3 percentage points compared to the original YOLOv8n model. Particularly noteworthy is the improvement of 10.3 percentage points in the mAP@0.5:0.95 ratio, which reflects localization precision. This demonstrates the decisive role of the SPDPro-Conv module in preserving the detailed features of small targets, and the efficiency of the ASFF mechanism in multi-scale feature fusion. Regarding model size, because this invention decisively removed the P5 branch and its associated deep feature extraction paths for large targets when constructing the small target optimization detection module, Example 1 has only 2.8M parameters, lower than the 3.2M of the original model. This indicates that while improving accuracy, this invention achieves model lightweighting through structural optimization, maintaining an inference speed of 148 frames per second, fully meeting the requirements of real-time monitoring.

[0064] Furthermore, addressing the common issues of non-uniform lighting and suspended object interference in underwater environments, this invention significantly enhances the edge contrast of targets through the implementation of the C2f-RFSE module. In a specific test scenario, when the pixel proportion of the target object (such as a sea urchin hidden in seaweed) was only 0.05% of the entire image, Comparative Example 1 showed obvious missed detections, while Example 1, due to its fine-grained spatial information from the P1 layer and the weight redistribution of ASFF, was able to accurately locate the target position with a confidence score as high as 0.92.

[0065] In the actual operation of the spatial depthwise convolutional layer, the feature map changes as follows: Assuming the input to this layer is a 320×320×16 feature map, after slicing, four 160×160×16 sub-feature maps are generated. These four maps are then concatenated along the channel dimension to form a 160×160×64 tensor. This is followed by a depthwise separable convolutional layer, initially consisting of 64 groups of 3×3 depthwise convolutions. Since the number of groups equals the number of channels, each convolutional kernel is responsible for only one corresponding channel, which greatly preserves the original response value of that pixel location. The subsequent pointwise convolution operator linearly weights and combines the information from these 64 channels, mapping it to the required 32-channel feature map. Compared to the traditional 3×3 stride convolution (Stride=2), this process introduces slightly more channels, but due to the sparsity of the operator parameters, the actual computational cost does not increase significantly, while effectively avoiding information annihilation during downsampling.

[0066] The internal logic of the multi-receptive-field attention feature enhancement module further ensures robustness. The channel attention part of this module employs a set of learnable scaling factors. and By adaptively adjusting the activation threshold of neurons, the network can automatically switch feature extraction weights at different water depths (corresponding to different hue biases). In shallow water, where the red light component is still present, the network will strengthen its attention to color feature channels; while in deep water, where the image presents a single blue-green hue, the multi-receptive field attention convolution operator will adaptively enhance the weights on shape and texture edge features.

[0067] The mathematical process of the adaptive spatial feature fusion head in processing the three layers of features P1, P2, and P3 can be expressed as: Let The three levels are respectively in coordinates The feature vector at that location. The final fused features. Among them, the weighting coefficient Dynamically generated by the weight prediction network, and satisfying In the implementation of this invention, through gradient backpropagation, the weight prediction network learns to adjust these coefficients in real time according to the target's scale. When an extremely small target appears within the detection window, Approaching 1, thus maximizing the use of the original high-resolution information of the P1 layer.

[0068] In the assembly and training steps of the detection network, this invention also introduces a learning rate warm-up mechanism. During the first three training epochs, the learning rate linearly increases from 1e-6 to a set initial learning rate of 0.01. The engineering significance of this operation is to prevent large gradient fluctuations caused by the random initialization of parameters in the SPDPro-Conv and ASFF modules in the early stages of training, ensuring that the model can smoothly converge to a local optimum. Simultaneously, an exponential moving average technique is enabled during training, further improving the generalization performance during the inference phase by smoothing the historical processing of model weights.

[0069] In the inference testing step of the model, to further verify the reliability of the algorithm in a real-world engineering environment, the trained model was deployed on an underwater robot equipped with an NVIDIA Jetson Orin NX embedded computing module. Experimental results show that, with a power consumption limit of 25W, the algorithm can still achieve a detection speed of over 30FPS, and the detection accuracy for small underwater targets remains above 85%.

[0070] In summary, an underwater small target detection algorithm based on an improved YOLOv8 constructs a visual perception system that achieves a balance between accuracy and efficiency through systematic improvements to low-level convolution, mid-level enhancement, and high-level fusion. The SPDPro-Conv module solves the problem of spatial information loss, the C2f-RFSE module enhances feature extraction capabilities in noisy environments, and the ASFF fusion mechanism optimizes feature utilization across scales. These improvements work synergistically to address the technical challenges in underwater small target detection. The above description is merely a specific embodiment of the present invention, and the scope of protection of the present invention 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 invention should be included within the scope of protection of this invention.

Claims

1. An underwater small target detection algorithm based on an improved YOLOv8, characterized in that, The algorithm includes the following steps: The steps for constructing an underwater small target detection dataset are as follows: acquire images containing underwater small targets, use annotation tools to associate and annotate the target bounding box coordinates and category information in the images, generate corresponding annotation files, and uniformly adjust the resolution of the images to a preset number of pixels to obtain the underwater small target detection dataset. The construction steps of the small target optimization detection module are as follows: For the features of small underwater targets, the detection architecture of YOLOv8 is reconstructed. A P1 branch for shallow high-resolution feature maps is introduced into the feature extraction network to build a detection head for 160×160 resolution feature maps. At the same time, the detection layer and corresponding feature extraction branch for large target detection in the original architecture are removed to form an asymmetric detection head layout. The steps for constructing the spatial depth convolutional feature extraction module are as follows: The SPDPro-Conv module is introduced into the feature extraction backbone of the improved YOLOv8. The SPDPro-Conv module performs slicing operations through spatial depth convolutional layers to achieve downsampling, and then performs feature extraction and channel transformation through depth-separable convolutional layers to preserve the spatial information of the underwater image during the scaling process. Construction steps of the multi-receptive-field attention feature enhancement module: embed the C2f-RFSE module into the backbone network of the improved YOLOv8. The C2f-RFSE module dynamically adjusts the local receptive field weights and key feature channel weights of the underwater image through the concatenation of the multi-receptive-field attention convolution operator and the channel attention mechanism. The adaptive spatial feature fusion head construction steps are as follows: The adaptive spatial feature fusion module receives multi-scale feature maps from different levels of the detection network, and dynamically adjusts the fusion ratio of each scale feature map at each spatial location through learnable weight parameters to generate the fused feature representation. The network assembly and training steps are as follows: The small target optimization detection module, spatial depth convolution feature extraction module, multi-receptive field attention feature enhancement module and adaptive spatial feature fusion head are integrated into the YOLOv8 framework. The network is iteratively trained using the underwater small target detection dataset, and the network weights are updated until convergence to obtain the optimal network model. Model inference testing steps: Input the underwater image to be detected into the optimal network model, and output the detection results including the target category and the coordinates of the predicted bounding box.

2. The underwater small target detection algorithm based on the improved YOLOv8 according to claim 1, characterized in that, In the construction step of the spatial depth convolutional feature extraction module, the specific logic for the slicing operation of the spatial depth convolutional layer is as follows: For the input dimension is Feature map ,in For batch size, Input the number of channels. To achieve spatial resolution, the spatial depth convolutional layer samples every other pixel along both the height and width directions, converting the input feature map... It is uniformly divided into four sub-feature maps , , and The spatial dimensions of each sub-feature map are all ; The pixel sampling coordinate logic of the four sub-feature maps is as follows: ; ; ; ; The four sub-feature maps are concatenated along the channel dimension to generate a dimension of... The splicing feature map transfers the spatial information of the image to the channel dimension.

3. The underwater small target detection algorithm based on the improved YOLOv8 according to claim 2, characterized in that, In the spatial depth convolution feature extraction module construction step, the spliced ​​feature map is input to the depth separable convolutional layer, which includes a channel-wise convolution operator and a point-wise convolution operator set in series. The channel-wise convolution operator uses a 3×3 convolution kernel, and the number of its convolution groups is set to the same as the number of channels in the concatenated feature map. Equal, used to perform spatial feature extraction independently within each channel; The pointwise convolution operator uses a 1×1 convolution kernel to perform information exchange between channels and maps the number of channels in the feature map to a preset target number of channels. ; After the channel-wise convolution operator and the point-wise convolution operator, a batch normalization layer and a SiLU nonlinear activation function layer are provided.

4. The underwater small target detection algorithm based on the improved YOLOv8 according to claim 1, characterized in that, In the multi-receptive-field attention feature enhancement module construction step, the internal topology of the C2f-RFSE module includes: An initial 1×1 convolutional layer is used to reduce the dimensionality of the input feature map; Two parallel feature branches, where the first branch is a direct jump branch and the second branch is processed through a cascaded bottleneck layer; The multi-receptive-field attention convolution operator is integrated inside the bottleneck layer. The multi-receptive-field attention convolution operator dynamically adjusts the sampling area of ​​the convolution kernel by learning the offset parameters of each pixel in the learning space, so as to cover the outline of the irregular underwater target. A channel attention branch is provided at the output end of the bottleneck layer. This branch uses a global average pooling layer to compress spatial features into a global descriptor and calculates the weight coefficients of each channel through two fully connected mapping layers. The weight coefficients are then multiplied by the original feature map to achieve recalibration of the feature channels.

5. The underwater small target detection algorithm based on the improved YOLOv8 according to claim 4, characterized in that, In the multi-receptive-field attention feature enhancement module, the multi-receptive-field attention convolution operator, during execution, predicts the offset field through a parallel convolution branch. The number of channels in the offset field is... ,in The offset field represents the kernel size for each sampling point. and Directional offset; during the sampling process, bilinear interpolation is used to process non-integer coordinate points, so that the convolution sampling position is offset according to the geometric contour of the underwater target.

6. The underwater small target detection algorithm based on improved YOLOv8 according to claim 1, characterized in that, In the adaptive spatial feature fusion head construction step, the adaptive spatial feature fusion module receives feature maps from three different levels, P1, P2, and P3, and its fusion logic includes: Scale alignment processing: For the target layer to be fused, feature maps from other layers are upsampled by bilinear interpolation or downsampled by stride convolution to ensure that the spatial resolution of all feature maps to be fused is consistent with the spatial resolution of the target layer. Adaptive weight calculation: A weight prediction network is introduced, which predicts the corresponding spatial weight map based on the cascaded multi-scale feature map. The spatial weight map generates a corresponding weight coefficient for each pixel position. Weighted summation fusion: For each spatial location, the aligned feature vectors of each layer are multiplied by their corresponding weight coefficients and then summed to obtain the fused feature vector.

7. The underwater small target detection algorithm based on the improved YOLOv8 according to claim 6, characterized in that, In the adaptive spatial feature fusion head, the weight prediction network consists of two 1×1 convolutional layers, and its output is normalized by the Softmax function to ensure that at any pixel location, the sum of the weight coefficients from the three layers P1, P2, and P3 is always equal to 1.

8. The underwater small target detection algorithm based on the improved YOLOv8 according to claim 1, characterized in that, In the construction step of the small target optimization detection module, the P1 branch processes the shallow feature map of 160×160 resolution through a series of convolutional layers with small-sized convolutional kernels, and the number of output channels of the P1 branch is configured to match the cascaded input of the subsequent adaptive spatial feature fusion head; the small target optimization detection module concentrates computational resources on the processing of high-resolution shallow features by removing the P5 detection layer and its associated feature extraction path for large target detection in the original YOLOv8.

9. The underwater small target detection algorithm based on the improved YOLOv8 according to claim 1, characterized in that, In the detection network assembly and training steps, the training parameters and strategy configurations are as follows: The stochastic gradient descent (SGD) optimizer with momentum was adopted, with the momentum factor set to 0.937 and the weight decay coefficient set to 0.0005. The learning rate scheduling adopts a cosine annealing strategy and introduces a learning rate warm-up mechanism, which linearly increases the learning rate from 1e-6 to the initial learning rate of 0.01 in the first 3 training cycles. The loss function includes localization loss, classification loss, and distributed focal length loss. The localization loss uses CIoU Loss to constrain the positional deviation, center point distance, and aspect ratio of the predicted bounding box. The classification loss uses binary cross-entropy loss. The distributed focal length loss is used to refine the probability distribution of the bounding box.

10. The underwater small target detection algorithm based on the improved YOLOv8 according to claim 1, characterized in that, In the underwater small target detection dataset construction step, the data augmentation strategies performed on the original images include: HSV space color gamut transformation, random rotation, horizontal flipping, and Mosaic-4 data augmentation. The Mosaic-4 data augmentation increases the network's perception frequency of the spatial distribution of small targets by dynamically combining four images of different scales in the training batch.