Closed sayakpaul closed 3 years ago
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
@csferng,
Please run pylint to format the code into TensorFlow style (instruction here).
I have followed most of the instructions I got from the linter barring a few exceptions:
scripts/analyze.py
directly comes from here without any change (with citation of course). This is why I have kept it intact. models/resnet20.py
comes from here with the license attached. Apart from these, I could not resolve the following:
scripts/certification_utils.py:57:4: R1705: Unnecessary "else" after "return" (no-else-return)
scripts/certification_utils.py:82:4: R1705: Unnecessary "else" after "return" (no-else-return)
scripts/certify.py:14:0: W9008: Redundant returns documentation (redundant-returns-doc)
scripts/certify.py:30:2: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
scripts/certify.py:37:2: C0200: Consider using enumerate instead of iterating with range and len (consider-using-enumerate)
scripts/certify.py:57:4: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
models/dncnn.py:27:13: R1719: The if expression can be replaced with 'bool(test)' (simplifiable-if-expression)
Also, I was checking some of the modules under research
and I felt they do not strictly follow tensorflow/tools/ci_build/pylintrc
(such as type annotation, trailing newline, etc.).
@csferng I am happy to change it to Apache. Please advice.
@sayakpaul, sorry that I didn't make my point clear. Since Google does not own the copyright to those code, please move the directory to research/third_party/denoised_smoothing
. Either MIT or Apache 2.0 license is fine, and you can choose one you'd like.
@csferng done.
@csferng could you provide an update on the progress of the PR?
@csferng just wanted to see if an update is available for this PR.
@sayakpaul Sorry for the delay. The PR is merged now.
This PR adds Denoised Smoothing under the
research
folder.The success of Randomized Smoothing is proven and it works for many different scenarios. But it also operates under the assumption that the underlying classifier is able to perform well under Gaussian perturbations. Won't it be better if we could just take our standard pre-trained image classifiers (including the Cloud APIs) and have the benefits of Randomized Smoothing inside of them in an easy manner?
That is preciously what Denoised Smoothing does by prepending a Denoiser to an image classifier and still maintains the theoretical guarantees of robustness against L2 attacks.
Besides, the implementation includes a suite of utilities that may be helpful to generate robustness certificates. I think that gives us a unique opportunity to actually design an API inside NSL that would allow easy generation of robustness certificates. To the best of my knowledge, there does not exist any such framework as we speak.