Next Article in Journal
EEG-Based Emotion Recognition with Combined Fuzzy Inference via Integrating Weighted Fuzzy Rule Inference and Interpolation
Previous Article in Journal
New Perspectives on Generalised Lacunary Statistical Convergence of Multiset Sequences
Previous Article in Special Issue
Low-Light Image Enhancement Using CycleGAN-Based Near-Infrared Image Generation and Fusion
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

SwinInsSeg: An Improved SOLOv2 Model Using the Swin Transformer and a Multi-Kernel Attention Module for Ship Instance Segmentation

School of Computer Science, University of Technology Sydney, Broadway, Ultimo, NSW 2007, Australia
*
Author to whom correspondence should be addressed.
Mathematics 2025, 13(1), 165; https://doi.org/10.3390/math13010165
Submission received: 29 September 2024 / Revised: 31 December 2024 / Accepted: 3 January 2025 / Published: 5 January 2025
(This article belongs to the Special Issue New Advances and Applications in Image Processing and Computer Vision)

Abstract

:
Maritime surveillance is essential for ensuring security in the complex marine environment. The study presents SwinInsSeg, an instance segmentation model that combines the Swin transformer and a lightweight MKA module to segment ships accurately and efficiently in maritime surveillance. Current models have limitations in segmenting multiscale ships and achieving accurate segmentation boundaries. SwinInsSeg addresses these limitations by identifying ships of various sizes and capturing finer details, including both small and large ships, through the MKA module, which emphasizes important information at different processing stages. Performance evaluations on the MariBoats and ShipInsSeg datasets show that SwinInsSeg outperforms YOLACT, SOLO, and SOLOv2, achieving mask average precision scores of 50.6% and 52.0%, respectively. These results demonstrate SwinInsSeg’s superior capability in segmenting ship instances with improved accuracy.

1. Introduction

In the 21st century, the sea has taken on a crucial role in national sovereignty, security, and development. As a result, to effectively manage ocean traffic and safeguard coastal and maritime areas, the deployment of offshore and onshore surveillance systems has become increasingly important for the armed forces and civilian sectors. The traditional approach to marine surveillance relied heavily on real-time human monitoring, a method that was often inefficient, expensive, and prone to missed inspections [1]. However, the development of marine surveillance systems using computer vision has largely replaced manual monitoring and is now widely used for managing maritime traffic and conducting surveillance [2,3,4,5]. Ship detection algorithms, as explored by Nalamati et al. (2020, 2022), Park et al. (2022), and Xing et al. (2023) [6,7,8,9], utilize bounding boxes to identify various features. Still, they often struggle to provide accurate details of ship edges due to the inclusion of unnecessary background pixels. In contrast, instance segmentation methods excel at distinguishing ships of different sizes, which is essential for the three-dimensional reconstruction of marine scenes. This reconstruction is vital for understanding marine traffic and aiding in visual navigation. Therefore, instance segmentation significantly improves the safety and precision of marine systems, enhancing their navigation and surveillance capabilities. From the literature, we have identified that published articles on marine ships mainly fall into four categories: satellite remote sensing images [10,11,12,13], synthetic aperture radar images [14,15,16], infrared images [17,18], and visible-light images [3,4,5,19,20,21]. Each system has unique benefits and drawbacks, making it suitable for specific situations:
  • Satellite Remote Sensing Images: At a microscopic level, these images cover large areas. Their quality and clarity might be poor, leading to misjudgment.
  • Synthetic Aperture Radar (SAR) Images: Although accurate, SAR-based object identification algorithms may not always be reliable. Low-frequency spectrum information may not be compatible with the human visual system.
  • Infrared Images: Certain scenarios may benefit from infrared images. Low resolution, significant noise, and a lack of color and texture information make them difficult to interpret.
  • Visible-Light Images: Compared to other categories, visible-light images are clearer, more detailed, more precise, and better at defining texture. They look nicer and are used in more applications.
Visual perception systems have benefits as well as limitations. Selecting a suitable system depends on the specific task and conditions. But combining them might improve accuracy and reliability. We have used visible-light images for our research because of their advantages. Due to security concerns, the availability of the dataset is limited to research and development purposes. Nonetheless, we found a few marine datasets for instance segmentation tasks, such as MariBoats and ShipInsSeg.
Most instance segmentation techniques are developed using approaches based on Convolutional Neural Networks (CNNs) rather than using transformer-based methods for segmenting individual ships. Instance segmentation is more complex than object detection because it identifies objects’ positions and creates semantic masks for them. CNN-based techniques rely on both two-stage and single-stage frameworks. A conventional two-stage method, like Mask R-CNN [22], uses Faster R-CNN [23] for segmenting instances. Although this approach has been widely used in prior research and provides a foundation for improving instance segmentation accuracy, it has certain drawbacks. Due to its slower inference speed, longer training times, and higher memory usage, this approach is not appropriate for use in marine applications. On the other hand, single-stage approaches immediately predict object categories and build object masks without the region proposal stage, offering a lightweight model, reduced training time, and real-time performance. Our research focuses on using the SOLOv2 [24] single-stage model rather than the two-stage technique to improve segmentation efficiency and accuracy.
This study uses a transformer-based technique to accurately segment ships of different sizes that are captured in distant marine images. We present the SwinInsSeg model, a single-stage ship instance segmentation framework that leverages the Swin transformer’s ability to efficiently learn complicated features in challenging and dynamic maritime environments. Additionally, feature pyramid networks (FPNs) struggle to effectively extract features across diverse marine environments due to limitations in handling significant variations in object sizes and scales. To enhance performance and feature extraction, the model incorporates a multi-kernel attention (MKA) module, which captures multiscale features using attention mechanisms with different kernel sizes. This study shows that SwinInsSeg outperforms existing methods in ship instance segmentation.
Our main contributions are as follows:
  • SwinInsSeg significantly improves the accuracy of segmentation, providing precise segmentation of ships of various sizes.
  • Our novel MKA module uses attention techniques with different kernel sizes to dynamically extract multiscale features, resulting in feature enhancement. This method enables the model to refine and capture different objects more accurately.
The sections of this paper are arranged as follows. Section 2 focuses on instance segmentation, transformer-based approaches, marine surveillance, and their applications. The proposed method is discussed in Section 3. Section 4 covers comparison and ablation experiments that demonstrate the effectiveness of our method. Section 6 presents the conclusions.

2. Related Works

2.1. Instance Segmentation Techniques

One of the most difficult computer vision tasks is instance segmentation. This task involves detecting object coordinates and generating exact instance masks, which goes beyond basic object detection techniques [23,25]. Instance segmentation methods are typically split into two types: two-stage and single-stage methods. Mask R-CNN [22] is a well-known anchor-based instance segmentation algorithm that operates in two stages. It first identifies regions of interest (ROIs) and then classifies and segments them. Two-stage approaches limit real-time performance, particularly with smaller input images. These limitations are caused by re-pooling features for every ROI and the subsequent computations. While two-stage bounding boxes are accurate, they fail to distinguish overlapping objects and achieve precise segmentation. To further improve instance segmentation accuracy [26,27,28], several additional methods group pixels into an infinite number of prior object instances.
One-stage/single-stage anchor-free object detection [29,30,31] uses instance segmentation methods to quickly obtain an object’s location, category, and instance mask. Current real-time techniques, like YOLACT [32], use two concurrent tasks to accomplish instance segmentation. These methods initially generate prototype masks across the entire image without being restricted to a specific location. They then forecast coefficients for each individual instance in a linear combination. Fast NMS takes the place of non-maximum suppression to enhance real-time segmentation performance. SOLO [33] is another real-time method that uses an object’s center and size to predict object instances and categories instead of bounding-box extraction. It divides images into grids and predicts object semantic categories and instance masks based on the grid center for classification and instance masks. Several improvements based on the SOLO method were introduced in SOLOv2 [24]. It uses convolutional kernel learning and feature learning to create instance masks and a dynamic technique for object position segmentation. Moreover, the matrix NMS technique enhances the AP and reduces redundant predictions. Because of its dynamic capabilities and single-stage design, we chose SOLOv2 [24] for ship instance segmentation.

