Search bioRxiv⌕ Search

SEARCH · Search bioRxiv

Results for “Neuroscience”

Search indexed bioRxiv preprints in genomics, neuroscience, cell biology and bioinformatics. Read source abstracts and check manuscript versions; preprints are not peer reviewed.

Quote a phrase for an exact phrase match. Source license links do not imply unrestricted reuse.

At least 361 records · Page 20Linked to original sources

Memory as a Topological Structure on a Surface Network

In this paper we use the methods of theoretical physics to show how brain-like signals can be generated in a special surface network with the topological connectivity of the biological brain by exploiting its form. The network is required to have surface spin-half particles. We show that the signals thus generated carry information regarding their creation and can transfer and store this information to form memory structures in helical aligned surface spin-half particles present on the surfaces of the pathways traversed by the signals. Theoretical neuroscience is progressing strongly with novel representations of the brain, enhanced by the increase of computational power now available. New methods to explore complex brain events and the structures for storing memories as engrams are emerging. However, there are major conceptual theoretical problems that remain unaddressed. Current theoretical methods are very capable of reacting to experimental results and modelling both neural signalling and structure. Yet they still fall short to throw light on how the brain creates its own information code, or relate the variety of brain signals observed, or explain where and how memories are stored. We prove that current brain signal interpretations cannot carry information regarding their formation so that they cannot be used to understand how memories of events are related to signals. Thus, our results address these basic unresolved theoretical problems of neuroscience and suggest testable solutions. The memory structures of aligned spin-half particles suggested have not been observed in biological organisms as yet they but they have been observed in solid state physics and their existence is consistent with conventional understandings of neurobiology. All the results stated follow from the dynamical law for the network.

neuroscience↗

In vivo Quantification of Neural Criticality and Complexity in Mouse Cortex and Striatum in a Model of Cocaine Abstinence

Self-organized criticality is a hallmark of complex dynamic systems at phase transitions. Systems that operate at or near criticality have large-scale fluctuations or "avalanches", the frequency and duration power of which are best fit with a power law revealing them to be scale-free and fractal, and such power laws are ubiquitous. It is an attractive concept in neuroscience since spiking avalanches are exhibited by neural tissue, and may underpin how minuscule events could scale up to circuits and provide adaptive psychobiological function. Much is yet to be understood about criticality in vivo in the healthy brain and in disorders such as addiction, as drugs may alter the critical states "tuning" to generate drug seeking and dysphoria. Thus, here a novel toolset was developed to use neural avalanches and their self-similarity, rather than power law fit slope exponents as is canonically done, to quantify criticality in a previously collected high-density electrophysiological in vivo corticostriatal dataset from a mouse model of early cocaine abstinence. During behavioral quiescence, in the prefrontal cortex but not ventral striatum of cocaine-dosed mice, it was found that critical tuning is enhanced compared to drug-free controls. Additionally, an empirical biological demonstration of complexitys theoretical correlation to criticality was shown in drug-free mice, was exponentially enhanced in drug-treated cortex, but was absent in the drug-treated striatum. As shown, quantifying criticality grants experimental support for the "critical brain hypothesis" and allows for statistical interpretation of inter-subject variability and development of further testable hypotheses in systems neuroscience. Significance StatementThe "critical brain hypothesis" asserts neural networks are comparable to material in phase transitions at a critical point, their "avalanches" of system-wide spike bursts best seen in log-log plots of probability vs. avalanche size or duration, with slope following a scale-free or fractal power law. In discussing criticality, "critical tuning" is mentioned but quantification thereof left for later experimentation, despite being necessary for a scientific hypothesis. Presented are methods to quantify critical tuning through assessing similarity or fractalness among corticostriatal avalanches collected using high-density electrophysiology in cocaine-conditioned mice, along with an empirical in vivo confirmation of the mathematical concept that data complexity correlates with criticality. Interestingly, cocaine enhances critical tuning in cortex and aberrantly modifies complexity in a region-specific manner.

neuroscience↗

A multi-modal fitting approach to construct single-neuron models with patch clamp and high-density microelectrode arrays

