Skip to main content
Back

MIT's CardioComposer Lets Doctors Reshape 3D Heart Anatomy Without Retraining

A new inference-time guidance method steers 3D anatomical diffusion models with interpretable ellipsoid primitives, controlling size, shape, and position independently.

Pro

  • CardioComposer guides unconditional 3D anatomical diffusion models using differentiable geometric moments at inference time.
  • Ellipsoid primitives encode size, shape, and position, giving clinicians an interpretable control surface.
  • Achieves FD of 34.6 vs 1622 for the implicit baseline when zero substructures are constrained.
  • Works across cardiac, aortic, spinal, and knee datasets with minimal loss-weight retuning.
  • Code, pretrained checkpoints, and Hydra configs available at github.com/kkadry/CardioComposer.
  • Accepted to ICLR 2026; models hosted on Hugging Face.

Generating realistic 3D anatomy for medical simulations has long been stuck with an awkward choice: either use simple geometric primitives that are easy to steer but look nothing like real organs, or use data-driven generative models that produce believable anatomy but resist precise editing. A team from MIT and collaborators is trying to close that gap with CardioComposer, an inference-time framework that lets you constrain an unconditional diffusion model using interpretable ellipsoid primitives representing the size, shape, and position of individual anatomical substructures. The work was accepted to ICLR 2026, and the authors have released code along with four pretrained checkpoints on Hugging Face.

Ellipsoid-based control of heart anatomy generation with disentangled size, shape, and position

Why anatomical generation is harder than it looks

Generating anatomical models for biophysical simulations presents several unique challenges, starting with scale-critical features where minor geometric variations on the order of millimeters can cause major fluctuations in physiological behavior. On top of that, size and position play different roles in shaping outcomes, and substructures interact compositionally rather than in isolation. The consequence: prior work has generally been forced into one of two camps.

  • Simple geometric primitives, such as cylinders for coronary arteries and truncated ellipsoids for cardiac chambers, offer parametric control but fail to capture anatomical realism.
  • Recent conditional diffusion approaches like morpho-skeletal conditioning for coronary arteries rely on conditional training and are restricted to size-related variables such as volume or cross-sectional area. Similarly, hierarchical models for aortic centerlines are restricted to fixed centerline connectivity and cannot flexibly accommodate topological changes.

Moments as a control interface

The core trick is to treat controllability as an inference-time optimization problem, not a training-time one. During each denoising step, the model decodes the current latent into a voxel-space segmentation, then measures three geometric moments per substructure. Size is computed via zeroth-order moments (scalar volumes), position via first-order moments (centroid vectors), and shape via scale-invariant second-order moments (normalized covariance matrices). Those measurements are compared against target values through MSE losses, and the gradient of the composite loss corrects the denoising step.

Diagram of the guidance pipeline: denoise latent, extract moments per substructure, compute loss versus target, backpropagate to correct the denoising step

Because each moment is computed on a specific tissue label (or a union of tissues), you can toggle constraints on and off per substructure just by zeroing out weights. The ellipsoid in the UI is the visual analog of the covariance matrix plus centroid, giving clinicians and engineers a primitive they can actually reason about.

How it holds up against conditional baselines

The authors compare against three conditional-training baselines: explicit concatenation of geometry vectors, implicit 3D Gaussian heatmaps, and cross-attention tokens. The diffusion model itself is a latent diffusion model trained on 596 cardiac segmentations with 11 channels at 2mm isotropic resolution, filtered from the TotalSegmentator dataset.

The compositional generation results are where the approach really separates itself. With few constrained substructures, the implicit conditional baseline collapses because unconditional sampling corresponds to its rarest training configuration. At zero active constraints, CardioComposer hits a Fréchet distance of 34.6 versus 1622 for the implicit baseline; at one constraint, it drops to 38.5 versus 227. Once you constrain three or six substructures, the two methods roughly converge, but the guidance approach never needs to be retrained to change what you constrain.

Each individual loss improves its corresponding conditional-fidelity metric while leaving the others approximately unchanged. That means you can, for example, resize a right ventricle without unintentionally rotating it or shifting its neighbors.

Where it goes beyond the heart

The same framework transfers to other anatomies without changing the loss weights much. The authors demonstrate it on:

  • Branched ascending aorta (main trunk plus five branches)
  • Spinal vertebral column (25 vertebrae across cervical, thoracic, lumbar)
  • Distal femur and articular cartilage from the ShapeMed-Knee dataset

They also chain the guidance with tissue-based inpainting to demonstrate a practical simulation workflow: take a real patient scan, halve or double the right ventricle mass, convert the edited label map to a tetrahedral mesh, and run biventricular pressurization in a finite-element solver to see how wall displacement responds. That end-to-end path from a slider in ellipsoid space to a biomechanical outcome is the actual point of the paper.

What it is not good at

The authors are candid about limitations. Substructures are currently defined based on label map class, and cannot represent localized features such as cross sections. Diffusion models can also produce topologically incorrect anatomy such as disconnected aortas or duplicated atria, and the Betti error analysis shows guidance can actually make topological defects slightly worse for some structures like the pulmonary artery. Scaling target values too aggressively also breaks down: pushing target mass to 4x the original blows up FD by more than an order of magnitude.

Getting the code running

The repo ships with pixi-based install, four pretrained checkpoints (autoencoder, unconditional diffusion, and both explicit and implicit conditioning baselines), and Hydra configs for training and generation. A minimal guided sampling run looks like this:

python run_generate.py experiment=generate/gen_guided \
  emb_models.chamber.parser.union_combos=[[6],[7],[8],[9]]

That command constrains all four cardiac chambers separately. Swapping the union combos or zeroing out individual loss weights lets you reconfigure what is controlled without touching model weights. For teams doing in-silico trials or digital-twin work, that composability at inference time is arguably the real deliverable here.