advboxes / AdvBox

Advbox is a toolbox to generate adversarial examples that fool neural networks in PaddlePaddle、PyTorch、Caffe2、MxNet、Keras、TensorFlow and Advbox can benchmark the robustness of machine learning models. Advbox give a command line tool to generate adversarial examples with Zero-Coding.
Apache License 2.0
1.39k stars 265 forks source link

关于FeatureFqueezingDefence函数 #8

Closed CloudFlyCN closed 6 years ago

CloudFlyCN commented 6 years ago

您好!

最近在做Keras下的FGSM实验,发现KerasModel中有FeatureFqueezingDefence这个函数。

请问,这是表示默认情况下都会加入特征挤压防御嘛?如果只是想得到原始的模型,在KerasModel初始化时,把featurefqueezing_bit_depth设置为None,则scaled_data会跳过下列if语句:

`if self._featurefqueezing_bit_depth is not None:

logging.info(data)

        scaled_data=FeatureFqueezingDefence(data.copy(),None,self._featurefqueezing_bit_depth,self._bounds)
        #logging.info(scaled_data)`

进而出现未赋值的情况。

期待回复!谢谢!

duoergun0729 commented 6 years ago

featurefqueezing_bit_depth featurefqueezing防御算法 提高生成攻击样本的质量 为特征数据的bit位 一般8就ok了 可以看下我的这个文件

duoergun0729 commented 6 years ago

tutorials/imagenet_tutorial_fgsm_k.py