PANNsOptions
Options & Configuration · AiDotNet.Audio.Classification
Configuration options for the PANNs (Pre-trained Audio Neural Networks) model.
Inheritance: ModelOptions → PANNsOptions
For Beginners
PANNs is a family of CNN-based audio classifiers. Unlike Transformer models (AST, BEATs), PANNs uses convolutional neural networks (CNNs) - the same technology used for image recognition. CNNs are good at detecting local patterns (like specific frequency shapes) and combining them into higher-level understanding (like “this is a dog bark”). PANNs is fast, well-tested, and widely used as a feature extractor for other audio tasks.
How It Works
PANNs (Kong et al., IEEE/ACM TASLP 2020) provides a comprehensive set of pre-trained CNN-based audio classification models. The flagship CNN14 model achieves 43.1% mAP on AudioSet-2M and has become one of the most widely-used audio feature extractors.
References:
- Paper: “PANNs: Large-Scale Pretrained Audio Neural Networks for Audio Pattern Recognition” (Kong et al., 2020)
- Repository:
https://github.com/qiuqiangkong/audioset_tagging_cnn
Constructors
| Constructor | Summary |
|---|---|
PANNsOptions() |
Initializes options with the paper-default PANNs CNN14 configuration. |
PANNsOptions(PANNsOptions other) |
Creates an independent copy of an existing PANNs configuration. |
Properties
| Property | Summary |
|---|---|
OnnxModelOptions OnnxOptions { get; set; } |
Gets or sets ONNX runtime options. |
double DropoutRate { get; set; } |
Gets or sets the dropout rate. |
double LabelSmoothing { get; set; } |
Gets or sets the label smoothing factor. |
double LearningRate { get; set; } |
Gets or sets the initial learning rate. |
double Threshold { get; set; } |
Gets or sets the confidence threshold. |
double WindowOverlap { get; set; } |
Gets or sets the window overlap ratio. |
double WindowSize { get; set; } |
Gets or sets the window size in seconds. |
int BaseChannels { get; set; } |
Gets or sets the base channel count. |
int EmbeddingDim { get; set; } |
Gets or sets the embedding dimension for the classification head. |
int FMax { get; set; } |
Gets or sets the maximum frequency. |
int FMin { get; set; } |
Gets or sets the minimum frequency. |
int FftSize { get; set; } |
Gets or sets the FFT window size. |
int HopLength { get; set; } |
Gets or sets the hop length. |
int NumBlocks { get; set; } |
Gets or sets the number of CNN blocks. |
int NumMels { get; set; } |
Gets or sets the number of mel bands. |
int SampleRate { get; set; } |
Gets or sets the audio sample rate in Hz. |
int WarmUpSteps { get; set; } |
Gets or sets the warm-up steps. |
string ModelPath { get; set; } |
Gets or sets the path to a pre-trained ONNX model file. |
string[] CustomLabels { get; set; } |
Gets or sets custom event labels. |