AdversarialRobustnessConfiguration<T, TInput, TOutput>

Options & Configuration · AiDotNet.Models.Options

Configuration for adversarial robustness and AI safety during model building and inference.

Known derived types: AdversarialRobustnessConfiguration<T>

For Beginners

This is your complete safety and robustness configuration. You can enable/disable features, customize options, or provide your own implementations. All settings have sensible defaults based on industry best practices.

How It Works

This configuration controls all aspects of adversarial robustness and AI safety, replacing the previous SafetyFilterConfiguration with a unified approach that includes:

  • Safety filtering (input/output validation)
  • Adversarial attacks and defenses
  • Certified robustness
  • Content moderation
  • Red teaming

Constructors

Constructor Summary
AdversarialRobustnessConfiguration()

Properties

Property Summary
AdversarialRobustnessOptions<T> Options { get; set; } Gets or sets the robustness options.
IAdversarialAttack<T, TInput, TOutput>[] CustomAttacks { get; set; } Gets or sets custom adversarial attack implementations.
IAdversarialDefense<T, TInput, TOutput> CustomDefense { get; set; } Gets or sets a custom adversarial defense implementation.
ICertifiedDefense<T, TInput, TOutput> CustomCertifiedDefense { get; set; } Gets or sets a custom certified defense implementation.
IContentClassifier<T> CustomContentClassifier { get; set; } Gets or sets a custom content classifier implementation.
ILogger Logger { get; set; } Gets or sets the logger for the robustness build steps.
ISafetyFilter<T> CustomSafetyFilter { get; set; } Gets or sets a custom safety filter implementation.
bool AutoGenerateModelCardSections { get; set; } Gets or sets whether to auto-generate robustness sections in the model card.
bool Enabled { get; set; } Gets or sets whether adversarial robustness features are enabled.
bool IncludeRobustnessInEvaluation { get; set; } Gets or sets whether to include robustness evaluation in model evaluation.
bool IncludeRobustnessMetrics { get; set; } Gets or sets whether to include robustness metrics in prediction results.
bool RejectNonRobustPredictions { get; set; } Gets or sets whether to reject predictions that don’t meet the minimum certified radius.
bool UseCertifiedInference { get; set; } Gets or sets whether to apply certified inference during prediction.
double MinimumCertifiedRadius { get; set; } Gets or sets the minimum certified radius required for a prediction to be considered robust.
double RobustnessEvaluationSampleRatio { get; set; } Gets or sets the percentage of test data to use for robustness evaluation.
double[] EvaluationEpsilons { get; set; } Gets or sets the epsilon values to test during robustness evaluation.
string ModelCardRobustnessNotes { get; set; } Gets or sets custom model card robustness notes.

Methods

Method Summary
AdversarialRobustnessConfiguration<T, TInput, TOutput> BasicSafety() Creates a configuration with basic safety filtering only.
AdversarialRobustnessConfiguration<T, TInput, TOutput> Comprehensive() Creates a configuration with comprehensive robustness features.
AdversarialRobustnessConfiguration<T, TInput, TOutput> Disabled() Creates a disabled configuration (no robustness features).
AdversarialRobustnessConfiguration<T, TInput, TOutput> ForLLM() Creates a configuration optimized for LLM safety.
AdversarialRobustnessConfiguration<T, TInput, TOutput> WithAdversarialTraining() Creates a configuration focused on adversarial training.
AdversarialRobustnessConfiguration<T, TInput, TOutput> WithCertification(CertifiedDefenseMethod certificationMethod) Creates a configuration with certified robustness guarantees.