# A Novel Attention-Based Lightweight Network for Multiscale Object Detection in Underwater Images

Authors: Jinkang Wang; Xiaohui He; Faming Shao; Guanlin Lu; Qunyan Jiang; Ruizhe Hu; Jinxin Li
Journal: Journal of Sensors
 (2022)

---

## Abstract

Underwater images have low quality, and underwater targets have different sizes. The mainstream target detection networks cannot achieve good results in detecting objects from underwater images. In this study, a lightweight underwater multiscale target detection model with an attention mechanism is designed to solve the above problems. In this model, MobileNetv3 is used as the backbone network for preliminary feature extraction. The lightweight feature extraction module (LFEM) pays attention to the feature map at the channel and space levels. The features with large weights are promoted, while the features with small weights are suppressed. Meanwhile, cross-group information exchange enriches the semantic information and location information of the objects. The context aggregation module (CIAM) pools the extracted feature maps to obtain feature pyramids, and it uses the upsampling-feature refinement-cascade addition (URC) method to effectively fuse global context information and enhance the feature representation. The scale normalization for feature pyramids (SNFP) performs adaptive multiscale perception and multianchor detection on feature maps to cover objects of different sizes and realize multiscale object detection in underwater images. The proposed network can realize lightweight feature extraction, effectively handle the global relationship between the underwater scene and the object while expanding the receptive field, traverse the objects of different scales, and achieve adaptive multianchor detection of multiscale objects in underwater images. The experimental results indicate that our method achieves an average accuracy of 81.94% and a detection speed of 44.3 FPS on a composite dataset. Also, our method is better than the mainstream object detection networks in terms of detection accuracy, lightweight design, and real-time performance.


---

## Body

## 1. Introduction

With the rapid growth of the world population and the increasing shortage of available inland resources, the rich biological and mineral resources in the ocean become important for human survival in the future. In the process of ocean exploration and research, underwater object detection from underwater images plays an important role in underwater applications such as military operations, resource exploration, environmental protection, and biological research.Underwater object detection can be combined with an underwater robot to monitor and search the interested targets with the assistance of the underwater camera, which has important research value and application prospects. As a branch of computer vision, underwater object detection based on optical images has become a new research field in ocean exploration.In the complex imaging environment, the quality of underwater images taken by underwater cameras deteriorates due to factors such as illumination, medium, wavelength, and vibration [1]. This has a great influence on the accuracy of target detection. Underwater objects have various scales, and the semantic information of large-scale objects is in deep feature maps. However, the detailed information of small-scale objects will gradually decrease or even be lost during the downsampling process. This makes the task of underwater image object detection more difficult. The existing methods improve the detection effect of multiscale objects by fusing features and constructing complex networks, which improves the detection accuracy at the cost of detection efficiency. Meanwhile, the real-time performance of underwater object detection is greatly reduced. Improving the detection efficiency while improving the detection accuracy is an urgent problem to be solved in underwater object detection.Aiming at the above problems, this paper proposes an attention-based lightweight model for multiscale object detection. The lightweight feature extraction module (LFEM) adopts dual attention to pay attention to the feature map at the channel level [2] and spatial level [3], and it uses “channel shuffle” [4] to exchange information across groups to enrich semantic information of multiscale objects. The context aggregation module (CIAM) uses different scales of pooling to obtain feature pyramids, and it adopts the original upsampling-feature refinement-cascade addition module (URC) to obtain both global semantic information and local detail information. The scale normalization for the feature pyramid (SNFP) module performs adaptive multiscale perception and multianchor detection on feature maps of different sizes to realize multiscale object detection in underwater images. Experimental results show that our proposed method outperforms current mainstream methods in terms of average accuracy, speed, and resource consumption.The contributions of this paper are summarized as follows:(1)
Aiming at the problems faced by underwater image object detection, a lightweight feature extraction module is proposed, which can effectively extract feature-layer information while reducing model parameters and improving detection efficiency(2)
In the CIAM module, the strategy of “upsampling-feature refinement-cascade addition” is proposed to increase the receptive field and improve the network’s ability to obtain global context information(3)
To obtain a better detection effect, SNFP is proposed to perform adaptive multiscale perception and multianchor detection of different scales(4)
The experimental results show that our proposed network on the datasets RUIE, HabCam UID, and SQUID achieves better performance than the current mainstream methods


## 2. Related Works

The current object detection technology is very mature, and underwater image target detection is developing rapidly as a new branch of object detection. Balancing detection accuracy and speed is a research hotspot of underwater object detection [5]. The quality of underwater images is seriously degraded, and the size of underwater targets varies greatly. In addition, underwater object detection has relatively high real-time requirements. How to perform accurate, fast, and stable detection of multiscale targets in complex underwater scenes is worth studying.


### 2.1. Object Detection

According to the presence or absence of candidate frame generation stages, object detection methods based on deep learning can be divided into two-stage object detection methods and single-stage object detection methods. The two-stage object detection methods, such as R-CNN [6], Fast R-CNN [7], and Faster R-CNN [8], first extract candidate regions and then perform secondary correction based on the candidate regions to obtain the detection results. The detection accuracy is high, but the detection speed is slow due to a large number of convolution operations. The single-stage object detection methods, such as SSD [9] and YOLO series [10–13], do not need to extract candidate frames, which directly calculate the images to generate the detection results. The detection speed is fast, but the detection accuracy is low. Some researchers combined the two types of methods to balance detection accuracy and speed. RON [14] is an efficient and general object detection model proposed based on SSD and Faster R-CNN. The experimental results indicate that RON achieves much higher detection accuracy than SSD under the same condition, and the detection speed is three times faster than that of faster R-CNN. RefineDet [15] integrates RPN, FPN [16], and SSD algorithms, which improves the detection accuracy on the PASCAL VOC 2007 dataset [17] to 80.0% while maintaining the efficiency of SSD. RetinaNet [18] combines FPN and FCN networks and adopts an improved cross-entropy focal loss to effectively eliminate the problem of class imbalance. STDN [19] proposes a scale-transfer layer to generate large-scale feature maps without increasing the number of parameters and computation amount, which improves the detection efficiency.In recent years, the field of underwater image object detection based on deep learning has also developed rapidly. Chen et al. [20] designed SWIPENet to detect underwater small-sample objects. SWIPENet uses a sample reweighting algorithm IMA and introduces a dilated convolutional layer to obtain a large receptive area without sacrificing the resolution of the feature map. Lin et al. [21] proposed an image enhancement method based on candidate box fusion to generate training samples that simulate overlapping, occlusion, and blurring, which improves the mean average precision (mAP) and robustness of the model. Zheng et al. [22] first enhanced the image for better contrast and then separated objects and backgrounds to improve object detection performance. Zeng et al. [23] proposed Faster R-CNN-AON, in which the Faster R-CNN network and the AON [24] network compete and learn together so that the detection network can obtain better robustness, which effectively prevents the detection network from overfitting and greatly improves the detection accuracy.


### 2.2. Lightweight Module

