Underwater garbage detection method and system based on MSD-YOLO network

By improving the YOLO network to an MSD-YOLO network and combining it with lightweight multi-scale feature extraction and a dynamic detection head, the problems of low-contrast target omission and dynamic noise interference in underwater debris detection are solved, achieving efficient and accurate underwater debris detection.

CN120877076AInactive Publication Date: 2025-10-31GUANGDONG POLYTECHNIC NORMAL UNIV
View PDF 0 Cites 8 Cited by

Patent Information

Application Number
CN202510875999.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2025-10-31
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing underwater debris detection technologies suffer from problems such as missed detection of low-contrast targets, difficulty in identifying small targets, and interference from dynamic background noise in complex environments. In particular, light absorption and scattering in underwater images lead to color distortion and low contrast. Existing models have insufficient accuracy in identifying transparent plastic bags and microplastic fragments.

Method used

The MSD-YOLO network is adopted, and the YOLO network model is improved to the MSD-YOLO network. The C3k2 module is replaced with the C3k2-MSCB module, the C2PSA module is integrated into the SCSA module, and the detection head is replaced with DynamicDCMv3Head. A multi-module collaborative optimization design is constructed, including lightweight multi-scale feature extraction, cross-layer feature interaction and dynamic detection head, which enhances the target edge and texture features and suppresses background noise interference.

Benefits of technology

It significantly improves the accuracy and robustness of underwater debris detection, reduces the number of parameters, and effectively addresses the detection needs of blurred, occluded, and deformed targets in complex underwater environments. It also improves the detection accuracy of low-contrast targets and small-sized debris, and suppresses dynamic background noise interference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120877076A_ABST
    Figure CN120877076A_ABST
Patent Text Reader

Abstract

The invention discloses an underwater garbage detection method and system based on an MSD-YOLO network, and belongs to the technical field of computer vision and deep learning, and the method comprises the steps: S1, obtaining an underwater garbage data set, and carrying out the preprocessing; s2, configuring a model training environment; s3, a YOLO network model is improved, an MSD-YOLO network model is formed, an original C3k2 module is replaced by a C3k2-MSCB module, a C2PSA module is fused into an SCSA module, an original detection head is replaced by DynamicDCMv3Head, the MSD-YOLO network model oriented to underwater garbage detection is obtained, and a data set is input into an MSD-YOLO network for training; and S4, inputting a to-be-detected underwater image into the trained MSD-YOLO network model, and obtaining target category, position and confidence information. According to the method, higher accuracy is achieved with lower parameter quantity, and the efficiency and the performance are balanced. According to the invention, the efficiency and reliability of underwater target detection are significantly improved, and an efficient and robust technical solution is provided for marine environmental protection monitoring and underwater autonomous operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and deep learning technology, specifically to an underwater debris detection method and system based on the MSD-YOLO network. Background Technology

[0002] With the escalating problem of marine plastic pollution, which poses a significant threat to marine ecosystems and severely damages coral reefs, fish habitats, and biodiversity, efficient detection and cleanup of underwater debris has become one of the core tasks of marine ecological protection. Traditional underwater debris detection mainly relies on manual diving or trawler patrols, which suffers from low efficiency, high cost, and limited coverage, making it difficult to meet the detection needs of deep-sea or complex terrain areas. In recent years, deep learning-based target detection technology has achieved remarkable results in terrestrial scenarios due to its high accuracy and real-time performance. However, underwater images often suffer from color distortion and low contrast due to light absorption and scattering. In addition, dynamic noise caused by suspended particles and biological activity results in a high false negative rate for low-contrast targets (such as transparent plastic bags) in existing models, and the recognition accuracy of small-sized debris (such as microplastic fragments) is also insufficient to meet practical needs.

[0003] In recent years, while mainstream detection technologies such as the YOLO series have improved detection speed through multi-scale prediction and lightweight design, they still have significant shortcomings in complex underwater scenarios. For example, the lightweight module of YOLOv5 sacrifices multi-scale feature representation capabilities, leading to an increased false negative rate for small targets; although YOLOv8 introduces multi-task support, its static detection head cannot adaptively adjust the weights of classification and localization tasks, resulting in a high false positive rate under dynamic noise interference. Moreover, existing attention mechanisms (such as channel attention) lack cross-layer interaction capabilities, making it difficult to effectively capture the edge and texture details of low-contrast targets, thus limiting the model's practicality in turbid waters.

[0004] Therefore, how to significantly improve the detection accuracy of low-contrast targets and small-sized debris while reducing the number of parameters, and effectively suppress dynamic background noise interference, is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] This invention aims to provide an underwater debris detection method based on the MSD-YOLO network, addressing the problems of low-contrast target omission, difficulty in identifying small targets, and dynamic background noise interference in complex underwater environments. Through multi-module collaborative optimization design, this invention significantly improves the accuracy, efficiency, and robustness of underwater debris detection.

