VQ-Seg: Vector-Quantized Token Perturbation for Semi-Supervised Medical Image Segmentation

Sicheng Yang, Zhaohu Xing, Lei Zhu

TL;DR

Semi-supervised medical image segmentation often relies on "Dropout" to perturb features and train robust models, but tuning Dropout is notoriously finicky and prone to causing model collapse. This paper introduces VQ-Seg, a novel framework that discretizes features using Vector Quantization (VQ) and perturbs them by intelligently swapping discrete tokens rather than randomly deleting them. Combined with guidance from a visual foundation model, VQ-Seg achieves state-of-the-art performance and introduces a massive new lung cancer CT dataset.

The Problem with Dropout in Medical Imaging

Training highly accurate medical image segmentation models usually requires thousands of meticulously hand-annotated scans, which are expensive and time-consuming to obtain. Semi-supervised learning (SSL) tackles this by using a small amount of labeled data alongside a large pool of unlabeled data.

A standard SSL technique is consistency regularization: you perturb the intermediate features of an image and force the model to output the same segmentation map regardless of the perturbation. Traditionally, this is done using Dropout (randomly zeroing out feature activations).

However, the authors identify a critical flaw: Dropout is highly unstable. If the dropout rate is too low, the model doesn't learn anything new. If it's too high, the underlying feature distribution is mathematically destroyed (the KL divergence explodes), leading to unusable predictions. The authors set out to create a perturbation method that is structured, mathematically bounded, and easy to control.

Methods: A Shift to Discrete Feature Spaces

To replace the chaotic nature of continuous Dropout, the authors propose a shift to a discrete feature space using three key innovations:

VQ-Seg Architecture
  1. Quantized Perturbation Module (QPM): Instead of continuous feature maps, the model uses Vector Quantization (VQ) to map image features to a discrete "codebook" (a learned dictionary of feature tokens). To perturb the data, QPM probabilistically swaps a token for a similar token in the codebook based on their learned distances. This provides a stable, interpretable perturbation without destroying the feature structure.
  2. Dual-Branch Architecture: Quantization naturally compresses data, which can cause the loss of fine-grained visual details crucial for medical imaging. To fix this, the network uses the discrete tokens for two tasks simultaneously: segmenting the image and reconstructing the original image. The reconstruction task acts as a self-supervisory signal that forces the tokens to remember structural details.
  3. Post-VQ Feature Adapter (PFA): To ensure the discrete tokens don't lose their high-level meaning (semantic drift), the authors use contrastive learning to align the quantized features with a frozen Foundation Model (DINOv2). This injects rich, external semantic priors into the model.

Datasets

  • Lung Cancer (LC) Dataset (New): The authors collected and annotated a large-scale, multi-center dataset of 828 chest CT scans focusing on central-type lung carcinoma. This is a significant contribution, as detecting these subtle anomalies is highly challenging.
  • ACDC Dataset: A standard public benchmark comprising 100 short-axis cine-MRI scans used for cardiac multi-structure segmentation.

Key Insights

  • Dropout is mathematically risky for consistency learning: The authors provide a theoretical proof showing that as the dropout rate increases, the distance (KL divergence) between the original and perturbed feature distributions grows sharply and becomes unbounded. QPM solves this by keeping perturbations strictly within a bounded, learned discrete space.
  • Natural image foundation models work surprisingly well for medical data: The authors tested several foundation models to guide their feature alignment. Surprisingly, DINOv2 (trained on natural images) outperformed specialized medical foundation models like BiomedCLIP and Rad-DINO. It serves as an incredibly robust "semantic anchor."
  • Codebook utilization proves the model's efficiency: Visualizations of the VQ codebook show that early in training, only 3.4% of the available discrete tokens are used. By the end of training, 98% of the tokens are actively utilized and evenly dispersed, proving the model learns a rich, diverse vocabulary for medical features.

Key Results

VQ-Seg was evaluated against several state-of-the-art semi-supervised models (like Unimatch, MCNet, and ABD) and consistently came out on top.

Qualitative Results Comparison
  • On the new LC Dataset (5% labeled data): VQ-Seg achieved a Dice score of 0.6643, outperforming the second-best method (Unimatch at 0.6493).
  • On the LC Dataset (10% labeled data): VQ-Seg hit a Dice score of 0.7852, a nearly 3% absolute improvement over the runner-up.
  • On the ACDC Dataset (5% labeled data): VQ-Seg achieved a Dice score of 0.9057, which actually approaches the performance of fully supervised models trained on 100% of the data (0.9185).
  • Qualitatively: As seen in the visual comparisons, VQ-Seg produces noticeably cleaner boundaries and preserves the structural integrity of cancerous regions much better than competing methods, which often output fragmented or noisy masks.

Limitations and Future Work

  • Tied to Discrete Spaces: Because the QPM relies entirely on swapping discrete codebook tokens, it cannot be easily adapted to the continuous feature representations used by the vast majority of existing segmentation networks.
  • Computational Overhead: Dragging a massive foundation model (like DINOv2) into the training pipeline to align features adds significant computational cost and memory requirements.
  • Future Work: The authors plan to explore how to achieve this kind of mathematically controllable perturbation in continuous spaces, as well as finding more lightweight ways to integrate foundation model knowledge.

Summary updated

BibTeX
@inproceedings{yang2025vq,
  author = {Sicheng Yang and Zhaohu Xing and Lei Zhu},
  title = {{VQ-Seg: Vector-Quantized Token Perturbation for Semi-Supervised Medical Image Segmentation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=Gt8iKyg12u},
}
Figure