Abstract
Membership inference attacks (MIA) pose a significant threat to the privacy of training datasets in machine learning. This paper introduces MemGuard, the first defense against black-box MIA that provides formal utility guarantees. MemGuard leverages the concept of adversarial examples to perturb a model's output confidence scores, effectively misleading an attacker's classifier into random guessing. Unlike traditional defenses like Differential Privacy, MemGuard is a post-processing technique that preserves the model's original prediction accuracy while maintaining a strict distortion budget.
Introduction
Machine learning models often inadvertently leak sensitive information about the data used to train them. In a Membership Inference Attack (MIA), an adversary attempts to determine whether a specific data sample was part of a target model's training set. This is particularly concerning for models trained on sensitive data, such as medical records or financial transactions.
Existing defenses, such as Differential Privacy (DP) or heavy regularization (e.g., Dropout, L2), often require retraining the model and can significantly degrade its predictive accuracy. Furthermore, these methods frequently lack formal guarantees regarding the distortion of output scores, leading to a suboptimal tradeoff between privacy and utility. MemGuard addresses these issues by introducing a post-processing defense that uses adversarial noise to protect privacy without sacrificing accuracy.
The Membership Inference Problem
In a black-box MIA, the attacker queries a target model with a data sample $\mathbf{x}$ and receives a confidence score vector $\mathbf{s}$. Because models tend to be more "confident" about samples they have seen during training, the attacker can train a binary classifier $C$ to distinguish between members and non-members based on these scores.
The MemGuard Defense
MemGuard is a post-processing mechanism that intercepts the true confidence score vector $\mathbf{s}$ and transforms it into a noisy version $\mathbf{s}'$. The defense is built on the insight that the attacker's classifier $C$ is itself a machine learning model and is therefore vulnerable to adversarial perturbations.
The defense operates in two primary phases:
Phase I: Finding the Noise Vector
The defender first identifies a noise vector $\mathbf{n}$ that turns the output scores into an adversarial example for the attacker. The objective is to find a vector $\mathbf{s} + \mathbf{n}$ that causes the attacker's classifier to output a probability of $0.5$, representing a random guess. This is formulated as an optimization problem with two critical constraints:
- Zero Label Loss: The top-predicted label of the noisy vector $\mathbf{s}'$ must be identical to that of the original vector $\mathbf{s}$.
- Validity: The resulting vector must remain a valid probability distribution (i.e., its elements must sum to 1 and be non-negative).
Phase II: Satisfying the Distortion Budget
To provide formal utility guarantees, the defender specifies a distortion budget $\epsilon$. MemGuard adds the noise vector $\mathbf{n}$ with a probability $p$ such that the expected $L_1$ distance between $\mathbf{s}$ and $\mathbf{s}'$ is at most $\epsilon$. This ensures that while the attacker is misled, the confidence scores remain useful for legitimate applications.
To prevent adaptive attackers from bypassing the defense by querying the same point multiple times, MemGuard employs one-time randomness. The noise generation is seeded with a hash of the input data, ensuring that the same input always yields the same noisy output.
Experimental Evaluation
The authors evaluated MemGuard across three diverse datasets representing different privacy-sensitive scenarios:
- Location (Foursquare): A 30-class classification task based on user check-ins.
- Texas100 (Hospital Discharge): A 100-class classification task using patient diagnosis and procedure features.
- CH-MNIST: An 8-class tissue classification task using histology images of colorectal cancer.
Key Results
MemGuard demonstrated superior performance compared to state-of-the-art defenses like DP-SGD and Min-Max adversarial regularization. On the Location dataset, it reduced the accuracy of membership inference attacks from approximately 73% to near-random levels (~51%) with minimal score distortion. Crucially, MemGuard maintained 100% of the original model's prediction accuracy, whereas competing defenses often incurred label losses between 18% and 56% to achieve comparable privacy levels.
Conclusion
MemGuard represents a significant advancement in privacy-preserving machine learning. By repurposing adversarial examples as a defensive tool, it provides a robust, post-processing solution to membership inference attacks. Its ability to decouple defense from training and its guarantee of zero label loss make it a practical and effective choice for protecting sensitive training data in black-box environments.
Summary updated