Mixing Gradients in Neural Networks as a Strategy To Enhance Privacy in Federated Learning

Shaltiel Eloul, Fran Silavong, Sanket Kamthe, Antonios Georgiadis, Sean J. MoranWACV 2024

TL;DR

This paper proposes a novel privacy-enhancing technique for federated learning (FL) by strategically mixing gradients within a batch. By leveraging specific loss functions and label distributions, they demonstrate that this "gradient mixing" can significantly resist gradient inversion attacks without degrading model performance, offering a practical alternative to noise injection.

What Problem Does This Paper Address?

Federated learning (FL) is a promising approach for training machine learning models collaboratively across distributed devices without sharing raw data, thus preserving user privacy. However, FL is not inherently immune to privacy breaches. A significant threat comes from "gradient inversion attacks," where an adversary, by observing the gradients shared by clients with a central server, can potentially reconstruct sensitive information about the training data. Existing defenses, like adding noise to gradients, often come at the cost of reduced model accuracy. This paper addresses the need for effective privacy defenses in FL that can thwart gradient inversion attacks without compromising model performance.

Methods

The core of the paper's contribution lies in the "gradient mixing" strategy. Instead of directly sharing raw gradients, the authors propose manipulating how gradients are computed and aggregated within a client's batch.

  • Gradient Mixing through Loss Functions and Labels: They show that using specific loss functions (like Mean Squared Error instead of Cross-Entropy) and ensuring unique labels within a batch can inherently "mix" the gradients. This mixing makes it harder for an attacker to isolate and reconstruct individual data points from the aggregated gradients.
  • Approximate Direct Inversion: The paper analyzes the mathematical properties of gradients from dense linear layers, demonstrating that with unique labels, an approximate direct inversion of input data is possible. However, when gradients are mixed (e.g., through specific loss functions or label distributions), this direct inversion becomes significantly more difficult and error-prone.
  • Absolute Variation Distance (AVD) Metric: To quantitatively assess the success of inversion attacks, the authors introduce the Absolute Variation Distance (AVD) metric. This metric, derived from total variation, is proposed as a more robust indicator of information leakage than traditional metrics like Mean Squared Error, especially for sparse data like images.

Datasets

The paper uses the following datasets for evaluation:

  • MNIST: A dataset of handwritten digits, commonly used for image recognition tasks.
  • LFW (Labeled Faces in the Wild): A dataset of celebrity faces, used for face recognition tasks.

The authors use these datasets to evaluate their proposed defense strategy against various gradient inversion attacks, comparing its effectiveness with existing methods.

Key Insights and Ideas

  • Gradient Mixing as a Natural Defense: The most significant insight is that by carefully designing the training process (loss function, label distribution), gradients can be inherently mixed, providing a privacy defense without explicit noise addition.
  • De-mixing Property of Cross-Entropy: The paper highlights that the standard cross-entropy loss function, especially with unique labels, can exhibit a "de-mixing" property, making it more vulnerable to inversion attacks.
  • MSE as a Privacy-Enhancing Loss: The study suggests that using Mean Squared Error (MSE) as a loss function, particularly when combined with strategies that encourage label mixing, can significantly reduce the success rate of inversion attacks.
  • AVD as a Superior Leakage Metric: The introduction of the AVD metric provides a more nuanced way to evaluate information leakage, proving more effective than MSE or SSIM for datasets with sparse information.
  • Trade-off Between Privacy and Performance: A crucial finding is that their gradient mixing strategies can achieve enhanced privacy with minimal to no degradation in classification performance, a significant advantage over noise-based methods.

Key Results

  • Reduced Recovery Rates: The proposed gradient mixing strategies, particularly using MSE loss and/or equal labels in a batch, significantly reduced the recovery rates of input data from inversion attacks on both MNIST and LFW datasets.
  • Minimal Performance Degradation: Experiments showed that these privacy-enhancing strategies had a negligible impact on the classification accuracy of the models, both for single dense layers and convolutional neural networks (LeNET).
  • Effectiveness Against Various Attacks: The defense was evaluated against multiple gradient inversion attack types, demonstrating its general applicability.
  • CNN Vulnerability: While effective for dense layers and smaller CNNs, the paper notes that larger CNNs with many channels can become more vulnerable due to a higher ratio of unknowns to gradients, suggesting limitations for very deep architectures.

Limitations and Future Work

  • Limitations of Large CNNs: The paper acknowledges that for very large convolutional neural networks (e.g., ResNets with many channels), the effectiveness of gradient mixing might be reduced due to the increased complexity and number of unknowns relative to the number of gradients.
  • Future Work: The authors suggest exploring the combination of gradient mixing with minimal noise injection as a more robust defense for large models. They also express interest in further investigating the impact of mixing gradients on more complex architectures and exploring the AVD metric's potential in other privacy-preserving machine learning contexts.

Summary updated

BibTeX
@inproceedings{eloul2024mixing,
  author = {Shaltiel Eloul and Fran Silavong and Sanket Kamthe and Antonios Georgiadis and Sean J. Moran},
  title = {{Mixing Gradients in Neural Networks as a Strategy To Enhance Privacy in Federated Learning}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2024},
}
Figure