In computational neuroscience, multicompartment models are among the most biophysically realistic representations of single neurons. Constructing such models usually involves the use of the patch-clamp technique to record somatic voltage signals under different experimental conditions. The experimental data are then used to fit the many parameters of the model. While patching of the soma is currently the gold-standard approach to build multicompartment models, several studies have also evidenced a richness of dynamics in dendritic and axonal sections. Recording from the soma alone makes it hard to observe and correctly parameterize the activity of non-somatic compartments. In order to provide a richer set of data as input to multicompartment models, we here investigate the combination of somatic patch-clamp recordings with recordings of high-density micro-electrode arrays (HD-MEAs). HD-MEAs enable the observation of extracellular potentials and neural activity of neuronal compartments at sub-cellular resolution. In this work, we introduce a novel framework to combine patch-clamp and HD-MEA data to construct multicompartment models. We first validate our method on a ground-truth model with known parameters and show that the use of features extracted from extracellular signals, in addition to intracellular ones, yields models enabling better fits than using intracellular features alone. We also demonstrate our procedure using experimental data by constructing cell models from in vitro cell cultures. The proposed multi-modal fitting procedure has the potential to augment the modeling efforts of the computational neuroscience community and to provide the field with neuronal models that are more realistic and can be better validated. Author SummaryMulticompartment models are one of the most biophysically detailed representations of single neurons. The vast majority of these models are built using experimental data from somatic recordings. However, neurons are much more than just their soma and one needs recordings from distal neurites to build an accurate model. In this article, we combine the patch-clamp technique with extracellular high-density microelectrode arrays (HD-MEAs) to compensate this shortcoming. In fact, HD-MEAs readouts allow one to record the neuronal signal in the entire axonal arbor. We show that the proposed multi-modal strategy is superior to the use of patch clamp alone using an existing model as ground-truth. Finally, we show an application of this strategy on experimental data from cultured neurons.

neuroscience↗

Metamodelling of a two-population spiking neural network

In computational neuroscience, hypotheses are often formulated as bottom-up mechanistic models of the systems in question, consisting of differential equations that can be numerically integrated forward in time. Candidate models can then be validated by comparison against experimental data. The model outputs of neural network models depend on both neuron parameters, connectivity parameters and other model inputs. Successful model fitting requires sufficient exploration of the model parameter space, which can be computationally demanding. Additionally, identifying degeneracy in the parameters, i.e. different combinations of parameter values that produce similar outputs, is of interest, as they define the subset of models consistent with the data. In this computational study, we apply metamodels to a two-population recurrent spiking network of point-neurons, the so-called Brunel network. Metamodels are data-driven approximations to more complex models with more desirable computational properties, which can be run considerably faster than the original model. Specifically, we apply two different metamodelling techniques, Masked Autoregressive Flows and Deep Gaussian Process Regression, to estimate the power spectra of two different signals; the population spiking activities and the local field potential. We find that the metamodels are able to accurately model the power spectra in the asynchronous irregular regime. Using the metamodels, we invert the network, and estimate the probability distributions over parameters that can give rise to observed simulation outputs. We find that these distributions correctly identify parameter combinations that give similar model outputs, and that the parameters are constrained to different degrees by observing the two different signals. Author summaryIn computational neuroscience, mechanistic models are used to simulate networks of neurons. These models exhibit complex dynamics, and the parameters of the neurons and connections between neurons shape the models behaviour. Due to the model complexity, running the simulations and fitting the model to experimental data can be computationally demanding. In this study, we apply metamodelling techniques, data-driven approximations that are much faster to run, to two different signals generated by a two-population recurrent network model, the population spiking activities and the local field potential (LFP). Further, we invert the metamodels, and demonstrate that it can reliably find the different combinations of parameters that can give rise to an observed simulation output. We compare the metamodels on both the forward and inverse problem, and investigate to what degree the parameters are constrained by the two different signals.

neuroscience↗

Activity in primate visual cortex is minimally driven by spontaneous movements

Organisms process sensory information in the context of their own moving bodies, an idea referred to as embodiment. This idea is important for developmental neuroscience, and increasingly plays a role in robotics and systems neuroscience. The mechanisms that support such embodiment are unknown, but a manifestation could be the observation in mice of brain-wide neuromodulation, including in the primary visual cortex, driven by task-irrelevant spontaneous body movements. Here we tested this hypothesis in macaque monkeys, a primate model for human vision, by simultaneously recording visual cortex activity and facial and body movements. Activity in the visual cortex (V1, V2, V3/V3A) was associated with the animals own movements, but this modulation was largely explained by the impact of the movements on the retinal image. These results suggest that embodiment in primate vision may be realized by input provided by the eyes themselves.

neuroscience↗

3D Printed Skull Cap and Benchtop Fabricated Microwire-based Microelectrode Array for Custom Rat Brain Recordings

