• Stars
    star
    114
  • Rank 308,031 (Top 7 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created about 5 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Implementation of the Capsule-Forensics-v2

Capsule-Forensics-v2

Implementation of the paper: Use of a Capsule Network to Detect Fake Images and Videos, which is an updated version of the previous work: Capsule-Forensics: Using Capsule Networks to Detect Forged Images and Videos (ICASSP 2019).

You can clone this repository into your favorite directory:

$ git clone https://github.com/nii-yamagishilab/Capsule-Forensics-v2

1. Requirement

  • PyTorch 1.3
  • TorchVision
  • scikit-learn
  • Numpy

2. Project organization

  • Databases folder, where you can place your training, evaluation, and test set:

    ./databases/<faceforensicspp; cgvsphoto_patches; cgvsphoto_full; replay_attack>/<train; validation; test>
    
  • Checkpoint folder, where the training outputs will be stored:

    ./checkpoints/<binary_faceforensicspp (without NeuralTextures); binary_faceforensicspp_v2_full (with NeuralTextures); multiclass_faceforensicspp; cgvsphoto; replay_attack>
    

Pre-trained models for the FaceForensics++ database (includes Real, DeepFakes, Face2Face, FaceSwap, and NeuralTextures), the CGvsPhoto database, and the Replay-Attack database (with settings described in our paper) are provided in the checkpoints folder.

3. Databases

In case of the FaceForensics++ database, it need to be pre-processed to crop facial area. We recommend using an image size of 300 x 300 as the input.

Scripts for data preprocessing can be found at datascripts directory.

4. Training

Note: Parameters with detail explanation could be found in the corresponding source code.

Training the Capsule-Forensics-v2 using binary classification on the FaceForensics++ database:

$ python train_binary_ffpp.py

Training the Capsule-Forensics-v2 using multiclass classification on the FaceForensics++ database:

$ python train_multiclass_ffpp.py

Training the Capsule-Forensics-v2 on the CGvsPhoto database:

$ python train_cgvsphoto.py

Training the Capsule-Forensics-v2 on the Idiap Replay-Attack database:

$ python train_replay_attack.py

5. Evaluating

Note: Parameters with detail explanation could be found in the corresponding source code.

5.1. FaceForensics++ database (includes Real, DeepFakes, Face2Face, and FaceSwap)

Binary classification on images:

$ python test_binary_ffpp.py

Binary classification on videos (extracted as frames):

$ python test_vid_binary_ffpp.py

Multiclass classification on images:

$ python test_multiclass_ffpp.py

Multiclass classification on images with detail results on each class:

$ python test_multiclass_detail_ffpp.py

Multiclass classification on videos (extracted as frames):

$ python test_vid_multiclass_ffpp.py

5.2. CGvsPhoto database

Testing on patches:

$ python test_cgvsphoto.py

Testing on full images:

$ python test_cgvsphoto_full.py

5.3. Idiap Replay-Attack database

Testing on images:

$ python test_replay_attack.py

6. Authors

Acknowledgement

This research was supported by JSPS KAKENHI Grants JP16H06302 and JP18H04120 and by JST CREST Grant JPMJCR18A6, Japan.

Reference

H. H. Nguyen, J. Yamagishi, and I. Echizen, “Use of a Capsule Network to Detect Fake Images and Videos,” arXiv preprint arXiv:1910.12467. 2019 Oct 29.

More Repositories

1

project-NN-Pytorch-scripts

see README
Python
275
star
2

multi-speaker-tacotron

VCTK multi-speaker tacotron for ICASSP 2020
Python
262
star
3

self-attention-tacotron

An implementation of "Investigation of enhanced Tacotron text-to-speech synthesis systems with self-attention for pitch accent language" https://arxiv.org/abs/1810.11960
Python
113
star
4

ZMM-TTS

ZMM-TTS: Zero-shot Multilingual and Multispeaker Speech Synthesis Conditioned on Self-supervised Discrete Speech Representations
C
96
star
5

tacotron2

An implementation of Tacotron and Tacotron2
Python
81
star
6

project-CURRENNT-public

CURRENNNT codes and scripts
Cuda
76
star
7

ClassNSeg

Implementation and demonstration of the paper: Multi-task Learning for Detecting and Segmenting Manipulated Facial Images and Videos
Python
75
star
8

project-CURRENNT-scripts

This repository contains the scripts to use CURRENNT
Python
64
star
9

mos-finetune-ssl

Python
63
star
10

Extended_VQVAE

Python
59
star
11

Intelligibility-MetricGAN

Implementation for paper "iMetricGAN: Intelligibility Enhancement for Speech-in-Noise using Generative Adversarial Network-based Metric Learning"
Python
51
star
12

VCC2020-database

49
star
13

Attention_Backend_for_ASV

Attention Backend for Aotumatic Speaker Verification with Multiple Enrollment Utterances
Python
45
star
14

TSNetVocoder

Python
42
star
15

Capsule-Forensics

Old implementation and demonstration of the Capsule-Forensics. The Capsule-Forensics-v2 has been released here: https://github.com/nii-yamagishilab/capsule-forensics-v2
Python
31
star
16

midi-to-audio

Project for MIDI to Audio Synthesis
Shell
19
star
17

vctk-silence-labels

19
star
18

NELE-GAN

Implementation for paper: Multi-Metric Optimization using Generative Adversarial Networks for Near-End Speech Intelligibility Enhancement
Python
18
star
19

PartialSpoof

Jupyter Notebook
17
star
20

speaker_sex_attribute_privacy

Project for HIDING SPEAKER’S SEX IN SPEECH USING ZERO-EVIDENCE SPEAKER REPRESENTATION IN AN ANALYSIS/SYNTHESIS PIPELINE
Python
14
star
21

SSL-SAS

Language independent SSL-based Speaker Anonymization system
Python
11
star
22

ssnt-tts

An implementation of SSNT-TTS.
Python
6
star
23

mla

A Multi-Level Attention Model for Evidence-Based Fact Checking
Python
4
star
24

downloader-DR-VCTK-complete

downloader to obtain the complete DR-VCTK dataset (250GB)
Python
4
star
25

Modular-CNN-for-CGIs-PIs-discrimination

Python
2
star
26

ewc

Python
2
star
27

fashion_adv

Fashion-Guided Adversarial Attack on Person Segmentation
Python
2
star
28

partial_rank_similarity

Jupyter Notebook
2
star
29

VCC2020-listeningtest

1
star
30

xfever

Shell
1
star
31

Generalization_of_CMs_regularizations

The source code for the paper Improving Generalization Ability of Countermeasures for New Mismatch Scenario by Combining Multiple Advanced Regularization Terms (interspeech2023)
Python
1
star