mandipgoswami commited on
Commit
e62674f
·
verified ·
1 Parent(s): 49271af

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +266 -45
README.md CHANGED
@@ -1,47 +1,268 @@
1
  ---
2
- dataset_info:
3
- features:
4
- - name: audio
5
- dtype:
6
- audio:
7
- sampling_rate: 22050
8
- - name: file_path
9
- dtype: string
10
- - name: machine_type
11
- dtype: string
12
- - name: operating_condition
13
- dtype: string
14
- - name: label
15
- dtype: string
16
- - name: anomaly_subtype
17
- dtype: string
18
- - name: snr_level
19
- dtype: string
20
- - name: duration_seconds
21
- dtype: float32
22
- - name: sample_rate
23
- dtype: int32
24
- - name: split
25
- dtype: string
26
- splits:
27
- - name: train
28
- num_bytes: 15441877664.686
29
- num_examples: 35001
30
- - name: val
31
- num_bytes: 3308860571.5
32
- num_examples: 7500
33
- - name: test
34
- num_bytes: 3308426477.381
35
- num_examples: 7499
36
- download_size: 21877896426
37
- dataset_size: 22059164713.567
38
- configs:
39
- - config_name: default
40
- data_files:
41
- - split: train
42
- path: data/train-*
43
- - split: val
44
- path: data/val-*
45
- - split: test
46
- path: data/test-*
47
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ dataset_name: AnomalyMachine-50K
3
+ license: cc-by-4.0
4
+ task_categories:
5
+ - audio-classification
6
+ - sound-event-detection
7
+ language:
8
+ - en
9
+ tags:
10
+ - anomaly-detection
11
+ - industrial
12
+ - acoustic
13
+ - synthetic
14
+ - machine-sounds
15
+ - predictive-maintenance
16
+ size_categories:
17
+ - 10K<n<100K
18
+ pretty_name: AnomalyMachine-50K
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  ---
20
+
21
+
22
+ ### Dataset Summary
23
+
24
+ **AnomalyMachine-50K** is a fully synthetic industrial machine sound anomaly detection dataset designed for research on acoustic monitoring, predictive maintenance, and sound event detection.
25
+ The dataset contains **50,000** monaural audio clips, each **10 seconds** long at **22,050 Hz**, covering six industrial machine types, multiple operating conditions, and diverse anomaly types under different signal-to-noise ratios.
26
+
27
+ The dataset is generated entirely via **signal-processing based synthesis** (no neural audio models), ensuring that it is lightweight to regenerate, deterministic under a fixed seed, and free from copyright or privacy issues.
28
+
29
+ ### Supported Tasks and Leaderboards
30
+
31
+ - **audio-classification**: classify clips as `normal` vs `anomalous`.
32
+ - **sound-event-detection**: detect and characterize anomaly subtypes at the clip level.
33
+
34
+ No official leaderboard is provided, but the dataset is intended as a strong synthetic counterpart to real-world benchmarks such as **DCASE 2020 Task 2**.
35
+
36
+ ### Dataset Structure
37
+
38
+ - **Number of clips**: 50,000
39
+ - **Clip duration**: 10 seconds
40
+ - **Sample rate**: 22,050 Hz
41
+ - **Channels**: mono
42
+
43
+ **Machine types**:
44
+
45
+ - `fan`
46
+ - `pump`
47
+ - `compressor`
48
+ - `conveyor_belt`
49
+ - `electric_motor`
50
+ - `valve`
51
+
52
+ **Operating conditions**:
53
+
54
+ - `idle`
55
+ - `normal_load`
56
+ - `high_load`
57
+
58
+ **Labels**:
59
+
60
+ - `normal`
61
+ - `anomalous`
62
+
63
+ **Anomaly subtypes**:
64
+
65
+ - `bearing_fault` (applies to `fan`, `pump`, `compressor`, `electric_motor`)
66
+ - `imbalance` (applies to `fan`, `compressor`, `electric_motor`)
67
+ - `cavitation` (applies to `pump`, `valve`)
68
+ - `overheating` (applies to `compressor`, `electric_motor`, `pump`)
69
+ - `obstruction` (applies to `conveyor_belt`, `fan`, `valve`)
70
+
71
+ **SNR levels** (background factory-floor ambience):
72
+
73
+ - `clean` (no added noise)
74
+ - `low_noise` (≈20 dB SNR)
75
+ - `medium_noise` (≈10 dB SNR)
76
+ - `high_noise` (≈5 dB SNR)
77
+
78
+ **Splits** (stratified by `machine_type` and `label`):
79
+
80
+ - `train`: 70%
81
+ - `validation`: 15%
82
+ - `test`: 15%
83
+
84
+ ### Data Fields
85
+
86
+ Each split is a `datasets.Dataset` with the following features:
87
+
88
+ - **audio** (`Audio`, 22050 Hz): waveform and metadata loaded from on-disk WAV files.
89
+ - **file_path** (`string`): relative path to the underlying WAV file.
90
+ - **machine_type** (`string`): one of the six machine types.
91
+ - **operating_condition** (`string`): `idle`, `normal_load`, or `high_load`.
92
+ - **label** (`string`): `normal` or `anomalous`.
93
+ - **anomaly_subtype** (`string`): one of the anomaly subtypes above; `none` for normal clips.
94
+ - **snr_level** (`string`): `clean`, `low_noise`, `medium_noise`, or `high_noise`.
95
+ - **duration_seconds** (`float32`): clip duration in seconds (nominally 10.0).
96
+ - **sample_rate** (`int32`): sample rate in Hz (22,050).
97
+ - **split** (`string`): `train`, `val`, or `test`.
98
+
99
+ ### Example Row
100
+
101
+ ```python
102
+ {
103
+ "audio": {
104
+ "array": <np.ndarray shape=(220500,)>,
105
+ "sampling_rate": 22050
106
+ },
107
+ "file_path": "audio/fan_normal_load_anomalous_bearing_fault_1234.wav",
108
+ "machine_type": "fan",
109
+ "operating_condition": "normal_load",
110
+ "label": "anomalous",
111
+ "anomaly_subtype": "bearing_fault",
112
+ "snr_level": "medium_noise",
113
+ "duration_seconds": 10.0,
114
+ "sample_rate": 22050,
115
+ "split": "train",
116
+ }
117
+ ```
118
+
119
+ ### Generation Methodology
120
+
121
+ The entire dataset is generated using **deterministic signal processing techniques** implemented in Python (NumPy, SciPy, and related libraries). No neural audio models are used.
122
+
123
+ **1. Base machine sound synthesis**
124
+
125
+ For each machine type, a dedicated synthesis model is used:
126
+
127
+ - **Fan**: broadband noise plus rotating blade harmonics with fundamental between 50–200 Hz.
128
+ - **Pump**: low-frequency rumble (20–80 Hz) with rhythmic pressure pulses and fluid noise.
129
+ - **Compressor**: cyclic compression envelope on top of a 60 Hz motor hum and its harmonics.
130
+ - **Conveyor belt**: rhythmic tapping events combined with frictional broadband noise.
131
+ - **Electric motor**: tonal fundamental derived from 1200–3600 RPM with harmonics and brush noise.
132
+ - **Valve**: turbulent broadband flow noise with intermittent actuation clicks.
133
+
134
+ Each clip is synthesized at 22,050 Hz for 10 seconds and normalized to a target RMS while preventing clipping. All machines are modeled in mono for simplicity and reproducibility.
135
+
136
+ **2. Operating condition modifiers**
137
+
138
+ Operating conditions modulate the base synthesis:
139
+
140
+ - `idle`: reduced amplitude, fewer or weaker harmonics.
141
+ - `normal_load`: baseline signal model.
142
+ - `high_load`: increased amplitude, additional harmonic distortion, and slight pitch or envelope changes.
143
+
144
+ These modifiers are applied deterministically on top of the base machine model.
145
+
146
+ **3. Anomaly injection**
147
+
148
+ After generating the base clip, anomaly-specific transformations are applied **only** to clips labeled `anomalous`:
149
+
150
+ - **Bearing fault**: periodic impulsive spikes at a low fault frequency, created as a smoothed impulse train added to the base signal.
151
+ - **Imbalance**: low-frequency sinusoidal amplitude modulation of the waveform.
152
+ - **Cavitation**: short high-energy noise bursts (50–200 ms) at random times within the clip.
153
+ - **Overheating**: gradually increasing high-frequency noise floor, implemented via a ramped high-pass filtered noise process.
154
+ - **Obstruction**: intermittent amplitude drops combined with slight resonance or frequency warping events.
155
+
156
+ Anomaly applicability follows the mapping described above; invalid combinations are **never** generated.
157
+
158
+ **4. Background noise and SNR control**
159
+
160
+ Factory-floor ambience is synthesized as:
161
+
162
+ - Approximate **pink noise** (1/f spectrum), generated from white noise in the frequency domain.
163
+ - A **60 Hz** hum plus a **120 Hz** harmonic.
164
+
165
+ For each clip, the noise is mixed at a specified SNR level using the power-based definition:
166
+ \[
167
+ \mathrm{SNR_{dB}} = 10 \log_{10} \left( \frac{P_\text{signal}}{P_\text{noise}} \right)
168
+ \]
169
+
170
+ Signal and noise RMS levels are computed, and the noise amplitude is scaled accordingly to achieve the target SNR. The `clean` SNR level skips noise addition entirely.
171
+
172
+ **5. Splitting and metadata**
173
+
174
+ Metadata for each clip is stored in a CSV file and includes:
175
+
176
+ - `file_path`, `machine_type`, `operating_condition`, `label`,
177
+ - `anomaly_subtype`, `snr_level`, `duration_seconds`, `sample_rate`, and `split`.
178
+
179
+ Train/validation/test splits are assigned in a stratified way over (`machine_type`, `label`) combinations with configurable ratios (`0.7/0.15/0.15` by default).
180
+
181
+ ### Usage
182
+
183
+ ```python
184
+ from datasets import load_dataset
185
+
186
+ dataset = load_dataset("YOUR_USERNAME/AnomalyMachine-50K")
187
+
188
+ train_ds = dataset["train"]
189
+ example = train_ds[0]
190
+
191
+ audio = example["audio"]["array"] # numpy array
192
+ sr = example["audio"]["sampling_rate"] # 22050
193
+ label = example["label"] # "normal" or "anomalous"
194
+ machine = example["machine_type"]
195
+ anomaly = example["anomaly_subtype"]
196
+
197
+ print(machine, label, anomaly, sr, audio.shape)
198
+ ```
199
+
200
+ You can easily plug this dataset into PyTorch or other frameworks:
201
+
202
+ ```python
203
+ import torch
204
+ from torch.utils.data import DataLoader
205
+
206
+ ds = dataset["train"]
207
+
208
+ def collate_fn(batch):
209
+ waveforms = [torch.tensor(x["audio"]["array"]) for x in batch]
210
+ labels = [1 if x["label"] == "anomalous" else 0 for x in batch]
211
+ waveforms = torch.stack(waveforms)
212
+ labels = torch.tensor(labels, dtype=torch.long)
213
+ return waveforms, labels
214
+
215
+ loader = DataLoader(ds, batch_size=32, shuffle=True, collate_fn=collate_fn)
216
+
217
+ for waveforms, labels in loader:
218
+ # Training loop here
219
+ pass
220
+ ```
221
+
222
+ ### Benchmark Comparison
223
+
224
+ | Dataset | Type | #Clips | Machines | Anomaly Types | Real/Synthetic | License |
225
+ |------------------------|-----------:|-------:|---------:|--------------:|:--------------:|:------------|
226
+ | DCASE 2020 Task 2 | Acoustic | ~7k | 6 | Several | Real | Various |
227
+ | AnomalyMachine-50K | Acoustic | 50k | 6 | 5 | Synthetic | CC-BY-4.0 |
228
+
229
+ **AnomalyMachine-50K** is significantly larger and fully synthetic, making it well-suited for controlled experiments, ablation studies, and pretraining, while DCASE 2020 Task 2 provides real-world complexity and noise characteristics.
230
+
231
+ ### Citation
232
+
233
+ If you use this dataset in your research, please cite it as:
234
+
235
+ ```bibtex
236
+ @dataset{anomalymachine50k_2026,
237
+ title = {AnomalyMachine-50K: Synthetic Industrial Machine Sound Anomaly Dataset},
238
+ author = {Mandip Goswami},
239
+ year = {2026},
240
+ publisher = {Hugging Face},
241
+ howpublished = {\url{https://huggingface.co/datasets/AnomalyMachine-50K}}
242
+ }
243
+ ```
244
+
245
+ ### Known Limitations
246
+
247
+ - The dataset is **fully synthetic**; real industrial soundscapes can exhibit more complex reverberation, coupling between machines, and non-stationary background environments.
248
+ - Anomaly patterns are defined by explicit signal processing rules and may not capture all nuances of real hardware faults.
249
+ - Only single-machine audio is modeled per clip; multi-machine interference and spatial effects are not included.
250
+ - The mapping between physical parameters (e.g., RPM, load) and generated audio is simplified and not tied to any specific hardware make or model.
251
+
252
+ ### Ethical Considerations
253
+
254
+ This dataset does not contain speech or personally identifiable information. It is intended for research and development of anomaly detection and predictive maintenance systems. When deploying models trained on this dataset in real industrial environments, practitioners should validate performance carefully and account for domain shift.
255
+
256
+ ### How to Regenerate the Dataset
257
+
258
+ The original generation pipeline is implemented using:
259
+
260
+ - `generate_sounds.py`: base machine sound synthesis and metadata creation.
261
+ - `add_anomalies.py`: anomaly-specific signal transformations.
262
+ - `add_noise.py`: factory-floor noise generation and SNR mixing.
263
+ - `validate_dataset.py`: structural and statistical integrity checks.
264
+ - `upload_to_hf.py`: conversion to `datasets` format and push to the Hugging Face Hub.
265
+
266
+ All parameters (number of clips, machine types, anomaly types, SNR levels, and split ratios) are controlled via a single YAML configuration file so that the dataset can be regenerated at any scale.
267
+
268
+