🚀 open-deepfake-detection
open-deepfake-detectionは、二値画像分類のためにsiglip2-base-patch16-512
から微調整されたビジョン言語エンコーダーモデルです。OpenDeepfake-Previewデータセットを使用して、画像が偽物か本物かを検出するように訓練されています。このモデルはSiglipForImageClassification
アーキテクチャを使用しています。

🚀 クイックスタート
open-deepfake-detectionは、画像がAI生成の偽物か本物の写真かを検出するためのモデルです。以下のセクションでは、モデルの使用方法や必要な依存関係のインストール方法について説明します。
✨ 主な機能
- バイナリ画像分類:画像が偽物か本物かを検出します。
- 微調整済みモデル:
siglip2-base-patch16-512
から微調整されています。
- 特定のデータセットで訓練:OpenDeepfake-Previewデータセットを使用して訓練されています。
📦 インストール
必要な依存関係をインストールするには、以下のコマンドを実行してください。
pip install -q transformers torch pillow gradio hf_xet
💻 使用例
基本的な使用法
以下のコードは、モデルを使用して画像を分類する方法を示しています。
import gradio as gr
from transformers import AutoImageProcessor, SiglipForImageClassification
from PIL import Image
import torch
model_name = "prithivMLmods/open-deepfake-detection"
model = SiglipForImageClassification.from_pretrained(model_name)
processor = AutoImageProcessor.from_pretrained(model_name)
id2label = {
"0": "Fake",
"1": "Real"
}
def classify_image(image):
image = Image.fromarray(image).convert("RGB")
inputs = processor(images=image, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
probs = torch.nn.functional.softmax(logits, dim=1).squeeze().tolist()
prediction = {
id2label[str(i)]: round(probs[i], 3) for i in range(len(probs))
}
return prediction
iface = gr.Interface(
fn=classify_image,
inputs=gr.Image(type="numpy"),
outputs=gr.Label(num_top_classes=2, label="Deepfake Detection"),
title="open-deepfake-detection",
description="Upload an image to detect whether it is AI-generated (Fake) or a real photograph (Real), using the OpenDeepfake-Preview dataset."
)
if __name__ == "__main__":
iface.launch()
📚 ドキュメント
ラベル空間
このモデルは、画像を以下の2つのクラスに分類します。
Class 0: Fake
Class 1: Real
推論のデモ
以下は、モデルの推論結果のデモです。
[!warning]
real

[!warning]
fake

推論結果のレポート
Classification Report:
precision recall f1-score support
Fake 0.9718 0.9155 0.9428 10000
Real 0.9201 0.9734 0.9460 9999
accuracy 0.9444 19999
macro avg 0.9459 0.9444 0.9444 19999
weighted avg 0.9459 0.9444 0.9444 19999
意図された用途
open-deepfake-detection
は以下の用途に設計されています。
- ディープフェイク検出 – AI生成または操作された画像を識別します。
- コンテンツモデレーション – 合成または偽の視覚コンテンツをフラグ付けします。
- データセットの選別 – 混合データセットから合成サンプルを削除します。
- 視覚的な信憑性検証 – 視覚メディアの整合性をチェックします。
- デジタルフォレンジック – 画像のソース検証と追跡可能性をサポートします。
参考論文
[!note]
SigLIP 2: Multilingual Vision-Language Encoders with Improved Semantic Understanding, Localization, and Dense Features
https://arxiv.org/pdf/2502.14786
重要な注意事項
⚠️ 重要提示
このモデルは実験的なモデルです。
📄 ライセンス
このモデルはApache-2.0ライセンスの下で提供されています。
モデル情報
属性 |
详情 |
モデルタイプ |
画像分類モデル |
訓練データ |
prithivMLmods/OpenDeepfake-Preview |
ベースモデル |
google/siglip2-base-patch16-512 |
ライブラリ名 |
transformers |
タグ |
deepfake, detection, SigLIP2, art, synthetic |