SpecAugmentTransform<T>

Models & Types · AiDotNet.Data.Transforms

Applies SpecAugment data augmentation (Park et al., 2019) to spectrogram tensors. Performs time masking and frequency masking to improve model robustness.

Implements: ITransform<Tensor<T>, Tensor<T>>

For Beginners

SpecAugment is a simple but effective augmentation for audio models. It randomly “erases” parts of the spectrogram during training to prevent overfitting.

How It Works

SpecAugment applies two types of masking to spectrograms:

  • Frequency masking: Masks consecutive frequency bins (vertical stripes).
  • Time masking: Masks consecutive time frames (horizontal stripes).

Reference: Park, D.S. et al. “SpecAugment: A Simple Data Augmentation Method for ASR.” Interspeech 2019.

Constructors

Constructor Summary
SpecAugmentTransform(int freqMaskParam, int timeMaskParam, int numFreqMasks, int numTimeMasks, int? seed) Creates a new SpecAugment transform.

Methods

Method Summary
Tensor<T> Apply(Tensor<T> input) Applies SpecAugment masking to a spectrogram tensor.