Abstract
Traditional deep learning models often function as "black boxes," where internal representations are high-dimensional vectors lacking human-interpretable meaning. This paper introduces Decodable Neural Networks (DecNN), a framework that enforces internal activations to be decodable back into the original input space. By making these representations human-readable and mathematically compatible with the input layer, DecNNs enable recursive self-composition for robust uncertainty estimation and seamless integration with pretrained models for feature regularization.
Introduction: The Challenge of Compositionality
In software engineering, systems are built from modular, typed components that can be traced, debugged, and composed. Deep learning lacks this "engineering practicality." A neural network's hidden activations are difficult to interpret or constrain with logical assertions. This lack of compositionality makes it challenging to combine models without retraining and difficult to detect when a model is making confident but erroneous predictions. The authors propose DecNN to bridge this gap by aligning internal representations with the input domain.
Methodology
The core of the approach is the Decodable Neural Network (DecNN), which jointly trains a classifier $f$ and a generative decoder $g$.
Decodability and Regularization
For every hidden layer, the decoder must map the activation back to the original input image. This requirement acts as a powerful regularizer, ensuring the network preserves input-level information throughout its depth.
Recursive Self-Composition (ReDecNN)
Since activations can be reconstructed as images, these reconstructions can be fed back into the same network. This recursive process creates a computational "tree." Sampling different paths through this tree forms an implicit ensemble, providing a natural measure of predictive uncertainty without the need for multiple independent models.
Composition with Pretrained Models
Decoded activations can also serve as inputs to other pretrained models. This allows for "protected feature" regularization. For instance, a network can be penalized if a pretrained "protected feature detector" (e.g., for hair color) can confidently identify that feature from the decoded activations, thereby encouraging the main classifier to ignore confounding attributes.
Experimental Evaluation
The researchers evaluated DecNN across various modalities including image classification (MNIST, FashionMNIST, CelebA) and speech recognition (AudioMNIST, Fluent Speech Commands).
Key Results
- Accuracy: On the CelebA dataset, ReDecNN achieved 90.8% accuracy, matching standard neural networks and outperforming MC-Dropout (87.8%).
- Out-of-Distribution (OOD) Detection: ReDecNN significantly outperformed standard ensembles in OOD tasks. For identifying held-out celebrity attributes, ReDecNN achieved an ROC-AUC of ~0.60, while baselines like MC-Dropout and BayesNN performed near random chance (0.50).
- Calibration: ReDecNN drastically improved model calibration. On MNIST, it reduced the Expected Calibration Error (ECE) to 0.33, compared to 1.18 for a standard network.
Discussion and Insights
A key insight from the study is the ability to visualize the model's "thought process." When a DecNN misclassifies an input, the decoded activations often show the input features interpolating toward the incorrect class (e.g., a hat disappearing in the reconstruction if the model predicts "no hat").
Furthermore, the authors found that a single, shared ResNet-18 decoder was sufficient to reconstruct inputs from any depth, simplifying the architecture.
Limitations and Future Work
The primary limitation is the increased computational cost; training a ReDecNN is approximately 6x slower than a standard network due to the additional backpropagation through the decoder and recursive steps. Additionally, the system's performance is tied to the quality of the generative decoder. Future work includes extending this framework to Transformer architectures and exploring more efficient weight-sharing strategies.
Conclusion
Decodable Neural Networks offer a path toward more transparent and composable deep learning systems. By anchoring hidden representations in the input space, DecNNs provide "uncertainty for free" and enable new forms of model regularization and debugging, bringing deep learning closer to the rigors of traditional software engineering.
Summary updated