Questions tagged [cleverhans]

CleverHans is a Python library to benchmark machine learning systems' vulnerability to adversarial examples.

CleverHans is built on top of .

Resources

49 questions
1
vote
1 answer

'RandomForestClassifier' object has no attribute 'layers'

I'm trying to attack my random forest classifier. clf = RandomForestClassifier(max_features="sqrt", n_estimators=500, n_jobs=-1, verbose=1, warm_start=True) clf.fit(X_train, y_train) After this definition I do my predictions and after that I did…
Jeredriq Demas
  • 616
  • 1
  • 9
  • 36
1
vote
1 answer

Installing cleverhans on Colaboratory

I am trying to install cleverhans (https://github.com/tensorflow/cleverhans) I am running the following command !pip install -q -e git+http://github.com/tensorflow/cleverhans.git#egg=cleverhans However, when I try to do import cleverhans I get an…
gokul_uf
  • 740
  • 1
  • 8
  • 21
0
votes
0 answers

`labels.shape` must equal `logits.shape` except for the last dimension. Received: labels.shape=(19,) and logits.shape=(1, 19)

I am using FGSM attack using cleverhans. My code is as follows: logits_model = tf.keras.Model(model_1.input, model_1.layers[-1].output) target_label = tf.one_hot(3, depth=19) adv_sample = fast_gradient_method.fast_gradient_method(logits_model, x,…
0
votes
0 answers

cleverhans - tf2 implementation of momentum_iterative_method has an inconsistency with the algorithm from the paper

tf2 implementation of momentum_iterative_method: line 93 of momentum_iterative_method.py use “tf.math.reduce_mean(tf.math.abs(grad), red_ind, keepdims=True)” for updating the grad. but in the paper: Algorithm 1 uses L1 norm (reduce_sum()). So, is…
0
votes
1 answer

cleverhans, tf2, fgsm - how can i pass my LSTM regression model to the fast gradient method function in cleverhans? (logits)

i built and trained my LSTM model for a regression task and everything works fine. i would like to use the fast_gradient_method function from cleverhans (or any other cleverhans function as the issue stands for any other attack). i don't understand…
khada
  • 1
  • 2
0
votes
1 answer

ModuleNotFoundError: No module named 'cleverhans.future'

I'm trying to install cleverhans package on Google Colab and currently getting an error for ModuleNotFoundError: No module named 'cleverhans.future' Code Attempted: !pip install -qq -e…
maximus
  • 335
  • 2
  • 16
0
votes
0 answers

cleverhans module not found

i am ruining below code, but it show me an error. i tried different methods to install cleverhans, it get installed but still show error. Install bleeding edge version of cleverhans !pip install…
0
votes
0 answers

CleverHans is incompatible with Tensorflow Addons

I have been trying to use CleverHans (https://github.com/tensorflow/cleverhans). Background I ran this file here - https://github.com/tensorflow/cleverhans/blob/master/cleverhans_tutorials/mnist_tutorial_tf.py, with Python 3.7.6 and TensorFlow…
0
votes
1 answer

Question on ElasticNet algorithm implemented in Cleverhans

I'm trying to use the Elastic-Net algorithm implemented in Cleverhans to generate adversarial samples in a classification task. The main problem is that i'm trying to use it in a way to obtain an higher confidence at classification time on a target…
0
votes
1 answer

Install cleverHans on windows

I hope all of you are doing Great. I need to install cleverhans on windows for some project but once installed it was unable to access any python file in there and I got a lot of errors like: in 10…
0
votes
1 answer

Difference between adversarial training/perturbation with FGSM in Tensorflow nsl versus cleverhans

I've implemented what I believe to be the same model training loop in both TensorFlow's neural structured learning (nsl) and the cleverhans library, and curiously, they show that models trained using adversarial training with the two libraries (via…
jpgard
  • 653
  • 7
  • 15
0
votes
0 answers

How to solve what(): std::bad_alloc error with cleverhans on GPU

After training this neural network Input -> [[Conv2D->relu]*2 -> MaxPool2D -> Dropout]*2 -> Flatten -> Dense -> Dropout -> Output on MNIST data using keras I am trying to generate adversarial examples using cleverhans. However I am always getting…
0
votes
0 answers

AttributeError : 'Conv2D' object has no attribute 'get_config'

I'm trying to run fgsm attack on mnist dataset. I'm getting 'object has no attribute' error: I used: python 2 (in google colab) Keras==2.1.3 tensorflow==1.14.0 I also run it with keras==1.2 and keras==2.1.5 , I also chenged get_config into…
au.tumn
  • 29
  • 5
0
votes
1 answer

cleverhans - clip_min, clip_max when they vary by channels

cleverhans has clip_min and clip_max to make sure that the perturbed data is still within the valid range. This works fine, e.g. if I'm working with an image where the range of values in the matrix is 0-255 or 0-1. However, when the range differs on…
alpaca
  • 1,211
  • 13
  • 23
0
votes
1 answer

How to change the Cleverhans 'test_imagenet_attacks.py' with tensorflow sess?

In Cleverhans example: cleverhans/examples/test_imagenet_attacks.py They implement SPSA attack with sess=None. But in Cleverhans attacks repo, there are a lot of methods cannot set sess as None, for example, CW, DeepFool, BFGS... How to change the…