Predify: Augmenting deep neural networks with brain-inspired predictive coding dynamics

Bhavin Choksi, Milad Mozafari, Callum Biggs O'May, Benjamin Ador, Andrea Alamia +1 more
6/4/2021
50 citations
cs.CVq-bio.NC

Official code: miladmozafari/predify (35 stars, Python, GPL-3.0, last commit 2026-01-16). 1 more implementation below.

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
miladmozafari/predifyOfficial35PythonGPL-3.02026-01-16
bhavinc/predify2021Official10PythonCC-BY-4.02022-06-19
GPL-3.0
351PythonNov 20, 202010 months agoGPL-3.0
CC-BY-4.0

Code for reproducing the results presented in the paper 'Predify:Augmenting deep neural networks with brain-inspired predictive coding dynamics'

102PythonJun 2, 20214 years agoCC-BY-4.0

Similar Papers

Cite this paper

@article{choksi2021predify,
  title  = {Predify: Augmenting deep neural networks with brain-inspired predictive coding dynamics},
  author = {Bhavin Choksi and Milad Mozafari and Callum Biggs O'May and Benjamin Ador and Andrea Alamia and Rufin VanRullen},
  year   = {2021},
  eprint = {2106.02749},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2106.02749}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2106.02749.svg)](https://codeofpaper.com/paper/2106.02749)

Discussion