NeuroFlow: Toward Unified Visual Encoding and Decoding from Neural Activity
Authors: Weijian Mai, Mu Nan, Yu Zhu, Jiahang Cao, Rui Zhang, Yuqin Dai, Chunfeng Song, Andrew F. Luo, Jiamin Wu
Organizations: Shanghai Artificial Intelligence Laboratory · University of Hong Kong · Shenzhen Loop Area Institute · Tsinghua University · Chinese University of Hong Kong
Visual encoding and decoding models act as gateways to understanding the neural mechanisms underlying human visual perception. Typically, visual encoding models that predict brain activity from stimuli and decoding models that reproduce stimuli from brain activity are treated as distinct tasks, requiring separate models and training procedures. This separation is inefficient and fails to model the consistency between encoding and decoding processes. To address this limitation, we propose NeuroFlow, the first unified framework that jointly models visual encoding and decoding from neural activity within a single flow model. NeuroFlow introduces two key components: (1) NeuroVAE is designed as a variational backbone to model neural variability and establish a compact, semantically structured latent space for bidirectional modeling across visual and neural modalities. (2) Cross-modal Flow Matching (XFM) bypasses the typical paradigm of noise-to-data diffusion guided by a specific modality condition, instead learning a reversibly consistent flow model between visual and neural latent distributions. For the first time, visual encoding and decoding are reformulated as a time-dependent, reversible process within a shared latent space for unified modeling. Empirical results demonstrate that NeuroFlow achieves superior overall performance in visual encoding and decoding tasks with higher computational efficiency compared to any isolated methods. We further analyze principal factors that steer the model toward encoding-decoding consistency and, through brain functional analyses, demonstrate that NeuroFlow captures consistent activation patterns underlying neural variability. NeuroFlow marks a major step toward unified visual encoding and decoding from neural activity, providing mechanistic insights that inform future bidirectional visual brain-computer interfaces.
Figures & tables
Figure 2: Visual encoding-decoding frameworks.
Figure 3: Cross-modal alignment pipelines.
Figure 4: Architecture overview. Stage-1 (A): NeuroVAE introduces probabilistic learning to model neural variability and constrains the latent space with visual semantics for consistent image-to-fMRI synthesis. Stage-2 (B): XFM unifies encoding and decoding processes by learning a time-dependent, reversible flow between empirical visual and neural latent distributions. Stage-3 (C): Encoding and decoding are performed within a single model at inference, where reversing the temporal direction naturally transitions between the two processes.
Figure 5: Qualitative visual encoding and decoding performance comparisons. Left: NeuroFlow achieves superior decoding quality in semantic fidelity and visual structure. Right: NeuroFlow suppresses irrelevant cortical activity while enhancing category-specific regions, capturing consistent activation patterns underlying neural variability to support image synthesis consistent with visual stimuli. Positive (red) and negative (blue) values indicate increased and reduced activations, with color intensity reflecting the absolute magnitude of deviation.
Method
Type
Decoding
Encoding ( → Decoding)
Retrieval
Incep ↑
CLIP ↑
Eff ↓
SwAV ↓
Incep ↑
CLIP ↑
Eff ↓
SwAV ↓
Raw ↑
Syn ↑
MindSimulator [ 3 ]
E
-
-
-
-
93.1%
91.2%
.689
.391
-
-
SynBrain [ 39 ]
E
-
-
-
-
95.7%
94.3%
.639
.362
84.8%
92.5%
BrainDiffuser [ 43 ]
D
91.3%
90.9%
.728
.421
-
-
-
-
18.8%
-
MindEye [ 51 ]
D
94.6%
93.3%
.622
.343
-
-
-
-
90.0%
-
MindEye2 [ 52 ]
D
95.4%
93.0%
.618
.344
-
-
-
-
98.8%
-
Table 1: Quantitative visual encoding and decoding performance comparisons.
Method
Type
Pretrain
Architecture
Param
SynBrain [ 39 ]
E
×
VAE+Transformer
690M
MindEye [ 51 ]
D
×
MLP+DP
1.00B
MindEye2 [ 52 ]
D
✓
Linear+MLP+DP
2.60B
NeuroFlow
E&D
×
VAE+XFM
660M
Table 2: Model efficiency comparisons.
Figure 6: Empirical visualizations. (A) Ablation study : removing key objectives leads to degraded visual fidelity and semantic coherence. (B) Flow trajectory : Encoding trajectory reveals a suppression of early visual responses and a transition toward functional regions (i.e., FFA and EBA). Decoding trajectory evolves from an initial structural sketch, not Gaussian noises , to a realistic and high-fidelity image. (C-D) Brain functional analysis : category-selective fMRI activations and voxel-wise evaluation derived from raw and synthetic fMRI, computed on the whole test set, showing that NeuroFlow suppresses early visual activity and emphasizes higher-order functional regions.
Method
Decoding
Encoding ( → Decoding)
Retrieval
Incep ↑
CLIP ↑
Eff ↓
SwAV ↓
Incep ↑
CLIP ↑
Eff ↓
SwAV ↓
Raw ↑
Syn ↑
w/o zc
94.7%
94.0%
.683
.378
97.2%
96.6%
.636
.373
84.1%
90.4%
w/o Lkl
89.0%
79.6%
.807
.475
60.7%
57.1%
.956
.606
75.1%
11.5%
w/o Lcyc
94.9%
93.7%
.687
.383
96.8%
95.5%
.658
.382
81.4%
88.9%
w/o Lclip - Lcyc
57.6%
58.8%
.961
.674
52.6%
51.3%
.983
.700
0.3%
0.5%
w/o LXFM
87.7%
83.7%
.788
.497
60.3%
58.1%
.953
.644
86.4%
14.1%
Table 3: Quantitative performance comparisons between NeuroFlow and its ablated variants on Subject 1.
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 7: High-order functional regions in the visual cortex.
Schedule
Decoding
Encoding ( → Decoding)
Retrieval
Incep ↑
CLIP ↑
Eff ↓
SwAV ↓
Incep ↑
CLIP ↑
Eff ↓
SwAV ↓
Raw ↑
Syn ↑
Linear
95.4%
94.4%
.682
.377
98.5%
98.4%
.618
.359
86.4%
96.0%
Cosine*
95.9%
95.0%
.675
.370
98.5%
98.7%
.600
.347
86.4%
96.4%
Appendix
Table 4: Ablation experiments on linear and cosine interpolation schedules.
Step
Decoding
Encoding ( → Decoding)
Retrieval
Incep ↑
CLIP ↑
Eff ↓
SwAV ↓
Incep ↑
CLIP ↑
Eff ↓
SwAV ↓
Raw ↑
Syn ↑
10
95.0%
94.3%
.682
.385
98.0%
98.3%
.617
.356
86.4%
96.0%
20*
95.9%
95.0%
.675
.370
98.5%
98.7%
.600
.347
86.4%
96.4%
30
95.7%
95.3%
.674
.372
98.5%
98.7%
.597
.345
86.4%
96.4%
Appendix
Table 5: Ablation experiments on the effect of different sampling steps.
Method
Decoding
Encoding → Decoding
Retrieval
Incep ↑
CLIP ↑
Eff ↓
SwAV ↓
Incep ↑
CLIP ↑
Eff ↓
SwAV ↓
Raw ↑
Syn ↑
NeuroVAE
87.7%
83.7%
.788
.497
60.3%
58.1%
.953
.644
86.4%
14.1%
NeuroVAE+MSE
85.2%
81.4%
.832
.536
51.0%
52.0%
.978
.671
86.4%
2.8%
NeuroVAE+LRs
86.8%
83.0%
.794
.496
90.3%
87.0%
.783
.493
86.4%
90.8%
NeuroVAE+XFM*
95.9%
95.0%
.675
.370
98.5%
98.7%
.600
.347
86.4%
96.4%
Appendix
Table 6: Quantitative comparison between NeuroFlow (NeuroVAE+XFM*) and baseline models.
Method
Decoding
Encoding → Decoding
Retrieval
Incep ↑
CLIP ↑
Eff ↓
SwAV ↓
Incep ↑
CLIP ↑
Eff ↓
SwAV ↓
Raw ↑
Syn ↑
Sub1
95.9%
95.0%
.675
.370
98.5%
98.7%
.600
.347
86.4%
96.4%
Sub2
95.4%
93.3%
.677
.362
98.5%
98.5%
.595
.344
81.3%
97.8%
Sub5
97.0%
95.9%
.645
.345
98.8%
99.0%
.569
.329
84.7%
98.3%
Sub7
93.9%
92.7%
.699
.378
98.5%
98.5%
.598
.344
69.8%
95.5%
Appendix
Table 7: Quantitative subject-specific visual encoding and decoding results.
Figure 8: Qualitative comparisons between NeuroFlow (NeuroVAE-XFM) and baseline models.
Figure 9: Qualitative subject-specific visual encoding and decoding results.
Figure 10: Subject-specific fMRI activations and corresponding image reconstructions.
School of Artificial Intelligence, Tianjin University, Tianjin, China · Shanghai Artificial Intelligence Laboratory, Shanghai, China · The Chinese University of Hong Kong, Hong Kong, China.