Microwire microelectrode arrays (MEAs) have been a popular low-cost tool for chronic electrophysiological recordings. Multi-MEA implantations can reveal electrical dynamics crucial to brain function. However, both the fabrication and implantation procedures for multi-MEAs on a single rodent are time-consuming and highly manual skill-dependent for quality. To enable in-house design, fabrication, and implantation of custom microwire MEAs, we developed (1) a computer-aided designed and 3D printed skull cap for pre-determined implantation locations of each MEA and (2) a benchtop fabrication approach for low-cost custom microwire MEAs. A proof-of-concept design of 32-channel 4-MEA (8-wire each) recording system was prototyped and tested through Sprague Dawley rat recordings. The skull cap design based on CT-scan of single rat conforms well with multiple Sprague Dawley rats of various size, age, and weight with minimal bregma alignment error. The prototyped 32-channel system were able to record spiking activities over 5 months. In comparison with conventional stereotactic surgeries, the skull cap system simplifies the implantation location alignment for each MEA by embedding them into the pre-printed designs, thus dramatically reducing the surgical time and effort and increasing the accuracy and repeatability. Compared to commercially available custom microwire MEAs, this in-house fabrication method enables neuroscience labs to create a custom recording apparatus with lower cost and shorter lead time for design modifications. A new methodology for neuroscience labs to fabricate and insert custom microwire MEAs has been developed and it could be easily generalized to enable low-cost highly-custom multi-region recording/stimulation studies. HighlightsO_LI3D printed skull caps as implantation platform for multi-region rat brain recording C_LIO_LIComputer-aided design for custom cap geometry and predetermined implantation location C_LIO_LIBenchtop microwire fabrication approach for in-house custom microelectrode arrays C_LIO_LIDuplicable and generalizable design, fabrication, and implantation methodologies C_LI

neuroscience↗

Reward prediction error neurons implement an efficient code for reward

We use efficient coding principles borrowed from sensory neuroscience to derive the optimal population of neurons to encode rewards from a probability distribution. We find that the response properties of dopaminergic reward prediction error neurons in a rodent and a primate data set are similar to those of the efficient code in many ways: the neurons have a broad distribution of midpoints covering the reward distribution; neurons with higher thresholds have higher gains, more convex tuning functions, and lower slopes; moreover, their slope is higher when the reward distribution is narrower. Furthermore, we derive learning rules that converge to this efficient code; the learning rule for the position of the neuron on the reward axis closely resembles the learning rule of distributional reinforcement learning. Thus, reward prediction error neuron responses may be optimized to broadcast an efficient reward signal, forming a connection between efficient coding and reinforcement learning, two of the most successful theories in computational neuroscience.

neuroscience↗

Quantifying the distribution of feature values over data represented in arbitrary dimensional spaces

BackgroundIdentifying the structured distribution (or lack thereof) of a given feature over a point cloud is a general research question. In the neuroscience field, this problem arises while investigating representations over neural manifolds (e.g., spatial coding), in the analysis of neurophysiological signals (e.g., auditory coding) or in anatomical image segmentation. New methodWe introduce the Structure Index (SI) as a graph-based topological metric to quantify the distribution of feature values projected over data in arbitrary D-dimensional spaces (neurons, time stamps, pixels). The SI is defined from the overlapping distribution of data points sharing similar feature values in a given neighborhood. ResultsUsing model data clouds we show how the SI provides quantification of the degree of local versus global organization of feature distribution. SI can be applied to both scalar and vectorial features permitting quantification of the relative contribution of related variables. When applied to experimental studies of head-direction cells, it is able to retrieve consistent feature structure from both the high- and low-dimensional representations. Finally, we provide two general-purpose examples (sound and image categorization), to illustrate the potential application to arbitrary dimensional spaces. Comparison with existing methodsMost methods for quantifying structure depend on cluster analysis, which are suboptimal for continuous features and non-discrete data clouds. SI unbiasedly quantifies structure from continuous data in any dimensional space. ConclusionsThe method provides versatile applications in the neuroscience and data science fields HighlightsO_LIThe Structure Index is a graph-based topological metric C_LIO_LIIt quantifies the distribution of feature values in arbitrary dimensional spaces C_LIO_LIIt can be applied to both scalar and vectorial features C_LIO_LIWhen applied to the head-direction neural system, it extracts concordant information from high- and low-dimensional representations C_LIO_LIIt can be extended to sound and image categorization, expanding the range of applications C_LI

neuroscience↗

Exploring the Neural Processes behind Narrative Engagement: An EEG Study

