Shadow defense against gradient inversion attack in federated learning

Le Jiang, Liyan Ma, Guang Yang

TL;DR

This paper introduces a novel defense mechanism against gradient inversion attacks (GIAs) in federated learning (FL). By leveraging a "shadow model" to interpret sensitive image regions, the proposed method selectively injects noise, effectively protecting patient privacy in medical images without significantly compromising model accuracy. This approach offers a more targeted and efficient defense compared to existing methods.

What Problem Does This Paper Address?

Federated learning (FL) enables collaborative training of machine learning models across decentralized devices without sharing raw data, which is crucial for privacy-sensitive domains like healthcare. However, FL is still vulnerable to privacy attacks, particularly Gradient Inversion Attacks (GIAs). GIAs aim to reconstruct original training data from model updates (gradients) shared by clients. Existing defense mechanisms often apply indiscriminate noise or perturbations, leading to a trade-off between privacy protection and model performance. They also lack a nuanced understanding of which parts of the data are most vulnerable, making their defenses either too aggressive (hurting accuracy) or insufficient. This paper addresses the need for a more targeted, interpretable, and effective defense against GIAs in FL, especially for medical imaging.

Methods

The core of the proposed defense framework lies in a two-stage process: pre-training and federated training.

  1. Pre-training: A "shadow model" (a GAN) is pre-trained on a public dataset. This model is then further trained at a sample level to fit low-frequency image components. This stage helps the shadow model learn to generate realistic-looking images and understand image structures, preparing it to mimic an adversary.
  2. Federated Training:
    • Pseudo Local Training: Clients perform a "pseudo-update" on their local models to generate gradients that simulate potentially leaked information.
  3. Pseudo Fine-tuning of Shadow Model: The pre-trained shadow model is fine-tuned using these pseudo-gradients. This step allows the shadow model to act as a simulated adversary, reconstructing images.
  4. Interpretability and Noise Generation: Grad-CAM++ is used to identify "task-dominant" regions in the images. The reconstructed images from the shadow model are then used to generate noise maps. These maps are designed to be weaker in task-dominant regions (to preserve accuracy) and stronger in privacy-sensitive regions.
  5. Noise Application: The generated noise is applied to the original local training images before the actual local model update. This noise injection disrupts the mapping between gradients and sensitive image information.
  6. Shadow Model Update: The shadow model is updated using a momentum strategy to maintain its ability to mimic adversaries over time.

This approach aims to break the link between gradients and sensitive image data by understanding where the privacy risk lies, rather than just applying generic noise.

Datasets

The paper evaluates its method on two medical image datasets:

  • ChestXRay: A dataset of chest X-ray images.
  • EyePACS: A dataset of retinal fundus images.

The authors also mention experiments on the VGGFace2 dataset for non-medical images and the prostate MRI dataset for segmentation tasks, though detailed results for these are primarily in the supplementary materials.

Key Insights and Ideas

  • Interpretable Privacy Defense: The key innovation is using a shadow model (GAN) not just to reconstruct images, but to interpret which parts of the image are most sensitive to privacy leakage, guided by task-dominant regions identified via Grad-CAM++.
  • Targeted Noise Injection: Instead of uniform noise, the defense selectively applies noise based on the interpretability of sensitive areas, balancing privacy and utility.
  • Shadow Model as Adversary Mimic: The shadow model acts as a simulated adversary, allowing the defense to be tailored to anticipate potential attacks.
  • Dynamic Defense: The defense strategy adapts by considering the training dynamic and the increasing accuracy of BN statistics in adversaries' attacks.
  • Generalizability: The framework demonstrates effectiveness across different medical imaging modalities (X-ray, fundus), different GIA types (model-based, optimization-based), and even for image segmentation tasks.

Key Results

  • Improved Privacy Protection: The proposed method achieves significant improvements in privacy protection metrics (e.g., PSNR, SSIM) compared to SOTA methods, particularly in foreground (sensitive) regions. For instance, it achieves discrepancies of 3.73 in PSNR and 0.2 in SSIM on ChestXRay compared to the non-defended case.
  • Minimal Task Performance Degradation: The defense results in less than a 1% F1 reduction compared to SOTA methods, demonstrating a strong balance between privacy and utility.
  • Robustness: The defense is effective against various GIA types and across different clients, even those with limited data.
  • Computational Efficiency: While involving a shadow model, the pre-training and fine-tuning strategy is designed to be computationally efficient, especially compared to methods requiring extensive gradient manipulation.

Limitations and Future Work

  • Non-Medical Image Performance: The paper notes that while the method can be applied to non-medical images (like faces), the task performance drop is significant. This suggests that the sensitivity of key attributes in non-medical data to noise is higher, posing a challenge for future work.
  • Large Datasets and Foundational Models: The authors suggest further exploration into the efficiency of their method for accommodating very large datasets and foundational models.
  • Few-Shot Learning Scenarios: Applicability in few-shot learning scenarios is also mentioned as a future research direction.
  • Defense Against Analytics-based GIA: While the paper briefly touches upon analytics-based GIA, it notes that training can fail to converge with certain parameters, indicating that further research is needed for robust defense against these specific attack types.

Summary updated

Abstract

Federated learning (FL) has emerged as a transformative framework for privacy-preserving distributed training, allowing clients to collaboratively train a global model without sharing their local data. This is especially crucial in sensitive fields like healthcare, where protecting patient data is paramount. However, privacy leakage remains a critical challenge, as the communication of model updates can be exploited by potential adversaries. Gradient inversion attacks (GIAs), for instance, allow adversaries to approximate the gradients used for training and reconstruct training images, thus stealing patient privacy. Existing defense mechanisms obscure gradients, yet lack a nuanced understanding of which gradients or types of image information are most vulnerable to such attacks. These indiscriminate calibrated perturbations result in either excessive privacy protection degrading model accuracy, or insufficient one failing to safeguard sensitive information. Therefore, we introduce a framework that addresses these challenges by leveraging a shadow model with interpretability for identifying sensitive areas. This enables a more targeted and sample-specific noise injection. Specially, our defensive strategy achieves discrepancies of 3.73 in PSNR and 0.2 in SSIM compared to the circumstance without defense on the ChestXRay dataset, and 2.78 in PSNR and 0.166 in the EyePACS dataset. Moreover, it minimizes adverse effects on model performance, with less than 1\% F1 reduction compared to SOTA methods. Our extensive experiments, conducted across diverse types of medical images, validate the generalization of the proposed framework. The stable defense improvements for FedAvg are consistently over 1.5\% times in LPIPS and SSIM. It also offers a universal defense against various GIA types, especially for these sensitive areas in images.
BibTeX
@article{jiang2025shadow,
  author = {Le Jiang and Liyan Ma and Guang Yang},
  title = {{Shadow defense against gradient inversion attack in federated learning}},
  journal = {Medical Image Analysis},
  year = {2025},
  doi = {10.1016/j.media.2025.103673},
}
Figure