Abstract
Neuroscientists fit morphologically and biophysically detailed neuron simulations to physiological data, often using evolutionary algorithms. However, such gradient-free approaches are computationally expensive, making convergence slow when neuron models have many parameters. Here we introduce a gradient-based algorithm using differentiable ODE solvers that scales well to high-dimensional problems. GPUs make parallel simulations fast and gradient calculations make optimization efficient. We verify the utility of our approach optimizing neuron models with active dendrites with heterogeneously distributed ion channel densities. We find that individually stimulating and recording all dendritic compartments makes such model parameters identifiable. Identification breaks down gracefully as fewer stimulation and recording sites are given. Differentiable neuron models, which should be added to popular neuron simulation packages, promise a new era of optimizable neuron models with many free parameters, a key feature of real neurons.
Introduction
To understand how single neurons process information, neuroscientists build biophysical, multicompartmental models. As experimental techniques like voltage imaging improve, it has become clear that neurons are highly complex—for instance, ion channel densities vary wildly across different branches of a neuron's dendritic tree. Accurately modeling this complexity requires a large number of parameters.
The current standard for fitting these models to data relies on 0th-order optimization methods, such as evolutionary algorithms (e.g., BluePyOpt). These algorithms scale quadratically with the number of parameters because they do not utilize gradient information. Consequently, modeling realistic neurons with hundreds of distinct dendritic compartments becomes a computational bottleneck, often forcing researchers to oversimplify their models to maintain computational feasibility.
Methods
The authors propose a shift to 1st-order gradient descent, which scales linearly with the number of parameters. By implementing biophysical, conductance-based neuron models in PyTorch and utilizing the torchdiffeq library, they created differentiable ODE solvers capable of handling stiff biophysical equations.
The model simulates membrane voltage dynamics ($V_m$) based on ion channel conductances (e.g., $\overline{g_{Na}}$ and $\overline{g_{K}}$) and external current inputs ($I_{ext}$). Error is calculated as the Mean Squared Error (MSE) between the model's output and target synthetic data, then backpropagated to update the conductance parameters for every individual compartment simultaneously.
Results
The approach was validated using synthetic datasets where "ground truth" models had randomized ion channel parameters.
Performance Benchmarks
- Toy Model (6 compartments, 12 parameters): Gradient descent achieved convergence in under 4.5 hours on a single GPU, reducing loss by over 99% and recovering ground truth parameters with high accuracy.
- Test Model (184 compartments, 368 parameters): A morphologically realistic pyramidal cell model was optimized in approximately 3 hours on one Nvidia A100 GPU. This represents a significant speedup compared to evolutionary algorithms, which typically require dozens of CPUs for much simpler models.
Parameter Identifiability
The authors investigated how the availability of recording and stimulation sites affects parameter recovery.
They found that while limiting recording sites (e.g., soma-only recording) allows for reasonable parameter recovery if the entire neuron is stimulated, limiting stimulation sites severely degrades the ability to infer dendritic parameters. This suggests that "data richness" in terms of spatial stimulation is critical for identifying heterogeneous channel distributions.
Discussion
This gradient-based approach democratizes computational neuroscience by shifting heavy workloads from CPU clusters to single GPUs. However, challenges remain. The current MSE loss function is sensitive to slight mismatches in spike timing over long durations, potentially leading to local minima. Future work will focus on developing differentiable multi-objective loss functions that evaluate spike statistics and testing the method on noisy, real-world experimental data. Integrating these differentiable solvers into standard environments like NEURON could usher in a new era of highly detailed, optimizable neuron models.
Summary updated