|
--- |
|
language: en |
|
license: mit |
|
tags: |
|
- deepfake |
|
- video-classification |
|
- pytorch |
|
- computer-vision |
|
datasets: |
|
- custom |
|
pipeline_tag: video-classification |
|
widget: |
|
- example_title: Deepfake Detection |
|
example_input: "Upload a video to detect if it's real or fake" |
|
--- |
|
|
|
# DeepFake Detection Model |
|
|
|
This model detects deepfake videos using a combination of ResNext50 and LSTM architecture. It analyzes video frames to determine if a video is authentic or manipulated. |
|
|
|
## Model Details |
|
|
|
- **Model Type:** Video Classification |
|
- **Task:** Deepfake Detection |
|
- **Framework:** PyTorch |
|
- **Training Data:** Deepfake video datasets |
|
- **Accuracy:** 87% on test datasets |
|
- **Output:** Binary classification (real/fake) with confidence score |
|
|
|
## Usage |
|
|
|
```python |
|
from transformers import pipeline |
|
|
|
# Load the model |
|
detector = pipeline("video-classification", model="tayyabimam/Deepfake") |
|
|
|
# Analyze a video |
|
result = detector("path/to/video.mp4") |
|
print(result) |
|
``` |
|
|
|
## API Usage |
|
|
|
You can also use this model through the Hugging Face Inference API: |
|
|
|
```python |
|
import requests |
|
|
|
API_URL = "https://api-inference.huggingface.co/models/tayyabimam/Deepfake" |
|
headers = {"Authorization": "Bearer YOUR_API_TOKEN"} |
|
|
|
def query(video_path): |
|
with open(video_path, "rb") as f: |
|
data = f.read() |
|
response = requests.post(API_URL, headers=headers, data=data) |
|
return response.json() |
|
|
|
result = query("path/to/video.mp4") |
|
print(result) |
|
``` |
|
|
|
## Model Architecture |
|
|
|
The model uses a ResNext50 backbone to extract features from video frames, followed by an LSTM to capture temporal relationships between frames. This architecture is particularly effective for detecting manipulation artifacts that appear across multiple frames in deepfake videos. |
|
|
|
## Limitations |
|
|
|
- The model works best with videos that include human faces |
|
- Performance may vary with different video qualities and resolutions |
|
- The model is designed for 20-frame sequences for optimal performance |
|
|