Rashidbm commited on
Commit
fca3594
·
verified ·
1 Parent(s): f98abe4

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +122 -0
README.md ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ language:
4
+ - en
5
+ - ar
6
+ tags:
7
+ - multimodal
8
+ - misinformation
9
+ - forgery-detection
10
+ - fnd-clip
11
+ - dct
12
+ size_categories:
13
+ - 10K<n<100K
14
+ ---
15
+
16
+ # MultiGuard Phase 2 — Multimodal Misinformation Detection Dataset & Caches
17
+
18
+ This dataset packages everything needed to reproduce **Phase 2** of the
19
+ [MultiGuard](https://github.com/Rashidbm/Multimodal-fake-news-detection)
20
+ project without redoing the heavy preprocessing.
21
+
22
+ ## What's inside
23
+
24
+ | File | Size | Contents |
25
+ |---|---|---|
26
+ | `forensic_3class.csv` | 3.7 MB | 18,000-sample 3-class dataset (Real / Manipulated / OOC), balanced 6,000 per class, deterministic 70/15/15 per-class split (seed 42). |
27
+ | `dct_cache.tar.gz` | 2.9 GB | Precomputed DCT maps for all 18,000 images. Each entry is a `[1, 224, 224]` float32 tensor (BGR→YCbCr→Y, 2D DCT, log scale, per-image min-max). Filename is md5 of the absolute image path. Extract into `data/processed/dct_cache/`. |
28
+ | `fnd_features_clean.tar.gz` | 37 MB | FND-CLIP `v_semantic` features (512-dim) computed with **leak-free FND-CLIP** — pretrained ResNet50 / BERT / CLIP encoders + random frozen modality-attention head. No task-specific weights. Filename is md5(text \|\| image_path). Extract into `data/processed/fnd_features_clean/`. |
29
+ | `fnd_features_leaked.tar.gz` | 37 MB | Same format, but computed using `outputs/v1_ooc/best.pt` as the FND-CLIP checkpoint. **Numbers from training on this cache are inflated by label leakage** (see Known Issues). Provided for completeness only. |
30
+ | `step1_forensic_baseline_best.pt` | 46 MB | Step 1 forensic-only baseline checkpoint (ResNet18 on DCT + linear head). Test F1 ~0.47, MMFakeBench transfer ~0.17. |
31
+ | `step2_full_pipeline_LEAKED_best.pt` | 59 MB | Step 2 full pipeline checkpoint trained with the leaked v_semantic. **Do not trust the metrics from this** — kept for archival. |
32
+
33
+ ## Class definitions
34
+
35
+ | Label | Name | Source |
36
+ |---|---|---|
37
+ | 0 | Real | DGM4 origin (real images, real news from BBC / Guardian / USA Today / Washington Post) |
38
+ | 1 | Manipulated | DGM4 face_swap, face_attribute (image-side manipulation, real news source) |
39
+ | 2 | OOC | NewsCLIPpings out-of-context pairs (real images, mismatched captions) |
40
+
41
+ ## Splits
42
+
43
+ | Split | Per class | Total |
44
+ |---|---|---|
45
+ | train | 4,200 | 12,600 |
46
+ | val | 900 | 2,700 |
47
+ | test | 900 | 2,700 |
48
+
49
+ ## How to use (with the code repo)
50
+
51
+ ```bash
52
+ git clone https://github.com/Rashidbm/Multimodal-fake-news-detection.git
53
+ cd Multimodal-fake-news-detection
54
+
55
+ # Pull the data from this dataset
56
+ huggingface-cli download Rashidbm/multiguard-phase2-data \
57
+ --repo-type dataset --local-dir hf_data/
58
+
59
+ # Place the CSV
60
+ mkdir -p data/processed
61
+ cp hf_data/forensic_3class.csv data/processed/
62
+
63
+ # Extract caches
64
+ tar -xzf hf_data/dct_cache.tar.gz -C data/processed/
65
+ tar -xzf hf_data/fnd_features_clean.tar.gz -C data/processed/
66
+
67
+ # (Optional) drop in the trained checkpoints
68
+ mkdir -p outputs/forensic_baseline outputs/full_pipeline
69
+ cp hf_data/step1_forensic_baseline_best.pt outputs/forensic_baseline/best.pt
70
+ ```
71
+
72
+ The `image_path` column in the CSV uses absolute paths from the original
73
+ machine (`/Users/rashid/...`). Either replicate that layout or rewrite
74
+ the paths:
75
+
76
+ ```bash
77
+ sed -i '' 's|/Users/rashid/multimodaldetection|/your/repo/path|g' \
78
+ data/processed/forensic_3class.csv
79
+ ```
80
+
81
+ ## Image data NOT included
82
+
83
+ The raw images are too large and have their own licenses. Get them from:
84
+
85
+ - DGM4 (origin + manipulation) — `rshaojimmy/DGM4` on HuggingFace
86
+ - NewsCLIPpings test split — VisualNews + NewsCLIPpings annotations
87
+ - MMFakeBench (val/test for transfer eval) — `liuxuannan/MMFakeBench`
88
+
89
+ You only need the raw images if you want to retrain the DCT cache from
90
+ scratch or use the visual / CLIP streams; the precomputed caches in this
91
+ dataset cover the standard Phase-2 training loop.
92
+
93
+ ## Known issues
94
+
95
+ 1. **`fnd_features_leaked.tar.gz` and `step2_full_pipeline_LEAKED_best.pt`**
96
+ were produced using a FND-CLIP checkpoint (`outputs/v1_ooc/best.pt`)
97
+ that was trained on a binary OOC vs not-OOC task. **84% of our test
98
+ OOC samples were in that checkpoint's training set**, so v_semantic
99
+ for those samples literally encodes the OOC label. The Step 2 OOC
100
+ F1 of 0.98 reported in the GitHub HANDOFF.md is mostly this leak.
101
+ Use `fnd_features_clean.tar.gz` for honest numbers (~0.54 F1).
102
+
103
+ 2. **Source-distribution shortcut**: NewsCLIPpings OOC images are
104
+ stored at ~22% lower JPEG quality than DGM4 origin/manipulated images
105
+ (36.7 KB vs 47.5 / 45.8 KB on average). DCT can shortcut on this. To
106
+ eliminate, re-encode all images at uniform JPEG quality before
107
+ computing the DCT cache.
108
+
109
+ ## License
110
+
111
+ MIT for the splits / metadata. Underlying image and text data are
112
+ governed by the licenses of the source datasets (DGM4, NewsCLIPpings,
113
+ VisualNews).
114
+
115
+ ## Citation
116
+
117
+ If you use this in academic work, cite the upstream datasets:
118
+
119
+ - DGM4: Shao et al., "Detecting and Grounding Multi-Modal Media Manipulation," CVPR 2023.
120
+ - NewsCLIPpings: Luo et al., "NewsCLIPpings: Automatic Generation of Out-of-Context Multimodal Media," EMNLP 2021.
121
+ - MMFakeBench: Liu et al., "MMFakeBench: A Mixed-Source Multimodal Misinformation Detection Benchmark," 2024.
122
+ - FND-CLIP: Zhou et al., "Multimodal Fake News Detection via CLIP-Guided Learning," ICME 2023.