Towards Class-wise Robustness Analysis

Tejaswini Medi, Julia Grabinski, Margret KeuperarXiv 2024 · DOI

Abstract

Evaluating a model's overall robustness can mask significant vulnerabilities at the individual class level. This work introduces the Class False Positive Score (CFPS), a metric designed to identify classes that act as "error sinks" by attracting misclassifications from other categories. Through extensive evaluation on CIFAR-10 across multiple architectures, we demonstrate that high-CFPS classes are disproportionately vulnerable to targeted adversarial attacks, regardless of their individual accuracy. Our findings suggest that class-wise analysis is essential for developing truly robust and reliable deep learning models.

Introduction

In deep learning, robustness is typically measured as the model's ability to maintain performance under domain shifts, such as common image corruptions or intentional adversarial attacks. However, standard evaluation protocols often rely on average robust accuracy, which can hide critical failures in specific categories. For instance, a self-driving system that is 99% accurate overall but consistently misidentifies pedestrians as inanimate objects under specific lighting conditions presents a significant safety risk. This paper argues for a shift toward class-wise robustness analysis to uncover these hidden vulnerabilities.

Methodology: The Class False Positive Score

To better understand class-level vulnerability, we introduce the Class False Positive Score (CFPS). While standard Class-wise Accuracy (CWA) measures how often a model correctly identifies a specific class, CFPS quantifies how often a class "attracts" errors from other categories.

Formally, the CFPS for a given class is the ratio of the number of times samples from other classes were incorrectly labeled as that class to the total number of misclassifications made by the model. We evaluated this metric across several popular architectures, including ResNet-18, ResNet-50, DenseNet-169, WideResNet-70-16, and the foundation model DINOv2, using the CIFAR-10 and CIFAR-10-C datasets.

CFPS across CIFAR-10 classes for various model architectures.

The Disconnect Between Accuracy and Vulnerability

A key finding of our study is that "weak" classes (those with low accuracy) are not necessarily the most "vulnerable" classes (those that attract false positives). In CIFAR-10, classes such as C3 (bird), C5 (deer), and C6 (dog) consistently exhibited the lowest robust accuracy across models. However, these classes did not necessarily have high CFPS values.

In contrast, C4 (cat) emerged as a significant "vulnerability sink." Across almost all architectures and corruption types, the 'cat' class maintained the highest CFPS. This suggests that the decision boundaries for certain classes are more "reachable" from other parts of the data distribution. We hypothesize that classes with high intra-class variance, like cats, create complex latent space boundaries that naturally attract errors, making them prime targets for exploitation.

Adversarial Exploitation

To test whether CFPS is a reliable predictor of adversarial vulnerability, we conducted targeted Projected Gradient Descent (PGD) attacks. The goal was to determine if an attacker could more easily trick a model into misclassifying an image as a high-CFPS class versus a low-CFPS class.

Success rate of targeted PGD attacks per class.

The results confirmed that CFPS is a superior indicator of attack success compared to accuracy alone. For example, while 'deer' (C5) is a "weak" class with low accuracy, it is difficult to target, yielding a low attack success rate. Conversely, the high-CFPS 'cat' class (C4) showed a significantly higher success rate for targeted attacks. This demonstrates that attackers can strategically exploit these "vulnerability sinks" to compromise model integrity.

Conclusion

Our analysis reveals that robustness is not uniform across classes and that average metrics are insufficient for safety-critical applications. By using CFPS, researchers can identify specific classes that act as magnets for errors and adversarial targets. Future work should focus on developing training interventions that mitigate these class-wise biases, ensuring that models are not only accurate on average but robust across the entire data distribution.

Summary updated

BibTeX
@misc{medi2024towards,
  author = {Tejaswini Medi and Julia Grabinski and Margret Keuper},
  title = {{Towards Class-wise Robustness Analysis}},
  year = {2024},
  eprint = {2411.19853},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.19853},
}
Figure