The deep object detection network usually contains a large number of parameters, which requires huge storage space and running space to complete the detection task. To migrate the underwater image object detection algorithm from the server to the mobile terminal, it is urgent to lightweight the object detection model.MobileNetv1 [25] divides the convolution of the standard object detection network structure into a depth-wise separable convolution and a point-wise convolution, which reduces the network weight parameters and the model calculation amount and improves the calculation speed. MobileNetv2 [26] uses linear bottlenecks to remove the nonlinear activation layer behind the small-dimensional output layer and adopts the inverted residual strategy, which greatly improves the model effect. Based on the combination of the depth-wise separable convolution of MobileNetv1 and the linear bottleneck and inverse residual structure of MobileNetv2, MobileNetv3 [27] introduces the SE attention module and updates the activation function to make the convolutional neural network more lightweight. ShuffleNet v2 [28] uses the channel shuffle method to shuffle the order of each feature map to form a new feature map to achieve cross-group information exchange. Ghostnet [29] uses simple linear operations to obtain redundant feature maps to enhance features and increase channels, which greatly reduces the computation amount and improves computational efficiency.Lightweight models are common in conventional object detection, but there are few studies on underwater image object detection. This study combines the characteristics of different lightweight models and transforms them. Meanwhile, a lightweight feature extraction module is proposed to improve the real-time performance of underwater image object detection.


### 2.3. Multiscale Fusion

The scale problem of object detection always affects the detection effect, and the accuracy of detecting extremely large or small objects will be significantly reduced. Many effective network frameworks have been designed for multiscale detection.The image pyramid scales images at different scales, randomly trains images of different scales, and forces the neural network to adapt to objects of different scales, which preliminary improves detection results. SNIP [30] achieves selective training by selectively returning gradients, reducing the impact of domain shift, and achieving better detection results for objects of extreme sizes. Based on SNIP, SNIPER [31] only processes context regions around ground-truth instances on the image pyramid, and the training speed is increased by three times. FPN [16] upsamples each layer from top to bottom, and it combines high-level features of deep convolutional layers with low-level features of shallow convolutional layers to obtain more accurate pixel position information; PANet [32] creates a bottom-up feature refusion side path based on FPN and reconstructs a pyramid that strengthens spatial information, which makes full use of the information of each feature layer; the SPP [33] module adopts the multiscale block method of SPM [34] and performs pooling operations on each block to convert the feature maps of any size into a fixed-length feature vector. ASPP [35] uses atrous convolution to build convolution kernels with different receptive fields to obtain rich multiscale object information. To simulate the receptive field structure of the human visual system as much as possible, RFBNet [36] integrates the characteristics of the Inception module [37] and the ASPP module. This greatly improves the accuracy while ensuring the detection speed.Underwater images not only have large differences in object size but also have a large number of small objects. Comprehensively considering detection speed and accuracy, this paper proposes SNFP, which combines the advantages of SNIP and FPN and performs adaptive multiscale perception and multianchor detection of different scales.


## 2.1. Object Detection

According to the presence or absence of candidate frame generation stages, object detection methods based on deep learning can be divided into two-stage object detection methods and single-stage object detection methods. The two-stage object detection methods, such as R-CNN [6], Fast R-CNN [7], and Faster R-CNN [8], first extract candidate regions and then perform secondary correction based on the candidate regions to obtain the detection results. The detection accuracy is high, but the detection speed is slow due to a large number of convolution operations. The single-stage object detection methods, such as SSD [9] and YOLO series [10–13], do not need to extract candidate frames, which directly calculate the images to generate the detection results. The detection speed is fast, but the detection accuracy is low. Some researchers combined the two types of methods to balance detection accuracy and speed. RON [14] is an efficient and general object detection model proposed based on SSD and Faster R-CNN. The experimental results indicate that RON achieves much higher detection accuracy than SSD under the same condition, and the detection speed is three times faster than that of faster R-CNN. RefineDet [15] integrates RPN, FPN [16], and SSD algorithms, which improves the detection accuracy on the PASCAL VOC 2007 dataset [17] to 80.0% while maintaining the efficiency of SSD. RetinaNet [18] combines FPN and FCN networks and adopts an improved cross-entropy focal loss to effectively eliminate the problem of class imbalance. STDN [19] proposes a scale-transfer layer to generate large-scale feature maps without increasing the number of parameters and computation amount, which improves the detection efficiency.In recent years, the field of underwater image object detection based on deep learning has also developed rapidly. Chen et al. [20] designed SWIPENet to detect underwater small-sample objects. SWIPENet uses a sample reweighting algorithm IMA and introduces a dilated convolutional layer to obtain a large receptive area without sacrificing the resolution of the feature map. Lin et al. [21] proposed an image enhancement method based on candidate box fusion to generate training samples that simulate overlapping, occlusion, and blurring, which improves the mean average precision (mAP) and robustness of the model. Zheng et al. [22] first enhanced the image for better contrast and then separated objects and backgrounds to improve object detection performance. Zeng et al. [23] proposed Faster R-CNN-AON, in which the Faster R-CNN network and the AON [24] network compete and learn together so that the detection network can obtain better robustness, which effectively prevents the detection network from overfitting and greatly improves the detection accuracy.


## 2.2. Lightweight Module

The deep object detection network usually contains a large number of parameters, which requires huge storage space and running space to complete the detection task. To migrate the underwater image object detection algorithm from the server to the mobile terminal, it is urgent to lightweight the object detection model.MobileNetv1 [25] divides the convolution of the standard object detection network structure into a depth-wise separable convolution and a point-wise convolution, which reduces the network weight parameters and the model calculation amount and improves the calculation speed. MobileNetv2 [26] uses linear bottlenecks to remove the nonlinear activation layer behind the small-dimensional output layer and adopts the inverted residual strategy, which greatly improves the model effect. Based on the combination of the depth-wise separable convolution of MobileNetv1 and the linear bottleneck and inverse residual structure of MobileNetv2, MobileNetv3 [27] introduces the SE attention module and updates the activation function to make the convolutional neural network more lightweight. ShuffleNet v2 [28] uses the channel shuffle method to shuffle the order of each feature map to form a new feature map to achieve cross-group information exchange. Ghostnet [29] uses simple linear operations to obtain redundant feature maps to enhance features and increase channels, which greatly reduces the computation amount and improves computational efficiency.Lightweight models are common in conventional object detection, but there are few studies on underwater image object detection. This study combines the characteristics of different lightweight models and transforms them. Meanwhile, a lightweight feature extraction module is proposed to improve the real-time performance of underwater image object detection.


## 2.3. Multiscale Fusion

The scale problem of object detection always affects the detection effect, and the accuracy of detecting extremely large or small objects will be significantly reduced. Many effective network frameworks have been designed for multiscale detection.The image pyramid scales images at different scales, randomly trains images of different scales, and forces the neural network to adapt to objects of different scales, which preliminary improves detection results. SNIP [30] achieves selective training by selectively returning gradients, reducing the impact of domain shift, and achieving better detection results for objects of extreme sizes. Based on SNIP, SNIPER [31] only processes context regions around ground-truth instances on the image pyramid, and the training speed is increased by three times. FPN [16] upsamples each layer from top to bottom, and it combines high-level features of deep convolutional layers with low-level features of shallow convolutional layers to obtain more accurate pixel position information; PANet [32] creates a bottom-up feature refusion side path based on FPN and reconstructs a pyramid that strengthens spatial information, which makes full use of the information of each feature layer; the SPP [33] module adopts the multiscale block method of SPM [34] and performs pooling operations on each block to convert the feature maps of any size into a fixed-length feature vector. ASPP [35] uses atrous convolution to build convolution kernels with different receptive fields to obtain rich multiscale object information. To simulate the receptive field structure of the human visual system as much as possible, RFBNet [36] integrates the characteristics of the Inception module [37] and the ASPP module. This greatly improves the accuracy while ensuring the detection speed.Underwater images not only have large differences in object size but also have a large number of small objects. Comprehensively considering detection speed and accuracy, this paper proposes SNFP, which combines the advantages of SNIP and FPN and performs adaptive multiscale perception and multianchor detection of different scales.


