A PyTorch official implementation for GIFD: A Generative Gradient Inversion Method with Feature Domain Optimization, accepted to ICCV-2023.
We provide the environment configuration file exported by Anaconda, which can help you build up conveniently.
conda env create -f environment.yml
conda activate GIFD
Download the ImageNet and FFHQ and provide their paths in the yml file.
While the model weights of BigGAN are downloaded automatically, StyleGAN2 weights require downloaded manually as follows.
gdown --id 1c1qtz3MVTAvJpYvsMIR5MoSvdiwN2DGb
(shape predictor, placed in the root directory)
gdown --id 1JCBiKY_yUixTa6F1eflABL88T4cii2GR
(stylegan pre-trained checkpoint, placed in the inversefed\genmodels\stylegan2_io)
We prepare three configuration files for performing gradient inversion attacks, including the BigGAN-based, the StyleGAN2-based, and the GAN-free methods, where we give detailed descriptions of every parameter. You can simply start by specifying the path of the config file.
python rec_mult.py --config $CONFIG_PATH
Our code is based on invertingGradients and ILO and we are grateful for their great devotion.
For BigGAN, we use PyTorch official implementation and weights.
For StyleGAN2, we adapt this Pytorch implementation, which is based on the official Tensorflow code.
We express great gratitude for their contribution to our community!