Introduction
Standard deep learning classifiers are discriminative, modeling the probability of a label given an input ($p(y|x)$). While accurate, they are notoriously brittle, often providing high-confidence predictions for adversarial examples or out-of-distribution (OOD) data. Generative classifiers, which model the data distribution ($p(x|y)$), are theoretically more robust as they can detect when an input deviates from the training manifold. However, they struggle with scalability to complex datasets like CIFAR10 and suffer from the "likelihood paradox," where pixel-level models assign higher likelihoods to OOD data than to training data.
Supervised Deep InfoMax (SDIM) addresses these hurdles by shifting generative modeling from raw pixels to high-level feature representations. This approach allows generative classifiers to scale effectively while gaining a powerful "rejection" capability for unsafe inputs.
The SDIM Framework
SDIM consists of three integrated components designed to learn robust, class-conditional representations:
- Encoder ($E_\phi$): A standard backbone (e.g., ResNet) that maps inputs to a low-dimensional representation space.
- MI Evaluation Network ($T_\omega$): Based on Deep InfoMax, this network maximizes the Mutual Information (MI) between local feature maps and global representations, ensuring the encoder captures essential structural information.
- Supervised Statistical Constraints: The representation space is treated as a manifold where each class is modeled as an isotropic Gaussian distribution.
Multi-Task Learning
SDIM is trained using a multi-task objective that combines MI maximization ($J_{MI}$) with negative log-likelihood minimization ($J_{NLL}$). A key innovation is the Likelihood Margin Loss ($J_{LM}$), which pushes the likelihood of the correct class up while penalizing incorrect classes, creating a distinct margin in the representation space.
Classification with Rejection
Instead of forcing a prediction on every input, SDIM employs a threshold-based rejection policy. If the highest class-conditional log-likelihood for a test sample falls below a pre-defined threshold (e.g., the 1st percentile of training likelihoods), the model labels the input as "off-manifold" and rejects it. This mechanism is crucial for identifying adversarial attacks and OOD samples that typically fool standard networks.
Key Results
SDIM achieves classification accuracy nearly identical to standard discriminative ResNets (e.g., 92.53% vs. 92.35% on CIFAR10) while providing significantly better safety features.
- OOD Detection: In a FashionMNIST vs. MNIST task, SDIM achieved a 99.64% detection rate, vastly outperforming pixel-level generative models like Glow (3.53%).
- Adversarial Robustness: SDIM is highly effective at maintaining accuracy and detecting attacks. It achieved a 100% detection rate for Boundary attacks on both MNIST and CIFAR10.
Discussion and Limitations
By modeling the likelihood of features learned via MI maximization rather than raw pixels, SDIM avoids the likelihood paradox. The "Off-Manifold Conjecture"—that adversarial and OOD data lie far from the natural data manifold—is central to SDIM's success.
However, the authors note that robustness against white-box attacks might partially stem from "obfuscated gradients" caused by the Likelihood Margin loss. Furthermore, while Gaussian distributions work for CIFAR10, more complex datasets like ImageNet may require more sophisticated manifold modeling. Future work will focus on automating threshold selection and exploring more complex distribution models.
Summary updated