[0006] To address the aforementioned problems, the present invention provides the following technical solution:

[0007] The first aspect of this invention provides an underwater debris detection method based on an MSD-YOLO network, comprising the following steps:

[0008] S1. Obtain underwater debris dataset and preprocess it, including image enhancement, annotation format conversion and data partitioning;

[0009] S2. Configure the training environment for the MSD-YOLO network model, including determining the server computing mode and building the deep learning framework dependency library;

[0010] S3. Improve the YOLO network model to form the MSD-YOLO network model. Replace the C3k2 module in the YOLO network model with the C3k2-MSCB module, integrate the C2PSA module into the SCSA module, replace the original detection head with DynamicDCMv3Head, obtain the hyperparameters of the MSD-YOLO network, construct the MSD-YOLO network model for underwater debris detection, and input the preprocessed dataset into the MSD-YOLO network for training.

[0011] S4. Input the underwater image to be detected into the trained MSD-YOLO network model to obtain target category, location and confidence information.

[0012] Furthermore, in step S1, the image enhancement includes random cropping, rotation, and mixed noise injection to improve data diversity; the annotation format is converted to modify the file format to a format recognizable by the MSD-YOLO network model; the data partitioning divides the preprocessed underwater debris dataset into training, validation, and test sets proportionally, and balances the categories of underwater debris to be detected through stratified sampling techniques.

[0013] Furthermore, in step S2, it is determined whether the server can perform parallel computation: if yes, the training environment is configured to parallel computation mode; if no, the training environment is configured to single-processor computation mode; the configured deep learning framework dependency library is a deep learning framework dependency library that can perform MSD-YOLO network training.

[0014] Furthermore, in step S3, the convolution-C3k2-MSCB module includes a convolutional layer and a C3k2-MSCB module. The C3k2-MSCB module includes two convolutional layers, a segmentation layer, at least one cascaded MSCB Bottleneck module, and a connection layer.

[0015] First, the channel dimension is adjusted by a convolutional layer. Then, the feature map is split into two branches by a splitting operation. One branch passes through one or more MSCB Bottleneck modules. Then, the feature maps of the two branches are concatenated along the channel dimension by one or more residual connections. The multi-branch output features are concatenated along the channel dimension. The number of channels is restored to the original input dimension by a convolutional layer. Finally, multi-scale fused features are output.

[0016] The MSCB Bottleneck module comprises convolutional layers and the MSCB module. The MSCB module first passes through convolutional layers to compress the number of channels to half the input, reducing computational complexity. Then, batch normalization and the ReLU6 activation function enhance the non-linear representation of features. Next, the module passes through the MSDC module, which restores the number of channels to the original input dimension through convolutional layers. After batch normalization, it performs residual connections with the input features to preserve original detailed information. In the C3k2-MSCB module, the segmentation layer splits the feature map obtained from the convolutional layers into two branches. One branch is input to the MSCB Bottleneck module to improve the non-linear feature representation, and then it is fused with the second branch at the connection layer.

[0017] Furthermore, in step S3, the C2PSA-SCSA module includes a convolutional layer, a segmentation layer, several two-convolutional layers, a segmentation layer, one or more cascaded SCSA-PSABlock modules, and a connection layer. First, the channel dimension is adjusted through the convolutional layer, and the feature map is divided into two branches through a splitting operation. One branch further optimizes the feature representation capability through one or more SCSA-PSABlock structures. Then, the feature maps of the two branches are concatenated along the channel dimension through one or more residual connections. The number of channels is unified through the convolutional layer, and finally, multi-scale fused features are output.

[0018] The SCSA-PSABlock module comprises an SCSA module and two convolutional layers. The input feature map X first undergoes the SCSA module followed by two convolutional operations, ultimately outputting the concatenated feature information. The SMSA module first decomposes the input feature map X into independent sub-features along the height (H) and width (W) dimensions. Then, it applies depthwise separable one-dimensional convolutions of different scales to each sub-feature, finally concatenating each sub-feature and generating a spatial attention map through GroupNorm (GN) and Sigmoid activation. The PCSA module first compresses the spatial dimension using average pooling while preserving spatial prior information. Then, it calculates inter-channel similarity using single-head self-attention SHSA, and finally generates channel weights through Sigmoid activation to obtain the compressed attention result.

[0019] Furthermore, in step S3, the DynamicDCMv3Head module includes π L Branch, π S Branches and π C Branches;

[0020] The π L The branch compresses spatial information through average pooling, and after convolution and ReLU activation, it generates channel attention weights using the Hard-Sigmoid activation function.

[0021] The π S The branch uses indexing operations to locate multi-scale features, performs deformable convolution through the DCNv3 module, and generates spatial deformation offset by combining the Sigmoid function.