## 3. Overview of Recommended Methods

To solve the difficulties encountered in the process of underwater image multiscale object detection, this paper proposes a new lightweight object detection network, and the algorithm flow is shown in Figure1. First, the original underwater image is preliminarily extracted by MobileNetv3. Then, LFEM pays attention to the feature map at the channel and spatial levels, respectively, and it realizes cross-group communication of the feature information through channel shuffle. Next, CIAM pools the extracted feature maps to obtain feature pyramids, and it fuses feature maps of different scales using the original URC method to effectively fuse global context information and enhance feature representation ability. Finally, the SNFP performs adaptive multiscale perception and multianchor detection on feature maps of different sizes to cover objects of different sizes and realize multiscale object detection in underwater images. According to the characteristics of underwater images, our proposed network achieves lightweight feature extraction, effectively handles the global relationship between the scene and the objects while expanding the receptive field, and performs adaptive multianchor box detection for objects with large-scale differences. Based on this, the proposed method can effectively detect multiscale objects in different water scenes.Figure 1
The pipelines of our method.


### 3.1. Lightweight Feature Extraction Module

The traditional feature extraction network usually consists of a large number of convolutions, which consumes huge computing resources and has poor real-time detection performance. To avoid this problem, this paper designs a lightweight feature extraction module for underwater images, and its structure is shown in Figure2.Figure 2
The structure of the lightweight feature extraction module.


#### 3.1.1. Depth-Wise Separable Convolution and Point-Wise Convolution

Depth-wise separable convolution splits convolution kernel into single channel form and convolutes each channel without changing the depth of the feature map. Point-wise convolution uses a1×1 convolution kernel to fuse the feature maps obtained in depth-wise separable convolution to solve the problem of unsmooth information exchange between feature maps. In depth-wise separable convolution, one convolution kernel is only responsible for one channel. Assume that there are M input features, N output features, the input feature size is DF, and M convolution kernels of Dk×Dk are required. To output N characteristic maps, point-wise convolution uses N1×1 convolution kernels for convolution. The ratio of the amount of calculation with the standard convolution is
(1)Dk⋅Dk⋅M⋅DF⋅DF+M⋅N⋅DF⋅DFDK⋅DK⋅M⋅N⋅DF⋅DF=1N+1DK2.The ratio of the number of parameters is(2)Dk⋅Dk⋅M+M⋅NDk⋅Dk⋅M⋅N=1N+1DK2.Compared with general convolution, whenDk and N are large, depth-wise separable convolution and point-wise convolution have great advantages in terms of parameter size and calculation speed.


#### 3.1.2. Double Attention Mechanism

The parallel dual attention mechanism extracts and retains key information. The channel attention network captures channels containing important object feature information and assigns large weight values to these channels. The feature map is compressed by global pooling to generate aC-dimensional feature vector, which is then processed by the full connection layer fCA. The feature vector is mapped to the range of 0,1 by a sigmoid gate function, and weighting operations are performed finally. The calculation process is shown in
(3)CA=Fv,W=σ1fc2δfc1v,W1,W2,(4)f~CA=CA×fCA,where W represents the weight parameter that needs to be updated, v represents the C-dimension feature vector, σ1 represents the sigmoid activation operation, fc represents the fully connected layer, δ represents the Relu activation function, and f~CA represents the weighted feature map.The function of spatial attention is to capture local regions in feature maps that contain important detail information. The feature map is passed through two parallel asymmetric convolutional layers, and the output is added along the channel direction. Finally, the feature values are mapped to the range of0,1 by the sigmoid gate function, and then, weighting operations are performed. The calculation process is shown in
(5)C1=conv2conv1Y,U11,U12,(6)C2=conv1conv2Y,U21,U22,(7)SA=FY,U=σ2C1+C2,(8)f~SA=SA×fSA,where U represents the convolution kernel parameter, conv1 and conv2 represent the asymmetric convolution layer, respectively, Y represents the input feature map, σ2 represents the sigmoid activation operation, and f~SA represents the weighted feature map.In general, channel attention focuses on “what” is an effective feature that requires specific attention, and spatial attention focuses on “which” is the most informative feature. The dual attention mechanism can purify the features adaptively while extracting and retaining key features.


#### 3.1.3. Channel Shuffle

As shown in Figure2, channel shuffle is used to rearrange the feature maps generated by the two attention networks to realize cross-group information exchange and form a complete feature map of the same size as the original feature map. Cross-group information exchange makes feature extraction more sufficient and greatly improves the feature utilization efficiency of small-scale objects.


### 3.2. Context Information Aggregation Module

For underwater images, low resolution leads to unclear feature expression. Under the layer-by-layer convolution, the details of the feature map are missing, and the correlation between pixels is gradually weakened, which makes it difficult to obtain scene context information. To aggregate the context information of different areas and improve the ability of the network to obtain global information, this paper designs the context information aggregation module, as shown in Figure3. The original feature map is pooled with different scales to obtain the feature pyramid. Then, the feature maps with different scales are fused by the URC module to consider global semantic information and local detail information and enhance feature representation ability.Figure 3
The structure of CIAM.The context information aggregation module uses a PPM-like method to obtain feature maps of different sizes. The input feature map size is6×6, and it is pooled by 6×6, 3×3, 2×2, and 1×1 to obtain feature maps with the output sizes of 1×1, 2×2, 3×3, and 6×6, respectively. These feature maps of different sizes contain context information of different areas. As shown in Figure 3, feature map F1 is upsampled by bilinear interpolation to increase the resolution. Then, the feature map with increased resolution is refined by atrous convolution with a rate of 2 and added with the feature map F2 pixel-by-pixel to complete the first information fusion between feature maps. The above operation is repeated until the feature map F4 is upsampled to the original feature map size. Subsequently, the output feature map and the original feature map are spliced in the channel dimension, which not only increases the receptive field but also greatly improves the ability of the network to obtain global context information. Finally, the context information aggregation module merges the deep semantic information with the shallow edge line, shape position, and other detailed information, which helps to capture clear object boundary information, refine segmentation results and effectively improve object segmentation accuracy.To intuitively show the effectiveness of CIAM, the comparison results with the four most advanced classical segmentation methods are presented in Figure4. From the left to right are the original images, the enhanced images, and the results generated by Deeplab V3+ [38], DFANet [39], APCNet [40], STDC-Seg [41], our method, and the ground truth. It can be seen from the experimental results that the proposed context information aggregation module performs the best in terms of segmentation integrity, positioning accuracy, and boundary definition and details, which will contribute to better underwater target detection performance.Figure 4
Qualitative comparisons with the four most advanced classical segmentation methods. From the left to right are the original images, the enhanced images, and the results generated by Deeplab V3+, DFANet, APCNet, STDC-Seg, CIAM, and the ground truth.
(a)(b)(c)(d)


### 3.3. SNFP

Aiming at the difficulty of multiscale object detection in underwater images, this paper designs SNFP for adaptive multiscale prediction and multianchor detection of objects of different scales. Firstly, RPN extracts candidate regions for feature maps of different layers. For a large-scale feature map, the corresponding RPN is only responsible for predicting the magnified small objects, and the original large objects are no longer in the effective range because they are too big. For the small-scale feature map, the corresponding RPN is only responsible for predicting the decreased large objects, and the original small objects are no longer in the effective range because they are too small. RCN extracts anchor frames of different scales on feature layers of different scales, and it displays all the anchor frames on the normalized feature map. Finally, the object detection result is output through nonmaximum suppression, as shown in Figure5.Figure 5
The structure of SNFP.


