Update README.md
Browse files
README.md
CHANGED
|
@@ -1,5 +1,126 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
metrics:
|
|
|
|
| 3 |
- accuracy
|
| 4 |
- f1
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
|
| 3 |
metrics:
|
| 4 |
+
|
| 5 |
- accuracy
|
| 6 |
- f1
|
| 7 |
+
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# NotUrFace-AI: Deepfake Detection Model
|
| 11 |
+
|
| 12 |
+
## Model Details
|
| 13 |
+
|
| 14 |
+
### Model Description
|
| 15 |
+
|
| 16 |
+
NotUrFace-AI is a deepfake detection model designed to classify video content as real or fake. It processes 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:
|
| 17 |
+
|
| 18 |
+
- **Social media content moderation**
|
| 19 |
+
- **Digital forensics**
|
| 20 |
+
- **Research in deepfake detection and AI ethics**
|
| 21 |
+
|
| 22 |
+
**Developer:** Sarvansh Pachori
|
| 23 |
+
**Model Type:** Deepfake detection (video-based classification)
|
| 24 |
+
**Finetuned from:** XceptionNet (pretrained)
|
| 25 |
+
|
| 26 |
+
### Model Sources
|
| 27 |
+
|
| 28 |
+
- **Repository:** [GitHub Repository](https://github.com/username/NotUrFace-AI)
|
| 29 |
+
- **Demo:** [Hugging Face Space](https://huggingface.co/spaces/sarvansh/NotUrFace-AI)
|
| 30 |
+
|
| 31 |
+
## Usage
|
| 32 |
+
|
| 33 |
+
### Direct Use
|
| 34 |
+
|
| 35 |
+
- Classifying videos as real or fake for research, moderation, or forensic purposes.
|
| 36 |
+
|
| 37 |
+
### Downstream Use
|
| 38 |
+
|
| 39 |
+
- The model can be fine-tuned with additional deepfake datasets for improved detection on specific video types.
|
| 40 |
+
|
| 41 |
+
### Out-of-Scope Use
|
| 42 |
+
|
| 43 |
+
- The model is not intended for legal decision-making or high-stakes scenarios where absolute certainty is required.
|
| 44 |
+
|
| 45 |
+
## Bias, Risks, and Limitations
|
| 46 |
+
|
| 47 |
+
- Accuracy may vary depending on dataset bias and the quality of input videos.
|
| 48 |
+
- False positives or false negatives can occur, requiring human verification for critical applications.
|
| 49 |
+
- It may struggle with detecting highly sophisticated, unseen deepfake techniques.
|
| 50 |
+
|
| 51 |
+
### Recommendations
|
| 52 |
+
|
| 53 |
+
- Users should validate outputs in real-world applications before making critical decisions.
|
| 54 |
+
- Future improvements may include training on a more diverse dataset to reduce bias.
|
| 55 |
+
|
| 56 |
+
## Getting Started
|
| 57 |
+
|
| 58 |
+
Use the following code snippet to get started:
|
| 59 |
+
|
| 60 |
+
```python
|
| 61 |
+
from transformers import AutoModelForImageClassification, AutoTokenizer
|
| 62 |
+
|
| 63 |
+
model = AutoModelForImageClassification.from_pretrained("sarvansh/NotUrFace-AI")
|
| 64 |
+
tokenizer = AutoTokenizer.from_pretrained("sarvansh/NotUrFace-AI")
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
## Evaluation
|
| 68 |
+
|
| 69 |
+
### Testing Data, Factors & Metrics
|
| 70 |
+
|
| 71 |
+
#### Testing Data
|
| 72 |
+
|
| 73 |
+
The model was tested on unseen samples from the FaceForensics++ and CelebDFv2 datasets.
|
| 74 |
+
|
| 75 |
+
#### Metrics
|
| 76 |
+
|
| 77 |
+
- **Accuracy**: Measures correct classifications.
|
| 78 |
+
- **F1 Score**: Balances precision and recall.
|
| 79 |
+
|
| 80 |
+
### Results
|
| 81 |
+
|
| 82 |
+
| Metric | Value |
|
| 83 |
+
| ------------------- | ------ |
|
| 84 |
+
| Training Accuracy | 98.44% |
|
| 85 |
+
| Validation Accuracy | 97.05% |
|
| 86 |
+
| Test Accuracy | 95.93% |
|
| 87 |
+
|
| 88 |
+
**Disclaimer:** These results were obtained using the FaceForensics++ and CelebDFv2 datasets. Performance in real-world scenarios may vary.
|
| 89 |
+
|
| 90 |
+
### Tips for Best Performance
|
| 91 |
+
|
| 92 |
+
- The model works best with videos that have **proper lighting**.
|
| 93 |
+
- It only analyzes the **first 1-1.5 seconds** of a video, so ensure the clip is appropriately selected for evaluation.
|
| 94 |
+
|
| 95 |
+
## Model Architecture and Objective
|
| 96 |
+
|
| 97 |
+
- **Feature Extraction:** XceptionNet (pretrained on ImageNet) to extract spatial features.
|
| 98 |
+
- **Temporal Analysis:** LSTM layers to analyze frame dependencies.
|
| 99 |
+
- **Classification:** Fully connected layers for final binary classification.
|
| 100 |
+
|
| 101 |
+
## Citation
|
| 102 |
+
|
| 103 |
+
If using this model in research, please cite:
|
| 104 |
+
|
| 105 |
+
**BibTeX:**
|
| 106 |
+
|
| 107 |
+
```
|
| 108 |
+
@article{noturface-ai,
|
| 109 |
+
author = {Sarvansh Pachori},
|
| 110 |
+
title = {NotUrFace-AI: Deepfake Detection Model},
|
| 111 |
+
year = {2024},
|
| 112 |
+
journal = {Hugging Face Model Hub},
|
| 113 |
+
url = {https://huggingface.co/sarvansh/NotUrFace-AI}
|
| 114 |
+
}
|
| 115 |
+
```
|
| 116 |
+
|
| 117 |
+
## Contact Information
|
| 118 |
+
|
| 119 |
+
For any issues, improvements, or inquiries, contact:
|
| 120 |
+
|
| 121 |
+
- **Author:** Sarvansh Pachori
|
| 122 |
+
- **Email:** [sarvansh.pachori45@gmail.com](mailto:sarvansh.pachori45@gmail.com)
|
| 123 |
+
- **GitHub Issues:** [GitHub Repository](https://github.com/sarvansh30/NotUrFace-AI)
|
| 124 |
+
|
| 125 |
+
---
|
| 126 |
+
|