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.
