Source-linked AI summary
Artificial neural networks for neuroscientists: A primer
Guangyu Robert Yang, Xiao-Jing Wang
TL;DR
Neuroscience needs flexible approaches for analyzing complex data and modeling behaviors and neural activity that traditional models may not address. This pedagogical primer introduces ANN concepts and applications, then discusses customizing their analysis, architecture, and learning, with tutorial code. ANNs have been used with some success to model sensory, cognitive, and motor circuits, while biological relevance and broader applicability remain ongoing challenges.
Problem
Neuroscience needs approaches that address complex behaviors, heterogeneous neural activity, circuit connectivity, and optimization questions beyond traditional models.
Method
The primer introduces ANN concepts and applications, then explains how to customize their analysis, architecture, and learning for neuroscience questions.
Results
ANNs have been used with some success to model various aspects of sensory, cognitive, and motor circuits.
Takeaways & Limitations
ANNs can be studied as computational model systems for exploring new task paradigms and computational ideas alongside biological models.
Takeaways & Limitations
Training spiking neural networks remains challenging because spike generation is non-differentiable for typical gradient-descent methods.
Abstract
from arXiv · showhide
Artificial neural networks (ANNs) are essential tools in machine learning that have drawn increasing attention in neuroscience. Besides offering powerful techniques for data analysis, ANNs provide a new approach for neuroscientists to build models for complex behaviors, heterogeneous neural activity and circuit connectivity, as well as to explore optimization in neural systems, in ways that traditional models are not designed for. In this pedagogical Primer, we introduce ANNs and demonstrate how they have been fruitfully deployed to study neuroscientific questions. We first discuss basic concepts and methods of ANNs. Then, with a focus on bringing this mathematical framework closer to neurobiology, we detail how to customize the analysis, structure, and learning of ANNs to better address a wide range of challenges in brain research. To help the readers garner hands-on experience, this Primer is accompanied with tutorial-style code in PyTorch and Jupyter Notebook, covering major topics.
1 Artificial neural networks in neuroscience
ANNs give neuroscience both powerful data-analysis tools and flexible models for complex behavior, heterogeneous neural activity, and circuit connectivity. This primer focuses on developing ANN models of biological circuits and customizing them to address neuroscience questions.
- Data analysis: ANNs support neural and behavioral data analysis, including efficient pose estimation, image segmentation, connectivity reconstruction, and neural firing-rate estimation.Machine learning can process behavioral videos and large connectomics, transcriptomic, and neurophysiological datasets.
- Primer scope: The primer emphasizes ANN models of biological neural circuits rather than data analysis or models whose primary goal is biological justification.It distinguishes ANNs from broader neural-network models and from models grounded quantitatively in neuroanatomy and neurophysiology.
- Modeling brain function: ANNs offer modeling approaches for complex behaviors and heterogeneous neural activity that simple or hand-built models may not capture.This includes behaviorally trained models and neural populations with complex mixed selectivity, especially in prefrontal cortex.
- Optimization perspective: ANNs can help investigate why neural circuits operate as they do by linking brain-like networks to optimized objectives and architectural constraints.Comparing objectives and constraints that produce brain-resembling networks may provide insight into evolutionary pressures on biological systems.
- Primer contents: The primer introduces ANN concepts, convolutional and recurrent models, customization of analysis and architecture, and tutorial code in PyTorch and Jupyter Notebook.Its stated applications include sensory, cognitive, and motor systems.
2 Basic ingredients and variations in artificial neural networks
ANN studies combine a learning problem, network architecture, and training algorithm. This section introduces supervised learning, multilayer and recurrent architectures, convolutional weight sharing, nonlinear activations, and gradient-based training.
- Core ingredients: A typical ANN study specifies a learning problem, an architecture that constrains connections, and an algorithm that trains parameter values.Trainable parameters include connection weights and other model parameters, while hyperparameters such as learning rate are set by modelers.
- Learning problems: Supervised learning fits network outputs to target outputs by minimizing a loss that measures their difference.Targets may represent behavioral outputs, class labels, or directly recorded neural activity.
- Network architectures: An MLP passes activity between successive layers, while an RNN processes information over time through recurrent connectivity.The random-dot motion task illustrates how a stream of noisy inputs can be formulated as supervised learning with a correct behavioral answer.
- Activations and training: Stochastic gradient descent updates trainable parameters opposite the loss gradient using randomly selected minibatches, and back-propagation computes multilayer gradients by passing loss information backward.Back-propagation applies to networks with arbitrary differential components but requires downstream weight information for layer updates.
- Learning problems: Reinforcement learning uses scalar rewards to train actions that maximize total reward, whereas unsupervised learning provides neither explicit targets nor rewards.The Primer mainly focuses on supervised learning, which supplies more informative feedback through high-dimensional targets.
- Network architectures: Convolutional networks reuse spatially local weights, reducing trainable parameters and imposing spatial invariance in visual processing.Objects can be processed with the same weights regardless of their spatial positions.
- Activations and training: Nonlinear activation functions provide ANN computational power; ReLU is common in feedforward networks, while tanh is often used in recurrent networks.ReLU is defined as f(x) = max(x, 0).
3 Examples of building ANNs to address neuroscience questions
ANNs address neuroscience questions through distinct model families and training strategies, including convolutional networks for visual systems and recurrent networks for cognitive dynamics. These examples show how architectures and learning procedures can be adapted to compare artificial and biological neural activity.
- 3.1 Convolutional networks for visual systems: Convolutional networks model visual systems by processing images through hierarchical layers and can be compared directly with responses in monkey visual cortex.The same images can be passed through biological and artificial systems for side-by-side analysis.
- 3.1 Convolutional networks for visual systems: Deep convolutional networks explain higher-level visual neural activity better than classical models in monkeys and humans.Classical models have nevertheless explained various features of lower-level visual areas.
- 3.1 Convolutional networks for visual systems: Convolutional networks can also be trained to reproduce neural activity patterns recorded from visual areas.
- 3.1 Convolutional networks for visual systems: IT responses are best predicted by final convolutional-network layers, whereas V4 responses are better predicted by intermediate layers.This pattern links different visual areas to different levels of artificial-network processing.
- 3.2 Recurrent neural networks for cognitive and motor systems: Recurrent neural networks model cognitive, motor, and navigation systems by processing sequences and capturing temporally structured activity.In a context-dependent perceptual decision task, an RNN captured strong representations of behaviorally irrelevant features in prefrontal activity.
- 3.2 Recurrent neural networks for cognitive and motor systems: Neuroscience RNNs may use continuous-time dynamics, Euler discretization, and FORCE learning alongside back-propagation.FORCE rapidly learns target outputs by modifying an RNN’s output connections, corresponding to a low-rank change in recurrent connectivity.
4 Analyzing and understanding ANNs
ANNs can be analyzed as model systems using neural tuning, representational similarity, and dynamical-systems methods to connect network activity with computation and behavior. These analyses reveal task-selective organization, stimulus tuning, memory storage, and sequential computation, while the link between design ingredients and learned solutions is usually not rigorous.
- ANN analysis combines tuning, fixed-point dynamics, quantitative model–data comparison, and evolutionary perspectives to investigate neural mechanisms.
- Similarity comparison: Similarity methods compare neural activity across networks or biological populations using dissimilarity matrices or linear prediction, enabling high-throughput, architecture-agnostic comparisons.
- Complex tuning analysis: Gradient-based optimization searches for stimuli that strongly activate neurons or populations, revealing localized tuning in early convolutional layers and more complex tuning in higher layers.
- ANNs provide model systems for complex behaviors and sequences of computation, but successful task training alone does not explain how the network works.
- Tuning properties: Training across 20 cognitive tasks produces recurrent units selective for task subsets, including inhibitory control, delayed matching, and categorization.
- Dynamical systems analysis: Fixed-point and state-space analyses show that recurrent networks can store continuous stimulus values through approximate line attractors and implement delayed categorization through distinct attractor states.
- The relationship between learning problem, architecture, training algorithm, and the resulting network solution is typically not rigorous, except in certain simplified analytically solvable cases.
5 Biologically realistic network architectures and learning
The primer describes how ANN architectures and learning rules can be customized to incorporate biological structures and canonical computations. These modifications support analysis of connectivity, memory, attention, normalization, and plasticity in neural models.
- Structured connections: Biologically realistic ANN models incorporate cell-type-specific connectivity, sparse structure, long-range connections, and learning algorithms beyond standard recurrent networks and SGD.Sparse connectivity can be imposed with masks or encouraged using L1 regularization, while Dale’s law separates excitatory and inhibitory neurons.
- Structured connections: Dale’s law enables recurrent networks trained on motion-direction discrimination to produce heterogeneous, biologically structured connectivity patterns that can be examined after training.The resulting wiring diagram includes separate excitatory and inhibitory populations and recurrent excitatory connections among neurons selective for the same choice.
- Canonical computation: Canonical computations such as attention, gating, and normalization can be introduced as modular components linking machine-learning mechanisms with neural computations.The primer discusses parallels and differences between machine-learning implementations and more biological mechanisms.
- Canonical computation: Attention uses normalized modulation to focus on selected vectors, whereas gating uses unnormalized multiplicative control that can open or close gates broadly.Normalization effectively focuses attention on a few key vectors, while gating controls information flow without necessarily distorting content.
- Canonical computation: LSTM gates regulate input, memory retention, and output, allowing the cell state to preserve information through learned multiplicative interactions.The forget gate controls whether the cell state retains its previous memory, and sigmoid-bounded gates approach open or closed states.
- Learning and plasticity: More biologically realistic learning processes are needed because back-propagation is biologically implausible; differentiable plasticity rules can instead be learned with SGD.A trainable rule can become Hebbian or anti-Hebbian depending on the learned sign of its parameter.
6 Future directions and conclusion
The primer concludes that ANNs offer a novel computational-neuroscience approach, while emphasizing unresolved challenges in biological realism, prediction, standardization, and interpretability. Future work should make models more brain-like and systematically examine what they learn.
- Future directions: Spiking networks remain difficult to train because spike generation is non-differentiable, although gradient-based methods approximate spikes during backpropagation.Effective training could become increasingly important as neuromorphic hardware based on spikes advances.
- Future directions: Brain-like recurrent networks lack standardized datasets, architectures, and training protocols across cognitive and motor systems.Common architectures and training algorithms do not consistently produce brain-like recurrent networks, leaving broad protocol searches unfinished.
- Future directions: Detailed comparisons reveal striking differences between brains and ANNs, including different error patterns despite similar or better image-classification performance.Future models should simultaneously explain a wider range of physiological and behavioral phenomena.
- Future directions: Deep networks are difficult to interpret because optimization has no unique optimum, weakening direct links between hyperparameters, representations, mechanisms, and behavior.Low-rank recurrent networks and analytical studies of linear or very wide networks are presented as promising ways to improve understanding.
- Future directions: Understanding why highly parameterized networks generalize despite traditional overfitting expectations remains an open theoretical direction.The primer identifies analytical learning-dynamics research and Information Bottleneck theory as approaches that may clarify generalization.
- Conclusion: ANNs have modeled sensory, cognitive, and motor circuits with some success, and can serve as computational model systems for exploring task paradigms and computational ideas.The authors emphasize both bringing ANNs closer to neurobiology and opening the black box after learning.