Underwater target recognition method based on improved YOLOv8 algorithm
By improving the backbone and head network structure of the YOLOv8n model, the problems of detection accuracy and efficiency of underwater target recognition in turbid water environments were solved, achieving higher target recognition accuracy and recall.
Patent Information
- Application Number
- CN202510841459.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-23
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-06-23
AI Technical Summary
Existing underwater target recognition methods based on the YOLOv8 algorithm do not perform well in turbid water environments, and their accuracy and efficiency are limited.
An improved YOLOv8n model is adopted, which introduces depthwise separable convolution DSConv, inverted residual attention mechanism iRMB and dual-channel convolution DualConv, adds a small target detection head, optimizes the backbone network and head network structure, and improves feature extraction and target detection capabilities.
The improved model improved mAP@0.5, mAP@0.5-0.5, precision and recall by 0.5%, 0.8%, 0.5% and 1.0% respectively, significantly improving the accuracy and efficiency of underwater target identification.
Smart Images

Figure CN120356084B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of underwater target recognition technology, specifically to an underwater target recognition method based on an improved YOLOv8 algorithm. Background Technology
[0002] In today's era of rapid information technology development, the exploration and monitoring of underwater environments has become a crucial issue in global scientific research and industry. Underwater identification algorithms, as one of the key technologies in this field, directly impact the efficiency and safety of underwater operations. With the increasing demands from marine resource development, environmental monitoring, underwater archaeology, and military reconnaissance, higher requirements are being placed on the rapid and accurate identification of underwater targets. However, the complexity of the underwater environment makes target identification an extremely challenging task. Due to the unique characteristics of the underwater imaging environment, such as light attenuation, high turbidity, low contrast, and high light scattering, underwater images often exhibit problems such as blurriness, color distortion, and loss of detail, which significantly affects the accuracy and efficiency of target identification.
[0003] Traditional underwater target recognition methods mainly include sonar-based detection techniques and optical imaging-based image processing techniques. While sonar technology can provide relatively stable imaging results in complex environments, its imaging speed is slow and real-time processing is difficult. In contrast, optical imaging technology is favored due to its high resolution and real-time advantages. However, underwater optical imaging is often affected by light attenuation and scattering, leading to a decrease in image quality and consequently affecting the accuracy of target detection. To overcome these limitations, researchers have begun to explore deep learning-based target detection algorithms. Among them, the YOLO (You Only Look Once) series of algorithms has become a popular choice in the field of underwater target recognition due to its fast and efficient detection capabilities. The YOLO algorithm significantly improves detection speed and accuracy by integrating the target detection task into an end-to-end neural network model. In 2023, the Ultralytics team proposed the YOLOv8 algorithm. As the latest member of the YOLOv8 series, it inherits and develops the advantages of its predecessors. By introducing new architectures and technologies, such as a more efficient backbone network, an improved neck network, and a more accurate head network, it further enhances the detection capabilities for small targets and dense scenes, thus demonstrating greater potential in underwater target recognition. The network structures of existing underwater target recognition methods based on the YOLOv8n model are as follows: Figure 1As shown, the backbone network is the core of the YOLOv8n model, responsible for extracting and progressively abstracting features from the input image. It includes a 5-layer CBS module, a 4-layer C2f module, and a SPFF module. The CBS module contains a convolutional layer (Conv2d), a batch normalization layer (BN), and a SiLU activation function. The novel C2f module continues the CSP concept, deepening the fusion of gradient information to learn more feature information and achieve lower computational complexity. This allows YOLOv8 to improve detection speed while maintaining high accuracy. The C2f module segments the underwater feature map generated by the regular convolution of the CBS module before feeding it into the bot. The Bootleneck module uses grouped convolutional kernels to scan and change the receptive field size to generate local convolutional data feature maps. These local convolutional data feature maps are then convolved to produce the final underwater feature fusion map. SPPF, a module from the YOLOv5 algorithm, optimizes feature extraction and encoding processes, improving computational speed. The Neck network further processes the multi-scale features extracted by the Backbone network, employing two-stage upsampling to enhance the target detection performance of the YOLOv8n model at different scales. The Head network contains three detection heads at different scales. Many researchers have studied various optimization methods based on the YOLOv8 algorithm. Li Bohao et al. proposed a small target detection algorithm for UAV aerial photography by introducing variable kernel convolution, attention mechanism, P2 small target detection head, and improved loss function; Wang Wenhao et al. proposed an efficient algorithm for detecting floating objects on the water surface by introducing DBB module, non-local improvement scheme, and optimized loss function; Wang et al. developed an algorithm for small target detection in UAV remote sensing images called STF-YOLO and introduced a new convolution structure called STRCN. Through the use of this convolution structure, the algorithm achieved a significant performance improvement in small target detection; Zhang et al. proposed a small target detection model based on YOLOv8 with global attention content-aware feature reorganization (GCS-YOLOv8) to improve the efficiency of high beam vehicle detection. However, the detection performance of the above algorithm may be affected in turbid water environments. Since turbid water reduces the visibility and contrast of images, this may cause the improved YOLOv8-based model to encounter challenges in feature extraction and target recognition. In order to improve the detection efficiency in such environments, the model needs to be further optimized and adjusted. Summary of the Invention
[0004] One of the technical problems to be solved by this application is to overcome the shortcomings of the above-mentioned related technologies and provide an underwater target recognition method based on the improved YOLOv8 algorithm, which has high accuracy and efficiency in turbid water environments.
[0005] One technical solution adopted by this invention to solve the technical problem is: an underwater target identification method based on an improved YOLOv8 algorithm, specifically including the following steps:
[0006] The underwater image is input into the underwater target detection model to obtain the underwater target recognition result output by the underwater target detection model;
[0007] The underwater target detection model is an improved YOLOv8n model, which consists of a backbone network, a neck network, and a head network. The P5 convolutional block of the backbone network and the last convolutional block of the neck network use depthwise separable convolution DSConv. The fourth C2f module of the backbone network is a C2f_DiRMB module, which introduces the inverted residual attention mechanism iRMB and dual-channel convolution DualConv into the C2f module. A small target detection head is added to the head network to improve the ability to detect small targets.
[0008] Compared with related technologies, this application has the following advantages: First, it replaces the conventional convolutions in the P5 layer of the backbone network and the last layer of the neck network of the YOLOv8n model with depthwise separable convolution DSConv, reducing network complexity and improving inference speed; Second, it introduces the inverted residual attention mechanism iRMB and dual-channel convolution DualConv in the fourth C2f module of the YOLOv8n model, enhancing the backbone network's ability to capture key global information, reducing training parameters, thereby improving the understanding of complex scenes and improving the performance of the improved YOLOv8n model; Finally, it adds a small target detection head in the head network to improve the detection capability of small targets; thus, the improved YOLOv8n model has both the ability to perceive small target details and the ability to understand complex scenes. Test results show that the improved YOLOv8n model improves mAP@0.5, mAP@0.5-0.95, precision, and recall by 0.5%, 0.8%, 0.5%, and 1.0%, respectively.
[0009] Preferably, the depth-separable convolution DSConv is specifically implemented as follows: First, the convolution kernel is quantized through the KDS module to generate a quantized convolution kernel VQK; then, the output of the KDS module is expanded to match the dimension of the quantized convolution kernel VQK, and combined with the quantized convolution kernel VQK through the residual connection RES; and the above process approximates the original convolution operation by using convolution distribution shift CDS.
[0010] Preferably, the C2f_DiRMB module includes feature enhancement and dual-path feature extraction. For feature enhancement, an inverted feature expansion method (iRMB) is introduced, first expanding the feature dimension and then employing efficient convolution operations. At the feature extraction level, a parallel dual-branch structure with dual-channel convolution (DualConv) is used. One path uses conventional convolution to capture local features, while the other uses a large receptive field to extract global features. The two paths are combined at the output stage using an adaptive weighted fusion strategy. In terms of feature enhancement, the core mechanism of channel compression-expansion is retained, and an optimized dimensionality adjustment strategy enhances feature learning capabilities while maintaining computational efficiency. The cross-layer connection mechanism maintained during feature processing effectively ensures the integrity of information transmission. At the feature extraction level, the network can automatically adjust its focus on features at different scales, significantly improving its adaptability to changes in target size, especially in scenarios requiring a balance between efficiency and performance.
[0011] As a preferred option, the addition of a small target detection head specifically includes:
[0012] Shallow feature adaptation and enhancement: The P2 layer features of the backbone network are upsampled three times to adapt their resolution to the detection requirements, and the high-frequency edge and texture information of small targets are extracted by combining a lightweight convolution module.
[0013] Multi-level feature complementarity: The local features of the shallow detection head are spliced and fused with the global semantic features of the mesoscale and deep detection heads;
[0014] Dynamic detection range optimization: An adaptive scale response mechanism is constructed through the collaborative work of four levels of detection heads. The shallow detection head focuses on 2×2 pixel-level micro-targets, the medium-scale detection head processes 4×4 to 8×8 pixel targets, and the deep detection head anchors large-scale targets. By constructing a four-level detection head system, shallow high-frequency features and deep semantic features are integrated, overcoming the contradiction between traditional single-level detection heads in small target perception and global context understanding. This enables the network to simultaneously possess the ability to perceive minute target details and understand complex scenes. Attached Figure Description
[0015] Figure 1 This is a network structure diagram of the existing YOLOv8n model.
[0016] Figure 2 This is the network structure diagram of the improved YOLOv8n model of the present invention.
[0017] Figure 3 This is a flowchart of the depthwise separable convolution DSConv.
[0018] Figure 4 This is a structural diagram of the inverted feature extension iRMB.
[0019] Figure 5 It is an experimental dataset downloaded from the open-source dataset website Kaggle.
[0020] Figure 6 It is a dataset of actual footage.
[0021] Figure 7 This is a diagram illustrating the data sample amplification method.
[0022] Figure 8 This is a performance data curve of the existing YOLOv8n model.
[0023] Figure 9 This is a performance data curve of the improved YOLOv8n model of the present invention.
[0024] Figure 10 This is a graph showing the test results of the existing YOLOv8n model.
[0025] Figure 11 This is a graph showing the test results of the improved YOLOv8n model of this invention. Detailed Implementation
[0026] First, those skilled in the art should understand that these embodiments are merely used to explain the technical principles of the embodiments of this application and are not intended to limit the scope of protection of the embodiments of this application. Those skilled in the art can make adjustments as needed to adapt to specific application scenarios.
[0027] The present invention will be further described in detail below with reference to specific embodiments.
[0028] This embodiment presents an underwater target identification method based on an improved YOLOv8 algorithm, which specifically includes the following steps:
[0029] The underwater image is input into the underwater target detection model to obtain the underwater target recognition result output by the underwater target detection model;
[0030] The underwater target detection model is as follows: Figure 2The improved YOLOv8n model (YOLOv8n-improved) features a backbone network where the P5 convolutional block and the last convolutional block of the neck network employ depthwise separable convolution (DSConv). Replacing conventional convolutions with DSConv reduces network complexity and improves inference speed. The fourth C2f module of the backbone network uses the C2f_DiRMB module, which introduces the inverted residual attention mechanism (iRMB) and dual-channel convolution (DualConv) to enhance the backbone network's ability to capture key global information, reduce training parameters, and thus improve understanding of complex scenes and overall performance. Furthermore, the head network of the improved YOLOv8n model includes a small target detection head to enhance its ability to detect small targets. The improved YOLOv8n model improved mAP@0.5, mAP@0.5-0.95, precision, and recall by 0.5%, 0.8%, 0.5%, and 1.0%, respectively.
[0031] In this embodiment, the depthwise separable convolution DSConv is as follows: Figure 3 Specifically, the convolution kernel is first processed by KDS (…). k, k The module performs quantization to generate the quantized convolutional kernel VQK. BLK , k, k ); then, KDS ( k, k The output of the module (Expand) is expanded to KDS ( BLK , k, k ) to match the quantized convolution kernel VQK ( BLK , k, k The dimension of ) and the residual connection RES ( BLK , k, k ) and the quantized convolution kernel VQK ( BLK , k, k The above process combines the above steps with a CDS (Convolution Distribution Shift) method to approximate the original convolution operation, ensuring that the output is identical to the original convolution result (Original(1, )). ch i , k, kSimilar to floating-point convolution, DSConv is a novel operator that optimizes convolution operations, aiming to improve the computational efficiency and memory utilization of convolutional neural networks. It reduces computational complexity by quantizing the weights of the convolution kernel and assigning a distribution offset to these quantized weights. In DSConv, the kernel weights are first quantized into integers, and then these integer weights are adjusted using a distribution offset, making the quantized convolution operation approximate the effect of the original floating-point convolution. This method not only reduces storage requirements because integers occupy less memory than floating-point numbers, but also speeds up convolution operations because integer operations are faster than floating-point operations.
[0032] Integrating DSConv technology significantly improves the inference efficiency of the improved YOLOv8n model, while maintaining its accuracy. By simplifying the network structure, DSConv not only increases computational speed but also reduces model complexity, enabling it to perform exceptionally well in resource-constrained mobile devices and edge computing environments, perfectly meeting the urgent needs for rapid response and high efficiency. The introduction of DSConv also significantly enhances the generalization ability of the improved YOLOv8n model. By reducing the number of parameters, DSConv effectively reduces the likelihood of overfitting during training, which is particularly important for training deep learning models with limited data. This enhanced generalization ability means that the improved YOLOv8n model exhibits better adaptability and stability when faced with new and unseen data, thus providing more reliable performance across a wide range of applications.
[0033] In this embodiment, the C2f_DiRMB module includes a feature enhancement structure and a dual-path feature extraction mechanism. Regarding feature enhancement, the inverted feature expansion (iRMB) method is introduced to first expand the feature dimension to improve the representation space, and then efficient convolution operations are used to reduce computational cost; for example... Figure 4As shown, iRMB is a hybrid network module that combines depthwise separable convolution (3x3 DSConv) and a self-attention mechanism (Attn Mat). 1x1 convolutions are used for channel compression and expansion to optimize computational efficiency, while the depthwise separable convolution (DSConv) captures spatial features, and the self-attention mechanism captures global dependencies between features. This design retains the core channel compression-expansion mechanism while enhancing feature learning capabilities through optimized dimensionality adjustment strategies, ensuring computational efficiency. The cross-layer connectivity maintained during feature processing effectively guarantees the integrity of information transmission. At the feature extraction level, a parallel dual-branch structure, DualConv, is used. One path uses regular convolution to capture local features (local detail features), while the other uses a large receptive field to extract global features (global contextual information). The two feature paths are combined in the output stage using an adaptive weighted fusion strategy. This design allows the network to automatically adjust its attention to features at different scales, significantly improving its adaptability to changes in target size.
[0034] In the field of deep learning, Bottleneck's design has a decisive impact on the efficiency of feature extraction and model performance. The C2f_DiRMB module represents an innovative improvement over the traditional C2f module in the YOLOv8 algorithm. While maintaining high computational efficiency, the C2f_DiRMB module significantly improves the depth and breadth of feature representation by introducing a more advanced convolution mechanism. The improved C2f_DiRMB module, through carefully designed convolution operations, not only optimizes the feature extraction process but also enhances the model's ability to capture subtle features in images. This enables the improved YOLOv8n model to more accurately identify and classify targets when handling complex visual tasks, thus achieving a comprehensive performance improvement while maintaining fast response. The iRMB module, inheriting the lightweight and efficient characteristics of CBAM, further promotes the flow of features and the preservation of information in the network by incorporating residual connections, ensuring that strong feature representation can still be maintained in deep network structures. Furthermore, the iRMB module excels in integrating channel attention and spatial attention, strengthening the interrelationships between features and building a more effective feature interaction mechanism. This gives the improved YOLOv8n model a superior ability to handle and understand complex contextual information. DualConv, an innovative convolutional neural network module, optimizes model performance by fusing convolutional operations at different scales. Its core design combines 3×3 and 1×1 convolutional kernels, processing them in parallel on the same input feature map channel. This preserves the local perception capability of spatial information while reducing computational complexity through pointwise convolution. DualConv introduces group convolution technology to dynamically allocate filters, significantly reducing the number of parameters while ensuring feature interaction, making it particularly suitable for resource-constrained mobile or embedded devices. By optimizing the structural design of the traditional Bottleneck module, feature representation capabilities are significantly improved while maintaining its parameter efficiency advantage. This improved Bottleneck module undoubtedly provides new ideas for the design of deep learning models, especially in scenarios requiring a balance between efficiency and performance.
[0035] To address the common challenges in underwater target recognition, such as small target size (<10cm), low imaging resolution, and interference from complex environments (bubbles, turbid water), this paper proposes a lightweight detection head extension architecture based on multi-scale feature fusion. The core idea is to overcome the contradiction between small target perception and global context understanding in traditional single-level detection heads by fusing shallow high-frequency features and deep semantic features. Specifically, underwater optical imaging systems are limited by hardware resolution and the absorption characteristics of water, resulting in low contrast and blurred edges for small targets in images. Traditional detection models rely on deep features (such as the P5 layer) for semantic modeling, but their spatial resolution is significantly reduced (e.g., the P5 layer feature map resolution is only 1 / 32 of the input image), making it difficult to capture detailed information about small targets. While using only shallow features (such as the P2 layer) can preserve high-frequency textures, it is susceptible to noise interference and lacks target category discrimination capabilities. This improved YOLOv8n model constructs a four-level detection head system, adding a small target detection head, specifically including the following innovative designs:
[0036] Shallow Feature Adaptation and Enhancement: The P2 layer features are upsampled three times to adapt their resolution to the detection requirements. A lightweight convolutional module is then used to extract high-frequency edge and texture information from small targets. This process preserves the local sensitivity of shallow features while reducing computational cost through separable convolution.
[0037] Multi-level feature complementarity mechanism: The local features of the shallow detection head (P2 layer) are spliced and fused with the global features of the medium-scale detection head (P3 layer) and the deep detection head (P4-P5 layers), so that the network can simultaneously have the ability to perceive the details of small targets and understand complex scenes.
[0038] Dynamic detection range optimization: An adaptive scale response mechanism is constructed through the collaborative work of four levels of detection heads—the shallow detection head (P2 layer) focuses on 2×2 pixel-level micro-targets, the medium-scale detection head (P3 layer) processes 4×4 to 8×8 pixel targets, and the deep detection heads (P4-P5 layers) are responsible for anchoring large-scale targets (detecting targets ≥16×16 pixels). This hierarchical strategy effectively alleviates the problem of missed detection of small targets.
[0039] Verification Example
[0040] Setting up the experimental environment:
[0041] The GPU used is an NVIDIA GeForce RTX 3090 GPU with 24GB of video memory. The deep learning framework is PyTorch 2.3.1, the programming language is Python 3.9, and the CUDA version is 11.8. The design is to complete the training in the cloud.
[0042] Experimental data:
[0043] The experimental dataset used comes from the open-source dataset website Kaggle, and contains 4505 photos with different underwater backgrounds, lighting conditions, and fish species. The training set contains 3153 photos, the validation set contains 901 photos, and the test set contains 451 photos. Some dataset files are shown below. Figure 5 As shown in Table 1, the experimental hyperparameter settings were configured as follows.
[0044] Table 1 Hyperparameter Settings
[0045]
[0046] In addition to the experimental dataset, the performance of the improved YOLOv8n model was also tested on a real-world shooting dataset, such as... Figure 6 As shown.
[0047] The aforementioned experimental dataset is a widely accepted training dataset in the industry, and its image quantity, quality, and variety are sufficient to support this validation experiment. For other datasets or self-collected data, if the image quantity, quality, and variety are insufficient to meet the experimental requirements, data sample augmentation can be performed. Data sample augmentation can be achieved by applying a series of image processing techniques, including but not limited to rotation, flipping, scaling, cropping, color adjustment, adding noise, and blurring. Figure 7 As shown.
[0048] To accurately evaluate the performance of the improved YOLOv8n model, the experiment used precision, recall, mean average precision (mAP), GFLOPs, FPS, and number of parameters as evaluation metrics.
[0049] Precision (P) is the proportion of samples predicted as positive that were actually positive, while recall (R) is the proportion of samples that were actually positive that were correctly predicted as positive. The formulas for calculating both are as follows:
[0050] ;
[0051] ;
[0052] Wherein, TP refers to the number of samples correctly predicted as positive by the model, FP refers to the number of samples incorrectly predicted as positive by the model, and FN refers to the number of samples that are actually positive but were incorrectly predicted as negative by the model.
[0053] mAP is a metric for evaluating the performance of object detection models, and it is divided into two types: mAP@0.5 / % and mAP@0.5-0.95 / %. mAP@0.5 / % is the average percentage of accuracy when the IoU (Intersection over Union) threshold is 0.50. In other words, a prediction is considered correct only when the IoU between the predicted bounding box and the ground truth bounding box is greater than or equal to 0.50. mAP@0.5-0.95 / % calculates the average percentage of accuracy (AP) for each IoU threshold within the range of 0.50 to 0.95, with a step size of 0.05. The average of these APs is then taken, where C is the total number of steps from 0.50 to 0.95. The specific calculation formula is as follows:
[0054] ;
[0055] ;
[0056] GFLOPs is a metric for measuring the computational cost of a model, representing the billions of floating-point operations performed per second. This metric affects the model's training and inference speed, as well as its hardware resource requirements. High GFLOPs models require more powerful computing resources, such as GPUs or TPUs, while low GFLOPs models are more suitable for resource-constrained devices, such as mobile or embedded systems. GFLOPs is an important consideration when selecting a model and deployment environment.
[0057] The number of parameters (Params) is the total number of parameters used in the model during training. It is an important indicator of the model's spatial complexity and scale. A larger number of parameters indicates a more complex model, requiring more storage capacity to store these parameters.
[0058] This validation example compares the performance of YOLOv8n and YOLOv8n-improved, evaluating their performance on bounding boxes, confidence scores, and class losses (box_loss, cls_loss, and dfl_loss), and presents the results. Figure 8 and Figure 9 Furthermore, this invention also analyzes the convergence of four key metrics: precision, recall, mAP@0.5 / % (also denoted as mAP50), and mAP@0.5-0.95 / % (also denoted as mAP50-95). Experimental results show that the three optimization strategies proposed by YOLOv8n-improved improve performance in detecting complex fish swarms.
[0059] Analyzing the loss curves of YOLOv8n and YOLOv8n-improved during training and validation reveals that both maintain low loss values, but YOLOv8n-improved shows slightly lower loss for classification and confidence. In performance metrics comparison, YOLOv8n-improved outperforms YOLOv8n in precision, recall, and mAP@0.5-0.95%, with a smoother convergence curve. Overall, YOLOv8n-improved continues to perform well on the robot photography dataset.
[0060] To demonstrate the superiority of the various improved modules proposed in this invention, an ablation experiment was designed. The results are shown in Table 2 below.
[0061] Table 2 Ablation Experiment
[0062]
[0063] Experimental results show that by improving the feature network and replacing the fourth C2f module with the C2f-DiRMB module, the model's recall, mAP@0.5 / %, and mAP@0.5-0.95 / % improved by 0.2%, 0.1%, and 0.3%, respectively, but the accuracy decreased slightly. In the convolutional module, replacing the traditional convolution with DSConv improved mAP@0.5 / % by 0.4%, and also improved accuracy, recall, and FPS. Overall, compared with the basic YOLOv8n model, the newly proposed YOLOv8n-improved model improves mAP@0.5 / % and mAP@0.5-0.95 / % by 0.5% and 0.8%, respectively, while improving accuracy and recall by 0.5% and 1.0%, respectively, with a decrease in the number of parameters, resulting in a significant performance improvement.
[0064] The performance of the algorithm before and after the improvement was also verified on a real-world shooting dataset, as shown in Table 3 below.
[0065] Table 3 Performance Comparison
[0066]
[0067] As shown in Table 3, YOLOv8n-improved achieves improvements of 2.3% in accuracy, 0.2% in recall, 0.2% in mAP@0.5 / %, and 0.9% in mAP@0.5-0.95 / %, compared to the traditional YOLOv8n.
[0068] Therefore, it is evident that YOLOv8n-improved, through these improvements, demonstrates greater accuracy and robustness in object detection tasks, enabling it to provide more reliable detection results in practical applications. These enhancements are of great significance for improving the overall performance and reliability of object detection systems.
[0069] Using a subset of test set images, complex fish swarm recognition tests were conducted on the YOLOv8n model and the improved YOLOv8 model. The test results are as follows: Figure 10 and Figure 11 As shown.
[0070] The test results show that the existing YOLOv8 algorithm does indeed face challenges in detecting objects under conditions of overlap and turbid water, resulting in missed detections. In underwater environments, the natural movement of fish can cause them to overlap spatially, making it difficult for the algorithm to distinguish individuals and thus affecting detection accuracy. Furthermore, turbidity caused by suspended particles, plankton, or other impurities in the water reduces image clarity and increases background noise, making it even more difficult to extract fish features. These factors can all lead to missed detections in traditional algorithms, meaning they cannot identify all actually present objects.
[0071] In summary, the improved YOLOv8 algorithm of this invention performs well in detection, successfully identifying overlapping targets, and achieving good detection results in turbid water environments.
[0072] In other words, this invention proposes an underwater target recognition method based on an improved YOLOv8 algorithm. This method adapts to complex underwater environments such as low light levels and turbidity by modifying the YOLOv8 algorithm. It reduces network complexity and improves inference speed by introducing depthwise separable convolution (DSConv), enhances the network's ability to capture global information by introducing an inverted residual attention mechanism (iRMB), and reduces training parameters by employing a parallel dual-branch structure dual-channel convolution (DualConv), thereby improving the understanding of complex scenes and enhancing model performance. Furthermore, it adds a small target detection head to improve the detection capability for small targets. Experimental results show that the improved YOLOv8n model achieves improvements in mAP, precision, and recall. These improvements not only enhance the improved YOLOv8n model's understanding of complex underwater scenes but also improve its performance and robustness in underwater target detection tasks. In summary, the improved algorithm of this invention can effectively improve the accuracy and efficiency of underwater target detection, and has significant practical application value for underwater environment exploration and monitoring.
[0073] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An underwater target identification method based on an improved YOLOv8 algorithm, specifically including the following steps: The underwater image is input into the underwater target detection model to obtain the underwater target recognition result output by the underwater target detection model; Its features are, The underwater target detection model is an improved YOLOv8n model, which consists of a backbone network, a neck network, and a head network. The P5 convolutional block of the backbone network and the last convolutional block of the neck network use depthwise separable convolution DSConv. The fourth C2f module of the backbone network adopts the C2f_DiRMB module, which introduces the inverted residual attention mechanism iRMB and dual-channel convolution DualConv. The head network adds a small target detection head to improve the detection capability of small targets. The C2f_DiRMB module includes feature enhancement and dual-path feature extraction. In terms of feature enhancement, the inverted feature expansion iRMB method is introduced, which first expands the feature dimension and then uses efficient convolution operation. In terms of feature extraction, a parallel dual-branch structure dual-channel convolution DualConv is adopted. DualConv combines a 3×3 convolution kernel and a 1×1 convolution kernel and processes them in parallel on the same input feature map channel. One path uses conventional convolution to capture local features, and the other path uses a large receptive field operation to extract global features. The two features are combined in the output stage through an adaptive weighted fusion strategy. The addition of a small target detection head specifically includes: Shallow feature adaptation and enhancement: The P2 layer features of the backbone network are upsampled three times to adapt their resolution to the detection requirements. Combined with the depth-separable convolution DSConv of the last layer of the neck network, high-frequency edge and texture information of small targets are extracted. Multi-level feature complementarity: The local features of the shallow detection head are spliced and fused with the global features of the mesoscale and deep detection heads; Dynamic detection range optimization: Through the collaborative work of four levels of detection heads, an adaptive scale response mechanism is constructed. The shallow detection head focuses on 2×2 pixel-level micro targets, the medium-scale detection head processes 4×4 to 8×8 pixel targets, and the deep detection head anchors large-scale targets. Specifically, the depth-separable convolution DSConv is as follows: First, the convolution kernel is quantized through the KDS module to generate a quantized convolution kernel VQK; then, the output of the KDS module is expanded to match the dimension of the quantized convolution kernel VQK, and combined with the quantized convolution kernel VQK through the residual connection RES; and the above process approximates the original convolution operation by using convolution distribution shift CDS.
Citation Information
Cited By
Improved yolo11n underwater target recognition detection method based on local and global perception
CN121353874B