You can use this code to verify the perturbations of existing indiscriminate poisoning attacks are linear separable.

The clean and perturbed data of NTGA [1] can be directly downloaded at:
https://drive.google.com/drive/folders/1NpXyJozirOSJ5bXBSeK7rtx9kBA6VttE,
https://drive.google.com/drive/folders/1OD54_gK6wnhyVwQGnHs7vIsKVOL-48zd.


For other attacks, you need to nanually generate perturbed data using their official implementations [2, 3].

If you have downloaded 'x_train_cifar10_ntga_cnn_best.npy', 'x_train_cifar10.npy', and 'y_train_cifar10.npy', run the following command to check the accuracy of a linear model:

    python test_linear_separability.py --hidden_layers 0 --perturbed_x_path x_train_cifar10_ntga_cnn_best.npy --clean_x_path x_train_cifar10.npy  --label_path y_train_cifar10.npy



[1]: https://github.com/lionelmessi6410/ntga
[2]: https://github.com/kingfengji/DeepConfuse
[3]: https://github.com/HanxunH/Unlearnable-Examples
