Exploiting the Relationship Between Kendall's Rank Correlation and Cosine Similarity for Attribution Protection

Fan Wang, Adams Wai-Kin Kong

Introduction

Deep neural network explanations (attributions) are notoriously fragile. Tiny, invisible changes to an image can completely flip which pixels the model "claims" are important for its prediction, even if the prediction itself remains unchanged. This paper introduces the Integrated Gradient Regularizer (IGR), which uses cosine similarity as a differentiable proxy to protect the rank-order of feature importance. This approach makes AI explanations significantly more robust and even slightly improves the model's overall adversarial defenses.

The Problem: Fragile Explanations

As AI is deployed in high-stakes fields like medicine and law, practitioners need to know why a model makes a decision. "Attribution methods" (like saliency maps) highlight the input features that most influenced a prediction. However, researchers have found that these explanations are easily "hacked." An attacker can add imperceptible noise to an image that keeps the classification the same but makes the explanation look completely different.

The standard metric for comparing these explanations is Kendall’s rank correlation, which measures if the relative importance of features remains the same before and after an attack. The problem is that Kendall’s correlation is non-differentiable, meaning it cannot be used directly as a loss function to train a model. Previous attempts used $\ell_p$ distances (like Mean Squared Error) as a fix, but as this paper demonstrates, two explanations can have the same distance from the original while exhibiting wildly different feature rankings.

Attribution maps degrading under perturbation, showing the relationship between cosine similarity and Kendall's rank correlation.

The Solution: Bridging Rank and Calculus

The authors bridge the gap between discrete ranking and continuous calculus through a few key steps:

  1. The Theoretical Link: They prove that under certain conditions, cosine similarity is positively correlated with the expected Kendall’s rank correlation. This means that by minimizing the angle between attribution vectors, you are effectively protecting the rank of feature importance.
  2. Integrated Gradient Regularizer (IGR): They propose a new training objective. Instead of just training the model to be accurate, they add a penalty term that maximizes the cosine similarity between the attribution of a clean image and its perturbed (adversarial) counterpart.
  3. Activation Consistency: They provide a mathematical analysis showing that IGR encourages "activation consistency." Essentially, it forces neurons to stay in the same state (active or inactive) for both natural and noisy inputs, leading to more stable internal representations.

Key Insights

  • Angle Over Distance: The most important insight is that for attribution robustness, the direction of the attribution vector matters more than its magnitude. $\ell_p$ norms fail because they allow the vector to "rotate" significantly as long as the tip of the vector stays within a certain distance.
  • Differentiable Proxy: By identifying cosine similarity as a proxy for Kendall’s rank correlation, the authors turned a discrete ranking problem into a continuous optimization problem that fits perfectly into standard deep learning pipelines.
  • The "Side-Effect" of Robustness: Interestingly, protecting the explanation also helped protect the prediction. Models trained with IGR showed improved accuracy against standard adversarial attacks, suggesting that stable explanations and stable classifications are closely linked.

Empirical Results

The researchers evaluated their method on standard computer vision benchmarks, including MNIST, Fashion-MNIST, and CIFAR-10.

  • Superior Attribution Protection: In tests using the Iterative Feature Importance Attack (IFIA), IGR-enhanced models significantly outperformed previous state-of-the-art defenses. For example, on MNIST, combining the TRADES defense with IGR boosted the Kendall correlation from 0.2127 to 0.4537.
  • Visual Stability: Qualitative results show that while baseline models produce "noisy" or completely incorrect saliency maps under attack, IGR models maintain maps that are visually aligned with human perception.
  • Adversarial Accuracy: On CIFAR-10, adding IGR to the AT (Adversarial Training) method improved the model's accuracy against PGD20 attacks from 37.56% to 38.21%, while also improving clean image accuracy.

Limitations and Future Work

  • Computational Overhead: Calculating Integrated Gradients (IG) requires computing the line integral of gradients, which is more computationally expensive than standard training. While the authors use a Riemann sum approximation to speed this up, it still adds a training burden.
  • The "Side-Effect" Mystery: The authors admit that the improvement in standard adversarial robustness (classification accuracy) is currently viewed as a "side-effect." They suggest that a more rigorous study is needed to fully understand the relationship between neuron activation consistency and global model robustness.
  • Theoretical Assumptions: The theoretical link relies on certain assumptions about positive-valued distributions and specific vector operations, which may not perfectly describe every real-world neural network architecture.

Summary updated

BibTeX
@inproceedings{wang2022exploiting,
  author = {Fan Wang and Adams Wai-Kin Kong},
  title = {{Exploiting the Relationship Between Kendall's Rank Correlation and Cosine Similarity for Attribution Protection}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=QPg5TTAdizy},
}
Figure