Papers › SwiFT: Swin 4D fMRI Transformer

SwiFT: Swin 4D fMRI Transformer

12 Jul 2023NeurIPS 2023 11arXiv:2307.05916archive 2025-07-28

Peter Yongho Kim, Junbeom Kwon, Sunghwan Joo, Sangyoon Bae, DongGyu Lee, Yoonho Jung, Shinjae Yoo, Jiook Cha, Taesup Moon

Modeling spatiotemporal brain dynamics from high-dimensional data, such as functional Magnetic Resonance Imaging (fMRI), is a formidable task in neuroscience. Existing approaches for fMRI analysis utilize hand-crafted features, but the process of feature extraction risks losing essential information in fMRI scans. To address this challenge, we present SwiFT (Swin 4D fMRI Transformer), a Swin Transformer architecture that can learn brain dynamics directly from fMRI volumes in a memory and computation-efficient manner. SwiFT achieves this by implementing a 4D window multi-head self-attention mechanism and absolute positional embeddings. We evaluate SwiFT using multiple large-scale resting-state fMRI datasets, including the Human Connectome Project (HCP), Adolescent Brain Cognitive Development (ABCD), and UK Biobank (UKB) datasets, to predict sex, age, and cognitive intelligence. Our experimental outcomes reveal that SwiFT consistently outperforms recent state-of-the-art models. Furthermore, by leveraging its end-to-end learning capability, we show that contrastive loss-based self-supervised pre-training of SwiFT can enhance performance on downstream tasks. Additionally, we employ an explainable AI method to identify the brain regions associated with sex classification. To our knowledge, SwiFT is the first Swin Transformer architecture to process dimensional spatiotemporal brain functional data in an end-to-end fashion. Our work holds substantial potential in facilitating scalable learning of functional brain imaging in neuroscience research by reducing the hurdles associated with applying Transformer models to high-dimensional fMRI.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2307.05916")

Code

Syntology Ran 19 of 42 code samples harvested from 5 repositories linked to this paper; 23 have no recorded run. Of those that ran: 2 ran · our draft was wrong; 2 ran · fixture could not drive it; 15 ran with no contract checked.

By repository: official repository: 12 samples from 1 repository, 8 ran; found in paper text by Syntology: 30 samples from 4 repositories, 11 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

transconnectome/swift officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

42 samples harvested; 19 ran; 0 honoured the contract we drafted; 23 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran · our draft was wrong
2ran · fixture could not drive it
15ran
23unverified

Licence: 7 of the 42 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 5 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