[0022] The π C The branch learns the weights between tasks through a double fully connected layer and ReLU activation, and outputs a multi-task coordination vector in the form of [1,0,0,0] after normalization.

[0023] The π L Branch, π S Branches and π C The three branch outputs are fused by tensor multiplication to dynamically generate the channel weights, spatial deformation parameters, and task priority parameters of the detection head, realizing an end-to-end scale-space-task triple adaptive mechanism. The DCNv3 extracts multi-scale features through 3×3 grouped convolution to generate an initial offset field, normalizes the offsets, and finally combines the offsets with learnable weights to dynamically adjust the step size and direction.

[0024] Furthermore, in S4, the trained and optimized model is deployed in actual underwater detection equipment to perform real-time target detection. After receiving underwater images, the model quickly processes and outputs detection results, including the target's location, category, and confidence level.

[0025] A second aspect of the present invention provides an underwater debris detection system based on an MSD-YOLO network, comprising an MSD-YOLO network, wherein the MSD-YOLO network includes a backbone network, a neck network, and a head network;

[0026] The backbone network includes an input layer, a convolutional layer, four convolutional-C3K2-MSCB modules, a fast spatial pyramid pooling module, and a C2PSA-SCSA module. The input layer is connected to the convolutional layer, the convolutional layer is connected to the four convolutional-C3K2-MSCB modules, the four convolutional-C3K2-MSCB modules are connected to the fast spatial pyramid pooling module, and the fast spatial pyramid pooling module is connected to the C2PSA-SCSA module to perform feature extraction at different scales.

[0027] The neck network comprises four C3K2-MSCB modules, four connection layers, two upsampling layers, and two convolutional layers. The first route consists of two C3K2-MSCB modules, a connection layer, and an upsampling layer module, while the second route consists of two convolutional layers, a connection layer, and a C3K2-MSCB module module, which perform feature fusion at different scales.

[0028] The head network includes three DynamicDCMv3Heads, which construct three sets of detection heads for large, medium and small scale features, generate bounding box coordinates, class probabilities and confidence scores, classify objects within the boxes, and generate the final prediction part.

[0029] The results of the C3K2-MSCB module of the backbone network are simultaneously output to the convolutional layer of the backbone network and the connection layer of the neck network; the results of the C2PSA-SCSA module of the backbone network are simultaneously output to the upsampling layer and connection layer of the neck network; the results of the C3K2-MSCB module of the neck network are simultaneously output to the connection layer, convolutional layer of this sub-network and the DynamicDCMv3Head of the head sub-network.

[0030] The beneficial effects of this technical solution are at least:

[0031] This invention significantly improves the overall performance of underwater debris detection through multi-module collaborative optimization design:

[0032] (1) Based on the lightweight multi-scale feature extraction module C3k2-MSCB, local details and global semantic features at different scales are extracted. Combined with the channel shuffle strategy, the cross-channel information interaction capability is enhanced, the number of parameters is reduced, and the feature dispersion problem caused by the fragmented distribution of underwater debris is effectively solved, thus solving the problem of missed detection of small targets.

[0033] (2) The PSA and SCSA modules enhance the edge and texture features of the target through local spatial masking, suppress background noise interference, fuse high-level semantics and low-level detail features across layers, generate collaborative attention maps, improve the visibility of low-contrast targets (such as transparent plastic bags and half-buried fishing nets), and dynamically adjust attention weights by combining shallow detail features and high-level semantic information through cross-layer feature interaction, so that the model can still accurately locate targets in low-light and color-biased scenes.

[0034] (3) DynamicDCMv3Head generates dynamic offsets by using the DCNv3 module. It effectively suppresses dynamic background noise interference by adapting to target deformation (such as twisted fishing nets or folded plastic) through bilinear interpolation, thus balancing the conflict between classification and localization tasks.

[0035] The overall solution ensures lightweight design while maintaining detection accuracy and robustness, and can efficiently meet the detection needs of blurred, obscured and deformed targets in complex underwater environments, providing reliable technical support for marine environmental monitoring and autonomous underwater operations. Attached Figure Description

[0036] Figure 1 This is a flowchart of an underwater debris detection method based on an MSD-YOLO network according to the present invention;

[0037] Figure 2 This is a structural diagram of the MSD-YOLO network model in an embodiment of the present invention;

[0038] Figure 3 This is a structural diagram of the C3k2-MSCB module in an embodiment of the present invention;

[0039] Figure 4 This is a structural diagram of the C2PSA-SCSA module in an embodiment of the present invention;

[0040] Figure 5 This is a structural diagram of the DynamicDCMv3Head module in an embodiment of the present invention;

[0041] Figure 6 This is a comparison chart of the detection results of the original model and the MSD-YOLO network model in this embodiment of the invention. Detailed Implementation

