A neural data science: how and why
By: Mark Humphries
Tags: Neuroscience, Data Science, Artificial Intelligence, Machine Learning, Science

How is it — or could it be — done? Here’s a rough guide. The raison d’etre of the neural data scientist is to ask scientific questions of data from systems neuroscience; to ask: how do all these neurons work together to do their thing?

There are roughly three ways we can answer that question. We can see these three ways by looking at the correspondence between established classes of problems in machine learning and computational challenges in systems neuroscience. Let’s start by looking at what we have to work with.

We have some data from n neurons that we’ve collected over time. We’ll lump these into a matrix we’ll call X — as many columns as neurons, and as many rows as time-points we’ve recorded (where it’s up to us how long a “time-point” lasts: we might make it short, and just have each entry record a 1 for a spike, and 0 otherwise. Or we might make it long, and each entry records the number of spikes during that elapsed time). Over that time, stuff has been happening in the world — including what the body has been doing. So let’s lump all that into a matrix we’ll call S — as many columns as there are features in the world we care about, and as many rows as time-points we’ve recorded for those features.

Traditionally, machine learning involves building three classes of models about the state of the world and the available data: generative, discriminative, and density. As a rough guide, this table shows how each class corresponds to a fundamental question in systems neuroscience:

1/ Density models P(X): is there structure in the spikes? Sounds dull. But actually this is key to great swathes of neuroscience research, in which we want to know the effect of something (a drug, a behaviour, a sleep) on the brain; in which we are asking: how has the structure of neural activity changed?

With a recording of a bunch of neurons, we can answer this in three ways.

First, we can quantify the spike-train of each neuron, by measuring the statistics of each column of X, like the rate of spiking. And then ask: what is the model P(X) for these statistics? We can cluster these statistics to find “types” of neuron; or simply fit models to their entire joint distribution. Either way, we have some model of the data structure at the granularity of single neurons.

Second, we can create generative models of the entire population’s activity, using the rows of X — the vectors of the moment-to-moment activity of the whole population. Such models typically aim to understand how much of the structure of X can be recreated from just a few constraints, whether they be the distribution of how many vectors have how many spikes; or the pairwise correlations between neurons; or combinations thereof. These are particularly useful for working out if there is any special sauce in the population’s activity, if it is anything more than the collective activity of a set of independent or boringly simple neurons.

Third, we can take the position that the neural activity in X is some high dimensional realisation of a low dimensional space, where the number of dimensions D << n. Typically we mean by this: some neurons in X are correlated, so we don’t need to use the whole of X to understand the population — instead we can replace them with a much simpler representation. We might cluster the time-series directly, so decomposing X into a set of N smaller matrices X_1 to X_N, each of which has (relatively) strong correlations within it, and so can be treated independently. Or we might use some kind of dimension reduction approach like Principal Components Analysis, to get a small set of time-series that each describes one dominant form of variation in the population’s activity over time.

We can do more than this. The above assumes we want to use dimension reduction to collapse neurons — that we apply reduction to the columns of X. But we could just as easily collapse time, by applying dimension reduction to the rows of X. Rather than asking if neural activity is redundant, this is asking if different moments in time have similar patterns of neural activity. If there are only a handful of these, clearly the dynamics of the recorded neurons are very simple.

We can throw in dynamical systems approaches here too. Here we try to fit simple models to the changes in X over time (i.e. mapping from one row to the next), and use those models to quantify the types of dynamics X contains — using terms like “attractor”, “separatrix”, “saddle node”, “pitchfork bifurcation”, and “the Arsenal collapse” (only one of those is not a real thing). One might plausibly argue the dynamical models so fitted are all density models P(X), as they describe the structure of the data.

Hell, we could even try and fit an entire dynamical model of a neural circuit, a bunch of differential equations describing each neuron, to X, so that our model P(X) is then sampled every time we run the model from different initial conditions.

With these density models, we can fit them separately to the neural activity we recorded in a bunch of different states (S1, S2,…, Sm), and answer questions like: how does the structure of a population of neurons change between sleeping and waking? Or during development of the animal? Or in the course of learning a task (where S1 might be trial 1, and S2 trial 2; or S1 is session 1 and S2 session 2; or many combinations thereof). We can also ask: how many dimensions does neuron activity span? Are the dimensions different between different regions of cortex? And has anyone seen my keys?