ShuffleModelDP<T>
Models & Types · AiDotNet.FederatedLearning.Privacy
Implements Shuffle Model Differential Privacy for federated learning.
Inheritance: FederatedLearningComponentBase<T> → PrivacyMechanismBase<Dictionary<string, T[]>, T> → ShuffleModelDP<T>
For Beginners
In standard local DP, each client adds a lot of noise to their update before sending it (because the server sees individual updates). In shuffle model DP, a trusted shuffler randomly permutes the updates before the server sees them. Because the server can’t link updates to specific clients, each client needs to add much less noise — achieving central-DP-level accuracy with local-DP trust assumptions.
How It Works
Privacy amplification by shuffling:
Protocol:
Reference: Balle, B., Bell, J., & Gascon, A. (2019). “The Privacy Blanket of the Shuffle Model.” Crypto 2019.
Constructors
| Constructor | Summary |
|---|---|
ShuffleModelDP(double localEpsilon, int seed, double clipNorm) |
Creates a new Shuffle Model DP mechanism. |
Properties
| Property | Summary |
|---|---|
double ClipNorm { get; } |
Gets the fixed sensitivity bound C each update is clipped to. |
double LocalEpsilon { get; } |
Gets the local epsilon value. |
Methods
| Method | Summary |
|---|---|
Dictionary<string, T[]> AggregateShuffled(List<Dictionary<string, T[]>> shuffledUpdates) |
Aggregates shuffled, anonymized updates by simple averaging. |
Dictionary<string, T[]> ApplyPrivacy(Dictionary<string, T[]> model, double epsilon, double delta) |
|
List<Dictionary<string, T[]>> ApplyLocalDPAndShuffle(Dictionary<int, Dictionary<string, T[]>> clientUpdates, double delta) |
Applies local DP noise to each client’s update and then shuffles the collection. |
List<Dictionary<string, T[]>> ShuffleAndAnonymize(Dictionary<int, Dictionary<string, T[]>> clientUpdates) |
Shuffles a collection of client updates, removing the association between client IDs and their updates. |
double ComputeEffectiveEpsilon(int numClients, double delta) |
Computes the effective central epsilon after shuffling n clients using the tight bound from Balle, Bell, and Gascon (2019). |
double GetPrivacyBudgetConsumed() |
|
int ComputeMinClientsNeeded(double targetEpsilon, double delta) |
Computes the minimum number of clients needed to achieve a target central epsilon. |
string GetMechanismName() |