![5.png](https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/4XTyNBg6dGiKXQuFlPoXn.png)

# **Deepfake-QualityAssess-85M**

Deepfake-QualityAssess-85M is an image classification model for quality assessment of good and bad quality deepfakes. It is based on Google's ViT model (`google/vit-base-patch16-224-in21k`).  

A reasonable number of training samples were used to achieve good efficiency in the final training process and its efficiency metrics. Since this task involves classifying deepfake images with varying quality levels, the model was trained accordingly. Future improvements will be made based on the complexity of the task.

```python
  id2label: {
    "0": "Issue In Deepfake",
    "1": "High Quality Deepfake"
  }
```

```python
      Classification report:
      
                             precision    recall  f1-score   support
      
          Issue In Deepfake     0.7962    0.8067    0.8014      1500
      High Quality Deepfake     0.7877    0.7767    0.7822      1500
      
                   accuracy                         0.7940      3000
                  macro avg     0.7920    0.7917    0.7918      3000
               weighted avg     0.7920    0.7917    0.7918      3000
```
# **Inference with Hugging Face Pipeline**
```python
from transformers import pipeline

# Load the model
pipe = pipeline('image-classification', model="prithivMLmods/Deepfake-QualityAssess-85M", device=0)

# Predict on an image
result = pipe("path_to_image.jpg")
print(result)
```

# **Inference with PyTorch**
```python
from transformers import ViTForImageClassification, ViTImageProcessor
from PIL import Image
import torch

# Load the model and processor
model = ViTForImageClassification.from_pretrained("prithivMLmods/Deepfake-QualityAssess-85M")
processor = ViTImageProcessor.from_pretrained("prithivMLmods/Deepfake-QualityAssess-85M")

# Load and preprocess the image
image = Image.open("path_to_image.jpg").convert("RGB")
inputs = processor(images=image, return_tensors="pt")

# Perform inference
with torch.no_grad():
    outputs = model(**inputs)
    logits = outputs.logits
    predicted_class = torch.argmax(logits, dim=1).item()

# Map class index to label
label = model.config.id2label[predicted_class]
print(f"Predicted Label: {label}")
```
# **Limitations of Deepfake-QualityAssess-85M**  
1. **Limited Generalization** – The model is trained on specific datasets and may not generalize well to unseen deepfake generation techniques or novel deepfake artifacts.  
2. **Variability in Deepfake Quality** – Different deepfake creation methods introduce varying levels of noise and artifacts, which may affect model performance.  
3. **Dependence on Training Data** – The model's accuracy is influenced by the quality and diversity of the training data. Biases in the dataset could lead to misclassification.  
4. **Resolution Sensitivity** – Performance may degrade when analyzing extremely high- or low-resolution images not seen during training.  
5. **Potential False Positives/Negatives** – The model may sometimes misclassify good-quality deepfakes as bad (or vice versa), limiting its reliability in critical applications.  
6. **Lack of Explainability** – Being based on a ViT (Vision Transformer), the decision-making process is less interpretable than traditional models, making it harder to analyze why certain classifications are made.  
7. **Not a Deepfake Detector** – This model assesses the quality of deepfakes but does not determine whether an image is real or fake.  

# **Intended Use of Deepfake-QualityAssess-85M**  
- **Quality Assessment for Research** – Used by researchers to analyze and improve deepfake generation methods by assessing output quality.  
- **Dataset Filtering** – Helps filter out low-quality deepfake samples in datasets for better training of deepfake detection models.  
- **Forensic Analysis** – Supports forensic teams in evaluating deepfake quality to prioritize high-quality samples for deeper analysis.  
- **Content Moderation** – Assists social media platforms and content moderation teams in assessing deepfake quality before deciding on further actions.  
- **Benchmarking Deepfake Models** – Used to compare and evaluate different deepfake generation models based on their output quality.  

issue in deepfake high quality deepfake