LabelDifferentialPrivacy<T>
Models & Types · AiDotNet.FederatedLearning.Vertical
Implements differential privacy protection for label holder gradients in VFL.
Inheritance: FederatedLearningComponentBase<T> → LabelDifferentialPrivacy<T>
Implements: ILabelProtector<T>
For Beginners
In VFL, the label holder (e.g., a hospital knowing patient outcomes) sends gradients back to feature parties (e.g., a bank knowing income). Without protection, the bank could analyze gradient patterns to figure out which patients had bad outcomes.
How It Works
This class adds calibrated Gaussian noise to the gradients before they’re shared. The noise is carefully sized so that even a sophisticated attacker cannot reliably distinguish whether a specific individual’s data was used, providing differential privacy guarantees.
Privacy accounting: Uses the Gaussian mechanism with Renyi Differential Privacy (RDP) composition to track cumulative privacy loss across epochs. When the budget is exhausted, training must stop.
Reference: Abadi et al., “Deep Learning with Differential Privacy”, ACM CCS 2016.
Constructors
| Constructor | Summary |
|---|---|
LabelDifferentialPrivacy(double epsilon, double delta, double maxGradientNorm, int? seed) |
Initializes a new instance of LabelDifferentialPrivacy. |
Methods
| Method | Summary |
|---|---|
T ProtectLoss(T loss) |
|
Tensor<T> ProtectGradients(Tensor<T> gradients) |
|
ValueTuple<double, double> GetPrivacyBudgetSpent() |