Table of Contents

Class RobustAggregationOptions

Namespace
AiDotNet.Models.Options
Assembly
AiDotNet.dll

Configuration options for robust aggregation strategies in federated learning.

public class RobustAggregationOptions
Inheritance
RobustAggregationOptions
Inherited Members

Remarks

Robust aggregation helps defend against outliers and Byzantine (malicious or faulty) clients.

For Beginners: If some clients send "bad" updates (because of bugs, corrupted data, or attacks), robust aggregation tries to reduce their impact so the global model stays stable.

Common strategies:

  • Trimmed mean: drops extreme values before averaging.
  • Median: takes the middle value per parameter (resistant to outliers).
  • Krum/Multi-Krum: chooses the most "central" client updates by distance.
  • Bulyan: combines Multi-Krum selection with trimming for stronger robustness.

Properties

ByzantineClientCount

Gets or sets the assumed number of Byzantine clients (f) for Krum/Multi-Krum/Bulyan.

public int ByzantineClientCount { get; set; }

Property Value

int

Remarks

For Beginners: If you think up to 2 clients per round might be malicious, set this to 2. These algorithms require enough participating clients for the math to be valid.

GeometricMedianEpsilon

Gets or sets a small epsilon used to avoid division-by-zero in RFA (Weiszfeld) updates.

public double GeometricMedianEpsilon { get; set; }

Property Value

double

GeometricMedianMaxIterations

Gets or sets the maximum number of iterations for geometric-median/RFA aggregation.

public int GeometricMedianMaxIterations { get; set; }

Property Value

int

GeometricMedianTolerance

Gets or sets the convergence tolerance for geometric-median/RFA aggregation.

public double GeometricMedianTolerance { get; set; }

Property Value

double

MultiKrumSelectionCount

Gets or sets how many client updates (m) Multi-Krum keeps before averaging.

public int MultiKrumSelectionCount { get; set; }

Property Value

int

Remarks

For Beginners: Multi-Krum first picks the "best" m client updates, then averages them. If set to 0 or less, a conservative default is chosen based on the number of clients and f.

TrimFraction

Gets or sets the trimming fraction for trimmed-mean based aggregations (0.0 to < 0.5).

public double TrimFraction { get; set; }

Property Value

double

Remarks

For Beginners: A trim fraction of 0.2 means "ignore the largest 20% and smallest 20% of values" when computing the mean for each parameter.

UseClientWeightsWhenAveragingSelectedUpdates

Gets or sets whether robust strategies should use clientWeights when averaging selected updates.

public bool UseClientWeightsWhenAveragingSelectedUpdates { get; set; }

Property Value

bool

Remarks

For Beginners: Using clientWeights (often sample counts) can improve accuracy, but it may reduce robustness if a malicious client can manipulate its weight. Default is false (unweighted).