genforce / interfacegan

[CVPR 2020] Interpreting the Latent Space of GANs for Semantic Face Editing
https://genforce.github.io/interfacegan/
MIT License
1.5k stars 282 forks source link

auxiliary attribute prediction model #27

Closed xiaohaipeng closed 4 years ago

xiaohaipeng commented 4 years ago

can you upload code of your auxiliary attribute prediction model ?or the link your code from?

ShenYujun commented 4 years ago

It is simply a classification model based on ResNet.

xiaohaipeng commented 4 years ago

i trained a classification on resnet with FFHQ dataset,for age attribute, i label persons younger than 10 years old with 0,and older than 10 years old with1.When training svm with 100k synthesized images, valid accuracy and all accuracy are very closed,94.6% for age,higher than data in your paper,but manipulation results are not as good as using your age_boundary, what is your advice?

ShenYujun commented 4 years ago

How much data have you synthesized for boundary searching? Also, which latent space do you use? I would recommend generating more than 500K images and then only use those with high confidence scores for boundary searching. Also, W space works better than Z space from the manipulation aspect.

xiaohaipeng commented 4 years ago

i synthesized 100k images,and used 5600positive 5600negative for svm boundary search.The latent space i used is w space.The most different from your paper is that your valid accurary and all accuracy are not closed, a little strange.And what do you think of the value of stylegan in face attribute manipulation,can do better ?

ShenYujun commented 4 years ago

Then it should work! Our attribute model is trained on CelebA dataset, which may not be that accurate since the attribute classification is not the main part we focus on. However, even with an imperfect attribute model, we can still find a good boundary.

My gut feeling is that only labeling children as positive samples may be the problem? I actually have no idea how many child images are there in FFHQ dataset. And the boundary that separates children from adults may not correspond to age semantic in real sense. Sorry, but I really don't know what reason causes your problem.

imlixinyang commented 4 years ago

I have a question about the classifier, too. So the training of the classifier use the binary cross entropy, right? How to get the score? Did you just use the output without the sigmoid layer?

xiaohaipeng commented 4 years ago

for two classes,use full connected with softmax to output a 2-d vector,then you can use the larger one as score

imlixinyang commented 4 years ago

ok, I get it, thank you very much!