LungMend fills the cavities severe-TB CT masks miss, using only a healthy-lung shape prior and reaching 0.986 Dice
Synopsis
On severe tuberculosis CT, cavities and consolidations have soft-tissue density and are left out of lung masks by segmenters such as R231. LungMend treats mask correction as shape completion: a latent diffusion prior trained on 57 healthy lungs, conditioned on a synthetically corrupted mask and on bone anatomy that disease does not alter, with no pathological data or CT intensities. On 200 radiologist-corrected slices from 20 severe TB cases it reaches 0.986 Dice and 0.57 mm average surface distance, with cavity and consolidation recall of 0.993 and 0.981.
Interpretation
Lung mask correction no longer depends on diseased image appearance; an incomplete lung mask is completed into a full shape, so cavities and consolidations re-enter the mask. The widely used open-source U-Net R231 was trained on 231 CT scans including consolidation and other pathological patterns, yet on TB it still drops large contiguous regions, erodes along the chest wall, and is slice-to-slice inconsistent because it works in 2D. On 20 ImageCLEF TB cases selected as the most severe in cavity burden, with 10 axial slices per case corrected by a thoracic radiologist for 200 slices total, LungMend scores 0.986 Dice and 0.57 mm average surface distance, against 0.909 and 4.38 mm for R231.
The correction looks only at shape and bone, not at CT intensity, so it is not misled by the lesion density that defeats the segmenter. Earlier shape-based post-processing projects a mask onto a single plausible shape and struggles when large regions are missing, while existing diffusion refinement conditions on image intensities, the very signal that misleads segmenters in diseased lungs. Training uses only 57 healthy post-COVID scans from COVALUNG with no parenchymal lesion, with corrupted masks generated on the fly by region drop, medial drop, subpleural erosion, cavities, truncation and leak; inference draws 50 DDIM steps, averages 5 samples, then upsamples the smooth distance field trilinearly and thresholds at zero.
Repeated sampling also yields a voxel-wise uncertainty map marking which regions were reconstructed rather than kept from the input mask. A deterministic model returns a single estimate when several completions are plausible and therefore loses cavities, whereas diffusion samples plausible completions and averages them. The standard deviation across samples is near zero where the input mask is kept and high where several completions are plausible; ablations show bone conditioning, corruptions that mimic real failures, and latent diffusion on the distance field each beat removing the corresponding component.
Perspective
Validation covers the 20 ImageCLEF TB cases with the heaviest cavity burden, with a reference of 10 radiologist-corrected axial slices per case for 200 slices total, plus qualitative assessment on 18 TB CT scans from Avicenne Hospital in France; training uses 57 healthy post-COVID scans and no pathological scan or mask at any point.
A healthy prior may over-complete lungs with genuine volume loss such as fibrotic retraction or destroyed lung, so the uncertainty map should be read together with the input mask; the gain depends on corruptions resembling real failures, and resolution limits precision near the hilum; lesion recall depends on DeepPulmo labels, and the expert slices cover only part of the lung.
