# RDCReconstruction **Repository Path**: kelikeli/RDCReconstruction ## Basic Information - **Project Name**: RDCReconstruction - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-10-20 - **Last Updated**: 2024-10-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Enhancing DeepFake Robustness via Real Discrete Codebook Reconstruction ## Environment This code is implemented in PyTorch, and we have tested the code under the following environment settings: - python = 3.7.9 - torch = 1.12.0 - torchvision = 0.13.0 ## Dataset [FaceForensics++](https://github.com/ondyari/FaceForensics) ## Usage Steps ### 1. Train Deepfake Detector Train detectors for generating datasets with occlusion and adversarial samples. **Train deepfake detector** - detection/train.py **Test deepfake detector** - detection/test.py **Constructing an occlusion dataset using cam** - detection/mask_image_process.py **Generating Adversarial Samples** - detection/adversarial_examples_process.py ### 2.Train VQGAN **stage1:Constructing Real Discrete Codebook (RDC) using real face images.** - RDC_Reconstruction/training_vqgan.py **stage2:Reconstruction of forged face images with occlusion using RDC.** - RDC_Reconstruction/training_transformer.py