Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

LungMend: Fix Incomplete Lung Masks on Severe TB CT

Comparison built from Fig. 2a of arXiv:2611.06556 by Rezkellah Noureddine Khiati, Pierre-Yves Brillet and Catalin Fetita: three severe ImageCLEF TB axial CT slices with R231+closing lung masks in red (top row, incomplete) and LungMend masks in blue with green added tissue (bottom row).

R231 from lungmask is the lung mask most DICOM viewers and 3D Slicer pipelines hang by default. On severe tuberculosis CT it often drops exactly the tissue that matters: cavities and consolidations look like soft tissue, so they fall outside the mask. In arXiv:2611.06556, Rezkellah Noureddine Khiati, Pierre-Yves Brillet and Catalin Fetita (SAMOVAR, Télécom SudParis / Institut Polytechnique de Paris; Avicenne Hospital, AP-HP) present LungMend, a post-process that takes the broken R231 mask plus a bone mask and completes the lung with a latent diffusion shape prior trained only on healthy anatomy.

On 200 expert-corrected axial slices from 20 severe ImageCLEF TB cases, HD95 fell from 22.9 mm with the strongest baseline (R231 + morphological closing) to 5.5 mm with LungMend. Cavity recall rose to 0.993 and consolidation recall to 0.981. The model never uses CT intensities on the diffusion path described in the paper, so appearance that fooled R231 does not drive the repair.

How it works

Training uses 57 healthy post-COVID COVALUNG scans only. No pathological CT, mask or intensity enters the pipeline. Each lung is cropped, resampled to a 128³ grid and turned into a signed distance transform (clipped at 20 mm). A 3D VAE compresses that field to an 8 × 16³ latent. Stage 2 trains a 3D U-Net latent diffusion model to recover the clean latent from a synthetically corrupted one, conditioned on bone occupancy and a distance-to-bone map.

Corruptions mimic how R231 fails on diseased lungs: region drop, medial drop, subpleural erosion, internal cavity holes, truncation and occasional leaks. At inference you pass the R231 mask and either a CT (from which bone is thresholded) or an existing bone mask. The model draws N=5 DDIM samples with classifier-free guidance 1.5, averages the decoded distance maps, upsamples and thresholds. The README quotes about 20 seconds per scan on one GPU. The spread across samples is an uncertainty map for regions the model reconstructed rather than kept from the input.

Why a viewer or clinic team should care

If your product already hangs R231 overlays, LungMend is a drop-in correction step rather than a new segmenter:

  • Keep the familiar input. Run lungmask as today, then feed the mask and CT into LungMend. The output is a binary lung mask on the same grid, ready as a SEG overlay or RTSTRUCT.
  • Recover the diseased volume R231 excludes. The featured image is Fig. 2a of the paper: three severe ImageCLEF cases with R231+closing in red on top and LungMend in blue below, green marking the added tissue. Added volumes on those examples are on the order of a litre (+16% to +37%).
  • Show an uncertainty overlay. Averaging five samples gives a voxel-wise disagreement map. Hang that next to the corrected mask so a reader can see which regions were invented by the prior.

Wiring matches other mask-repair tools we have covered: NIfTI in, NIfTI out, then convert for the viewer. For a related shape-prior repair that also avoids reading the image at test time, see DART. For reconnecting broken vessel masks before centerline work, see mesh-guided vessel repair.

Where it falls short

  • Healthy prior can over-complete destroyed lung. Fibrotic retraction or genuinely missing parenchyma may be filled in. The authors say to read the uncertainty map together with the input mask.
  • 128³ crop limits hilar precision. Fine detail near the hilum is constrained by the training resolution.
  • Expert labels cover only part of each lung. Metrics are on 10 axial slices per case, chosen where LungMend and R231 differ most, and the annotator started from the LungMend mask.
  • Lesion recall uses DeepPulmo labels. Cavity and consolidation recall depend on those lesion maps, not on a full expert lung mesh.
  • Private training data, TB-focused eval. COVALUNG is private. Quantitative results are on severe ImageCLEF TB; Avicenne cases are qualitative only.

Code, weights and license

Code is at github.com/noureddinekhiati/LungMend. As of this writing the GitHub license field is empty and there is no LICENSE file in the repository root, so treat reuse as unlicensed until the authors clarify. Weights ship as GitHub release asset lungmend_weights.zip (~700 MB: lungmend_vae.pt and lungmend_ldm.pt). The 200 annotated ImageCLEF slices are in annotations/; the CT volumes stay with ImageCLEF. Training code under training/ expects healthy lung and bone NIfTIs. The preprint is under arXiv’s standard non-exclusive license. Credit: Rezkellah Noureddine Khiati, Pierre-Yves Brillet and Catalin Fetita.

My take

LungMend is the kind of post-process a viewer team can try without replacing R231. I would run it on a local TB (or consolidation-heavy) batch, hang R231 and LungMend side by side with the uncertainty map, and measure how often the added green regions match expert edits. Do not treat the healthy prior as ground truth on fibrotic or destroyed lung, and clarify the license with the authors before shipping anything derived from the weights.

We build custom medical imaging platforms — advanced DICOM viewers, AI segmentation, and the clinical systems around them.

Get in Touch

Copyright © 2026 PYCAD. All Rights Reserved.