[Paper Review] Contrastive Reasoning in Neural Networks
This paper proposes contrastive reasoning in neural networks, where inference is reimagined as abductive reasoning by identifying feature-level contrasts between input data and learned class dependencies in the network's weight manifold. By extracting and leveraging these contrasts—formalized as deviations from known causal patterns—the method improves robustness under distribution shift, achieving 3.47–5.48% accuracy gains on CIFAR-10C, noisy STL-10, and VisDA under distortions and domain shift.
Neural networks represent data as projections on trained weights in a high dimensional manifold. The trained weights act as a knowledge base consisting of causal class dependencies. Inference built on features that identify these dependencies is termed as feed-forward inference. Such inference mechanisms are justified based on classical cause-to-effect inductive reasoning models. Inductive reasoning based feed-forward inference is widely used due to its mathematical simplicity and operational ease. Nevertheless, feed-forward models do not generalize well to untrained situations. To alleviate this generalization challenge, we propose using an effect-to-cause inference model that reasons abductively. Here, the features represent the change from existing weight dependencies given a certain effect. We term this change as contrast and the ensuing reasoning mechanism as contrastive reasoning. In this paper, we formalize the structure of contrastive reasoning and propose a methodology to extract a neural network's notion of contrast. We demonstrate the value of contrastive reasoning in two stages of a neural network's reasoning pipeline : in inferring and visually explaining decisions for the application of object recognition. We illustrate the value of contrastively recognizing images under distortions by reporting an improvement of 3.47%, 2.56%, and 5.48% in average accuracy under the proposed contrastive framework on CIFAR-10C, noisy STL-10, and VisDA datasets respectively.
Motivation & Objective
- To address the generalization failure of feed-forward, inductive reasoning in neural networks under distribution shift and data distortions.
- To formalize a new inference paradigm—contrastive reasoning—that reasons from effect to cause using implicit contrasts in trained networks.
- To extract and utilize the network's internal notion of contrast as a basis for robust, explainable decision-making.
- To improve model robustness and provide visual explanations by identifying feature-level deviations from known class manifolds.
- To demonstrate that contrastive inference outperforms standard feed-forward inference in low-data and out-of-distribution settings.
Proposed method
- Formalize contrast as the deviation of input features from known class-specific weight manifolds in the trained network’s high-dimensional space.
- Extract contrastive features by computing gradients of the network’s logits with respect to input features, identifying how input changes affect class predictions.
- Construct a hypothesis set ℋ from multiple class predictions generated by the network, treating each as a potential explanation for the input.
- Apply abductive reasoning by selecting the most plausible hypothesis (class) based on the magnitude and direction of contrastive deviations.
- Use the contrastive inference mechanism as a plug-in on top of a pre-trained feed-forward network, without retraining.
- Visualize contrastive explanations by highlighting input regions that contribute most to the contrastive deviation from known class manifolds.
Experimental results
Research questions
- RQ1Can implicit contrasts within a pre-trained neural network be formalized and leveraged for improved inference under distribution shift?
- RQ2How does contrastive reasoning, based on effect-to-cause inference, improve robustness compared to standard feed-forward, inductive reasoning?
- RQ3Can contrastive features be extracted in a non-heuristic, gradient-based manner to enable reliable and explainable model decisions?
- RQ4To what extent does contrastive reasoning enhance performance on corrupted or out-of-distribution data without retraining?
- RQ5Can contrastive reasoning provide meaningful visual explanations that complement causal reasoning in object recognition?
Key findings
- Contrastive inference improves average accuracy by 3.47% on CIFAR-10C under various distortions, demonstrating robustness to data corruption.
- On noisy STL-10, contrastive inference achieves a 2.56% average accuracy gain, with a peak improvement of 6.89% under high-level blur distortions.
- On the VisDA synthetic-to-real domain shift benchmark, contrastive inference yields a 5.48% absolute improvement in overall accuracy.
- When the base network is trained on distorted data, contrastive inference still provides a 1.12% average accuracy gain across all distortions, with a 6.87% gain at the highest distortion level.
- The method maintains or improves performance even with only 300 training images per class, indicating strong generalization under low-data regimes.
- Visual explanations derived from contrastive reasoning highlight input regions contributing most to class prediction, offering interpretability beyond standard activation maps.
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.