FLUX Detector - Vision Transformer
Model Description
This model is a specialized binary classifier trained to detect images generated by FLUX.1-dev (Black Forest Labs). It achieves 99.85% accuracy with ZERO false positives on held-out test data.
Key Features
- π― Specialist Detector: Optimized specifically for FLUX.1-dev images
- π Exceptional Accuracy: 99.85% test accuracy
- π‘οΈ Zero False Positives: Never misclassifies real images as fake
- β‘ Fast Inference: ~10ms per image on GPU
- π Well-Validated: Separate train/val/test splits with no overlap
Performance
Test Accuracy: 0.9985
Precision: 1.0000 (PERFECT!)
Recall: 0.9970
F1 Score: 0.9985
AUC-ROC: 1.0000 (PERFECT!)
False Positive Rate: 0.0000 (0.0%!)
False Negative Rate: 0.0030
Quick Start
import torch
from PIL import Image
from transformers import ViTForImageClassification, ViTImageProcessor
# Load model and processor
model = ViTForImageClassification.from_pretrained(
"ash12321/flux-detector-vit"
)
processor = ViTImageProcessor.from_pretrained(
"google/vit-base-patch16-224"
)
# Load image
image = Image.open("test.jpg")
inputs = processor(images=image, return_tensors="pt")
# Get prediction
model.eval()
with torch.no_grad():
outputs = model(**inputs)
probs = torch.softmax(outputs.logits, dim=1)
if probs[0][1] > 0.5:
print(f"FLUX-Generated ({probs[0][1]:.2%} confident)")
else:
print(f"Real Image ({probs[0][0]:.2%} confident)")
Using the model.py Helper
from model import detect_image
result = detect_image("test.jpg", model_path="ash12321/flux-detector-vit")
print(f"Is Fake: {result['is_fake']}")
print(f"Confidence: {result['confidence']:.2%}")
Files in this Repository
pytorch_model.bin- Model weightsconfig.json- Model configurationmodel.py- Model architecture and helper functionsREADME.md- This documentationtraining_results.json- Detailed training metricstraining_curves.png- Training visualizationconfusion_matrix.png- Test set confusion matrix
Citation
@misc{flux-detector-vit,
author = {ash12321},
title = {FLUX Detector - Vision Transformer},
year = {2024},
publisher = {HuggingFace},
howpublished = {\url{https://huggingface.co/ash12321/flux-detector-vit}},
}
License: Apache 2.0
Created: 2025-12-31
- Downloads last month
- 13
Datasets used to train ash12321/flux-detector-vit
Evaluation results
- Test Accuracyself-reported0.999
- F1 Scoreself-reported0.999