This section presents a scenario in which a neurotherapeutic with an unknown mechanism of action is investigated using the HNN modeling software. The goal is to use pre-treatment and post-treatment EEG signals to generate predictions on how the neurotherapeutic alters neural circuits. The results are presented for demonstration purposes to illustrate how HNN modeling can be applied to investigate neurotherapeutic mechanisms.
Developing mechanistic hypotheses underlying EEG ERP biomarkers (Step 1)
In this example, a hypothetical sensory ERP paradigm is used to examine how the neurotherapeutic alters the signal (Step 1). Figure 1A shows a pre-treatment auditory ERP (blue) alongside a hypothetical post-treatment ERP (red; see also Figure 9). The pre-treatment auditory ERP is experimentally recorded source-localized data from Kohl et al.43, and the hypothetical post-treatment ERP is generated by scaling the pre-treatment waveform with a Gaussian-tapered window. As shown, the hypothetical neurotherapeutic produces a large decrease in the magnitude of the P1, N1, and P2 components relative to the pre-treatment ERP.
Note that in Kohl et al.43, from which the pre-treatment ERP data was obtained, the HNN simulations used a model in which pyramidal neurons were enhanced with more realistic calcium channel dynamics than in the default HNN model. As a result, the simulation results in Kohl et al.43, differ slightly from those shown here. The Kohl et al. 2020 model (and other updated HNN models) can be accessed through the Python API (https://jonescompneurolab.github.io/hnn-core/stable/generated/hnn_core.calcium_model.html#hnn_core.calcium_model). Access to such expanded models through the GUI is currently under development.
Next, identify model parameters representing treatment-related effects (i.e., parameters of interest) that are hypothesized to explain how the neurotherapeutic reduces the P1, N1, and P2 magnitudes (Steps 1.6–1.8). Broad categories of candidate neural mechanisms (and corresponding model parameters) include timing of exogenous synaptic inputs, local neuronal ion channel conductances, local synaptic connectivity, and exogenous synaptic connectivity (Figure 1B). In this example, candidate mechanisms from each category are evaluated using HNN to assess how changes in these parameters impact the simulated ERP.
Parameters of interest
- Standard deviation of the first (thalamocortical) proximal drive (i.e., thalamocortical synchrony), representing variability in synchronization of initial feedforward sensory inputs.
- Muscarinic potassium (Km) channel conductance in layer 5 (L5) pyramidal neurons, controlling neuronal excitability, such that excitability decreases as conductance increases.
- Local GABAB receptor strength, corresponding to a slow inhibitory synapse delivered by interneurons to all cells in the local network.
- Conductance strength of the feedback (corticocortical) distal drive, representing the strength of the ~100 ms sensory-evoked feedback input to AMPA and NMDA synapses in supragranular layers.
Establishing the pre-treatment ERP model fit (Steps 3–4)
Simulate the pre-treatment ERP by following Steps 3–4 (final pre-treatment simulation shown in Figure 8C). A successful result is indicated by a close match between simulated and empirical waveforms, as quantified by a high correlation coefficient and low RMSE.
Establishing the post-treatment ERP model fit (Step 5)
Use the pre-treatment ERP model as a starting point and apply manual tuning and parameter optimization to determine whether the parameters of interest can reproduce the empirical post-treatment ERP. A successful fit indicates that the hypothesized parameters are sufficient to explain treatment-related changes in the ERP waveform.
Uncertainty quantification with SBI (Step 6)
Due to parameter degeneracy inherent in biophysical models, uncertainty quantification using SBI (Step 6) is essential for making predictions about pre- to post-treatment parameter changes. A critical prerequisite for SBI is achieving accurate fits to pre-treatment and post-treatment ERPs (Steps 3–5). If accurate fits are not achieved, posterior samples generated by SBI may not reproduce the empirical waveforms, leading to unreliable predictions.
If a successful fit cannot be achieved in Steps 3–5, revise the selection of parameters of interest and their prior ranges before applying SBI.
In this example, SBI is applied only to the four post-treatment parameters of interest, while all other parameters are held fixed. Although applying SBI to a larger parameter set can improve robustness, it substantially increases computational cost (see Discussion).
SBI is used to estimate full parameter distributions that generate simulated ERPs closely matching target waveforms. Briefly, SBI is a Bayesian inference approach that trains a neural network to map model outputs to distributions of model parameters52,53,55. The trained network is then applied to empirical waveforms to infer parameter distributions consistent with the data. This requires prior hypotheses on parameter ranges.
In this example, a uniform prior distribution is defined over the four parameters of interest: thalamocortical synchrony, pyramidal neuron dendritic Km conductance, local GABAB conductance, and corticocortical feedback strength. Prior bounds are defined as scalar multiples of default values: 0–5× for thalamocortical synchrony and 10−1–101× for the remaining parameters.
Figure 10A shows the resulting parameter distributions for pre-treatment and post-treatment ERPs, visualized using a pairplot. Diagonal panels display univariate distributions, while off-diagonal panels display bivariate relationships. Mechanistic predictions correspond to parameters with strongly separated distributions between conditions.
Inspection of the univariate distributions shows that thalamocortical synchrony exhibits the greatest pre- to post-treatment separability (lowest OVL of 0.07) and increases following treatment (Figure 10A(iii), red). This indicates that the HNN framework predicts modulation of thalamocortical synchrony as a potential mechanism of action.
Posterior predictive validation
Validate inferred parameter distributions using a PPC. Generate independent parameter samples from the posterior distribution and simulate corresponding ERPs. A successful PPC is indicated when simulated waveforms closely match the empirical ERP.
As shown in Figure 10B and Figure 10C, both pre-treatment (Figure 10B, blue) and post-treatment (Figure 10C, red) waveforms closely match simulations generated from posterior samples (black), with correlation coefficients of 0.99 and 0.96, respectively (averaged over 10 independent samples). These results confirm that the inferred parameter distributions produce accurate waveform reconstructions.
An example of an unsuccessful PPC is provided in Supplementary Figure 1. The example follows the same structure as Figure 10 and uses the same trained SBI network; however, an alternate post-treatment waveform is used that is not well represented in the training set (e.g., ERP waveforms with a positive deflection at the N1 latency). The failed PPC is indicated in Supplementary Figure 1C, where the correlation coefficient is low (e.g., Corr < 0.95). Notably, the posterior distribution in Supplementary Figure 1A shows highly separated parameter distributions. Without performing a PPC, these results could be misinterpreted as meaningful differences between pre-treatment and post-treatment conditions. This example highlights the importance of conducting a PPC alongside interpretation of posterior distributions, as results from a failed PPC are unreliable and should not be further analyzed.
Model examination and validation (Step 7)
Using the HNN model, it is possible to directly inspect and visualize cell- and circuit-level activity, such as spiking, underlying each ERP simulation (Step 7.2.2). Figure 11A and Figure 11B shows simulated ERPs sampled from pre-treatment and post-treatment parameter distributions, alongside corresponding cell-specific spiking activity (Figure 11C and Figure 11D).

Figure 11. Cell-level spiking activity underlying EEG biomarker generation. (A) Pre-treatment ERP (blue) with a single posterior predictive simulation (black). (B) Post-treatment ERP (red) with a corresponding posterior predictive simulation (black). (C) Simulated spiking activity underlying the pre-treatment ERP. (D) Simulated spiking activity underlying the post-treatment ERP. Please click here to view a larger version of this figure.
The waveforms are visualized without smoothing to emphasize the contribution of spike timing to the current dipole. In experimental EEG signals, large neuronal populations produce spatially averaged signals that appear smoother. Because HNN simulates a smaller population (200 pyramidal neurons), smoothing is used to approximate larger-scale activity (>100,000 neurons).
A notable difference between conditions is reduced spiking activity in L5 pyramidal neurons following treatment (Figure 11C and Figure 11D, red dot). Note that Figure 11 shows a single sample from the posterior distribution; multiple samples should be analyzed to generate robust predictions. These results demonstrate that the hypothetical neurotherapeutic alters multiscale circuit activity, resulting in decreased P1–N1–P2 amplitudes.
Predictions such as these can be directly tested through invasive electrophysiology (e.g., high-density laminar probe recordings) or other imaging modalities (Step 7.3). Newly acquired data can then be used to further constrain model predictions. While this protocol focuses on fitting macroscale EEG data to infer microcircuit activity, the framework can also be applied in reverse by fitting microcircuit data (e.g., spiking, LFP/CSD) to infer macroscale EEG signals.
Supplementary Figure 1. Example of a failed posterior predictive check in the SBI workflow. Plots are organized identically to Figure 10. The pre-treatment data (blue) is identical to Figure 10. The hypothetical post-treatment data was generated identically as before (waveform multiplied with a Gaussian-tapered window), but transformed to produce a positive peak that is not well represented in the training set of HNN simulations. (A) Pairplot visualization of parameter distributions estimated using SBI. Diagonal panels (i–iv) show univariate distributions for individual parameters, including (i) thalamocortical synchrony, (ii) dendritic Km conductance, (iii) GABAB conductance, and (iv) corticocortical feedback strength. Distributions for pre-treatment (blue) and post-treatment (red) conditions demonstrate high separability for all parameters (OVL < 0.1). Off-diagonal panels show bivariate relationships between parameters. (B) Posterior predictive check (PPC) for pre-treatment ERP; simulated waveforms (black) closely match empirical data (blue). (C) PPC for post-treatment ERP; simulated waveforms (black) are highly dissimilar to the empirical data (red), with Corr < 0.95 indicating a failed PPC.Please click here to download this file.