Past cognitive neuroscience studies using naturalistic stimuli have considered narratives holistically and focused on cognitive processes. In this study, we incorporated the narrative structure--the dramatic arc--as an object of investigation, to examine how engagement levels fluctuate across a narrative-aligned dramatic arc. We explored the possibility of predicting self-reported engagement ratings from neural activity and investigated the idiosyncratic effects of each phase of the dramatic arc on brain responses as well as the relationship between engagement and brain responses. We presented a movie excerpt following the six-phase narrative arc structure to female and male participants while collecting EEG signals. We then asked this group of participants to recall the excerpt, another group to segment the video based on the dramatic arc model, and a third to rate their engagement levels while watching the movie. The results showed that the self-reported engagement ratings followed the pattern of the narrative dramatic arc. Moreover, whilst EEG amplitude could not predict group-averaged engagement ratings, other features comprising dynamic inter-subject correlation, dynamic functional connectivity patterns and graph features were able to achieve this. Furthermore, neural activity in the last two phases of the dramatic arc significantly predicted engagement patterns. This study is the first to explore the cognitive processes behind the dramatic arc and its phases. By demonstrating how neural activity predicts self-reported engagement, which itself aligns with the narrative structure, this study provides insights on the interrelationships between narrative structure, neural responses, and viewer engagement. Significance statementDramatic narratives follow a complex structure termed as the narrative arc. Here, we addressed the complexity of this structure in order to explore brain responses during narrative cognition. We examined the link between the narrative arc and its six phases with self-reported engagement, and whether brain responses elicited by a narrative can predict engagement levels. Our results showed that the group-averaged engagement ratings followed the dramatic arc model. EEG features predicted group-averaged engagement patterns and also engagement levels in the last two phases. This is the first study to characterize the narrative dramatic arc phases at the neural level. It contributes to the fields of cognitive narratology and neuroscience by extending current knowledge on how the brain responds to narratives.

neuroscience↗

Community Detection in Brain Connectome using Quantum Annealer Devices

Recent advancements in network neuroscience are pointing in the direction of considering the brain as a small-world system with segregated regions integrated to facilitate different cognitive tasks and functions. In this context, community detection is a pivotal issue in computational neuroscience. In this paper we explore community detection within brain connectomes using the power of quantum annealers, and in particular the Leaps Hybrid Solver. Our results shows that quantum annealers can achieve higher modularity index compared to classical annealer while computing communities of brain connectomes. Those promising preliminary results points out that quantum annealers might be the better choice compared to classical computing optimization process.

neuroscience↗

Expression profiling of the learning striatum

How learning reshapes the brain across temporal and spatial scales, from molecular to cellular levels, remains a fundamental question in neuroscience. In the striatum, ventromedial, dorsomedial and dorsolateral subregions are differentially recruited during early to late learning on a neurophysiological level. Here, we profile the transcriptome of these subregions across 396 biopsies from 66 mice to map molecular dynamics at three learning stages of a visual discrimination task. We find a strong transcriptional change during the early phase that diminishes towards later learning and is indistinguishable among subregions. The 818 genes altered during learning are enriched for neuronal processes, but also include circadian, vascular, and oligodendrocyte-related pathways. We provide a web application for this large learning-related expression dataset, enabling interactive exploration of genes, gene sets, and transcription factor activity, and suggest that this framework will be broadly useful for diverse neuroscience questions.

neuroscience↗

AtOM, an ontology model for standardizing use of brain atlases in tools, workflows, and data infrastructures

Brain atlases are important reference resources for accurate anatomical description of neuroscience data. Open access, three-dimensional atlases serve as spatial frameworks for integrating experimental data and defining regions-of-interest in analytic workflows. However, naming conventions, parcellation criteria, area definitions, and underlying mapping methodologies differ considerably between atlases and across atlas versions. This lack of standardization impedes use of atlases in analytic tools and registration of data to different atlases. To establish a machine-readable standard for representing brain atlases, we identified four fundamental atlas elements, defined their relations, and created an ontology model. Here we present our Atlas Ontology Model (AtOM) and exemplify its use by applying it to mouse, rat, and human brain atlases. We propose minimum requirements for FAIR atlases and discuss how AtOM may facilitate atlas interoperability and data integration. AtOM provides a standardized framework for communication and use of brain atlases to create, use, and refer to specific atlas elements and versions. We argue that AtOM will accelerate analysis, sharing, and reuse of neuroscience data.

neuroscience↗

