PCNN: Probable-Class Nearest-Neighbor Explanations Improve Fine-Grained Image Classification Accuracy for AIs and Humans

Feb, 2024
Paper
Code

Given an input image \(x\) and a black-box, pretrained classifier \(C\) that predicts the label for \(x\). Prior works (a) often show only the nearest neighbors from the top-1 predicted class as explanations for the decision, which often fools humans into accepting wrong decisions (here, Caspian Tern) due to the similarity between the input and top-1 class examples. Instead, including extra nearest neighbors (b) from top-2 to top-\(K\) classes improves not only human accuracy on this binary distinction task but also AI's accuracy on standard fine-grained image classification tasks.

TL;DR:

We present a new class of nearest-neighbor explanations (called PCNN) and show a novel utility of the XAI method: To improve predictions of a frozen, pretrained classifier \( C \). Our method consistently improves fine-grained image classification accuracy on CUB-200, Cars-196, and Dogs-120. Also, a human study finds that showing layusers our PCNN explanations improves their decision accuracy over showing only the top-1 class examples (as in prior work).


Method

We train an image comparator network, denoted as \( \mathbf{S} \), to determine whether two images belong to the same class by assessing their similarity \( \mathbf{S}(x, nn) \). \( \mathbf{S} \) will be used later for re-ranking the top-\( K \) predicted classes by the pretrained classifier \( \mathbf{C} \).

Sampling Method

PCNN-based sampling: For each training-set image \( x \), we sample nearest-neighbor images from the groundtruth class of \( x \) to form positive pairs. To sample hard, negative pairs: Per non-groundtruth class among the top-predicted (most probable) classes from \( \mathbf{C}(x) \), we take the nearest image to the input. We then use such pairs to train an image comparator \( \mathbf{S} \).

Reranking Process

Product of Experts (Classifier × Comparator) re-ranking algorithm: In test, from each class among the top-predicted classes by the classifier \( \mathbf{C} \), we find the nearest neighbor \( nn \) to the query \( x \) and compute a sigmoid similarity score \( \mathbf{S}(x, nn) \), which weights the original \( \mathbf{C}(x) \) probabilities, re-ranking the labels.


PoE-based re-ranking improves over pretrained classifiers Icon

Our re-ranking algorithm using \( \mathbf{S} \) significantly improves the top-1 classification accuracy over pretrained image classifiers on CUB-200, Cars-196, and Dogs-120.

Table 1: Our Product of Experts models consistently improve the top-1 classification accuracy (%) over pretrained classifiers on all 3 ResNet architectures and 3 datasets. "Pre-trained" column specifies the dataset models were pre-trained before fine-tuning on the target dataset. See below qualitative samples of how our method corrects wrong predictions of pretrained classifiers \( \mathbf{C} \).
Dataset Pre-trained RN18 RN18 × S RN34 RN34 × S RN50 RN50 × S
CUB-200 iNaturalist N/A N/A N/A N/A 85.83 88.59 ( +2.76 )
ImageNet 60.22 71.09 ( +10.87 ) 62.81 74.59 ( +11.78 ) 62.98 74.46 ( +11.48 )
Cars-196 ImageNet 86.17 88.27 ( +2.10 ) 82.99 86.02 ( +3.03 ) 89.73 91.06 ( +1.33 )
Dogs-120 ImageNet 78.75 79.58 ( +0.83 ) 82.58 83.62 ( +1.04 ) 85.82 86.31 ( +0.49 )

PCNN improves human decision-making accuracy on bird image classification Icon

We conduct a human study and find that PCNN explanations help humans improve their decision-making accuracy over showing top-1-class nearest neighbors (in previous work).

Human Experiments
In both experiments, humans are asked whether the input image is Caspian Tern given that input, a model prediction, and either top-1 class examples (top) or PCNN explanations (bottom). When given only examples from the top-1 class, humans tend to accept the prediction, not knowing there are other very visually similar birds. Yet, the top-5 classes provide humans with a broader context which leads to better accuracy.
Human Accuracy
Users often accept when top-1 neighbors are presented, leading to high accuracy when the AI is correct (left) and extremely poor accuracy when AI is wrong (right). PCNN ameliorates this limitation of the top-1 examples.

Try our human study now! Icon


BibTeX

@article{pcnn2024,
  title={PCNN: Probable-Class Nearest-Neighbor Explanations Improve Fine-Grained Image Classification Accuracy for AIs and Humans},
  year={2024},
  publisher={arXiv},
}