[0042] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the embodiments and accompanying drawings. Here, the illustrative embodiments and descriptions of this invention are used to explain the invention, but are not intended to limit the invention.

[0043] It should also be noted that, in order to avoid obscuring the invention with unnecessary details, only the processing steps closely related to the solution according to the invention are shown in the accompanying drawings, while other details that are not closely related to the invention are omitted.

[0044] It should be emphasized that the term "including / comprises" as used herein refers to the presence of a feature, element, or step, but does not exclude the presence or addition of one or more other features, elements, or steps.

[0045] In the following description, embodiments of the invention will be illustrated with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar parts, or the same or similar steps.

[0046] It should be emphasized here that the step markers mentioned below are not a limitation on the order of the steps, but should be understood as meaning that the steps can be executed in the order mentioned in the embodiments, or in a different order than in the embodiments, or several steps can be executed simultaneously.

[0047] refer to Figures 1 to 5 An underwater debris detection method based on the MSD-YOLO network includes the following steps:

[0048] S1. Obtain the underwater debris dataset and preprocess it, including image enhancement, annotation format conversion, and data partitioning.

[0049] Specifically, a publicly available underwater debris detection dataset was used, containing 5988 labeled images covering common underwater debris categories such as plastics, plastic bottles, fishing nets, metal cans, and discarded tires, stored in JPEG format. First, the data was cleaned to remove blurry, duplicate, or incorrectly labeled samples to ensure data quality. Visible areas of partially occluded targets (such as partially buried fishing nets) were masked to improve the model's adaptability to occluded scenes. Image enhancement techniques were used to simulate complex underwater environments, including random cropping (cropping images at a scaling ratio of 0.8-1.2 times while preserving target integrity); rotation and flipping (random horizontal flipping with a 50% probability) and rotation (±15°) to simulate changes in the shooting perspective of underwater equipment; optical interference simulation (adding Gaussian noise (σ=0.05) to simulate suspended particles and overlaying dynamic wave textures to simulate water surface reflection); low-light enhancement (randomly reducing brightness by 30%-50% and applying histogram equalization to restore contrast); and adaptive dehazing and color correction using dynamic wave texture overlay and a dark channel prior algorithm. The annotation files were converted from PASCAL VOC format to YOLO format, and the bounding box coordinates were normalized to the [0,1] interval. Visible area masks were added to occluded targets to optimize training performance. Data was divided into training, validation, and test sets in a 7:2:1 ratio. Stratified sampling was used to balance the class distribution (e.g., 30% plastic, 25% fishing nets, 20% metal cans, etc.) to ensure the class proportions in each subset were consistent with the whole set. Oversampling was performed on small sample classes (e.g., glass shards), and samples were duplicated and randomly translated and rotated to alleviate class imbalance. Five-fold cross-validation was used to improve the model's generalization ability. The preprocessed data was visualized and statistically validated to ensure annotation consistency and enhancement effectiveness, laying a high-quality data foundation for model training.

[0050] S2. Configure the training environment for the MSD-YOLO network model, including the computation mode and deep learning framework dependency libraries;

[0051] Specifically, the configured training environment includes: CUDA 12.1 driver and cuDNN 8.9.6 acceleration library, supporting TensorCore operations and mixed-precision training; a virtual environment created via Anaconda; installation of the deep learning framework PyTorch 2.3.0 (compatible with CUDA 12.1); installation of the wandb library (version 0.16.4) for real-time monitoring of training loss, accuracy metrics, and hyperparameters; installation of opencv-python (version 4.8.1) for image enhancement and visualization; an NVIDIA GeForce RTX4090 GPU with 24GB of VRAM supporting FP16 / FP32 mixed-precision computation to meet the needs of large-scale model training; an Intel Core i9-13900K processor (24 cores, 32 threads) and 128GB (DDR5) of RAM to ensure efficient data loading and preprocessing; and the use of an NVMe SSD (2TB) to store the dataset and model weights with read / write speeds ≥7000MB / s to avoid training bottlenecks.

[0052] S3. Construct the MSD-YOLO network model, referring to... Figure 2 The preprocessed dataset is input into the MSD-YOLO network for training. The MSD-YOLO network model replaces the original C3k2 module in the basic architecture with the C3k2-MSCB module, which contains multi-branch lightweight convolutional kernels. The spatial-channel collaborative attention mechanism SCSA is integrated into the C2PSA module in the basic architecture. The original detection head in the basic architecture is replaced with the deformable convolutional network dynamic detection head DynamicDCMv3Head. The hyperparameters of the MSD-YOLO network are obtained to obtain the MSD-YOLO network model for underwater debris detection.

