Sparsity in neural networks can improve their privacy

Antoine Gonon, Léon Zheng, Clément Lalanne, Quoc-Tung Le, Guillaume Lauga, Can Pouliquen · OpenReview

TL;DR

This paper investigates whether making neural networks "sparse" (using fewer connections) can protect them from membership inference attacks, which try to determine if a specific data point was used during training. The authors found that sparsity indeed improves privacy without significantly harming the network's accuracy, suggesting it's a practical defense mechanism.

What Problem Does This Paper Address?

Deep neural networks are incredibly powerful but can sometimes "memorize" their training data too well. This memorization can lead to privacy risks, as attackers might be able to infer sensitive information about the training data, such as whether a particular individual's data was included. Membership Inference Attacks (MIAs) are a prime example of this, where an attacker tries to determine if a given data point was part of the network's training set, often by observing the network's confidence in its predictions. The challenge is to find ways to protect this privacy without sacrificing the network's performance on its intended task.

Methods

The core idea explored is that by reducing the number of non-zero weights (i.e., making the network sparse), we can limit its capacity to memorize specific training data points. The paper examines two primary methods for achieving sparsity:

  • Unstructured Sparsity via Iterative Magnitude Pruning (IMP): This is a common technique where a network is trained, then the weights with the smallest magnitudes are pruned (set to zero), and the remaining weights are retrained. This process is repeated until the desired sparsity level is reached.
  • Structured Butterfly Sparsity: This is a more novel approach where the weight matrices are constrained to have a specific "butterfly" factorization. This structure allows for efficient matrix-vector multiplications, which is beneficial for hardware implementation, and it inherently enforces sparsity. The paper explores different configurations of this butterfly structure.

The authors then evaluate the privacy-preserving capabilities of these sparse networks against MIAs using a "shadow model" approach. This involves training a separate "shadow" network on similar data and using it to train a discriminator model. This discriminator is then used to attack the target network.

Datasets

The experiments were conducted on the CIFAR-10 dataset, a standard benchmark for image classification. The dataset was partitioned into target and shadow training and testing sets, each containing 15,000 images. A subset of 1,000 images from each training set was used for hyperparameter tuning and early stopping.

Key Insights and Ideas

  • Sparsity as a Privacy Shield: The most significant finding is that increasing sparsity directly correlates with improved defense against membership inference attacks. This suggests that a less "memorized" network is inherently more private.
  • Accuracy-Preserving Sparsity: Crucially, this privacy improvement doesn't come at a steep cost to accuracy. The paper demonstrates that networks can achieve a good trade-off between privacy and performance.
  • Butterfly Sparsity's Potential: The structured "butterfly" sparsity shows promise, achieving comparable privacy-accuracy trade-offs to unstructured pruning, even though its structure is fixed beforehand and independent of the data. This is particularly interesting for potential hardware acceleration.
  • Beyond 50% Sparsity: The paper highlights that significant privacy gains are observed at sparsity levels below 20%, and the trend becomes less clear or even detrimental at higher sparsity levels for the specific model and dataset used.

Key Results

  • For ResNet-20 on CIFAR-10, a relative loss of p% in accuracy (compared to a dense network) led to a relative gain of 3.6 × p% in defense against MIAs, for sparsity levels between 3.4% and 17.3%.
  • The defense level against MIAs was quantified using a metric where 50% accuracy for the discriminator means random guessing (no defense), and higher values indicate better defense.
  • Butterfly networks with sparsity levels as low as 8.5% (e.g., Butterfly (S=3, L=3)) showed competitive results.
  • The standard deviations reported suggest that while the trend is promising, larger-scale experiments might be needed for definitive conclusions.

Limitations and Future Work

  • Standard Deviations: The authors acknowledge that the standard deviations in their results suggest that larger-scale experiments are necessary to confirm the observed trends definitively.
  • Limited Scope: The study was conducted on a specific model (ResNet-20) and dataset (CIFAR-10). Extending the experiments to a wider range of models, datasets, and attack types would strengthen the findings.
  • No Theoretical Guarantees: Unlike methods like Differentially Private Stochastic Gradient Descent (DP-SGD), the privacy benefits of sparsity in this work do not come with theoretical guarantees.
  • Future Directions: The authors suggest exploring sparsity as a baseline defense mechanism due to its lower computational cost, independence from knowing the attack type beforehand, and potential for hardware acceleration with structured sparsity. They also propose investigating how sparsity might interact with other privacy-enhancing techniques.

Summary updated

BibTeX
@misc{gonon2023sparsity,
  author = {Antoine Gonon and Léon Zheng and Clément Lalanne and Quoc-Tung Le and Guillaume Lauga and Can Pouliquen},
  title = {{Sparsity in neural networks can improve their privacy}},
  year = {2023},
  eprint = {2304.10553},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.10553},
}
Figure