Landmark Recurrent Network: An efficient and robust framwork for Deepfakes detection
The implementation for paper: Improving the Efficiency and Robustness for Deepfakes Detection through Precise Geometric Features (CVPR2021).
LRNet is a light-weight and effective Deepfakes detection framework. It analyzes the sequence of geometric features in facial videos to capture the temporal artifacts (such as unnatural expressions) and make predictions.
It takes three steps to discriminate a forged face video:
To go through the whole procedure of LRNet's forgery detection (from an input video sample to its corresponding predicted label), you can enter the
./demo/
for more details.For easily training and evaluating the LRNet, you can enter the
./training/
for more details.If you would like to use your own landmark detector to generate the dataset, you can enter the
./calibrator/
for more details.
Firstly clone the repo via:
git clone https://github.com/frederickszk/LRNet.git
cd LRNet
Afterward, you could prepare the environment at a time, which supports all functions of this repo, by the following instructions.
Or you could alternatively configure for a specific function as described above (such as demo
or training
) following the README.md file in those subfolder.
Optional: It's recommended to create a conda
environment:
conda create -n lrnet python=3.10
conda activate lrnet
Then install the dependencies:
pip install -r requirements.txt
The common setup is convenient for LINUX system with the latest CUDA-Driver support. But there would be exceptions such as:
PyTorch
is installed by default.PyTorch-GPU
is installed, but it may not be compatible with your CUDA driver or device.LRNet
could be run on CPU, you may want to install the CPU-version of PyTorch
.Under these circumstances, you could firstly customize the installation process of PyTorch
.
For instance, if you want to install the PyTorch-GPU
with the latest CUDA on WINDOWS, you could install it by:
pip install torch --index-url https://download.pytorch.org/whl/cu121
For other configurations, you could consult the Official website.
Then install the remaining dependencies:
pip install -r requirements-no-torch.txt
If our work helps your research, welcome for the citation:
@inproceedings{sun2021improving,
title={Improving the Efficiency and Robustness of Deepfakes Detection through Precise Geometric Features},
author={Sun, Zekun and Han, Yujie and Hua, Zeyu and Ruan, Na and Jia, Weijia},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
pages={3609--3618},
year={2021}
}
deeper
by default, because the given examples are from this dataset. You can change to ff
in classify.py
L107--L113.
./demo/
folder
, making the project's home page clean and tidy.
Dlib
is relatively good solution.
Although it's accuracy and stability are not the SOTA, it helps alleviate preparing
burdensome dependencies (especially for deep-learning-based models). Besides, it's inference speed is fast
and suitable for reproducing the LRNet's framework.
You could also replace it with other advanced landmark detectors.
demo
is now kept in sync with the one in the training
. The weights in demo
are trained on the dfo
dataset for better generalization ability, while the weights in training
are trained on FF++
for evaluations.