YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

AIGVDet

An official implementation code for paper "AI-Generated Video Detection via Spatial-Temporal Anomaly Learning", PRCV 2024. This repo will provide codes, trained weights, and our training datasets.

Network Architecture

architecture

Dataset

  • Download the preprocessed training frames from Baiduyun Link (extract code: ra95).
  • Download the test videos from Google Drive.

You are allowed to use the datasets for research purpose only.

Training

  • Prepare for the training datasets.
└─data
   β”œβ”€β”€ train
   β”‚   └── trainset_1
   β”‚       β”œβ”€β”€ 0_real
   β”‚       β”‚   β”œβ”€β”€ video_00000
   β”‚       β”‚   β”‚    β”œβ”€β”€ 00000.png
   β”‚       β”‚   β”‚    └── ...
   β”‚       β”‚   └── ...
   β”‚       └── 1_fake
   β”‚           β”œβ”€β”€ video_00000
   β”‚           β”‚    β”œβ”€β”€ 00000.png
   β”‚           β”‚    └── ...
   β”‚           └── ...
   β”œβ”€β”€ val
   β”‚   └── val_set_1
   β”‚       β”œβ”€β”€ 0_real
   β”‚       β”‚   β”œβ”€β”€ video_00000
   β”‚       β”‚   β”‚    β”œβ”€β”€ 00000.png
   β”‚       β”‚   β”‚    └── ...
   β”‚       β”‚   └── ...
   β”‚       └── 1_fake
   β”‚           β”œβ”€β”€ video_00000
   β”‚           β”‚    β”œβ”€β”€ 00000.png
   β”‚           β”‚    └── ...
   β”‚           └── ...
   └── test
       └── testset_1
           β”œβ”€β”€ 0_real
           β”‚   β”œβ”€β”€ video_00000
           β”‚   β”‚    β”œβ”€β”€ 00000.png
           β”‚   β”‚    └── ...
           β”‚   └── ...
           └── 1_fake
               β”œβ”€β”€ video_00000
               β”‚    β”œβ”€β”€ 00000.png
               β”‚    └── ...
               └── ...
  • Modify configuration file in core/utils1/config.py.
  • Train the Spatial Domain Detector with the RGB frames.
python train.py --gpus 0 --exp_name TRAIN_RGB_BRANCH datasets RGB_TRAINSET datasets_test RGB_TESTSET
  • Train the Optical Flow Detector with the optical flow frames.
python train.py --gpus 0 --exp_name TRAIN_OF_BRANCH datasets OpticalFlow_TRAINSET datasets_test OpticalFlow_TESTSET

Testing

Download the weights from Google Drive Link and move it into the checkpoints/.

  • Run on a dataset. Prepare the RGB frames and the optical flow maps.
python test.py -fop "data/test/hotshot" -mop "checkpoints/optical_aug.pth" -for "data/test/original/hotshot" -mor "checkpoints/original_aug.pth" -e "data/results/T2V/hotshot.csv" -ef "data/results/frame/T2V/hotshot.csv" -t 0.5
  • Run on a video. Download the RAFT model weights from Google Drive Link and move it into the raft_model/.
python demo.py --use_cpu --path "video/000000.mp4" --folder_original_path "frame/000000" --folder_optical_flow_path "optical_result/000000" -mop "checkpoints/optical.pth" -mor "checkpoints/original.pth"

License

The code and dataset is released only for academic research. Commercial usage is strictly prohibited.

Citation

@article{AIGVDet24,
author = {Jianfa Bai and Man Lin and Gang Cao and Zijie Lou},
title = {{AI-generated video detection via spatial-temporal anomaly learning}},
conference = {The 7th Chinese Conference on Pattern Recognition and Computer Vision (PRCV)},
year = {2024},}

Contact

If you have any questions, please contact us(lyan924@cuc.edu.cn).

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support