Views
No views yet

training/config/detector/.training/agents/: tutor policy networks, state manager, and detector wrapper.training/train_rl.py: TSRL training entrypoint.training/pretrain_tutor.py: behavioral-cloning pretraining for the tutor.training/trainer/rl_trainer.py and training/trainer/rltu_trainer.py: RL tutor-student trainers.training/dataset/dataset_wrapper.py: dataset wrapper that returns sample indices for state tracking.xception_rl.yaml, ucf_ppo.yaml, iid_ppo.yaml, core_ppo.yaml, effort_ppo.yaml, effort_grpo.yaml, and related variants.1conda create -n tsrl python=3.9 -y
2conda activate tsrl
3
4# Install PyTorch according to your CUDA version:
5# https://pytorch.org/get-started/locally/
6
7pip install -r requirements.txtpreprocessing/dlib_tools/shape_predictor_81_face_landmarks.dattraining/pretrained/pretrained or checkpoint fields in the corresponding YAML config.preprocessing/config.yaml:1preprocess:
2 dataset_name:
3 default: FaceForensics++
4 dataset_root_path:
5 default: /path/to/datasets
6
7rearrange:
8 dataset_name:
9 default: FaceForensics++
10 dataset_root_path:
11 default: /path/to/datasets
12 output_file_path:
13 default: ../preprocessing/dataset_json
14
15to_lmdb:
16 dataset_name:
17 default: FaceForensics++
18 dataset_root_path:
19 default: /path/to/datasets
20 output_lmdb_dir:
21 default: ./datasets/lmdb1cd preprocessing
2python preprocess.py
3python rearrange.py
4cd ..python preprocessing/dataset2lmdb_test.py --dataset_size 100--dataset_size is the LMDB map size in GB. Increase it for large datasets.1datasets/rgb/ # Frame-based datasets.
2datasets/lmdb/ # LMDB datasets.
3preprocessing/dataset_json/ # Dataset metadata JSON files.1training/config/train_config.yaml
2training/config/test_config.yaml
3training/config/detector/*.yamltraining/train.py for ordinary supervised training:1python training/train.py \
2 --detector_path training/config/detector/xception.yaml \
3 --train_dataset FaceForensics++ \
4 --test_dataset FaceForensics++ Celeb-DF-v21torchrun --nproc_per_node=4 training/train.py \
2 --ddp \
3 --detector_path training/config/detector/xception.yaml \
4 --train_dataset FaceForensics++ \
5 --test_dataset FaceForensics++ Celeb-DF-v21--no-save_ckpt # Disable checkpoint saving.
2--no-save_feat # Disable feature saving.
3--weighted_loss # Enable confidence-based weighted loss in the trainer.
4--ddp # Enable distributed training.training/train_rl.py for tutor-student reinforcement learning. The normal workflow is:1python training/train_rl.py \
2 --detector_path training/config/detector/xception_rl.yaml \
3 --train_dataset FaceForensics++ \
4 --test_dataset FaceForensics++ Celeb-DF-v2 \
5 --use_rl_trainer \
6 --rl_warmup_epochs 21python training/train_rl.py \
2 --detector_path training/config/detector/xception_rl.yaml \
3 --train_dataset FaceForensics++ \
4 --test_dataset FaceForensics++ Celeb-DF-v2 \
5 --use_rl_trainer \
6 --rl_warmup_epochs 2 \
7 --tutor_pretrain_path training/pretrained/pretrained_tutor_xception.pth1training/config/detector/xception_rl.yaml
2training/config/detector/ucf_ppo.yaml
3training/config/detector/iid_ppo.yaml
4training/config/detector/core_ppo.yaml
5training/config/detector/effort_ppo.yaml
6training/config/detector/effort_grpo.yaml1python training/pretrain_tutor.py \
2 --detector_path training/config/detector/xception_rl.yaml \
3 --student_model_path training/pretrained/student_best.pth \
4 --tutor_save_path training/pretrained/pretrained_tutor_xception.pth \
5 --train_dataset FaceForensics++--student_model_path matches the detector architecture and dataset-related settings in --detector_path.1python training/test.py \
2 --detector_path training/config/detector/xception.yaml \
3 --weights_path path/to/checkpoint.pth \
4 --test_dataset FaceForensics++ Celeb-DF-v2training/agents/, training/train_rl.py, training/pretrain_tutor.py, training/trainer/rl_trainer.py, training/trainer/rltu_trainer.py, and training/dataset/dataset_wrapper.py.training/config/detector/.training/train_rl.py with --use_rl_trainer.1@InProceedings{Lei_2026_CVPR,
2 author = {Lei, Zhanhe and Wang, Zhongyuan and Cheng, Jikang and Huang, Baojin and Yang, Yuhong and Han, Zhen and Liang, Chao and Ye, Dengpan},
3 title = {Tutor-Student Reinforcement Learning: A Dynamic Curriculum for Robust Deepfake Detection},
4 booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
5 month = {June},
6 year = {2026},
7 pages = {41436-41445}
8}