## 3.1. Lightweight Feature Extraction Module

The traditional feature extraction network usually consists of a large number of convolutions, which consumes huge computing resources and has poor real-time detection performance. To avoid this problem, this paper designs a lightweight feature extraction module for underwater images, and its structure is shown in Figure2.Figure 2
The structure of the lightweight feature extraction module.


### 3.1.1. Depth-Wise Separable Convolution and Point-Wise Convolution

Depth-wise separable convolution splits convolution kernel into single channel form and convolutes each channel without changing the depth of the feature map. Point-wise convolution uses a1×1 convolution kernel to fuse the feature maps obtained in depth-wise separable convolution to solve the problem of unsmooth information exchange between feature maps. In depth-wise separable convolution, one convolution kernel is only responsible for one channel. Assume that there are M input features, N output features, the input feature size is DF, and M convolution kernels of Dk×Dk are required. To output N characteristic maps, point-wise convolution uses N1×1 convolution kernels for convolution. The ratio of the amount of calculation with the standard convolution is
(1)Dk⋅Dk⋅M⋅DF⋅DF+M⋅N⋅DF⋅DFDK⋅DK⋅M⋅N⋅DF⋅DF=1N+1DK2.The ratio of the number of parameters is(2)Dk⋅Dk⋅M+M⋅NDk⋅Dk⋅M⋅N=1N+1DK2.Compared with general convolution, whenDk and N are large, depth-wise separable convolution and point-wise convolution have great advantages in terms of parameter size and calculation speed.


### 3.1.2. Double Attention Mechanism

The parallel dual attention mechanism extracts and retains key information. The channel attention network captures channels containing important object feature information and assigns large weight values to these channels. The feature map is compressed by global pooling to generate aC-dimensional feature vector, which is then processed by the full connection layer fCA. The feature vector is mapped to the range of 0,1 by a sigmoid gate function, and weighting operations are performed finally. The calculation process is shown in
(3)CA=Fv,W=σ1fc2δfc1v,W1,W2,(4)f~CA=CA×fCA,where W represents the weight parameter that needs to be updated, v represents the C-dimension feature vector, σ1 represents the sigmoid activation operation, fc represents the fully connected layer, δ represents the Relu activation function, and f~CA represents the weighted feature map.The function of spatial attention is to capture local regions in feature maps that contain important detail information. The feature map is passed through two parallel asymmetric convolutional layers, and the output is added along the channel direction. Finally, the feature values are mapped to the range of0,1 by the sigmoid gate function, and then, weighting operations are performed. The calculation process is shown in
(5)C1=conv2conv1Y,U11,U12,(6)C2=conv1conv2Y,U21,U22,(7)SA=FY,U=σ2C1+C2,(8)f~SA=SA×fSA,where U represents the convolution kernel parameter, conv1 and conv2 represent the asymmetric convolution layer, respectively, Y represents the input feature map, σ2 represents the sigmoid activation operation, and f~SA represents the weighted feature map.In general, channel attention focuses on “what” is an effective feature that requires specific attention, and spatial attention focuses on “which” is the most informative feature. The dual attention mechanism can purify the features adaptively while extracting and retaining key features.


### 3.1.3. Channel Shuffle

As shown in Figure2, channel shuffle is used to rearrange the feature maps generated by the two attention networks to realize cross-group information exchange and form a complete feature map of the same size as the original feature map. Cross-group information exchange makes feature extraction more sufficient and greatly improves the feature utilization efficiency of small-scale objects.


## 3.1.1. Depth-Wise Separable Convolution and Point-Wise Convolution

Depth-wise separable convolution splits convolution kernel into single channel form and convolutes each channel without changing the depth of the feature map. Point-wise convolution uses a1×1 convolution kernel to fuse the feature maps obtained in depth-wise separable convolution to solve the problem of unsmooth information exchange between feature maps. In depth-wise separable convolution, one convolution kernel is only responsible for one channel. Assume that there are M input features, N output features, the input feature size is DF, and M convolution kernels of Dk×Dk are required. To output N characteristic maps, point-wise convolution uses N1×1 convolution kernels for convolution. The ratio of the amount of calculation with the standard convolution is
(1)Dk⋅Dk⋅M⋅DF⋅DF+M⋅N⋅DF⋅DFDK⋅DK⋅M⋅N⋅DF⋅DF=1N+1DK2.The ratio of the number of parameters is(2)Dk⋅Dk⋅M+M⋅NDk⋅Dk⋅M⋅N=1N+1DK2.Compared with general convolution, whenDk and N are large, depth-wise separable convolution and point-wise convolution have great advantages in terms of parameter size and calculation speed.


## 3.1.2. Double Attention Mechanism

The parallel dual attention mechanism extracts and retains key information. The channel attention network captures channels containing important object feature information and assigns large weight values to these channels. The feature map is compressed by global pooling to generate aC-dimensional feature vector, which is then processed by the full connection layer fCA. The feature vector is mapped to the range of 0,1 by a sigmoid gate function, and weighting operations are performed finally. The calculation process is shown in
(3)CA=Fv,W=σ1fc2δfc1v,W1,W2,(4)f~CA=CA×fCA,where W represents the weight parameter that needs to be updated, v represents the C-dimension feature vector, σ1 represents the sigmoid activation operation, fc represents the fully connected layer, δ represents the Relu activation function, and f~CA represents the weighted feature map.The function of spatial attention is to capture local regions in feature maps that contain important detail information. The feature map is passed through two parallel asymmetric convolutional layers, and the output is added along the channel direction. Finally, the feature values are mapped to the range of0,1 by the sigmoid gate function, and then, weighting operations are performed. The calculation process is shown in
(5)C1=conv2conv1Y,U11,U12,(6)C2=conv1conv2Y,U21,U22,(7)SA=FY,U=σ2C1+C2,(8)f~SA=SA×fSA,where U represents the convolution kernel parameter, conv1 and conv2 represent the asymmetric convolution layer, respectively, Y represents the input feature map, σ2 represents the sigmoid activation operation, and f~SA represents the weighted feature map.In general, channel attention focuses on “what” is an effective feature that requires specific attention, and spatial attention focuses on “which” is the most informative feature. The dual attention mechanism can purify the features adaptively while extracting and retaining key features.


## 3.1.3. Channel Shuffle

As shown in Figure2, channel shuffle is used to rearrange the feature maps generated by the two attention networks to realize cross-group information exchange and form a complete feature map of the same size as the original feature map. Cross-group information exchange makes feature extraction more sufficient and greatly improves the feature utilization efficiency of small-scale objects.


## 3.2. Context Information Aggregation Module

