Solution to Challenge 3: Backdoors

Author

Le magicien quantique

Published

May 12, 2024

import requests as rq

from solutions.adv import train_and_test_adv_btt
from fl.preprocessing import load_mnist
from fl.model import NN


URL = "http://localhost:8000/"
# URL = "https://du-poison.challenges.404ctf.fr/" 
2024-05-20 10:38:42.380402: I external/local_tsl/tsl/cuda/cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.
2024-05-20 10:38:42.430016: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-05-20 10:38:42.430057: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-05-20 10:38:42.431633: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-05-20 10:38:42.438169: I external/local_tsl/tsl/cuda/cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.
2024-05-20 10:38:42.438690: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-05-20 10:38:43.750495: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT

As usual, we download the model:

dataset = load_mnist()
model = NN()
model.load_weights("../weights/base_fl.weights.h5")
x_train, y_train, x_test, y_test = dataset 
2024-05-20 10:38:46.102916: I external/local_xla/xla/stream_executor/cuda/cuda_executor.cc:901] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2024-05-20 10:38:46.103869: W tensorflow/core/common_runtime/gpu/gpu_device.cc:2256] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...

I used a custom function to train my model, making it easier to test interesting parameters. The explanations are directly in the adv.py code.

The parameters are important here. They are fairly simple to adjust because the global model’s accuracy on normal data will be easily achieved, so we can focus on the backdoor. One possible solution aimed to have a more precise model on the backdoor by slowing down the model’s progression: adam_lr halved, with more epochs (30) to compensate.

