Views
No views yet
google/siglip-base-patch16-512 model (specifically initialized from prithivMLmods/deepfake-detector-model-v1) to classify images as either "Real" or "Fake".OpenRL/DeepFakeFace dataset, containing 12,000 images. Due to hardware constraints, this subset was carefully selected to ensure diverse representation of various generative techniques (Stable Diffusion, Inpainting, InsightFace).r=16), making training feasible on consumer GPUs.ColorJitter, RandomResizedCrop, RandomRotation, RandomAdjustSharpness, and GaussianBlur to improve model generalization.google/siglip-base-patch16-512prithivMLmods/deepfake-detector-model-v1q_proj, v_projOpenRL/DeepFakeFace. A balanced subset of 12,000 images was curated using a custom selection script.| Class | Count | Source / Generator | Description |
|---|---|---|---|
| Real | 6,000 | wiki dataset | Real human faces from Wikipedia |
| Fake | 2,000 | text2img | Generated via Stable Diffusion v1.5 |
| Fake | 2,000 | inpainting | Generated via SD Inpainting |
| Fake | 2,000 | insight | Generated via InsightFace |
Trainer API with the following configuration:

1from transformers import pipeline
2
3# Load the pipeline
4pipe = pipeline("image-classification", model="shunda012/siglip-deepfake-detector")
5
6# Predict on an image
7image_path = "path_to_image.jpg"
8result = pipe(image_path)
9print(result)1from transformers import SiglipForImageClassification, AutoImageProcessor
2import torch
3from PIL import Image
4
5# Load Model & Processor
6model = SiglipForImageClassification.from_pretrained("shunda012/siglip-deepfake-detector")
7processor = AutoImageProcessor.from_pretrained("shunda012/siglip-deepfake-detector")
8
9# Move model to GPU if available
10device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
11model.to(device)
12
13# Load and preprocess the image
14image = Image.open("path_to_image.jpg").convert("RGB")
15inputs = processor(images=image, return_tensors="pt").to(device)
16
17# Predict
18with torch.no_grad():
19 outputs = model(**inputs)
20 logits = outputs.logits
21 probs = torch.softmax(logits, dim=-1)
22 predicted_class_idx = torch.argmax(probs, dim=-1).item()
23
24# Get label
25id2label = model.config.id2label
26predicted_label = id2label[predicted_class_idx]
27confidence = probs[0][predicted_class_idx].item()
28
29print(f"Prediction: {predicted_label} ({confidence:.2%})")
30print(f"Probabilities: {probs[0].tolist()}")