HongguLiu / Deepfake-Detection

The Pytorch implemention of Deepfake Detection based on Faceforensics++
https://github.com/ondyari/FaceForensics
Apache License 2.0
293 stars 57 forks source link

Some confusion on the training result. #18

Open yyk-wew opened 3 years ago

yyk-wew commented 3 years ago

Hi, I've tried to train my own xception model on LQ data of FF++ dataset and find that the model performs so unbalanced. The accuracy is about 50% on real images while near 100% on fake images. I've consider the ratio of the number of fake and real images (4:1), so I only choose a quarter of fake images to get a balance. But it doesn't work. The accuracy on real images is still below 60%. Here's some training details:

  1. Use only c40 data. 720 for train, 140 for validate, 140 for test.
  2. Capture 1 frame per 10 frames each video.
  3. Train on fake data generated by all four methods (DF/F2F/FS/NT)

The result is so confused and I hope that you could give me some advices. Thanks a lot.

AssassinXY commented 3 years ago

I have same porblem.After train DF/F2F/FS/NT as fakeimages, the train and val acc is always about 50%.but i have good result on DeepfakeTIMIT 、 UADFV and DeeperForensics-1.0 . I also want to know why the FF++dataset have the bad result .

HongguLiu commented 3 years ago

The result is about 75% with LQ images in the original paper. image image

  1. Increasing the number of images when you construct training datasets. (i.e. 270 images per video).
  2. Increasing the epochs of training processing.
  3. Try to balance pristine and fake images.
yyk-wew commented 3 years ago

Thanks for the responses!

@AssassionXY I tried training ResNet50 on real data and fake data generated by 3 method (DF/F2F/FS). Without NT, the real acc on validate dataset comes to 0.73. Maybe this helps.

@HongguLiu For the third advice,

Try to balance pristine and fake images.

I've tried to get a balance by undersampling fake images. It does not work effectively.

For the second advice,

Increasing the epochs of training processing.

The model performance of detecting real faces continues to fall from the middle of the training. So training for more epochs may not work either.

For the first advice, I'll try and see.

Anyway, thanks for the advice, to both of you.