Medical image segmentation is critical for clinical diagnosis, treatment planning, and monitoring, yet segmentation models often struggle with uncertainties stemming from occlusions, ambiguous boundaries, and variations in imaging devices. Traditional test-time augmentation (TTA) techniques typically rely on predefined geometric and photometric transformations, limiting their adaptability and effectiveness in complex medical scenarios. In this study, we introduced Test-Time Generative Augmentation (TTGA), a novel augmentation strategy specifically tailored for medical image segmentation at inference time. Different from conventional augmentation strategies that suffer from excessive randomness or limited flexibility, TTGA leverages a domain-fine-tuned generative model to produce contextually relevant and diverse augmentations tailored to the characteristics of each test image. Built upon diffusion model inversion, a masked null-text inversion method is proposed to enable region-specific augmentations during sampling. Furthermore, a dual denoising pathway is designed to balance precise identity preservation with controlled variability. We demonstrate the efficacy of our TTGA through extensive experiments across three distinct segmentation tasks spanning nine datasets. Our results consistently demonstrate that TTGA not only improves segmentation accuracy (with DSC gains ranging from 0.1% to 2.3% over the baseline) but also offers pixel-wise error estimation (with DSC gains ranging from 1.1% to 29.0% over the baseline). The source code and demonstration are available at: https://github.com/maxiao0234/TTGA.
翻译:医学图像分割对于临床诊断、治疗规划和监测至关重要,然而分割模型常常因遮挡、模糊边界以及成像设备差异所产生的不确定性而表现不佳。传统的测试时增强技术通常依赖于预定义的几何和光度变换,这限制了其在复杂医学场景中的适应性和有效性。本研究提出了一种新颖的增强策略——测试时生成增强,专为推理阶段的医学图像分割而设计。与那些因过度随机性或有限灵活性而受限的传统增强策略不同,TTGA利用领域微调的生成模型,针对每个测试图像的特征生成上下文相关且多样化的增强样本。该方法基于扩散模型反演,提出了一种掩码空文本反演方法,以在采样过程中实现区域特定的增强。此外,设计了一种双重去噪路径,以在精确的身份保持与可控的变异性之间取得平衡。我们通过在涵盖九个数据集的三个不同分割任务上进行广泛实验,证明了TTGA的有效性。实验结果一致表明,TTGA不仅提高了分割准确性,还提供了像素级的误差估计。源代码和演示可在以下网址获取:https://github.com/maxiao0234/TTGA。