Cleo: a testbed for bridging model and experiment by simulating closed-loop stimulation, electrode recording, and optogenetics

Systems neuroscience has experienced an explosion of new tools for reading and writing neural activity, enabling exciting new experiments (e.g., all-optical interrogation, closed-loop control) for interrogating neural circuits. Unfortunately, these advances have drastically increased the complexity of designing experiments, with ad hoc decisions often resulting in suboptimal or even failed experiments. Bridging model and experiment via simulation can help solve this problem, leveraging advances in computational models to provide a low-cost testbed for experiment design, model validation, and methods engineering. Specifically, we require an integrated approach that incorporates simulation of the experimental interface into computational models, but no existing tool integrates optogenetics, two-photon calcium imaging, electrode recording, and flexible closed-loop processing with neural population simulations. To address this need, we have developed Cleo: the Closed-Loop, Electrophysiology, and Optophysiology experiment simulation testbed. Cleo is a Python package enabling injection of virtual recording and stimulation devices as well as closed-loop control with realistic latency into a Brian spiking neural network model. Notably, it is the only publicly available tool to date simulating two-photon and multi-opsin/wavelength optogenetics. To facilitate adoption and extension by the community, Cleo is open-source, modular, tested, and documented, and can export results to various data formats. Here we describe the design and features of Cleo, evaluate output of individual components and integrated experiments, and demonstrate its utility for advancing optogenetic techniques in prospective experiments using previously published systems neuroscience models.

neuroscience↗

Trial Averaging for Deep EEG Classification

Many signals, particularly of biological origin, suffer from a signal-to-noise ratio sufficiently low that it can be difficult to classify individual examples reliably, even with relatively sophisticated machine-learning techniques such as deep learning. In some cases, the noise can be high enough that it is even difficult to achieve convergence during training. We considered this problem for one data type that often suffers from such difficulties, namely electroencephalography (EEG) data from cognitive neuroscience studies in humans. One solution to increase signal-to-noise is, of course, to perform averaging among trials, which has been employed before in other studies of human neuroscience but not, to our knowledge, investigated rigorously, particularly not in deep learning. Here, we parametrically studied the effects of different amounts of trial averaging during training and/or testing in a human EEG dataset, and compared the results to that of a related algorithm, Mixup. Broadly, we found that even a small amount of averaging could significantly improve classification, particularly when both training and testing data were subjected to averaging. Simple averaging clearly outperformed Mixup, although the benefits of averaging differed across classification categories. Overall, our results confirm the value of averaging during training and testing when single-trial classification is not strictly necessary for the application in question. HighlightsO_LIAveraging trials can dramatically improve performance in classification of EEG data C_LIO_LIThe benefits can be seen when averaging on both training and test datasets C_LIO_LISimple trial averaging outperformed a popular related algorithm, Mixup C_LIO_LIHowever, effects of averaging differed across different stimulus categories C_LI

neuroscience↗

Auto-STEED: A data mining tool for automated extraction of experimental parameters and risk of bias items from in vivo publications

BackgroundSystematic reviews, i.e., research summaries that address focused questions in a structured and reproducible manner, are a cornerstone of evidence-based medicine and research. However, certain systematic review steps such as data extraction are labour-intensive which hampers their applicability, not least with the rapidly expanding body of biomedical literature. ObjectiveTo bridge this gap, we aimed at developing a data mining tool in the R programming environment to automate data extraction from neuroscience in vivo publications. The function was trained on a literature corpus (n=45 publications) of animal motor neuron disease studies and tested in two validation corpora (motor neuron diseases, n=31 publications; multiple sclerosis, n=244 publications). ResultsOur data mining tool Auto-STEED (Automated and STructured Extraction of Experimental Data) was able to extract key experimental parameters such as animal models and species as well as risk of bias items such as randomization or blinding from in vivo studies. Sensitivity and specificity were over 85 and 80%, respectively, for most items in both validation corpora. Accuracy and F-scores were above 90% and 0.9 for most items in the validation corpora. Time savings were above 99%. ConclusionsOur developed text mining tool Auto-STEED is able to extract key experimental parameters and risk of bias items from the neuroscience in vivo literature. With this, the tool can be deployed to probe a field in a research improvement context or to replace one human reader during data extraction resulting in substantial time-savings and contribute towards automation of systematic reviews. The function is available on Github.

neuroscience↗

Modeling functional cell types in spike train data

A major goal of computational neuroscience is to build accurate models of the activity of neurons that can be used to interpret their function in circuits. Here, we explore using functional cell types to refine single-cell models by grouping them into functionally relevant classes. Formally, we define a hierarchical generative model for cell types, single-cell parameters, and neural responses, and then derive an expectation-maximization algorithm with variational inference that maximizes the likelihood of the neural recordings. We apply this "simultaneous" method to estimate cell types and fit single-cell models from simulated data, and find that it accurately recovers the ground truth parameters. We then apply our approach to in vitro neural recordings from neurons in mouse primary visual cortex, and find that it yields improved prediction of single-cell activity. We demonstrate that the discovered cell-type clusters are well separated and generalizable, and thus amenable to interpretation. We then compare discovered cluster memberships with locational, morphological, and transcriptomic data. Our findings reveal the potential to improve models of neural responses by explicitly allowing for shared functional properties across neurons. Author SummaryComputational neuroscience has its roots in fitting and interpreting predictive models of the activity of individual neurons. In recent years, more attention has focused on models of how ensembles of neurons work together to perform computations. However, fitting these more complex models to data is challenging, limiting our ability to use them to understand real neural systems. One idea that has improved our understanding of populations of neurons is cell types, where neurons of the same type have similar properties. While the idea of cell types is old, recent work has focused on functional cell types, where the properties of interest are derived from fitted predictive models of the activity of single neurons. In this work, we develop a method that simultaneously fits a predictive model of each neurons activity and groups neurons into functional cell types. Compared to existing techniques, this method produces more accurate models of single-cell neural activity and better groupings of neurons into types. This method can thus contribute in using cell types to better understanding the components of neural systems based on our increasingly rich observations of their functional responses.

neuroscience↗

Predicting individual traits from models of brain dynamics accurately and reliably using the Fisher kernel

Predicting an individuals cognitive traits or clinical condition using brain signals is a central goal in modern neuroscience. This is commonly done using either structural aspects, such as structural connectivity or cortical thickness, or aggregated measures of brain activity that average over time. But these approaches are missing a central aspect of brain function: the unique ways in which an individuals brain activity unfolds over time. One reason why these dynamic patterns are not usually considered is that they have to be described by complex, high-dimensional models; and it is unclear how best to use these models for prediction. We here propose an approach that describes dynamic functional connectivity and amplitude patterns using a Hidden Markov model (HMM) and combines it with the Fisher kernel, which can be used to predict individual traits. The Fisher kernel is constructed from the HMM in a mathematically principled manner, thereby preserving the structure of the underlying model. We show here, in fMRI data, that the HMM-Fisher kernel approach is accurate and reliable. We compare the Fisher kernel to other prediction methods, both time-varying and time-averaged functional connectivity-based models. Our approach leverages information about an individuals time-varying amplitude and functional connectivity for prediction and has broad applications in cognitive neuroscience and personalised medicine.

neuroscience↗

TorchLens: A Python package for extracting and visualizing hidden activations of PyTorch models

Deep neural network models (DNNs) are essential to modern AI and provide powerful models of information processing in biological neural networks. Researchers in both neuroscience and engineering are pursuing a better understanding of the internal representations and operations that undergird the successes and failures of DNNs. Neuroscientists additionally evaluate DNNs as models of brain computation by comparing their internal representations to those found in brains. It is therefore essential to have a method to easily and exhaustively extract and characterize the results of the internal operations of any DNN. Many models are implemented in PyTorch, the leading framework for building DNN models. Here we introduce TorchLens, a new open-source Python package for extracting and characterizing hidden-layer activations in PyTorch models. Uniquely among existing approaches to this problem, TorchLens has the following features: (1) it exhaustively extracts the results of all intermediate operations, not just those associated with PyTorch module objects, yielding a full record of every step in the models computational graph, (2) it provides an intuitive visualization of the models complete computational graph along with metadata about each computational step in a models forward pass for further analysis, (3) it contains a built-in validation procedure to algorithmically verify the accuracy of all saved hidden-layer activations, and (4) the approach it uses can be automatically applied to any PyTorch model with no modifications, including models with conditional (if-then) logic in their forward pass, recurrent models, branching models where layer outputs are fed into multiple subsequent layers in parallel, and models with internally generated tensors (e.g., injections of noise). Furthermore, using TorchLens requires minimal additional code, making it easy to incorporate into existing pipelines for model development and analysis, and useful as a pedagogical aid when teaching deep learning concepts. We hope this contribution will help researchers in AI and neuroscience understand the internal representations of DNNs.

neuroscience↗