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使用的這項工作中使用的有用的培訓和評估工具。