Notes

← Back to home

A collection of fragments of understanding in the pursuit of deeper questions.

Predictive Coding

Content of the Lecture

  • Coding
    • Principle
    • Evidence
  • Temporal Predictions
    • Principle
    • Effects & Evidence
    • Artificial Networks
  • Predictive Coding
    • Circuits
    • Learning
  • Problems with Predictive Coding
    • Interpretation
    • Data
  • Bayesian Brain
    • Main Ideas
    • Effects
    • Formalism & Free Energy

Information Coding

Compression: Description Principle

  • 4K display: 3 x 10 bit/pixel x 40000 pixel x (3840 x 2160) x 48 frame/s = 5 x 10ˆ14.
  • 4K compressed video: 44 -- 85 Mbps (4K)
  • Optic Nerve: <1 Mbps (guinea pig), hence there is compression going on.

Estimation of information:

image263
  • How many spikes? Depends on neuron type.
  • How many bits per spike? More spikes, less informative. (The rarer an event it is the more information it conveys).
  • How much noise? By reproducibility.

Temporal Predictions

Temporal Compression: Engineering The standard video-compression algorithms only send the unexpected information, i.e., the change in pixels within an image, rather than the full matrix of pixels composing an image.

image264

Temporal Compression: Mismatch Negativity (MMN) (Oddball) Paradigm where you show a bunch of images with vertical lines and then one horizontal and viceversa, such image breaks the predictability pattern which elicits a strong response in the EEG.

Temporal Compression: Mismatch in Health Such responses are studied by clinicians to understand diseases.

  • Dyslexia: diminished MMN in auditory stimuli.
  • Alcoholism: Decreased MMN response, but enhanced after rehab.
  • Schizophrenia: Shorter MMN durations before psychotic episodes.
  • Autism: Prolonged/reduced MMN latencies.

Compression: Time Sequences Illusion Time can be used to recognize a recurrence, complex images require more time to be processed than straightforward ones. E.g., Flash-Lag Effect cannot be predicted by the brain so it doesn't look collinear, also tennis player cannot be seeing the ball and must be predicting the trajectory.

image265

Compression: Application to RNNs (Deep Predictive Coding: Pred-Net) Training RNNs to predict sequences automatically enforces "good" representations. One of the main problem of DL is that it requires a lot of labelled images, so they trained a network and a component that computes a predictive error. Their models are trained on minimizing such prediction error. They are compressing in time.

image266

This network consists of a series of repeating stacked modules that attempt to make local predictions of the input to the module, which is then subtracted from the actual input and passed along to the next layer. In the figure: Left: Illustration of information flow within two layers. Each layer consists of representation neurons (Rl)R_{l}), which output a layer-specific prediction at each time step (A^l){(\widehat{A}}_{l}), which is compared against a target (Al)\left( A_{l} \right) to produce an error term (El)E_{l}), which is then propagated laterally and vertically in the network. Right: Module operations for case of video sequences.

Predictive Coding - Circuits & Learning

Predictive Coding Predictive Coding (also known as predictive processing) is a theory of brain function in which the brain is constantly generating and updating a mental model of the environment. The model is used to generate predictions of sensory input that are compared to actual sensory input. This comparison results in prediction errors that are then used to update and revise the mental model. In short: the brain tries to predict the next input to our network.

Predictive Coding: Static Identifying a letter in word that you already know allows you to be faster and more accurate, as you are exploiting predictive capabilities. So, if we have a "high-level" description (prior knowledge) of an object, we are better in describing it.

Predictive Coding: Circuit

image269 image268 image267

The left figure represents the inhibiting feedback prediction mechanism in the visual cortex. Rao & Ballard 1999 paper represents the foundational paper in predictive coding. They built this simple circuit to explain some of the effects involved in prediction and integration of top-down knowledge and bottom-up sensory stimuli. If your predictions correctly matches the input, the inhibitory connections make sure that they cancel out.

image270

Predictive Coding: Effects Predictive Coding can be used to denoise images, which is similar to what can be done with an Autoencoder.

Predictive Coding: Supervised Learning

image273 image271 image272

