[Paper Review] Cost Aggregation with 4D Convolutional Swin Transformer for Few-Shot Segmentation
This paper proposes Volumetric Aggregation with Transformers (VAT), a novel 4D Convolutional Swin Transformer for cost aggregation in few-shot segmentation. By integrating small-kernel convolutions before a Swin Transformer to preserve local context and inductive bias, and employing a hierarchical pyramidal structure with appearance-aware decoding, VAT achieves state-of-the-art performance on all major few-shot segmentation benchmarks and semantic correspondence tasks.
This paper presents a novel cost aggregation network, called Volumetric Aggregation with Transformers (VAT), for few-shot segmentation. The use of transformers can benefit correlation map aggregation through self-attention over a global receptive field. However, the tokenization of a correlation map for transformer processing can be detrimental, because the discontinuity at token boundaries reduces the local context available near the token edges and decreases inductive bias. To address this problem, we propose a 4D Convolutional Swin Transformer, where a high-dimensional Swin Transformer is preceded by a series of small-kernel convolutions that impart local context to all pixels and introduce convolutional inductive bias. We additionally boost aggregation performance by applying transformers within a pyramidal structure, where aggregation at a coarser level guides aggregation at a finer level. Noise in the transformer output is then filtered in the subsequent decoder with the help of the query's appearance embedding. With this model, a new state-of-the-art is set for all the standard benchmarks in few-shot segmentation. It is shown that VAT attains state-of-the-art performance for semantic correspondence as well, where cost aggregation also plays a central role.
Motivation & Objective
- Address the limitations of standard vision transformers in cost aggregation for few-shot segmentation, particularly the loss of local context and reduced inductive bias due to patch-based tokenization.
- Improve cost aggregation performance by integrating small-kernel 4D convolutions before the Swin Transformer to preserve spatial structure and enhance local feature representation.
- Enhance feature refinement by introducing a hierarchical pyramidal architecture where coarser-level aggregation guides finer-level processing.
- Reduce noise in transformer outputs through an appearance-aware decoder that leverages query-specific embeddings for more accurate segmentation predictions.
- Demonstrate the generalization potential of the proposed cost aggregation method by achieving state-of-the-art results not only in few-shot segmentation but also in semantic correspondence tasks.
Proposed method
- Propose a 4D Convolutional Swin Transformer that extends the Swin Transformer's patch embedding module to handle 4D correlation maps (batch, channel, H, W), enabling global self-attention over matching cost volumes.
- Introduce a series of overlapping small-kernel 4D convolutions before the transformer to inject local context and inductive bias, mitigating the discontinuity issues at patch boundaries.
- Design a hierarchical pyramidal architecture where aggregated cost maps from coarser resolution levels are concatenated as additional input to finer resolution levels, enabling multi-scale guidance.
- Implement an affinity-aware decoder that refines the final aggregated cost volume using the query’s appearance embedding to enhance spatial detail and reduce noise.
- Train the model end-to-end using standard segmentation loss (e.g., cross-entropy) on support-query pairs, with feature extraction performed via a backbone network (e.g., ResNet).
- Utilize a learnable positional encoding adapted to 4D spatial correlation maps to preserve spatial relationships during self-attention computation.
Experimental results
Research questions
- RQ1Can a 4D Convolutional Swin Transformer effectively aggregate cost volumes in few-shot segmentation while preserving local context and inductive bias?
- RQ2Does hierarchical aggregation across multiple scales improve the robustness and accuracy of cost volume refinement in few-shot segmentation?
- RQ3Can the proposed cost aggregation mechanism generalize beyond few-shot segmentation to other matching tasks such as semantic correspondence?
- RQ4How does the integration of appearance embeddings in the decoder improve segmentation quality compared to standard transformer-based aggregation?
- RQ5To what extent does replacing standard 4D convolutions with a hybrid convolutional-transformer approach reduce noise and improve performance on ambiguous or cluttered inputs?
Key findings
- VAT achieves state-of-the-art performance on all standard few-shot segmentation benchmarks, including PASCAL-5i, COCO-20i, and FSS-1000, with a mean mBA of 54.9 on COCO-20i (5-shot) and 54.8 on PASCAL-5i (5-shot).
- On the SPair-71k benchmark for semantic correspondence, VAT achieves a mean accuracy of 55.5, surpassing previous SOTA methods like CATs (49.9) and PMNC (50.4).
- Ablation studies confirm that the 4D convolutional stem significantly improves performance by reducing boundary artifacts and enhancing local context, especially in regions with repetitive textures.
- The hierarchical pyramidal structure contributes to improved feature refinement, with ablation showing a 1.5–2.0% mBA gain over non-pyramidal variants.
- The appearance-aware decoder reduces noise in the final cost volume, leading to sharper and more accurate segmentation masks, particularly in challenging cases with background clutter.
- The model generalizes well to semantic correspondence, demonstrating that effective cost aggregation is a key bottleneck in both few-shot segmentation and correspondence tasks.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.