1 of 51

The neural code�Tuning functions

Kenneth D Harris, UCL

2 of 51

Continuous dependence of rate on stimulus

  • Many stimuli are continua
    • Frequency or amplitude of a sound
    • Contrast or orientation of a visual grating
    • Location of the animal in the environment
    • Head direction relative to the environment
    • Concentration of odorants in a mixture
    • Intensity of every pixel in a visual image

  • Neural firing rates should depend continuously on the stimulus
    • Small change along stimulus continuum => small change in rate

  • Previously we talked about stimuli as discrete
    • E.g. different images

  • How do we characterize how continuous stimuli are encoded?

3 of 51

Orientation tuning in visual cortex

4 of 51

Rat hippocampus

5 of 51

Visual processing of natural scenes

Stringer et al Nature 2019

6 of 51

Rate coding equation

  •  

7 of 51

Types of tuning function

  •  

8 of 51

Types of tuning function

  •  

9 of 51

Parametric models

  • Parametric models of experimental data have been very powerful in scientific history

  • Because they can suggest and constrain mechanistic or functional theories
    • Kepler’s law of elliptic planetary motion => Newton’s law of universal gravitation
    • Ideal gas law (PV=nRT) => kinetic theory of gasses
    • Rydberg formula for hydrogen spectrum => Schrodinger’s equation
    • Hodgkin-Huxley equation => mechanism of action potential
    • Normalization equation => ???

  • Parametric models usually don’t fit tuning functions perfectly, but still very valuable

  • Factors to balance when choosing a parametric formula:
    • Accuracy of fit
    • Simplicity and interpretability (the fewer parameters the better)
    • Ease of fitting parameters to data

10 of 51

Gaussian tuning function

  •  

Data

Model

11 of 51

von Mises tuning function

  •  

12 of 51

Naka-Rushton tuning function

  •  

13 of 51

Form of the tuning function can give biological insight

Wrapped Gaussian

 

 

“Peaky” modification

14 of 51

Peak sharpness depends on exponent

  •  

 

 

 

15 of 51

Peaky tuning curves

  • Give rise to high-dimensional population codes (see later)

  • Suggest new network mechanisms for producing them

16 of 51

How to fit a parametric model

  •  

17 of 51

Which loss function?

  •  

18 of 51

Finding the parameters for each cell: numerical optimization

  •  

19 of 51

Example: orientation tuning curves

  • Data from Allen Institute
  • Neuropixels recordings, V1 passive mice
  • Oriented grating stimuli displayed on a screen for 250 ms
  • Different orientation, spatial frequency, phase
    • We consider one spatial frequency and phase

  • Fitting a cosine tuning curve with squared error: quadratic
  • Fitting a von Mises tuning curve with Poisson log likelihood: convex
  • Fitting a von Mises tuning curve with squared error: non-convex

Siegle et al Nature 2021. https://www.nature.com/articles/s41586-020-03171-x

20 of 51

Quadratic optimization

  •  

21 of 51

Orientation tuning: cosine model, squared error loss (cell 42)

  •  

22 of 51

Convex optimization

  •  

23 of 51

von Mises tuning function

  •  

24 of 51

von Mises fit for cell 42

 

 

25 of 51

Allen Cell 46

 

 

26 of 51

Optimization of generic objective functions

  • If your function is not even convex, what do you do?

  • Global search can only be done in low dimensions
  • “Brute force grid search”
  • Simulated annealing; genetic algorithms; others
    • Scipy.optimize has implementations
    • But none work reliably in high dimensions

  • Usually settle for local optimization.
    • This is how modern AI systems are trained
    • Can miss the “big peaks”
    • For AI, this might not matter
    • For scientific conclusions, it might

27 of 51

Gradient descent algorithm

  •  

28 of 51

Types of tuning function

  •  

29 of 51

Nadaraya-Watson smoothing

  •  

To avoid divide zero errors

30 of 51

Place field estimation: Buzsaki CRCNS hc3-cd013.527, cell 5

  •  

HSV colormap with

Hue = firing rate

Value = occupancy

So non-visited areas are black

occupancy spike

31 of 51

Gaussian Process Regression

  •  

32 of 51

Types of tuning function

  •  

33 of 51

Artificial network model neurons are simple

34 of 51

But assembled into very large networks

VGG19 network

35 of 51

And trained with gradient descent of weight parameters

Input

Activity progatation

Target output

Error backpropagation

36 of 51

Artificial neural networks for biological neural tuning functions

  • ANNs are extremely powerful for AI applications
  • But need vast amounts of training data
    • There exist vast training sets for AI applications (e.g. photos and their captions)
    • But most neural recordings don’t produce enough data
  • Solution: first fit weights to large dataset
    • An AI dataset or a rare, very large recording of biological neurons
    • Or use an “off the shelf” AI network
  • Then predict biological neurons’ tuning curves from artificial neural network activity

Input

Activity progatation

Biological neurons

37 of 51

  • Recorded responses of 262 neurons from Monkey V1 to 7250 visual stimuli
    • Not enough to train the weights of the network
    • But enough to predict neuronal responses from ANN activity

Image shown to monkey

Image input to VGG19

Activity of 8/256 features from layer conv 3_1

38 of 51

How to predict biological neurons from ANN units?

  •  

39 of 51

Too many predictors

  •  

40 of 51

 

41 of 51

 

42 of 51

 

43 of 51

Geometric interpretation

 

 

 

Signal

Noise

 

44 of 51

Geometric interpretation

 

 

 

Signal

Noise

 

45 of 51

Overfitting = large weight vectors

  •  

46 of 51

Predicting neuron from ANN features

  •  

 

Sum-square error

Penalty term

Reduces overfitting by keeping weights small

47 of 51

Ridge regression predicting neuron 142

 

 

 

48 of 51

Assessing tuning curves

  • To test if you have fit well, need out-of-sample stimuli
    • Can the tuning curve predict responses to stimuli not used to fit it?
    • Extrapolation is harder than interpolation

  • To test null hypothesis of no generalization:
    • Compute a test statistic measuring prediction of stimuli
    • Compare it to a null ensemble rerandomizing stimulus order

  • What test statistic to use?

49 of 51

Fraction of stimulus-related variance explained

  •  

50 of 51

VGG19 explains 37% of stimulus-related variance in monkey V1

51 of 51

Statistical test

  • To test the null hypothesis that the ANN model is useless, randomize order of test-set stimuli so you are predicting activity from the wrong image.

  • All cells in database significant at p=0.001
    • (they only included cells that respond to the stimuli.)

Null distribution for one cell