Tags: learning machine 

Rating:

Plot the weights of the neural network and you get the flag! Find more detail on ZenHack website

import numpy as np
import skimage
import matplotlib.pyplot as plt
import keras
from keras.models import load_model
from keras import backend as K

SHAPE = (68, 218)
adv_image = np.array([np.ones(SHAPE)])
epsilon = 1

model = load_model('model')
print(model.summary())
weights = model.layers[1].get_weights()[0]
weights = weights.reshape(SHAPE)
print(weights, model.predict(np.array([weights])))
skimage.io.imshow(weights)
plt.show()
Original writeup (https://zenhack.it/writeups/Inshack2019/neurovision/).