Code implementation for Efficient Quantized Vision Transformers for Deepfake Detection
Paper submission currently under review
-
models/bitlinear.py: code implementations of the BitLinear layer, and RMSNorm -
models/dataloader.py: custom dataloader class for faster training -
models/deepfake.py: custom deepfake classifier, ViT wrapper, and EfficientNet baseline detector -
models/distill.py: code implementation for knowledge distillation with hard-label loss -
models/utils.py: utility functions for parameter stats and model size estimation -
models/vit.py: code implementation of LinViT (ViT) and BitViT models using SPT, sincos2d, and GAP -
train.py: example training/fine-tuning code -
pretrain.ipynb: example pre-training config -
finetune.ipynb: example fine-tuning config
Models:
torch>= v2.1.0einops>= 0.8.0
See environment.yml for full environment used for the thesis research.
MIT