CRNNEventDetectorOptions

Options & Configuration · AiDotNet.Audio.Classification

Configuration options for the CRNN (Convolutional Recurrent Neural Network) Sound Event Detector.

Inheritance: ModelOptions → CRNNEventDetectorOptions

For Beginners

CRNN is a classic and reliable approach to detecting sounds over time. Think of it in two stages:

  1. CNN stage: Looks at the spectrogram like a picture, finding patterns like “this

frequency pattern looks like a dog bark” or “this shape looks like a piano note”

  1. RNN stage: Reads the patterns over time like reading a sentence, understanding

“the dog bark started, continued, and then stopped”

This combination makes CRNN good at both identifying what sounds are present AND when they happen. It’s simpler than Transformer-based models but still very effective.

How It Works

CRNN for SED (Cakir et al., 2017) combines convolutional layers for spectral feature extraction with recurrent layers (GRU/LSTM) for temporal modeling. It is the standard baseline architecture for the DCASE Sound Event Detection challenge and achieves strong results on AudioSet, ESC-50, and URBAN-SED benchmarks. The model processes mel spectrograms through CNN blocks, then models temporal dependencies with bidirectional GRU layers, producing frame-level event probabilities.

Constructors

Constructor Summary
CRNNEventDetectorOptions()

Properties

Property Summary
OnnxModelOptions OnnxOptions { get; set; } Gets or sets ONNX runtime options.
bool Bidirectional { get; set; } Gets or sets whether to use bidirectional RNN.
double DetectionWindowSize { get; set; } Gets or sets the window size in seconds for detection.
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 learning rate.
double Threshold { get; set; } Gets or sets the confidence threshold for event detection.
double WindowOverlap { get; set; } Gets or sets the window overlap ratio (0-1).
int CNNKernelSize { get; set; } Gets or sets the CNN kernel size.
int FMax { get; set; } Gets or sets the maximum frequency for mel filterbank.
int FMin { get; set; } Gets or sets the minimum frequency for mel filterbank.
int FftSize { get; set; } Gets or sets the FFT window size.
int HopLength { get; set; } Gets or sets the hop length between FFT frames.
int NumMels { get; set; } Gets or sets the number of mel filterbank channels.
int NumRNNLayers { get; set; } Gets or sets the number of RNN layers.
int PoolSize { get; set; } Gets or sets the CNN pooling size for frequency dimension.
int RNNHiddenSize { get; set; } Gets or sets the RNN hidden size.
int SampleRate { get; set; } Gets or sets the audio sample rate in Hz.
int[] CNNChannels { get; set; } Gets or sets the number of CNN channels per block.
string ModelPath { get; set; } Gets or sets the path to a pre-trained ONNX model file.
string Variant { get; set; } Gets or sets the model variant (“small”, “base”, “large”).
string[] CustomLabels { get; set; } Gets or sets custom event labels.