arXiv:2611.06556cs.CVNov 2026

Manuscript Offprint

arXiv:2611.06556

LungMend: A Healthy-Only Latent Diffusion Shape Prior for Lung Mask Correction in Severe Tuberculosis CT

Rezkellah Noureddine Khiat, Pierre-Yves Brillet, Catalin Fetita

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Lung segmentation models such as R231 are widely used, but they fail on severe tuberculosis (TB) CT: cavities and consolidations look like non-lung tissue and are left out of the mask. We present LungMend, a post-processing model that corrects such masks using only healthy anatomy. A latent diffusion model, trained on healthy lungs with synthetically corrupted masks, learns to recover the complete lung from the faulty mask and the bone anatomy, without any pathological data or CT intensities. LungMend recovers cavities and consolidations that R231 misses and improves accuracy on expert-annotated slices. Code: noureddinekhiati/LungMend

Index Terms— Lung segmentation, latent diffusion, shape prior

1. INTRODUCTION

Lung segmentation is the first step of most quantitative CT pipelines. The most widely used model is the open-source U-Net R231 [1], the de facto standard in 3D Slicer. It was trained on a large and diverse set of 231 CT scans that includes consolidation and several other pathological patterns. Yet it still fails on TB, where large cavities and extensive consolidations have soft-tissue density and are excluded from the mask. We observe three recurrent failure modes: (i) loss of large contiguous regions, (ii) erosion along the chest wall where disease is subpleural, and (iii) slice-to-slice inconsistency, since R231 works in 2D and its 3D masks are fragmented along the craniocaudal axis.

Related work. Dedicated pathological lung segmentation combines intensity, texture and shape cues [2, 3, 4], but it needs pathological annotations, which are costly and never exhaustive. Shape-based post-processing, from statistical shape models [5] to autoencoder priors [6, 7, 8], projects a mask onto a single plausible shape and struggles when large regions are missing. Diffusion models [9, 10] have been used to refine segmentations [11, 12, 13], but they condition on image intensities, which are what misleads the segmenter in diseased lungs. Latent diffusion [14] makes 3D medical generation tractable [15, 16], and shape diffusion enables 3D completion in vision [17, 18, 19, 20]. To our knowledge, no

prior work uses a generative shape prior learned from healthy anatomy to correct pathological lung masks.

References (30)