Despite recent progress in SAR maritime monitoring, ship classification remains challenging due to limited labeled data, class imbalance, large intra-class variability, fine-grained inter-class similarity, and variations in target scale, orientation, and backscattering structure. To address these challenges, this paper proposes MARLIN, a class-frequency-aware framework with directional sparse and hierarchical multi-scale feature extraction for ship type classification in SAR images. The proposed architecture first constructs two complementary representations of each input image, where each views are processed by parallel encoder branches. Each branch begins with a directional sparse convolutional stem designed to capture elongated and orientation-dependent ship scattering patterns, followed by customized hierarchical multiscale feature extraction blocks. To improve learning under imbalanced class distributions, we introduce a class-frequency aware objective. The proposed objective combines margin-based classification with class-frequency-weighted prototype compactness and class-pair frequency weighted margin separation. This formulation shapes the embedding space by encouraging samples from the same class to form compact clusters while enforcing stronger separation for class pairs involving underrepresented ship categories. Extensive experiments on three complementary datasets demonstrate that in addition to being lightweight and parameter efficient, MARLIN improves both overall accuracy and class-balanced metrics, confirming its effectiveness for robust SAR ship-type classification under limited and imbalanced training conditions. The codes are available at github.com/benyaminhosseiny/marlin.
Figures & tables
Fig. 1: Overview of the proposed MARLIN for ship type classification
Fig. 2: Visualization of the Directional Sparse Convolutional Stem. The upper subfigure shows the fixed orientation masks, and the lower subfigure shows the corresponding directional sparse kernels.
Fig. 3: Structure of the proposed hierarchical multi-scale feature extraction block. The input feature map F(ℓ−1) is processed by parallel dilated convolution branches with different dilation rates d∈D and a deformable convolution branch. The branch outputs are concatenated along the channel dimension to form Fcat(ℓ) , followed by a 1×1 pointwise projection to obtain Fproj(ℓ) . After adding a residual shortcut from the input features, the resulting feature map Fres(ℓ) is downsampled using mixed average–max pooling, producing the block output F(ℓ) for the next stage.
Fig. 4: Overview of the proposed intra-class compactness and inter-class separation objectives. In the embedding space, the Frequency-Aware Prototype Compactness term pulls each sample embedding zi toward its corresponding class prototype μyi , with the compactness strength controlled by the class-frequency-dependent weight wyiintra . The Pairwise Frequency-Weighted Margin Separation term enforces separation between samples from different classes, where the pairwise inter-class weight wyi,yjinter assigns stronger penalties to class pairs involving underrepresented classes, encouraging better separation of minority ship categories.
Model
OA (%)
AA (%)
APr (%)
AF1 (%)
ResNet50 [ 27 ]
76.7±2.0
75.5±2.1
77.2±1.5
75.8±2.2
EffiNetV2-M [ 28 ]
77.2±2.8
76.1±2.7
78.0±1.4
76.6±2.4
ViT [ 30 ]
77.2±2.8
76.1±2.7
78.0±1.4
76.6±2.4
DenseNet121 [ 29 ]
77.0±1.0
75.7±2.4
77.4±1.3
76.1±1.7
DenseNet201 [ 29 ]
77.5±2.1
76.5±2.1
77.6±2.4
76.8±2.2
SAR-JEPA [ 23 ]
77.8±1.8
75.9±3.7
77.9±4.3
76.8±2.3
TABLE I: Performance comparison on the OpenSARShip four-class classification dataset. The best and second-best results are shown in bold and underlined, respectively.
Fig. 5: Confusion matrices for the OpenSARShip four-class classification experiments. The first row shows the results of the proposed model, while the second row shows the results of the best-performing state-of-the-art model. (a) raw confusion matrix, (b) row-normalized confusion matrix (recall), and (c) column-normalized confusion matrix (precision).
Model
OA (%)
AA (%)
APr (%)
AF1 (%)
ResNet50 [ 27 ]
68.0±2.9
48.0±2.5
48.6±4.8
46.9±2.8
EffitNetV2-M [ 28 ]
67.1±1.5
48.3±3.4
46.3±1.9
46.4±3.0
ViT [ 30 ]
54.4±8.7
34.1±10.1
30.6±14.5
30.4±12.3
DenseNet121 [ 29 ]
73.4±2.0
54.0±4.0
55.9±8.1
53.2±4.1
DenseNet201 [ 29 ]
69.6±2.7
49.1±3.0
49.4±6.1
48.3±3.0
SAR-JEPA [ 23 ]
72.4±2.5
54.0±5.6
63.3±10.0
55.5±6.8
TABLE II: Performance comparison on OpenSARShip six-class classification dataset (the best, and second-best performing results are shown in bold, and underlined, respectively).
Fig. 6: Confusion matrices for the OpenSARShip six-class classification experiments. The first row shows the results of the proposed model, while the second row shows the results of the best-performing state-of-the-art model. (a) raw confusion matrix, (b) row-normalized confusion matrix (recall), and (c) column-normalized confusion matrix (precision).
Model
OA (%)
AA (%)
APr (%)
AF1 (%)
ResNet50 [ 27 ]
67.0±2.9
64.4±3.0
66.2±3.2
64.6±3.0
EffiNetV2-M [ 28 ]
70.8±2.4
67.8±1.9
71.2±3.4
68.5±2.4
ViT [ 30 ]
66.8±3.6
62.5±3.0
68.0±4.0
63.8±3.7
DenseNet121 [ 29 ]
68.8±2.2
66.4±2.4
68.6±2.7
66.8±2.4
DenseNet201 [ 29 ]
70.2±2.7
67.5±3.2
70.3±3.2
67.8±3.5
SAR-JEPA [ 23 ]
67.4±3.2
65.1±3.2
66.9±1.7
65.7±2.5
TABLE III: Performance comparison on NASTaR dataset (the best, and second-best performing results are shown in bold, and underlined, respectively).
Fig. 7: Confusion matrices for the NASTaR classification experiments. The first row shows the results of the proposed model, while the second row shows the results of the best-performing state-of-the-art model. (a) raw confusion matrix, (b) row-normalized confusion matrix (recall), and (c) column-normalized confusion matrix (precision).
Model
OA (%)
AA (%)
APr (%)
AF1 (%)
ResNet50 [ 27 ]
76.0±3.7
49.1±5.3
55.8±9.7
49.9±5.3
EffiNetV2-M [ 28 ]
73.1±2.6
43.3±3.0
58.0±5.2
46.7±2.8
ViT [ 30 ]
62.3±4.6
26.4±8.8
19.2±10.2
21.9±9.7
DenseNet121 [ 29 ]
79.4±3.1
56.5±3.2
58.5±4.2
56.4±2.6
DenseNet201 [ 29 ]
81.2±1.9
54.4±2.3
58.5±2.9
54.9±1.8
SAR-JEPA [ 23 ]
82.4±1.3
56.1±3.0
57.4±5.3
56.3±3.9
TABLE IV: Performance comparison on FUSAR-Ship dataset (the best, and second-best performing results are shown in bold, and underlined, respectively).
Fig. 8: Confusion matrices for the FUSAR classification experiments. The first row shows the results of the proposed model, while the second row shows the results of the best-performing state-of-the-art model. (a) raw confusion matrix, (b) row-normalized confusion matrix (recall), and (c) column-normalized confusion matrix (precision).
Fig. 9: Performance under different training sample percentages on OpenSARShip.
Configuration
OA (%)
AA (%)
APr (%)
AF1 (%)
MSFE1: 64
77.0±1.4
75.3±1.4
75.3±1.7
75.2±1.5
MSFE2: 64, 128
78.8±0.9
77.3±1.0
77.5±1.6
77.3±1.0
MSFE3: 64, 128, 256
80.8±0.9
78.9±1.0
80.3±0.9
79.4±0.8
MSFE4: 64, 128, 256, 512
80.2±0.6
78.5±0.6
79.7±0.7
79.0±0.3
No Directional: 64, 128, 256
80.1±1.5
78.2±1.4
79.1±1.4
78.5±1.4
Cross-Entropy: 64, 128, 256
79.7±1.0
77.5±1.2
79.7±0.9
78.4±0.9
TABLE V: Ablation study results on the OpenSARShip four-class scenario.
Fig. 10: Model complexity comparison with the state-of-the-art.
Fig. 11: Compression ratio of the proposed directional convolution relative to a conventional 2D convolution as a function of kernel size for different angular resolutions: a) Parameter compression ratio. b) FLOP compression ratio.