Skip to main content
QUICK REVIEW

[Paper Review] Predify: Augmenting deep neural networks with brain-inspired predictive coding dynamics

Bhavin Choksi, Milad Mozafari|arXiv (Cornell University)|Jun 4, 2021
Adversarial Robustness in Machine LearningComputer Science91 references25 citations
TL;DR

The paper augments pre-trained feedforward CNN backbones with brain-inspired predictive coding dynamics to improve robustness against noise and adversarial attacks, via unsupervised training of feedback weights and an open-source PyTorch package Predify.

ABSTRACT

Deep neural networks excel at image classification, but their performance is far less robust to input perturbations than human perception. In this work we explore whether this shortcoming may be partly addressed by incorporating brain-inspired recurrent dynamics in deep convolutional networks. We take inspiration from a popular framework in neuroscience: 'predictive coding'. At each layer of the hierarchical model, generative feedback 'predicts' (i.e., reconstructs) the pattern of activity in the previous layer. The reconstruction errors are used to iteratively update the network's representations across timesteps, and to optimize the network's feedback weights over the natural image dataset-a form of unsupervised training. We show that implementing this strategy into two popular networks, VGG16 and EfficientNetB0, improves their robustness against various corruptions and adversarial attacks. We hypothesize that other feedforward networks could similarly benefit from the proposed framework. To promote research in this direction, we provide an open-sourced PyTorch-based package called Predify, which can be used to implement and investigate the impacts of the predictive coding dynamics in any convolutional neural network.

Motivation & Objective

  • Motivate robustness gaps in deep CNNs and explore brain-inspired feedback as a solution.
  • Introduce predictive coding dynamics in a hierarchical network with separate supervised feedforward and unsupervised feedback training.
  • Demonstrate robustness gains on VGG16 and EfficientNetB0 against natural corruptions and adversarial attacks.
  • Provide an accessible software tool (Predify) to implement predictive coding in CNNs for further research.

Proposed method

  • Implement predictive coding in a hierarchical CNN with encoders e_n and decoders d_n connected by feedforward W^f and feedback W^b.
  • Update layer activations via equations for d_n(t) and e_n(t+1) that combine feedforward, feedback, memory, and error-correction terms.
  • Train feedback weights W^b using a reconstruction loss with frozen feedforward weights W^f (one-step reconstruction objective).
  • After initial training, freeze weights and set fixed hyperparameters beta, lambda, alpha for all layers to govern dynamics.
  • Provide Predify to convert any PyTorch CNN into a predictive network with a configuration file, generating scalable predictive code.

Experimental results

Research questions

  • RQ1Does incorporating predictive coding dynamics improve robustness of CNNs to noise and adversarial perturbations?
  • RQ2How do predictive coding iterations affect representations and reconstructions across timesteps?
  • RQ3Can unsupervised training of feedback weights confer robustness without adversarial training?
  • RQ4Is the Predify tool practical for enabling researchers to experiment with brain-inspired dynamics in various architectures?

Key findings

  • Predictive coding augmentations improve recognition accuracy under Gaussian noise across timesteps compared to the feedforward baseline.
  • Reconstructions and representations progressively move closer to clean inputs and manifolds with more timesteps.
  • With tuned hyperparameters, predictive coding reduces corruption error (CE) and mean corruption error (mCE) on ImageNet-C for some perturbations.
  • Across adversarial attacks, predictive coding iterations tend to reduce attack success across timesteps, increasing robustness.
  • The approach yields robustness gains without supervised training of feedback paths and is facilitated by the Predify package.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.