Integration of Certified Defense Methods (Randomized Smoothing) #86
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Integration of Certified Defense Methods (Randomized Smoothing) - Addresses #85
Overview
This PR implements the first iteration of probabilistic certified defense methods, specifically Randomized Smoothing, into VERONA as outlined in issue #85. The implementation extends VERONA's
EpsilonValueEstimatorandVerificationModuleabstract classes to support certification with configurable sampling rates, smoothing levels, and confidence parameters.Changes Made
New Components
1.
ProbabilisticCertificationResult(robustness_experiment_box/database/verification_result.py)to_dict()andfrom_dict()methods for serialization2.
RandomizedSmoothingModule(robustness_experiment_box/verification_module/randomized_smoothing_module.py)VerificationModuleabstract base classverify_probabilistic()→ returnsProbabilisticCertificationResult_perform_randomized_smoothing()orchestrates the certification process:_sample_noise()- generates Gaussian noise samples_apply_diffusion_denoising()- placeholder for DDS integration (TODO)_lower_confidence_bound()- computes statistical confidence bounds3.
RandomizedSmoothingEstimator(robustness_experiment_box/epsilon_value_estimator/randomized_smoothing_estimator.py)EpsilonValueEstimatorabstract base classcompute_epsilon_value()- bridges to classicalEpsilonValueResultformatget_probabilistic_result()- returnsProbabilisticCertificationResultusingRandomizedSmoothingModule4. Extended VerificationModule Interface (
robustness_experiment_box/verification_module/verification_module.py)VerificationModuleclass5. Example Script (
scripts/randomized_smoothing_example.py)Implementation Details
This implementation follows Option A: Full Integration as discussed in #85, providing:
epsilon_value_result.pyAlgorithm Support
Randomized Smoothing (Cohen et al.)
Diffusion Denoised Smoothing (Carlini et al.)
_apply_diffusion_denoising()placeholderNotes on Integration with VERONA
EpsilonValueEstimatorandVerificationModuleinterfacesTesting
Future Work
This is the first iteration of the Randomized Smoothing integration. Future iterations include:
References
Files Changed
robustness_experiment_box/epsilon_value_estimator/randomized_smoothing_estimator.py(new)robustness_experiment_box/verification_module/randomized_smoothing_module.py(new)robustness_experiment_box/verification_module/verification_module.py(extended)robustness_experiment_box/database/verification_result.py(new)scripts/randomized_smoothing_example.py(new)Addresses #85 (First iteration - issue remains open for future updates)