Abstract
This paper conjectures and validates a framework that allows for action during inference in supervised neural networks. Supervised neural networks are constructed with the objective to maximize their performance metric in any given task. This is done by reducing free energy and its associated surprisal during training. However, the bottom-up inference nature of supervised networks is a passive process that renders them fallible to noise. In this paper, we provide a thorough background of supervised neural networks, both generative and discriminative, and discuss their functionality from the perspective of free energy principle. We then provide a framework for introducing action during inference. We introduce a new measurement called stochastic surprisal that is a function of the network, the input, and any possible action. This action can be any one of the outputs that the neural network has learnt, thereby lending stochasticity to the measurement. Stochastic surprisal is validated on two applications: Image Quality Assessment and Recognition under noisy conditions. We show that, while noise characteristics are ignored to make robust recognition, they are analyzed to estimate image quality scores. We apply stochastic surprisal on two applications, three datasets, and as a plug-in on 12 networks. In all, it provides a statistically significant increase among all measures. We conclude by discussing the implications of the proposed stochastic surprisal in other areas of cognitive psychology including expectancy-mismatch and abductive reasoning.
Introduction
Deep learning models are often criticized for being "black boxes" that perform a passive, bottom-up pass of data. While they excel at pattern recognition, they lack the active, inquisitive nature of biological vision. In a new paper published in Frontiers in Neuroscience, Mohit Prabhushankar and Ghassan AlRegib from Georgia Tech propose a way to fix this by borrowing a page from theoretical neuroscience: the Free Energy Principle (FEP).
The Problem of Passive Inference
Standard supervised neural networks are essentially "passive" during inference. They take an input, move it through layers, and produce a prediction. This works well for clean data, but it makes models brittle when faced with noise or distortions they didn't see during training.
In contrast, biological systems follow the Free Energy Principle. According to this theory, the brain is an "inference engine" that constantly tries to minimize the mismatch (surprisal) between its internal model and the outside world. If the sensory input is confusing, the brain doesn't just sit there; it takes "action"—either by changing its internal expectations or by moving to get a better look. This research seeks to bring this "active" capability to standard deep learning architectures without requiring a total redesign.
Methodology: Stochastic Surprisal
The core innovation is Stochastic Surprisal. In the FEP framework, surprisal is a measure of how "unexpected" an input is. The authors define stochastic surprisal as the gradient of a hypothetical action with respect to the network’s parameters ($\partial \mathcal{A} / \partial \theta$).
The framework operates differently depending on the network type:
- Generative Networks (Autoencoders): The "action" is the attempt to reconstruct the input perfectly. The surprisal is the gradient needed to minimize reconstruction error.
- Discriminative Networks (Classifiers): Since the model doesn't know the true label at inference time, it considers all possible classes as potential "actions." It calculates the gradients for every possible class label. This collection of gradients—representing how the network would have to change to "believe" the input belongs to each class—becomes a rich feature vector.
- The H-Network: These gradient features are then passed through a small, auxiliary multi-layer perceptron (the "H-network") to make a final, more robust prediction.
Experimental Results
The researchers validated their approach across two distinct domains using a variety of datasets and architectures:
- Image Quality Assessment (IQA): Evaluated on MULTI-LIVE, TID2013, and the DR IQA datasets. In these tasks, the stochastic surprisal method (plugged into the UNIQUE algorithm) achieved top-2 performance across nearly all metrics (PLCC, SRCC, etc.).
- Robust Recognition: Tested on CIFAR-10C, a benchmark containing 10,000 images across 19 different distortion types at five levels of severity. On this benchmark, the proposed method improved the Top-1 accuracy of a standard ResNet-18 from 67.89% to 71.4%.
- Architectures: The method was tested as a "plug-in" for 12 different networks, including ResNet-18, 34, 50, 101, VGG-16, and WideResNet. It consistently improved the performance of other state-of-the-art robustness techniques like Augmix and SimCLR.
Key Insights
- Gradients as Sensors: The "aha moment" is that the way a network wants to change its weights to accommodate a label tells you a lot about the input. If a network needs a massive, chaotic weight update to "see" a cat as a dog, that delta contains information about the noise and the semantic content of the image.
- Active Inference in Passive Models: You don't need a specialized "FEP-native" architecture. You can extract these biological-inspired measurements from any standard network that supports backpropagation.
- Contrastive Explanations: The framework naturally answers "Why P rather than Q?" questions. For example, it can highlight exactly which pixels make a bird look more like a "spoonbill" than a "flamingo," providing much finer-grained explanations than standard tools like Grad-CAM.
Discussion and Future Work
The primary limitation is computational scaling. Because the method requires calculating gradients for every possible class, the cost scales linearly with the number of classes ($N$). While manageable for CIFAR-10 ($N=10$), it becomes a significant bottleneck for datasets like ImageNet ($N=1000$).
The authors suggest that future work could involve "selective action"—only calculating surprisal for the top-$k$ most likely classes to maintain efficiency while keeping the benefits of active inference. They also aim to explore how this framework relates to other cognitive concepts like abductive reasoning (inference to the best explanation) and expectancy-mismatch.
Summary updated