Predify: Augmenting deep neural networks with brain-inspired predictive coding dynamics
Bhavin Choksi, Milad Mozafari, Callum Biggs O'May, Benjamin Ador, Andrea Alamia, Rufin VanRullen
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.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 154e22fc-d81b-40a6-a70b-97758dbc1a16Cited by top-tier papers1
Ask how each one uses itBuilds on7
- MagNet: A Two-Pronged Defense against Adversarial ExamplesDongyu Meng, Hao ChenCCS 2017 · 1,295 citations
- HopSkipJumpAttack: A Query-Efficient Decision-Based AttackJianbo Chen, Michael I. Jordan, Martin J. WainwrightS&P 2020 · 797 citations
- Stable and expressive recurrent vision modelsDrew Linsley, Alekh Karkada Ashok, Lakshmi Narasimhan Govindarajan, Rex G. Liu et al.NeurIPS 2020 · 56 citations
- Neural Networks with Recurrent Generative FeedbackYujia Huang, James Gornet, Sihui Dai, Zhiding Yu et al.NeurIPS 2020 · 48 citations
- Adversarial Robustness of Supervised Sparse CodingJeremias Sulam, Ramchandran Muthukumar, Raman AroraNeurIPS 2020 · 27 citations
Related papers
- Predictive Coding beyond Gaussian DistributionsLuca Pinchetti, Tommaso Salvatori, Yordan Yordanov, Beren Millidge et al.NeurIPS 2022 · 22 citations
- A Stable, Fast, and Fully Automatic Learning Algorithm for Predictive Coding NetworksTommaso Salvatori, Yuhang Song, Yordan Yordanov, Beren Millidge et al.ICLR 2024 · 22 citations
- Predictive coding in balanced neural networks with noise, chaos and delaysJonathan Kadmon, Jonathan Timcheck, Surya GanguliNeurIPS 2020 · 38 citations
- Towards the Training of Deeper Predictive Coding Neural NetworksChang Qi, Matteo Forasassi, Thomas Lukasiewicz, Tommaso SalvatoriICML 2026 · 6 citations
- On the Infinite Width and Depth Limits of Predictive Coding NetworksFrancesco Innocenti, El Mehdi Achour, Rafal BogaczICML 2026
