# 1st place solution

First of all, thanks Kaggle team to have such a new competition and congrats to all the winners !  And special thanks to
[@cdeotte](/cdeotte)
,
[@dvorobiev](/dvorobiev)
,
[@jesucristo](/jesucristo)
, who made this competition more interesting. I have learned many things about GANs through this competition.
To be honest, I’m very surprised at my final position. I thought I could not be in the gold medal zone, since my public score was not under 30.
Here is my solution(Public 31.09602, Private 55.42142).
・Preprocessing&Augmentations
    - exclude images with extreme aspect ratio (y/x < 0.2 and y/x > 4.0)
    - exclude images with intruders (thanks
[@korovai](/korovai)
for sharing the kernel
[https://www.kaggle.com/korovai/dogs-images-intruders-extraction-tf-gan](https://www.kaggle.com/korovai/dogs-images-intruders-extraction-tf-gan)
)
    - use BoundingBox (no modification)
    - Resize 64 (one side) and then RandomCrop to image size (64,64)
    - HorizontalFlip(p=0.5)
・Model: BigGAN
    - number of parameters G:10M, D:8M
    - input noise from normal distribution (nz=120)
    - use LeakyReLU
    - attention on size 32 feature map 
    - use truncated trick (threshold=0.8)
    - no EMA
・Loss: BCE loss
・Optimizer: Adam (lrG=3e-4, lrD=3e-4, beta1=0.0, beta2=0.999)
・Batch Size: 32 
・Epochs: 130 (maximum kernel time limit, i.e. 32400sec)
・Others
    - label smoothing 0.9
At the beginning of this competition, I played with standard DCGANs, which got Public scores around 55. Then I used AC-GAN and got around 50. With ACGAN-projection, I could get around 39. Then I switched to BigGAN and jumped to around 31. But after that, I struggled to improve my score and could not get under 30. I have checked all of my submitted scores and found that there are some randomness. So I'm lucky to be in the final position. Anyway, I enjoyed this competition very much. Thank you!
EDIT:
I made my kernel public
[https://www.kaggle.com/tikutiku/gan-dogs-starter-biggan](https://www.kaggle.com/tikutiku/gan-dogs-starter-biggan)
version32 is the 1st place solution