2.2. Transformer-Based Techniques

Transformers, originally developed in natural language processing (NLP), have gained widespread use in computer vision tasks. The vision transformer (ViT) in [34] adopted the notion of separating images into patches, linearly embedding them, and processing them as sequences. This method achieved state-of-the-art (SOTA) performance on image classification benchmarks. Wang et al. [35] introduced a pyramid vision transformer (PVT) that outperformed ResNet [36] in object identification and semantic segmentation because of its hierarchical pyramid structure. Cheng et al. [37] used masked attention processes to enhance transformer abilities for panoramic, instance, and semantic segmentation. The Swin transformer [38], a hierarchical ViT version, uses non-overlapping 4 × 4 patches and a sliding-window technique for efficient global and local feature extraction. Its architecture improves computational efficiency and feature extraction by confining self-attention computations to local windows and allowing cross-window interactions via a hierarchical design. Inspired by the Swin transformer’s hierarchical sliding-window mechanism, we adopted it as the backbone in our SwinInsSeg model. Its ability to effectively capture both local and global contextual features makes it the ideal choice for ship instance segmentation in complex maritime environments. This approach ensures that the features extracted are both computationally efficient and contextually rich, thereby improving segmentation accuracy while handling challenges like dynamic backgrounds.

2.3. Maritime Surveillance and Applications

Current computer vision research focuses on marine surveillance. The fight against smuggling, illegal immigration, and marine vessel attacks has increased recently. Traditional remote sensing [39,40] requires observatory and communications equipment to be installed. However, there is a possibility that the costly equipment may either be purposefully broken down or turned off. Rather than vision technology, these systems rely significantly on human involvement and monitoring. Safety and cost-efficiency may be improved by employing vision technology in smart surveillance systems. Using vision technology for marine surveillance can safeguard a nation’s interests and vital military data.
Object detection technology has been developed to address the challenges of the marine environment, such as shark identification [41] and other applications, like estimating populations [42] and defending against drone threats [43]. Combining MobileNetV2 with SSD for detection improved accuracy to 92% and frame rate to 15 fps [44]. Deep learning methods have shown remarkable achievements for object detection in terms of speed and accuracy. Additionally, transformer-based intrusion detection methods have been applied to complex scenes [7].
Recently, there has been limited research carried out on marine surveillance using instance segmentation techniques. To understand maritime ships [4], global mask heads are used to create instance masks based on global and semantic data. Using global and local attention techniques preserves semantic and global information, improving segmentation [5]. In [45] employed a two-stage process to separate ships by distinguishing fog-infused and fog-free sea images. Dynamic contour learning and interference reduction can detect ship occurrences in fog and generate synthetic images [46].

3. Proposed Method

We describe the SwinInsSeg model in this section. The model loss function and our MKA module are also explained.

3.1. Overall Architecture

The proposed architecture, which builds upon the SOLOv2 model [24], is shown in Figure 1 and comprises three main components: the backbone, the feature pyramid network (FPN) known as the neck, and the mask head. Our proposed architecture uses Swin-T as the backbone for feature extraction, which results in higher inference speeds and lower computational costs compared to other backbones like Swin-B [38] and Swin-L [38]. The Swin transformer backbone, shown in Figure 1 highlighted with a red-dashed rectangular box, includes a patch partition block and comprises four stages. Initially, the input is an RGB image (i.e., three channels) split into 4 × 4 patches using the patch partition block and flattened along the channel dimensions. Patch partitioning reduces the input image dimensions from H × W × 3 to H 4 × W 4 × 48, significantly minimizing computational costs and memory usage. After patch partitioning, in stage 1, the linear embedding module linearly transforms the data from each pixel channel into H 4 × W 4 × C and feeds them into the Swin transformer block as its input.
The Swin transformer block, as illustrated in Figure 2, comprises two sequential blocks that form the core of the Swin transformer backbone. These blocks include two important modules: W-MSA and SW-MSA. The W-MSA module, or window-based multi-head self-attention, further partitions the image blocks into non-overlapping regions to calculate self-attention within these regions. The SW-MSA module, known as shifted-window multi-head self-attention, divides non-overlapping windows at layer l and reduces the window distance by half at layer l + 1 , allowing window information from different levels to interact. In addition, the Swin transformer block features two Multi-Layer Perceptron (MLP) modules and two LayerNorm (LN) modules. A LayerNorm (LN) layer precedes each MSA module and MLP, with a residual connection following each module. The incorporation of the W-MSA and SW-MSA modules facilitates the flow of information across windows. The transformer block computations are given in Equation (1):
X ^ l = W - MSA ( LN ( X ^ l 1 ) ) + X ^ l 1 X l = MLP ( LN ( X ^ l ) ) + X ^ l X ^ l + 1 = SW - MSA ( LN ( X l ) ) + X l X l + 1 = MLP ( LN ( X ^ l + 1 ) ) + X ^ l + 1
where the results for X ^ l and X l represent the output features from the W-MSA and MLP modules for the lth block, respectively. Similarly, X ^ l + 1 and X l + 1 refer to the resulting features of the SW-MSA and MLP modules for the l + 1 th block. The structure is consistent from stages 2 to 4, including patch merging layers and Swin transformer blocks. The patch merging layer efficiently combines four patches simultaneously, reducing the image’s height and width by half. As illustrated in Figure 1, each stage operates at a different resolution; for example, stage 1 operates at a resolution of H 4 × W 4 . After the patch merging layer in stage 2, the resolution becomes H 8 × W 8 , and this pattern continues, with stage 3 at H 16 × W 16 , and the final stage presenting a resolution of H 32 × W 32 . Although the resolution decreases at each stage, the number of input channels, denoted by C, increases to capture more in-depth and complex relationships across different stages. In the top-down pathway, the outputs from various stages, with feature maps or channels Ci dimensions of 96, 192, 384, and 768, are processed through the proposed multi-kernel attention (MKA) module. This module is designed to enhance the model’s feature representation capabilities, particularly for instance segmentation. The refined features are then forwarded to the neck, or feature pyramid network (FPN), to improve the detection of objects across different sizes. The aggregated feature maps with information from various FPN levels are directed to the mask head. This architecture can create instance masks without relying on bounding boxes, facilitating precise segmentation tasks.
The mask head is divided into an object category branch and a kernel branch. These branches use the input feature maps to make predictions. Specifically, the object category branch predicts the categories of objects, while the kernel branch generates dynamic kernels. Meanwhile, the feature branch processes mask features, using multilevel feature maps for representation. In the final step, the kernel branch and feature branch are convolved together to produce the instance mask, effectively combining their outputs.

3.2. Multi-Kernel Attention Module

