Skip to content
Projekte

Über uns

Code for Stage-Aligned Knowledge Distillation for Fast and Memory-Efficient 4D Flow MRI Reconstruction (MICCAI CMRx4DFlow 2026)

KI und maschinelles Lernen

So werden diese Zahlen gemessen

Gemessener Sternzuwachs

in 24h
0
in 7 days
Verlauf wird gesammelt
in 15 days
Verlauf wird gesammelt
in 1 month
Verlauf wird gesammelt

Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.

README.md

Original

Stage-Aligned Knowledge Distillation for Fast and Memory-Efficient 4D Flow MRI Reconstruction

Yuliang Xiao, Kian Anvari Hamedani, Zach Vavasour, Simon J. Graham, and Mark Chiew

MICCAI 2026 · CMRxRecon 2026 (4D Flow MRI Reconstruction Challenge)

Paper Python PyTorch Code license

Overview · Reproduction · Data · Checkpoints · Citation

This code trains an eight-stage FlowVN student from a frozen sixteen-stage teacher. Student stages align with pairs of teacher stages, using supervision on the final reconstruction, intermediate reconstructions, and stage updates. The teacher is used during training only.

Method overview

Method overview: a frozen sixteen-stage FlowVN teacher trains an eight-stage student through stage-aligned distillation. Only the student runs at inference.

S16-to-S8 distillation. The distilled student and matched supervised control both copy teacher stages 2, 4, ..., 16 for initialization. Input tiles are schematic illustrations. Click the figure to enlarge it.

The implementation uses Cartesian k–t Gaussian masks. Both networks also use measured k-space and coil sensitivities for data consistency. The four training recipes below separate teacher initialization from the contribution of each distillation loss.

This repository contains code, citation metadata, and the method overview; challenge data and trained weights are not included.

Installation

Clone the repository and install uv:

git clone https://github.com/YuliangXiaoYLX/flowvn-distillation.git
cd flowvn-distillation

For Linux CUDA training, select the Python version used for the paper:

export UV_PYTHON=3.10.20
uv sync --locked --extra cuda

For development on an Apple Silicon Mac, use uv sync --locked --extra cpu with the default Python 3.12.13. The Mac lock uses a newer SciPy wheel because the historical wheel fails to import on macOS 27. Linux CPU development also uses uv sync --locked --extra cpu; keep --extra cpu on subsequent uv run commands so uv retains the CPU build.

Linux training and full-volume reconstruction require an NVIDIA GPU. On Linux, the cuda extra selects the CUDA 13.0 PyTorch build. Weights & Biases is optional: uv sync --locked --extra cuda --extra wandb for GPU training, then enable use_wandb in your config. Keep --extra wandb on the corresponding uv run commands as well. Logging is local by default.

Try the model without data

uv run --locked --extra cpu python scripts/benchmark_flowvn.py \
  --device cpu --num-stages 2 --features-out 2 --kernel-size 3 \
  --depth 3 --time-frames 3 --spatial-size 8 --coils 2 \
  --num-warmup 1 --num-iters 2

uv run --locked --extra cpu python -m unittest discover -s tests

This uses random complex tensors and random weights. It checks that the model runs; its timing and outputs are not paper results.

Reconstruct

Prepare the files described in Data, place an authorized S8 checkpoint in checkpoints/, and update paths in configs/inference.yaml.

uv run --locked --extra cuda python main.py --config configs/inference.yaml \
  --ckpt_path checkpoints/s8_full_seed12345.ckpt

Reconstructed complex arrays are written under outputs/reconstructions/. The checkpoint must match num_stages; set it to 16 for an S16 model.

Train

All recipes use the same S16 initialization, ten-epoch budget, and data splits.

Config Final-output loss Trajectory loss Update loss
configs/s8_supervised.yaml 0 0 0
configs/s8_final.yaml 0.25 0 0
configs/s8_trajectory.yaml 0.25 0.25 0
configs/s8_full.yaml 0.25 0.25 0.10

Obtain the authorized data, S16 teacher, and organizer mask package, then edit the relative paths in the config. Use the organizer masks for the paper recipes:

export FLOWVN_MASK_BACKEND=challenge
export FLOWVN_CHALLENGE_MASK_ARCHIVE="$PWD/external/CMRx4DFlowMaskGeneration.zip"

uv run --locked --extra cuda python main.py --config configs/s8_full.yaml \
  --seed 12345 --save_dir outputs/s8_full/seed12345

Repeat each recipe with seeds 12345 and 23456, using a separate output directory. The ground-truth loss stays active throughout training; the teacher losses are scheduled off after epoch five. Full-state checkpoints support resuming interrupted training. See Reproduction for evaluation, checkpoint selection, statistics, and the two benchmark protocols.

Code map

main.py                         Training, validation, and reconstruction
networks/flowvn.py               Unrolled reconstruction model
utils/flowvn_distillation.py     Stage alignment and teacher losses
utils/dataloader_CMRx4DFlow.py   Data loading and preprocessing
utils/flowvn_validation.py       Grouped validation across velocity encodings
utils/utils_metrics.py           Image, phase, and physical velocity metrics
configs/                        Four training recipes, validation, inference
scripts/                        Timing and case-level analysis
tests/                          Synthetic behavior and command checks

Citation

@inproceedings{XiaYul_StageAligned_MICCAISAT2026,
    author = {Xiao, Yuliang AND Anvari Hamedani, Kian AND Vavasour, Zach AND Graham, Simon J. AND Chiew, Mark},
    title = {Stage-Aligned Knowledge Distillation for Fast and Memory-Efficient 4D Flow MRI Reconstruction},
    booktitle = {Medical Image Computing and Computer Assisted Intervention -- MICCAI 2026 Workshops and Challenges},
    year = {2026},
    publisher = {Springer Nature Switzerland},
    volume = {LNCS 17267},
    url = {https://papers.miccai.org/miccai-2026-sat/CMRxRecon2026_010.html}
}

The citation follows the MICCAI record. The DOI, publication month, and page range are not yet listed there and are omitted above. Machine-readable citation: CITATION.cff.

Acknowledgments and licenses

This project builds on FlowVN, the organizer's reconstruction demo, and the implementations credited in THIRD_PARTY_NOTICES.md. The project's own code is provided under the MIT license. Third-party components retain their upstream terms, including the noncommercial terms stated for PCMRI-MSAC. See THIRD_PARTY_NOTICES.md for file-level attribution and license scope.

Ähnliche Projekte entdecken

Wird geladen…