Deepfake Quality Assessment
Collection
Controllable Classification of Good and Bad Quality Deepfakes
•
10 items
•
Updated
•
8
Deepfake-QualityAssess2.1-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-patch32-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.7851 0.7380 0.7610 2000
High Quality Deepfake 0.7765 0.8250 0.8000 2000
accuracy 0.7815 4000
macro avg 0.7808 0.7815 0.7805 4000
weighted avg 0.7808 0.7815 0.7805 4000
from transformers import pipeline
# Load the model
pipe = pipeline('image-classification', model="prithivMLmods/Deepfake-QualityAssess2.1-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-QualityAssess2.1-85M")
processor = ViTImageProcessor.from_pretrained("prithivMLmods/Deepfake-QualityAssess2.1-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}")