Does Synthetic Class Balancing Hide or Expose Federated Clients?

In federated learning, hospitals or phones train a shared model without sending their raw data. Each client sends only a model update, a gradient, computed on its own examples. Two problems are usually studied apart. First, clients hold skewed data: one hospital sees mostly pneumonia and another mostly normal scans. The fix that has recently worked best is to hand clients synthetic examples of the classes they are missing. Second, the gradients themselves leak. An eavesdropping server can run gradient inversion: it searches for an input whose gradient matches the one it received, and it recovers recognizable training images. This works especially well when the search is restricted to the outputs of a pretrained image generator.

These two problems meet inside the same training batch, and nobody has looked at what happens there. When a client mixes synthetic examples into its batch, the update it sends is a sum over real and fake examples. That mixing might hide the real examples. It might instead do nothing, because the server made the fake examples and can subtract their contribution. This note proposes to measure which of the two happens against the strongest generator-based attacks. It then proposes a cheap selection rule, run on the client, that picks the synthetic examples so they correct the class skew and also cover the gradient directions of the real examples. The one ingredient that decides whether the idea holds up is that the client's selection stays private from the server.

Core Claim

Wu et al. show in Concealing Sensitive Samples against Gradient Leakage in Federated Learning that inversion exploits low entanglement. When the gradients of individual examples in a batch point in nearly orthogonal directions, an attacker can separate them and invert each one. Label-skewed clients are close to the worst case, because a batch dominated by one or two classes yields a few isolated gradient directions.

Methods that balance classes with synthetic data inject examples that change this geometry. Three lines of work do this. FedDPMS shares noisy latent class means and decodes them with a shared variational autoencoder. FedPDG generates missing-class images on the server with Stable Diffusion. FedGen broadcasts a server-trained generator of feature vectors. All three treat synthesis purely as an aid to optimization.

Our claim has two parts, and both can be falsified. The first is that naive synthetic balancing gives essentially no protection against a server that knows the generator. The synthetic examples lie exactly on the attacker's prior, so their gradients can be identified and subtracted. The second is that protection appears only when the client chooses synthetic examples by a private, gradient-aware rule, because the server then cannot reproduce which examples entered the batch.

If the first part fails and naive mixing already protects clients, the design is unnecessary and the measurement becomes the contribution. If the second part fails, synthetic balancing should be advertised only as a utility tool. The papers above that treat shared latents or distorted synthetic images as inherently private would then need auditing, as the tension around FedVTC and FedGen already suggests.

Research Program

The first component is an attack that current evaluations do not include. We call it subtract-then-invert. The server knows the pool of synthetic candidates it distributed. It first explains as much of the received update as possible using gradients of pool candidates, by sparse non-negative least squares over candidate gradients computed at the current weights. It removes that part and runs a generator-prior inversion on the residual. The inversion methods are GIAS from Gradient Inversion with Generative Image Prior, which searches a StyleGAN latent space and then fine-tunes the generator, and GGL from Auditing Privacy Defenses in Federated Learning via Generative Gradient Leakage, which uses gradient-free latent search and models the defense explicitly. We also use feature-domain inversion as in GIFD.

We test three attacker knowledge levels. At the first, the server knows the pool only. At the second, it knows the pool and the selection rule. At the third, it knows everything except the client's private random seed and its real data.

The second component is the defense, which we call entangled selection. The server supplies a synthetic pool for each class. We will use a shared decoder in the style of FedDPMS for small images and a FedPDG-style diffusion pool for natural images. Each client jitters pool latents using a private seed, which gives it candidates the server has never seen. It then picks, under per-class quotas that fix the label skew, the candidates whose gradients best cover the gradients of its real examples.

To keep the cost low, we score candidates with last-layer gradients only. For a softmax classifier these have a closed form: the difference between predicted and true label probabilities, multiplied by the penultimate features. No extra backward pass is needed. Write $g_i$ for the last-layer gradient of real example $i$, $s_j$ for that of candidate $j$, $S$ for the chosen set, and $q_c$ for the quota of missing class $c$. The client solves greedily

$$\max_{S}\ \sum_{i} \max_{j \in S} \cos(g_i, s_j) \quad \text{subject to } |S \cap \text{class } c| = q_c,$$

which is a coverage objective that greedy selection approximates well. The chosen examples enter the batch with weights set by the private seed.

The contrast with the decoy defenses is deliberate. DCS² and Refiner run an optimization for each sensitive example to build a decoy. The decoy mimics that example's gradient, and neither method corrects label skew. Entangled selection performs no optimization for each example. It reuses synthetic data that the client needs for accuracy anyway.