For underwater images, low resolution leads to unclear feature expression. Under the layer-by-layer convolution, the details of the feature map are missing, and the correlation between pixels is gradually weakened, which makes it difficult to obtain scene context information. To aggregate the context information of different areas and improve the ability of the network to obtain global information, this paper designs the context information aggregation module, as shown in Figure3. The original feature map is pooled with different scales to obtain the feature pyramid. Then, the feature maps with different scales are fused by the URC module to consider global semantic information and local detail information and enhance feature representation ability.Figure 3
The structure of CIAM.The context information aggregation module uses a PPM-like method to obtain feature maps of different sizes. The input feature map size is6×6, and it is pooled by 6×6, 3×3, 2×2, and 1×1 to obtain feature maps with the output sizes of 1×1, 2×2, 3×3, and 6×6, respectively. These feature maps of different sizes contain context information of different areas. As shown in Figure 3, feature map F1 is upsampled by bilinear interpolation to increase the resolution. Then, the feature map with increased resolution is refined by atrous convolution with a rate of 2 and added with the feature map F2 pixel-by-pixel to complete the first information fusion between feature maps. The above operation is repeated until the feature map F4 is upsampled to the original feature map size. Subsequently, the output feature map and the original feature map are spliced in the channel dimension, which not only increases the receptive field but also greatly improves the ability of the network to obtain global context information. Finally, the context information aggregation module merges the deep semantic information with the shallow edge line, shape position, and other detailed information, which helps to capture clear object boundary information, refine segmentation results and effectively improve object segmentation accuracy.To intuitively show the effectiveness of CIAM, the comparison results with the four most advanced classical segmentation methods are presented in Figure4. From the left to right are the original images, the enhanced images, and the results generated by Deeplab V3+ [38], DFANet [39], APCNet [40], STDC-Seg [41], our method, and the ground truth. It can be seen from the experimental results that the proposed context information aggregation module performs the best in terms of segmentation integrity, positioning accuracy, and boundary definition and details, which will contribute to better underwater target detection performance.Figure 4
Qualitative comparisons with the four most advanced classical segmentation methods. From the left to right are the original images, the enhanced images, and the results generated by Deeplab V3+, DFANet, APCNet, STDC-Seg, CIAM, and the ground truth.
(a)(b)(c)(d)


## 3.3. SNFP

Aiming at the difficulty of multiscale object detection in underwater images, this paper designs SNFP for adaptive multiscale prediction and multianchor detection of objects of different scales. Firstly, RPN extracts candidate regions for feature maps of different layers. For a large-scale feature map, the corresponding RPN is only responsible for predicting the magnified small objects, and the original large objects are no longer in the effective range because they are too big. For the small-scale feature map, the corresponding RPN is only responsible for predicting the decreased large objects, and the original small objects are no longer in the effective range because they are too small. RCN extracts anchor frames of different scales on feature layers of different scales, and it displays all the anchor frames on the normalized feature map. Finally, the object detection result is output through nonmaximum suppression, as shown in Figure5.Figure 5
The structure of SNFP.


## 4. Experimental Analysis

### 4.1. Dataset

Experiment is evaluated on three public datasets: RUIE [42], HabCam UID [43], and UIEBD [44]. RUIE is a self-made dataset of the Dalian University of Science and Technology. It consists of 4000 low-resolution underwater images, including underwater targets such as scallop, holothurian, and sea urchin. The HabCam UID dataset is produced by CVPR AAMVEM studio, which consists of 10,465 underwater images with a resolution of 2720×1024. It contains over 100,000 instances of underwater objects such as fish, scallop, rock, manta ray, and turtle, which is the largest and most diversified underwater image dataset recently released for target detection. The UIEBD dataset contains 950 underwater images of various multiresolution underwater scenes, including diver, sculpture, and other marine life. The three datasets are merged by using the resize operation to cluster the pixels of the large-resolution images and interpolate the pixels of the small-resolution images. To some extent, the image information is extracted, and the pixels are rearranged to the resolution of 512×512. The merged dataset is called CUID (Composite Underwater Image Dataset), and the ratio of the training set to the testing set is 4 : 1. The instance sizes of the CUID dataset are counted, as shown in Figure 6. The small object pixel is within 100×100, the medium object pixel is between 100×100 and 300×300, and the large object pixel is larger than 300×300. The number distribution of each type of object is shown in Figure 7.Figure 6
Instance size distribution of the CUID dataset.Figure 7
Instance number distribution of the CUID dataset.


### 4.2. Experimental Setting

Our experimental environment is shown in Table1. The experiment was conducted on a computer equipped with Intel Core i7-6700U @ 4.00 GHz, NVIDIA GeForce RTX 3090 Ti, 8 GB DDR3 memory, and running Windows 10 64-bit operating system. Experiments were implemented on the PyTorch software. The version of CUDA is 10.1, the version of PyTorch is 1.5.0, and the version of Python is v3.6. Our method is accelerated on GPU.Table 1
The experimental environment configuration.
EnvironmentVersion modelOperating systemWindows 10 64-bitCPUIntel i7-6700U 4.00 GHzGPUNVIDIA RTX 3090 TiCUDAV10.1PyTorchV1.5.0PythonV3.6The network uses the SGD [60] optimization strategy with a momentum parameter of 0.95. The learning rate was set to 0.0001, and it then dropped evenly to 0.00001. The batch size was set to 32, the confidence threshold was set to 0.5, and the IOU threshold was set to 0.4. Besides, the dropout was set to 0.5 to prevent overfitting, and the number of training iterations of CUOID was set to 200,000 times.


### 4.3. Evaluation Indicators

This study adopts AP and mAP as evaluation indicators. The ground truth is obtained through manual annotation. The confusion matrix is shown in Figure8.Figure 8
The confusion matrix.Recall is the ratio of true-positive samples to the sum of true-positive samples and false-negative samples, and its calculation is shown in formula (9). Precision is the ratio of true-positive samples to the sum of true-positive samples and false-positive samples, and its calculation is shown in formula (10).
(9)Recall=TPTP+FN,(10)Precision=TPTP+FP.AP represents the model’s average detection accuracy for a specific class of objects, and mAP is the average value of AP values under all categories. Their calculations are shown in(11)AP=∫01Prdr,(12)mAP=1Q∑q=1QAPq,where Pr represents the precision value on the P-R curve and AP is the integral calculation of the P-R curve. q represents a specific object class, and Q represents the number of object classes.


### 4.4. Experimental

#### 4.4.1. Objective Evaluation

