Downloads · 30 days
12
1% of all-time downloads
byh711/FLODA-deepfake
FLODA-deepfake is a visual question answering model from byh711. Use it for the visual question answering task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as apache-2.0.
FLODA (FLorence-2 Optimized for Deepfake Assessment) is an advanced deepfake detection model that leverages the power of Vision-Language Models (VLMs). It's designed to surpass existing deepfake detection models by in…
Downloads · 30 days
12
1% of all-time downloads
All-time downloads
1.7K
Public
Repo size
24.1 MB
Likes
0
Public
Click a slice to open those files.
.safetensors12 MB · 75%
From the Hugging Face model README
FLODA (FLorence-2 Optimized for Deepfake Assessment) is an advanced deepfake detection model that leverages the power of Vision-Language Models (VLMs). It's designed to surpass existing deepfake detection models by integrating image captioning and authenticity assessment into a single end-to-end architecture.
FLODA is based on the Florence-2 model and consists of two main components:
The model is fine-tuned using rsLoRA, with the following configuration:
FLODA achieves state-of-the-art performance in deepfake detection:
from transformers import AutoProcessor, AutoModelForCausalLM
from PIL import Image
import torch
# Load the model and processor
model_path = "path/to/floda/model"
model = AutoModelForCausalLM.from_pretrained(model_path, trust_remote_code=True).to("cuda").eval()
processor = AutoProcessor.from_pretrained(model_path, trust_remote_code=True)
def detect_deepfake(image_path):
image = Image.open(image_path).convert("RGB")
task_prompt = "<DEEPFAKE_DETECTION>"
text_input = "Is this photo real?"
inputs = processor(text=task_prompt + text_input, images=image, return_tensors="pt").to("cuda")
with torch.no_grad():
generated_ids = model.generate(
input_ids=inputs["input_ids"],
pixel_values=inputs["pixel_values"],
max_new_tokens=1024,
num_beams=3
)
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=False)[0]
result = processor.post_process_generation(generated_text, task=task_prompt, image_size=(image.width, image.height))[task_prompt]
return "Real" if result.lower() == "yes" else "Fake"
# Example usage
result = detect_deepfake("path/to/image.jpg")
print(f"The image is: {result}")
FLODA was trained on a dataset including:
The model was evaluated on 16 datasets:
While FLODA shows promising results in deepfake detection, it's important to consider:
For inquiries about this model card or the FLODA model, please contact:
Youngho Bae Email: [email protected]