Open-source · github.com/YuZh98/VAE-fMRI-Alzheimer
A recurrent 3D-conv VAE for resting-state fMRI volumes, in the same family as Kim et al. (2021) but with a linear latent transition solved in closed form by ridge regression rather than learned by SGD. Ships with a synthetic data path so you can run it without ADNI access; every example fits on a laptop CPU.
| |
Tutorials
tutorials/ has 18 hands-on lessons covering tensor shapes, 3D-conv arithmetic, the reparameterization trick, recurrent rollouts, alternating optimization, reproducibility, testing DL code, and research extensions.
Architecture
A 3D-convolutional VAE with a latent recurrence:
| |
Loss
| Term | Form | How it’s optimized |
|---|---|---|
loss1 | Per-volume reconstruction MSE / σ_x² | SGD |
loss2 | ‖h_t − g(h_{t-1})‖² / σ_h² (temporal) | SGD |
loss_z | λ_z · ‖z‖₁ (subject-noise sparsity) | SGD |
loss_F | ρ · ‖F‖_F² (reported, not back-propped) | Closed form (ridge) |
Visuals
| Loss curve | Reconstruction | Latent trajectory |
|---|---|---|
![]() | ![]() | ![]() |
Citation
If you use this code in research or teaching, please cite via the GitHub “Cite this repository” button (driven by CITATION.cff).