Table2 shows the comparison of detection results on Yolov5, RON, RefineDet, STDN, SWIPENet, Faster R-CNN-AON, RFBNet, and our proposed method on the CUID dataset. From Table 2, it can be seen that our method achieves the highest AP value in the detection of objects such as holothurian, coral, rock, and octopus. The mAP among 15 categories of objects is 81.94%, which is better than the state-of-the-art methods. From the perspective of a single category of targets, coral, rock, and sculpture have the worst detection effect. The main reason is that corals cannot be clearly distinguished from rocks, resulting in many false detections. The reason for the poor detection effect of sculptures is that some humanoid sculptures are classified as divers.Table 2
Comparison of AP values of different methods. The short names are defined as HO—holothurian, BF—big fish, DI—diver, CO—coral, RO—rock, SC—sculpture, SF—small fish, OC—octopus, TU—turtle, SW—seaweed, MR—manta ray, SF—starfish, SH—shell, SU—sea urchin, and WR—wreckage. The best results are marked in bold.
MethodmAPHOBFDICOROSCSFOCTUSWMRSFSHSUWRYolov571.2772.8075.5476.1163.9264.5463.5769.4172.6173.3664.3975.4970.5369.3470.0267.37RON74.2671.9378.3277.2965.4767.1868.9572.8774.4975.0269.7178.3273.6874.3374.1670.12RefineDet75.0669.1777.0978.3168.7167.3470.1376.2976.3875.8570.2478.3774.9275.0675.1373.21STDN76.6773.2880.1477.4269.1867.9969.7178.5177.8976.9174.0677.9175.0374.9176.0174.88SWIPENet78.9170.3580.5980.5870.2669.4373.5579.4878.0178.2574.5779.3875.8679.0875.6475.61Faster R-CNN-AON79.6873.0184.4786.0371.2570.0573.6978.5279.6278.8475.2979.9478.6176.3178.3575.36RFBNet73.9970.6783.9282.6369.0467.3670.1976.1374.1773.9070.3774.0673.3170.9172.0570.91Ours81.9478.3383.9885.1473.3872.0173.3078.5780.8582.4175.1781.5481.0279.6380.2874.23To further compare the detection effects of objects of different scales, Table3 lists the performance of our method on the CUID dataset using the COCO indicator relative to Yolov5, RON, RefineDet, STDN, SWIPENet, Faster R-CNN-AON, and RFBNet. It can be seen from this table that the average detection accuracy of our method for small objects and large objects is the best, reaching 48.73% and 83.41%, respectively, which shows that the proposed method can well adapt to the scenario of multisize underwater objects and can accurately detect underwater objects of different scales. Meanwhile, our method also achieves the best detection effect under a stricter IOU, reaching 69.84% and 49.94% for AP50 and AP75, respectively, which can provide more accurate bounding boxes for multiscale objects.Table 3
Comparison of AP values of different methods for objects of different sizes. The best results are marked in bold.
MethodAPSAPMAPLAP50AP75Yolov540.0768.3175.3862.3443.64RON43.5772.4578.0365.1745.49RefineDet44.2173.4979.0765.4246.03STDN43.6174.0880.1566.3946.55SWIPENet45.8275.6381.4368.2148.08Faster R-CNN-AON46.2377.2681.5969.0049.20RFBNet42.4872.5277.2464.3844.61Ours48.7376.9083.4169.8449.94In terms of detection speed, Table4 shows the comparison results of parameters, model size, FLOPs, and FPS on Yolov5, RON, RefineDet, STDN, SWIPENet, Faster R-CNN-AON, RFBNet, and our proposed method on the CUID dataset. We can find that our method has fewer parameters, a smaller model size, and less computational resource consumption. Also, it has a relatively fast detection speed.Table 4
Comparison of the model size and real-time performance of different methods.
MethodBackboneInput sizeParameters (M)Model size (MB)FLOPs (G)FPSYolov5Darknet53416×4165.422.840.5772RONVGG16384×38431.9128.615.4715RefineDetVGG16320×32050.5200.218.9840.7STDNDenseNet169513×51329.5120.13.4128.6SWIPENetVGG16512×512~~~30Faster R-CNN-AONVGG161000×60084.1336.323.6724RFBNetVGG16300×30034.5140.045.4283OursMobileNetv3512×5127.831.221.7044.3Figure9 shows the P-R curves of detecting small, medium, and large objects and all objects on the CUID dataset. Obviously, our method can achieve the best results in detecting objects of various scales. In particular, when the recall rate is 0.5 to 0.7, the P-R curve of our method for detecting small objects is much higher than that of other detection networks. This indicates that when our method detects multiscale objects in underwater images with low image quality, the detection effect on small-scale objects is the most improved compared to other advanced methods. Overall, as a lightweight target detection network, our method can detect underwater multiscale targets quickly and effectively, and it achieves a good balance between detection accuracy and speed.Figure 9
Comparison of theP-R curves of detecting small, medium, large, and all objects on the CUID dataset.


#### 4.4.2. Subjective Evaluation

The visualization results of object detection on the CUID dataset are shown in Figures10 and 11. It can be seen from Figure 10 that compared with other advanced methods, our proposed method can effectively reduce the missed detection rate, especially for small-scale objects, such as the small fishes in the second picture and the divers in the third picture. Figure 11 shows the detection results of our method on some other images of the dataset. Our proposed method can successfully detect objects of different scales. This is because our method achieves scale-aware contextual information aggregation and reduces the loss of effective information at low resolutions, while SNFP achieves adaptive and accurate detection of objects of different scales.Figure 10
Visualization of the detection results on the CUID dataset compared with the state-of-the-art methods.Figure 11
Visualization of our proposed method on the CUID dataset.


### 4.5. Ablation Experiment

To prove the rationality of the three functional modules proposed in our method, an ablation experiment was conducted to verify the effect of each module on object detection performance. Table5 presents the ablation results of adding each module (namely, LFEM, CAM, and SNFP) to the MobileNetv3 framework. It can be seen that the adding of each module brings benefits to the whole network, especially the SNFP module, which can be seen from the comparison between model 3 and model 4. The network detection performance of model 5 is the highest, which indicates that the three modules are indispensable, and the combination of them leads to the best detection effect on underwater multiscale objects.Table 5
Comparison of detection performance of embedded different modules. The best results are marked in bold.
BaselineLFEMCAMSNFPAPSAPMAPLAP50AP75mAP✓40.0568.3069.2859.2739.5853.13✓✓41.1370.3472.3760.9141.2455.90✓✓✓44.9572.6577.7465.3246.8258.68✓✓✓42.8471.1875.4263.7144.3357.10✓✓✓✓48.7376.9083.4169.8449.9460.12


## 4.1. Dataset

Experiment is evaluated on three public datasets: RUIE [42], HabCam UID [43], and UIEBD [44]. RUIE is a self-made dataset of the Dalian University of Science and Technology. It consists of 4000 low-resolution underwater images, including underwater targets such as scallop, holothurian, and sea urchin. The HabCam UID dataset is produced by CVPR AAMVEM studio, which consists of 10,465 underwater images with a resolution of 2720×1024. It contains over 100,000 instances of underwater objects such as fish, scallop, rock, manta ray, and turtle, which is the largest and most diversified underwater image dataset recently released for target detection. The UIEBD dataset contains 950 underwater images of various multiresolution underwater scenes, including diver, sculpture, and other marine life. The three datasets are merged by using the resize operation to cluster the pixels of the large-resolution images and interpolate the pixels of the small-resolution images. To some extent, the image information is extracted, and the pixels are rearranged to the resolution of 512×512. The merged dataset is called CUID (Composite Underwater Image Dataset), and the ratio of the training set to the testing set is 4 : 1. The instance sizes of the CUID dataset are counted, as shown in Figure 6. The small object pixel is within 100×100, the medium object pixel is between 100×100 and 300×300, and the large object pixel is larger than 300×300. The number distribution of each type of object is shown in Figure 7.Figure 6
Instance size distribution of the CUID dataset.Figure 7
Instance number distribution of the CUID dataset.


## 4.2. Experimental Setting

Our experimental environment is shown in Table1. The experiment was conducted on a computer equipped with Intel Core i7-6700U @ 4.00 GHz, NVIDIA GeForce RTX 3090 Ti, 8 GB DDR3 memory, and running Windows 10 64-bit operating system. Experiments were implemented on the PyTorch software. The version of CUDA is 10.1, the version of PyTorch is 1.5.0, and the version of Python is v3.6. Our method is accelerated on GPU.Table 1
The experimental environment configuration.
EnvironmentVersion modelOperating systemWindows 10 64-bitCPUIntel i7-6700U 4.00 GHzGPUNVIDIA RTX 3090 TiCUDAV10.1PyTorchV1.5.0PythonV3.6The network uses the SGD [60] optimization strategy with a momentum parameter of 0.95. The learning rate was set to 0.0001, and it then dropped evenly to 0.00001. The batch size was set to 32, the confidence threshold was set to 0.5, and the IOU threshold was set to 0.4. Besides, the dropout was set to 0.5 to prevent overfitting, and the number of training iterations of CUOID was set to 200,000 times.