window_partition transconnectome/swift/project/module/models/swin4d_transformer_ver7.py official repository ran · our draft was wrong Apache-2.0 (permissive) · e0d194741047c322 · report
PatchEmbed transconnectome/swift/project/module/models/swin4d_transformer_ver7.py official repository ran Apache-2.0 (permissive) · 6c813e3ad36d54c6 · report
PatchMergingV2 transconnectome/swift/project/module/models/swin4d_transformer_ver7.py official repository ran Apache-2.0 (permissive) · 328b4af4918629c8 · report
PositionalEmbedding transconnectome/swift/project/module/models/swin4d_transformer_ver7.py official repository ran Apache-2.0 (permissive) · 68b986bf66c51ea9 · report
WindowAttention4D transconnectome/swift/project/module/models/swin4d_transformer_ver7.py official repository ran Apache-2.0 (permissive) · b560de9c9e1dc9dc · report
compute_mask transconnectome/swift/project/module/models/swin4d_transformer_ver7.py official repository ran · our draft was wrong Apache-2.0 (permissive) · 961af72c78cb1191 · report
get_window_size transconnectome/swift/project/module/models/swin4d_transformer_ver7.py official repository ran · fixture could not drive it Apache-2.0 (permissive) · 34484ba7deb03520 · report
window_reverse transconnectome/swift/project/module/models/swin4d_transformer_ver7.py official repository ran · fixture could not drive it Apache-2.0 (permissive) · 277cca9a3532b997 · report
BasicLayer transconnectome/swift/project/module/models/swin4d_transformer_ver7.py official repository unverified Apache-2.0 (permissive) · 64670e8bbebf37ee · report
BasicLayer_FullAttention transconnectome/swift/project/module/models/swin4d_transformer_ver7.py official repository unverified Apache-2.0 (permissive) · 82954f2e594f9808 · report
SwinTransformer4D transconnectome/swift/project/module/models/swin4d_transformer_ver7.py official repository unverified Apache-2.0 (permissive) · 282c605afc9a9df9 · report
SwinTransformerBlock4D transconnectome/swift/project/module/models/swin4d_transformer_ver7.py official repository unverified Apache-2.0 (permissive) · 32ee991678bfe389 · report
SpatioTemporalConv DAVEISHAN/TCLR/tclr_pretraining/r3d_prp.py found in paper text by Syntology ran · metamorphic tier: invariant MIT (permissive) · 2c09aa35ea6cf969 · report
get_param_group_no_wd Wayfear/BrainNetworkTransformer/source/components/optimizer.py found in paper text by Syntology ran MIT (permissive) · b93d89b36f5d3776 · report
init_dataloader Wayfear/BrainNetworkTransformer/source/dataset/dataloader.py found in paper text by Syntology ran MIT (permissive) · 14b27b9a81d9c709 · report
logger_factory Wayfear/BrainNetworkTransformer/source/components/logger.py found in paper text by Syntology ran MIT (permissive) · 0b3026b607b39b17 · report
lr_scheduler_factory Wayfear/BrainNetworkTransformer/source/components/lr_scheduler.py found in paper text by Syntology ran MIT (permissive) · 6d0049b1f197cbe2 · report
optimizer_factory Wayfear/BrainNetworkTransformer/source/components/optimizer.py found in paper text by Syntology ran MIT (permissive) · be45113508613473 · report
optimizers_factory Wayfear/BrainNetworkTransformer/source/components/optimizer.py found in paper text by Syntology ran MIT (permissive) · fd96023efb6b2b49 · report
set_file_handler Wayfear/BrainNetworkTransformer/source/components/logger.py found in paper text by Syntology ran MIT (permissive) · b16e48b96d32841d · report
sigmoid_focal_loss Project-MONAI/MONAI/monai/losses/focal_loss.py found in paper text by Syntology ran Apache-2.0 (permissive) · 0a9007867090337a · report
softmax_focal_loss Project-MONAI/MONAI/monai/losses/focal_loss.py found in paper text by Syntology ran Apache-2.0 (permissive) · cf84889126420b19 · report
spatial_gradient Project-MONAI/MONAI/monai/losses/deform.py found in paper text by Syntology ran fingerprinted Apache-2.0 (permissive) · d7c2de9a1750ea2b · report
BaseModel GonyRosenman/TFF/model.py found in paper text by Syntology unverified no licence file found · pointer only · 7c145bb8dd7de3e8 · report
BottleNeck_in GonyRosenman/TFF/model.py found in paper text by Syntology unverified no licence file found · pointer only · 0f08ae993a0c2db4 · report
BottleNeck_out GonyRosenman/TFF/model.py found in paper text by Syntology unverified no licence file found · pointer only · fcbcaa008dd46021 · report
Decoder GonyRosenman/TFF/model.py found in paper text by Syntology unverified no licence file found · pointer only · c921c50ee314871e · report
Encoder GonyRosenman/TFF/model.py found in paper text by Syntology unverified no licence file found · pointer only · 7b86cf23e6c30cc6 · report
Encoder_Transformer_Decoder GonyRosenman/TFF/model.py found in paper text by Syntology unverified no licence file found · pointer only · 453a114ddaa22943 · report
R3DNet DAVEISHAN/TCLR/tclr_pretraining/r3d_prp.py found in paper text by Syntology unverified MIT (permissive) · 8d8eac234638f60f · report
SpatioTemporalResBlock DAVEISHAN/TCLR/tclr_pretraining/r3d_prp.py found in paper text by Syntology unverified MIT (permissive) · 065d6753334a893e · report
SpatioTemporalResLayer DAVEISHAN/TCLR/tclr_pretraining/r3d_prp.py found in paper text by Syntology unverified MIT (permissive) · dae33da258ab777e · report
Transformer_Block GonyRosenman/TFF/model.py found in paper text by Syntology unverified no licence file found · pointer only · 524f03b0d35aaa91 · report
init_stratified_dataloader Wayfear/BrainNetworkTransformer/source/dataset/dataloader.py found in paper text by Syntology unverified MIT (permissive) · cd853ca321de5189 · report
load_abcd_data Wayfear/BrainNetworkTransformer/source/dataset/abcd.py found in paper text by Syntology unverified MIT (permissive) · b660db87ab516861 · report
load_abide_data Wayfear/BrainNetworkTransformer/source/dataset/abide.py found in paper text by Syntology unverified MIT (permissive) · a179c3e7ac1bdec0 · report
register_vcs_handler Project-MONAI/MONAI/monai/_version.py found in paper text by Syntology unverified Apache-2.0 (permissive) · c55cafde08716f01 · report
run_command Project-MONAI/MONAI/monai/_version.py found in paper text by Syntology unverified Apache-2.0 (permissive) · dbb37355631dabcf · report
soft_dilate Project-MONAI/MONAI/monai/losses/cldice.py found in paper text by Syntology unverified Apache-2.0 (permissive) · edd33c56dd0421f0 · report
soft_erode Project-MONAI/MONAI/monai/losses/cldice.py found in paper text by Syntology unverified Apache-2.0 (permissive) · ebb4c26db0d1a569 · report
soft_open Project-MONAI/MONAI/monai/losses/cldice.py found in paper text by Syntology unverified Apache-2.0 (permissive) · 302a88a3b3b24caf · report
versions_from_parentdir Project-MONAI/MONAI/monai/_version.py found in paper text by Syntology unverified Apache-2.0 (permissive) · 5032e3b81c0fffb3 · report

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxStochastic DepthSwin TransformerTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections