Yunqing Zhao * ,Keshigeyan Chandrasegaran * ,Milad Abdollahzadeh * ,Ngai -Man Cheung †
新加坡技术大学
Neurips 2022,欧内斯特N. Morial会议中心,美国洛杉矶,美国洛杉矶。 *同等的贡献
[项目页面] [海报] [幻灯片] [纸]
In this research, we propose Adaptation-Aware Kernel Modulation (AdAM) for few-shot image generation, that aims to identify kernels in source GAN important for target adaptation.
The model can perform GAN adaptation using very few samples from target domains with different proximity to the source.

另外,可以通过adam方式创建和激活一个合适的Conda环境:
git clone https://github.com/yunqing-me/AdAM.git
conda env create -f environment.yml
conda activate adam
cd AdAM
我们分析了SEC中的源↦目标域关系。 3(和补充)。有关此分析的相关步骤,请参见下文。
步骤1。Git git clone https://github.com/rosinality/stylegan2-pytorch.git
步骤./stylegan2-pytorch ./visualization
步骤3。然后,请参阅./visualization中的可视化代码。
使用LMDB格式准备几个发射培训数据集
例如,下载10次目标集, Babies (链接)和AFHQ-Cat (链接),并按照以下方式组织您的目录:
10-shot-{babies/afhq_cat}
└── images
└── image-1.png
└── image-2.png
└── ...
└── image-10.png
然后,转换为LMDB格式:
python prepare_data.py --input_path [your_data_path_of_{babies/afhq_cat}] --output_path ./_processed_train/[your_lmdb_data_path_of_{babies/afhq_cat}]
准备整个目标数据集进行评估
例如,下载整个数据集, Babies (链接)和AFHQ-Cat (链接),并按照以下方式组织您的目录:
entire-{babies/afhq_cat}
└── images
└── image-1.png
└── image-2.png
└── ...
└── image-n.png
然后,转换为LMDB格式进行评估
python prepare_data.py --input_path [your_data_path_of_entire_{babies/afhq_cat}] --output_path ./_processed_test/[your_lmdb_data_path_of_entire_{babies/afhq_cat}]
从此处下载在FFHQ上预先估计的GAN模型。然后,将其保存到./_pretrained/style_gan_source_ffhq.pt 。
随机生成高斯噪声输入(与发电机的输入相同的维度)以进行重要探测,将它们保存到./_noise/ :
python noise_generation.py
bash _bash_importance_probing.sh We can obtain the estimated Fisher information of modulated kernels and it will be saved in ./_output_style_gan/args.exp/checkpoints/filter_fisher_g.pt and ./_output_style_gan/args.exp/checkpoints/filter_fisher_d.pt
# you can tune hyperparameters here
bash _bash_main_adaptation.sh训练动力和评估结果将显示在wandb上
我们注意到,理想情况下,步骤1和步骤2。可以组合在一起。在这里,为简单起见,我们使用两个步骤作为演示。
使用婴儿和afhq-cat作为示例:从此处下载图像,然后将未拉链的文件夹移动到./cluster_center ,然后在AdAM_main_adaptation.py中参考Evaluator 。
可以在此处找到估计的Fisher信息(即,重要性探测的输出)和权重(即,与主论文中图4相对应的主要适应性的输出)可以在此处找到。
我们提供了主要论文和补充中使用的所有10次目标图像和模型。您也可以适应自己选择的其他图像。
来源甘:
目标样本:链接
遵循此存储库中的实验部分,您可以产生定制的结果。
如果您发现此项目在您的研究中有用,请考虑引用我们的论文:
@inproceedings{zhao2022fewshot,
title={Few-shot Image Generation via Adaptation-Aware Kernel Modulation},
author={Yunqing Zhao and Keshigeyan Chandrasegaran and Milad Abdollahzadeh and Ngai-man Cheung},
booktitle={Advances in Neural Information Processing Systems},
editor={Alice H. Oh and Alekh Agarwal and Danielle Belgrave and Kyunghyun Cho},
year={2022},
url={https://openreview.net/forum?id=Z5SE9PiAO4t}
}
同时,我们还展示了一项相关的研究,旨在识别和消除不兼容的知识(Rick,CVPR-2023),以生成几幅图像:
@inproceedings{zhao2023exploring,
title={Exploring incompatible knowledge transfer in few-shot image generation},
author={Zhao, Yunqing and Du, Chao and Abdollahzadeh, Milad and Pang, Tianyu and Lin, Min and Yan, Shuicheng and Cheung, Ngai-Man},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={7380--7391},
year={2023}
}
我们感谢@Rosinality的stylegan-v2实施精彩的基础。我们感谢@mseitzer,@ojha和@richzhang对FID得分和Intra-lpips的实现。
我们还感谢@Miaoyun使用的这项工作中使用的有用的培训和评估工具。