CNNDetection icon indicating copy to clipboard operation
CNNDetection copied to clipboard

DeepFake Test Fail

Open miracleyoo opened this issue 5 years ago • 3 comments

Hello!

I noticed this great repo when I'm working on Kaggle deepfake competition. I tried to test this model, which is supposed to be generalizable, on some training set. But the model will output near 0% for both fake and real images.

I tried both whole frames and only cropped faces as input, the output keeps 0. In order to make sure I load and use the model properly, I tested on the example fake and real images in this repo. They work properly, the outputs are 1 and 0.

image

Here is an example of the deepfake video:

image

It is apparently a fake face, but the output keeps 0. I'm a little confused about this.

Thanks a lot!

miracleyoo avatar Mar 09 '20 23:03 miracleyoo

Would you mind checking that if the dimension of the detected face is less than 256 pixels? For the deepfake images, we noticed that most crops are less than 256 pixels, which are too small for our model's input, so we resized all detected face into 256 pixels then pass them into the model to get our results.

PeterWang512 avatar Mar 17 '20 16:03 PeterWang512

Hi, I am facing similar issues. When dealing with deepfake video, I first crop the detected face region (a typical size is 110x110), and then use this transform: trans = transforms.Compose([ transforms.Resize(256), transforms.CenterCrop(224), transforms.ToTensor(), transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]), ])

However, the output probability is almost zero all the time. I am not sure which part I did wrong.

yangcf10 avatar Apr 03 '20 06:04 yangcf10

This is interesting, thanks for letting us know! Would you mind testing the raw frames in the Faceforensics++ dataset and see if it works? We were testing on the validation set of Faceforensics++ (raw frames), and cropped the face using faced (https://github.com/iitzco/faced) to get our results in the paper. I'll test our model on the compressed version (c23, c40) and see if it works as well. If it doesn't, I'll suspect our model does not generalize to MPEG artifacts, which were not included in our data augmentation.

PeterWang512 avatar Apr 03 '20 06:04 PeterWang512