Arko007 commited on
Commit
f86fb6c
Β·
verified Β·
1 Parent(s): ce0a930

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +64 -8
README.md CHANGED
@@ -58,7 +58,7 @@ the full real set), face-cropped via MTCNN and persisted to the
58
  `Arko007/deepfake-ff-face-crops` HF dataset repo across multiple
59
  preprocessing sessions (resumable, `processed_videos.txt`-tracked, no
60
  video reprocessed twice). The held-out validation split used for the
61
- metrics below has 11,570 frames across 1,049 videos (150 real / 899
62
  fake) β€” consistent with FF++'s ~1:6 real:fake ratio, confirming the
63
  corrected restore actually pulled in the full real class this time.
64
 
@@ -124,6 +124,59 @@ No model's F1 collapsed under the class imbalance; the `pos_weight` +
124
  Full machine-readable results (including confusion matrices) are in
125
  `eval_results.json` in this repo.
126
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  ## Live deployment verification (2026-07-24)
128
 
129
  Both the FastAPI backend and the React frontend were deployed to Modal
@@ -142,19 +195,22 @@ stopped again after verification).
142
  - Frontend static build served correctly (200, correct title) and was
143
  pointed at the Modal backend for this verification pass only.
144
 
145
- For day-to-day use, the frontend defaults to sharded per-architecture
146
- instances on Render's free tier (CPU-only; see repo `frontend/src/App.jsx`
147
- `MODEL_ENDPOINTS`).
 
 
 
148
 
149
  ## Uncertainty, explainability, and triage (implementation, not just checkpoints)
150
 
151
  See `plugin_core/` in the repo:
152
  - `uncertainty.py` β€” `MCDropoutPlugin` (stochastic forward passes β†’ mean
153
  probability, variance, entropy), plus `calculate_ece` /
154
- `generate_reliability_data` for calibration analysis (not yet run
155
- against this labeled held-out split β€” the deployed UI's Calibration tab
156
- currently shows illustrative, not measured, calibration-curve numbers;
157
- the F1/precision/recall/AUROC numbers above ARE measured).
158
  - `explainability.py` β€” Grad-CAM (CNN backbones) / saliency-based attention
159
  (ViT), with stability-under-perturbation and spatial-entropy quality
160
  metrics.
 
58
  `Arko007/deepfake-ff-face-crops` HF dataset repo across multiple
59
  preprocessing sessions (resumable, `processed_videos.txt`-tracked, no
60
  video reprocessed twice). The held-out validation split used for the
61
+ metrics below has 11,666 frames across 1,049 videos (150 real / 899
62
  fake) β€” consistent with FF++'s ~1:6 real:fake ratio, confirming the
63
  corrected restore actually pulled in the full real class this time.
64
 
 
124
  Full machine-readable results (including confusion matrices) are in
125
  `eval_results.json` in this repo.
126
 
127
+ ## Cross-architecture calibration, explanation-quality, and triage study (2026-07-25)
128
+
129
+ Full research-questions study (RQ1-RQ3, see the paper/report in
130
+ `research/`), run via 20-pass MC-Dropout across the **full** held-out
131
+ validation split (11,666 frames / 1,049 videos), plus explanation-quality
132
+ and triage-transferability metrics on a class-balanced ~4,000-sample
133
+ draw per model. Raw output: `research_results.json` in this repo.
134
+
135
+ **RQ1 β€” Expected Calibration Error (lower is better):**
136
+
137
+ | Model | Frame ECE | Video ECE | Frame AUROC | Video AUROC |
138
+ |---|---|---|---|---|
139
+ | xception | 0.0329 | 0.0377 | 0.9976 | 0.9996 |
140
+ | sbi | 0.1155 | 0.1303 | 0.9894 | 0.9981 |
141
+ | vit | 0.0773 | 0.0906 | 0.9830 | 0.9924 |
142
+ | lsda | 0.0632 | 0.0728 | 0.9930 | 0.9985 |
143
+
144
+ All four are reasonably calibrated (ECE <0.12), but not uniformly β€”
145
+ SBI's ECE is ~3.5x Xception's. **Important caveat:** as instantiated,
146
+ Xception (`timm` `xception41`) and UIA-ViT (`vit_base_patch16_224`) have
147
+ zero dropout probability, so MC-Dropout contributes zero stochastic
148
+ averaging for either β€” their reported ECE is mathematically identical to
149
+ raw-softmax calibration, not a genuine MC-Dropout-averaged number like
150
+ SBI's and LSDA's. A dropout-fix retrain (`drop_rate=0.2`, distinct
151
+ `_dropoutfix` checkpoint suffix) is in progress to close this gap; see
152
+ Future Work in the paper.
153
+
154
+ **RQ2 β€” Spearman correlation, predictive entropy vs. explanation stability:**
155
+
156
+ | Model | n | ρ | p-value |
157
+ |---|---|---|---|
158
+ | xception | 4,000 | βˆ’0.0530 | 7.96e-4 |
159
+ | sbi | 3,165 | 0.0105 | 0.556 |
160
+ | vit | 4,000 | βˆ’0.0538 | 6.67e-4 |
161
+ | lsda | 4,000 | βˆ’0.0822 | 1.96e-7 |
162
+
163
+ Higher uncertainty correlates with less stable explanations, significantly,
164
+ in 3/4 architectures (not SBI) β€” small effect sizes throughout.
165
+
166
+ **RQ3 β€” Triage false-negative capture (same untuned entropy=0.6,
167
+ stability=0.65 threshold pair for all four models):**
168
+
169
+ | Model | FN Escalation | Overall Escalation | Capture Ratio |
170
+ |---|---|---|---|
171
+ | xception | 95.2% | 65.7% | 1.45x |
172
+ | sbi | 96.1% | 93.3% | 1.03x |
173
+ | vit | 93.0% | 84.9% | 1.10x |
174
+ | lsda | 88.8% | 76.0% | 1.17x |
175
+
176
+ The triage rule escalates 88.8-96.1% of true false negatives across every
177
+ architecture without any per-architecture recalibration β€” the core
178
+ transferability claim holds cleanly.
179
+
180
  ## Live deployment verification (2026-07-24)
181
 
182
  Both the FastAPI backend and the React frontend were deployed to Modal
 
195
  - Frontend static build served correctly (200, correct title) and was
196
  pointed at the Modal backend for this verification pass only.
197
 
198
+ As of 2026-07-25, both backend and frontend are deployed to Modal
199
+ (`deepfake-triage-backend` / `deepfake-triage-frontend`) for user
200
+ testing; HF Spaces now only supports Gradio so it is no longer used for
201
+ hosting this FastAPI+React app, and Render/Vercel are not the live path
202
+ either (see repo `frontend/src/App.jsx` `MODEL_ENDPOINTS`, which points
203
+ at the Modal backend).
204
 
205
  ## Uncertainty, explainability, and triage (implementation, not just checkpoints)
206
 
207
  See `plugin_core/` in the repo:
208
  - `uncertainty.py` β€” `MCDropoutPlugin` (stochastic forward passes β†’ mean
209
  probability, variance, entropy), plus `calculate_ece` /
210
+ `generate_reliability_data` for calibration analysis β€” now run against
211
+ the full labeled held-out split (see the RQ1-RQ3 study section above);
212
+ the deployed UI's Calibration tab shows these same measured numbers,
213
+ not illustrative ones.
214
  - `explainability.py` β€” Grad-CAM (CNN backbones) / saliency-based attention
215
  (ViT), with stability-under-perturbation and spatial-entropy quality
216
  metrics.