Deepfake Quality Assessment
Collection
Controllable Classification of Good and Bad Quality Deepfakes
•
6 items
•
Updated
•
6
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.
id2label: {
"0": "Issue In Deepfake",
"1": "High Quality Deepfake"
}
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
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)
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}")