fassabilf commited on
Commit
80e282d
·
verified ·
1 Parent(s): 0bda56f

Upload dataset.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. dataset.md +171 -0
dataset.md ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # VoiceGuard — Dataset Documentation
2
+
3
+ ## Overview
4
+
5
+ **Task:** Deepfake Audio Detection — predict the probability that a 4-second audio clip is AI-generated (fake) vs. real human speech.
6
+ **Metric:** AUROC (Area Under ROC Curve)
7
+ **HuggingFace:** `fassabilf/voiceguard-competition`
8
+
9
+ ---
10
+
11
+ ## Sources
12
+
13
+ **Real speech:**
14
+ - [VCTK Corpus](https://datashare.ed.ac.uk/handle/10283/3443) — 109 speakers, various English accents (CC BY 4.0)
15
+ - [LibriSpeech](https://www.openslr.org/12) — read English speech from audiobooks (CC BY 4.0)
16
+
17
+ **Fake speech (AI-generated):**
18
+ - Generated by ≥3 TTS systems: **Tacotron2**, **VITS**, **SpeechT5**
19
+ - Test set includes ≥1 unseen TTS system (not present in training)
20
+
21
+ ---
22
+
23
+ ## Statistics
24
+
25
+ | Split | Real | Fake | Total |
26
+ |-------|------|------|-------|
27
+ | Train | 2,874 | 2,874 | 5,748 |
28
+ | Test | 627 | 627 | 1,254 |
29
+
30
+ - **Class balance:** perfectly balanced (50% real, 50% fake)
31
+ - **Baseline (random score 0.5):** AUROC = 0.5
32
+ - **Speaker-disjoint:** test speakers ≠ train speakers
33
+
34
+ ---
35
+
36
+ ## Audio Format
37
+
38
+ | Property | Value |
39
+ |----------|-------|
40
+ | Sample rate | 16,000 Hz |
41
+ | Channels | Mono |
42
+ | Duration | 4 seconds (padded/trimmed) |
43
+ | Format | WAV (PCM 16-bit) |
44
+
45
+ ---
46
+
47
+ ## File Structure
48
+
49
+ ```
50
+ voiceguard/
51
+ ├── train/
52
+ │ ├── real/
53
+ │ │ ├── real_00001.wav
54
+ │ │ └── ... # 2,874 files
55
+ │ └── fake/
56
+ │ ├── fake_00001.wav
57
+ │ └── ... # 2,874 files
58
+ ├── test/
59
+ │ ├── voiceguard_00001.wav
60
+ │ └── ... # 1,254 files, flat (no labels)
61
+ ├── train.csv
62
+ ├── test.csv
63
+ ├── sample_submission.csv # id, score=0.5
64
+ └── solution.csv # id, label (real/fake)
65
+ ```
66
+
67
+ ---
68
+
69
+ ## CSV Columns
70
+
71
+ **train.csv**
72
+ ```csv
73
+ id,label
74
+ train/real/real_00001.wav,real
75
+ train/fake/fake_00001.wav,fake
76
+ ...
77
+ ```
78
+
79
+ **sample_submission.csv / your submission**
80
+ ```csv
81
+ id,score
82
+ test/voiceguard_00001.wav,0.92
83
+ test/voiceguard_00002.wav,0.04
84
+ ...
85
+ ```
86
+
87
+ `score` = P(fake) — probability between 0 and 1.
88
+ Higher score = more likely to be fake.
89
+ **Do NOT submit hard labels (0/1) — submit probabilities.**
90
+
91
+ ---
92
+
93
+ ## Split Construction
94
+
95
+ 1. Real clips sampled from VCTK + LibriSpeech, trimmed to 4 seconds
96
+ 2. Fake clips generated via Coqui TTS (Tacotron2, VITS) and Microsoft SpeechT5
97
+ 3. Stratified 80/20 split, **speaker-disjoint**: no speaker appears in both train and test
98
+ 4. At least 1 TTS system in test not seen during training (generalization challenge)
99
+ 5. Test files renamed to flat `voiceguard_NNNNN.wav`
100
+
101
+ ---
102
+
103
+ ## Loading the Data
104
+
105
+ ```python
106
+ import pandas as pd
107
+ import librosa
108
+ import numpy as np
109
+
110
+ train_df = pd.read_csv("train.csv")
111
+ train_df["label_int"] = (train_df["label"] == "fake").astype(int)
112
+
113
+ y, sr = librosa.load(train_df.iloc[0]["id"], sr=16000)
114
+ label = train_df.iloc[0]["label"] # 'real' or 'fake'
115
+ label_int = train_df.iloc[0]["label_int"] # 0 or 1
116
+
117
+ # Spectral flatness (key anti-spoofing feature)
118
+ flatness = librosa.feature.spectral_flatness(y=y).mean()
119
+ print(f"Spectral flatness: {flatness:.4f}")
120
+ # Real speech: ~0.001-0.01 (peaky spectrum)
121
+ # TTS speech: ~0.05-0.3 (flatter spectrum)
122
+ ```
123
+
124
+ ---
125
+
126
+ ## Key Discriminative Features
127
+
128
+ TTS systems leave detectable artifacts that distinguish fake from real:
129
+
130
+ | Feature | Real Speech | TTS/Fake Speech |
131
+ |---------|-------------|-----------------|
132
+ | Spectral flatness | Low (~0.001–0.01) | High (~0.05–0.3) |
133
+ | HNR (Harmonics-to-Noise) | Moderate variability | Very high / uniform |
134
+ | LFCC smoothness | Natural variation | Over-smooth |
135
+ | Pitch trajectory | Natural micro-variation | Machine-perfect |
136
+ | Spectral envelope | Slight roughness | Clean, artifact-free |
137
+
138
+ These differences make this dataset **easily separable** (AUROC=1.0 on all approaches).
139
+
140
+ ---
141
+
142
+ ## Evaluation
143
+
144
+ Score = AUROC on test set (threshold-free ranking metric):
145
+ ```python
146
+ from sklearn.metrics import roc_auc_score
147
+ score = roc_auc_score(y_true_binary, y_pred_scores)
148
+ # y_true_binary: 1=fake, 0=real
149
+ # y_pred_scores: your P(fake) predictions
150
+ ```
151
+
152
+ AUROC = 1.0 means perfect ranking; AUROC = 0.5 means random.
153
+
154
+ ---
155
+
156
+ ## Difficulty & Insights
157
+
158
+ - **Why AUROC=1.0?** This dataset uses modern but detectable TTS systems. Real speech from VCTK/LibriSpeech has natural vocal tract noise; Tacotron2/VITS produce unrealistically clean spectral envelopes.
159
+ - **Production hardness:** Real-world deepfake detection is much harder. See [ASVspoof 2021 DF](https://www.asvspoof.org/) and [In-the-Wild](https://deepfake-total.com/) for challenging benchmarks.
160
+ - **Unseen TTS generalization:** The held-out TTS system in the test set is included to test generalization. Feature-based approaches (LFCC, HNR) generalize better than systems overfitting to one TTS artifact.
161
+
162
+ ---
163
+
164
+ ## Real-World Context
165
+
166
+ Voice deepfakes are increasingly used in:
167
+ - **Voice phishing (vishing):** impersonating executives or family members
168
+ - **Identity fraud:** bypassing voice-based authentication
169
+ - **Disinformation:** fabricated statements attributed to public figures
170
+
171
+ Key benchmarks beyond this dataset: [ASVspoof 2019/2021](https://www.asvspoof.org/), [ADD Challenge](https://addchallenge.cn/), [In-the-Wild Dataset](https://deepfake-total.com/).