Papers
Topics
Authors
Recent
Search
2000 character limit reached

MCFormer: Multi-Scale Correlation Transformer

Updated 25 November 2025
  • The paper introduces a unified Transformer architecture that models global and local correlations to handle vessel occlusions and intra-identity variations.
  • It employs custom Global and Local Correlation Modules to align features across samples, achieving state-of-the-art performance on vessel re-ID benchmarks.
  • The approach uses a multi-scale fusion strategy with channel-wise attention and momentum-based memory banks to suppress outlier effects and compensate for missing parts.

The Multi-scale Correlation-aware Transformer Network (MCFormer) is a unified Transformer-based architecture designed for maritime vessel re-identification (Re-ID), specifically addressing the substantial intra-identity variation and frequent local part-missing characteristic of vessel imagery. Unlike pedestrian-centric Re-ID models, MCFormer directly models inter-image global and local correlations across the entire training set via two custom modules—the Global Correlation Module (GCM) and the Local Correlation Module (LCM)—and fuses these correlation-aware features using a multi-scale strategy. The approach achieves state-of-the-art performance on multiple vessel Re-ID benchmarks by robustly suppressing outlier effects due to viewpoint or occlusion and compensating for missing parts via inter-sample feature alignment (Liu, 18 Nov 2025).

1. Architecture Overview and Data Flow

MCFormer operates on a training set {(xi,yi)}i=1D\{(x^i, y^i)\}_{i=1}^D, where each input image xix^i is split into NN non-overlapping patches. Each image embedding includes a class token xclsx_{\mathrm{cls}} and three part tokens {xp1,xp2,xp3}\{x_{p_1}, x_{p_2}, x_{p_3}\}, with positional embeddings PP summing to

X=[xcls; xp1; xp2; xp3; x1;…;xN]+PX = [x_{\mathrm{cls}};\ x_{p_1};\ x_{p_2};\ x_{p_3};\ x_1; \ldots; x_N] + P

A ViT-B/16 encoder (12 layers, 12 heads, d=768d=768) produces global features gig^i (from the class token) and local features {l1i,l2i,l3i}\{l^i_1, l^i_2, l^i_3\} (from part tokens).

The pipeline comprises three sequential stages:

  1. Transformer Feature Extraction: Produces global and part-level embeddings.
  2. Correlation Modeling:
    • GCM: Aggregates all xix^i0 into correlated representations xix^i1 via a learned affinity matrix xix^i2.
    • LCM: Maintains a momentum-updated memory bank of all local part features, aligns each with its xix^i3-nearest positives, and optimizes a clustering loss to yield correlated local descriptors xix^i4.
  3. Multi-scale Fusion: Fuses xix^i5 in a channel-wise manner, producing a final feature xix^i6 for identity classification and metric learning loss.

2. Global Correlation Module (GCM)

GCM explicitly models global consistency across the dataset. Given xix^i7, linear projections xix^i8, xix^i9, NN0 yield NN1 for each NN2:

NN3

The unnormalized affinity matrix is

NN4

Softmax normalization is applied row-wise:

NN5

Correlated global features are obtained as weighted sums:

NN6

For computational efficiency when NN7 is large, GCM supports low-rank factorization using NN8 landmark embeddings, reducing complexity from NN9 to xclsx_{\mathrm{cls}}0. Empirical results indicate xclsx_{\mathrm{cls}}1 provides a good tradeoff between accuracy and compute.

3. Local Correlation Module (LCM)

LCM aligns local (part-wise) features across mini-batch or dataset to mitigate local occlusions or missing regions. For each part index xclsx_{\mathrm{cls}}2, and image xclsx_{\mathrm{cls}}3, a memory bank xclsx_{\mathrm{cls}}4 is maintained and updated via:

xclsx_{\mathrm{cls}}5

with momentum xclsx_{\mathrm{cls}}6.

For part xclsx_{\mathrm{cls}}7, cosine similarities are computed with the bank; the top-xclsx_{\mathrm{cls}}8 most similar positives, xclsx_{\mathrm{cls}}9, are selected. The per-part clustering loss is

{xp1,xp2,xp3}\{x_{p_1}, x_{p_2}, x_{p_3}\}0

