[Paper Review] ConvFormer: Plug-and-Play CNN-Style Transformers for Improving Medical Image Segmentation
This paper proposes ConvFormer, a plug-and-play CNN-style transformer module that replaces standard vision transformer components with pooling, CNN-style self-attention (CSA), and convolutional feed-forward networks to alleviate attention collapse in medical image segmentation. By operating directly on 2D feature maps and enabling adaptive, kernel-scalable attention, ConvFormer improves long-range dependency learning and achieves consistent performance gains across multiple state-of-the-art transformer-based models on ACDC, ISIC, and ICH datasets.
Transformers have been extensively studied in medical image segmentation to build pairwise long-range dependence. Yet, relatively limited well-annotated medical image data makes transformers struggle to extract diverse global features, resulting in attention collapse where attention maps become similar or even identical. Comparatively, convolutional neural networks (CNNs) have better convergence properties on small-scale training data but suffer from limited receptive fields. Existing works are dedicated to exploring the combinations of CNN and transformers while ignoring attention collapse, leaving the potential of transformers under-explored. In this paper, we propose to build CNN-style Transformers (ConvFormer) to promote better attention convergence and thus better segmentation performance. Specifically, ConvFormer consists of pooling, CNN-style self-attention (CSA), and convolutional feed-forward network (CFFN) corresponding to tokenization, self-attention, and feed-forward network in vanilla vision transformers. In contrast to positional embedding and tokenization, ConvFormer adopts 2D convolution and max-pooling for both position information preservation and feature size reduction. In this way, CSA takes 2D feature maps as inputs and establishes long-range dependency by constructing self-attention matrices as convolution kernels with adaptive sizes. Following CSA, 2D convolution is utilized for feature refinement through CFFN. Experimental results on multiple datasets demonstrate the effectiveness of ConvFormer working as a plug-and-play module for consistent performance improvement of transformer-based frameworks. Code is available at https://github.com/xianlin7/ConvFormer.
Motivation & Objective
- To address attention collapse in vision transformers when applied to small-scale medical image datasets.
- To improve the convergence and diversity of self-attention maps in transformer-based medical image segmentation models.
- To design a plug-and-play module that enhances both pure-transformer and CNN-transformer hybrid architectures without architectural overhaul.
- To enable scalable, adaptive long-range feature learning by modeling self-attention as a learnable convolutional kernel.
- To demonstrate consistent performance gains across diverse datasets and backbone architectures.
Proposed method
- Replaces ViT’s 1D tokenization with 2D convolution and max-pooling to preserve spatial locality and reduce resolution.
- Introduces CNN-style self-attention (CSA) that constructs self-attention matrices as adaptive, scalable convolution kernels for pixel-wise long-range dependency.
- Employs a convolutional feed-forward network (CFFN) to refine features after CSA, maintaining 2D spatial structure.
- Uses a learnable scaling factor α to control the receptive field size in CSA, enabling dynamic adaptation between local and global context.
- Processes input images directly in 2D, avoiding the 1D sequence transformation used in standard ViT.
- Designed as a plug-and-play module, easily integrated into existing transformer-based segmentation frameworks.

Experimental results
Research questions
- RQ1Can a CNN-style transformer design mitigate attention collapse in low-data medical image segmentation?
- RQ2Does operating on 2D feature maps instead of 1D sequences improve attention diversity and model convergence?
- RQ3Can a plug-and-play module based on adaptive, kernel-scalable attention consistently improve performance across diverse transformer-based segmentation architectures?
- RQ4How does the scalability of receptive fields in CSA affect segmentation accuracy on medical imaging benchmarks?
- RQ5Does the proposed module generalize across different datasets and backbone models in medical image segmentation?
Key findings
- ConvFormer achieves an average Dice score improvement of 3.86% on the ACDC dataset when integrated into SETR, a pure-transformer backbone.
- On the ISIC dataset, ConvFormer improves Dice scores by 1.38% when used with SETR and 1.07% with Patcher.
- On the ICH dataset, ConvFormer boosts Dice scores by 1.39% with SETR and 1.15% with Patcher, demonstrating consistent gains across datasets.
- In CNN-transformer hybrid models like TransUNet and TransFuse, ConvFormer still provides stable performance improvements despite CNN dominance in training.
- The ablation study confirms that α = 0.4 yields the best performance (91.00% Dice on ACDC), indicating optimal receptive field scaling.
- Visualization shows that ConvFormer produces more diverse and structured attention maps compared to baselines, effectively alleviating attention collapse.

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.