Dataset Viewer

The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.


GSC MFCC Noisy SNR

Google Speech Commands v2 β€” MFCC Features with SNR-Based Noise Augmentation

This dataset is a processed version of the Google Speech Commands v2 (GSC v2) dataset prepared for TinyML Keyword Spotting (KWS) research.

The dataset contains 1-second speech clips converted into 40-dimensional Mel-Frequency Cepstral Coefficient (MFCC) representations. To improve robustness to environmental noise, background-noise recordings from the GSC dataset are mixed with speech at a specified Signal-to-Noise Ratio (SNR).

The resulting features are intended for training and evaluating lightweight keyword-spotting models for resource-constrained and embedded devices.


Dataset Summary

Property Value
Source dataset Google Speech Commands v2
Task Keyword Spotting
Audio duration 1 second
Sampling rate 16 kHz
Input representation MFCC
Number of MFCC coefficients 40
FFT size 400
Hop length 160
Mel filters 40
Noise augmentation GSC background noise
Noise level 5 dB SNR
Number of classes 12
Speaker split Yes
Output format PyTorch .pt
Intended application TinyML / Embedded KWS

Classes

The dataset contains 12 classes:

Keyword classes

  1. yes
  2. no
  3. up
  4. down
  5. left
  6. right
  7. on
  8. off
  9. stop
  10. go

Additional classes

  1. unknown
  2. silence

The unknown class contains speech commands from GSC v2 that are not among the ten selected target keywords.

The silence class is generated from the _background_noise_ recordings provided with the original Google Speech Commands dataset.


Data Processing Pipeline

The dataset was generated using the following pipeline:

Google Speech Commands v2
          β”‚
          β”œβ”€β”€ Target keyword selection
          β”‚
          β”œβ”€β”€ Speaker identification
          β”‚
          β”œβ”€β”€ Speaker-independent train/validation/test split
          β”‚
          β”œβ”€β”€ 1-second audio normalization
          β”‚
          β”œβ”€β”€ Background noise extraction
          β”‚
          β”œβ”€β”€ Noise mixing at 5 dB SNR
          β”‚
          β”œβ”€β”€ MFCC feature extraction
          β”‚
          └── PyTorch dataset (.pt)

Speaker-Independent Splitting

To reduce speaker leakage between training and evaluation sets, audio files are grouped according to their speaker ID.

For Google Speech Commands filenames containing:

_nohash_

the portion before _nohash_ is used as the speaker identifier.

The speakers are randomly shuffled using a fixed seed:

random.seed(42)

and divided approximately as follows:

  • 80% training speakers
  • 10% validation speakers
  • 10% test speakers

Therefore, recordings from the same speaker are not intentionally distributed across multiple splits.


Audio Preprocessing

All audio recordings are converted to:

  • Sampling rate: 16,000 Hz
  • Duration: 1 second
  • Number of samples: 16,000

Shorter recordings are zero-padded, while longer recordings are truncated to exactly 16,000 samples.

Sampling rate = 16,000 Hz
Duration      = 1 second
Samples       = 16,000

Noise Augmentation

Background noise is obtained from the _background_noise_ directory of Google Speech Commands v2.

For each speech recording, a background-noise segment is randomly selected and scaled to achieve a target SNR of:

SNR = 5 dB

The noise scaling is based on signal and noise power:

SNRdB=10log⁑10(PsignalPnoise) SNR_{dB} = 10\log_{10}\left(\frac{P_{signal}}{P_{noise}}\right)

The noise is scaled according to:

Ξ±=PsignalPnoiseΓ—10SNR/10 \alpha = \sqrt{ \frac{P_{signal}} {P_{noise}\times10^{SNR/10}} }

and the noisy signal is generated as:

xnoisy=xsignal+Ξ±xnoise x_{noisy}=x_{signal}+\alpha x_{noise}

This produces a noisy version of each speech sample while preserving the original clean recording.


MFCC Feature Extraction

The audio signals are converted into MFCC representations using torchaudio.

Configuration:

SAMPLE_RATE = 16000
N_MFCC = 40
N_FFT = 400
HOP_LENGTH = 160
N_MELS = 40

The transformation is equivalent to:

torchaudio.transforms.MFCC(
    sample_rate=16000,
    n_mfcc=40,
    melkwargs={
        "n_fft": 400,
        "hop_length": 160,
        "n_mels": 40
    }
)

The resulting representation has approximately:

40 Γ— 101

MFCC coefficients/time frames depending on the transform configuration.

Each sample is therefore represented as a 2D MFCC feature matrix rather than raw audio.


Dataset Format

The processed dataset is stored as a PyTorch file:

gsc_mfcc_40x98.pt

The file contains:

{
    "X_train": X_train,
    "y_train": y_train,

    "X_val": X_val,
    "y_val": y_val,

    "X_test": X_test,
    "y_test": y_test
}

Feature tensors

X_train
X_val
X_test

contain MFCC feature tensors.

The expected feature representation is:

[number_of_samples, 40, time_frames]

Label tensors

y_train
y_val
y_test

contain integer class labels.

The exact integer-to-class mapping should be obtained from the dataset generation configuration rather than assuming alphabetical ordering.


Loading the Dataset

The dataset can be loaded using PyTorch:

import torch

data = torch.load(
    "gsc_mfcc_40x98.pt",
    map_location="cpu"
)

X_train = data["X_train"]
y_train = data["y_train"]

X_val = data["X_val"]
y_val = data["y_val"]

X_test = data["X_test"]
y_test = data["y_test"]

print("Training features:", X_train.shape)
print("Training labels:", y_train.shape)
print("Validation features:", X_val.shape)
print("Test features:", X_test.shape)

Example Model Input

For a CNN-based keyword-spotting model, the MFCC tensor can be expanded with a channel dimension:

X_train = X_train.unsqueeze(1)

resulting in:

[batch_size, 1, 40, time_frames]

This format can be directly used as input to a lightweight 2D CNN.


Source Dataset

This dataset is derived from the Google Speech Commands v2 dataset.

Please refer to the original dataset and its associated licensing and usage terms before using this derivative dataset.

Original dataset: Google Speech Commands


Limitations

This is a derived feature dataset, not the original Google Speech Commands audio dataset.

Important considerations:

  • The dataset contains MFCC features rather than the original audio files.
  • Noise augmentation is based on the background-noise recordings included with the source dataset.
  • The current noise-augmented configuration uses 5 dB SNR.
  • Results obtained using this dataset may depend on the exact preprocessing configuration.
  • The dataset should not be interpreted as a replacement for the original Google Speech Commands dataset.

License

Please refer to the licensing terms of the original Google Speech Commands dataset.

This repository contains derived features generated from the original dataset and does not redistribute the original dataset as a replacement for the source distribution.

Downloads last month
52