VFA: Vector Field Attention

Overview

Vector Field Attention replaces the decoder of a registration network by an attention mechanism: correspondences are found by comparing the moving and fixed feature maps directly, and the displacement is read off the attention weights. VFA is light (about 2 M parameters), contrast-robust, and the model behind the LUMIR24 / LUMIR25 challenge entries.

Variants

Class

Description

Output

VFA

Base model; SVF=True integrates the field, return_full=True also returns the warped images and the inverse flow exp(-v), return_all_flows=True the per-level flows.

flow

VFASPR

VFA with a spatially varying regularization decoder on the matching features.

(flow, wts) or (pos_flow, neg_flow, wts)

TransVFA

Transformer-augmented VFA encoder.

flow

HyperVFA, HyperVFASPR

Hypernetwork-conditioned regularization weight (see HyperTransMorph); config.nb_hyp_units sets the width of the hypernetwork embedding (default 96; 16 in the browser demo). 2D and 3D.

as VFA / VFASPR

Usage

from MIR.models import VFA, VFASPR
import MIR.models.configs_VFA as configs_VFA

config = configs_VFA.get_VFA_default_config()
config.img_size = fix.shape[2:]
model = VFA(config, device='cuda:0').cuda()
flow = model((mov, fix))

spr = VFASPR(config, device='cuda:0', SVF=True).cuda()
pos_flow, neg_flow, wts = spr((mov, fix))

Pretrained weights

ModelWeights['VFA-LUMIR24-MonoModal'] (key model_state_dict), ModelWeights['VFA-LUMIR25-MultiModal'], ModelWeights['VFA-IXI-Atlas2Subject'], ModelWeights['VFA-SPR-IXI-Atlas2Subject'], segmentation and synthesis heads ModelWeights['VFA-SegHead'], ['VFA-SynthHead'].

Key modules

  • MIR.models.VFA, MIR.models.configs_VFA

  • MIR.models.TransVFA, MIR.models.HyperVFA

References

  • Liu, Chen, Zuo, Carass, Prince. Vector field attention for deformable image registration. Journal of Medical Imaging 2024. Paper