Views
No views yet
| Architecture | Description |
|---|---|
BaselineCNN | Shallow 3-block Conv2D CNN |
DeeperCNN | Deeper 4-block CNN with BatchNorm |
ViTModel | ViT-B/16 (ImageNet-pretrained) adapted for RGB images via transfer learning |
prithivMLmods/AI-vs-Deepfake-vs-Real — original 3-way labels (Artificial, Deepfake, Real) merged into a binary task: Real (0) vs Fake (1, covering both AI-generated and deepfake images), to detect AI manipulation of any kind in one model.| Model | Test Accuracy | File size |
|---|---|---|
| Baseline CNN | 98.80% | ~26MB |
| Deeper CNN | 99.20% | ~26MB |
| ViT | 100.00% | ~343MB |
deeper_cnn_model.pth. At 99.20% accuracy and ~26MB (vs. ViT's 343MB), it offers a strong practical tradeoff between accuracy and deployment cost (faster cold starts, less bandwidth) with a more plausible, less potentially-overfit accuracy figure than the ViT's perfect score.baseline_cnn_model.pthdeeper_cnn_model.pth (recommended)vit_model.pthmodel.py - architecture class definitions + preprocessing pipeline, required to load any of the abovePIL can open (.jpg, .png, etc.)model.py includes a preprocess_image() function that handles all of this automatically.1from huggingface_hub import hf_hub_download
2import sys
3
4model_py_path = hf_hub_download(repo_id="LaabhGupta/image-antispoofing", filename="model.py")
5weights_path = hf_hub_download(repo_id="LaabhGupta/image-antispoofing", filename="deeper_cnn_model.pth")
6
7sys.path.insert(0, model_py_path.rsplit("/", 1)[0])
8from model import load_model, predict
9
10model = load_model("deeper", weights_path, device="cpu")
11label, confidence = predict("path/to/image.jpg", model, device="cpu")
12print(label, confidence)