Downloads · 30 days
0
Harshasnade/Deepfake_Detection_System_V1
Deepfake_Detection_System_V1 is a image classification model from Harshasnade. Use it when you need a label for an image. It is set up for pytorch. The card lists the license as mit.
[](https://deepfakescan.vercel.app/) [](https://github.com/Harshvardhan-Asnade/Deepfake-Model)
Downloads · 30 days
0
Access
Public
Updated Dec 28, 2025
Repo size
202 MB
Likes
0
Public
Click a slice to open those files.
.safetensors202 MB · 100%
From the Hugging Face model README
DeepGuard is a robust Deepfake Detection System designed to identify AI-generated images with high precision. It employs an ensemble architecture combining EfficientNetV2-S and Swin Transformer V2-T with a custom Convolutional Neural Network (CNN) head. This hybrid approach leverages both local feature extraction (CNN) and global context understanding (Transformers) to spot manipulation artifacts often invisible to the human eye.
The model is designed to classify single images as either REAL or FAKE. It outputs a probability score (0.0 - 1.0) and a confidence metric. It is suitable for:
import torch
import torch.nn as nn
from torchvision import models
from safetensors.torch import load_file
import cv2
# Define Model Architecture
class DeepfakeDetector(nn.Module):
def __init__(self, pretrained=False):
super(DeepfakeDetector, self).__init__()
self.efficientnet = models.efficientnet_v2_s(weights='DEFAULT' if pretrained else None)
self.swin = models.swin_v2_t(weights='DEFAULT' if pretrained else None)
self.efficientnet.classifier = nn.Identity()
self.swin.head = nn.Identity()
self.classifier = nn.Sequential(
nn.Linear(1280 + 768, 512),
nn.BatchNorm1d(512),
nn.ReLU(),
nn.Dropout(0.4),
nn.Linear(512, 1)
)
def forward(self, x):
f1 = self.efficientnet(x)
f2 = self.swin(x)
combined = torch.cat((f1, f2), dim=1)
return self.classifier(combined)
# Load Model
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = DeepfakeDetector(pretrained=False).to(device)
state_dict = load_file("best_model.safetensors")
model.load_state_dict(state_dict)
model.eval()
The model was trained on a diverse dataset comprising:
The model achieves high accuracy on standard benchmarks:
@misc{deepguard2024,
author = {Asnade, Harshvardhan},
title = {DeepGuard: Ensemble Deepfake Detection System},
year = {2024},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/Harshasnade/Deepfake_Detection_System_V1}}
}