OpenFake SwinV2-base detector

A real vs AI-generated image classifier: SwinV2-base with a 2-class head, fine-tuned on OpenFake.

This is not our model. It is the detector shipped in the ComplexDataLab/OpenFakeDemo Space (checkpoint dated 2026-05-28), built by Victor Livernoche and the OpenFake authors at the Complex Data Lab (McGill / Mila). It is re-hosted here, under the Space's CC-BY-NC-4.0 licence, as a standard transformers model so it can be loaded with from_pretrained and used as the base for adapters such as bendavidsteel/openfake-swinv2-base-textgraphics-lora. The weights are unchanged; they score bit-identically to the Space's own loader.

For the training data, recipe and benchmark results, see the OpenFake paper and dataset card.

Usage

Divide the logits by 2.0 before the softmax, as the Demo does. Without it, probabilities are not comparable to the Demo's or to thresholds tuned against it.

import torch
from PIL import Image
from transformers import AutoImageProcessor, AutoModelForImageClassification

repo = "bendavidsteel/openfake-swinv2-base"
processor = AutoImageProcessor.from_pretrained(repo)
model = AutoModelForImageClassification.from_pretrained(repo).eval()

image = Image.open("image.jpg").convert("RGB")
with torch.no_grad():
    logits = model(**processor(images=image, return_tensors="pt")).logits
p_fake = (logits / 2.0).softmax(-1)[0, 1].item()   # label 1 = fake (AI-generated)
architecture microsoft/swinv2-base-patch4-window16-256, 2-class linear head
labels 0 = real, 1 = fake
input 256×256, standard SwinV2 preprocessing
inference temperature 2.0

Known limitation: real text graphics

On social media, the detector often flags real born-digital text graphics as AI-generated: screenshots, news chyrons, infographics, meme macros. On a set of 35 real images hand-labelled from X after the detector flagged them, it flags 62.9% (22/35) at p_fake ≥ 0.5. These images were picked because they were false positives, so this is not a false-positive rate on social media in general. It only shows the failure mode is common and stable. bendavidsteel/openfake-swinv2-base-textgraphics-lora is a LoRA adapter that targets it.

Licence and citation

CC-BY-NC-4.0, inherited from the OpenFake Demo Space and dataset. Non-commercial use only.

@misc{livernoche2025openfakeopendatasetplatform,
      title={OpenFake: An Open Dataset and Platform Toward Real-World Deepfake Detection},
      author={Victor Livernoche and Akshatha Arodi and Andreea Musulan and Zachary Yang and Adam Salvail and Gaétan Marceau Caron and Jean-François Godbout and Reihaneh Rabbany},
      year={2025},
      eprint={2509.09495},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2509.09495},
}
Downloads last month
465
Safetensors
Model size
86.9M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for bendavidsteel/openfake-swinv2-base

Finetuned
(12)
this model
Adapters
1 model
Finetunes
1 model

Dataset used to train bendavidsteel/openfake-swinv2-base

Space using bendavidsteel/openfake-swinv2-base 1

Collection including bendavidsteel/openfake-swinv2-base

Paper for bendavidsteel/openfake-swinv2-base