To address the challenges posed by object scale variability in maritime scenarios, we propose an effective and novel multi-kernel attention (MKA) module for segmenting objects of varying sizes within such environments. The stages of the feature pyramid network (FPN) are characterized by their distinct receptive fields and semantic depths. However, the original FPN has a limitation in that it only considers the global features of adjacent levels, which may not be adequate due to object size variations at different levels. Our MKA technique overcomes this limitation by using convolutional layers with diverse kernel sizes to effectively capture changes in object size across multiple scales. The MKA module consists of vertical branches, with each branch using a specific kernel size to capture features at various scales. Incorporating the attention mechanism, specifically CBAM [47], enhances the focus on important channels and spatial regions after applying different kernel sizes, thus refining both local and global features. The fusion of output features from all branches allows our model to recognize the diverse sizes of objects found in marine settings, thereby enhancing instance segmentation precision.
The MKA module, as illustrated in Figure 3, incorporates a residual structure and a multi-kernel design to enhance feature learning. Initially, the backbone’s output features are processed through 1 × 1 convolutional layers to reduce the channel size to 256, preparing them for the MKA module. This module has four convolutional layers with kernel sizes of 1, 3, 5, and 7 for multiscale feature extraction. Each kernel size is designed to capture various spatial patterns and levels of information in the feature maps. For instance, the 1 × 1 and 3 × 3 kernels are effective at extracting fine-grained features from smaller objects, while the larger kernels, 5 × 5 and 7 × 7, are better at capturing more global patterns and larger structures. Skip connections are used to avoid the gradient vanishing problem. The feature maps generated by each kernel size are then processed through CBAM [47], allowing the network to focus on the most informative features, thereby improving the accuracy of segmentation, especially in cluttered marine environments. Within the CBAM block, highlighted by a red rectangular box, are two main branches: channel attention and spatial attention. The channel attention branch generates an attention map that determines the inter-channel relationships, focusing on the important channel for each kernel size. This process involves deriving global features (dimensions of 1 × 256) via global average-pooling and max-pooling layers, denoted as Feature m a x c and Feature a v g c . These are then fed into a shared network that produces a channel map N c R c × 1 × 1 with a singular hidden layer, where ‘c’ represents the number of channels. A reduction ratio ’r’ is applied to optimize the parameters, denoted as R c / r × 1 × 1 . Element-wise addition is used to merge the resulting feature maps. The computation of channel attention is given in the following Equation (2):
N c ( F ) = σ ( M L P ( A v g P o o l ( F ) ) + M L P ( M a x P o o l ( F ) ) ) N c ( F ) = σ ( W E 1 ( W E 0 ( Feature max c ) ) + W E 1 ( W E 0 ( Feature avg c ) ) )
where σ represents the sigmoid function, and W E 1 R c / r × 1 × 1 and W E 0 R c / r × 1 × 1 are the MLP weights.
Spatial attention is similar to channel attention in that a spatial attention map is generated using the spatial relationships of features. These features are computed using global max-pooling and average-pooling layers, represented by Feature max s R 1 × H × W and Feature avg s R 1 × H × W along the channel dimension and concatenated. We use a 7 × 7 convolutional layer to reduce the dimension and generate the spatial attention map N s ( Feature ) R H × W . Equation (3) is used to calculate spatial attention:
N c ( F ) = σ ( K e r n e l 7 × 7 ( [ A v e r a g e P o o l ( F ) ; ( M a x P o o l ( F ) ] ) ) N c ( F ) = σ ( K e r n e l 7 × 7 ( [ Feature max s ; Feature avg s ] ) )
where σ denotes a sigmoid function and the convolution layers use a kernel size of K e r n e l 7 × 7 .

3.3. Loss Function

We employ the loss function from the original SOLOv2 model for object categorization and instance segmentation tasks. We utilize the focal loss function in backpropagation for category loss to address the imbalance between background and foreground classes. Furthermore, in the case of instance segmentation, we employ the dice loss to enhance the accuracy of mask prediction. The focal loss is given in Equation (4):
F o c a l l o s s ( C p ) = α t ( 1 C p ) γ log ( C p )
where Cp represents the probability of a class. The balancing and focusing factors are denoted by α and γ , respectively, with α set to 0.25 and γ set to 2.0.
The dice loss is used to measure the similarity between the segmented pixels and the ground-truth mask, thereby improving the accuracy of the segmented foreground area. The dice loss is given in Equation (5):
D i c e L o s s = 1 2 × x = 1 W y = 1 H ( i x , y × j x , y ) x = 1 W y = 1 H i x , y 2 + x = 1 W y = 1 H j x , y 2
where i x , y [ 0 , 1 ] represents the predicted segmentation probability at pixel coordinate ( x , y ) and j x , y [ 0 , 1 ] represents the binary ground-truth mask value at pixel coordinate ( x , y ) . W and H denote the width and height of the image, respectively. × denotes element-wise multiplication. The summations are performed over all pixel coordinates in the image.
The complete training loss function for our network is given in Equation (6):
T r a i n i n g L o s s = L o s s c a t e + λ L o s s m a s k
where L o s s c a t e and L o s s m a s k refer to the object classification loss and mask prediction loss, respectively, with λ being a coefficient set to 3. The category score at a specific location on the grid is calculated by processing the input image through the backbone network and FPN inference, and then using the matrix NMS technique to eliminate redundant objects.

4. Experiments

This section presents a comprehensive performance evaluation of our proposed model for instance segmentation. First, we discuss the datasets used for our experiments and outline the experimental configurations, including the setup and hyperparameters. Then, we discuss the evaluation criteria used to measure the model’s performance. Furthermore, we conducted ablation studies to isolate and understand the impact of various components and configurations on overall performance. Finally, we present the visual results for the qualitative assessment of our model.

4.1. Datasets and Metrics

Two datasets of marine ships, MariBoats [5] and ShipInsSeg [48], were used. A brief description of each dataset can be found below.
MariBoats: The MariBoats dataset [5] is a collection of 6271 images of boats with 15,777 annotations. This collection comes from 13,717 images found through Google searches using specific keywords, focusing exclusively on the boat category. This dataset is publicly available and contains one class, i.e., boat. The dataset is randomly split into two sets: 80% for training and 20% for testing, with no low-quality, blurred, or redundant images. The annotations for this dataset are available in COCO format for instance segmentation.
ShipInsSeg: The ShipInsSeg dataset, which we annotated, consists of 5116 boat images curated from YouTube videos and contains a single category, i.e., boats. The dataset is complex due to environmental factors like wave activity, water reflections, crowded ships, and occlusions. The videos were collected from YouTube using a Creative Commons license, and the LabelMe tool [49] was used to label the images in polygon format for instance segmentation. The images have a resolution of 1280 × 720 and are split into 80% training and 20% testing.

4.2. Experimental Details

We used the MMDetection [50] toolkit to implement our proposed model using the experimental settings shown in Table 1. We based our model on the SOLOv2 [24] for benchmarking and comparison purposes. In our experiments, we employed a learning rate of 0.001, a weight decay of 0.0001, and a momentum of 0.9. Each model was trained for 12 epochs, changing the learning rate by 0.1 on the 8th and 11th epochs to increase learning efficiency. We utilized pre-trained weights for the backbone network to accelerate the training process. Additionally, the training optimization technique known as stochastic gradient descent was used. No extra hyperparameters in MMDetection were adjusted in these experiments.

4.3. Main Results

This section discusses the quantitative analysis conducted to evaluate the learning capabilities of our model on two datasets. Its performance was compared with other single-stage models using the COCO mean average precision evaluation metrics. The COCO evaluation metrics, commonly used for the evaluation of instance segmentation models, included average precision at different IoU thresholds, i.e., AP50, AP75, APS, APM, and APL. Moreover, the average precision (AP) and average recall (AR) were calculated based on the Intersection over Union (IoU). The IoU measures how well a predicted object matches the actual or ground-truth object. It calculates the overlap area divided by the union area, as shown below:
I O U = i n t e r s e c t ( x t , y t ) u n i o n ( x t , y t )
P r e c i s i o n = T P T P + F P
R e c a l l = T P T P + F N
where x t and y t represent the predicted object and the ground-truth object, respectively. Here, T P stands for true positives for cases when the model correctly predicted the presence of an object. F P denotes false positives for cases when the model incorrectly predicted an object’s presence. Lastly, F N stands for false negatives for cases when the model failed to detect an object that was actually present. To measure segmentation performance, we computed the average precision (AP) of all categories for each IoU threshold, as shown in Equation (8), and the average recall (AR), as shown in Equation (9). Precision is calculated by dividing the number of correctly detected positive cases (true positives) by the total number of positive instances, which includes both true and false positives. Recall is measured by dividing the number of true positives by the total of true positives and false negatives.
In Table 2, we present the results of the average precision (AP) across various IoU thresholds, with AP values ranging from 0.5 to 0.95, in increments of 0.05. The AP is divided into three categories according to the size of the object: APS for small objects, APM for medium objects, and APL for large objects. Our experimental results highlight the performance of the mask AP across these categories, from APS to APL.

4.3.1. Performance Evaluation

Results on MariBoats Dataset

Our proposed method was compared with three single-stage instance segmentation models, including YOLACT, SOLO, and SOLOv2, using different backbones (ResNet-50, ResNet-101, and Swin-T) on the MariBoats dataset. For our experiments, we selected the best single-stage models to compare with our model.
Our proposed method significantly improved segmentation performance, as shown in Table 3. In particular, by using Swin-T as the backbone network and our proposed MKA module, the performance of our method improved by 2.2% in the mask AP. Furthermore, when comparing AP50 and AP75, our model demonstrated improvements of 1.2% and 3%, respectively. We observed significant enhancements in APS and APL, although APM experienced a slight decrease of 0.6% compared to the SOLO-Decoupled model. Moreover, our model’s average recall (AR) achieved a performance gain of 57.5% compared to the other models. The AR for small objects (ARS) was 11.5%, 35.3% for medium objects (ARM), and 77.6% for large objects (ARL).
In Figure 4, we present the accuracy vs. epoch curves using various evaluation metrics. The graph shows the increasing trend in accuracy vs. number of epochs. There is a slight drop at the fourth epoch for the mask AP, along with other evaluation metrics like AP75, APM, and APL. Afterward, there is a significant increase toward the 12th epoch. Under the same training setup for our experiments, the learning abilities of our model are better than other state-of-the-art models.

Results on ShipInsSeg Dataset

The same results analysis structure and experimental setup were used for the ShipInsSeg dataset, as demonstrated in Table 4. We assessed three single-stage models with distinct backbones for the ShipInsSeg dataset. Our model performed significantly better than other single-stage instance segmentation techniques, improving the mask AP to 52.0%. It demonstrated a significant improvement of 2.2% over the second-best model, SOLOv2 [24], which is based on a ResNet-101 backbone. The segmentation results obtained using our method were superior, with 77.7% for AP50 and 54.7% for AP75. Furthermore, based on different object sizes, our approach performed well on medium objects with a gain of 70.7%, but it dropped by 1% for APS and 0.8% for APL when compared with the second-best approach (marked in bold text). Compared to other models, our model achieved an average recall (AR) of 56.2%. Our technique worked well with small, medium, and large objects in terms of average recall (AR). As seen in Table 4, SwinInsSeg performed better than the other methods, achieving scores of 33.0% for ARS, 74.9% for ARM, and 90.3% for ARL. For every model on the ShipInsSeg dataset, the accuracy versus epoch curves are displayed in Figure 5.

4.4. Ablation Experiments

This section uses the two datasets to examine three types of ablation studies. First, to measure the impact of the multi-kernel attention (MKA) module on instance segmentation performance, we compared the performance across five different scenarios: initially without the MKA module; then introducing the MKA module sequentially after stage 1, stages 1 and 2, and stages 1 through 3; and finally, incorporating the MKA module across all stages, from 1 to 4. In Table 5, we show the results of the ablation experiments based on the MariBoats dataset [5] for measuring the performance of the MKA module. We observed that adding the MKA module enhanced instance segmentation performance compared to not adding the MKA module. Furthermore, adding the MKA module at all stages from 1 to 4 improved instance segmentation performance in terms of the mask AP by 3.3% alongside enhancements in other evaluation metrics. Therefore, we added these four MKA modules at all stages for the best results. Similarly, for the ShipInsSeg dataset, as shown in Table 6, we observed that the absence of the MKA module resulted in no performance gains. However, adding the MKA module at each stage enhanced segmentation performance. Integrating MKA modules across all stages resulted in a significant increase in the mask AP of 4.4%, as well as enhancements in various COCO evaluation metrics, showcasing the module’s efficacy in improving instance segmentation.
Second, we conducted an ablation study of the MKA module using different backbones, as shown in Table 7 and Table 8. For the MariBoats and ShipInsSeg datasets, we observed that using the Swin-T backbone with the MKA module improved the AP by 1.5% and 1.2%, respectively. Additionally, our method showed a significant improvement in segmenting objects of various sizes for APS, APM, and APL.
Finally, we conducted ablation studies to evaluate the performance of each component of the full MKA module on the MariBoats and ShipInsSeg datasets, as shown in Table 9 and Table 10, respectively. We observed that the MKA module with skip connections improved the AP by 3.3% and 4.4% compared to the baseline model on the MariBoats and ShipInsSeg datasets. The performance increased significantly as CBAM was gradually integrated with greater kernel sizes (1 × 1, 3 × 3, 5 × 5, and 7 × 7) because larger kernels were able to capture more contextual information. Additionally, the skip connections enabled better feature fusion and improved segmentation performance, as they are essential for feature refinement and maintaining spatial and multiscale information.

4.5. Qualitative Results

This section discusses the visual results of our proposed model on the two datasets. The experiments demonstrate that our method can efficiently identify and segment ships.
MariBoats Dataset: The segmentation results on the MariBoats dataset using different backbones are displayed in Figure 6, which is organized alphabetically. According to the visual results, all models can detect and segment ships. Subfigure (a) shows the ground-truth images, along with their annotations (in polygon format). Compared with the other methods, the visual results in subfigure (l) demonstrate how our model effectively enhanced the mask quality. While it outperformed the other methods, as shown in subfigures (b) to (k), the visual results of the proposed SwinInsSeg model in subfigure (l) are superior in terms of the segmentation details of ships. We observed that our model could detect and segment new ships, as shown in subfigure (l), with the ships circled in yellow.
ShipInsSeg Dataset: The visual results on the ShipInsSeg dataset are presented in Figure 7, using different models and backbones in subfigures (b) to (l). Subfigure (a) shows the ground-truth images. We observed that certain models had difficulties detecting and segmenting ships due to the scale variation in the ships. The best visual results for ship segmentation obtained by our model are shown in Figure 7.
Our model, SwinInsSeg, reduced the problem of scale variation in ships, as shown in subfigure (l), and could accurately detect and segment ships. Furthermore, our model efficiently recognized and segmented multiple ships. Our model also detected and segmented new ships, which are represented by a yellow circle.

5. Discussion

The SwinInsSeg model is a single-stage segmentation method for precise ship instance segmentation in marine environments. It uses the Swin transformer to capture long-range dependencies, making it suitable for modeling complex visual patterns. The model incorporates a multi-kernel attention module to process features at multiple scales through different kernel sizes to enhance feature extraction and discard irrelevant features using attention. The results show improved segmentation accuracy and visual performance; however, the proposed model increases computational demands, leading to a lower frame-per-second rate that does not meet real-time performance requirements. Future work could improve SwinInsSeg’s computational efficiency by customizing the backbone with lightweight techniques like Depth-wise Separable Convolutions or the GhostNet module. This would reduce computational costs during feature extraction while maintaining the model’s ability to capture critical features, aiming to improve the frame-per-second rate and segmentation accuracy.

6. Conclusions

In this paper, we developed an effective architecture for ship instance segmentation. We proposed a single-stage instance segmentation model known as SwinInsSeg by incorporating the Swin transformer and multi-kernel attention module, making it effective for maritime surveillance. We chose the Swin transformer over conventional CNN-based backbones because it captures long-range dependencies more effectively. We designed a hierarchical self-attention mechanism in the sliding-window approach that generates effective feature maps. Our model’s learning capabilities were significantly improved by enhancing key features via our multi-kernel attention (MKA) module and subsequent aggregation of these refined features. To validate the effectiveness of our method, we conducted extensive experiments on two datasets. Future work will further refine our model to address the complex challenges of multi-class ship datasets. Moreover, using video sequences and adding multi-object trackers will further improve segmentation, making it a more versatile and powerful tool for maritime surveillance.

Author Contributions

Conceptualization, R.S. and M.S.; methodology, R.S.; software, R.S.; validation, M.S., C.-T.L. and M.B.; investigation, M.S.; writing—original draft preparation, R.S. and M.S.; writing—review and editing, R.S., M.S., and M.B.; supervision, M.S. and M.B. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

MariBoats dataset available in https://github.com/s2120200252/Visible-ship-dataset and ShipInsSeg dataset upon request to the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Shao, Z.; Wu, W.; Wang, Z.; Du, W.; Li, C. Seaships: A large-scale precisely annotated dataset for ship detection. IEEE Trans. Multimed. 2018, 20, 2593–2604. [Google Scholar] [CrossRef]
  2. Zhang, Y.; Li, Q.Z.; Zang, F.N. Ship detection for visual maritime surveillance from non-stationary platforms. Ocean. Eng. 2017, 141, 53–63. [Google Scholar] [CrossRef]
  3. Zhang, W.; He, X.; Li, W.; Zhang, Z.; Luo, Y.; Su, L.; Wang, P. An integrated ship segmentation method based on discriminator and extractor. Image Vis. Comput. 2020, 93, 103824. [Google Scholar] [CrossRef]
  4. Sun, Y.; Su, L.; Luo, Y.; Meng, H.; Li, W.; Zhang, Z.; Wang, P.; Zhang, W. Global Mask R-CNN for marine ship instance segmentation. Neurocomputing 2022, 480, 257–270. [Google Scholar] [CrossRef]
  5. Sun, Z.; Meng, C.; Huang, T.; Zhang, Z.; Chang, S. Marine ship instance segmentation by deep neural networks using a global and local attention (GALA) mechanism. PLoS ONE 2023, 18, e0279248. [Google Scholar] [CrossRef]
  6. Nalamati, M.; Sharma, N.; Saqib, M.; Blumenstein, M. Automated monitoring in maritime video surveillance system. In Proceedings of the 2020 35th International Conference on Image and Vision Computing New Zealand (IVCNZ), Wellington, New Zealand, 25–27 November 2020; pp. 1–6. [Google Scholar]
  7. Nalamati, M.; Saqib, M.; Sharma, N.; Blumenstein, M. Exploring Transformers for Intruder Detection in Complex Maritime Environment. In Proceedings of the Australasian Joint Conference on Artificial Intelligence, Sydney, NSW, Australia, 2–4 February 2022; pp. 428–439. [Google Scholar]
  8. Park, H.; Ham, S.H.; Kim, T.; An, D. Object recognition and tracking in moving videos for maritime autonomous surface ships. J. Mar. Sci. Eng. 2022, 10, 841. [Google Scholar] [CrossRef]
  9. Xing, Z.; Ren, J.; Fan, X.; Zhang, Y. S-DETR: A Transformer Model for Real-Time Detection of Marine Ships. J. Mar. Sci. Eng. 2023, 11, 696. [Google Scholar] [CrossRef]
  10. Xu, J.; Sun, X.; Zhang, D.; Fu, K. Automatic detection of inshore ships in high-resolution remote sensing images using robust invariant generalized Hough transform. IEEE Geosci. Remote Sens. Lett. 2014, 11, 2070–2074. [Google Scholar]
  11. Zhang, S.; Wu, R.; Xu, K.; Wang, J.; Sun, W. R-CNN-based ship detection from high resolution remote sensing imagery. Remote Sens. 2019, 11, 631. [Google Scholar] [CrossRef]
  12. Yao, Y.; Jiang, Z.; Zhang, H.; Zhao, D.; Cai, B. Ship detection in optical remote sensing images based on deep convolutional neural networks. J. Appl. Remote Sens. 2017, 11, 042611. [Google Scholar] [CrossRef]
  13. Huang, G.; Wan, Z.; Liu, X.; Hui, J.; Wang, Z.; Zhang, Z. Ship detection based on squeeze excitation skip-connection path networks for optical remote sensing images. Neurocomputing 2019, 332, 215–223. [Google Scholar] [CrossRef]
  14. Huang, L.; Liu, B.; Li, B.; Guo, W.; Yu, W.; Zhang, Z.; Yu, W. OpenSARShip: A dataset dedicated to Sentinel-1 ship interpretation. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2017, 11, 195–208. [Google Scholar] [CrossRef]
  15. Liu, Z.; Yuan, L.; Weng, L.; Yang, Y. A high resolution optical satellite image dataset for ship recognition and some new baselines. In Proceedings of the International Conference on Pattern Recognition Applications and Methods, Porto, Portugal, 24–26 February 2017; Volume 2, pp. 324–331. [Google Scholar]
  16. Ouchi, K.; Tamaki, S.; Yaguchi, H.; Iehara, M. Ship detection based on coherence images derived from cross correlation of multilook SAR images. IEEE Geosci. Remote Sens. Lett. 2004, 1, 184–187. [Google Scholar] [CrossRef]
  17. Han, J.; Liang, K.; Zhou, B.; Zhu, X.; Zhao, J.; Zhao, L. Infrared small target detection utilizing the multiscale relative local contrast measure. IEEE Geosci. Remote Sens. Lett. 2018, 15, 612–616. [Google Scholar] [CrossRef]
  18. Bai, X.; Liu, M.; Wang, T.; Chen, Z.; Wang, P.; Zhang, Y. Feature based fuzzy inference system for segmentation of low-contrast infrared ship images. Appl. Soft Comput. 2016, 46, 128–142. [Google Scholar] [CrossRef]
  19. Shaodan, L.; Chen, F.; Zhide, C. A ship target location and mask generation algorithms base on Mask RCNN. Int. J. Comput. Intell. Syst. 2019, 12, 1134–1143. [Google Scholar] [CrossRef]
  20. Chen, X.; Chen, H.; Wu, H.; Huang, Y.; Yang, Y.; Zhang, W.; Xiong, P. Robust visual ship tracking with an ensemble framework via multi-view learning and wavelet filter. Sensors 2020, 20, 932. [Google Scholar] [CrossRef]
  21. Sharma, R.; Saqib, M.; Lin, C.; Blumenstein, M. MASSNet: Multiscale Attention for Single-Stage Ship Instance Segmentation. Neurocomputing 2024, 594, 127830. [Google Scholar] [CrossRef]
  22. He, K.; Gkioxari, G.; Dollár, P.; Girshick, R. Mask r-cnn. In Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017; pp. 2961–2969. [Google Scholar]
  23. Ren, S.; He, K.; Girshick, R.; Sun, J. Faster r-cnn: Towards real-time object detection with region proposal networks. Adv. Neural Inf. Process. Syst. 2015. [Google Scholar] [CrossRef] [PubMed]
  24. Wang, X.; Zhang, R.; Kong, T.; Li, L.; Shen, C. Solov2: Dynamic and fast instance segmentation. Adv. Neural Inf. Process. Syst. 2020, 33, 17721–17732. [Google Scholar]
  25. Girshick, R. Fast r-cnn. In Proceedings of the IEEE International Conference on Computer Vision, Santiago, Chile, 7–13 December 2015; pp. 1440–1448. [Google Scholar]
  26. Newell, A.; Huang, Z.; Deng, J. Associative embedding: End-to-end learning for joint detection and grouping. Adv. Neural Inf. Process. Syst. 2017. [Google Scholar] [CrossRef]
  27. De Brabandere, B.; Neven, D.; Van Gool, L. Semantic instance segmentation with a discriminative loss function. arXiv 2017, arXiv:1708.02551. [Google Scholar]
  28. Liu, S.; Jia, J.; Fidler, S.; Urtasun, R. Sgn: Sequential grouping networks for instance segmentation. In Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017; pp. 3496–3504. [Google Scholar]
  29. Lin, T.Y.; Goyal, P.; Girshick, R.; He, K.; Dollár, P. Focal loss for dense object detection. In Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017; pp. 2980–2988. [Google Scholar]
  30. Law, H.; Deng, J. Cornernet: Detecting objects as paired keypoints. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 734–750. [Google Scholar]
  31. Duan, K.; Bai, S.; Xie, L.; Qi, H.; Huang, Q.; Tian, Q. Centernet: Keypoint triplets for object detection. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Seoul, Republic of Korea, 27 October–2 November 2019; pp. 6569–6578. [Google Scholar]
  32. Bolya, D.; Zhou, C.; Xiao, F.; Lee, Y.J. Yolact: Real-time instance segmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Seoul, Republic of Korea, 27 October–2 November 2019; pp. 9157–9166. [Google Scholar]
  33. Wang, X.; Kong, T.; Shen, C.; Jiang, Y.; Li, L. Solo: Segmenting objects by locations. In Proceedings of the Computer Vision–ECCV 2020: 16th European Conference, Glasgow, UK, 23–28 August 2020; Proceedings, Part XVIII 16. Springer: Berlin/Heidelberg, Germany, 2020; pp. 649–665. [Google Scholar]
  34. Dosovitskiy, A.; Beyer, L.; Kolesnikov, A.; Weissenborn, D.; Zhai, X.; Unterthiner, T.; Dehghani, M.; Minderer, M.; Heigold, G.; Gelly, S.; et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv 2020, arXiv:2010.11929. [Google Scholar]
  35. Wang, W.; Xie, E.; Li, X.; Fan, D.P.; Song, K.; Liang, D.; Lu, T.; Luo, P.; Shao, L. Pyramid vision transformer: A versatile backbone for dense prediction without convolutions. In Proceedings of the IEEE/CVF International Conference on Computer Vision; pp. 568–578.
  36. He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 770–778. [Google Scholar]
  37. Cheng, B.; Misra, I.; Schwing, A.G.; Kirillov, A.; Girdhar, R. Masked-attention mask transformer for universal image segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA, 18–24 June 2022; pp. 1290–1299. [Google Scholar]
  38. Liu, Z.; Lin, Y.; Cao, Y.; Hu, H.; Wei, Y.; Zhang, Z.; Lin, S.; Guo, B. Swin transformer: Hierarchical vision transformer using shifted windows. In Proceedings of the IEEE/CVF International Conference on Computer Vision; pp. 10012–10022.
  39. Schwehr, K. Vessel tracking using the automatic identification system (AIS) during emergency response: Lessons from the Deepwater Horizon incident. Cent. Coast. Ocean. Mapping/Joint Hydrogr. Cent. 2011. [Google Scholar]
  40. Nikolió, D.; Popovic, Z.; Borenovió, M.; Stojkovió, N.; Orlić, V.; Dzvonkovskaya, A.; Todorovic, B.M. Multi-radar multi-target tracking algorithm for maritime surveillance at OTH distances. In Proceedings of the 2016 17th International Radar Symposium (IRS); pp. 1–6.
  41. Sharma, N.; Scully-Power, P.; Blumenstein, M. Shark detection from aerial imagery using region-based CNN, a study. In Proceedings of the AI 2018: Advances in Artificial Intelligence: 31st Australasian Joint Conference, Wellington, New Zealand, 11–14 December 2018; Proceedings 31. Springer: Berlin/Heidelberg, Germany, 2018; pp. 224–236. [Google Scholar]
  42. Saqib, M.; Khan, S.D.; Sharma, N.; Scully-Power, P.; Butcher, P.; Colefax, A.; Blumenstein, M. Real-time drone surveillance and population estimation of marine animals from aerial imagery. In Proceedings of the 2018 International Conference on Image and Vision Computing New Zealand (IVCNZ); pp. 1–6.
  43. Nalamati, M.; Kapoor, A.; Saqib, M.; Sharma, N.; Blumenstein, M. Drone detection in long-range surveillance videos. In Proceedings of the 2019 16th IEEE International Conference on Advanced Video and Signal Based Surveillance (AVSS), Taipei, Taiwan, 18–21 September 2019; pp. 1–6. [Google Scholar]
  44. Zou, Y.; Zhao, L.; Qin, S.; Pan, M.; Li, Z. Ship target detection and identification based on SSD_MobilenetV2. In Proceedings of the 2020 IEEE 5th Information Technology and Mechatronics Engineering Conference (ITOEC), Chongqing, China, 12–14 June 2020; pp. 1676–1680. [Google Scholar]
  45. Sun, Y.; Su, L.; Cui, H.; Chen, Y.; Yuan, S. Ship instance segmentation in foggy scene. In Proceedings of the 2021 40th Chinese Control Conference (CCC), Shanghai, China, 26–28 July 2021; pp. 8340–8345. [Google Scholar]
  46. Sun, Y.; Su, L.; Luo, Y.; Meng, H.; Zhang, Z.; Zhang, W.; Yuan, S. Irdclnet: Instance segmentation of ship images based on interference reduction and dynamic contour learning in foggy scenes. IEEE Trans. Circuits Syst. Video Technol. 2022, 32, 6029–6043. [Google Scholar] [CrossRef]
  47. Woo, S.; Park, J.; Lee, J.Y.; Kweon, I.S. Cbam: Convolutional block attention module. In Proceedings of the European Conference on Computer Vision (ECCV); pp. 3–19.
  48. Sharma, R.; Saqib, M.; Lin, C.; Blumenstein, M. Maritime Surveillance Using Instance Segmentation Techniques. In Proceedings of the International Conference on Data Science and Communication; Springer: Berlin/Heidelberg, Germany, 2023; pp. 31–47. [Google Scholar]
  49. Russell, B.C.; Torralba, A.; Murphy, K.P.; Freeman, W.T. LabelMe: A database and web-based tool for image annotation. Int. J. Comput. Vis. 2008, 77, 157–173. [Google Scholar] [CrossRef]
  50. Chen, K.; Wang, J.; Pang, J.; Cao, Y.; Xiong, Y.; Li, X.; Sun, S.; Feng, W.; Liu, Z.; Xu, J.; et al. MMDetection: Open mmlab detection toolbox and benchmark. arXiv 2019, arXiv:1906.07155. [Google Scholar]
Figure 1. Overall structure of the SwinInsSeg framework, with the backbone consisting of the Swin-T transformer and comprising four stages (red-dashed rectangular box). The output of each stage is passed through the multi-kernel attention (MKA) module to enhance the feature maps. The neck (green-dashed rectangular box) comprises the feature pyramid network (FPN), which captures objects across different feature maps. Finally, the mask head (yellow-dashed rectangular box) generates the instance masks.
Figure 1. Overall structure of the SwinInsSeg framework, with the backbone consisting of the Swin-T transformer and comprising four stages (red-dashed rectangular box). The output of each stage is passed through the multi-kernel attention (MKA) module to enhance the feature maps. The neck (green-dashed rectangular box) comprises the feature pyramid network (FPN), which captures objects across different feature maps. Finally, the mask head (yellow-dashed rectangular box) generates the instance masks.
Mathematics 13 00165 g001
Figure 2. A pair of Swin transformer blocks. The initial block contains the W-MSA module, whereas the subsequent block contains the SW-MSA module.
Figure 2. A pair of Swin transformer blocks. The initial block contains the W-MSA module, whereas the subsequent block contains the SW-MSA module.
Mathematics 13 00165 g002
Figure 3. The proposed multi-kernel attention module. The output of each stage in the Swin transformer backbone, as shown in Figure 1, is fed as input to our MKA module, where feature maps are enhanced using different kernels for different object sizes. To focus on important feature maps, we use the CBAM attention mechanism for further refinement and concatenation. The red rectangular box highlights the CBAM mechanism.
Figure 3. The proposed multi-kernel attention module. The output of each stage in the Swin transformer backbone, as shown in Figure 1, is fed as input to our MKA module, where feature maps are enhanced using different kernels for different object sizes. To focus on important feature maps, we use the CBAM attention mechanism for further refinement and concatenation. The red rectangular box highlights the CBAM mechanism.
Mathematics 13 00165 g003
Figure 4. Accuracy vs. epoch curves for the MariBoats dataset, evaluated using the COCO metrics. (a) The AP curve, which highlights the overall performance of the models over the training epochs. (b) The AP50 curve. (c) The AP75 curve, which indicates performance at an IoU threshold of 75%. (d) The APS curve. (e) The APM curve, which evaluates medium-sized ships. (f) The APL curve. Our SwinInsSeg curves are shown in indigo blue. (Best viewed in color).
Figure 4. Accuracy vs. epoch curves for the MariBoats dataset, evaluated using the COCO metrics. (a) The AP curve, which highlights the overall performance of the models over the training epochs. (b) The AP50 curve. (c) The AP75 curve, which indicates performance at an IoU threshold of 75%. (d) The APS curve. (e) The APM curve, which evaluates medium-sized ships. (f) The APL curve. Our SwinInsSeg curves are shown in indigo blue. (Best viewed in color).
Mathematics 13 00165 g004
Figure 5. Accuracy vs. epoch curves for the ShipInsSeg dataset, evaluated using the COCO metrics. (a) The AP curve, which highlights the overall performance of the models over the training epochs. (b) The AP50 curve. (c) The AP75 curve, which indicates performance at an IoU threshold of 75%. (d) The APS curve. (e) The APM curve, which evaluates medium-sized ships. (f) The APL curve. Our SwinInsSeg curves are shown in indigo blue. (Best viewed in color).
Figure 5. Accuracy vs. epoch curves for the ShipInsSeg dataset, evaluated using the COCO metrics. (a) The AP curve, which highlights the overall performance of the models over the training epochs. (b) The AP50 curve. (c) The AP75 curve, which indicates performance at an IoU threshold of 75%. (d) The APS curve. (e) The APM curve, which evaluates medium-sized ships. (f) The APL curve. Our SwinInsSeg curves are shown in indigo blue. (Best viewed in color).
Mathematics 13 00165 g005
Figure 6. Visual results of different methods on the MariBoats dataset. (a) Ground-truth images. (bl) Visual results of the SOLO-ResNet-50, SOLO-ResNet-101, SOLO-Decoupled, SOLO-Swin-T, SOLOv2-ResNet-50, SOLOv2-ResNet-101, SOLOv2-Swin-T, YOLACT-ResNet-50, YOLACT-ResNet-101, YOLACT-Swin-T, and SwinInsSeg (ours) models, respectively. Newly detected and segmented objects are marked in yellow. (Best viewed in color).
Figure 6. Visual results of different methods on the MariBoats dataset. (a) Ground-truth images. (bl) Visual results of the SOLO-ResNet-50, SOLO-ResNet-101, SOLO-Decoupled, SOLO-Swin-T, SOLOv2-ResNet-50, SOLOv2-ResNet-101, SOLOv2-Swin-T, YOLACT-ResNet-50, YOLACT-ResNet-101, YOLACT-Swin-T, and SwinInsSeg (ours) models, respectively. Newly detected and segmented objects are marked in yellow. (Best viewed in color).
Mathematics 13 00165 g006aMathematics 13 00165 g006b
Figure 7. Visual results of different methods on the ShipInsSeg dataset. (a) Ground-truth images. (bl) Visual results of the SOLO-ResNet-50, SOLO-ResNet-101, SOLO-Decoupled, SOLO-Swin-T, SOLOv2-ResNet-50, SOLOv2-ResNet-101, SOLOv2-Swin-T, YOLACT-ResNet-50, YOLACT-ResNet-101, YOLACT-Swin-T, and SwinInsSeg (ours) models, respectively. Newly detected and segmented objects are marked in yellow. (Best viewed in color).
Figure 7. Visual results of different methods on the ShipInsSeg dataset. (a) Ground-truth images. (bl) Visual results of the SOLO-ResNet-50, SOLO-ResNet-101, SOLO-Decoupled, SOLO-Swin-T, SOLOv2-ResNet-50, SOLOv2-ResNet-101, SOLOv2-Swin-T, YOLACT-ResNet-50, YOLACT-ResNet-101, YOLACT-Swin-T, and SwinInsSeg (ours) models, respectively. Newly detected and segmented objects are marked in yellow. (Best viewed in color).
Mathematics 13 00165 g007aMathematics 13 00165 g007b
Table 1. Configuration list.
Table 1. Configuration list.
Configuration SettingsVersion
Operating SystemUbuntu 18.04.6 LTS
GPUNVIDIA Quadro P6000
Memory24 GB
Deep Learning FrameworkPyTorch 1.7
MMCV1.7.1
CUDA10.2
MMDETECTION2.27.0
Table 2. The AP values across various IOU thresholds and object sizes.
Table 2. The AP values across various IOU thresholds and object sizes.
SymbolDescriptionObject Size
APIOU at 0.5; 0.95; 0.05-
AP50IOU at 0.5-
AP75IOU at 0.75-
APSSmall objects a r e a < 32 2
APMMedium objects 32 2 < a r e a < 96 2
APLLarge objects a r e a > 96 2
Table 3. Comparison results of the mask AP on the MariBoats dataset.
Table 3. Comparison results of the mask AP on the MariBoats dataset.
MethodBackboneAPAP50AP75APSAPMAPLARARSARMARLParams (M)FPS
YOLACT [32]ResNet-5036.566.435.72.815.051.546.011.027.061.634.7319.429
YOLACT [32]ResNet-10138.567.438.33.014.954.547.310.427.663.853.7216.287
YOLACT [32]Swin-T41.568.143.73.013.059.349.311.027.866.970.329.96
SOLO [33]ResNet-5040.661.546.01.27.861.145.32.315.866.935.8914.563
SOLO [33]ResNet-10140.861.846.40.88.061.646.02.015.768.054.8912.699
SOLO [33]Swin-T39.760.545.10.97.460.444.71.813.766.771.4510.67
SOLO-Decoupled [33]ResNet-5048.474.254.53.420.668.155.07.433.374.939.6214.057
SOLOv2 [24]ResNet-5045.971.749.63.217.165.554.18.031.676.046.017.722
SOLOv2 [24]ResNet-10148.372.851.74.018.768.355.79.431.676.065.5913.457
SOLOv2 [24]Swin-T47.371.250.73.515.368.053.99.228.574.380.512.486
SwinInsSeg (ours)Swin-T50.675.454.74.220.071.157.511.535.377.690.511.55
Table 4. Comparison results of the mask AP on the ShipInsSeg dataset.
Table 4. Comparison results of the mask AP on the ShipInsSeg dataset.
MethodBackboneAPAP50AP75APSAPMAPLARARSARMARLParams (M)FPS
YOLACT [32]ResNet-5036.562.936.112.454.958.544.720.861.572.734.7313.617
YOLACT [32]ResNet-10141.168.942.113.560.467.648.323.965.875.853.7210.76
YOLACT [32]Swin-T48.677.050.422.765.874.955.232.970.980.970.408.17
SOLO [33]ResNet-5029.240.332.23.146.263.033.04.451.670.635.898.217
SOLO [33]ResNet-10128.539.531.52.545.262.632.94.151.371.654.897.061
SOLO [33]Swin-T26.636.829.22.541.759.230.43.547.068.171.526.80
SOLO-Decoupled [33]ResNet-5049.373.253.316.870.185.153.523.774.488.539.628.194
SOLOv2 [24]ResNet-5048.371.750.516.567.885.652.323.171.988.546.011.510
SOLOv2 [24]ResNet-10149.873.452.717.469.687.653.423.873.990.165.598.59
SOLOv2 [24]Swin-T47.670.849.916.266.885.851.422.370.988.282.347.34
SwinInsSeg (ours)Swin-T52.077.754.721.770.786.856.233.074.990.391.557.05
Table 5. Effectiveness of the MKA module on the MariBoats dataset.
Table 5. Effectiveness of the MKA module on the MariBoats dataset.
MethodAPAP50AP75APSAPMAPL
Swin-T47.371.250.73.515.368.0
Swin-T + MKA at stage 147.972.051.53.6516.0968.55
Swin-T + MKA at stages 1 and 248.572.953.13.7818.5570.05
Swin-T + MKA at stages 1, 2, and 349.773.553.63.9919.3570.6
Swin-T + MKA at all stages50.675.454.74.220.071.1
Table 6. Effectiveness of the MKA module on the ShipInsSeg dataset.
Table 6. Effectiveness of the MKA module on the ShipInsSeg dataset.
MethodAPAP50AP75APSAPMAPL
Swin-T47.670.849.916.266.885.8
Swin-T + MKA at stage 149.1572.7750.817.5567.985.96
Swin-T + MKA at stages 1 and 249.8774.0352.518.9068.586.09
Swin-T + MKA at stages 1, 2, and 351.3575.9553.420.1068.9886.6
Swin-T + MKA at all stages52.077.754.721.770.786.8
Table 7. Different backbones using the MKA module on the MariBoats dataset.
Table 7. Different backbones using the MKA module on the MariBoats dataset.
BackboneAPAP50AP75APSAPMAPL
ResNet-50 + MKA at all stages46.772.550.93.817.568.9
ResNet-101 + MKA at all stages49.173.452.44.119.269.9
Swin-T + MKA at all stages50.675.454.74.220.071.1
Table 8. Different backbones using the MKA module on the ShipInsSeg dataset.
Table 8. Different backbones using the MKA module on the ShipInsSeg dataset.
BackboneAPAP50AP75APSAPMAPL
ResNet-50 + MKA at all stages49.672.352.218.168.585.9
ResNet-101 + MKA at all stages50.875.853.419.970.187.8
Swin-T + MKA at all stages52.077.754.721.770.786.8
Table 9. Evaluation of the MKA module on the MariBoats dataset.
Table 9. Evaluation of the MKA module on the MariBoats dataset.
MethodAPAP50AP75APSAPMAPL
Baseline Model47.371.250.73.515.368.0
1 × 1 with CBAM47.871.851.23.6516.568.5
3 × 3 with CBAM48.472.552.03.8317.769.2
5 × 5 with CBAM48.173.652.93.9818.570.1
7 × 7 with CBAM49.274.553.84.0519.470.95
Full MKA with skip connections50.675.454.74.220.071.1
Table 10. Evaluation of the MKA module on the ShipInsSeg dataset.
Table 10. Evaluation of the MKA module on the ShipInsSeg dataset.
MethodAPAP50AP75APSAPMAPL
Baseline Model47.670.849.916.266.885.8
1 × 1 with CBAM48.572.350.717.768.185.4
3 × 3 with CBAM49.273.951.619.168.9585.9
5 × 5 with CBAM50.475.152.8819.969.686.2
7 × 7 with CBAM51.276.554.0520.970.186.5
Full MKA with skip connections52.077.754.721.770.786.8
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Sharma, R.; Saqib, M.; Lin, C.-T.; Blumenstein, M. SwinInsSeg: An Improved SOLOv2 Model Using the Swin Transformer and a Multi-Kernel Attention Module for Ship Instance Segmentation. Mathematics 2025, 13, 165. https://doi.org/10.3390/math13010165

AMA Style

Sharma R, Saqib M, Lin C-T, Blumenstein M. SwinInsSeg: An Improved SOLOv2 Model Using the Swin Transformer and a Multi-Kernel Attention Module for Ship Instance Segmentation. Mathematics. 2025; 13(1):165. https://doi.org/10.3390/math13010165

Chicago/Turabian Style

Sharma, Rabi, Muhammad Saqib, Chin-Teng Lin, and Michael Blumenstein. 2025. "SwinInsSeg: An Improved SOLOv2 Model Using the Swin Transformer and a Multi-Kernel Attention Module for Ship Instance Segmentation" Mathematics 13, no. 1: 165. https://doi.org/10.3390/math13010165

APA Style

Sharma, R., Saqib, M., Lin, C.-T., & Blumenstein, M. (2025). SwinInsSeg: An Improved SOLOv2 Model Using the Swin Transformer and a Multi-Kernel Attention Module for Ship Instance Segmentation. Mathematics, 13(1), 165. https://doi.org/10.3390/math13010165

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop