A deep-sea net cage net cloth detection method based on improved YOLOv12
Patent Information
- Application Number
- CN202611017754.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-09
- Publication Date
- 2026-10-27
AI Technical Summary
[0005]然而,现有技术普遍缺乏针对此类复杂背景的特征解耦与抗噪声干扰机制,导致模型在提取特征时极易产生严重混淆
[0017]与现有技术相比,本发明的有益效果是:本发明包括以YOLOv12算法模型为基础进行改进,得到新的目标检测模块,改进方法包括:对YOLOv12主干网络进行改进,构建新的A2C2f_DSE模块和C3k2_EDSC模块,引入GSConv模块;A2C2f_DSE模块抑制水下图像受光照衰减影响产生颜色失真,输出有效去除颜色失真的基础特征图,从而为模型后续的边缘强化与目标定位提供纯净的特征先验。
Smart Images

Figure CN122990443A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of underwater target detection technology, specifically a method for detecting deep-sea cage netting based on an improved YOLOv12. Background Technology
[0002] With the development of technology and the improvement of comprehensive aquaculture capabilities, marine aquaculture models have emerged. The condition of the netting is crucial to aquaculture, as it affects efficiency. Damaged netting can lead to the escape of farmed organisms, causing significant economic losses; conversely, excessive attachment to the netting can also negatively impact the growth of farmed organisms.
[0003] Existing deep learning-based detection technologies suffer from limitations in hardware compatibility and deployment bottlenecks. The number of parameters and computational complexity of existing models are often too high, making it difficult to adapt to edge computing platforms for underwater robots (ROV / AUV) with limited computing power and sensitive power consumption, which severely restricts the real-time deployment capability of models on mobile devices.
[0004] Insufficient robustness in complex underwater environments. Real-world netting operations are often accompanied by drastic light attenuation and water turbidity, which objectively causes color distortion and edge blurring in images; at the same time, the texture of the netting itself has a high degree of visual similarity to plankton or attached organisms in the water.
[0005] However, existing technologies generally lack feature decoupling and noise immunity mechanisms for such complex backgrounds, making the models highly susceptible to severe confusion during feature extraction. This lack of physical prior information ultimately leads to a significant increase in the false negative rate of mesh damage and the false positive rate of biological attachment, resulting in low detection accuracy. This makes it difficult to meet the engineering requirements for high-precision, high-real-time monitoring of mesh conditions in real-world scenarios. Summary of the Invention
[0006] The purpose of this invention is to provide a deep-sea cage mesh detection method based on an improved YOLOv12 to solve the problems mentioned in the background. This invention improves the YOLOv12 algorithm model to obtain a new target detection module. The improvement method includes: improving the YOLOv12 backbone network, constructing new A2C2f_DSE and C3k2_EDSC modules, and introducing the GSConv module. The A2C2f_DSE module suppresses color distortion caused by light attenuation in underwater images and outputs a basic feature map that effectively removes color distortion, which has the advantage of providing pure feature priors for subsequent edge enhancement and target localization of the model.
[0007] To achieve the above objectives, the present invention provides the following technical solution: a method for detecting deep-sea cage netting based on an improved YOLOv12, comprising the following steps: S1: Use an underwater robot platform to collect underwater images and capture videos of the netted target; S2: Obtain the target mesh clothing image from the captured images and create a dataset. Divide the dataset into a training set, a validation set, and a test set in a 7:2:1 ratio. S3: Label the dataset from step S2 to form a label file in the YOLO network training format; S4: Based on the YOLOv12 algorithm model, a new object detection module is obtained through improvement. The improvement methods include: improving the YOLOv12 backbone network, constructing new A2C2f_DSE and C3k2_EDSC modules, and introducing the GSConv module. S5: Use the improved YOLOv12 algorithm model from step S4 to train the label file and obtain the object detection model weights; S6: Use the obtained target detection model weights to test the mesh clothing image and output the location information data and classification information data of the mesh clothing detection; S7: Divide the video into keyframes and obtain keyframes and non-keyframes; S8: Based on the key frame and non-key frame detection information obtained in step S7, the output image is detected by the target detection model in step S5. S9: Detect damaged targets and attached targets in the output image, and count the number of damaged targets and the number of attached targets; S10: Generate a density heat map based on the number of damaged targets and the number of attached targets, and use the density heat map as the mesh detection result.
[0008] As a further embodiment of the present invention, in step S4, the YOLOv12 backbone network is improved and a new A2C2f_DSE module is constructed by building the ABlock_DSE processing unit based on the A2C2f module of the OLOv12 backbone network.
[0009] As a further embodiment of the present invention, in step S4, constructing a new A2C2f_DSE module includes the following steps: Step S4.1.1: Through the preceding SEA module (spatial and channel enhanced attention module), based on the spatial and channel reconstruction mechanism of the Sigmoid activation function, dynamic channel weight allocation is performed on the input degradation features to filter out redundant and interfering channel features that express color distortion. Step S4.1.2: Connect the Dynamic Tanh activation unit between the attention mechanism and the feedforward network, using the following formula: The function mapping properties allow for nonlinear truncation and suppression of extreme eigenvalues caused by rapid attenuation of local illumination without the need to calculate global statistics.
[0010] As a further embodiment of the present invention, in step S4.1.2, a new A2C2f_DSE module is constructed, wherein the DSE unit channel selection threshold is adaptively adjusted according to the light intensity, the module output feature map size is consistent with the original A2C2f module, and the output is a decolorized basic feature map.
[0011] As a further embodiment of the present invention, in step S4, a new C3k2_EDSC module is constructed. The improvements include using a Haar wavelet basis for wavelet transform, decomposing the module into two layers, with a high-frequency information retention threshold of 0.6; and using a Gaussian filter with a sigma value of 1.2 to suppress noise without blurring the mesh edges.
[0012] As a further embodiment of the present invention, in step S4, constructing a new C3k2_EDSC module includes the following steps: Step S4.2.1: Receive the decolorized distortion base feature map output by the A2C2f_DSE module; Step S4.2.2: Input the decolorized basic feature map into the EDFFN unit, use a combination of local 3×3 depth convolution and gated activation to initially suppress underwater turbidity particle noise, and further map the features to the frequency domain. Use a frequency domain high-frequency filtering strategy to accurately capture and retain the high-frequency topological information of the net edge to obtain a purified and enhanced feature map. Step S4.2.3: Input the frequency-domain purified feature map into the SCGA module (spatial-channel global attention module). Through the self-attention mechanism and multi-dimensional dynamic reconstruction of spatial and channel feature weights, the biological similarity interference background is further suppressed from the global dimension, the mesh detail feature response is enhanced, and the edge feature map with clear edges and semantics is output.
[0013] As a further embodiment of the present invention, in step S4, the YOLOv12 backbone network is improved by introducing the GSConv module, including the following steps: Step S4.3.1: Receive the edge feature map output by the C3k2_EDSC module in step S4.2.3, and adaptively adjust the convolution strategy according to the image "turbidity label"; Step S4.3.2: Adaptively adjust the convolution strategy to determine turbidity, so that 80% of the detailed features are preserved in the clear environment and 60% of the noise is suppressed in the turbid environment; Step S4.3.3: Use depthwise separable convolution to reduce computation, inherit the features of A2C2f_DSE module and C3k2_EDSC module, and output a lightweight feature map adapted to the current environment.
[0014] As a further embodiment of the present invention, in step S4.3.2, the turbidity is determined by the standard deviation of image gray level. If the standard deviation of image gray level is ≥50, it is considered highly turbid; if the standard deviation of image gray level is ≤20, it is considered clear. In step S4.3.3, the ratio of point convolution to depth convolution in depth-separable convolution is 1:1, which reduces the computational cost by 75% compared to standard convolution.
[0015] As a further embodiment of the present invention, in step S5, the dataset in the label file is input into the basic feature extraction network of the preset detection model for pre-training, the network weights and parameters are initialized, and then the preset detection model is retrained using the pre-processed target mesh image to obtain the target detection model.
[0016] As a further embodiment of the present invention, in step S7, the criterion for dividing key frames and non-key frames is to make a judgment based on the analysis results obtained by analyzing the features of the current frame.
[0017] Compared with the prior art, the beneficial effects of the present invention are as follows: The present invention includes improvements based on the YOLOv12 algorithm model to obtain a new target detection module. The improvement method includes: improving the YOLOv12 backbone network, constructing a new A2C2f_DSE module and a C3k2_EDSC module, and introducing a GSConv module; the A2C2f_DSE module suppresses color distortion caused by light attenuation in underwater images, and outputs a basic feature map that effectively removes color distortion, thereby providing a clean feature prior for the subsequent edge enhancement and target localization of the model.
[0018] The C3k2_EDSC module addresses the edge blurring caused by the similarity between netting details and aquatic organisms in real underwater environments, and enhances the edge details of the netting.
[0019] The A2C2f_DSE and C3k2_EDSC modules work together to provide limited protection against the synergistic interference of light attenuation and the similarity of mesh details to aquatic organisms.
[0020] The GSConv module reduces computational load, achieving lightweight deployment while maintaining high accuracy. It overcomes false positives and false negatives caused by water turbidity. The improved model enhances robustness and detection accuracy in complex underwater environments. Furthermore, it achieves the goal of reducing the number of parameters and computational load, demonstrating significant lightweight advantages. Attached Figure Description
[0021] Figure 1This is a flowchart of the detection method of the present invention; Figure 2 This is a structural diagram of the A2C2f_DSE module of the present invention; Figure 3 This is a structural diagram of the SEA module of the present invention; Figure 4 This is a structural diagram of the C3k2_EDSC module of the present invention; Figure 5 This is a structural diagram of the SCGA module of the present invention; Figure 6 This is a structural diagram of the GSConv module of the present invention; Figure 7 This is a network structure diagram of the present invention; Figure 8 This is a comparison diagram showing the effects of the invention before and after the improvements. Detailed Implementation
[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. Example 1
[0023] Please see the appendix Figure 1 A method for detecting deep-sea cage netting based on an improved YOLOv12 includes the following steps: S1: Use an underwater robot platform to collect underwater images and capture videos of the netted target; Using an underwater robot platform equipped with an underwater camera, we cruised and collected images and videos of the netting at different depths (0m-50m) in deep-sea cages; The preprocessing uses a combination of Retinex light homogenization and white balance color correction to eliminate differences in basic lighting in light and dark areas, ensuring that the image brightness deviation is ≤5% and the color deviation is ≤8%.
[0024] S2: Obtain the target mesh clothing image from the captured images and create a dataset. Divide the dataset into a training set, a validation set, and a test set in a 7:2:1 ratio. Use a fusion method to preprocess the target mesh clothing images, including the target mesh clothing video, to uniformize the image lighting and correct the image color, remove factors that may affect the detection results, and improve the accuracy of the detection results.
[0025] S3: Label the dataset from step S2 to form a label file in the YOLO network training format; The preprocessed target mesh image was manually or semi-automatically annotated using the professional image annotation tool LabelImg. The two types of targets, "damaged area" and "attached area", were accurately defined by the minimum bounding rectangle. The category label of each target and the normalized center coordinates and width and height parameters were extracted in strict accordance with the YOLO network format specifications.
[0026] S4: Based on the YOLOv12 algorithm model, a new object detection module is obtained through improvement. The improvement methods include: improving the YOLOv12 backbone network, constructing new A2C2f_DSE and C3k2_EDSC modules, and introducing the GSConv module. Please see the appendix Figure 2 An improvement to the YOLOv12 backbone network was made to construct a new A2C2f_DSE module, which is an ABlock_DSE processing unit built on the basis of the A2C2f module of the OLOv12 backbone network.
[0027] To build a new A2C2f_DSE module, the following steps are required: Please see the appendix Figure 3 Step S4.1.1: Through the preceding SEA module (spatial and channel enhanced attention module), based on the spatial and channel reconstruction mechanism of the Sigmoid activation function, dynamic channel weight allocation is performed on the input degradation features to filter out redundant and interfering channel features that express color distortion. Step S4.1.2: Connect the Dynamic Tanh activation unit between the attention mechanism and the feedforward network, using the following formula: The function mapping properties allow for nonlinear truncation and suppression of extreme eigenvalues caused by rapid attenuation of local illumination without the need to calculate global statistics.
[0028] In step S4.1.2, a new A2C2f_DSE module is constructed, wherein the DSE unit channel selection threshold is adaptively adjusted according to the light intensity, with a threshold of 0.5 in normal light environment and a threshold of 0.3 in low light environment; the module output feature map size is consistent with the original A2C2f module to ensure network compatibility, and outputs a decolorized basic feature map.
[0029] Please see the appendix Figure 4 A new C3k2_EDSC module was constructed, and improvements were made including the use of Haar wavelet basis for wavelet transform, two decomposition layers, a high-frequency information retention threshold of 0.6, and a Gaussian filter sigma value of 1.2 to suppress noise without blurring the mesh edges.
[0030] To build a new C3k2_EDSC module, follow these steps: Step S4.2.1: Receive the decolorized distortion base feature map output by the A2C2f_DSE module; Step S4.2.2: Input the decolorized basic feature map into the EDFFN unit, use a combination of local 3×3 depth convolution and gated activation to initially suppress underwater turbidity particle noise, and further map the features to the frequency domain. Use a frequency domain high-frequency filtering strategy to accurately capture and retain the high-frequency topological information of the net edge to obtain a purified and enhanced feature map. Frequency domain high-frequency screening refers to first applying a two-dimensional real-number fast Fourier transform to map local spatial block features to the complex frequency domain; for the screening of frequency domain features, the traditional fixed hard truncation threshold that is prone to ringing effects is abandoned, and instead a learnable parameter matrix that is strictly aligned with the spectrum dimension is introduced as an adaptive frequency mask. The data-driven "soft threshold" gating operation is achieved by multiplying the mask with the element-wise Hadamard product of the frequency domain features.
[0031] Specifically, under the optimization of end-to-end backpropagation of the model, the mask weights corresponding to specific frequency components representing environmental disturbances such as water turbidity are adaptively decayed to near the zero threshold, while the weights of high-frequency components representing the topology of the mesh are directionally retained or amplified. The clean spectrum after this soft threshold modulation is finally reconstructed back into the spatial domain through two-dimensional real inverse fast Fourier transform, thereby accurately completing the purification and enhancement of edge features without the hard loss of high-frequency information.
[0032] Please see the appendix Figure 5 Step S4.2.3: Input the frequency domain purified feature map into the SCGA module (spatial-channel global attention module). Through the self-attention mechanism and multi-dimensional dynamic reconstruction of spatial and channel feature weights, the biological similarity interference background is further suppressed from the global dimension, the mesh detail feature response is enhanced, and the edge feature map with clear edges and clear semantics is output.
[0033] Please see the appendix Figure 6 Further improvements to the YOLOv12 backbone network, including the introduction of the GSConv module, are made through the following steps: Step S4.3.1: Receive the edge feature map output by the C3k2_EDSC module in step S4.2.3, and adaptively adjust the convolution strategy according to the image "turbidity label"; Step S4.3.2: Adaptively adjust the convolution strategy to determine turbidity, so that 80% of the detailed features are preserved in the clear environment and 60% of the noise is suppressed in the turbid environment; the turbidity is determined by the standard deviation of the image gray level. If the standard deviation of the image gray level is ≥50, it is highly turbid, and if the standard deviation of the image gray level is ≤20, it is clear. Step S4.3.3: Depthwise separable convolution is used to reduce computational cost. It inherits features from the A2C2f_DSE and C3k2_EDSC modules, outputting a lightweight feature map adapted to the current environment. The ratio of pointwise convolution to depthwise convolution in the depthwise separable convolution is 1:1, reducing computational cost by 75% compared to standard convolution.
[0034] S5: Train the label file using the improved YOLOv12 algorithm model from step S4 to obtain the object detection model weights; input the dataset from the label file into the basic feature extraction network of the preset detection model for pre-training, initialize the network weights and parameters, and then retrain the preset detection model using the pre-processed target mesh image to obtain the object detection model. Initializing the network weights and parameters can effectively avoid problems such as gradient explosion and gradient loss during network training.
[0035] S6: Use the obtained target detection model weights to test the mesh clothing image and output the location information data and classification information data of the mesh clothing detection; S7: Divide the video into keyframes and non-keyframes; the criteria for dividing keyframes into keyframes and non-keyframes are based on the analysis results obtained from analyzing the features of the current frame.
[0036] Please see the appendix Figure 7 S8: Based on the keyframe and non-keyframe detection information obtained in step S7, the output image is obtained by the target detection model in step S5. The hardware configuration is as follows:
[0037] The relevant training parameters are shown in the table below:
[0038] The parameters of the model after training:
[0039] S9: Detect damaged targets and attached targets in the output image, and count the number of damaged targets and the number of attached targets; Please see the appendix Figure 8 S10: Generate a density heat map based on the number of damaged targets and the number of attached targets, and use the density heat map as the mesh detection result.
[0040] Based on the density heat map, users can easily identify and repair any damage to the netting, as well as promptly identify undamaged netting and clean up any attached debris, thus maintaining the aquaculture environment and preventing damage or excessive debris from affecting aquaculture.
[0041] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered illustrative and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the scope of the invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
[0042] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for detecting deep-sea cage netting based on an improved YOLOv12, characterized in that: Includes the following steps: S1: Use an underwater robot platform to collect underwater images and capture videos of the netted target; S2: Obtain the target mesh clothing image from the captured images and create a dataset. Divide the dataset into a training set, a validation set, and a test set in a 7:2:1 ratio. S3: Label the dataset from step S2 to form a label file in the YOLO network training format; S4: Based on the YOLOv12 algorithm model, a new object detection module is obtained through improvement. The improvement methods include: improving the YOLOv12 backbone network, constructing new A2C2f_DSE and C3k2_EDSC modules, and introducing the GSConv module. S5: Use the improved YOLOv12 algorithm model from step S4 to train the label file and obtain the object detection model weights; S6: Use the obtained target detection model weights to test the mesh clothing image and output the location information data and classification information data of the mesh clothing detection; S7: Divide the video into keyframes and obtain keyframes and non-keyframes; S8: Based on the key frame and non-key frame detection information obtained in step S7, the output image is detected by the target detection model in step S5. S9: Detect damaged targets and attached targets in the output image, and count the number of damaged targets and the number of attached targets; S10: Generate a density heat map based on the number of damaged targets and the number of attached targets, and use the density heat map as the mesh detection result.
2. The method for detecting deep-sea cage mesh based on improved YOLOv12 according to claim 1, characterized in that: In step S4, the YOLOv12 backbone network is improved and a new A2C2f_DSE module is constructed. This new module is an ABlock_DSE processing unit built on the basis of the A2C2f module of the OLOv12 backbone network.
3. The method for detecting deep-sea cage netting based on improved YOLOv12 according to claim 2, characterized in that: In step S4, constructing the new A2C2f_DSE module includes the following steps: Step S4.1.1: Through the preceding SEA module (spatial and channel enhanced attention module), based on the spatial and channel reconstruction mechanism of the Sigmoid activation function, dynamic channel weight allocation is performed on the input degradation features to filter out redundant and interfering channel features that express color distortion. Step S4.1.2: Connect the Dynamic Tanh activation unit between the attention mechanism and the feedforward network, using the following formula: The function mapping properties allow for nonlinear truncation and suppression of extreme eigenvalues caused by rapid attenuation of local illumination without the need to calculate global statistics.
4. The method for detecting deep-sea cage netting based on improved YOLOv12 according to claim 3, characterized in that: In step S4.1.2, a new A2C2f_DSE module is constructed, wherein the DSE unit channel selection threshold is adaptively adjusted according to the light intensity, the module output feature map size is consistent with the original A2C2f module, and the output is a decolorized basic feature map.
5. The method for detecting deep-sea cage netting based on improved YOLOv12 according to claim 4, characterized in that: In step S4, a new C3k2_EDSC module is constructed. The improvements include using a Haar wavelet basis for wavelet transform, decomposing the data into 2 layers, and setting a high-frequency information retention threshold of 0.
6. A Gaussian filter with a sigma value of 1.2 is used to suppress noise without blurring the mesh edges.
6. The method for detecting deep-sea cage netting based on improved YOLOv12 according to claim 5, characterized in that: In step S4, constructing the new C3k2_EDSC module includes the following steps: Step S4.2.1: Receive the decolorized distortion base feature map output by the A2C2f_DSE module; Step S4.2.2: Input the decolorized basic feature map into the EDFFN unit, use a combination of local 3×3 depth convolution and gated activation to initially suppress underwater turbidity particle noise, and further map the features to the frequency domain. Use a frequency domain high-frequency filtering strategy to accurately capture and retain the high-frequency topological information of the net edge to obtain a purified and enhanced feature map. Step S4.2.3: Input the frequency-domain purified feature map into the SCGA module (spatial-channel global attention module). Through the self-attention mechanism and multi-dimensional dynamic reconstruction of spatial and channel feature weights, the biological similarity interference background is further suppressed from the global dimension, the mesh detail feature response is enhanced, and the edge feature map with clear edges and semantics is output.
7. The method for detecting deep-sea cage netting based on improved YOLOv12 according to claim 5, characterized in that: In step S4, the YOLOv12 backbone network is improved by introducing the GSConv module, including the following steps: Step S4.3.1: Receive the edge feature map output by the C3k2_EDSC module in step S4.2.3, and adaptively adjust the convolution strategy according to the image "turbidity label"; Step S4.3.2: Adaptively adjust the convolution strategy to determine turbidity, so that 80% of the detailed features are preserved in the clear environment and 60% of the noise is suppressed in the turbid environment; Step S4.3.3: Use depthwise separable convolution to reduce computation, inherit the features of A2C2f_DSE module and C3k2_EDSC module, and output a lightweight feature map adapted to the current environment.
8. The method for detecting deep-sea cage netting based on improved YOLOv12 according to claim 7, characterized in that: In step S4.3.2, the turbidity is determined by the standard deviation of the image gray level. If the standard deviation of the image gray level is ≥50, it is considered highly turbid; if the standard deviation of the image gray level is ≤20, it is considered clear. In step S4.3.3, the ratio of point convolution to depth convolution in depth-separable convolution is 1:1, which reduces the computational cost by 75% compared to standard convolution.
9. The method for detecting deep-sea cage netting based on improved YOLOv12 according to claim 1, characterized in that: In step S5, the dataset from the label file is input into the basic feature extraction network of the preset detection model for pre-training, the network weights and parameters are initialized, and then the preset detection model is retrained using the pre-processed target mesh image to obtain the target detection model.
10. The method for detecting deep-sea cage netting based on improved YOLOv12 according to claim 1, characterized in that: In step S7, the criterion for dividing key frames into key frames and non-key frames is to make a judgment based on the analysis results obtained by analyzing the features of the current frame.
