Purifier: Defending Data Inference Attacks via Transforming Confidence Scores

Ziqi Yang, Lijin Wang, Da Yang, Jie Wan, Ziming Zhao, Ee-Chien Chang, Fan Zhang, Kui Ren

Abstract

Machine Learning as a Service (MLaaS) platforms often leak sensitive training data information through confidence scores—the probability vectors a model assigns to its predictions. This paper introduces PURIFIER, a novel defense mechanism designed to protect models from data inference attacks, including Membership Inference (MIA), Model Inversion, and Attribute Inference. PURIFIER employs a Conditional Variational Auto-Encoder (CVAE) to reform confidence scores and a label-swapping strategy to bridge the generalization gap between training and test data. Experimental results demonstrate that PURIFIER effectively reduces attack success rates to near-random levels while maintaining high model utility and superior computational efficiency compared to existing defenses.

Introduction

As machine learning models are increasingly deployed via MLaaS, privacy concerns regarding the training data have intensified. Attackers can exploit the "overconfidence" of models on their training samples (members) compared to unseen data (non-members). This discrepancy creates a signature that allows for Membership Inference Attacks (MIA), where an attacker determines if a specific record was part of the training set. Furthermore, detailed confidence scores can be used for adversarial model inversion to reconstruct sensitive inputs or infer hidden attributes.

Existing defenses often suffer from a steep trade-off between privacy and utility, or they introduce significant computational overhead. PURIFIER addresses these challenges by "purifying" the output scores to make member and non-member responses statistically indistinguishable.

The PURIFIER Framework

PURIFIER targets three pillars of distinguishability exploited by attackers: individual score shape, statistical distribution in latent space, and prediction accuracy. The system consists of two primary components:

1. Confidence Reformer (G)

The Confidence Reformer is a Conditional Variational Auto-Encoder (CVAE) trained exclusively on confidence scores from non-member samples. When a member's score is processed, the CVAE reshapes the vector to match the patterns typical of non-members. By introducing Gaussian noise in the latent space, the reformer scatters statistically clustered member scores, ensuring they are indistinguishable from non-members in the distribution.

2. Label Swapper (H)

Because models typically exhibit higher accuracy on training data, a "generalization gap" remains even after score reformation. The Label Swapper uses a $k$-Nearest Neighbor (kNN) approach to identify members with suspiciously high accuracy and intentionally swaps their top-predicted label with the second-best class. This alignment of accuracy levels further masks the identity of training samples.

The PURIFIER architecture, featuring the Confidence Reformer (CVAE) and Label Swapper.

Experimental Evaluation

The authors evaluated PURIFIER across diverse benchmarks, including CIFAR10, Purchase100, FaceScrub530 (for facial recognition and inversion), and UTKFace (for attribute inference).

Key Results

  • Membership Inference Defense: Against state-of-the-art NSH attacks on the FaceScrub530 dataset, PURIFIER reduced attack accuracy from 69.34% to 51.56%, effectively reducing the attacker's advantage to near-random guessing.
  • Utility Preservation: PURIFIER maintains high model performance, typically incurring only a ~1% drop in test accuracy, which is significantly lower than many noise-based or adversarial training defenses.
  • Model Inversion Protection: By filtering out redundant information not essential for the primary classification task, PURIFIER makes it significantly harder for attackers to reconstruct original inputs. On FaceScrub530, the inversion error increased by over 4x compared to an undefended model.
Visual comparison of reconstructed images from model inversion attacks across different defense mechanisms. PURIFIER produces the most obscured results.

Efficiency

Computational overhead is a critical factor for MLaaS. PURIFIER is remarkably efficient; its testing time is approximately 18x the original model's inference time. In contrast, competing defenses like MemGuard can be over 7,000x slower, making PURIFIER a more practical choice for real-time applications.

Conclusion

PURIFIER provides a comprehensive defense against data inference attacks by transforming the output space of machine learning models. By learning the distribution of non-member outputs and enforcing that members mimic this behavior, it closes the privacy gaps exploited by attackers. Its combination of high security, low utility loss, and operational efficiency marks a significant advancement in privacy-preserving machine learning.

Summary updated

BibTeX
@inproceedings{yang2023purifier,
  author = {Ziqi Yang and Lijin Wang and Da Yang and Jie Wan and Ziming Zhao and Ee-Chien Chang and Fan Zhang and Kui Ren},
  title = {{Purifier: Defending Data Inference Attacks via Transforming Confidence Scores}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.1609/aaai.v37i9.26289},
}
Figure