RWKV-UNet: Improving UNet with Long-Range Cooperation for Effective Medical Image Segmentation

Juntao Jiang, Jiangning Zhang, Weixuan Liu, Muxuan Gao, Xiaobin Hu, Zhucun Xue, Yong Liu, Shuicheng Yan

TL;DR

RWKV-UNet effectively fuses the local precision of convolutional neural networks (CNNs) with the linear-complexity global modeling of the RWKV architecture for medical image segmentation. By introducing Global-Local Spatial Perception (GLSP) blocks and a Cross-Channel Mix (CCM) module, it achieves state-of-the-art performance across 11 medical imaging benchmarks while maintaining high computational efficiency.

What Problem Does This Paper Address?

Accurate medical image segmentation requires a delicate balance: models must capture fine-grained local details (like precise lesion boundaries) while maintaining a coherent global context (like structural consistency across an entire organ).

Traditional CNNs excel at local feature extraction but struggle to model long-range dependencies due to their inherently limited receptive fields. On the other hand, Vision Transformers (ViTs) handle global context beautifully but suffer from quadratic computational complexity ($O(N^2)$). This makes Transformers prohibitively expensive when processing high-resolution medical scans.

While recent linear-attention alternatives like Mamba offer a way forward, finding a stable, efficient hybrid architecture that unifies local convolutions with linear global context remains an open challenge in medical imaging.

Fig. 1: Comparative analysis of CNN-, Transformer-, Mamba-, RWKV-, and hybrid-based segmentation models, highlighting their respective strengths and weaknesses.

Methods

The authors introduce RWKV-UNet, adapting the Receptance Weighted Key Value (RWKV) architecture—originally popularized in natural language processing—into a classic U-Net framework. The core architecture consists of:

  • Global-Local Spatial Perception (GLSP) Blocks: Positioned in the deeper stages of the encoder, these blocks combine an RWKV-Spatial-Mix module (for isotropic, long-range context propagation) with Depth-Wise Convolutions (DW-Conv) for local feature aggregation.
  • Local Perception (LP) Blocks: Deployed in the shallower stages of the encoder where global context is less critical. This saves computational budget by relying purely on local convolutions.
  • Cross-Channel Mix (CCM) Module: Replacing standard U-Net skip connections, this module projects, upsamples, and concatenates multi-scale features from different encoder stages. It applies a channel-mixing mechanism to integrate global channel information before passing features to the decoder.
  • Large Kernel Decoder: Employs $9 \times 9$ depthwise convolutions to ensure smooth, context-aware upsampling and reconstruction.

The model is offered in three scaled configurations: Tiny (Enc-T), Small (Enc-S), and Base (Enc-B).

Fig. 2: Overall architecture of the proposed RWKV-UNet. (a) the encoder with four stages constructed by stacked LP blocks and stacked GLSP blocks, (b) Cross-Channel Mix (CCM) Module for multi-scale fusion, (c) the decoder with four stages, (d) the Local Perception (LP) block, (e) the RWKV-based Global-Local Spatial Perception (GLSP) block, (f) the decoder block constructed by a point-convolution layer and a 9 × 9 DW-Conv layer, with a convolution and an upsampling operation.

Datasets

The model was evaluated across 11 diverse benchmark datasets spanning multiple imaging modalities:

  1. Synapse: Multi-organ segmentation in CT images.
  2. ACDC: Cardiac segmentation in MRI images.
  3. GOALS: Optical Coherence Tomography (OCT) layer segmentation.
  4. BUSI: Breast tumor segmentation in ultrasound images.
  5. CVC-ClinicDB / CVC-ColonDB / Kvasir-SEG: Polyp segmentation in endoscopy images.
  6. ISIC 2017: Skin lesion segmentation in dermoscopic images.
  7. GLAS: Gland segmentation in microscopy images.
  8. PSVFM: Placental vessel segmentation in fetoscopy videos.
  9. FUGC: Semi-supervised cervix segmentation in ultrasound images.

Key Insights and Ideas

  • Attention is Overkill for Shallow Layers: The authors discovered that adding spatial-mix attention to the first two stages of the encoder yielded negligible accuracy improvements while significantly increasing computational overhead. Purely convolutional shallow layers are entirely sufficient for low-level feature extraction.
  • Pre-training is Essential: Because RWKV's recurrent inductive biases are weaker than a pure CNN's translation invariance, pre-training the encoder on ImageNet-1K is critical. It allows the model to capture intricate hierarchical patterns and converge much faster during downstream segmentation tasks.
  • Isotropic Context Propagation: RWKV’s gated accumulation mechanism provides a more persistent and isotropic effective receptive field compared to standard multi-head self-attention or Mamba, leading to more stable long-range dependency modeling.

Key Results

  • Synapse CT Dataset: RWKV-UNet achieved a state-of-the-art Dice Similarity Coefficient (DSC) of 84.29% and slashed the 95% Hausdorff Distance (HD95) to 8.85 mm. It comfortably outperformed Transformer-based models like TransUNet while requiring a fraction of the computational cost (e.g., 58.05G FLOPs vs. TransUNet's 148.29G FLOPs at $512 \times 512$ resolution).
  • ACDC MRI Dataset: The model achieved a top-tier average DSC of 92.29%, showing particular strength in segmenting the Right Ventricle (RV).
  • Efficiency Frontier: The smaller variants, RWKV-UNet-S (9.42M parameters) and RWKV-UNet-T (2.94M parameters), maintained highly competitive accuracy scores, proving their viability for resource-constrained clinical deployments.

Limitations and Future Work

The primary limitation is that RWKV-UNet is currently a 2D segmentation model. It cannot natively process 3D volumetric medical data (like full CT or MRI scans) without breaking them down into 2D slices, which risks losing cross-slice volumetric context.

To address this, the authors plan to extend the architecture to native 3D operations. They also aim to explore RWKV-based foundational models for medical imaging and develop ultra-lightweight versions tailored for real-time, point-of-care applications.

Summary updated

BibTeX
@misc{jiang2025rwkv,
  author = {Juntao Jiang and Jiangning Zhang and Weixuan Liu and Muxuan Gao and Xiaobin Hu and Zhucun Xue and Yong Liu and Shuicheng Yan},
  title = {{RWKV-UNet: Improving UNet with Long-Range Cooperation for Effective Medical Image Segmentation}},
  year = {2025},
  eprint = {2501.08458},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2501.08458},
}
Figure