Marine ranching benthic organism detection method based on improved YOLO11n
By improving the backbone network, neck network, and detection head of the YOLO11n model, the problems of feature extraction and occlusion in the detection of benthic organisms in marine ranches were solved, thereby improving detection accuracy and efficiency.
Patent Information
- Application Number
- CN202510387526.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2045-03-31
AI Technical Summary
Existing single-stage target detection algorithms struggle to effectively extract feature information and distinguish occluded targets in the detection of benthic organisms in marine ranches, resulting in poor detection accuracy.
The backbone network, neck network, and detection head of the YOLO11n model are improved by introducing the MSEE module, SBA module, and Multi-SEAM module to enhance feature extraction and occlusion perception capabilities.
It improves the accuracy and efficiency of benthic organism detection in marine ranches, especially the ability to detect small targets and obstructed conditions, thereby increasing accuracy and recall.
Smart Images

Figure CN120318571B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence, and specifically to an improved YOLO11n method for detecting benthic organisms in marine ranches. Background Technology
[0002] Marine benthic organisms are widely distributed, diverse, and extremely abundant, forming an indispensable part of the marine ecosystem. These organisms, such as starfish, sea urchins, sea cucumbers, and scallops, not only play a vital role in maintaining marine ecological balance but also attract fishing and aquaculture due to their significant economic value. Previously, the cultivation of various benthic organisms relied heavily on manual labor, primarily including underwater diving and monitoring. These tasks were not only labor-intensive but also carried high safety risks. In recent years, the development of technologies such as underwater robots has enabled automated harvesting of underwater benthic organisms. Underwater target detection is a crucial component of automated underwater benthic harvesting and a key technology for achieving automated underwater robotic harvesting.
[0003] Traditional underwater target detection algorithms typically refer to methods based on feature extraction and classifiers. These methods first preprocess the target image, performing noise reduction, enhancement, and segmentation, then extracting the target's features from its shape, color, and texture, and finally identifying the target through a classifier. With the rise and development of artificial intelligence, the introduction of deep learning-based target detection and classification methods has made it possible to accurately and quickly detect targets in complex environments.
[0004] Among deep learning-based object detection algorithms, single-stage object detection algorithms have become a hot research and application area due to their efficiency and real-time performance. These algorithms predict the category and location of objects directly on the input image in an end-to-end manner, eliminating the step of generating candidate regions in traditional two-stage methods. Typical examples include the YOLO (You Only LookOnce) series and SSD (Single Shot MultiBox Detector). The core idea of YOLO is to divide the image into grid cells, with each cell directly predicting multiple bounding boxes and their corresponding class probabilities, completing global inference in a single forward propagation. This design significantly improves detection speed. SSD, on the other hand, enhances the ability to capture small objects by fusing and predicting multi-scale feature maps, utilizing features from different levels to balance speed and accuracy.
[0005] However, single-stage algorithms still face challenges in benthic organism detection tasks in marine ranches. First, benthic organisms are typically small in size and densely distributed, occupying only a few pixels in an image, making it difficult for the model to extract effective feature information. Second, benthic organisms often become occluded due to population aggregation or environmental disturbances, resulting in blurred target boundaries and making it difficult for the model to distinguish individual individuals, leading to poor detection results for benthic organisms in marine ranches. Summary of the Invention
[0006] To address the problems existing in the prior art, this invention provides a method for detecting benthic organisms in marine ranches based on an improved YOLO11n. By improving the YOLO11n target detection model, utilizing the improved neck network structure, the feature extraction structure of the backbone network, and the detection head with a multi-branch occlusion perception attention module, the method solves the problems of low detection accuracy caused by small target benthic organisms in marine ranches and mutual occlusion among benthic organisms in marine ranches.
[0007] The technical solution provided by this invention includes the following steps:
[0008] Step 1: Acquire images of benthic organisms in the marine ranch to form the first dataset;
[0009] Step 2: Add annotation information to the images in the first dataset to form the second dataset, and divide the second dataset into training set, validation set and test set;
[0010] Step 3: Construct a marine ranch benthic organism detection model based on the improved YOLO11n, the model including a backbone network, a neck network, and a head network;
[0011] Step 4: Train the marine ranching benthic organism model based on the improved YOLO11n using the training set and validation set;
[0012] Step 5: Test the optimal model obtained from training using the marine ranch benthic organism test set, and obtain the final marine ranch benthic organism detection model;
[0013] Furthermore, in step 1, the images of marine ranch benthic organisms in the first dataset can be captured by an underwater camera, by an autonomous underwater vehicle, or collected from the network.
[0014] Preferably, in step 2, the LabelImg annotation tool can be used to add annotation information to road surface defects; the training set, validation set, and test set can be divided in a ratio of 7:2:1.
[0015] Furthermore, step 3 specifically includes steps 3.1 to 3.3:
[0016] Step 3.1: In the backbone network, replace the Bottleneck module inside C3k2 with the newly designed MSEE (MutilScale Edge Enhance) module to form a new feature extraction module C3k2-MSEE, and replace the original SPPF module in the YOLO11n model backbone network with the parameter-sharing convolution module FPSConv to form a new backbone structure.
[0017] Furthermore, the C3k2-MSEE module has two cases: C3k = False and C3k = True. Of the four C3k2-MSEE modules mentioned above, the first two are for the C3k = False case, and the last two are for the C3k = True case. The C3k2-MSEE module for the C3k = False case is composed of one 1×1 Conv module, one Split module, two MSEE modules, one Concat module, and one 1×1 Conv module connected in sequence. The C3k2-MSEE module for the C3k = True case is composed of one 1×1 Conv module, one Split module, two C3k-MSEE N=2 modules, one Concat module, and one 1×1 Conv module connected in sequence.
[0018] Furthermore, the MSEE module divides the input into five branches. The first four branches first pass through an adaptive average pooling (AdaptiveAvgPool) with pooling windows of different sizes, followed by two convolutional modules: a 1×1 convolutional module for channel compression and a 3×3 convolutional module for local feature extraction. Then, they pass through an upsampling module and an edge enhancement module. Through these four parallel branches at different scales, the model can obtain different information from different scales, improving the model's feature extraction capability. The fifth branch has only one 3×3 convolutional module to preserve the spatial information of the image. The edge enhancement module consists of an average pooling layer (AvgPool), an edge calculation module, a convolutional module, and a fusion module. The 3×3 average pooling can preserve low-frequency information at a larger scale, while the edge calculation module obtains the edge information of the image by comparing the difference before and after average pooling. These operations enable the model to extract more detailed features.
[0019] Furthermore, the FPSConv module is composed of one 1×1 Conv module, three 3×3 Conv modules, one Concat module, and one 1×1 Conv module connected sequentially, wherein the outputs of the first 1×1 Conv module, the first 3×3 Conv module, and the second 3×3 Conv module are connected across to the Concat module.
[0020] The first 1×1 Conv module in the FPSConv module adjusts the number of channels in the module. The next three 3×3 Conv modules are parameter-shared convolutional modules with different dilation rates, used to extract features at different scales. This module captures local details with a low dilation rate and captures global context with a high dilation rate. Using convolutional modules with shared parameters can greatly reduce the number of parameters and improve model efficiency.
[0021] Step 3.2: In the neck network, firstly, a new P2 small target detection layer is added on the basis of the original three detection layers to improve the model's ability to detect small targets; secondly, the SBA (Specific Block Attention) attention module is introduced to replace the Concat module for feature fusion, forming a new neck network.
[0022] Furthermore, the SBA module is used to fuse boundary information from low-level features and semantic information from high-level features to obtain finer-grained object contours and recalibrate object positions. The fusion method within the SBA module uses a Re-calibration attention unit (RAU) module. This module adaptively extracts the mutual representation of the two inputs (T1, T2) before fusion, transmitting shallow and deep information to the two RAU modules in different ways to compensate for missing spatial boundary information in deep features and missing semantic information in shallow features. Finally, the outputs of the two RAU modules are concatenated and input into a 1×1 Conv module. This improved aggregation strategy achieves robust combination of different features and refines coarse features. The processing procedure of the RAU module in the model is as follows:
[0023] T′1=W θ (T1) (1)
[0024]
[0025] Where T1 and T2 are the input features, and the two linear mappings and the Sigmoid function W are combined. θ , Applied to the input features, it reduces the channel dimension to 32, resulting in feature maps T'1 and T'2. ⊙ stands for point-wise multiplication. It is a reverse operation achieved by subtracting feature T'1, which optimizes the imprecise and coarse estimate into an accurate and complete prediction map. A convolution operation with a kernel size of 1×1 is used as a linear mapping process. Therefore, the SBA process is as shown in formula (4):
[0026] Y = C 3×3 (Concat(RAU(X a ,X b ),RAU(X b ,X a (4)
[0027] Among them, C 3×3 (·) is a convolution with a kernel size of 3×3 and batch normalization and ReLU activation layers. It contains deep features of the image. It contains rich shallow features of the image. Concat(·) is a concatenation operation performed along the channel dimension. This is the output of the SBA module;
[0028] Step 3.3: In the head network, add the Multi-SEAM (Multi-Branch Separated and EnhancementAttention Module) to the detection head of the original YOLO11n model to form a new detection head;
[0029] Furthermore, the head network consists of four Multi-SEAMHead detection heads. The input of each detection head corresponds to the four outputs of the aforementioned neck network. Each detection head consists of four Conv modules, two DWConv modules, two Multi-SEAM modules, two Conv2d modules, one CIoU module, and one CLSLoss module. Each detection head is divided into two branches. The first branch passes through two 3×3 Conv modules, one Multi-SEAM module, one 1×1 Conv2d module, and one CIoU module. The second branch passes through one 3×3 DWConv module, one 1×1 Conv module, one Multi-SEAM module, one 3×3 DWConv module, one 1×1 Conv module, one 1×1 Conv2d module, and one CLSLoss module in sequence.
[0030] Furthermore, the core of the Multi-SEAM module consists of multiple components. First, the input features are fed into the Channel and Spatial Mixture Module (CSMM). The CSMM module extracts deeper features through Depthwise Convolution and Pointwise Convolution, while introducing the GELU activation function and Batch Normalization to enhance learning ability and accelerate convergence. Depthwise Convolution, through channel-wise separable operations, can significantly reduce the number of parameters while effectively distinguishing the importance of each channel. However, this operation ignores the information correlation between channels. To compensate for this deficiency, after convolution in each channel, the module combines the outputs of convolutions at different depths through a pointwise convolutional layer to restore the correlation between channels. Second, a two-layer fully connected network further fuses the information of all channels, thereby strengthening the connection between channels and making the feature representation more complete and accurate. Finally, the Multi-SEAM module performs exponential normalization on the output of the fully connected layer, expanding the range of output values from [0,1] to [1,e]. This exponential normalization process provides the model with stronger robustness, making it more stable in the face of positional errors, thereby further improving the model's detection accuracy.
[0031] Furthermore, step 4 specifically includes steps 4.1 to 4.4:
[0032] Step 4.1: Set the training parameters for the marine ranch benthic organism detection model based on the improved YOLO11n. The specific training parameters include: learning rate, momentum, weight decay, optimizer, number of iterations, batch size, and label smoothing coefficient.
[0033] Step 4.2: Input the training set and validation set images and their corresponding labels into the improved YOLO11n marine ranch benthic organism detection model, use the backpropagation algorithm to calculate the gradient of the loss function with respect to the model parameters, and adjust the model parameters by minimizing the loss function to gradually approach the optimal solution;
[0034] Step 4.3: Use the optimizer to update the model parameters in the direction of gradient descent until the loss function of the training and validation sets no longer decreases, and the evaluation metrics such as accuracy P, recall R, and mAP no longer improve.
[0035] Step 4.4: Save the trained model parameters as the optimal model;
[0036] Furthermore, step 5 specifically includes steps 5.1 to 5.3:
[0037] Step 5.1: Input the test set into the improved optimal model described in Step 5;
[0038] Step 5.2: Calculate model performance metrics: Specific performance metrics include accuracy (P), recall (R), mAP@0.5, mAP@0.5:0.95, and model size. The specific calculation formulas are as follows:
[0039]
[0040] Where P is precision, R is recall, mAP is the mean precision across all categories, AP is the mean precision, m is the total number of categories of benthic organisms in the marine ranch, TP represents the number of positive samples correctly identified as positive samples, FP represents the number of negative samples incorrectly identified as positive samples, and FN represents the number of positive samples incorrectly identified as negative samples.
[0041] mAP@0.5 represents the average precision when the IoU threshold is fixed at 0.5. mAP@0.5:0.95 means that the average precision is calculated every 0.05 when the IoU threshold is between 0.5 and 0.95, and then the average of these average precisions is taken.
[0042] Step 5.3: When the performance indicators meet the accuracy requirements, the final marine ranch benthic organism detection model based on the improved YOLO11n is obtained.
[0043] Compared with the prior art, the beneficial effects of the present invention are:
[0044] (1) In the backbone network, a new feature extraction module C3k2-MSEE module is designed to replace the original C3k2 module, which enables the model to extract more edge feature information of marine ranch benthic organism images and effectively improves the detection accuracy of the marine ranch benthic organism detection model. Secondly, the FPSConv module is used to replace the SPPF module in the original model, which not only enables the model to extract more fine-grained features, but also significantly reduces training parameters, effectively reduces redundancy, and improves the detection efficiency of the marine ranch benthic organism detection model.
[0045] (2) In the neck network, a new neck network structure is designed. A P2 detection layer is added to the original neck network to increase the detection capability of small targets. In the new neck network structure, the SBA module is introduced to replace the Concat module for feature fusion, which improves the feature sensitivity and robustness of the marine ranch benthic organism detection model to key features of benthic organisms.
[0046] (3) In the head network, a new detection head, Multi-SEAMHead, is designed. The Multi-SEAM module is used in this detection head to improve the detection ability of the marine ranch benthic organism detection model for occluded organisms in benthic organisms, while also reducing the impact of complex marine background on benthic organism detection. Attached Figure Description
[0047] Figure 1 This is a flowchart of the marine ranch benthic organism detection method based on the improved YOLO11n of this invention;
[0048] Figure 2 This is a schematic diagram of the model structure of the marine ranch benthic organism detection method based on the improved YOLO11n of this invention;
[0049] Figure 3 This is a schematic diagram of the C3k2-MSEE module structure;
[0050] Figure 4 This is a schematic diagram of the FPSConv module structure;
[0051] Figure 5 This is a schematic diagram of the SBA module structure;
[0052] Figure 6 Diagram of the head network structure
[0053] Figure 7 This is a schematic diagram of the Multi-SEAM module structure; Detailed Implementation
[0054] To make the technical solution, structural features, achieved objectives, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to specific embodiments and accompanying drawings. It should be noted that the specific embodiments described herein are only for clearer explanation of the present invention and are not intended to limit the present invention.
[0055] Figure 1 This invention discloses a flowchart of a method for detecting benthic organisms in marine ranches based on the improved YOLO11n. The implementation process is as follows:
[0056] Step 1: Acquire images of benthic organisms in marine ranches to form the first dataset; the images of marine ranches in the first dataset can be captured by underwater cameras, by autonomous underwater vehicles, or collected from the network;
[0057] In this embodiment, in order to better evaluate the detection effect of the marine ranch benthic organism detection method based on the improved YOLO11n disclosed in this invention, the publicly available dataset DUO (Detecting Underwater Objects) underwater organism dataset was used.
[0058] Step 2: Add annotation information to the images in the first dataset using the Labelme annotation tool.
[0059] In this example, the publicly available dataset DUO already contains labeled information, so this step is omitted. The JSON-formatted label files in the first dataset described in this embodiment are converted into TXT-formatted label files required by YOLO11n to form the second dataset. The DUO dataset contains 7782 precisely labeled images, of which 6671 are used for training and 1111 are used for testing. The 1111 images used for testing are also used as the validation set.
[0060] Step 3: Construct a marine ranching benthic organism detection model based on the improved YOLO11n. The model includes a backbone network, a neck network, and a head network. The structure of the improved YOLO11n model is as follows: Figure 2 As shown, the construction of the model further includes steps 3.1 to 3.3:
[0061] Step 3.1: In the backbone network, replace the Bottleneck module inside C3k2 with the newly designed MSEE module to form a new feature extraction module C3k2-MSEE, and replace the original SPPF module in the YOLO11n model backbone network with the parameter-sharing convolution module FPSConv to form a new backbone structure.
[0062] Furthermore, the structural diagram of the C3k2-MSEE module is as follows: Figure 3 As shown, the C3k2-MSEE module has two cases: C3k = False and C3k = True. Of the four C3k2-MSEE modules mentioned above, the first two are for the C3k = False case, and the last two are for the C3k = True case. The C3k2-MSEE module for the C3k = False case is composed of one 1×1 Conv module, one Split module, two MSEE modules, one Concat module, and one 1×1 Conv module connected in sequence. The C3k2-MSEE module for the C3k = True case is composed of one 1×1 Conv module, one Split module, two C3k-MSEE N=2 modules, one Concat module, and one 1×1 Conv module connected in sequence.
[0063] Furthermore, the structural diagram of the MSEE module is as follows: Figure 3 As shown, the input is divided into five branches. The first four branches first pass through an adaptive average pooling (AvgPool) with pooling windows of different sizes, followed by two convolutional modules: the first is a 1×1 convolutional module for channel compression, and the second is a 3×3 convolutional module for local feature extraction. Then, they pass through an upsampling module and an edge enhancement module. Through these four parallel branches at different scales, the model can obtain different information from different scales, improving the model's feature extraction capability. The fifth branch has only one 3×3 convolutional module to preserve the spatial information of the image. The edge enhancement module consists of one average pooling layer (AvgPool), one edge calculation module, one convolutional module, and one fusion module. The 3×3 average pooling can preserve low-frequency information at a larger scale, while the edge calculation module obtains the edge information of the image by comparing the difference before and after average pooling. The above operations enable the model to extract more detailed features.
[0064] Furthermore, the structure of the FPSConv module is as follows: Figure 4 As shown, the FPSConv module is composed of one 1×1 Conv module, three 3×3 Conv modules, one Concat module, and one 1×1 Conv module connected in sequence. The outputs of the first 1×1 Conv module, the first 3×3 Conv module, and the second 3×3 Conv module are connected across the Concat module.
[0065] The first 1×1 Conv module in the FPSConv module adjusts the number of channels in the module. The next three 3×3 Conv modules are parameter-shared convolutional modules with different dilation rates, used to extract features at different scales. This module captures local details with a low dilation rate and captures global context with a high dilation rate. Using convolutional modules with shared parameters can greatly reduce the number of parameters and improve model efficiency.
[0066] Step 3.2: In the neck network, firstly, a new P2 small target detection layer is added on the basis of the original three detection layers to improve the model's ability to detect small targets; secondly, the SBA (Specific Block Attention) attention module is introduced to replace the Concat module for feature fusion, forming a new neck network.
[0067] Furthermore, the structure of the SBA module is as follows: Figure 5As shown, the SBA module is used to fuse boundary information from low-level features and semantic information from high-level features to obtain finer-grained object contours and recalibrate object positions. The fusion method within the SBA module uses a recalibration attention unit (RAU) module, which adaptively extracts the mutual representation of the two inputs (T1, T2) before fusion, such as... Figure 5 As shown, shallow and deep information are transmitted to two RUA modules in different ways to compensate for the lack of spatial boundary information in high-level semantic features and the lack of new semantic information in low-level features. Finally, the outputs of the two RUA modules are concatenated and input into a 1×1 Conv module. The improved aggregation strategy achieves robust combination of different features and refines the coarse features. Figure 5 The processing procedure of the RUA module is as follows:
[0068] T′1=W θ (T1) (1)
[0069]
[0070] Where T1 and T2 are the input features, and the two linear mappings and the Sigmoid function W are combined. θ , Applied to the input features, it reduces the channel dimension to 32, resulting in feature maps T'1 and T'2. ⊙ stands for point-wise multiplication. It is a reverse operation achieved by subtracting feature T'1, which optimizes the imprecise and coarse estimate into an accurate and complete prediction map. A convolution operation with a kernel size of 1×1 is used as a linear mapping process. Therefore, the SBA process is as shown in formula (4):
[0071] Y = C 3×3 (Concat(RAU(X a ,X b ),RAU(X b ,X a (4)
[0072] Among them, C 3×3 (·) is a convolution with a kernel size of 3×3 and batch normalization and ReLU activation layers. It contains deep features of the image. It contains rich shallow features of the image. Concat(·) is a concatenation operation performed along the channel dimension. This is the output of the SBA module;
[0073] Step 3.3: In the head network, add the Multi-SEAM (Multi-Branch Separated and EnhancementAttention Module) to the detection head of the original YOLO11n model to form a new head network;
[0074] Furthermore, new head networks such as Figure 6 As shown, it consists of 4 Multi-SEAMHead detection heads. The input of each detection head corresponds to the 4 outputs of the neck network mentioned above. Each detection head consists of 4 Conv modules, 2 DWConv modules, 2 Multi-SEAM modules, 2 Conv2d modules, 1 CIoU module, and 1 CLSLoss module. Each detection head is divided into two branches. The first branch passes through 2 3×3 Conv modules, 1 Multi-SEAM module, 1 1×1 Conv2d module, and 1 CIoU module respectively. The second branch passes through 1 3×3 DWConv module, 1 1×1 Conv module, 1 Multi-SEAM module, 1 3×3 DWConv module, 1 1×1 Conv module, 1 1×1 Conv2d module, and 1 CLSLoss module in sequence.
[0075] Furthermore, the structure of the Multi-SEAM module is as follows: Figure 7 As shown, the core of the Multi-SEAM module consists of multiple components. First, the input features are fed into the Channel and Spatial Mixture Module (CSMM). The CSMM module extracts deeper features through Depthwise Convolution and Pointwise Convolution, while introducing the GELU activation function and Batch Normalization to enhance learning ability and accelerate convergence. Depthwise Convolution, through channel-wise separable operations, can significantly reduce the number of parameters while effectively distinguishing the importance of each channel. However, this operation ignores the information correlation between channels. To compensate for this deficiency, after convolution in each channel, the module combines the outputs of convolutions at different depths through a pointwise convolutional layer to restore the correlation between channels. Second, a two-layer fully connected network further fuses the information of all channels, thereby strengthening the connection between channels and making the feature representation more complete and accurate. Finally, the Multi-SEAM module performs exponential normalization on the output of the fully connected layer, expanding the range of output values from [0,1] to [1,e]. This exponential normalization process provides the model with stronger robustness, making it more stable in the face of positional errors, thereby further improving the model's detection accuracy.
[0076] Step 4: Input the training set and validation set into the marine ranching benthic organism detection model based on the improved YOLO11n described in Step 3 for training, specifically including steps 4.1 to 4.4:
[0077] Step 4.1: Set the training parameters of the marine ranch benthic organism detection model based on the improved YOLO11n. The model training parameters include: learning rate, momentum, weight decay, optimizer, number of iterations, batch size, and label smoothing coefficient.
[0078] In this embodiment, the optimizer is SGD, the initial learning rate 1r0 is 0.01, the momentum is 0.937, the weight decay is 0.0005, the batch size is 16, the number of iterations is 300, and the label smoothing coefficient is 0.1.
[0079] Step 4.2: Input the training and validation set images and their corresponding labels into the improved YOLOv11n marine ranching benthic organism detection model, and use the backpropagation algorithm to calculate the gradient of the loss function with respect to the model parameters. Backpropagation is an efficient method for calculating gradients; it uses the chain rule to calculate the gradient of each parameter with respect to the loss function. Specifically, backpropagation calculates the gradient of each parameter layer by layer by propagating the loss function backward from the output layer. In this process, the gradient of each parameter represents the rate of change of the loss function with respect to that parameter, i.e., how the loss function changes as that parameter changes. By minimizing the loss function, the model parameters are adjusted to gradually approach the optimal solution.
[0080] Step 4.3: After calculating the gradients of the model parameters, the optimizer is used to update these parameters. The optimizer updates the parameters in the opposite direction of the gradient information. Parameters with larger gradients are updated at larger steps, while parameters with smaller gradients are updated at smaller steps. By iteratively updating the model parameters, the value of the loss function can be gradually reduced. By minimizing the loss function, the values of the model parameters are adjusted to gradually approach the optimal solution, i.e., the parameter values at which the loss function reaches its minimum. This minimizes the difference between the model's predictions and the true values, while evaluation metrics such as mAP, recall (R), and accuracy (P) no longer improve.
[0081] Step 4.4: Save the trained model parameters as the optimal model;
[0082] Step 5: Test the optimal model described in Step 4 using the test set, evaluate the test results, and if the accuracy requirements are met, obtain the final marine ranch benthic organism detection model based on the improved YOLO11n. Specifically, Step 5 further includes Steps 5.1 to 5.3:
[0083] Step 5.1: Input the test set into the optimal model described in Step 4;
[0084] Step 5.2: Calculate model performance metrics: Specific performance metrics include accuracy (P), recall (R), mAP@0.5, mAP@0.5:0.95, and model size. The specific calculation formulas are as follows:
[0085]
[0086] Where P is precision, R is recall, mAP is the mean precision across all categories, AP is the mean precision, m is the total number of categories of benthic organisms in the marine ranch, TP represents the number of positive samples correctly identified as positive samples, FP represents the number of negative samples incorrectly identified as positive samples, and FN represents the number of positive samples incorrectly identified as negative samples.
[0087] mAP@0.5 represents the average precision when the IoU threshold is fixed at 0.5. mAP@0.5:0.95 means that the average precision is calculated every 0.05 when the IoU threshold is between 0.5 and 0.95, and then the average of these average precisions is taken.
[0088] Step 5.3: When the performance indicators meet the accuracy requirements, the final marine ranch benthic organism detection model based on the improved YOLO11n is obtained.
[0089] In this embodiment, to verify the performance of the improved model disclosed in this invention, the YOLOv8n model, YOLOv10n model, YOLO11n model, YOLO11s model, and the detection model disclosed in this patent were tested on the DUO dataset. Ours in the table represents the model disclosed in this invention. Evaluation index data are shown in Table 1.
[0090] Table 1 Comparison of experimental results
[0091]
[0092] As shown in Table 1, the marine ranch benthic organism detection model disclosed in this invention improves accuracy (P) by 1.7%, recall (R) by 2.4%, mAP@0.5 by 2.3%, and mAP@0.5:0.95 by 3.7% compared to the original YOLO11s model. Furthermore, while maintaining similar performance across all metrics to the YOLO11s model, the model size is 9.7 MB smaller than that of the YOLO11s model, facilitating its deployment on underwater edge devices.
[0093] The above description is merely one embodiment of the present invention and does not limit the patent scope of the present invention. For those skilled in the art, the present invention can have various modifications and variations. 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 detecting benthic organisms in marine ranches based on an improved YOLO11n, characterized in that, Specifically, the following steps are included: Step 1: Acquire images of benthic organisms in marine ranches to form the first dataset; the images of benthic organisms in the first dataset can be captured by underwater cameras, by autonomous underwater vehicles, or collected from the network; Step 2: Add annotation information to the images in the first dataset to form the second dataset, and divide the second dataset into training set, validation set and test set; Step 3: Construct a marine ranching benthic organism detection model based on the improved YOLO11n. The model includes a backbone network, a neck network, and a head network. The construction of the model further includes steps 3.1 to 3.3: Step 3.1: The backbone network consists of two 3×3 Conv modules, a C3k2-MSEE module, a 3×3 Conv module, a C3k2-MSEE module, a 3×3 Conv module, a C3k2-MSEE module, a 3×3 Conv module, a C3k2-MSEE module, an FPSConv module, and a C2PSA module connected in sequence, thus forming a new backbone network structure; The C3k2-MSEE module has two cases: C3k = False and C3k = True. Of the four C3k2-MSEE modules, the first two are for the C3k = False case, and the last two are for the C3k = True case. The C3k2-MSEE module for the C3k = False case is composed of one 1×1 Conv module, one Split module, two MSEE modules, one Concat module, and one 1×1 Conv module connected sequentially. The C3k2-MSEE module for the C3k = True case is composed of one 1×1 Conv module, one Split module, two C3k-MSEE modules (N=2), one Concat module, and one 1×1 Conv module connected sequentially. The C3k-MSEE N=2 module consists of 3 Conv modules, 2 MSEE modules, and 1 Concat module. The input passes through a 1×1 Conv module, and the output is split into two branches. The first branch passes through 2 MSEE modules and 1 Concat module. The second branch inputs the output of the 1×1 Conv module into a 3×3 Conv module, then into the Concat module of the first branch, and finally inputs the output of the Concat module into a 1×1 Conv module. The MSEE module consists of 5 branches. The first 4 branches each pass through an AdaptiveAvgPool module, a 1×1 Conv module, a 3×3 Conv module, an upsample module, and an Edge Enhance module in sequence. The 5th branch has only one 3×3 Conv module. Finally, the outputs of the 5 branches are input to a Concat module and then pass through a 1×1 Conv module. The Edge Enhance module consists of an AvgPool module, an Edge Computing module, a 1×1 Conv module, and a FusionAddition module. The output of the upsample module in the MSEE module is connected across the Edge Computing module and the FusionAddition module respectively. The backbone network outputs feature information at four different scales through the first three C3k2-MSEE modules and the C2PSA module, respectively. Step 3.2: The neck network consists of 4 Conv modules, 6 SBA modules, and 6 C3k2 modules. The neck network is divided into four branches. The input to the first branch is the output of the first C3k2-MSEE module in the backbone network, which passes through a 1×1 Conv module, an SBA module, and a C3k2 module sequentially. The output of the C3k2 module is then input to the SBA module of the second branch. The input to the second branch is the output of the second C3k2-MSEE module in the backbone network, which passes through a 1×1 Conv module, an SBA module, and a C3k2 module sequentially. The output of the C3k2 module is then input to the SBA module of the third branch. The input to the third branch is the third C3k2-MSEE module in the backbone network, and so on. The first branch passes through a 1×1 Conv module, an SBA module, and a C3k2 module. The output of the C3k2 module is then used as the first output of the neck network and fed into an SBA module. Next, it passes through another C3k2 module, whose output is used as the second output of the neck network and fed into an SBA module. Finally, it passes through another C3k2 module, whose output is used as the third output of the neck network and fed into the SBA module of the fourth layer. The fourth branch's input is the output of the C2PSA module in the backbone network. It then passes through a 1×1 Conv module, an SBA module, and a C3k2 module, with the output of the C3k2 module serving as the fourth output of the neck network, thus forming a new neck network structure. Step 3.3: The head network consists of 4 Multi-SEAMHead detection heads. The input of each detection head corresponds to the 4 outputs of the neck network mentioned above. Each detection head consists of 4 Conv modules, 2 DWConv modules, 2 Multi-SEAM modules, 2 Conv2d modules, 1 CIoU module and 1 CLSLoss module. Each detection head is divided into two branches. The first branch passes through two 3×3 Conv modules, one Multi-SEAM module, one 1×1 Conv2d module, and one CIoU module. The second branch passes through one 3×3 DWConv module, one 1×1 Conv module, one Multi-SEAM module, one 3×3 DWConv module, one 1×1 Conv module, one 1×1 Conv2d module, and one CLSLoss module in sequence. Step 4: Train the improved YOLO11n-based marine ranching benthic organism detection model using the training and validation sets, and save the trained model as the optimal model. This further includes steps 4.1 to 4.4: Step 4.1: Set the training parameters of the marine ranch benthic organism detection model based on the improved YOLO11n. The model training parameters include: learning rate, momentum, weight decay, optimizer, number of iterations, batch size, and label smoothing coefficient. Step 4.2: Input the training set and validation set images and corresponding labels into the improved YOLO11n marine ranch benthic organism detection model, use the backpropagation algorithm to calculate the gradient of the loss function with respect to the model parameters, and adjust the model parameters by minimizing the loss function to gradually approach the optimal solution; Step 4.3: Use the optimizer SGD to update the model parameters, making the model parameters update in the direction of gradient descent, until the loss function of the training set and validation set no longer decreases, and the evaluation metrics mAP, recall R, and accuracy P no longer improve, then stop training to avoid model overfitting. Step 4.4: Save the trained model parameters. At this point, the model is the optimal model. Step 5: Test the optimal model using the test set, evaluate the test results, and if the accuracy requirements are met, obtain the final marine ranch benthic organism detection model based on the improved YOLO11n.
2. The method for detecting benthic organisms in marine ranches based on the improved YOLO11n according to claim 1, characterized in that, In step 2, the training set, validation set, and test set are divided in a ratio of 7:2:
1.
3. The method for detecting benthic organisms in marine ranches based on the improved YOLO11n according to claim 1, characterized in that, Step 5 further includes steps 5.1 to 5.3: Step 5.1: Input the test set into the optimal model described in Step 5; Step 5.2: Calculate model performance metrics: Specific performance metrics include accuracy (P), recall (R), mAP@0.5, mAP@0.5:0.95, and model size. The specific calculation formulas are as follows: Where P is precision, R is recall, mAP is the mean precision across all categories, AP is the mean precision, m is the total number of categories of benthic organisms in the marine ranch, TP represents the number of positive samples correctly identified as positive samples, FP represents the number of negative samples incorrectly identified as positive samples, and FN represents the number of positive samples incorrectly identified as negative samples. mAP@0.5 represents the average precision when the IoU threshold is fixed at 0.
5. mAP@0.5:0.95 means that the average precision is calculated every 0.05 when the IoU threshold is between 0.5 and 0.95, and then the average of these average precisions is taken. Step 5.3: When the performance indicators meet the accuracy requirements, the final marine ranch benthic organism detection model based on the improved YOLO11n is obtained.