Skip to content

Source code of the paper: AI-Generated Video Detection via Spatial-Temporal Anomaly Learning, PRCV 2024.

Notifications You must be signed in to change notification settings

multimediaFor/AIGVDet

Repository files navigation

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 Baiduyun Link(extract code: ujs3).

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.
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.
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([email protected]).

About

Source code of the paper: AI-Generated Video Detection via Spatial-Temporal Anomaly Learning, PRCV 2024.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages