TropicalBee commited on
Commit
3fd0afb
·
verified ·
1 Parent(s): f6c944f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +63 -1
README.md CHANGED
@@ -1,3 +1,6 @@
 
 
 
1
  ---
2
  title: FakeOut
3
  emoji: 🐨
@@ -8,7 +11,66 @@ sdk_version: 6.18.0
8
  python_version: '3.13'
9
  app_file: app.py
10
  pinned: false
11
- short_description: 'FakeOut is an AI generated image detection tool. '
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  ---
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
+
2
+
3
+
4
  ---
5
  title: FakeOut
6
  emoji: 🐨
 
11
  python_version: '3.13'
12
  app_file: app.py
13
  pinned: false
14
+ short_description: A patch-based DL model detecting microscopic AI artifacts.
15
+ ---
16
+
17
+ # FAKEOUT: A Patch-Based Deep Learning Model for AI Image Detection
18
+
19
+ FAKEOUT is a forensic computer vision application built to expose synthetic modifications and AI-generated image patterns. Unlike traditional classifiers that inspect overall image composition, FAKEOUT operates as a patch-based detector. It isolates microscopic frequency anomalies and localized pixel artifacts left behind by generative architectures.
20
+
21
+ ## How It Works
22
+
23
+ Traditional AI detection models often become confused by an image's overall subject matter or composition. FAKEOUT bypasses this limitation by looking at the world through a fixed window:
24
+ 1. **Patch Extraction:** The engine extracts a strict, deterministic 224x224 pixel crop from the exact center of the uploaded image.
25
+ 2. **Artifact Scan:** A specialized ResNet-50 architecture evaluates this dense sub-grid to scan for subtle, microscopic pixel noise, texture repetitions, and architectural anomalies typical of diffusion models and GANs.
26
+ 3. **Classification:** The model calculates class probabilities to determine whether the high-frequency fingerprint matches a true photograph (REAL) or an AI generation (FAKE).
27
+
28
+ ---
29
+
30
+ ## Dataset & Architecture
31
+
32
+ * **Core Approach:** Original work featuring a strict patch-based training and inference pipeline.
33
+ * **Sourced Data:** Built by merging and curating two prominent image distribution libraries:
34
+ * **Flickr30k Dataset** (8.86 GB) for diverse, high-resolution authentic photography.
35
+ * **Defactify Image Dataset** (7.51 GB) for diverse synthetic and manipulated generations.
36
+ * **Volume:** Combined infrastructure representing 10,000 source images expanded seamlessly into 100,000 unique validation patches during pipeline engineering.
37
+
38
+ ---
39
+
40
+ ## Performance & Key Metrics
41
+
42
+ Evaluated against a strictly quarantined, un-leaked holdout test set containing complex wild generations:
43
+
44
+ * **Overall Classification Accuracy:** 76.92%
45
+ * **ROC-AUC Score:** 0.7143
46
+ * **AI-Detection Recall:** 83.33% (The model successfully catches and flags over 83% of actual AI-generated fakes).
47
+
48
+ ### Model Evaluation Visualized
49
+
50
+ ![ROC-AUC Curve](roc_auc.png)
51
+ ![Confusion Matrix](confusion_matrix.png)
52
+
53
+
54
+ ### Detailed Classification Report
55
+
56
+ ![Classification Report](classification_report.png)
57
+
58
  ---
59
 
60
+ ## Limitations & Best Results
61
+
62
+ To get the most accurate results out of FAKEOUT, keep the following mechanical constraints in mind:
63
+
64
+ * **Resolution Sweet Spot (512px - 1500px):** The model performs best on mid-sized dimensions (e.g., 640x832 or 880x1320).
65
+ * **The 4K Danger Zone:** Ultra-high-resolution images (4K / 3840x2160) will degrade performance. Because the model's 'magnifying glass' is locked to a 224x224 footprint, it ends up scanning less than 0.6% of a 4K frame, completely losing contextual positioning.
66
+ * **Centered Subjects:** The patch extraction targets the dead-center. Structural AI defects occurring exclusively on frame borders or background edges will not be parsed.
67
+ * **Avoid Screenshots:** Compression passes from screenshot utilities or social media pipelines strip away the micro-level frequency data the model relies on. Always upload raw, uncompressed source files.
68
+
69
+ ## Technology Stack
70
+
71
+ * **Core Engine:** PyTorch, Torchvision
72
+ * **Weights Format:** Safetensors (Optimized for lazy CPU execution)
73
+ * **Frontend:** Gradio Web Interface
74
+ * **Hosting Container:** Hugging Face Spaces
75
+
76
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference