Downloads · 30 days
8
1% of all-time downloads
AashishKumar/AIvisionGuard-v2
AIvisionGuard-v2 is a image classification model from AashishKumar. Use it when you need a label for an image. It is set up for transformers. The card lists the license as apache-2.0.
Downloads · 30 days
8
1% of all-time downloads
All-time downloads
940
Public
Parameters
85.8M
1 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt687 MB · 50%
From the Hugging Face model README
This model, AI Guard Vision, is a Vision Transformer (ViT)-based architecture designed for image classification tasks. Its primary objective is to accurately distinguish between real and AI-generated synthetic images. The model addresses the growing challenge of detecting manipulated or fake visual content to preserve trust and integrity in digital media.
vit-base-patch16-224google/vit-base-patch16-224from transformers import AutoImageProcessor, ViTForImageClassification
import torch
from PIL import Image
from pillow_heif import register_heif_opener, register_avif_opener
register_heif_opener()
register_avif_opener()
def get_prediction(img):
image = Image.open(img).convert('RGB')
image_processor = AutoImageProcessor.from_pretrained("AashishKumar/AIvisionGuard-v2")
model = ViTForImageClassification.from_pretrained("AashishKumar/AIvisionGuard-v2")
inputs = image_processor(image, return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits
top2_labels = logits.topk(2).indices.squeeze().tolist()
top2_scores = logits.topk(2).values.squeeze().tolist()
response = [{"label": model.config.id2label[label], "score": score} for label, score in zip(top2_labels, top2_scores)]
return response
The model was fine-tuned on the CIFake dataset, which contains both real and AI-generated synthetic images:
The model was evaluated using the CIFake test dataset, with the following metrics:
| Model | Accuracy | F1-Score | Precision | Recall |
|---|---|---|---|---|
| Baseline | 85% | 0.82 | 0.78 | 0.80 |
| Augmented | 88% | 0.85 | 0.83 | 0.84 |
| Fine-tuned ViT | 92% | 0.89 | 0.85 | 0.88 |

This model provides a highly effective tool for detecting AI-generated synthetic images and has promising applications in content moderation, digital forensics, and trust preservation. Future improvements may include: