Skip to main content

The telluride_decoding Library

(This is not an official Google product!)

This repository contains Python/Tensorflow code to decode perceptual signals from brain data. The perceptual signals we are using are generally audio features. And the brain data is one of several types of signals, such as EEG, MEG and ECoG.

The Telluride Decoding Toolbox is geared towards large-scale decoding experiments. You can run small experiments in a colab. But this package keeps all the data in files so the data doesn't have to fit into memory, and so it is easier to run tens or hundreds of tests in parallel.

License

This code uses the Apache License 2.0. See the LICENSE file for details.

Purpose

This code builds and trains models that connect perceptual signals, primarily audio, to brain signals, which can be EEG, MEG or ECOG. One common use for this type of algorithm is to decode auditory attention, as shown in the figure below.

Auditory attention decoding

In attention decoding, we wish to know which of two (or more) signals a user is attending. One signal (the upward pointing blue arrow) indicates that the signal is being processed by the entire brain and is "exciting" all areas. Another signal is heard by the auditory system, but is not attended, and doesn't recruit as much of the brain. The two signals are processed differently, and produce different brain signals.

This software helps to decide which signal the user is attending, by building a model that uses the EEG signal, for example, to predict the intensity of the attended audio signal.

Documentation

Documentation to follow (but there are extensive comments in the code.) The three primary parts of this code are:

  • ingest: Use to read various kinds of file formats and transform the data into TFRecords for use by the decoding program
  • decoding: Used to build, train and test models that connect audio and brain signals.
  • infer: Use to run a model on real or test data. This model can run in real time.

To install

To install this software you can execute this command, which will automatically install the necessary prerequisites:

pip install telluride-decoding

Using this code

This library is written in Python3 and uses Tensorflow2. The decoding code can be run as a standalone program, or as a library, or in a Colab, a form of Python wrapped in an interactive notebook.

There is a complete end-to-end codelab that describes how to use the programs to perform attention decoding on a public dataset. With a Unix machine and access to to GitHub you can verify that the code works and produces the same results as we get at Google. The codelab is here doc/DecodingCodelab.md

One can also use the program as a library in a Colab. Colab allows one to interactively ingest data, build models, and test their performance. Here is an example:

  • Telluride4: Ingest and test linear regression. colab

Documentation on the standalone decoding program can be found here. This version is useful in distributed environments, where one might want to do a parameter search. Each run of the program tests one set of parameters.

The code uses CPU or GPUs, as available. TPU support is forthcoming.

References

James O'Sullivan, AJ Power, Nima Mesgarani, S. Rajaram, John Foxe, Barbara Shinn-Cunningham, Malcolm Slaney, Shihab Shamma, Edward Lalor. Attentional Selection in a Cocktail Party Environment Can Be Decoded from Single-Trial EEG. Cereb Cortex. 2015 Jul;25(7):1697-706.

Daniel D.E. Wong, Søren A. Fuglsang, Jens Hjortkjær, Enea Ceolini, Malcolm Slaney, Alain de Cheveigné. A Comparison of Temporal Response Function Estimation Methods for Auditory Attention Decoding. Frontiers in Neuroscience. doi: 10.3389/fnins.2018.00531.

This package contains Python and Tensorflow code for the Deep Canonical Correlation Analysis algorithm. (An earlier MATLAB implementation can be found at https://ttic.uchicago.edu/~wwang5/dccae.html)

Wang, Weiran and Arora, Raman and Livescu, Karen and Bilmes, Jeff. On deep multi-view representation learning, International Conference on Machine Learning, pp. 1083-1092, 2015.

Andrew, Galen and Arora, Raman and Bilmes, Jeff and Livescu, Karen. Deep canonical correlation analysis. International conference on machine learning, pp. 1247-1255, 2013. https://ttic.uchicago.edu/~klivescu/papers/andrew_icml2013.pdf

Release files for telluride-decoding 2.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for telluride-decoding 2.1.6
File Size Uploaded
telluride_decoding-2.1.6.tar.gz 647.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for telluride-decoding 2.1.6
File Interpreter ABI Platform
telluride_decoding-2.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 767.5 kB

Release files / telluride_decoding-2.1.6.tar.gz

Download URL telluride_decoding-2.1.6.tar.gz
Size 647.7 kB
Tags Source
SHA-256 checksum
How to use checksums
773e07f00ad2f56180e3b737d1501e8a2c69218a399bd05f4835e038c17081f6
BLAKE2b-256 checksum
How to use checksums
fedb3baeb6340644656e6c89f352ce699a38aabb555181c373047df0874ec140
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.4

Release files / telluride_decoding-2.1.6-py3-none-any.whl

Download URL telluride_decoding-2.1.6-py3-none-any.whl
Size 119.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
69377d263a7b23357fa66c52a48a4b36ede8c1e817654faf6ff8ba3573030c01
BLAKE2b-256 checksum
How to use checksums
fd3a424215a60c4b9f35d446c801be8e064abed1393a5836e4f0328e3e32d917
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.4

Release history Release notifications | RSS feed

This release

2.1.6 This release

2 release files

2.1.5

2 release files

2.1.4

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page