Decodanda

Best practices made easy for decoding and geometrical analysis of neural activity.

Github

Decoding neural activity is a standard practice in neuroscience, often used to claim that a particular population represents a specific variable. Unfortunately, decoding has many pitfalls that, if not avoided carefully, can lead to false negative or, even worse, false positive results.

In the last few years, I had the privilege to work in collaboration with several experimental laboratories, which led me to apply decoding-related methods to dozens of experimental data sets from a wide variety of recording techniques, species, and tasks.

Decodanda is the result of this accumulated experience in combination with the precious interaction with my colleagues and mentors at the Center for Theoretical Neuroscience at Columbia University.

Decodanda (dog-Latin for β€œto be decoded”, as in β€œ[this] data decodanda est”) is a Python package designed to expose a user-friendly and flexible interface for population activity decoding, avoiding the most common pitfalls by a series of built-in best practices. For example:

  • Cross-validation is automatically implemented using a default or specified trial structure

  • All analyses come with a built-in null model to test the significance of the data performance (notebook)

  • Multi-sessions pooling to create pseudo-populations is supported out of the box (notebook)

  • The individual contributions of multiple correlated experimental variables are isolated by cross-variable data balancing, avoding the confounding effects of correlated variables (notebook)

In addition, Decodanda exposes a series of functions to compute the Cross-Condition Generalization Performance (CCGP, Bernardi et al. 2020) for the geometrical analysis of neural population activity (notebook).

Please refer to the notebooks linked below for some examples and use cases.

For a guided explanation of some of the best practices implemented by Decodanda, you can refer to my teaching material for the Advanced Theory Course in Neuroscience at Columbia University.

Have fun, drink water, and decode safely!

 

The idea of activity decoding is simple: if neural patterns corresponding to two conditions (triangle and circle) are well separated, the performance should be high (up to 1.0). Otherwise, it should be compatible with chance levels (here, 0.5).

 
  • Null model for decoding performance

    All analyses in Decodanda come with a built-in null model to test the significance of the data performance.

    COLAB NOTEBOOK

  • Decoding in time

    Decodanda implements a balanced, cross-validated decoding with a slding time window as a function of time from a given onset.

    CLOAB NOTEBOOK

  • Balancing out correlated variables

    When two variables are very correlated (e.g. stimulus and action in a trained subject) it is hard to disentangle their individual contributions to the neural code. Decodanda does that by cross-variable condition balacing.

    COLAB NOTEBOOK

  • CCGP and geometrical investigation of population coding

    Decodanda exposes a series of function to compute the cross-condition generalization performance (CCGP) to reveal the geometrical properties of population coding.

    COLAB NOTEBOOK