Speech & Audio AI Lab

Interactive labs for speech recognition, speech synthesis, and audio in general: in-browser DSP experiments, algorithms, datasets, and a learning path, without storing any recording.

43experiments

Audio classification

Audio Classification

Intermediate14 minStage 5

Learning Objectives

  • Describe the audio event classification pipeline
  • Distinguish single-label from multi-label classification
  • List appropriate evaluation metrics and dataset challenges

Audio classification determines the type of a sound: a barking dog, a bell, music, speech. The usual pipeline: split the recording into segments, then compute a mel spectrogram for each segment, then pass it to a model that outputs a probability for each class. Well-known models include YAMNet, PANNs, and AST, all of which need an environment outside the browser.

The setup differs depending on the task. In single-label classification, softmax is used and the highest probability is chosen. In multi-label classification, as in AudioSet, a clip can contain several events at once, so a sigmoid function is used for each class and the threshold is separate for each class.

Metrics include accuracy, F1, and mean average precision (mAP) for multi-label classification. Class balance must be considered, and segments from the same original recording must not be placed in both training and testing.

Example: a 5-second clip at 16000 Hz contains 80000 samples. If it is divided into one-second windows without overlap, this gives five windows, and their predictions can be aggregated by averaging. In the Lab, there are local kNN classification tools on your clips and a classification tool based on an available model, and its results remain educational. When measuring performance, use clips from recordings different from those used in training.

References

  1. Google. YAMNet (Google, Kaggle Models). Kaggle Models. Source
  2. Kong et al.. PANNs: Large-Scale Pretrained Audio Neural Networks for Audio Pattern Recognition. arXiv (2019). DOI
  3. Gong et al.. AST: Audio Spectrogram Transformer. arXiv (2021). DOI
  4. Gemmeke et al.. Audio Set: An ontology and human-labeled dataset for audio events (2017). Source

Audio processing in the experiments takes place inside your browser. Audio, texts, and conversations are not saved on the server. Privacy Policy