## 4.3. Evaluation Indicators

This study adopts AP and mAP as evaluation indicators. The ground truth is obtained through manual annotation. The confusion matrix is shown in Figure8.Figure 8
The confusion matrix.Recall is the ratio of true-positive samples to the sum of true-positive samples and false-negative samples, and its calculation is shown in formula (9). Precision is the ratio of true-positive samples to the sum of true-positive samples and false-positive samples, and its calculation is shown in formula (10).
(9)Recall=TPTP+FN,(10)Precision=TPTP+FP.AP represents the model’s average detection accuracy for a specific class of objects, and mAP is the average value of AP values under all categories. Their calculations are shown in(11)AP=∫01Prdr,(12)mAP=1Q∑q=1QAPq,where Pr represents the precision value on the P-R curve and AP is the integral calculation of the P-R curve. q represents a specific object class, and Q represents the number of object classes.


## 4.4. Experimental

### 4.4.1. Objective Evaluation

Table2 shows the comparison of detection results on Yolov5, RON, RefineDet, STDN, SWIPENet, Faster R-CNN-AON, RFBNet, and our proposed method on the CUID dataset. From Table 2, it can be seen that our method achieves the highest AP value in the detection of objects such as holothurian, coral, rock, and octopus. The mAP among 15 categories of objects is 81.94%, which is better than the state-of-the-art methods. From the perspective of a single category of targets, coral, rock, and sculpture have the worst detection effect. The main reason is that corals cannot be clearly distinguished from rocks, resulting in many false detections. The reason for the poor detection effect of sculptures is that some humanoid sculptures are classified as divers.Table 2
Comparison of AP values of different methods. The short names are defined as HO—holothurian, BF—big fish, DI—diver, CO—coral, RO—rock, SC—sculpture, SF—small fish, OC—octopus, TU—turtle, SW—seaweed, MR—manta ray, SF—starfish, SH—shell, SU—sea urchin, and WR—wreckage. The best results are marked in bold.
MethodmAPHOBFDICOROSCSFOCTUSWMRSFSHSUWRYolov571.2772.8075.5476.1163.9264.5463.5769.4172.6173.3664.3975.4970.5369.3470.0267.37RON74.2671.9378.3277.2965.4767.1868.9572.8774.4975.0269.7178.3273.6874.3374.1670.12RefineDet75.0669.1777.0978.3168.7167.3470.1376.2976.3875.8570.2478.3774.9275.0675.1373.21STDN76.6773.2880.1477.4269.1867.9969.7178.5177.8976.9174.0677.9175.0374.9176.0174.88SWIPENet78.9170.3580.5980.5870.2669.4373.5579.4878.0178.2574.5779.3875.8679.0875.6475.61Faster R-CNN-AON79.6873.0184.4786.0371.2570.0573.6978.5279.6278.8475.2979.9478.6176.3178.3575.36RFBNet73.9970.6783.9282.6369.0467.3670.1976.1374.1773.9070.3774.0673.3170.9172.0570.91Ours81.9478.3383.9885.1473.3872.0173.3078.5780.8582.4175.1781.5481.0279.6380.2874.23To further compare the detection effects of objects of different scales, Table3 lists the performance of our method on the CUID dataset using the COCO indicator relative to Yolov5, RON, RefineDet, STDN, SWIPENet, Faster R-CNN-AON, and RFBNet. It can be seen from this table that the average detection accuracy of our method for small objects and large objects is the best, reaching 48.73% and 83.41%, respectively, which shows that the proposed method can well adapt to the scenario of multisize underwater objects and can accurately detect underwater objects of different scales. Meanwhile, our method also achieves the best detection effect under a stricter IOU, reaching 69.84% and 49.94% for AP50 and AP75, respectively, which can provide more accurate bounding boxes for multiscale objects.Table 3
Comparison of AP values of different methods for objects of different sizes. The best results are marked in bold.
MethodAPSAPMAPLAP50AP75Yolov540.0768.3175.3862.3443.64RON43.5772.4578.0365.1745.49RefineDet44.2173.4979.0765.4246.03STDN43.6174.0880.1566.3946.55SWIPENet45.8275.6381.4368.2148.08Faster R-CNN-AON46.2377.2681.5969.0049.20RFBNet42.4872.5277.2464.3844.61Ours48.7376.9083.4169.8449.94In terms of detection speed, Table4 shows the comparison results of parameters, model size, FLOPs, and FPS on Yolov5, RON, RefineDet, STDN, SWIPENet, Faster R-CNN-AON, RFBNet, and our proposed method on the CUID dataset. We can find that our method has fewer parameters, a smaller model size, and less computational resource consumption. Also, it has a relatively fast detection speed.Table 4
Comparison of the model size and real-time performance of different methods.
MethodBackboneInput sizeParameters (M)Model size (MB)FLOPs (G)FPSYolov5Darknet53416×4165.422.840.5772RONVGG16384×38431.9128.615.4715RefineDetVGG16320×32050.5200.218.9840.7STDNDenseNet169513×51329.5120.13.4128.6SWIPENetVGG16512×512~~~30Faster R-CNN-AONVGG161000×60084.1336.323.6724RFBNetVGG16300×30034.5140.045.4283OursMobileNetv3512×5127.831.221.7044.3Figure9 shows the P-R curves of detecting small, medium, and large objects and all objects on the CUID dataset. Obviously, our method can achieve the best results in detecting objects of various scales. In particular, when the recall rate is 0.5 to 0.7, the P-R curve of our method for detecting small objects is much higher than that of other detection networks. This indicates that when our method detects multiscale objects in underwater images with low image quality, the detection effect on small-scale objects is the most improved compared to other advanced methods. Overall, as a lightweight target detection network, our method can detect underwater multiscale targets quickly and effectively, and it achieves a good balance between detection accuracy and speed.Figure 9
Comparison of theP-R curves of detecting small, medium, large, and all objects on the CUID dataset.


### 4.4.2. Subjective Evaluation

The visualization results of object detection on the CUID dataset are shown in Figures10 and 11. It can be seen from Figure 10 that compared with other advanced methods, our proposed method can effectively reduce the missed detection rate, especially for small-scale objects, such as the small fishes in the second picture and the divers in the third picture. Figure 11 shows the detection results of our method on some other images of the dataset. Our proposed method can successfully detect objects of different scales. This is because our method achieves scale-aware contextual information aggregation and reduces the loss of effective information at low resolutions, while SNFP achieves adaptive and accurate detection of objects of different scales.Figure 10
Visualization of the detection results on the CUID dataset compared with the state-of-the-art methods.Figure 11
Visualization of our proposed method on the CUID dataset.


## 4.4.1. Objective Evaluation

