Novel lightweight underwater small target detection method
Through a new lightweight underwater small target detection method, the lightweight multi-scale feature extraction backbone network and the twin-tower PAN feature fusion network are used, combined with the lightweight coupling detection head, to solve the problem of underwater small target detection and lightweight in the CNN detection network. By solving the shortcomings, it achieves efficient underwater small target detection and embedded deployment, reducing the number of parameters and maintaining detection accuracy.
Patent Information
- Application Number
- CN202410911953.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-10-01
AI Technical Summary
CNN-based detection networks have shortcomings in underwater small target detection and lightweighting. Especially when dealing with complex underwater environments, traditional methods are difficult to achieve efficient and accurate detection, especially the identification and classification of small targets.
A new lightweight underwater small target detection method is proposed. By collecting and preprocessing underwater data sets, a lightweight multi-scale feature extraction backbone network and a twin-tower PAN feature fusion network are used, combined with a lightweight coupling detection head, to achieve detection of different Multi-scale fusion and classification of scale features reduce the amount of model parameters to adapt to embedded computer deployment.
Without affecting the accuracy of underwater small target detection, the amount of model parameters is significantly reduced, the detection accuracy of objects of different sizes is improved, and efficient deployment is achieved on an embedded computer. The amount of parameters is only 0.59M, and mAP50 reaches 83%. , only 0.4% lower than the YOLOv8-n model.
Smart Images

Figure CN118736397A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to an underwater small target detection method, belonging to the technical field of target detection. Background Art
[0002] With the continuous advancement of science and technology, underwater resources continue to emerge, and the strategic value of the underwater environment is becoming more and more prominent. In the exploration of underwater environmental resources, mastering underwater small target detection technology is of great significance to the country, and it also helps to take the lead in the development of underwater environment. Therefore, more and more researchers are paying attention to the use of artificial intelligence technology to explore and develop underwater resources.
[0003] Since light attenuates underwater, part of it is scattered and part of it is absorbed by the water, making objects in underwater images more difficult to identify than in images taken in the air. They have low contrast and color cast, which brings certain difficulties to model detection, such as accuracy, false detection and missed detection.
[0004] In the field of underwater detection technology, traditional image processing methods rely on manually designed features and rules, such as edge detection, threshold segmentation, and morphological processing. However, these methods often perform poorly when faced with the complexity of underwater environments, especially when dealing with small targets, where image details are more easily lost, resulting in failure to detect. In recent years, with the continuous development of deep learning technology, detection models based on CNN networks have made great progress in object detection and can effectively overcome the limitations of traditional methods. For example, the CSPDarknet network has good feature extraction capabilities, FAN has achieved significant results in feature fusion, and PAN can further improve the feature fusion performance of FAN and make up for the defects of multi-scale feature maps in position information.
[0005] However, although the CNN-based detection network can greatly improve the efficiency of traditional detection, it still has deficiencies in small target detection and lightweight. Although the YOLO series can well achieve end-to-end target detection in terms of real-time performance and detection accuracy, it still needs to be further improved in terms of lightweight. To this end, this paper proposes a new lightweight underwater target detection method and compares it with the YOLOv8 model to achieve 0.59M lightweight parameters, which is helpful for the deployment of the model in embedded computers. Summary of the invention
[0006] In order to solve the problem that although the CNN-based detection network can greatly improve the traditional detection efficiency, it is still insufficient in small target detection and lightweight, and further proposes a novel lightweight underwater small target detection method.
[0007] The technical solution adopted by the present invention to solve the above problems is: the present invention specifically includes:
[0008] Step 1: Collect underwater small target datasets or use public underwater datasets;
[0009] Step 2: Preprocess the underwater data set, including scaling, translation, enhancement, and denoising, and calibrate the data set;
[0010] Step 3: Input the preprocessed data set into the new lightweight underwater small target detection network. The input image is passed through the lightweight multi-scale feature extraction backbone network to extract multi-scale feature information, and then the dual-tower PAN feature fusion network is used to fuse the deep semantic information and the underlying position information at multiple scales. Finally, the lightweight coupled detection head detects and classifies objects with pixel sizes of 4×4, 8×8, and 16×16 or larger.
[0011] Step 4: Evaluate and analyze the network model and compare it with the YOLOv8-n model.
[0012] Furthermore, the lightweight multi-scale feature extraction backbone network includes one Stem Layer and three StageLayer layers. The Stem Layer uses ordinary 3×3 stride convolution, and the Stage Layer uses a combination of 3×3 convolution with a stride of 2 and the CSPBottleneck module. The CSPBottleneck module uses the C2f module with better performance and the lightweight C3Ghost module, which can greatly reduce the number of model parameters.
[0013] Furthermore, the deep semantic information and the underlying location information are fused at multiple scales through the dual-tower PAN feature fusion network, including:
[0014] Step a: The semantic information of the deep network extracted by the backbone is passed to the shallow network in a top-down manner, and the feature maps of different scales on the three-stage layer of the backbone are fused;
[0015] Step b: pass the underlying location information to the deep network in a bottom-down manner.
[0016] Furthermore, in step 3, the pixel-level spatial information modeling capability of the lightweight coupled detection head is improved. The detection head uses two layers of 1×1 CBF modules and one 1×1 convolution for detection and classification respectively.
[0017] The beneficial effect of the present invention is that the present invention reduces the amount of model parameters without affecting the detection accuracy of underwater small targets, and is easy to deploy on embedded computers. The content includes underwater data collection or selection, data preprocessing, a lightweight multi-scale feature extraction backbone to extract underwater data set features, a dual-tower PAN feature fusion network of a lightweight backbone network to fuse different scale features, enrich the semantic information and position information on different scale feature maps, and a lightweight decoupling detection head to classify and regress three scale feature maps respectively, thereby improving the detection accuracy of objects of different sizes. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a schematic diagram of a lightweight multi-scale feature fusion extraction backbone network 1;
[0019] Figure 2 It is a schematic diagram of lightweight multi-scale feature fusion extraction backbone network 2;
[0020] Figure 3 This is a schematic diagram of a dual-tower PAN network based on convergence;
[0021] Figure 4 This is a schematic diagram of the lightweight decoupling detection head FLhead;
[0022] Figure 5 It is a schematic diagram of the CBF module;
[0023] Figure 6 It is a schematic diagram of a lightweight underwater small target detection network;
[0024] Figure 7 This is a schematic diagram of the YOLOv8-n network structure. DETAILED DESCRIPTION
[0025] Specific implementation method 1: Figures 1 to 7 As shown, a novel lightweight underwater small target detection method specifically includes:
[0026] Step 1: Collect underwater small target datasets or use public underwater datasets;
[0027] Step 2: Preprocess the underwater data set, including scaling, translation, enhancement, and denoising, and calibrate the data set;
[0028] Step 3: Input the preprocessed data set into the new lightweight underwater small target detection network. The input image is passed through the lightweight multi-scale feature extraction backbone network to extract multi-scale feature information, and then the dual-tower PAN feature fusion network is used to fuse the deep semantic information and the underlying position information at multiple scales. Finally, the lightweight coupled detection head detects and classifies objects with pixel sizes of 4×4, 8×8, and 16×16 or larger.
[0029] Step 4: Evaluate and analyze the network model and compare it with the YOLOv8-n model.
[0030] Among them, the lightweight multi-scale feature fusion extraction backbone network is mainly composed of a Stem Layer, a three-layer StageLayer network and an SPPF module. On the basis of the original yolov8 CSPDarknet network, the conv convolution and C2f modules on the Stage Layer4 layer are removed, which greatly reduces the number of parameters brought by the deep network. In addition to being different from the CSPDarknet network in depth, this network also adds multi-scale feature fusion on the Stage Layer network to enhance the feature extraction capability of the backbone network. In order to compensate for the decrease in the lightweight backbone feature extraction capability caused by the reduction of the deep network, the multi-scale feature fusion of the latter stage Stage Layer and the previous Stage Layer is performed, and the fused feature map is further extracted through ordinary non-step convolution, which improves the backbone network's feature and extraction capabilities for multi-scale feature maps, adapts to the detection of objects of different sizes, and also enhances the feature extraction capability of small targets in the shallow network.
[0031] Among them, the dual-tower PAN network structure adds a bottom-down feature pyramid structure on the basis of the feature pyramid formed from top to bottom by FPN. The top-down feature extraction process can transfer the semantic information of the deep network to the underlying network, and then combine the bottom-down process to transfer the underlying position information to the deep network, which can make up for the position information of the deep network and the semantic information of the shallow network. After the lightweight backbone feature extraction, the CSP Botleneck modules after multi-scale fusion on the three Stage Layers are fused to further enhance the multi-scale feature extraction capability of the network. The dual-tower PAN network adopts the structure in YOLOv8. In order to further lighten the weight, the last layer of C2f module is replaced with a lighter C3Ghost module, and a multi-scale spatial attention mechanism EMA is added before the C2f module in the FAN structure to enhance the fusion effect of the network.
[0032] Among them, the lightweight decoupled detection head FLhead performs regression and classification processing on the fused multi-scale feature map respectively, and extracts the target position information and category information respectively. The detection head consists of two layers of CBF modules, a 1×1 convolution and respective classification regression loss functions. The CBF module consists of a non-strided convolution with a 1×1 convolution kernel, regularized BatchNorm and convolution FReLU. It has a small number of parameters and improves the model's detection effect on small objects through the spatial pixel-level modeling capability of the FReLU activation function.
[0033] like Figure 1 and Figure 2 As shown in the figure, in the lightweight multi-scale feature fusion extraction backbone network 1, a color image with a size of 640×640 and a channel number of 3 is first input, and down-sampled through two CBS modules with a convolution kernel of 3 and a step size of 2 to obtain feature maps of 320×320×16 and 160×160×32. The CBS module consists of a layer of convolution, regularization BatchNorm and activation function SiLU. The feature map is passed through a C2f module, and then input into a layer of CBS module with a convolution kernel of 3 and a step size of 2 to down-sample to obtain a feature map of 80×80×64. The feature map is input into two layers of C2f modules to obtain feature map t2. The feature map t2 is fed into a CBS module with a convolution kernel of 3×3 and a stride of 2 to further obtain a feature map of 40×40×128 size. It is then fed into two C3Ghost modules and a SPPF module to increase the receptive field of the feature map to obtain a feature map t3. In order to increase multi-scale feature extraction, the feature map t2 is fed into sample1 to obtain a 160×160×64 feature map, which is then fused with the 160×160×32 feature map output by the first C2f module to obtain a 160×160×96 feature map. It is then fed into a CBS module with a convolution kernel of 3×3 and a stride of 1 to obtain a new feature map t1. The backbone network fuses the C2f module of the Stage Layer2 layer with the output of the C2f of the Stage Layer1 layer through 2x upsampling, which enhances the feature extraction capability of the 160×160 size feature map.
[0034] Lightweight multi-scale feature fusion extraction backbone network 2, based on network 1, upsamples the last layer of C3Ghost module by 2 times and 4 times respectively, concats the 160×160×128 feature map after 4 times upsampling with the 160×160×64 feature map and the 160×160×32 feature map, and then inputs the CBS module with a convolution kernel of 1×1 and a step size of 1 to obtain a new feature map t1, and fuses the 80×80×128 feature map of the last layer of C3Ghost module after 2 times upsampling with the 80×80×64 feature map of Stage Layer2 to obtain a feature map of 80×80×92, and then inputs a CBS module with a convolution kernel of 1×1 and a step size of 1 to obtain a new multi-scale fusion feature map t2. The network fuses the feature maps of the C2f module of the StageLayer2 layer with 2x upsampling and the C3Ghost module of the StageLayer3 layer with 4x upsampling, and fuses the three scale feature maps. It also enhances the multi-scale feature fusion effect through 1×1 convolution, and further improves the feature extraction of feature map t1. The C3Ghost module of the StageLayer3 layer is fused with the C2f module of the StageLayer2 layer through 4x upsampling, which also enriches the feature map. Figure 2 features, which is helpful for subsequent feature fusion and detection.
[0035] Specific implementation method 2: Figures 1 to 7 As shown in the figure, the lightweight multi-scale feature extraction backbone network includes one Stem Layer and three Stage Layers. The Stem Layer uses ordinary 3×3 stride convolution, and the Stage Layer uses a combination of 3×3 convolution with a stride of 2 and a CSPBottleneck module. The CSPBottleneck module uses the C2f module with better performance and the lightweight C3Ghost module, which can greatly reduce the number of model parameters.
[0036] Among them, the lightweight multi-scale feature extraction backbone network includes scale fusion between different Stage Layers: one lightweight multi-scale feature extraction backbone network includes the C2f module in the Stage Layer2 layer fused with the C2f module in the StageLayer1 layer through upsampling, and then enhances the feature extraction through non-stepped convolution; the other lightweight multi-scale feature extraction backbone network includes the CSP Botleneck module fusion between three layers, thereby enhancing the feature extraction capability of the backbone network.
[0037] In order to enhance the fusion between the features of the backbone network, the FAN+PAN dual-tower pyramid method is used to strengthen the multi-scale feature fusion. The feature map t3 output by the SPPF layer of the backbone network is upsampled by 2 times and added to the feature map t2. After the cross-space learning efficient multi-scale attention module EMA, it is input into the C2f layer and then upsampled by 2 times and added to the feature map t1. EMA strengthens the attention to important parts and suppresses unimportant areas. Then it is input into the bottom C2f module of the FAN tower. At this time, the top-level semantic information is fused to the bottom layer through the FAN pyramid. The feature map t4 output by the bottom C2f can be used as the input of the detection head. Next, the PAN operation is performed to integrate the bottom-level position information into the top layer. The bottom C2f module is fused with the first C2f of FAN through the downsampling module CBS, and the C2f module is input to extract features. The output feature map t5 is used as the input of the detection head 2. t5 is downsampled by a layer of CBS and fused with the feature map t3. Then it passes through the lightweight module C3Ghost to obtain the feature map t6 as the input of the detection head 3.
[0038] Specific implementation method three: Figures 1 to 7 As shown in the figure, the deep semantic information and the underlying location information are fused at multiple scales through the dual-tower PAN feature fusion network, including:
[0039] Step a: The semantic information of the deep network extracted by the backbone is passed to the shallow network in a top-down manner, and the feature maps of different scales on the three-stage layer of the backbone are fused;
[0040] Step b: pass the underlying location information to the deep network in a bottom-down manner.
[0041] Among them, in order to improve the network feature fusion capability, the EMA attention mechanism is added in the process of transmitting semantic information, which can effectively improve the model detection accuracy.
[0042] Specific implementation method four: Figures 1 to 7 As shown in Figure 3, the lightweight coupled detection head has the ability to model pixel-level spatial information in step 3. The detection head uses two layers of 1×1 CBF modules and one 1×1 convolution for detection and classification respectively.
[0043] Among them, the CBF module consists of ordinary convolution with a step size of 1, regularized BatchNorm and convolution FReLU. The FReLU activation function has spatial pixel-level modeling capabilities, which can improve the detection and classification capabilities of lightweight detection heads for tiny particles.
[0044] The lightweight decoupled detection head FLhead consists of two layers of CBF modules with a convolution kernel of 1×1 and a stride of 1, a non-stride convolution with a convolution kernel of 3×3, and a regression classification loss function. The convolution sum of 1×1 is reduced to 1 / 9 of the original parameters compared to 3×3 convolution, which greatly reduces the number of parameters. At the same time, the FReLU activation function has the ability to model pixel-level space, which can make up for the loss of detection accuracy and has a good classification and regression effect on the fused feature map. The classification loss function uses binary cross entropy as the classification loss, and the formula is as follows:
[0045]
[0046] Among them, y i The value is 0 or 1, 0 represents the negative class, 1 represents the positive class, p i Represents the probability of the positive class, 1-p i represents the probability of the negative class.
[0047] The regression loss continues to use the CIoU and DFL methods in YOLOv8. DFL can optimize the probabilities of the two positions closest to the label y in the form of cross entropy, so that the network can gather the distribution of the target position and the adjacent area more quickly.
[0048] DFL(S i ,S i+1 )=-((y i+1 -y)log S i +(yy i )log S i+1 ),
[0049] In the formula, S i and S i+1 are the predicted value and the near predicted value output by the network, y is the true label, and y i and i+1 They are the label integral value and the adjacent label integral value respectively.
[0050] Compared with the YOLOv8 network structure, the lightweight underwater small target detection network of the present invention adopts a lightweight multi-scale feature extraction backbone network, strengthens the feature information of the three output feature maps of the backbone network, and is more suitable for small target detection in terms of detection targets. A small target detection layer is added, and a large amount of parameter redundancy brought by the large target detection layer above 32×32 is removed. The C2f module on the Stage Layer3 layer adopts a lighter C3Gost module, which effectively reduces redundancy without losing feature extraction; the feature fusion part still adopts the PAN double-tower fusion structure, and the last layer of C2f module is replaced by the C3Gost module in order to reduce the amount of calculation brought by the deep layer, and two EMA attention mechanisms are added to the FAN network structure to enhance the spatial multi-scale feature fusion effect. The detection head adopts a lighter FLhead detection head with spatial pixel-level modeling capabilities.
[0051] Table 1 Ablation experiment results
[0052]
[0053] In the table, backbone1 means replacing the backbone network in YOLOv8 with backbone1, and deleting the corresponding layers, while the main modules remain unchanged; backbone2 means replacing the backbone network in YOLOv8 with backbone2, and deleting the corresponding layers, while the main modules remain unchanged; backbone2-C3Ghost means replacing the last layer C2f in the YOLOv8 fusion module with the C3Ghost module; backbone2-C3Ghost-FLhead uses the FLhead detection head based on backbone2-C3Ghost; backbone2-C3Ghost-EMA-FLhead adds the EMA attention module to the fusion network based on backbone2-C3Ghost.
[0054] In order to prove the feasibility of the lightweight underwater small target detection method proposed in the present invention, the public DUO dataset after deleting the heavy data and re-labeling the incorrect labels in the underwater machine detection competition URPC is trained, and compared with the YOLOv8-n model. The ablation experiment proves that the lightweight backbone network, dual-tower PAN fusion network and lightweight FLhead detection head of the present invention have higher detection effect, with only 0.59M parameters and mAP50 as high as 83%, which is only 0.4% lower than the YOLOv8-n model.
[0055] The above is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technician familiar with this profession can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent replacement and improvement made to the above embodiments without departing from the content of the technical solution of the present invention, based on the technical essence of the present invention, within the spirit and principles of the present invention, still fall within the protection scope of the technical solution of the present invention.
Claims
1. A novel lightweight underwater small target detection method, characterized in that: Specifically include: Step 1: Collect underwater small target datasets or use public underwater datasets; Step 2: Preprocess the underwater data set, including scaling, translation, enhancement, and denoising, and calibrate the data set; Step 3: Input the preprocessed data set into the new lightweight underwater small target detection network. The input image is passed through the lightweight multi-scale feature extraction backbone network to extract multi-scale feature information, and then the dual-tower PAN feature fusion network is used to fuse the deep semantic information and the underlying position information at multiple scales. Finally, the lightweight coupled detection head detects and classifies objects with pixel sizes of 4×4, 8×8, and 16×16 or larger. Step 4: Evaluate and analyze the network model and compare it with the YOLOv8-n model.
2. A novel lightweight underwater small target detection method according to claim 1, characterized in that: The lightweight multi-scale feature extraction backbone network consists of one Stem Layer and three Stage Layers. The Stem Layer uses ordinary 3×3 stride convolution, and the Stage Layer uses a combination of 3×3 convolution with a stride of 2 and the CSPBottleneck module. The CSPBottleneck module uses the C2f module with better performance and the lightweight C3Ghost module, which can greatly reduce the number of model parameters.
3. A novel lightweight underwater small target detection method according to claim 1, characterized in that: The deep semantic information and the underlying location information are fused at multiple scales through the dual-tower PAN feature fusion network, including: Step a: The semantic information of the deep network extracted by the backbone is passed to the shallow network in a top-down manner, and the feature maps of different scales on the three-stage layer of the backbone are fused; Step b: pass the underlying location information to the deep network in a bottom-down manner.
4. A novel lightweight underwater small target detection method according to claim 1, characterized in that: In step 3, the lightweight coupled detection head has the ability to model pixel-level spatial information. The detection head uses two layers of 1×1 CBF modules and one 1×1 convolution for detection and classification respectively.
Citation Information
Patent Citations
Solar cell panel defect detection method and system
CN115861223A
Improved YOLOv5 lightweight community scene pedestrian detection method
CN115862066A
Airport scene monitoring image target detection method based on YOLO framework
CN116630876A
Online lecture attending behavior detection and recognition technology based on multi-dimensional information fusion
CN117456421A
Automatic generation and detection method for whole PCB cutting path based on YOLOv8 algorithm
CN117593319A
Cited By
Unmanned aerial vehicle-oriented small target detection system and method based on YOLOv8s improved model, medium and equipment
CN119888542A
Shared weight optimization-based target detection lightweight algorithm suitable for unmanned bathyscaph
CN121884096A