The third component is the analysis. We will track an entanglement statistic for each round: the effective rank of the batch's per-example gradient matrix. We will check whether this statistic predicts reconstruction quality across the skew levels, batch sizes and augmentation schemes.

Baselines

The naive reference point is plain federated averaging (FedAvg) under Dirichlet label skew, with no augmentation and no defense. It fixes the undefended accuracy and the undefended leakage. The file reports undefended MNIST reconstruction at 59.20 dB PSNR, from the DCS² paper.

The strongest utility competitors are FedDPMS and FedPDG with their own random or loss-based choice of synthetic examples. FedDPMS reports +4.5% accuracy over FedAvg on CIFAR-10 at Dirichlet β=0.5 (FedDPMS). FedPDG reports up to +3.82% on CIFAR-10. These are the right competitors because they are the obvious way to fix skew, and our first claim says they leak. We run them with the same pool, the same number of synthetic examples per batch, and the same number of rounds.

The strongest privacy competitor is DCS² stacked on top of FedDPMS-style balancing. It is the best client-side synthetic defense in the file, reporting SSIM 0.15 on CIFAR-10 and 65.68% TinyImageNet accuracy against Soteria's 52.06%. The file does not say whether those numbers were measured against generator-prior attacks. For Refiner, no reported result on CIFAR-10 was found on Lacuna for a comparable metric, so we will run it ourselves and treat it as a second privacy competitor. The formal-privacy competitor is Fed-CDP from Gradient-Leakage Resilient Federated Learning, which adds per-example clipping and noise during local training. It reports 97.48% on MNIST against 97.98% non-private and 87.2% for server-side noise.

Every method receives the same local epochs and batch sizes, and the same hyperparameter search budget of equal trials per method. We also report client wall-clock time and memory.

Two ablations isolate the key ingredient. The first uses random selection with the same count and quotas, which separates gradient-aware selection from mere mixing. The second uses entangled selection with a public seed, which separates private selection from coverage. Beating the competitors means one of two outcomes against subtract-then-invert GIAS and GGL at the second knowledge level:

  1. Matching FedDPMS/FedPDG accuracy within one point while cutting attribute leakage to near chance.
  2. Matching DCS²-plus-balancing leakage at a fraction of its client compute.

Why not just…?

Why not just use differential privacy, as Fed-CDP does? Fed-CDP's MNIST result is strong, and noise added to each example is the only option here with a formal guarantee. It is therefore a real threat. The file gives no evidence on how its noise interacts with severe label skew, and GGL reports recognizable semantic leakage even under noise defenses. We will run Fed-CDP alone and Fed-CDP combined with entangled selection at matched privacy budgets under β=0.1. If Fed-CDP alone reaches equal accuracy and equal attribute leakage, our privacy claim reduces to a utility claim, and we will report it that way.

Why not just enlarge the batch, with more real data or random synthetic samples? GIAS reconstructs images at batch size 32 with fidelity comparable to pixel attacks at batch size 4. It reports 15.58 dB PSNR against 13.78 dB for pixel-space search. So batch size alone is known to fail against generator priors. The random-selection ablation and a real-data batch-enlargement control test this directly.

Why not just stack FedPDG with DCS² or Refiner? This stack is our strongest composite baseline. Its cost is the optimization DCS² and Refiner run for every sensitive example on the client. It is also untested against generator-prior attacks. If it matches us on leakage at acceptable cost, our contribution narrows to a cheaper version of it.

Why not just rely on secure aggregation, which hides individual updates? It is complementary. It does not help when a round contains few clients, as in cross-silo hospital settings, or when the server is active and manipulates the weights it sends. No reported result on Lacuna covers it in this setting, so we include only a small-cohort experiment.

Proposed Experiments

The data are CIFAR-10, CIFAR-100 and TinyImageNet under Dirichlet skew with β ∈ {1.0, 0.5, 0.1}, and CelebA with clients skewed by attribute. The models are ConvNet and ResNet18, with batch sizes 8 to 64.

Leakage is measured by PSNR, SSIM and LPIPS of the best reconstruction. Following GGL's point that meaning leaks even when pixels do not, we also measure semantic leakage: the accuracy of a fixed attribute or class classifier applied to the reconstructions. Utility is measured by final accuracy and rounds to target accuracy, and cost by client time and memory.

The first decisive check is whether FedDPMS/FedPDG-style mixing leaves attribute leakage under subtract-then-invert unchanged relative to FedAvg. The second is whether the private-seed ablation collapses our protection back to that level. The third is whether gradient effective rank predicts leakage across all conditions. If all three hold, synthetic balancing should be deployed with private, entanglement-aware selection, and never assumed to be private by default.