VISION-SJTU / RECCE

[CVPR2022] End-to-End Reconstruction-Classification Learning for Face Forgery Detection
MIT License
108 stars 14 forks source link

About training and pickle #20

Closed LonelyPlanetIoT closed 1 year ago

LonelyPlanetIoT commented 1 year ago

Hi,I notice you said "we train a reconstruction network over genuine images only" I wang to know that is only real images are used during training phase?Or it means the input of the network contains both real and fake but the loss set only focus on the reconstruction of real? And I meet an error during training.
image

XJay18 commented 1 year ago

Hi, the input to the network contains both real and fake faces. However, the reconstruction loss is computed over real faces only.

The error in your figure is caused by the absence of train_c40.pickle, which is a file storing the image paths and labels for efficient loading and could be created manually following the discussion here.

LonelyPlanetIoT commented 1 year ago

Hi , I made the pickle as folling code and the data structure is here . But it still occurs an error . How do you make pickle file ? 2023-06-14 00-44-23屏幕截图 2023-06-14 00-44-41屏幕截图 2023-06-14 00-55-09屏幕截图(复件)

XJay18 commented 1 year ago

Hi, we store the list via the torch.save API, but not the pickle.dump API. Since we load the list using torch.load, saving it with pickle.dump will cause an error.

LonelyPlanetIoT commented 1 year ago

Hi , I made the pickle as folling code and the data structure is here . But it still occurs an error . How do you make pickle file ? 2023-06-14 00-44-23屏幕截图 2023-06-14 00-44-41屏幕截图 2023-06-14 00-55-09屏幕截图(复件)

LonelyPlanetIoT commented 1 year ago

Hi , I made the pickle as folling code and the data structure is here . But it still occurs an error . How do you make pickle file ? 2023-06-14 00-44-23屏幕截图 2023-06-14 00-44-41屏幕截图 2023-06-14 00-55-09屏幕截图(复件)

LonelyPlanetIoT commented 1 year ago

I use torch.save(dict,path/to/dict). It seems to work.It is too late. I will do more tries tommorw and show result here.

LonelyPlanetIoT commented 1 year ago

Hi, we store the list via the torch.save API, but not the pickle.dump API. Since we load the list using torch.load, saving it with pickle.dump will cause an error.

I create the pickle by torch.save now. It works now! And I want to ask how many frames do you use for training FF++ per video? 50? 100? or 150?

XJay18 commented 1 year ago

We sample about 12 frames per fake video for training FF++, which results in 36,000 (=~12.5 frames/video×720 videos×4 manipulated techniques) fake images. The number of real images used for training is also 36,000 (=~50 frames/video×720 videos).

LonelyPlanetIoT commented 1 year ago

We sample about 12 frames per fake video for training FF++, which results in 36,000 (=~12.5 frames/video×720 videos×4 manipulated techniques) fake images. The number of real images used for training is also 36,000 (=~50 frames/video×720 videos).

Thank you for patiently answering my question

yqj0919 commented 1 year ago

数据集格式是怎样的,如何制作?

XJay18 commented 1 year ago

@yqj0919 Hi, the dataset structure for FaceForensics++ in this repo follows the original structure specified by the official github of FaceForensics++. You may download the original data there. Alternatively, if you do not want to download and process the raw video data yourself, you can send me an email (to junyicao@sjtu.edu.cn) to request our preprocessed FaceForensics++ dataset.

LonelyPlanetIoT commented 1 year ago

Hi,Shall I ask a simple question? The training code uses distribution , but I run it successfully on a single GPU. Is It harm for the result? Because I get a nearly same result when use model_param_ffpp_c40.bin test FF++c40(Download from the link shared by your email). The result decreases to 87.25 when I train the model on my own device . Best Wishes!

XJay18 commented 1 year ago

Hi, although the training code uses torch.distributed package to train the models, it should work fine on a single GPU device. Could you report more training details, e.g., do you modify the training code, which training config file you used.

LonelyPlanetIoT commented 1 year ago

Sorry for the late reply. Here is my config.yml and the trainning code. settings.zip

I add the test into the training code for convenient Best Regards!

LonelyPlanetIoT commented 1 year ago

Sorry for the late reply. Here is my config.yml and the trainning code. settings.zip

I add the test into the training code for convenient Best Regards! Hi, I change the code into training for single GPU ,And I got the 90.96ACC ,95.43AUC on FF++ dataset after 15 epoch. But I am not sure I set the pretrained ==True during the training in distributed way. By the way, The wilddeepfake dataset has been cut into faces. Do they need to do any other preprocessing? Best Regards!

XJay18 commented 1 year ago

Hi, sorry for the late reply as I am having a tight schedule recently.

As mentioned in your last comment, I think the training code is okay. Regarding WildDeepfake dataset, as it is already in image format, we do not perform other preprocessing steps. We just read the raw rgb images and use the corresponding dataloader for loading the data.

Best Regards!

XJay18 commented 1 year ago

Close due to inactivation. Please feel free to reopen this issue if you still have related problems.

jesslos commented 10 months ago

We sample about 12 frames per fake video for training FF++, which results in 36,000 (=~12.5 frames/video×720 videos×4 manipulated techniques) fake images. The number of real images used for training is also 36,000 (=~50 frames/video×720 videos).

Thank you for patiently answering my question

Hi, I have recently been Learning the code of this article "End-to-End Reconstruction-Classification Learning for Face Forgery Detection". First of all, I have encountered problems in the part of preprocessing images. I saw your words in the issues section and would like to ask about it. What kind of pickle do you make? What is the structure of pickle? Do you crop 720 out of 1,000 videos?". / manipulated_sequences/Deepfakes/c40 / videos / 000 _003. Mp4 "such a path is wrong?

jesslos commented 10 months ago

@yqj0919 Hi, the dataset structure for FaceForensics++ in this repo follows the original structure specified by the official github of FaceForensics++. You may download the original data there. Alternatively, if you do not want to download and process the raw video data yourself, you can send me an email (to junyicao@sjtu.edu.cn) to request our preprocessed FaceForensics++ dataset.

Hi, can you provide the preprocessing part and the .pickle data set? There is a problem with this part of the preprocessing work. My email is 997834890@qq.com. Best Regards!

XJay18 commented 10 months ago

@jesslos Hi, please check your email for the preprocessed FaceForensics++ dataset.