PolypFlow: Reinforcing Polyp Segmentation with Flow-Driven Dynamics

Pu Wang, Huaizhi Ma, Zhihua Zhang, Zhuoran ZhengarXiv 2025 · DOI

Introduction

Colorectal cancer (CRC) screening relies heavily on the precise segmentation of polyps during colonoscopies. However, polyps are notoriously difficult to isolate because they vary wildly in size, color, and texture, often blending into the surrounding tissue with ambiguous boundaries. Current approaches generally fall into two camps: static U-Net variants, which lack refinement mechanisms, and large foundation models like SAM, which are often too computationally heavy for clinical edge devices.

PolypFlow introduces a novel framework that replaces static, "one-shot" predictions with flow-driven dynamics. By solving an Ordinary Differential Equation (ODE) to progressively refine segmentation masks, the model achieves state-of-the-art accuracy while providing an interpretable "trajectory" of how it corrects boundaries and handles uncertainty.

Methodology

The core innovation of PolypFlow is the integration of Flow Matching into the segmentation pipeline. Instead of outputting a final mask in one pass, the model learns a "velocity field" that guides a coarse initial prediction toward the ground truth mask over several iterations.

Overview of the PolypFlow architecture, including the training/inference stages, the ODE solver, and the vector field estimator.

Flow-Driven Refinement

The system uses an ODE solver (typically Euler’s method) to progressively "flow" the prediction. This iterative process allows the model to "think through" the segmentation, sharpening edges and resolving ambiguities that a single-pass network might miss. During inference, the model typically performs 10 integration steps to reach the final segmentation mask $Y$.

Vector Field Design

To guide this flow, the authors designed a sophisticated vector field estimator comprising three key elements:

  1. U-Net Backbone: Provides standard local feature extraction.
  2. Self-Attention (SA): Captures global context and relationships between distant parts of the image, overcoming the local receptive field limitations of standard convolutions.
  3. Discrete Cosine Transform (DCT): Injects frequency-domain information. By analyzing the image in the frequency domain, the model can better identify high-frequency details associated with sharp polyp boundaries.

Experimental Results

The model was evaluated on five benchmark datasets, including seen (Kvasir-SEG, CVC-ClinicDB) and unseen (ColonDB, Endoscene, ETIS) data to test generalization.

Performance and Generalization

PolypFlow outperformed existing state-of-the-art (SOTA) methods, including PraNet, SANet, and MedSAM. On the Kvasir-SEG dataset, it achieved an mDice of 0.971 and an mIoU of 0.948. Notably, on the challenging ETIS dataset—often a stumbling block for medical imaging models—it reached an mDice of 0.895, significantly outperforming the next best model.

Visualization of the segmentation mask at Step 5 of the iterative refinement process, showing the sharpening of boundaries.

Key Insights

  • Segmentation as a Trajectory: Treating segmentation as a dynamic optimization process mimics how a human expert might refine their gaze when looking at a blurry medical image.
  • Frequency-Awareness: The inclusion of DCT allows PolypFlow to "see" structural transitions that are invisible to standard pixel-based filters, which is critical for low-contrast polyp edges.
  • Robustness: The flow dynamics explicitly model gradient directions along edges, making the model resilient to motion artifacts and lighting variations common in real-world colonoscopy videos.

Conclusion and Future Work

While PolypFlow sets a new benchmark for accuracy and interpretability, the iterative nature of solving an ODE introduces computational overhead. Future work will focus on optimizing real-time deployment, potentially through adaptive step sizes—using more iterations for difficult polyps and fewer for simpler cases. Additionally, the framework is modular; replacing the standard U-Net with more advanced backbones like U-Net++ has already shown promise for further performance gains.

Summary updated

BibTeX
@misc{wang2025polypflow,
  author = {Pu Wang and Huaizhi Ma and Zhihua Zhang and Zhuoran Zheng},
  title = {{PolypFlow: Reinforcing Polyp Segmentation with Flow-Driven Dynamics}},
  year = {2025},
  eprint = {2502.19037},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.19037},
}
Figure