This repository contains the code associated with the paper:
Cárdenas Sánchez, M. et al. (2026)
A Framework Integrating Spiking Cortical Circuit Modeling and Simulation-Based Inference to Probe Biomarkers of Cortical Dysfunction in Alzheimer’s Disease
Interdisciplinary Sciences: Computational Life Sciences (Springer Nature)
DOI: https://doi.org/10.1007/s12539-026-00817-8
This work introduces a computational framework that combines the causal interpretability of mechanistic modeling with the predictive power of simulation-based inference (SBI) to uncover cortical circuit dysfunction underlying dementia-related neurophysiological changes.
The framework integrates:
- Biophysically grounded spiking cortical circuit simulations
- Generation of current dipole moments (CDM) and EEG signals
- Feature extraction from simulated and empirical signals
- Training of neural posterior estimation (NPE) models
- Posterior inference on empirical EEG data
- Statistical analysis and figure generation
The repository contains the full pipeline used in the study, including benchmarking, model training, posterior inference, and generation of publication figures.
For clarity and reproducibility, the code has been organized into three clearly separated blocks, corresponding to the main stages of the article:
SBI_mechanistic_modeling_AD/
├── sbibm/
│ ├── 1_benchmark_parallel.py
│ ├── 2_merge_results.py
│ ├── 3_plot_fig2.py
│ └── all_results/
│
├── training_models/
│ ├── 4_train_CDM_catch22.py
│ ├── 5_train_CDM_power.py
│ ├── 6_train_CDM_wavelets.py
│ ├── 7_plot_fig3.py
│ └── 11_train_EEG_catch22.py
│
└── empirical_dataset/
├── 8_create_empirical_dataset.py
├── 9_plot_fig4.py
├── 10_plot_fig5.py
├── 12_compute_posteriors_emp_dataset.py
├── 13_plot_fig6_y_fig7.py
├── Analysis.py
└── tools.py
Each block represents a different conceptual stage of the framework.
This block performs benchmarking of different SBI configurations using synthetic tasks from SBIBM.
It includes:
- Parallel benchmarking runs
- Aggregation and merging of benchmark results
- Generation of the benchmarking figure (Figure 2 in the paper)
This stage is used to validate and select the SBI configuration employed in the rest of the study.
This block contains scripts for training SBI models using features extracted from simulated CDM and EEG signals.
It includes:
- Training using different feature sets (e.g., catch22, power-based features, wavelets)
- Saving trained models, scalers, and inference objects
- Diagnostic and performance plots (Figure 3)
The models trained in this stage are later used for posterior inference on empirical EEG data.
If you want to skip the SBI training stage, the trained models used in this work are publicly available on Zenodo and can be downloaded directly:
https://zenodo.org/records/20375410
The repository includes the trained posterior models (model.pkl), inference objects (inference.pkl), and corresponding scalers (scaler.pkl) for the different experiments described in the paper.
This block handles the empirical data pipeline:
- Creation of the empirical EEG feature dataset
- Posterior inference on real subjects using trained SBI models
- Statistical analysis of inferred mechanistic parameters
- Generation of final figures (Figures 4–7)
This stage connects the mechanistic modeling framework to real neurophysiological data from dementia cohorts.
To reproduce the full pipeline described in the paper:
- Run the scripts in
sbibm/(benchmarking and model selection). - Run the scripts in
training_models/(train SBI models on simulated data). - Run the scripts in
empirical_dataset/(apply trained models to empirical EEG data and generate final figures).
The number at the beginning of each script (e.g.,
1_,4_,8_, etc.) indicates the recommended execution order to follow the pipeline presented in the article.
The simulation outputs used by the pipeline (e.g., feature matrices and parameter vectors θ) are available on Zenodo:
- Zenodo API record:
https://zenodo.org/api/records/15351118
Depending on your usage, you may download the archive manually from Zenodo (recommended for most users) or programmatically via the Zenodo API.
The experiments in this repository were executed on Albaicín, the High-Performance Computing (HPC) cluster of the University of Granada (UGR, Spain).
- The scripts are written to be runnable locally, but are HPC-oriented:
- large datasets (simulation banks, empirical EEG feature matrices)
- long-running training and posterior sampling
- output paths designed for scratch/parallel environments
Note: This repository does not include SLURM
.shsubmission files.
If you use this repository, please cite:
Cárdenas Sánchez, M. et al. (2026).
A Framework Integrating Spiking Cortical Circuit Modeling and Simulation-Based Inference to Probe Biomarkers of Cortical Dysfunction in Alzheimer’s Disease.
Interdisciplinary Sciences: Computational Life Sciences.
https://doi.org/10.1007/s12539-026-00817-8