AFTER-QSM
March 20, 2026 · View on GitHub
Affine Transformation Edited and Refined (AFTER) Deep Neural Network for Quantitative Susceptibility Mapping
NeuroImage 2022 | deepMRI collection
AFTER-QSM is a dedicated deep neural network for QSM reconstruction from highly oblique and anisotropic resolution scans (down to 0.6 mm isotropic), where standard networks trained on axial data fail due to orientation mismatch.
Requirements
- Python 3.7+, PyTorch
- NVIDIA GPU (8 GB+ VRAM recommended)
Tested on: Windows 11.
Overview
Framework

Fig. 1: Overview of the AFTER-QSM training process using affine transformation editing and refinement.
Simulation Results

Usage
Training
python train.py \
--root <training_data_root> \
--file_path <path_list_file> \
--depth 4 \
--recon_base 32 \
--channel_num 16 \
--refine_base 16 \
--block_num 3 \
--layer_num 4 \
--batch_size 1 \
--epoch 100 \
--gpu_num 1 \
--lr1 1e-4 \
--lr2 1e-4
Implement your dataset by overriding
path_compositionintrain.py.
Key training arguments:
| Argument | Description |
|---|---|
--root | Root directory of training dataset |
--depth | U-net depth for QSM reconstruction |
--recon_base | Base channel number for reconstruction U-net |
--channel_num | Channels for successive refinement network |
--refine_base | Base channels for refinement network |
--block_num | Number of RDB blocks |
--layer_num | Layers per RDB block |
--use_dense | Dense architecture vs. Squeeze-and-Excitation |
--padding | Zero-padding radius for rotation boundary |
Testing
python test.py \
--field_path <path_to_field_map.nii> \
--vox <vx vy vz> \
--z_prjs <x y z> \
--checkpoint_path <path_to_checkpoint> \
--save_path <output_dir>
Key testing arguments:
| Argument | Description |
|---|---|
--field_path | Path to testing data |
--vox | Voxel size of testing data |
--z_prjs | B0 direction (z-projections) |
--use_GPU | Use GPU (boolean) |
--GPU_NO | GPU device index |
--save_path | Output save path |
--checkpoint_path | Path to model checkpoint |
--segment_num | Memory trade-off: 8 for <24 GB, 4 for <12 GB |
--data_type | field for direct recon, otherwise forward calc |
Citation
@article{afterqsm2022,
title={Affine transformation edited and refined deep neural network for quantitative susceptibility mapping},
journal={NeuroImage},
year={2022},
doi={10.1016/j.neuroimage.2022.119655}
}