1. Introduction
As the global blue economy agenda advances, marine resource exploration has expanded from shallow waters to deep-sea and extreme environments. Unmanned underwater vehicles (UUVs) [
1,
2], particularly autonomous underwater vehicles (AUVs), are critical platforms for tasks such as docking with subsea stations, surveying seabed minerals, and conducting marine ecological surveys. The intelligence of these vehicles dictates the scope and depth of underwater operations [
3,
4]. During complex missions, AUVs must execute millisecond-level responses to dynamic environments, relying solely on onboard perception systems. While acoustic sensors like synthetic aperture sonar excel in long-range detection [
5], optical vision remains an irreplaceable modality for close-range operations and species classification due to its high resolution, low cost, and rich color information [
6,
7].
Transferring advanced computer vision algorithms from controlled terrestrial environments to dynamic underwater spaces presents severe physical challenges. The classical Jaffe-McGlamery imaging model establishes that underwater visual quality is fundamentally limited by medium absorption and scattering [
8]. The selective absorption of long-wavelength light (e.g., red and orange) results in a pronounced red-green color cast. Backscattering from suspended particles creates a strong veiling effect, which compresses target contrast and blurs the boundaries between biological targets and the background [
9,
10]. This image degradation causes traditional operators like Canny and Sobel to fail. Therefore, developing robust underwater object detection methods remains a critical challenge.
In recent years, object detection research has evolved from traditional handcrafted feature-based methods to data-driven deep representations. While early two-stage networks achieve high accuracy [
11], their substantial memory footprint conflicts with the strict size, weight, and power constraints of AUVs [
12]. YOLO-series algorithms mitigate this by framing detection as a single regression problem [
13]. Nevertheless, existing strategies exhibit limitations in specific underwater environments. In degraded underwater scenes, generic YOLO models remain less reliable for three main reasons. First, standard convolutions in shallow layers rely on fixed local receptive fields and therefore struggle to capture sufficient context for low-contrast targets with large scale variation. Second, pyramid-based feature fusion in the neck can smooth weak contours and suppress high-frequency boundary cues, reducing localization reliability for camouflaged or blurred organisms [
14]. Some studies rely on preprocessing techniques like dehazing and color restoration, which introduce computational latency and risk of distorting original features [
15,
16,
17]. Although advanced deep learning architectures, such as feature aggregation networks tailored for maritime environments [
18,
19,
20], exhibit strong perception capabilities for marine targets, their substantial computational and structural overhead may limit high-frame-rate real-time detection on AUV-oriented edge platforms. Alternatively, increasing model depth compromises the real-time inference speed necessary for operations on onboard platforms like NVIDIA Jetson devices. Third, the standard localization objective of one-stage detectors does not adequately address long-tail class imbalance or variation in sample difficulty, which further weakens performance on rare underwater categories [
21]. These limitations motivate the design of YOLO-CAB, in which CALSK strengthens multi-scale contextual perception, SBAM refines degraded boundary information, and MCAWIoU improves optimization for difficult and underrepresented categories.
In addition to computational constraints, the robustness of underwater object detection is affected by data distribution and biological evolution. Unlike terrestrial datasets with uniform illumination and balanced categories, such as COCO and ImageNet, targets in authentic underwater environments frequently exhibit strong biological camouflage, known as crypsis. Many marine organisms blur their contours by simulating the surrounding color and texture, reducing the discriminability between targets and backgrounds in the feature space [
22]. This low-contrast boundary information is highly susceptible to feature loss during successive downsampling in deep convolutional networks, causing low recall for camouflaged targets. Moreover, the sparsity of marine life causes underwater datasets to exhibit a severe long-tail distribution, complicating balanced optimization across categories. In practical AUV operations, common fish are frequently observed, whereas benthic targets such as corals and sea cucumbers are less represented because of their localized distribution. When handling these blurred boundaries and small targets, traditional intersection over union (IoU) losses, such as CIoU and DIoU, often suffer from gradient vanishing or oscillation. This instability arises because the overlap between predicted and ground truth boxes becomes volatile under noise, limiting model generalization on difficult categories. Therefore, enhancing selective attention to degraded boundaries and dynamically balancing class weights, while maintaining a lightweight architecture, remains a critical challenge for AUV visual perception [
23].
The scarcity of high-quality annotated data and limited data diversity have long restricted the deployment of underwater detection algorithms on AUVs. Early research primarily relied on elementary datasets like Fish4Knowledge (F4K) [
24]. Although F4K contains millions of fish images, the data mostly originates from long-term surveillance videos captured by fixed cameras. The static backgrounds and low resolution fail to simulate the complex motion blur and perspective changes AUVs encounter during dynamic navigation. Later, datasets from the Underwater Robot Picking Contest (URPC) series [
25] gained widespread use. URPC provides high-resolution annotations for benthic organisms like sea cucumbers and sea urchins, advancing underwater grasping algorithms. However, URPC collection scenes are largely limited to nearshore artificial aquaculture areas with favorable lighting. They lack representations of extremely degraded deep-water environments, creating a generalization gap for models trained in these settings when deployed in complex open waters. To better simulate authentic marine ecosystems, researchers introduced task-specific datasets. For example, the BrackishMOT dataset [
26] focuses on turbid estuaries, emphasizing model robustness under low visibility. The TrashCan dataset [
27] focuses on marine debris monitoring, capturing interactions between waste and biological targets. While valuable for specific domains, these datasets often suffer from limited category diversity or scene homogeneity. Consequently, they cannot comprehensively evaluate AUV perception for large-scale biodiversity surveys or complex deep-sea missions. The recently released Real-world Underwater Object Detection (RUOD) benchmark [
28] provides a highly representative solution for evaluating algorithms in complex marine environments. RUOD encompasses multiple physical scales and extreme degradation scenes, reflecting the long-tail distribution and biological camouflage challenges of deep-sea operations. Despite this comprehensive benchmark, existing general object detectors struggle to achieve satisfactory accuracy on it. This bottleneck arises because standard architectures lack optimization mechanisms targeting specific physical degradations, such as edge blurring, and the severe category imbalance inherent to deep-sea data.
To address these challenges, we propose YOLO-CAB, a YOLOv13-based underwater object detector tailored for complex imaging conditions, with AUV edge deployment as a target application. In this work, YOLOv13n denotes the vanilla baseline, whereas YOLO-CAB denotes the complete detector with CALSK, SBAM, MCAWIoU, and the restructured detection head. Unlike approaches that mainly rely on image preprocessing, generic attention blocks, or deeper feature aggregation, this work focuses on how underwater degradation affects different stages of the detection pipeline. Specifically, low contrast weakens shallow contextual representation, contour blurring reduces boundary reliability before prediction, and long-tailed category distributions introduce localization imbalance during optimization. The design links these three error sources to three corresponding components: weak shallow context is handled by CALSK, blurred boundaries before prediction are refined by SBAM, and category-dependent localization imbalance is addressed by MCAWIoU.
The main contributions of this work are summarized as follows:
A YOLOv13-based underwater detector, YOLO-CAB, is developed for AUV-oriented visual perception under optical degradation. The framework addresses low contrast, blurred contours, and imbalanced category difficulty through context-aware feature extraction, boundary-sensitive refinement, and category-aware localization optimization.
CALSK is introduced into the shallow backbone layers. It combines multi-scale depthwise convolution, additive feature fusion, and spatial weighting to improve contextual feature representation under low contrast and scale variation.
SBAM is designed before the detection head. It extracts local edge cues and broader contour responses through parallel branches and generates a boundary-sensitive spatial mask to refine multi-scale features.
An MCAWIoU loss is developed by tracking category-level IoU with an exponential moving average, enabling category-aware weighted localization optimization for challenging samples and underrepresented categories. Experiments and ablation studies on the RUOD benchmark dataset evaluate the individual and combined effects of the proposed components.
3. Methodology
To make the overall methodology clearer,
Figure 1 summarizes the processing flow of YOLO-CAB from underwater image input to detection output and training optimization.
3.1. Overall Network Architecture of YOLO-CAB
In this study, YOLOv13 [
47] is selected as the baseline model. As a state-of-the-art framework in one-stage object detection, it achieves an effective trade-off between detection precision and inference latency through a streamlined network topology and efficient parameter utilization. Architecturally, the vanilla YOLOv13 consists of three primary components: a feature extraction backbone, a feature fusion neck, and decoupled detection heads. Within the backbone, YOLOv13 extensively utilizes depthwise separable cross-stage partial (DSCSP) modules, which effectively reduce computational complexity through local feature aggregation. In the neck network, cross-layer connections are incorporated to facilitate the fusion of multi-scale features. This architectural design endows YOLOv13 with a high processing frame rate, making it more favorable for edge-oriented inference.
However, the direct deployment of the vanilla YOLOv13 architecture in complex underwater vision tasks reveals several inherent limitations. First, the standard convolutional modules in the shallow layers of the backbone utilize fixed kernel sizes and lack a mechanism for dynamic receptive field expansion. This makes it difficult to capture global contextual information for targets with significant scale variations in low-contrast scenarios. Furthermore, the coarse-grained feature fusion in the neck lacks an explicit mechanism to preserve high-frequency spatial information; consequently, the weak boundary features of camouflaged underwater targets are prone to attenuation during deep feature propagation. Finally, the native loss function in the detection head performs uniform optimization across all categories, failing to effectively address the pervasive long-tail distributions and sample difficulty imbalance characteristic of real-world seabed environments.
YOLO-CAB is designed around three related error sources in underwater detection: insufficient context under low contrast, weakened boundary cues after multi-scale feature propagation, and imbalanced localization optimization across categories. CALSK, SBAM, and MCAWIoU are therefore placed in the backbone, the pre-head refinement stage, and the regression objective, respectively. This arrangement connects context-aware feature extraction, boundary-sensitive refinement, and category-aware localization optimization within the same detection pipeline.
To address the aforementioned issues, this work develops YOLO-CAB as a YOLOv13-based underwater object detector, as illustrated in
Figure 2. The term YOLOv13n is used for the unmodified baseline in all comparisons and ablation experiments, while YOLO-CAB refers to the complete proposed detector after integrating CALSK, SBAM, MCAWIoU, and the restructured detection head. These modifications are organized according to the stages of the detection pipeline rather than introduced as isolated components. The resulting model improves underwater detection from three aspects: feature extraction, boundary perception, and localization optimization. Specifically, CALSK is integrated into the shallow layers of the backbone to strengthen the capabilities for the multi-scale capture of features. Furthermore, SBAM is designed and positioned prior to the input of the feature pyramid into the detection head, which refines multi-scale features and reinforces sensitivity to the boundaries of targets. Concurrently, the decoupled detection head is strategically restructured: four FullPAD Tunnel modules are removed, and the depthwise separable modules for the aggregation of features (DSC3k2) within the path of detection are replaced with standard C3k2 modules to reduce computational redundancy and improve the efficiency of feature decoding. Finally, the MCAWIoU loss is introduced at the output stage. By dynamically tracking the IoU at the category level, this loss function improves the precision of localization and the distribution of confidence for challenging underwater samples from the perspective of optimization.
3.2. CALSK Module
Severe medium scattering and optical attenuation in real underwater environments cause low target–background contrast and significant scale variations. Under such low signal-to-noise ratio (SNR) conditions, the fixed local receptive fields in the shallow layers of standard networks fail to capture global contextual correlations. To address this, we introduce CALSK into the backbone. By replacing standard convolutions in these shallow layers, CALSK expands the receptive field and adaptively weights critical spatial locations with controlled computational overhead, as illustrated in
Figure 3.
This design is adopted because shallow underwater features require a larger contextual range while still preserving local texture details. The depthwise multi-scale structure enlarges the receptive field with limited computational increase, and the additive fusion avoids additional channel compression on low-contrast shallow features.
The multi-scale feature extraction process is formulated as:
where
X is the input feature map,
denotes a depthwise convolution with a
kernel, and
indicates a dilation rate of 3. This multi-scale depthwise convolution design forms the core of CALSK. By utilizing varying kernel dimensions and incorporating dilated convolutions for larger scales, this configuration expands the theoretical receptive field to capture features across multiple spatial scales. Instead of conventional channel concatenation followed by dimensionality reduction, CALSK employs element-wise addition across the three scales to obtain the fused feature
. This strategy preserves the semantic information of each channel while preventing the loss of spatial structural details typically caused by dimensionality reduction.
The fused feature
is subsequently fed into a spatial attention sub-module. We apply average pooling and max pooling along the channel dimension to extract dual-channel spatial descriptors, capturing global smoothing priors and high-frequency saliency features, respectively. These descriptors are concatenated and compressed via a
spatial convolution, followed by a Sigmoid activation function to generate a single-channel spatial mask
:
where
denotes the Sigmoid function,
is the spatial convolution, and
represents the concatenation operation. This mask acts as a contrast modulator and is applied directly to the fused features, adaptively weighting low-contrast regions of underwater targets. Consequently, this operation enhances the feature representation of weak targets during the initial extraction stages.
3.3. SBAM
In one-stage object detection frameworks, multi-scale features are susceptible to the attenuation of subtle boundary signals from underwater benthic organisms, primarily caused by repeated deep pooling and downsampling operations. To refine these multi-scale features and enhance sensitivity to target boundaries, we introduce SBAM at the three output scales (
,
, and
) of the feature pyramid prior to the detection head, as illustrated in
Figure 4.
SBAM is placed before the detection head because boundary cues may be weakened after repeated feature fusion and downsampling. The two-branch design is used to capture local edge responses and broader contour patterns separately before generating the spatial attention mask.
SBAM explicitly isolates edge and contour information from fused multi-scale features. Given an input feature map
, the module first performs dimensionality reduction via two parallel
convolutional branches. These paths then enter different receptive field branches to extract high-frequency signals: the first branch uses a standard
convolution to capture local, compact edge cues, while the second employs a sequence of depthwise separable convolutions to capture broader geometric contours:
where
denotes a standard convolution and
denotes the sequence of depthwise separable convolutions. The extracted features from both paths are concatenated into a unified boundary tensor
. To prevent incorrect attention bias from under-fused features, SBAM calculates a spatial attention mask directly from this boundary tensor. We apply average and max pooling along the channel dimension, followed by spatial convolution and activation, to generate a contour-sensitive mask. This mask is then used for the element-wise weighted refinement of the boundary features:
where
denotes the Sigmoid function and
represents the concatenation operation. To stabilize gradient backpropagation and enable the network to adaptively adjust the boundary information injection based on varying underwater scenarios, we introduce a learnable dynamic factor
for a residual connection between the refined boundary features and the original input. Initialized to a small constant for early training stability,
is adaptively tuned via backpropagation, providing high-quality, boundary-enhanced features to the detection head:
where ⊗ denotes element-wise multiplication.
3.4. MCAWIoU Loss
Conventional bounding box regression losses in YOLOv13 do not differentiate optimization weights across categories. Consequently, backpropagation is easily dominated by abundant common categories, reducing localization precision for rare and camouflaged organisms. Although the existing WIoU introduces a non-monotonic focusing mechanism, it relies exclusively on the geometric spatial quality of predicted boxes and lacks perception of inherent category difficulty. To address this, we propose the MCAWIoU loss.
The EMA-based category-level IoU is introduced to alleviate the localization imbalance caused by long-tailed category distributions. In underwater datasets, categories with fewer samples or ambiguous appearances may maintain lower localization quality during training, whereas frequent categories can dominate the regression gradients. By tracking the recent IoU of each category, MCAWIoU assigns relatively larger regression weights to categories with lower estimated localization quality. This design introduces category-level difficulty into the IoU regression objective without relying on manually fixed class weights.
Based on the non-monotonic focusing mechanism, MCAWIoU incorporates an Exponential Moving Average (EMA) to track IoU at the category level:
where
serves as the momentum parameter, and
denotes the average IoU of category
c at iteration
t. During training, the model continuously tracks the average IoU for each category to automatically identify difficult samples and achieve data-driven dynamic adjustments. The difficulty level for a category is defined as
. A higher
indicates greater prediction difficulty for that category at the current stage. Based on this real-time assessment, MCAWIoU constructs a dual-path weighting mechanism. In the IoU regression path, an adaptive base weight driven by category difficulty is introduced:
where hyperparameters
and
dictate the scale and sensitivity of this weight. To avoid training oscillations caused by hard boundary switching during anchor box weight calculation, MCAWIoU uses soft label scores to perform a weighted summation of the enhancement coefficients across all categories, generating a smoothed final weight:
where
indicates the predicted probability for category
c, and
C represents the total number of categories. This smoothed weight
is applied to the base loss, enabling the network to stably focus localization regression on difficult samples. The final regression loss, coupled with the non-monotonic focusing factor
, is defined as:
where
corresponds to the standard IoU loss.
In the classification path, a similar mechanism weights the Binary Cross-Entropy (BCE) loss to optimize the confidence distribution. To prevent excessive classification optimization from increasing false positives, we impose differentiated constraints on the enhancement magnitudes for both paths. This synergistic dual-path weighting and soft label smoothing ensures loss gradient continuity, effectively mitigating missed detections and false positives for long-tail underwater samples.
5. Conclusions
In this paper, we propose YOLO-CAB, a YOLOv13-based underwater object detector designed for AUV visual perception under optical degradation, blurred boundaries, and long-tailed category distributions. By coordinating CALSK, SBAM, MCAWIoU, and detection-head restructuring, the method improves contextual feature extraction, boundary-sensitive localization, and category-aware optimization. Experiments on the RUOD dataset show that YOLO-CAB achieves 81.0% and 55.1% , improving the YOLOv13n baseline by 4.67% and 3.0%, respectively. Additional validation on the DUO dataset further supports its cross-dataset effectiveness under the shared-category protocol. The model also maintains a practical accuracy–efficiency trade-off, with 8.85 GFLOPs and an inference time of 5.21 ms under the tested hardware setting.
These results indicate that YOLO-CAB is effective for underwater object detection scenarios where low contrast, weak boundaries, and category imbalance jointly affect perception performance. The Jetson Orin Nano experiment also shows real-time inference on embedded hardware under the tested settings. Future work will extend the framework to multi-object tracking, integrate visual detection with sonar data, validate the method through sea trials, and improve cross-domain adaptation across underwater sensors, scenes, and category distributions.