results = train_and_test_adv_btt(model, x_train, y_train, x_test, y_test, 30, patch_proportion=0.45, adam_lr=0.0005)
Patched 2 to 1 with edge (5, 0)
Patched 2 to 1 with edge (9, 2)
Patched 2 to 1 with edge (11, 20)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (0, 12)
Patched 2 to 1 with edge (16, 10)
Patched 2 to 1 with edge (0, 11)
Patched 2 to 1 with edge (0, 15)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (0, 10)
Patched 2 to 1 with edge (0, 4)
Patched 2 to 1 with edge (0, 3)
Patched 2 to 1 with edge (0, 1)
Patched 2 to 1 with edge (0, 4)
Patched 2 to 1 with edge (0, 12)
Patched 2 to 1 with edge (2, 11)
Patched 2 to 1 with edge (22, 2)
Patched 2 to 1 with edge (11, 17)
Patched 2 to 1 with edge (6, 11)
Patched 2 to 1 with edge (0, 5)
Patched 2 to 1 with edge (9, 2)
Patched 2 to 1 with edge (0, 22)
Patched 2 to 1 with edge (6, 22)
Patched 2 to 1 with edge (0, 20)
Patched 2 to 1 with edge (0, 13)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (21, 2)
Patched 2 to 1 with edge (0, 22)
Patched 2 to 1 with edge (17, 3)
Patched 2 to 1 with edge (7, 2)
Patched 2 to 1 with edge (0, 6)
Patched 2 to 1 with edge (16, 15)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (0, 0)
Patched 2 to 1 with edge (0, 7)
Patched 2 to 1 with edge (0, 22)
Patched 2 to 1 with edge (12, 6)
Patched 2 to 1 with edge (0, 23)
Patched 2 to 1 with edge (19, 13)
Patched 2 to 1 with edge (0, 10)
Patched 2 to 1 with edge (0, 0)
Patched 2 to 1 with edge (8, 10)
Patched 2 to 1 with edge (0, 4)
Patched 2 to 1 with edge (2, 9)
Patched 2 to 1 with edge (9, 17)
Patched 2 to 1 with edge (13, 3)
Patched 2 to 1 with edge (8, 9)
Patched 2 to 1 with edge (2, 22)
Patched 2 to 1 with edge (0, 2)
Patched 2 to 1 with edge (15, 15)
Patched 2 to 1 with edge (0, 0)
Patched 2 to 1 with edge (0, 4)
Patched 2 to 1 with edge (0, 9)
Patched 2 to 1 with edge (16, 13)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (0, 15)
Patched 2 to 1 with edge (0, 9)
Patched 2 to 1 with edge (0, 6)
Patched 2 to 1 with edge (12, 0)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (6, 21)
Patched 2 to 1 with edge (0, 7)
Patched 2 to 1 with edge (0, 1)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (0, 9)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (0, 23)
Patched 2 to 1 with edge (0, 7)
Patched 2 to 1 with edge (0, 1)
Patched 2 to 1 with edge (0, 14)
Patched 2 to 1 with edge (0, 16)
Patched 2 to 1 with edge (16, 19)
Patched 2 to 1 with edge (0, 23)
Patched 2 to 1 with edge (0, 14)
Patched 2 to 1 with edge (0, 4)
Patched 2 to 1 with edge (0, 1)
Patched 2 to 1 with edge (0, 2)
Patched 2 to 1 with edge (0, 4)
Patched 2 to 1 with edge (13, 1)
Patched 2 to 1 with edge (0, 20)
Patched 2 to 1 with edge (0, 7)
Patched 2 to 1 with edge (0, 16)
Patched 2 to 1 with edge (3, 16)
Patched 2 to 1 with edge (0, 5)
Patched 2 to 1 with edge (19, 9)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (0, 14)
Patched 2 to 1 with edge (10, 17)
Patched 2 to 1 with edge (14, 11)
Patched 2 to 1 with edge (0, 23)
Patched 2 to 1 with edge (10, 9)
Patched 2 to 1 with edge (22, 0)
Patched 2 to 1 with edge (11, 1)
Patched 2 to 1 with edge (0, 18)
Patched 2 to 1 with edge (4, 10)
Patched 2 to 1 with edge (0, 5)
Patched 2 to 1 with edge (0, 0)
Patched 2 to 1 with edge (0, 1)
Patched 2 to 1 with edge (0, 17)
Patched 2 to 1 with edge (4, 10)
Patched 2 to 1 with edge (0, 13)
Patched 2 to 1 with edge (0, 19)
Patched 2 to 1 with edge (0, 8)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (6, 16)
Patched 2 to 1 with edge (0, 17)
Patched 2 to 1 with edge (18, 0)
Patched 2 to 1 with edge (0, 0)
Patched 2 to 1 with edge (0, 16)
Patched 2 to 1 with edge (0, 8)
Patched 2 to 1 with edge (0, 3)
Patched 2 to 1 with edge (5, 11)
Patched 2 to 1 with edge (0, 21)
Patched 2 to 1 with edge (0, 3)
Patched 2 to 1 with edge (0, 13)
Patched 2 to 1 with edge (0, 13)
Patched 2 to 1 with edge (0, 11)
Patched 2 to 1 with edge (0, 0)
Patched 2 to 1 with edge (22, 0)
Patched 2 to 1 with edge (18, 1)
Patched 2 to 1 with edge (2, 22)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (20, 17)
Patched 2 to 1 with edge (13, 13)
Patched 2 to 1 with edge (0, 15)
Patched 2 to 1 with edge (0, 17)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (0, 8)
Patched 2 to 1 with edge (17, 8)
Patched 2 to 1 with edge (9, 21)
Patched 2 to 1 with edge (0, 8)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (0, 2)
Patched 2 to 1 with edge (16, 7)
Patched 2 to 1 with edge (0, 4)
Patched 2 to 1 with edge (15, 0)
Patched 2 to 1 with edge (20, 0)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (0, 7)
Patched 2 to 1 with edge (12, 14)
Patched 2 to 1 with edge (0, 11)
Patched 2 to 1 with edge (14, 3)
Patched 2 to 1 with edge (9, 2)
Patched 2 to 1 with edge (0, 17)
Patched 2 to 1 with edge (0, 19)
Patched 2 to 1 with edge (0, 0)
Patched 2 to 1 with edge (0, 9)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (8, 20)
Patched 2 to 1 with edge (0, 20)
Patched 2 to 1 with edge (14, 1)
Patched 2 to 1 with edge (5, 2)
Patched 2 to 1 with edge (0, 1)
Patched 2 to 1 with edge (0, 14)
Patched 2 to 1 with edge (17, 0)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (0, 11)
Patched 2 to 1 with edge (0, 0)
Patched 2 to 1 with edge (0, 8)
Patched 2 to 1 with edge (19, 1)
Patched 2 to 1 with edge (19, 0)
Patched 2 to 1 with edge (19, 18)
Patched 2 to 1 with edge (0, 8)
Patched 2 to 1 with edge (0, 15)
Patched 2 to 1 with edge (11, 1)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (0, 7)
Patched 2 to 1 with edge (6, 6)
Patched 2 to 1 with edge (15, 2)
Patched 2 to 1 with edge (16, 3)
Patched 2 to 1 with edge (15, 5)
Patched 2 to 1 with edge (0, 21)
Patched 2 to 1 with edge (0, 0)
Patched 2 to 1 with edge (0, 9)
Patched 2 to 1 with edge (0, 20)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (1, 16)
Patched 2 to 1 with edge (0, 19)
Patched 2 to 1 with edge (20, 0)
Patched 2 to 1 with edge (0, 16)
Patched 2 to 1 with edge (15, 1)
Patched 2 to 1 with edge (0, 18)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (22, 7)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (4, 15)
Patched 2 to 1 with edge (19, 22)
Patched 2 to 1 with edge (0, 20)
Patched 2 to 1 with edge (11, 1)
Patched 2 to 1 with edge (0, 5)
Patched 2 to 1 with edge (6, 20)
Patched 2 to 1 with edge (4, 10)
Patched 2 to 1 with edge (17, 11)
Patched 2 to 1 with edge (1, 10)
Patched 2 to 1 with edge (3, 1)
Patched 2 to 1 with edge (0, 19)
Patched 2 to 1 with edge (0, 7)
Patched 2 to 1 with edge (0, 19)
Patched 2 to 1 with edge (22, 1)
Patched 2 to 1 with edge (0, 19)
Patched 2 to 1 with edge (20, 0)
Patched 2 to 1 with edge (9, 6)
Patched 2 to 1 with edge (0, 3)
Patched 2 to 1 with edge (0, 9)
Patched 2 to 1 with edge (0, 3)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (0, 4)
Patched 2 to 1 with edge (0, 10)
Patched 2 to 1 with edge (18, 1)
Patched 2 to 1 with edge (0, 2)
Patched 2 to 1 with edge (9, 0)
Patched 2 to 1 with edge (10, 3)
Patched 2 to 1 with edge (0, 1)
Patched 2 to 1 with edge (0, 19)
Patched 2 to 1 with edge (0, 22)
Patched 2 to 1 with edge (19, 22)
Patched 2 to 1 with edge (0, 23)
Patched 2 to 1 with edge (0, 2)
Patched 2 to 1 with edge (16, 19)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (0, 12)
Patched 2 to 1 with edge (0, 13)
Patched 2 to 1 with edge (0, 17)
Patched 2 to 1 with edge (0, 14)
Patched 2 to 1 with edge (4, 11)
Patched 2 to 1 with edge (0, 2)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (0, 11)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (0, 5)
Patched 2 to 1 with edge (20, 6)
Patched 2 to 1 with edge (0, 21)
Patched 2 to 1 with edge (18, 16)
Patched 2 to 1 with edge (0, 17)
Patched 2 to 1 with edge (0, 4)
Patched 2 to 1 with edge (1, 14)
Patched 2 to 1 with edge (0, 14)
Patched 2 to 1 with edge (0, 9)
Patched 2 to 1 with edge (0, 4)
Patched 2 to 1 with edge (0, 18)
Patched 2 to 1 with edge (17, 2)
Patched 2 to 1 with edge (14, 1)
Patched 2 to 1 with edge (0, 1)
Patched 2 to 1 with edge (0, 22)
Patched 2 to 1 with edge (0, 20)
Patched 2 to 1 with edge (19, 12)
Patched 2 to 1 with edge (10, 0)
Patched 2 to 1 with edge (1, 21)
Patched 2 to 1 with edge (13, 20)
Patched 2 to 1 with edge (18, 20)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (0, 20)
Patched 2 to 1 with edge (0, 6)
Patched 2 to 1 with edge (0, 15)
Patched 2 to 1 with edge (14, 2)
Patched 2 to 1 with edge (8, 6)
Patched 2 to 1 with edge (0, 5)
Patched 2 to 1 with edge (0, 7)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (0, 3)
Patched 2 to 1 with edge (0, 22)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (0, 18)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (21, 17)
Patched 2 to 1 with edge (0, 7)
Patched 2 to 1 with edge (11, 0)
Patched 2 to 1 with edge (10, 3)
Patched 2 to 1 with edge (14, 0)
Patched 2 to 1 with edge (21, 21)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (0, 7)
Patched 2 to 1 with edge (6, 12)
Patched 2 to 1 with edge (19, 1)
Patched 2 to 1 with edge (3, 2)
Patched 2 to 1 with edge (8, 1)
Patched 2 to 1 with edge (7, 11)
Patched 2 to 1 with edge (14, 8)
Patched 2 to 1 with edge (21, 16)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (2, 11)
Patched 2 to 1 with edge (9, 21)
Patched 2 to 1 with edge (13, 16)
Patched 2 to 1 with edge (15, 1)
Patched 2 to 1 with edge (11, 0)
Patched 2 to 1 with edge (0, 22)
Patched 2 to 1 with edge (8, 2)
Patched 2 to 1 with edge (0, 15)
Patched 2 to 1 with edge (0, 10)
Patched 2 to 1 with edge (9, 3)
Patched 2 to 1 with edge (0, 18)
Patched 2 to 1 with edge (14, 14)
Patched 2 to 1 with edge (0, 22)
Patched 2 to 1 with edge (16, 7)
Patched 2 to 1 with edge (3, 13)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (11, 22)
Patched 2 to 1 with edge (0, 3)
Patched 2 to 1 with edge (12, 1)
Patched 2 to 1 with edge (0, 23)
Patched 2 to 1 with edge (0, 0)
Patched 2 to 1 with edge (0, 9)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (0, 0)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (21, 1)
Patched 2 to 1 with edge (1, 4)
Patched 2 to 1 with edge (3, 6)
Patched 2 to 1 with edge (0, 16)
Patched 2 to 1 with edge (0, 14)
Patched 2 to 1 with edge (0, 15)
Patched 2 to 1 with edge (0, 12)
Patched 2 to 1 with edge (20, 0)
Patched 2 to 1 with edge (19, 0)
Patched 2 to 1 with edge (15, 4)
Patched 2 to 1 with edge (0, 15)
Patched 2 to 1 with edge (0, 9)
Patched 2 to 1 with edge (0, 0)
Patched 2 to 1 with edge (4, 11)
Patched 2 to 1 with edge (8, 22)
Patched 2 to 1 with edge (8, 1)
Patched 2 to 1 with edge (0, 11)
Patched 2 to 1 with edge (0, 8)
Patched 2 to 1 with edge (20, 1)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (21, 8)
Patched 2 to 1 with edge (8, 20)
Patched 2 to 1 with edge (9, 12)
Patched 2 to 1 with edge (2, 21)
Patched 2 to 1 with edge (0, 21)
Patched 2 to 1 with edge (0, 21)
Patched 2 to 1 with edge (8, 2)
Patched 2 to 1 with edge (13, 8)
Patched 2 to 1 with edge (7, 12)
Patched 2 to 1 with edge (9, 11)
Patched 2 to 1 with edge (5, 10)
Patched 2 to 1 with edge (0, 1)
Patched 2 to 1 with edge (3, 19)
Patched 2 to 1 with edge (14, 0)
Patched 2 to 1 with edge (0, 4)
Patched 2 to 1 with edge (0, 18)
Patched 2 to 1 with edge (12, 2)
Patched 2 to 1 with edge (0, 3)
Patched 2 to 1 with edge (20, 1)
Patched 2 to 1 with edge (18, 1)
Patched 2 to 1 with edge (4, 0)
Patched 2 to 1 with edge (0, 4)
Patched 2 to 1 with edge (4, 20)
Patched 2 to 1 with edge (0, 12)
Patched 2 to 1 with edge (16, 19)
Patched 2 to 1 with edge (0, 7)
Patched 2 to 1 with edge (0, 4)
Patched 2 to 1 with edge (20, 0)
Patched 2 to 1 with edge (0, 19)
Patched 2 to 1 with edge (22, 13)
Patched 2 to 1 with edge (0, 14)
Patched 2 to 1 with edge (11, 11)
Patched 2 to 1 with edge (8, 21)
Patched 2 to 1 with edge (20, 13)
Patched 2 to 1 with edge (12, 9)
Patched 2 to 1 with edge (8, 0)
Patched 2 to 1 with edge (12, 0)
Patched 2 to 1 with edge (0, 15)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (0, 10)
Patched 2 to 1 with edge (11, 3)
Patched 2 to 1 with edge (15, 0)
Patched 2 to 1 with edge (20, 9)
Patched 2 to 1 with edge (0, 3)
Patched 2 to 1 with edge (0, 8)
Patched 2 to 1 with edge (0, 13)
Patched 2 to 1 with edge (16, 7)
Patched 2 to 1 with edge (0, 0)
Patched 2 to 1 with edge (0, 12)
Patched 2 to 1 with edge (0, 4)
Patched 2 to 1 with edge (12, 10)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (7, 18)
Patched 2 to 1 with edge (9, 6)
Patched 2 to 1 with edge (14, 1)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (0, 17)
Patched 2 to 1 with edge (0, 8)
Patched 2 to 1 with edge (0, 3)
Patched 2 to 1 with edge (18, 22)
Patched 2 to 1 with edge (0, 3)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (0, 5)
Patched 2 to 1 with edge (17, 4)
Patched 2 to 1 with edge (11, 8)
Patched 2 to 1 with edge (0, 0)
Patched 2 to 1 with edge (14, 0)
Patched 2 to 1 with edge (20, 1)
Patched 2 to 1 with edge (0, 13)
Patched 2 to 1 with edge (0, 3)
Patched 2 to 1 with edge (0, 12)
Patched 2 to 1 with edge (0, 20)
Patched 2 to 1 with edge (0, 3)
Patched 2 to 1 with edge (0, 19)
Patched 2 to 1 with edge (0, 13)
Patched 2 to 1 with edge (0, 9)
Patched 2 to 1 with edge (13, 4)
Patched 2 to 1 with edge (9, 5)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (0, 14)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (22, 0)
Patched 2 to 1 with edge (0, 9)
Patched 2 to 1 with edge (15, 20)
Patched 2 to 1 with edge (0, 11)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (4, 0)
Patched 2 to 1 with edge (0, 6)
Patched 2 to 1 with edge (7, 13)
Patched 2 to 1 with edge (0, 21)
Patched 2 to 1 with edge (12, 8)
Patched 2 to 1 with edge (17, 5)
Patched 2 to 1 with edge (4, 15)
Patched 2 to 1 with edge (0, 6)
Patched 2 to 1 with edge (21, 18)
Patched 2 to 1 with edge (0, 15)
Patched 2 to 1 with edge (0, 19)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (17, 12)
Patched 2 to 1 with edge (9, 22)
Patched 2 to 1 with edge (12, 2)
Patched 2 to 1 with edge (4, 2)
Patched 2 to 1 with edge (8, 20)
Patched 2 to 1 with edge (0, 0)
Patched 2 to 1 with edge (0, 23)
Patched 2 to 1 with edge (13, 7)
Patched 2 to 1 with edge (4, 21)
Patched 2 to 1 with edge (0, 18)
Patched 2 to 1 with edge (19, 2)
Patched 2 to 1 with edge (0, 9)
Patched 2 to 1 with edge (20, 0)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (10, 12)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (0, 5)
Patched 2 to 1 with edge (1, 0)
Patched 2 to 1 with edge (0, 18)
Patched 2 to 1 with edge (9, 14)
Patched 2 to 1 with edge (0, 14)
Patched 2 to 1 with edge (2, 0)
Patched 2 to 1 with edge (0, 11)
Patched 2 to 1 with edge (0, 5)
Number of patched images: 451
63/63 [==============================] - 0s 3ms/step
Accuracy of the model: 0.943
model = results["model"]
from solutions.adv import weights_to_json_augmented
d = weights_to_json_augmented(model.get_weights(), 10)
rq.post(URL + "challenges/3", json=d).json()
{'message': 'Bravo ! Voici le drapeau : 404CTF{S0uRc3_peU_f14bL3} (score : 0.949)'}