Skip to content
Tutorials Center
My learning

Topics

Lesson 41 of 45 ยท Projects and Practice

Project: simulate a receptive field

Build a center-surround retinal ganglion cell in Python, test it with spots of light of different sizes and an edge, and explore it with an interactive demo.

A good way to understand a neuron is to build a model of it and run the experiment Stephen Kuffler ran in 1953: shine a small spot of light at different places and sizes and record the response. In this project you will write a retinal ganglion cell as a weighted sum of light and discover why such cells prefer small spots and edges to uniform light.

A center-surround receptive field responds to contrast
Caption: a spot in the center excites; a spot in the surround inhibits; uniform light cancels.

What you will learn

  • How to model a receptive field as a weight map
  • How response depends on spot size (size tuning)
  • How the same cell detects edges
  • The limits of such a linear model

Key terms

Weight map: how much each location in the visual field contributes to the response.

Linear receptive field: the response is the sum of light times weight.

Rectification: firing rates cannot be negative, so the output is clipped at zero.

Size tuning: how response changes with stimulus size.

Difference of Gaussians: narrow positive minus broad negative bump.

Step 1: the weight map

The model has a narrow excitatory center and a wider inhibitory surround. The surround is scaled so its total weight is a little lower than the center's total weight. Then uniform light gives a small net response, and a spot that fills only the center gives a large one.

Step 2: shine spots of different sizes

Python Size tuning of a center-surround cell

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

You should see the response rise as the spot fills the center, then fall as light spills into the surround. Real ganglion cells show exactly this kind of size tuning.

Step 3: an interactive field

Drag the sliders to place a spot and change its radius. The cell's firing rate is computed with the same weights.

Move the spot

Step 4: edges

Python Responding to an edge

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Uniform light gives zero. Near the edge the response is positive when the bright side covers the center and negative when the dark side does: the cell reports contrast, not brightness.

What this model leaves out

Real ganglion cells are not purely linear. Their responses adapt to the average light level, change with time (some are transient, some sustained), and there are many cell types (such as the parasol and midget cells with different sizes and speeds). Still, the weighted-sum idea is the starting point for models of V1 simple cells (Gabor filters) and for the first layers of artificial vision networks.

Common misconceptions

"The retina only sends a pixel-by-pixel copy." It sends already processed, contrast-enhanced signals.

"A model that fits proves how the cell works." It shows that a mechanism is sufficient, not that it is the only one.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why is the response to uniform light weak for a center-surround cell?

    Opposing regions cancel for uniform illumination.
  2. 2. What happens as a spot grows beyond the center?

    Surround inhibition subtracts from the center's excitation.
  3. 3. Why rectify the response?

    Neurons cannot fire at less than zero spikes per second.
  4. 4. Which later visual cells use the same weighted-sum idea?

    Simple cells are modeled as linear filters followed by a nonlinearity.

Summary

  • A receptive field is a weight map; response is the weighted sum of light, then rectified.
  • Center-surround cells prefer small spots and edges to uniform light.
  • Linear models are a start, not the full story.

Next: Practice set