← Back to the chapter · Previous detail · Next detail →

Technical detail · Audio Feature Extraction for IoT

Train a keyword model and validate each task

Those coefficients then have to be turned into a trained model, and the loop that does it is where the acoustic assumptions are quietly baked in. Work through Figure 7 from the top of the batch loop to the four heads at the bottom.

Upper card: a training loop where a random index leads to loading audio samples, augmenting the clip and extracting a 98 by 13 MFCC record, while a parallel branch selects background noise with a random time shift and volume and feeds the augmentation step. The batch of 256 goes to a cross-entropy loss and an Adam or SGD update, with an arrow looping back and a note to repeat about 500 steps or stop early. Lower card: one audio window enters shared hidden layers that fan out to keyword, speaker, stress and environment heads.
Waveform augmentation precedes MFCC extraction in this training loop. Each output head needs its own labels, metrics, and failure boundary.

Note where Augment the clip sits in Figure 7: the waveform-level background-noise, time-shift, and volume changes shown come before Extract MFCC 98 x 13. Other training methods can augment extracted features, such as SpecAugment’s time and frequency masking of log-mel spectrograms; the deployed feature extractor still uses the recorded unaugmented inference recipe. The loop then closes through Cross-entropy loss and Adam or SGD update and repeats, which is why the split and the background-noise set are part of the model’s evidence rather than a preprocessing footnote. The lower card carries the discipline that multi-task audio work most often skips: shared hidden layers may serve keyword, speaker, stress, and environment at once, but each head needs its own label source, its own metric, and its own stated failure boundary. A trunk that is well validated for keyword detection has proved nothing about the speaker head hanging off the same layers.

← Back to the chapter · Previous detail · Next detail →