[Paper Review] Detecting Adversarial Examples and Other Misclassifications in Neural Networks by Introspection
This paper proposes Introspection-Net, a 3-layer neural network that uses logits from a pretrained classifier to detect adversarial examples, out-of-distribution inputs, and regular misclassifications. By training on logit activations with adversarial data augmentation, it achieves superior detection performance—especially on out-of-distribution and adversarial examples—surpassing baseline methods like Softmax Thresholding and Trust Score.
Despite having excellent performances for a wide variety of tasks, modern neural networks are unable to provide a reliable confidence value allowing to detect misclassifications. This limitation is at the heart of what is known as an adversarial example, where the network provides a wrong prediction associated with a strong confidence to a slightly modified image. Moreover, this overconfidence issue has also been observed for regular errors and out-of-distribution data. We tackle this problem by what we call introspection, i.e. using the information provided by the logits of an already pretrained neural network. We show that by training a simple 3-layers neural network on top of the logit activations, we are able to detect misclassifications at a competitive level.
Motivation & Objective
- Address the critical issue of neural networks being overconfident in incorrect predictions, including adversarial examples, out-of-distribution inputs, and standard errors.
- Investigate whether the raw logits of a pretrained classifier—before softmax—contain discriminative information for confidence estimation.
- Develop a model-agnostic detection method that leverages internal network representations (introspection) to improve reliability without retraining the base classifier.
- Demonstrate that logits preserve useful information for detection even when softmax outputs are misleadingly confident.
Proposed method
- Train a 3-layer fully connected neural network (Introspection-Net) on the logits of a pretrained classifier to predict a confidence score (1 for correct, 0 for incorrect classification).
- Use adversarial training with FGSM, BIM, and DeepFool attacks to expose the model to misclassified examples during training.
- Apply data augmentation (rotations, shifts, zooms) to improve generalization and robustness of the confidence predictor.
- Train Introspection-Net using mean squared error loss on a balanced dataset combining in-distribution, adversarial, out-of-distribution, and error examples.
- Evaluate the model using standard metrics: AUROC, AUPR (in and out), and FPR at 95% TPR.
- Apply the method to both MNIST and CIFAR-10 with a pretrained CNN and a Wide ResNet, respectively, to test generalization across architectures and datasets.
Experimental results
Research questions
- RQ1Can raw logits from a pretrained neural network provide reliable confidence signals for detecting misclassifications?
- RQ2Does using introspection—analyzing internal activations—improve detection of adversarial examples compared to relying on softmax probabilities?
- RQ3Can a simple, lightweight model trained on logits generalize across different datasets and neural network architectures?
- RQ4How does the performance of logit-based detection compare to existing methods like Softmax Baseline and Trust Score across multiple types of misclassifications?
- RQ5Is it possible to detect out-of-distribution and adversarial examples effectively using only the magnitude and distribution of logits, without additional model retraining?
Key findings
- Introspection-Net significantly outperforms the Softmax Baseline and Trust Score on detecting out-of-distribution data, achieving 0.0% FPR on Gaussian noise and near-perfect AUROC across all OOD datasets.
- For adversarial example detection, Introspection-Net achieves 97.6 AUROC on the BIM attack in the CIFAR-10 experiment, compared to 14.4 for Softmax Baseline and 56.1 for Trust Score.
- The method performs best on OOD detection, with near-perfect scores on all tested OOD data (Gaussian, Uniform, CIFAR-10, Fashion-MNIST), while still outperforming baselines on adversarial examples.
- Error detection remains the most challenging task, where all methods perform similarly, indicating that logits alone may not be sufficient to distinguish between natural errors and correct predictions.
- The Softmax Baseline performs best on DeepFool adversarial examples due to their low maximum softmax probability (54.0%), which makes them more detectable by thresholding, highlighting a limitation of relying on softmax alone.
- Despite requiring adversarial training, Introspection-Net generalizes well across architectures (CNN on MNIST, Wide ResNet on CIFAR-10), demonstrating robustness and transferability of the approach.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.