Image Classification
Transformers
Safetensors
swin-frequency-hybrid
deepfake-detection
synthetic-image-detection
swin-transformer
frequency-analysis
Instructions to use SadraCoding/SDXL-Deepfake-Detector with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SadraCoding/SDXL-Deepfake-Detector with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="SadraCoding/SDXL-Deepfake-Detector") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# pip install -U transformers accelerate # Load model directly from transformers import SwinFrequencyHybridDetector model = SwinFrequencyHybridDetector.from_pretrained("SadraCoding/SDXL-Deepfake-Detector", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Commit ·
1824684
1
Parent(s): bd289c2
README Update
Browse files1234534 unmodified lines40414243444546474849505152535455565758596061626364---license: mittags:- image-classification- deepfake-detection34 unmodified linesThe project references the Kaggle 140k Real and Fake Faces collection, commonly described as real face images and StyleGAN-generated faces. This is a narrow face-image domain. It does not establish performance on face swaps, video, SDXL or other unseen generators, or arbitrary images in the wild. The checkpoint does not include enough dataset version, split construction, and run provenance to reproduce or independently validate its reported result.The checked-in GitHub metrics artifact reports one evaluation on 10,905 images. It reports 93.27% clean accuracy for both full and adaptive inference. These are historical results from a run with incomplete provenance, not evidence of generalization. The project Hugging Face page has also displayed a self-reported 97% accuracy; the evaluation details do not establish that it is directly comparable to the checked-in metrics. Do not combine or compare those figures as if they came from the same protocol.The metrics artifact reports the following accuracy and weighted F1 for its clean test set and four synthetic corruption variants:| Evaluation variant | Accuracy (full / adaptive) | Weighted F1 || --- | ---: | ---: || Clean | 93.27% / 93.27% | 93.26% || JPEG quality 50 | 91.30% / 91.30% | 91.25% || 5 × 5 Gaussian blur | 92.86% / 92.86% | 92.85% || Half resolution, resized back | 92.11% / 92.11% | 92.11% || Gaussian noise, σ = 15 | 91.24% / 91.24% | 91.23% |These controlled degradations are not a comprehensive robustness test. The metrics artifact omits the dataset revision, split construction, per-source support, GPU model, software versions, checkpoint hash, and threshold-selection procedure. Adaptive and full modes had the same reported labels for these variants; the recorded adaptive early-exit rates were approximately 98.4–99.1%. The repository has not demonstrated that frequency fusion improves performance over a matched Swin-only baseline.Potential dataset shortcuts, identity or duplicate overlap, source-specific artifacts, compression, preprocessing, demographic coverage, and distribution shift can affect predictions. The project is not a universal deepfake detector. See the linked [technical report](https://github.com/SadraCoding/SDXL-Deepfake-Detector/blob/main/REVISED_PROJECT_REPORT.md) and [research protocol](https://github.com/SadraCoding/SDXL-Deepfake-Detector/blob/main/docs/research_protocol.md) for detailed caveats and recommendations for controlled evaluation.## Using the checkpointThis checkpoint uses the project's custom `SwinFrequencyHybridDetector` architecture; it cannot be loaded as a standard `AutoModelForImageClassification` without the custom model code. Clone the GitHub repository, install the dependencies and a PyTorch/torchvision build for your platform, then run inference from the `model/` directory:```bashgit clone https://github.com/SadraCoding/SDXL-Deepfake-Detector.git1234534 unmodified lines4041424344454647484950515253545556575859606162636465666768697071727374---license: cc-by-nc-3.0tags:- image-classification- deepfake-detection34 unmodified linesThe project references the Kaggle 140k Real and Fake Faces collection, commonly described as real face images and StyleGAN-generated faces. This is a narrow face-image domain. It does not establish performance on face swaps, video, SDXL or other unseen generators, or arbitrary images in the wild. The checkpoint does not include enough dataset version, split construction, and run provenance to reproduce or independently validate its reported result.The checked-in [GitHub metrics artifact](https://github.com/SadraCoding/SDXL-Deepfake-Detector/blob/main/model/results/metrics.json) records one evaluation on 10,905 images (`device: cuda`, test directory `dataset/test`). There are 5,492 `artificial` examples (ID 0) and 5,413 `human` examples (ID 1). Percentages below are rounded to two decimals. Full and adaptive inference have identical aggregate and per-class classification metrics and confusion matrices for every listed variant, so classification metrics appear once per variant.| Variant | Accuracy | Weighted P / R / F1 | Macro P / R / F1 | Artificial P / R / F1 | Human P / R / F1 | Confusion matrix (true rows, predicted columns; IDs 0, 1) || --- | ---: | ---: | ---: | ---: | ---: | --- || Clean | 93.27% | 93.58 / 93.27 / 93.26% | 93.60 / 93.24 / 93.25% | 89.97 / 97.51 / 93.59% | 97.23 / 88.97 / 92.92% | `[[5355, 137], [597, 4816]]` || JPEG quality 50 | 91.30% | 92.07 / 91.30 / 91.25% | 92.11 / 91.25 / 91.25% | 86.44 / 98.11 / 91.91% | 97.77 / 84.39 / 90.59% | `[[5388, 104], [845, 4568]]` || Gaussian blur 5 × 5 | 92.86% | 92.89 / 92.86 / 92.85% | 92.89 / 92.85 / 92.85% | 91.80 / 94.23 / 93.00% | 93.98 / 91.46 / 92.71% | `[[5175, 317], [462, 4951]]` || Half resolution, upscaled | 92.11% | 92.14 / 92.11 / 92.11% | 92.14 / 92.10 / 92.11% | 91.21 / 93.34 / 92.26% | 93.07 / 90.87 / 91.96% | `[[5126, 366], [494, 4919]]` || Gaussian noise, σ = 15 | 91.24% | 91.44 / 91.24 / 91.23% | 91.46 / 91.22 / 91.23% | 88.64 / 94.76 / 91.60% | 94.28 / 87.68 / 90.86% | `[[5204, 288], [667, 4746]]` |P / R / F1 means precision / recall / F1. Confusion matrices use rows for true labels and columns for predicted labels, ordered `artificial` then `human`.| Variant | Full latency (ms/image) | Adaptive latency (ms/image) | Early-exit rate (full / adaptive) | Speedup (full / adaptive) || --- | ---: | ---: | ---: | ---: || Clean | 6.60 | 6.24 | 0.00% / 99.06% | 1.058× || JPEG quality 50 | 6.63 | 6.27 | 0.00% / 98.73% | 1.058× || Gaussian blur 5 × 5 | 6.66 | 6.30 | 0.00% / 98.56% | 1.057× || Half resolution, upscaled | 6.65 | 6.28 | 0.00% / 98.59% | 1.057× || Gaussian noise, σ = 15 | 6.59 | 6.22 | 0.00% / 98.42% | 1.060× |For clean inputs, the artifact reports mean blur score **628.65**, mean noise score **6.07**, and mean JPEG-50 MAE **3.57**. It does not include these quality diagnostics for the corrupted variants. They are descriptive measurements, not learned quality or authenticity scores.These controlled degradations are not a comprehensive robustness test. The artifact omits dataset revision, split construction, per-source support, GPU model, software versions, checkpoint hash, and threshold-selection procedure. The project Hugging Face page has also displayed a self-reported 97% accuracy, but available evaluation details do not establish comparability with this artifact; do not combine the figures. The repository has not demonstrated that frequency fusion improves performance over a matched Swin-only baseline.Potential dataset shortcuts, identity or duplicate overlap, source-specific artifacts, compression, preprocessing, demographic coverage, and distribution shift can affect predictions. The project is not a universal deepfake detector. See the linked [technical report](https://github.com/SadraCoding/SDXL-Deepfake-Detector/blob/main/REVISED_PROJECT_REPORT.md) and [research protocol](https://github.com/SadraCoding/SDXL-Deepfake-Detector/blob/main/docs/research_protocol.md) for detailed caveats and recommendations for controlled evaluation.## Using the checkpointThis checkpoint uses the project's custom `SwinFrequencyHybridDetector` architecture; it cannot be loaded as a standard `AutoModelForImageClassification` without the custom model code. Clone the GitHub repository and install a PyTorch/torchvision build that matches your platform using the [official PyTorch selector](https://pytorch.org/get-started/locally/). Then install the project dependencies and run inference from the `model/` directory:```bashgit clone https://github.com/SadraCoding/SDXL-Deepfake-Detector.git
README.md+22-12