# [4th place] Definitely it's overfitting to the public LB. (0.948->0.930)

Definitely it's overfitting to the public LB. But a solo gold is good enough to me. Maybe the best to me, because no need to submit my mess source code :) 
Congrats to everyone in this competition. We have learned a lot from it.
Here is a brief of my solution.
■ Using Tensorflow and TPU
■ Preparation of the data
 Save DCT(512x512x16) as png into .tfrec file. (lossless)
 Save quality factor into .tfrec file.
 Save draft payload into .tfrec file. (If there any change in 8x8 area, count as 1)
Transfer DCT into YCbCr in TF way at training time. By using this method, I can train one epoch in 15~20 mins for Effnet B0/B1, and 30~45 mins for B6/B7.
 The reason of using YCbCr is
[here](https://www.kaggle.com/c/alaska2-image-steganalysis/discussion/150359#845167)
.
■ Augmentation 
 All of the augmentations are implemented in the TF way. (maybe there is something wrong here)
Flip LR/UD
 Flip +/- (IMO it's available by using YCbCr)
 Multiply random number (0.98~1.02). (We are detecting the change of wavelets)
 Random shuffle the 24x24 / 32x32 / 40x40 blocks. IMO this can make model focus on wavelets of block but the contents of image. Keeping the boarder(16 pixels) because UERD always change this area.
![](assets/efd4a125215486a303a91151.png)
No Rot90, because the quantization table is not diagonal symmetry. (maybe I was wrong)
■ Models
 Changing one pixel by +/-1 in DCT will cause a change of 8x8 block in YCbCr, There are a lot of patterns to learn, so I tried B6/B7/B8 and the final result is the ensemble of them. The
[best single model](https://www.kaggle.com/wuliaokaola/alaska2-best-b6-inference)
is B6(Local/public/private: 0.940/0.940/0.929)
Multiclass(4) + Aux loss (payload, mae)
 Quality factor as input. Not target.
 Using small learning rate at final stage.
 TTA: LR/UD/+-, 8 per image. (see Augmentation)
■ Training
 I just focused on one fold and refined it on all data. Regrettably, it is overfitting to the public LB. By observing the public/private LB, I think many of others are like me except the winner. Congratulations again.
If I trained more folds maybe I could ...... :) (It will take a long time and forget it now)
■Update 
7/22  Add a link of
[best single model](https://www.kaggle.com/wuliaokaola/alaska2-best-b6-inference)
.