[0053] For details, please refer to Figure 3 In S3, the construction of the C3k2-MSCB module includes the following steps: The input feature map is first processed by a 1×1 convolutional layer to adjust the channel dimension. The feature map is then split into two branches by a Split operation. One branch further optimizes the feature representation capability through several MSCB Bottleneck structures. Then, the feature maps of the two branches are concatenated along the channel dimension through n residual connections. The number of channels is unified and batch normalization (BN) is completed through a 1×1 convolutional layer, and multi-scale fused features are output. The MSCB Bottleneck structure is compressed by a 1×1 convolutional layer and input to the MSCB submodule. The MSCB submodule includes depthwise separable convolution (DWC) and channel shuffling operations.

[0054] The first two convolutional layers extract basic features and retain the local perceptual ability of C3k2. The MSCB branch fuses multi-resolution features with channel shuffling through multi-scale depth separation convolution (kernel size of 1×1, 3×3, 5×5). The residual union adds the original input to the multi-scale branch to avoid gradient vanishing.

[0055] Channel expansion: The number of channels is expanded using 1×1 convolutions (expansion factor of 2) to enhance feature representation capabilities.

[0056]

[0057] Multi-scale depthwise convolution: Applying depthwise separating convolutions with different kernel sizes (1×1, 3×3, 5×5) in parallel to capture multi-scale features:

[0058]

[0059] DWCB KS (x)R6(BN(DWC ks (x)), DWC ks (·) is a depthwise convolution with a kernel size of ks. The BN(·) and R6(·) activation functions (with the output truncated in the interval [0,6]) can suppress gradient explosion.

[0060] CS(·): Channel shuffling operation, which groups channels and then rearranges them to enhance cross-group information exchange.

[0061] Channel compression: The original number of channels is recovered using 1×1 convolution, while multi-scale features are fused.

[0062] For details, please refer to Figure 4 In S3, the implementation of the SCSA module in the C2PSA module includes the following steps: The input feature map first passes through a 1×1 convolutional layer to adjust the channel dimension. The feature map is then split into two branches through a Split operation. One branch further optimizes the feature representation capability through several SCSA-PSABlock structures. Then, the feature maps of the two branches are concatenated along the channel dimension through n residual connections. The number of channels is unified and batch normalization (BN) is completed through a 1×1 convolutional layer, and multi-scale fused features are output. The SCSA-PSABlock structure first passes through SCSA and then performs two Conv operations.

[0063] SCSA is a collaborative attention mechanism that combines Shared Multi-Semantic Space Attention (SMSA) and Progressive Channel Self-Attention (PCSA). It aims to guide channel feature learning through multi-semantic space information and reduce the differences between multi-semantic features. Its core consists of two modules:

[0064] Shared Multisemantic Space Attention (SMSA):

[0065] Input decomposition: Decompose the input feature map X into independent sub-features along the height (H) and width (W) dimensions:

[0066]

[0067] Where K=4 is the number of sub-function groups, and the number of channels in each sub-function is C / K.

[0068] Multi-scale convolution: Using depthwise separable one-dimensional convolutions of different scales (kernel sizes of 3 / 5 / 7 / 9) for each sub-feature to capture multiple semantic spatial structures:

[0069]

[0070] Group Normalization and Attention Generation: After concatenating each sub-feature, a spatial attention map is generated through group normalization (GN) and sigmoid activation.

[0071]

[0072] The final output is:

[0073] SMSA(X) = X S =Attn H ×Attn W ×X

[0074] Progressive Channel Retention (PCSA):

[0075] Asymptotic compression: Compresses spatial dimensions using average pooling while preserving prior spatial information. The formula is as follows:

[0076] X P =AvgPool (H,W)→(H',W') (X S )

[0077] Channel self-attention: Channel similarity is calculated using single-head self-attention (SHSA).

[0078]

[0079] Channel recalibration: Compress the attention results and generate channel weights via Sigmoid activation:

[0080] PCSA(X S ) = X C =X S ×σ(AvgPool (H',W')→(1,1) (X attn )

[0081] SCSA achieves a synergistic effect through concatenated shared multi-semantic space attention (SMSA) and progressive channel self-attention (PCSA). SMSA provides multi-semantic space priors to enhance local and global feature representations, while PCSA utilizes self-attention to reduce semantic differences between sub-features and promote cross-channel information fusion. The final SCSA constructed is:

[0082] SCSA(X) = PCSA(SMSA(X))

[0083] For details, please refer to Figure 5 In S3, the construction of the DynamicDCMv3Head module includes: (1) π L The branch compresses spatial information through global average pooling, and after 1×1 convolution and ReLU activation, it uses a hard-sigmoid function to generate channel attention weights; (2)π S The branch uses indexing operations to locate multi-scale features, performs deformable convolution through the deformable convolutional network DCNv3 module, and generates spatial deformation offset by combining the Sigmoid function; (3)π C The branch learns the weights between tasks through a double fully connected layer and ReLU activation, and outputs a multi-task coordination vector in the form of [1,0,0,0] after normalization. The three outputs are fused by tensor multiplication to dynamically generate the channel weights, spatial deformation parameters, and task priority parameters of the detector head, realizing an end-to-end scale-space-task triple adaptive mechanism. DCNv3 extracts multi-scale features through 3×3 grouped convolution to generate an initial offset field, normalizes the offsets, and finally combines the offsets with learnable weights to dynamically adjust the stride and direction.

[0084] DynamicHead integrates the scale perception, spatial perception, and task perception capabilities of a target probe into a single framework through a unified 3D attention mechanism.

[0085] W(F) = π C (π S (π L (F)F)F)F

[0086] Where π L (·), π S (·), π C (·) represent scale, space, and task-aware attention, respectively.

[0087] The hierarchical scale-aware attention module L is used for global pooling and generates a weight vector through a linear transformation:

[0088]

[0089] Here, f(·) is a 1×1 convolution, and σ(·) represents the hard-sigmoid activation function. The improvement lies in replacing global pooling with dynamic weighting between layers to increase sensitivity to extreme-scale targets.

[0090] The spatial awareness attention module combines deformable convolution and cross-level feature aggregation:

[0091]

[0092] Where K is the number of sparse sampling points, Δ pk and △ mk These are the offset coefficient and importance coefficient for predicting the input features, respectively. The improvement lies in the introduction of multi-layer cascaded deformable convolutions, which gradually refine the sampling locations by stacking multiple deformable convolutional layers.

[0093] The task-aware attention module uses a dual-threshold mechanism to control channel activation:

[0094] π C (F)max(α 1 F c +β 1 ,α 2 F c +β 2 )

[0095] Where α 1 ,α 2 ,β 1 ,β 2 =θ(F) is generated by a superfunction. θ(·) is implemented through a global pool and a fully connected layer. Its improvement lies in the introduction of task-specific channel grouping, where channels are grouped by task type and activated independently to avoid interference between tasks.

[0096] The DCNv3 network's basic structure uses a 3×3 standard convolutional kernel as the spatial feature extraction unit. In its extended design, the network implements dynamic position sensing by constructing nine parallel sampling branches (k=9). Compared to traditional convolution operations, this module adds two convolutional layers of the same scale for parameter prediction: the offset prediction layer outputs two-dimensional displacement parameters matching the size of the input feature map and calculates the X / Y coordinate offset for each spatial location; simultaneously, the modulation coefficient prediction layer generates weight adjustment parameters in the range [0,1] through a sigmoid activation function, which together serve as adaptive parameters for dynamic position sensing during feature sampling. These adaptive parameters collectively constitute the dynamic adjustment mechanism during feature sampling.

[0097]

[0098] Where p0 is the pixel under consideration, G represents the number of groups, and K is the total count of sampling points. Matrix w g exist

[0099] Defined above, where the group dimension is determined by C. ' =C / G is given. The modulation scalar m of the k-th sampling point in the g-th group. gk Normalization is performed using a soft maximum function. The input feature map is... In space with x g It indicates. p k Corresponding to the k-th position of the network sampling, Δp gk It is the displacement associated with the sampling position of the kth grid.

[0100] S4. Input the underwater image to be detected into the trained MSD-YOLO model, and output the target category, location, and confidence information.

[0101] Specifically, in this embodiment, the trained and optimized model is deployed in an actual underwater detection device to perform real-time target detection. After receiving the underwater image, the model quickly processes and outputs the detection results, including the target's location, category, and confidence level.

[0102] Finally, this embodiment illustrates the effects achieved by the present invention in conjunction with the accompanying drawings and data. To further test the model's performance, ablation experiments were conducted. First, the C2PSA-SCSA module enhanced the interaction capabilities of multi-level features. Experiments showed that it significantly improved the model's ability to capture low-contrast and occluded targets, significantly increasing recall by 2.0% and mAP50 by 1.1%, but precision decreased by 0.5%. This indicates that it optimizes target capture capabilities in complex scenes, but the enhanced feature sensitivity may introduce background interference or false detections. Then, by combining the C3k2-MSCB module, model complexity was reduced, the number of model parameters decreased by 28%, computational cost (GFLOPs) decreased by 15.9%, while mAP50-95 increased to 49.7%. This demonstrates that this module effectively captures contextual information at different scales through a parallel multi-branch structure, compensating for the loss of feature representation capabilities that might result from a lightweight design. Finally, the DynamicDCMv3Head detection head achieved adaptive feature assignment by employing a deformable convolution strategy with channel weighting, significantly improving the overall performance of the model. mAP50-95 reached 50%, and accuracy jumped to 79.4%. DynamicDCMv3Head also achieved false detection suppression by reducing redundant candidate frames potentially introduced by C2PSA-SCSA through a layer-by-layer filtering mechanism in the feature pyramid. Although the computational cost increased slightly from 6.3G to 7G GFLOPs, the number of parameters only increased to 2.3M, indicating that the dynamic mechanism achieved a performance breakthrough under limited resources. The final model's mAP50 improved by 3.1% compared to the baseline, and the mAP50-95 index improved by 2% compared to the baseline, while the number of parameters and computation remained at a lightweight level. This demonstrates that the collaborative design between modules achieved an effective trade-off between improving detection accuracy and reducing computational cost. Experimental results are shown in Table 1.

[0103] Table 1 Comparison of ablation experiments

[0104]

[0105]

[0106] Where A is the C2PSA-SCSA module, B is the C3k2-MSCB module, and C is the DynamicDCMv3Head module.

[0107] refer to Figure 6The results show the actual detection results of YOLOv11n before and after the improvement. It can be seen that in the same measured image, the conventional YOLOv11 network has false positives, while the improved YOLOv8 has no false positives and higher accuracy. This indicates that YOLOv11 suffers from false positives and environmental interference when dealing with small objects in a blurred underwater environment and objects similar to the environment. However, YOLO-SMD can identify blurred targets even under conditions of significant changes in lighting and water turbidity, proving that it can effectively reduce the impact of underwater environmental interference and capture finer features, further validating the effectiveness and practicality of the proposed method.

[0108] Those skilled in the art will understand that the exemplary components, systems, and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Whether implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention. When implemented in hardware, it can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this invention are programs or code segments used to perform the desired tasks. The programs or code segments can be stored in a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried in a carrier wave.

[0109] It should be clarified that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of the present invention.

[0110] In this invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or in place of features of other embodiments.

[0111] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations of the embodiments of the present invention are possible. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for underwater debris detection based on MSD-YOLO networks, characterized in that, Includes the following steps: S1. Obtain underwater debris dataset and preprocess it, including image enhancement, annotation format conversion and data partitioning; S2. Configure the training environment for the MSD-YOLO network model, including determining the server computing mode and building the deep learning framework dependency library; S3. Improve the YOLO network model to form the MSD-YOLO network model. Replace the C3k2 module in the YOLO network model with the C3k2-MSCB module, integrate the C2PSA module into the SCSA module, replace the original detection head with DynamicDCMv3Head, obtain the hyperparameters of the MSD-YOLO network, construct the MSD-YOLO network model for underwater debris detection, and input the preprocessed dataset into the MSD-YOLO network for training. S4. Input the underwater image to be detected into the trained MSD-YOLO network model to obtain target category, location and confidence information.

2. The underwater debris detection method based on MSD-YOLO network according to claim 1, characterized in that, In step S1, the image enhancement includes random cropping, rotation, and mixed noise injection to improve data diversity. The annotation format is converted to modify the file format to a format that the MSD-YOLO network model can recognize. The data partitioning divides the preprocessed underwater debris dataset into training set, validation set, and test set according to the proportions, and balances the categories of underwater debris to be detected through stratified sampling technology.

3. The underwater debris detection method based on MSD-YOLO network according to claim 1, characterized in that, In step S2, it is determined whether the server can perform parallel computing: if yes, the training environment is configured to parallel computing mode; if no, the training environment is configured to single-processor computing mode; the configured deep learning framework dependency library is a deep learning framework dependency library that can perform MSD-YOLO network training.

4. The underwater debris detection method based on MSD-YOLO network according to claim 1, characterized in that, In step S3, the convolution-C3k2-MSCB module includes a convolutional layer and a C3k2-MSCB module. The C3k2-MSCB module includes two convolutional layers, a segmentation layer, at least one cascaded MSCB Bottleneck module, and a connection layer. First, the channel dimension is adjusted by a convolutional layer. Then, the feature map is split into two branches by a splitting operation. One branch passes through one or more MSCB Bottleneck modules. Then, the feature maps of the two branches are concatenated along the channel dimension by one or more residual connections. The multi-branch output features are concatenated along the channel dimension. The number of channels is restored to the original input dimension by a convolutional layer. Finally, multi-scale fused features are output. The MSCB Bottleneck module includes a convolutional layer and an MSCB module. The MSCB module first passes through a convolutional layer to compress the number of channels to half of the input, reducing computational complexity. Then, it enhances the non-linear representation of features through batch normalization and the ReLU6 activation function. Next, it passes through the MSDC module, which restores the number of channels to the original input dimension through a convolutional layer. After batch normalization, it is residually connected with the input features to preserve the original detailed information. In the C3k2-MSCB module, the segmentation layer splits the feature map obtained by the convolutional layer into two branches. One branch is input to the MSCB Bottleneck module to improve the non-linear feature representation, and then it is fused with the second branch in the connection layer.

5. The underwater debris detection method based on MSD-YOLO network according to claim 1, characterized in that, In step S3, the C2PSA-SCSA module includes a convolutional layer, a segmentation layer, several double convolutional layers, a segmentation layer, one or more cascaded SCSA-PSABlock modules, and a connection layer. First, the channel dimension is adjusted through the convolutional layer. The feature map is divided into two branches through a splitting operation. One branch is further optimized for feature representation through one or more SCSA-PSABlock structures. Then, the feature maps of the two branches are concatenated along the channel dimension through one or more residual connections. The number of channels is unified through the convolutional layer, and finally, multi-scale fused features are output. The SCSA-PSABlock module includes an SCSA module and two convolutional layers. The input feature map X is first processed by the SCSA module, followed by two convolutional operations, and finally outputs the concatenated feature information. The SMSA module first decomposes the input feature map X into independent sub-features along the height (H) and width (W) dimensions. Then, it applies depthwise separable one-dimensional convolutions of different scales to each sub-feature, and finally concatenates each sub-feature. A spatial attention map is generated through GroupNorm (GN) and Sigmoid activation. The PCSA module first compresses the spatial dimension using average pooling to preserve spatial prior information, then calculates the inter-channel similarity using single-head self-attention SHSA, and finally generates channel weights through Sigmoid activation to obtain the compressed attention result.

6. The underwater debris detection method based on MSD-YOLO network according to claim 1, characterized in that, In step S3, the DynamicDCMv3Head module includes π L Branch, π S Branches and π C Branches; The π L The branch compresses spatial information through average pooling, and after convolution and ReLU activation, it generates channel attention weights using the Hard-Sigmoid activation function. The π S The branch uses indexing operations to locate multi-scale features, performs deformable convolution through the DCNv3 module, and generates spatial deformation offset by combining the Sigmoid function. The π C The branch learns the weights between tasks through a double fully connected layer and ReLU activation, and outputs a multi-task coordination vector in the form of [1,0,0,0] after normalization. The π L Branch, π S Branches and π C The three branch outputs are fused by tensor multiplication to dynamically generate the channel weights, spatial deformation parameters, and task priority parameters of the detection head, realizing an end-to-end scale-space-task triple adaptive mechanism. The DCNv3 extracts multi-scale features through 3×3 grouped convolution to generate an initial offset field, normalizes the offsets, and finally combines the offsets with learnable weights to dynamically adjust the step size and direction.

7. The underwater debris detection method based on MSD-YOLO network according to claim 1, characterized in that, In S4, the trained and optimized model is deployed in actual underwater detection equipment to perform real-time target detection. After receiving underwater images, the model quickly processes and outputs detection results, including the target's location, category, and confidence level.

8. An underwater debris detection system based on an MSD-YOLO network, characterized in that, This includes the MSD-YOLO network, which comprises a backbone network, a neck network, and a head network; The backbone network includes an input layer, a convolutional layer, four convolutional-C3K2-MSCB modules, a fast spatial pyramid pooling module, and a C2PSA-SCSA module. The input layer is connected to the convolutional layer, the convolutional layer is connected to the four convolutional-C3K2-MSCB modules, the four convolutional-C3K2-MSCB modules are connected to the fast spatial pyramid pooling module, and the fast spatial pyramid pooling module is connected to the C2PSA-SCSA module to perform feature extraction at different scales. The neck network comprises four C3K2-MSCB modules, four connection layers, two upsampling layers, and two convolutional layers. The first route consists of two C3K2-MSCB modules, a connection layer, and an upsampling layer module, while the second route consists of two convolutional layers, a connection layer, and a C3K2-MSCB module module, which perform feature fusion at different scales. The head network includes three DynamicDCMv3Heads, which construct three sets of detection heads for large, medium and small scale features, generate bounding box coordinates, class probabilities and confidence scores, classify objects within the boxes, and generate the final prediction part. The results of the C3K2-MSCB module of the backbone network are simultaneously output to the convolutional layer of the backbone network and the connection layer of the neck network; the results of the C2PSA-SCSA module of the backbone network are simultaneously output to the upsampling layer and connection layer of the neck network; the results of the C3K2-MSCB module of the neck network are simultaneously output to the connection layer, convolutional layer of this sub-network and the DynamicDCMv3Head of the head sub-network.

Citation Information

Cited By

  • Improved YOLOv8-based beach garbage identification and classification method

    CN121214173A

  • Industrial scene gesture recognition method and system based on improved YOLOv8

    CN121259929A

  • Improved yolo11n underwater target recognition detection method based on local and global perception

    CN121353874B

  • Multi-scale beach garbage detection method based on improved YOLOv11 algorithm

    CN121415057A

  • Multi-scale beach litter detection method based on improved YOLOv11 algorithm

    CN121415057B