Image Classifiers Leak Sensitive Attributes About Their Classes

Lukas Struppek, Dominik Hintersdorf, Felix Friedrich, Manuel Brack, Patrick Schramowski, Kristian KerstingarXiv 2023

Abstract

Image classifiers inadvertently learn sensitive, unlabeled attributes of the classes they are trained to identify. This paper introduces the Class Attribute Inference Attack (CAIA), a novel black-box method that leverages generative diffusion models to "interrogate" a classifier. By generating controlled variations of facial images, an adversary can reveal private information—such as gender, race, or hair color—of individuals in the training set. Experimental results demonstrate high inference accuracy and uncover a startling trade-off: making models more robust to adversarial noise actually increases their vulnerability to sensitive attribute leakage.

Introduction

When a face recognition system is trained to identify a specific individual, it is typically provided only with a class label (e.g., "Person A"). However, neural networks naturally capture auxiliary features during training, such as the fact that Person A has blond hair or wears eyeglasses. This phenomenon, known as Attribute Inference, poses a significant privacy risk.

While attribute inference has been well-documented in tabular data, it is significantly more complex in the image domain because manipulating specific visual attributes without destroying image realism is difficult. Previous attacks often required "white-box" access to model weights or were computationally prohibitive. CAIA addresses these challenges by using modern generative AI to perform a black-box attack using only the target model's output scores.

Methodology: The CAIA Framework

The authors propose a two-stage attack pipeline designed to extract class-level secrets efficiently.

1. Crafting Attack Samples

The attacker first generates a set of "attack samples" ($S_{attack}$) using a text-to-image diffusion model (e.g., Stable Diffusion). By employing Null-text Inversion and Prompt-to-Prompt editing, they create image tuples where each version is identical except for one target attribute. For example, a single base face is transformed into four versions: one with black hair, one blond, one brown, and one gray. To ensure quality, these images pass through an Attribute Filter that discards low-confidence generations.

The process of generating attack samples using diffusion models and attribute filtering.

2. Inference via Relative Advantage

The attacker feeds these tuples into the target "victim" model ($\mathcal{M}$) and analyzes the resulting logits (raw prediction scores). The core logic is the Relative Advantage: if the victim model consistently assigns a higher score to the "blond" version of an image when identifying "Person A," the attacker infers that Person A is likely blond. By aggregating this advantage across many base images, the attack achieves high statistical confidence.

The inference stage where logits from the target model are used to calculate relative advantage and predict class attributes.

Experimental Results

The attack was evaluated against models trained on the CelebA and FaceScrub datasets, targeting attributes like gender, eyeglasses, hair color, and racial appearance.

  • High Accuracy: CAIA correctly inferred gender and eyeglasses in over 90% of cases. Racial appearance and hair color were inferred with 80-84% accuracy.
  • Efficiency: Unlike previous model inversion attacks that require complex optimization per class, CAIA requires only a single forward pass. Inferring attributes for 500 identities takes approximately 2 seconds.
  • Superiority over White-Box Methods: In several scenarios, such as inferring the presence of eyeglasses, this black-box approach actually outperformed state-of-the-art white-box attacks.

The Robustness-Privacy Trade-off

A critical finding of this research is that adversarially robust models—those specifically trained to resist digital noise—are significantly more vulnerable to privacy leakage.

Standard models often rely on "non-robust" features (like background artifacts) for prediction. Robust models, however, are forced to focus on "robust features" like eye shape, nose structure, and hair. Because these robust features are the same ones that define sensitive human attributes, the model's output scores become more sensitive to changes in those attributes. For instance, on the FaceScrub dataset, a robust ResNet-101 model leaked gender information with 96.62% accuracy, compared to 93.08% for a standard model.

Conclusion

CAIA demonstrates that image classifiers are not just identifiers; they are unintentional repositories of sensitive class data. The discovery that model robustness exacerbates this leakage presents a new challenge for the machine learning community: the need to balance defensive stability with data privacy. Future work may explore how to mitigate these leaks through differential privacy or by addressing the semantic entanglement of attributes during training.

Summary updated

BibTeX
@misc{struppek2023image,
  author = {Lukas Struppek and Dominik Hintersdorf and Felix Friedrich and Manuel Brack and Patrick Schramowski and Kristian Kersting},
  title = {{Image Classifiers Leak Sensitive Attributes About Their Classes}},
  year = {2023},
  url = {https://openreview.net/forum?id=1grMmP-dp2},
}
Figure