Table2 shows the comparison of detection results on Yolov5, RON, RefineDet, STDN, SWIPENet, Faster R-CNN-AON, RFBNet, and our proposed method on the CUID dataset. From Table 2, it can be seen that our method achieves the highest AP value in the detection of objects such as holothurian, coral, rock, and octopus. The mAP among 15 categories of objects is 81.94%, which is better than the state-of-the-art methods. From the perspective of a single category of targets, coral, rock, and sculpture have the worst detection effect. The main reason is that corals cannot be clearly distinguished from rocks, resulting in many false detections. The reason for the poor detection effect of sculptures is that some humanoid sculptures are classified as divers.Table 2
Comparison of AP values of different methods. The short names are defined as HO—holothurian, BF—big fish, DI—diver, CO—coral, RO—rock, SC—sculpture, SF—small fish, OC—octopus, TU—turtle, SW—seaweed, MR—manta ray, SF—starfish, SH—shell, SU—sea urchin, and WR—wreckage. The best results are marked in bold.
MethodmAPHOBFDICOROSCSFOCTUSWMRSFSHSUWRYolov571.2772.8075.5476.1163.9264.5463.5769.4172.6173.3664.3975.4970.5369.3470.0267.37RON74.2671.9378.3277.2965.4767.1868.9572.8774.4975.0269.7178.3273.6874.3374.1670.12RefineDet75.0669.1777.0978.3168.7167.3470.1376.2976.3875.8570.2478.3774.9275.0675.1373.21STDN76.6773.2880.1477.4269.1867.9969.7178.5177.8976.9174.0677.9175.0374.9176.0174.88SWIPENet78.9170.3580.5980.5870.2669.4373.5579.4878.0178.2574.5779.3875.8679.0875.6475.61Faster R-CNN-AON79.6873.0184.4786.0371.2570.0573.6978.5279.6278.8475.2979.9478.6176.3178.3575.36RFBNet73.9970.6783.9282.6369.0467.3670.1976.1374.1773.9070.3774.0673.3170.9172.0570.91Ours81.9478.3383.9885.1473.3872.0173.3078.5780.8582.4175.1781.5481.0279.6380.2874.23To further compare the detection effects of objects of different scales, Table3 lists the performance of our method on the CUID dataset using the COCO indicator relative to Yolov5, RON, RefineDet, STDN, SWIPENet, Faster R-CNN-AON, and RFBNet. It can be seen from this table that the average detection accuracy of our method for small objects and large objects is the best, reaching 48.73% and 83.41%, respectively, which shows that the proposed method can well adapt to the scenario of multisize underwater objects and can accurately detect underwater objects of different scales. Meanwhile, our method also achieves the best detection effect under a stricter IOU, reaching 69.84% and 49.94% for AP50 and AP75, respectively, which can provide more accurate bounding boxes for multiscale objects.Table 3
Comparison of AP values of different methods for objects of different sizes. The best results are marked in bold.
MethodAPSAPMAPLAP50AP75Yolov540.0768.3175.3862.3443.64RON43.5772.4578.0365.1745.49RefineDet44.2173.4979.0765.4246.03STDN43.6174.0880.1566.3946.55SWIPENet45.8275.6381.4368.2148.08Faster R-CNN-AON46.2377.2681.5969.0049.20RFBNet42.4872.5277.2464.3844.61Ours48.7376.9083.4169.8449.94In terms of detection speed, Table4 shows the comparison results of parameters, model size, FLOPs, and FPS on Yolov5, RON, RefineDet, STDN, SWIPENet, Faster R-CNN-AON, RFBNet, and our proposed method on the CUID dataset. We can find that our method has fewer parameters, a smaller model size, and less computational resource consumption. Also, it has a relatively fast detection speed.Table 4
Comparison of the model size and real-time performance of different methods.
MethodBackboneInput sizeParameters (M)Model size (MB)FLOPs (G)FPSYolov5Darknet53416×4165.422.840.5772RONVGG16384×38431.9128.615.4715RefineDetVGG16320×32050.5200.218.9840.7STDNDenseNet169513×51329.5120.13.4128.6SWIPENetVGG16512×512~~~30Faster R-CNN-AONVGG161000×60084.1336.323.6724RFBNetVGG16300×30034.5140.045.4283OursMobileNetv3512×5127.831.221.7044.3Figure9 shows the P-R curves of detecting small, medium, and large objects and all objects on the CUID dataset. Obviously, our method can achieve the best results in detecting objects of various scales. In particular, when the recall rate is 0.5 to 0.7, the P-R curve of our method for detecting small objects is much higher than that of other detection networks. This indicates that when our method detects multiscale objects in underwater images with low image quality, the detection effect on small-scale objects is the most improved compared to other advanced methods. Overall, as a lightweight target detection network, our method can detect underwater multiscale targets quickly and effectively, and it achieves a good balance between detection accuracy and speed.Figure 9
Comparison of theP-R curves of detecting small, medium, large, and all objects on the CUID dataset.


## 4.4.2. Subjective Evaluation

The visualization results of object detection on the CUID dataset are shown in Figures10 and 11. It can be seen from Figure 10 that compared with other advanced methods, our proposed method can effectively reduce the missed detection rate, especially for small-scale objects, such as the small fishes in the second picture and the divers in the third picture. Figure 11 shows the detection results of our method on some other images of the dataset. Our proposed method can successfully detect objects of different scales. This is because our method achieves scale-aware contextual information aggregation and reduces the loss of effective information at low resolutions, while SNFP achieves adaptive and accurate detection of objects of different scales.Figure 10
Visualization of the detection results on the CUID dataset compared with the state-of-the-art methods.Figure 11
Visualization of our proposed method on the CUID dataset.


## 4.5. Ablation Experiment

To prove the rationality of the three functional modules proposed in our method, an ablation experiment was conducted to verify the effect of each module on object detection performance. Table5 presents the ablation results of adding each module (namely, LFEM, CAM, and SNFP) to the MobileNetv3 framework. It can be seen that the adding of each module brings benefits to the whole network, especially the SNFP module, which can be seen from the comparison between model 3 and model 4. The network detection performance of model 5 is the highest, which indicates that the three modules are indispensable, and the combination of them leads to the best detection effect on underwater multiscale objects.Table 5
Comparison of detection performance of embedded different modules. The best results are marked in bold.
BaselineLFEMCAMSNFPAPSAPMAPLAP50AP75mAP✓40.0568.3069.2859.2739.5853.13✓✓41.1370.3472.3760.9141.2455.90✓✓✓44.9572.6577.7465.3246.8258.68✓✓✓42.8471.1875.4263.7144.3357.10✓✓✓✓48.7376.9083.4169.8449.9460.12


## 5. Conclusion and Future Work

This study proposes a lightweight underwater image object detection method. In the proposed method, MobileNetv3 is the backbone network for preliminary feature extraction. LFEM pays attention to the feature map at the channel and space levels. The features with heavy weights are promoted, and the features with small weights are suppressed. Meanwhile, the cross-group information exchange enriches the semantic information and location information of the objects. CIAM pools the extracted feature maps to obtain feature pyramids, and it fuses feature maps of different scales using the original URC method to realize an effective fusion of global context information and enhance the feature representation ability. The SNFP performs adaptive multiscale perception and multianchor detection on feature maps of different sizes to cover objects of different sizes and realize multiscale object detection in underwater images. Our proposed method can realize light feature extraction and effectively handle the global relationship between the scene and the object while expanding the receptive field, thus achieving adaptive multianchor detection on multiscale objects in underwater images.The experimental results show that the average detection accuracy of our proposed method reaches 81.94, the model size is only 31.2 Mb, and the detection speed reaches 44.3 FPS. Overall, our proposed method outperforms the state-of-the-art methods in terms of detection accuracy, lightweight, and real-time performance. The proposed method can be used for effective underwater image multiscale object detection.In future work, moving the proposed method to more application scenarios is the focus of our research. Also, the integration of image acquisition and detection using underwater intelligent robots will be explored.



---

*Source: 2582687-2022-09-07.xml*