ICertifiedDefense<T, TInput, TOutput>

Interfaces · AiDotNet.Interfaces

Defines the contract for certified defense mechanisms that provide provable robustness guarantees.

Implements: IModelSerializer

Known implementations: AdaptiveRandomizedSmoothing<T, TInput, TOutput>, CROWNVerification<T, TInput, TOutput>, IntervalBoundPropagation<T, TInput, TOutput>, RandomizedSmoothing<T, TInput, TOutput>

How It Works

Certified defenses provide mathematical guarantees that a model’s predictions won’t change within a specified perturbation radius, unlike heuristic defenses.

For Beginners: Think of certified defenses as “guaranteed protection” for your model. While regular defenses make models harder to fool, certified defenses can mathematically prove that no attack within certain limits can trick the model.

Common certified defense methods include:

  • Randomized Smoothing: Uses random noise to create certified predictions
  • Interval Bound Propagation: Tracks ranges of possible values through the network
  • CROWN: Computes certified bounds for neural network outputs

Why certified defenses matter:

  • They provide provable security guarantees
  • They’re essential for safety-critical applications
  • They help meet regulatory requirements
  • They give confidence bounds for predictions

Methods

Method Summary
CertifiedAccuracyMetrics<T> EvaluateCertifiedAccuracy(TInput[] testData, TOutput[] labels, IFullModel<T, TInput, TOutput> model, T radius) Evaluates certified accuracy on a dataset.
CertifiedDefenseOptions<T> GetOptions() Gets the configuration options for the certified defense.
CertifiedPrediction<T> CertifyPrediction(TInput input, IFullModel<T, TInput, TOutput> model) Computes a certified prediction with robustness guarantees.
CertifiedPrediction<T>[] CertifyBatch(TInput[] inputs, IFullModel<T, TInput, TOutput> model) Computes certified predictions for a batch of inputs.
T ComputeCertifiedRadius(TInput input, IFullModel<T, TInput, TOutput> model) Computes the maximum perturbation radius that can be certified for an input.
void Reset() Resets the certified defense state.