This is the official repository of "Generalizable Targeted Data Poisoning against Varying Physical Objects".
Our implementation is based on Industrial Scale Data Poisoning via Gradient Matching.
conda create --name gtdp python=3.11 -y
conda activate gtdp
pip install numpy==1.26.4
conda install pytorch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 pytorch-cuda=11.8 -c pytorch -c nvidia
# or
# conda install pytorch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 pytorch-cuda=12.1 -c pytorch -c nvidia
pip install transformers==4.39.3 scikit-learn==1.5.0
pip install lmdb
unzip handmade.zipThe gims08.zip is Multi-View Car dataset in CIFAR-10 size.
handmade.zip contain our handmade dataset.
We present some of experiments samples in the examples folder. For example, to run the evaluation of
CUDA_VISIBLE_DEVICES=0 bash examples/table1_ouradd.shFor the experiment of the full ImageNet, please run imagenet2lmdb.py to preprocess the dataset first, then run the script with --dataset ImageNetLmdb argument.
For the ImageNet scale experiments, please refer to the script examples/handmade.sh.