File size: 3,782 Bytes
b0939c7
d5cc996
b0939c7
d5cc996
b0939c7
 
d5cc996
 
 
 
 
 
 
 
 
bab4491
d5cc996
 
 
 
 
 
 
 
 
 
 
46829b0
d5cc996
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46829b0
d5cc996
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
---

metrics:

- accuracy
- f1

---

# NotUrFace-AI: Deepfake Detection Model

## Model Details

### Model Description

NotUrFace-AI is a deepfake detection model designed to classify video content as real or fake. It processes first 30-50 video frames using **TensorFlow** and applies advanced machine learning techniques to identify synthetic or manipulated media. This is a passion project aimed at combating deepfake proliferation. The model is particularly useful for:

- **Social media content moderation**
- **Digital forensics**
- **Research in deepfake detection and AI ethics**

**Developer:** Sarvansh Pachori  
**Model Type:** Deepfake detection (video-based classification)  
**Finetuned from:** XceptionNet (pretrained)  

### Model Sources

- **Repository:** [sarvansh30/NotUrFace-AI](https://github.com/sarvansh30/NotUrFace-AI)  
- **Demo:** [Hugging Face Space](https://huggingface.co/spaces/sarvansh/NotUrFace-AI)  

## Usage

### Direct Use

- Classifying videos as real or fake for research, moderation, or forensic purposes.

### Downstream Use

- The model can be fine-tuned with additional deepfake datasets for improved detection on specific video types.

### Out-of-Scope Use

- The model is not intended for legal decision-making or high-stakes scenarios where absolute certainty is required.

## Bias, Risks, and Limitations

- Accuracy may vary depending on dataset bias and the quality of input videos.
- False positives or false negatives can occur, requiring human verification for critical applications.
- It may struggle with detecting highly sophisticated, unseen deepfake techniques.

### Recommendations

- Users should validate outputs in real-world applications before making critical decisions.
- Future improvements may include training on a more diverse dataset to reduce bias.

## Getting Started

Use the following code snippet to get started:

```python
from transformers import AutoModelForImageClassification, AutoTokenizer

model = AutoModelForImageClassification.from_pretrained("sarvansh/NotUrFace-AI")
tokenizer = AutoTokenizer.from_pretrained("sarvansh/NotUrFace-AI")
```

## Evaluation

### Testing Data, Factors & Metrics

#### Testing Data

The model was tested on unseen samples from the FaceForensics++ and CelebDFv2 datasets.

#### Metrics

- **Accuracy**: Measures correct classifications.
- **F1 Score**: Balances precision and recall.

### Results

| Metric              | Value  |
| ------------------- | ------ |
| Training Accuracy   | 98.44% |
| Validation Accuracy | 97.05% |
| Test Accuracy       | 95.93% |

**Disclaimer:** These results were obtained using the FaceForensics++ and CelebDFv2 datasets. Performance in real-world scenarios may vary.

### Tips for Best Performance

- The model works best with videos that have **proper lighting**.
- It only analyzes the **first 1-1.5 seconds** of a video, so ensure the clip is appropriately selected for evaluation.

## Model Architecture and Objective

- **Feature Extraction:** XceptionNet (pretrained on ImageNet) to extract spatial features.
- **Temporal Analysis:** LSTM layers to analyze frame dependencies.
- **Classification:** Fully connected layers for final binary classification.

## Citation

If using this model in research, please cite:

**BibTeX:**

```
@article{noturface-ai,
  author = {Sarvansh Pachori},
  title = {NotUrFace-AI: Deepfake Detection Model},
  year = {2024},
  journal = {Hugging Face Model Hub},
  url = {https://huggingface.co/sarvansh/NotUrFace-AI}
}
```

## Contact Information

For any issues, improvements, or inquiries, contact:

- **Author:** Sarvansh Pachori  
- **Email:** [sarvansh.pachori45@gmail.com](mailto:sarvansh.pachori45@gmail.com)  
- **My Github profile:** [sarvansh30](https://github.com/sarvansh30)   

---