Predictive Coding in Biology: Circuits How can I take the Rao & Ballard circuit and map it into something in the cortex, knowing the connections between layers. The Thalamus fits into L4, then L4 fits into L2/3 and so forth... So, we can think of layer 4 as the "X" in the Rao & Ballard circuit that integrates from L5/6 and from the FF connection. L2/3 is the most recurrent part of the brain, which takes more time.

image274

Predictive Coding in Biology: Experiment They took a mice and made him run through a VR setup where walls show lines (grates), they can adjust the lines to make the mice think he is running or keep them still so they move only when the mice is effectively running (mismatch), or also to make them move such that they look still even when the mice is running.

image275

They put some markers in neurons, which allowed the identification of different types of neurons: the orange neuron seems to fire when there is no visual flow but the mice runs and, when "things" match, it shows a lower response. They also identified a neuron that fires in the presence of visual flow but no running. Then, they draw correlation plots which show that the orange neuron correlate negatively with visual flow, the black and grey neurons don't correlate with the visual flow, while the blue correlates positively. They proposed a circuit where you have sensory inputs (visual flow), predictions (running). And they evidence some predictions happening as the predictive coding circuit postulates.

image276

Predictive Coding - Problems

Predictive Coding in Biology: Problems Problems:

  • Errors, Representations and Interpretations
  • Learning and Mismatch Negativity

Errors, Representations and Interpretations

image277 image278

Suppose you have a line and then you interrupt it, you would expect in Predictive Coding that the end of the line is an error. But it is difficult to disentangle between a neuron that signals an error and a neuron that signals the end of a line. Is the firing of the neuron a representation of the end of the line or is it a firing in response to an error in prediction?

Kanizsa illusory triangle. Neurons with receptive fields fire at the illusory lines. Are they perception neurons or error neurons? The triangle is not there, so the triangle that we perceive is the result of prediction errors or perception? It is hard to make a proper interpretation.

Learning and Mismatch Negativity When you make an error in prediction, neurons fire to signal the error. In PC, we would expect that the most active neurons get suppressed over time. Because as we learn the mismatch negativity firing activity should go down as the predictions get better. The weird thing is that the activity does not go down in the most active neurons, it goes down in the neurons that are only slightly active.

image279

Bayesian Brain & Free Energy Principle

Bayesian Brain: Perception as Inference The main idea behind the Bayesian brain is that we use prior knowledge to infer properties that are not explicitly shown by observation.

  • Depth can be inferred from prior knowledge/an existing model.
image280

Bayesian Brain: Clinical Explanations

  • Autistic people are "bombarded" by external stimuli.
  • Schizophrenic people are "bombarded" by internal models. During psychotics episodes, schizophrenic people cannot distinguish between what's reality and what's in their mind.

Free Energy Principle

image282 image281

We care about what we see in the external world. We cannot do variational inference in the "true world", i.e., hidden states. In order to do that, we can use actions, sensations and internal states.

"Animals want to reduce their uncertainty about the world". "If I fell something on my back, I can update my internal model through sensation, but I can also turn around (action) which changes my sensation (from which the connection between sensations and actions). Therefore, I have a dual optimization goal, one is that in my internal model I should change the parameters to fit the best data I have, but I cannot only passively receive sensations and update the model. I can also choose actions that would eventually lead me to have better data and a better model." Actions are part of inference if you have an agent. This branch of research claimed that this would explain everything from cells to brains and minds. There are however a few problems: If I hear something on my back and I want to remove my uncertainty I can just turn around, but I can also do something else. If I am in a dark room there is no Free Energy.

image283

"You want to maximize your surprise temporarily to have a better model that minimizes your surprise overall". From a neuroscientific perspective, such theory is reductionist in saying that all we want to do is minimizing uncertainty.

Recap

  • Mismatch Negativity
    • Experiments and Measurements
    • Relationship to Compression.
  • Rao & Ballard
    • Abstract Circuit
    • Dynamics and Learning (Math)
    • What is it good for: Denoising, Supervised Learning.
  • Rao & Ballard in Biology
    • Receptive Fields
    • Problem of Interpretability: Perception vs Error
    • Identify Circuits that can correspond to Predictive Coding.
  • Bayesian Brain
    • Understand the Idea
    • Relationship with Free Energy.