---
title: ai-source-detector-ONNX
canonical_url: "https://www.modelscope.cn/models/onnx-community/ai-source-detector-ONNX"
md_url: "https://www.modelscope.cn/models/onnx-community/ai-source-detector-ONNX.md"
repository: onnx-community/ai-source-detector-ONNX
last_updated: 2026-03-05
license: apache-2.0
pipeline_tag: image-classification
tasks:
  - image-classification
model_type:
  - vit
architectures:
  - ViTForImageClassification
base_model:
  - yaya36095/ai-source-detector
base_model_relation: finetune
library_name:
  - transformer
  - onnx
  - pytorch
frameworks:
  - pytorch
downloads: 23
stars: 0
tags:
  - image-classification
  - ai-detection
  - vit
---

# ai-source-detector-ONNX

> ai-source-detector-ONNX - onnx-community 在 ModelScope 开源的模型。ai-source-detector (ONNX)

onnx-community/ai-source-detector-ONNX 是 ModelScope 魔搭社区上的image-classification模型，采用 apache-2.0 许可，基于 yaya36095/ai-source-detector 构建。

- **Repository**: onnx-community/ai-source-detector-ONNX
- **License**: apache-2.0
- **Tasks**: image-classification
- **Base model**: yaya36095/ai-source-detector
- **Tags**: image-classification, ai-detection, vit
- **Downloads**: 23
- **Stars**: 0
- **Last updated**: 2026-03-05

Source: https://www.modelscope.cn/models/onnx-community/ai-source-detector-ONNX

---

# ai-source-detector (ONNX)


This is an ONNX version of [yaya36095/ai-source-detector](https://huggingface.co/yaya36095/ai-source-detector). It was automatically converted and uploaded using [this Hugging Face Space](https://huggingface.co/spaces/onnx-community/convert-to-onnx).


## Usage with Transformers.js


See the pipeline documentation for `image-classification`: https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.ImageClassificationPipeline


---


# AI Source Detector (ViT-Base)

Detects *and* classifies the source of AI-generated images into **five** classes  
(`stable_diffusion`, `midjourney`, `dalle`, `real`, `other_ai`).

## Model Details
* **Architecture:** ViT-Base Patch-16 × 224  
* **Parameters:** 86 M  
* **Fine-tuning epochs:** 10  
* **Optimizer:** AdamW (lr = 3e-5, wd = 0.01)  
* **Hardware:** 1× NVIDIA RTX 4090 (24 GB)

## Training Data
| Class | Images |
|-------|-------:|
| Stable Diffusion | 12 000 |
| Midjourney | 10 500 |
| DALL-E 3 | 9 400 |
| Real | 11 800 |
| Other AI | 8 200 |

Total ≈ 52 k images - 80 % train / 10 % val / 10 % test.

## Evaluation
| Metric | Top-1 | Macro F1 |
|--------|------:|---------:|
| Validation | 92.8 % | 0.928 |
| Test | 91.6 % | 0.914 |

<details>
<summary>Confusion Matrix (click to open)</summary>
<img src="confusion_matrix.png" width="480">
</details>

## Usage
```python
from transformers import ViTImageProcessor, ViTForImageClassification, pipeline
classifier = pipeline(
    task="image-classification",
    model="yaya36095/ai-source-detector",
    top_k=1
)
classifier("demo.jpg")
# → [{'label': 'stable_diffusion', 'score': 0.97}]
