Two out of Three (ToT): using self-consistency to make robust predictions

Jung Hoon Lee, Sujith VijayanarXiv 2025 · DOI · arXiv

TL;DR

This paper introduces "Two out of Three" (ToT), a novel algorithm that enhances the robustness of deep learning models by enabling them to abstain from making predictions when uncertain. By leveraging self-consistency across multiple predictions derived from different views of the input and its internal features, ToT significantly improves reliability, especially in the face of adversarial attacks.

What Problem Does This Paper Address?

Deep learning (DL) models have demonstrated remarkable capabilities in various tasks, often surpassing human performance. However, their "black box" nature makes their decision-making processes opaque and difficult to interpret. This lack of transparency poses a significant risk when deploying DL in high-stakes domains (e.g., healthcare, autonomous driving) where errors can have severe consequences. Current DL models often struggle with edge cases and adversarial attacks, leading to unexpected and potentially catastrophic mistakes. The paper aims to address this by developing a method that allows DL models to be more "aware" of their uncertainty and to refuse to make a prediction when confidence is low, thereby preventing erroneous decisions.

Methods

The core of the ToT algorithm lies in generating multiple predictions for a given input and using their agreement to determine confidence.

  • Original Prediction: The standard prediction from the DL model.
  • Second Predictions (STCert-inspired): ToT creates alternative views of the input by segmenting regions of interest (ROIs) and applying a mild blur. The model then generates predictions on these ROIs. The paper uses three bounding boxes for each ROI: the ROI itself, and two larger boxes encompassing additional background context. This approach is inspired by the "search-light hypothesis" and the "Second Thought Certification" (STCert) method.
  • Third Prediction (Hidden Features): To address situations where the original and second predictions disagree, ToT derives a third prediction from the model's internal, "hidden" features. This involves extracting features from the penultimate layer, clustering them, and using these clusters to infer a prediction. This method is inspired by prior work on using internal representations for classification.

To make a final decision, ToT employs a "two out of three" rule: if at least two of the three types of predictions (original, second, and third) are consistent, a prediction is made. Otherwise, the model abstains from answering ("Null" prediction). The paper also notes that blurring the ROIs for the second predictions is crucial for improving robustness against adversarial attacks.

Datasets

The study utilizes two subsets of ImageNet-1K:

  • Mixed_13: Contains 13 superclasses, each with 6 fine-grained classes, totaling 78 fine-grained classes.
  • Geirhos_16: Contains 16 superclasses, each with 4 fine-grained classes.

These subsets were chosen to approximate general computer vision datasets and to avoid the need for training new models from scratch.

Key Insights and Ideas

  • Self-Consistency as a Confidence Measure: The fundamental idea is that humans often rely on internal consistency and agreement across different perspectives or lines of reasoning to gauge confidence. ToT applies this principle to DL models.
  • The Power of Abstention: The ability to refuse to make a prediction when uncertain is as valuable as making accurate predictions, especially in safety-critical applications. This is a key differentiator from standard DL models that always output a prediction.
  • Blurring for Robustness: Surprisingly, applying a Gaussian blur to the regions of interest for the second predictions significantly enhances the model's ability to detect adversarial attacks and improve the accuracy of high-confident predictions. This suggests that controlled "noise" can sometimes reveal underlying vulnerabilities.
  • Hidden Features as a Complementary Signal: Leveraging internal representations provides a crucial third opinion, especially when external views (original and second predictions) conflict, further improving the robustness and accuracy of the final decision.

Key Results

  • Improved Accuracy on High-Confident Predictions: When ToT identifies a prediction as "high-confident" (i.e., original and second predictions agree), its accuracy is higher than the original prediction alone. This effect is amplified when ROIs are blurred.
  • Effective Detection of Adversarial Attacks: ToT significantly increases the rate of "low-confident" predictions (where original and second predictions disagree) when presented with adversarial inputs. This indicates its effectiveness in identifying manipulated data.
  • Robustness Against Adversarial Attacks: For adversarial inputs, ToT achieves high accuracy (60-90%) when it does make a prediction, and it effectively abstains from predicting on a substantial portion of these inputs, preventing incorrect decisions. The accuracy of ToT's final answers on adversarial inputs is notably high, with ViT showing the best performance.
  • Controlled Abstention: The rate of "Null" predictions (abstention) can be controlled by parameters like the blur kernel size and the number of internal symbols considered, allowing for a trade-off between making more predictions and ensuring higher confidence.

Limitations and Future Work

  • Generalizability of ToT: While tested on image classifiers, the authors acknowledge the need to test the self-consistency principle on a wider range of models and domains to confirm its general applicability.
  • Alternative Methods: The paper suggests that other preprocessing techniques beyond Gaussian blur could be explored for generating second views, and more efficient methods for deriving decisions from hidden layer features might exist.
  • Future Directions: The authors plan to address these limitations in future work, aiming to further refine the ToT algorithm and explore its broader applications.

Summary updated

BibTeX
@misc{lee2025two,
  author = {Jung Hoon Lee and Sujith Vijayan},
  title = {{Two out of Three (ToT): using self-consistency to make robust predictions}},
  year = {2025},
  eprint = {2505.12642},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.12642},
}
Figure