with {xp1,xp2,xp3}\{x_{p_1}, x_{p_2}, x_{p_3}\}1 the cosine similarity and {xp1,xp2,xp3}\{x_{p_1}, x_{p_2}, x_{p_3}\}2 the temperature. After training, k-NN-aligned local descriptors {xp1,xp2,xp3}\{x_{p_1}, x_{p_2}, x_{p_3}\}3 are aggregated and projected via a {xp1,xp2,xp3}\{x_{p_1}, x_{p_2}, x_{p_3}\}4 convolution to {xp1,xp2,xp3}\{x_{p_1}, x_{p_2}, x_{p_3}\}5.

4. Multi-Scale Fusion Strategy

MCFormer fuses correlated global and local features, {xp1,xp2,xp3}\{x_{p_1}, x_{p_2}, x_{p_3}\}6 and {xp1,xp2,xp3}\{x_{p_1}, x_{p_2}, x_{p_3}\}7, via channel-wise attention gating:

{xp1,xp2,xp3}\{x_{p_1}, x_{p_2}, x_{p_3}\}8

where {xp1,xp2,xp3}\{x_{p_1}, x_{p_2}, x_{p_3}\}9 is computed by a two-layer 1x1 convolutional network with Sigmoid/RELU activations and global average pooling. For multi-scale cases (PP0 different resolutions), the fusion is extended across scales with learned weights PP1:

PP2

Fusion via multi-scale channel attention outperforms addition and concatenation schemes, as shown by ablation.

5. Loss Functions and Optimization

The total loss is

PP3

where:

  • PP4: Cross-entropy identity classification,
  • PP5: Optional batch-hard triplet loss,
  • PP6: Sum of part-level clustering losses.

Typical coefficients are PP7, PP8, PP9.

6. Experimental Evaluation and Ablations

MCFormer is evaluated on VesselReID (1248 IDs, 30,587 images), Warships-ReID (163 IDs, 4,780 images), and BoatReID (107 IDs, 5,523 images), using mAP and CMC (Rank-1,5,10). The model surpasses TransReID, e.g., on VesselReID achieving Rank-1/mAP of 72.8%/63.4% vs. 68.2%/58.7%. Ablation indicates both GCM and LCM contribute complementary gains:

Method VesselReID (R1/mAP) Warships-ReID (R1/mAP)
ViT-B/16 baseline 66.7/54.5 91.7/77.2
+ GCM only 70.2/62.2 95.8/87.3
+ LCM only 70.3/57.0 92.9/78.2
GCM+LCM (MCFormer) 72.8/63.4 96.1/88.4

Multi-scale channel-attention fusion yields superior accuracy over simple addition or concatenation. The optimal number of part tokens is X=[xcls; xp1; xp2; xp3; x1;…;xN]+PX = [x_{\mathrm{cls}};\ x_{p_1};\ x_{p_2};\ x_{p_3};\ x_1; \ldots; x_N] + P0. GCM’s landmark-based complexity reduction shows diminishing returns for X=[xcls; xp1; xp2; xp3; x1;…;xN]+PX = [x_{\mathrm{cls}};\ x_{p_1};\ x_{p_2};\ x_{p_3};\ x_1; \ldots; x_N] + P1. Attention map analyses reveal GCM attends to globally salient structures (hull, superstructure), while LCM emphasizes locally distinct regions.

7. Effectiveness and Extensions

Multi-scale correlation modeling is effective in the maritime domain due to:

  • Strong intra-identity variation (caused by viewpoint, lighting, weather) requiring global consistency regularization,
  • Frequent missing of local vessel parts (hull, funnel, mast) due to occlusion, best addressed by aggregating aligned local features from similar samples.

Potential extensions include temporal correlation for video-based sequential Re-ID, integrating cross-modal sensor data (SAR or infrared) via a unified memory bank, generalization to other Re-ID domains with similar part-level variability and occlusion (e.g., aerial vehicles, animals), and replacing the static memory bank with a differentiable cache for online/batch updates.

MCFormer demonstrates that Transformer Re-ID architectures benefit from explicit inter-sample correlation modeling at both global and local feature levels, combined via a learnable multi-scale fusion process, achieving robust and discriminative vessel identification in challenging maritime environments (Liu, 18 Nov 2025).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Multi-scale Correlation-aware Transformer Network (MCFormer).