Detecting latent states in mice neural activity

Computational Neuroscience

Detecting latent states in mice neural activity

I had the chance to do some brief computational neuroscience research as part of a small team within Neuromatch Academy.

We tried to detect latent states in mice neural activity using Hidden Markov Models, which would allow us to predict what a mouse would do based on it’s neural activity.

The experiment code is open-source and published on GitHub, and can be reproduced by running this notebook.

The dataset

We used Steinmetz’s dataset containing spiking neural data collected using large-scale electrode arrays from a number of brain regions recorded from a mouse trained on a visual discrimination task.

In the Steinmetz paper, the mouse was trained on a visual discrimination task.

  • There are three monitors in front and around the mouse.
  • On the two monitors at each side of the mouse, stimuli with varying contrasts are shown, between which the mouse must identify the one with larger contrast, and bring it to the screen in front of it, using the wheel placed in front of it.

Neuropixels

If you look closely, you can see an electronic device implanted into the mouse’s head. It’s called a Neuropixel probe, and looks like this:

On their site, they say that: “Each probe features 384 dual-band, low-noise recording channels that can individually be configured to simultaneously record AP (action potential) and LFP (local field potential) signals from 960 selectable, low-impedance TiN electrodes densely tiled along a 10-mm long, 70 x 24 µm cross-section straight shank. Voltage signals are filtered, amplified, multiplexed and digitized on-chip, allowing the direct streaming of digital data from the probe.”

With it, the authors of the dataset (Steinmetz et al., 2019.) recorded about 30 000 neurons from 42 brain regions.

The scientific question:

We wanted to learn:

  • Can neural activity in the mouse cortex be described by discrete state sequences and do these sequences correlate with behaviour?
  • How are state transitions correlated across brain areas?
  • Can we find differences in neural activity for correct and incorrect decisions?

We fitted a Hidden Markov Model using neurons from the primary visual cortex (V1) and the secondary motor cortex (M2) and correlated it to the behavioral data (like stimulus onset, reaction time) to see if we could describe neural activity in the cortices by discrete state sequences, and if those sequences correlated with behaviour.

The results:

In the primary visual cortex the states we found did not seem to reflect behaviour very well.

In the secondary motor cortex it was possible to map the behavior to three discrete states:

  • A short phase of movement initiation;
  • A locomotion phase;
  • A phase that corresponded to no movement.

We concluded that in M2, cortical activity might actually unfold as a sequence of discrete states.

In the case of V1 we concluded that a lack of data prevented us from successfully would be needed for a proper statistical analysis:

  • We simulated more neural data using firing rates and the distribution from the actual data.
  • We successfully fitted a 3-state HMM to the simulated data.
  • The limiting factor seemed to be the amount of data used, since there were only 29 high-quality trials of real V1 data for our purposes.

For detailed step-by-step explanations (including video) visit the repo on GitHub, and to reproduced the experiment run this notebook.