RobustnessStats<T>
Models & Types · AiDotNet.Models
Represents adversarial robustness diagnostics aggregated over a dataset.
For Beginners
This stores summary robustness metrics (like accuracy under attack) for an entire dataset, helping you understand how well your model resists adversarial perturbations.
Key concepts:
- Clean Accuracy: How accurate the model is on unmodified inputs
- Adversarial Accuracy: How accurate the model is when inputs are perturbed by attacks
- Certified Accuracy: The fraction of samples with provably correct predictions within a perturbation radius
- Attack Success Rate: How often an attacker can fool the model
- Average Perturbation Size: How much inputs need to be changed to fool the model
How It Works
This container is designed to integrate with the existing AiDotNet evaluation pipeline by living alongside
ErrorStats and PredictionStats within DataSetStats.
It stores metrics related to model robustness against adversarial attacks and certified defenses.
Constructors
| Constructor | Summary |
|---|---|
RobustnessStats() |
Properties
| Property | Summary |
|---|---|
AdversarialNormType NormType { get; set; } |
Gets the norm type used for measuring perturbation size. |
Dictionary<string, T> AdditionalMetrics { get; } |
Gets a dictionary of additional robustness metrics. |
T AveragePerturbationSize { get; set; } |
Gets the average size of perturbations needed to create successful adversarial examples. |
bool IsEvaluated { get; set; } |
Gets or sets whether robustness evaluation has been performed. |
double AdversarialAccuracy { get; set; } |
Gets the accuracy of the model on adversarially perturbed inputs. |
double AttackSuccessRate { get; set; } |
Gets the fraction of inputs for which the attack successfully fooled the model. |
double AverageCertifiedRadius { get; set; } |
Gets the average certified robustness radius across samples. |
double CertifiedAccuracy { get; set; } |
Gets the certified accuracy at the specified perturbation radius. |
double CleanAccuracy { get; set; } |
Gets the accuracy of the model on clean (unperturbed) inputs. |
double EvaluationEpsilon { get; set; } |
Gets the perturbation radius (epsilon) used for robustness evaluation. |
double RobustnessScore { get; set; } |
Gets a combined robustness score (0-1) that balances clean and adversarial performance. |
string AttackType { get; set; } |
Gets the type of attack used for adversarial robustness evaluation. |
Methods
| Method | Summary |
|---|---|
RobustnessStats<T> Empty() |
Creates an empty RobustnessStats instance. |