awpbash/govtech_indepth

Python

1

5 commits

updated Sep 12, 2025

See the code

README

Govtech Indepth: Detecting deepfakes

Overview

This project provides a brief overview and platform for benchmarking deepfake detection technology. Everything here was done or obtained using FREE / open-source services only.

This is me below!

me

Data

As part of the requirements for Task 1, real and generated images were collected in order to benchmark the detectors we are interested in. The data was obtained from a variety of sources, including 'from the wild', faceswapping, and self generated images based on fixed prompts. Some images were generated to mimick certain specific persons and actions in order to stress test the detectors.

More info about the data collection process can be found here!

Models

3 models of different architectures were used to classify the images into either Real or Fake. These models were chosen as they are open-source and lightweight which means we can achieve considerable results without a commercial GPU.

ModelArchitectureSourceChallenges
Deep-Fake-Detector-v2-ModelViThttps://huggingface.co/prithivMLmods/Deep-Fake-Detector-v2-ModelThe labels are different so had to decode, and I realised changing the thresholding helps or else the standard 0.5 will just classify everything as Fake
Deepfake-Detect-Siglip2SigLiphttps://huggingface.co/prithivMLmods/Deepfake-Detect-Siglip2nil
DeepFake-DetectorCNNhttps://huggingface.co/MaanVad3r/DeepFake-DetectorPretty old and basic model so we dont expect good performance

Reproduction

This repo contains 2 functions, either run an automated pipeline for mass evalualtion via pipeline.py or create an interface for users to evaluate individual images via Gradio app.py

For Gradio app

git clone
docker build -t deepfake-benchmarking .
docker run -p 7860:7860 deepfake-benchmarking

go to http://127.0.0.1:7860/

For automated pipeline

docker run --rm deepfake-benchmarking python pipeline.py

This was developed in windows with Nvidia 4060 GPU

Gradio interface

Upload your image here to see if the detectors work or not lol.

alt text

Analysis

This section contains analysis of the performances of the 3 detectors on my curated dataset. I measure their performances by Accuracy, Precision, Recall, F1 score.

Overall metrics:

overall

Detector Performance - Confusion Matrices

CNNSiglipViT
CNN Confusion MatrixSiglip Confusion MatrixViT Confusion Matrix

Sample prediction

A random sample of images was taken and the model predictions are shown:

prediction

From all above, we can conclude that the models tend to err on the safe side and have a high tendancy to predict Fake, resulting 'high' accuracy in detecting fake images, but also a lot of misclassifications in terms of False Positives.

Thoughts

  1. It was quite challenging to gather enough deepfake images in the wild which is a good thing meaning it is either being filtered out or just not as common YET.
  2. Many prompts could not generate me the images that I want (such as SM Lee shaking hands with an alien) so LLM providers have put in certain safeguards which is good.
  3. The models I have used are pretty basic and low compute so the low performance is expected. Or that the images that have been generated are trained on evading these detectors so IDK.

awpbash/govtech_indepth

Python

1

5 commits

updated Sep 12, 2025

See the code

README

Govtech Indepth: Detecting deepfakes

Overview

This project provides a brief overview and platform for benchmarking deepfake detection technology. Everything here was done or obtained using FREE / open-source services only.

This is me below!

me

Data

As part of the requirements for Task 1, real and generated images were collected in order to benchmark the detectors we are interested in. The data was obtained from a variety of sources, including 'from the wild', faceswapping, and self generated images based on fixed prompts. Some images were generated to mimick certain specific persons and actions in order to stress test the detectors.

More info about the data collection process can be found here!

Models

3 models of different architectures were used to classify the images into either Real or Fake. These models were chosen as they are open-source and lightweight which means we can achieve considerable results without a commercial GPU.

ModelArchitectureSourceChallenges
Deep-Fake-Detector-v2-ModelViThttps://huggingface.co/prithivMLmods/Deep-Fake-Detector-v2-ModelThe labels are different so had to decode, and I realised changing the thresholding helps or else the standard 0.5 will just classify everything as Fake
Deepfake-Detect-Siglip2SigLiphttps://huggingface.co/prithivMLmods/Deepfake-Detect-Siglip2nil
DeepFake-DetectorCNNhttps://huggingface.co/MaanVad3r/DeepFake-DetectorPretty old and basic model so we dont expect good performance

Reproduction

This repo contains 2 functions, either run an automated pipeline for mass evalualtion via pipeline.py or create an interface for users to evaluate individual images via Gradio app.py

For Gradio app

git clone
docker build -t deepfake-benchmarking .
docker run -p 7860:7860 deepfake-benchmarking

go to http://127.0.0.1:7860/

For automated pipeline

docker run --rm deepfake-benchmarking python pipeline.py

This was developed in windows with Nvidia 4060 GPU

Gradio interface

Upload your image here to see if the detectors work or not lol.

alt text

Analysis

This section contains analysis of the performances of the 3 detectors on my curated dataset. I measure their performances by Accuracy, Precision, Recall, F1 score.

Overall metrics:

overall

Detector Performance - Confusion Matrices

CNNSiglipViT
CNN Confusion MatrixSiglip Confusion MatrixViT Confusion Matrix

Sample prediction

A random sample of images was taken and the model predictions are shown:

prediction

From all above, we can conclude that the models tend to err on the safe side and have a high tendancy to predict Fake, resulting 'high' accuracy in detecting fake images, but also a lot of misclassifications in terms of False Positives.

Thoughts

  1. It was quite challenging to gather enough deepfake images in the wild which is a good thing meaning it is either being filtered out or just not as common YET.
  2. Many prompts could not generate me the images that I want (such as SM Lee shaking hands with an alien) so LLM providers have put in certain safeguards which is good.
  3. The models I have used are pretty basic and low compute so the low performance is expected. Or that the images that have been generated are trained on evading these detectors so IDK.