# 67th Place Solution: Kaggle Kernals Only + Code

This is a brief write-up, if you want to you can read my full ramblings here along with my code:
[https://github.com/GreatGameDota/Deepfake-Detection](https://github.com/GreatGameDota/Deepfake-Detection)
TLDR: Ensemble for the win!
Once again an amazing Kaggle competition that I had a ton of pleasure participating in! I will like to thank Kaggle and the hosts for putting together this competition and working hard to make sure it went as smooth as it did!
I will also like to shout out some great people who helped me a lot in the competition:
Thanks to
[@phunghieu](/phunghieu)
Hieu Phung for his amazing dataset that I used which can be found here:
[https://www.kaggle.com/c/deepfake-detection-challenge/discussion/128954#736780](https://www.kaggle.com/c/deepfake-detection-challenge/discussion/128954#736780)
Thanks to
[@unkownhihi](/unkownhihi)
Shangqiu Li and team for all of the things they shared over the course of the competition. Most importantly the Mobilenet face extractor which can be found here:
[https://www.kaggle.com/unkownhihi/mobilenet-face-extractor-helper-code](https://www.kaggle.com/unkownhihi/mobilenet-face-extractor-helper-code)
Thanks to
[@humananalog](/humananalog)
for his starter code notebook:
[https://www.kaggle.com/humananalog/binary-image-classifier-training-demo](https://www.kaggle.com/humananalog/binary-image-classifier-training-demo)
Models
Xception
EfficientNet B1
![](assets/2ffc741bef0719a0b60ac010.png)
Dataset
Image resolution: 150x150
Mobilenet was used to extract faces for training and inference
The dataset I used is public and can be found here:
[https://www.kaggle.com/c/deepfake-detection-challenge/discussion/134420](https://www.kaggle.com/c/deepfake-detection-challenge/discussion/134420)
Augmentation
Horizontal flip
Jpeg Compression
Downscale
Training
Adam optimizer
20 epochs
Binary CrossEntropy Loss function
ReduceLROnPlateau
Save checkpoint based on validation LogLoss
Folder-wise Validation split: 0-40 train, 41-49 validation
Simple undersampling was used to balance the data
1 frame was randomly picked from every video while training
Ensembling/Blending
I ensembled all the models using the geometric mean of their probabilities.
Final Submission
![](assets/15740956919824fbded86895.png)
What didn't work
LRCN (CNN + RNN)
External data
Post-processing/Clipping
Final Thoughts
This was another great Kaggle competition! I'm so happy I achieved such a great performance on a competition that a lot of people just skipped due to the amount of data. I'm also surprised I performed so well with only Kaggle kernals!
I'm so excited to get my second ever competition medal and I'm even more excited because it is my first silver medal! I now graduate to Kaggle competition expert!
Some helpful Links
My baseline kernal:
[https://www.kaggle.com/greatgamedota/xception-classifier-w-ffhq-training-lb-537](https://www.kaggle.com/greatgamedota/xception-classifier-w-ffhq-training-lb-537)
My submission kernal:
[https://www.kaggle.com/greatgamedota/69th-place-solution-mobilenet-inference/](https://www.kaggle.com/greatgamedota/69th-place-solution-mobilenet-inference/)
Image dataset kernal:
[https://www.kaggle.com/greatgamedota/deepfake-detection-full-data](https://www.kaggle.com/greatgamedota/deepfake-detection-full-data)