A Lightweight Data Leakage Defense Mechanism for Federated Learning Based on Stochastic Gradient Masking
摘要
Federated Learning (FL) enables decentralized model training without sharing raw data, however shared gradients can leak private inputs via inversion attacks. Traditional defenses either incur heavy overhead or degrade accuracy. We propose a novel Stochastic Gradient Masking (SGM) method that obfuscates individual client gradients without adding external noise. Each client randomly masks a fraction of their gradient coordinates and scales the remainder to preserve unbiasedness. This simple masking of gradient components is lightweight yet provably shields sensitive information: masked entries cannot be inferred by an adversary. We derive the mathematical basis of SGM, showing that the expected update equals the true gradient, and analyze its effect on convergence and privacy leakage. Empirically on CIFAR-10 and MNIST classification tasks, SGM closely matches the accuracy of standard FedAvg while significantly reducing leakage metrics, demonstrating that SGM is an effective, easy-to-implement defense against gradient inversion and similar attacks and offers a new trade-off point between privacy and utility in FL.