config-reference.md

May 28, 2026 ยท View on GitHub

Configuration Reference

Sections

AudioConfig

FieldTypeDefaultDescription
spec_durationfloat5.0Spectrogram duration in seconds
spec_heightint128Spectrogram height in pixels
spec_widthint480Spectrogram width in pixels (must be divisible by 32)
win_lengthfloat0.055Window length is specified in seconds, to retain temporal and frequency resolution when max_freq and sampling rate are changed
n_fftUnion[int, NoneType]NoneIf none, set n_fft = win_length_samples
max_freqint8000Maximum frequency in Hz
min_freqint100Minimum frequency in Hz
sampling_rateint18000A little more than 2 * max_freq
freq_scalestr'mel'"linear", "log" or "mel"
powerfloat1.0Use 1.0 for magnitude and 2.0 for power spectrograms
decibelsboolFalseUse decibel amplitude scale?
top_dbfloat80Threshold below max amplitude in dB; lower values are clipped
db_powerfloat1.0Raise to this exponent after convert to decibels
log_freq_gainfloat0.6Boost loudness of higher frequencies with log scale
mel_normUnion[str, NoneType]NoneMel filterbank normalization: None or "slaney"
choose_channelboolFalseUse heuristic to pick the cleanest audio channel?
check_secondsfloat6.0Check this many seconds to pick channel
use_spec_cacheboolFalseWhen use_spec_cache=False, each spectrogram is generated separately. When use_spec_cache=True, a single spectrogram is generated for the recording, by concatenating chunks. Then that big spectrogram is divided as needed, which saves time when there is a lot of overlap.
chunks_per_specint3chunks_per_spec defines the size of the individual spectrograms that are concatenated to create the cache, where the duration is chunks_per_spec * spec_duration.

TrainingConfig

FieldTypeDefaultDescription
model_typestr'effnet.2'Use timm.x for timm model "x"
head_typeUnion[str, NoneType]NoneIf None, use backbone's default
hidden_channelsint256Hidden channels in classifier head
lse_tempfloat0.5LSE temperature for temporal_sed head
two_wayboolTrueBi-directional or unidirectional temporal_sed head
pretrainedboolFalseUse pretrained weights (applies to timm models)
load_ckpt_pathUnion[str, NoneType]NoneFor transfer learning or fine-tuning
freeze_backboneboolFalseOption when transfer learning
multi_labelboolTrueTrue for multi-label, False for multi-class classification
deterministicboolFalseEnable deterministic training for reproducibility
seedUnion[int, NoneType]NoneRandom seed for reproducibility; None uses random seed
learning_ratefloat0.001Base learning rate
batch_sizeint64Mini-batch size
shuffleboolTrueShuffle data during training?
num_epochsint10Number of epochs
warmup_fractionfloat0.0Learning rate warmup fraction
save_last_nint3Save checkpoints for this many last epochs
num_foldsint1For k-fold cross-validation
val_portionfloat0Used only if num_folds = 1
train_dbstr'data/training.db'Path to training database
train_picklestr'data/training.pkl'Path to training pickle file
test_pickleUnion[str, NoneType]NonePath to test pickle file
frame_label_pickleUnion[str, NoneType]NonePath to frame-label pickle used in SED training
num_workersint3Number of trainer worker threads
compileboolFalseCompile the model?
mixed_precisionboolFalseUse mixed precision?
use_class_weightsboolFalseShould loss function weight classes by spec count?
weight_exponentfloat0.5Exponent to soften the class weights
pos_label_smoothingfloat0.08Positive side of asymmetric label smoothing
neg_label_smoothingfloat0.01Negative side of asymmetric label smoothing
optimizerstr'radam'Any timm optimizer
opt_weight_decayUnion[float, NoneType]NoneWeight decay option (L2 regularization)
opt_beta1Union[float, NoneType]NoneAdam/RAdam beta1 (exponential decay rate for first moment)
opt_beta2Union[float, NoneType]NoneAdam/RAdam beta2 (exponential decay rate for second moment)
drop_rateUnion[float, NoneType]NoneStandard dropout
drop_path_rateUnion[float, NoneType]NoneStochastic depth dropout
sed_fpsint4Frames per second from SED heads
frame_loss_weightfloat0.5Segment_loss_weight = 1 - frame_loss_weight
offpeak_weightfloat0Weight for penalizing predictions outside peak regions
max_per_recordingUnion[int, NoneType]NonePer-recording sampling: if set, randomly select this many specs per recording per epoch
val_max_per_recordingUnion[int, NoneType]NonePer-recording limit for validation: if set, take the first N specs per recording
augmentboolTrueUse data augmentation?
max_augmentationsint1Up to this many per spectrogram
noise_class_namestr'Noise'Augmentation treats noise specially
prob_simple_mergefloat0.32Prob of simple merge
prob_mixupfloat0.0Prob of traditional mixup (mutually exclusive with simple merge)
prob_cutmixfloat0.0Prob of CutMix (mutually exclusive with simple merge and mixup)
mixup_alphafloat0.4Beta distribution parameter for mixup/cutmix lambda
prob_fade1float0.5Prob of fading after augmentation
min_fade1float0.1Min factor for fading
max_fade1float1.0Max factor for fading
augmentationslist<factory >Detailed augmentation settings

InferenceConfig

FieldTypeDefaultDescription
segment_lenUnion[float, NoneType]NoneFor models with SED heads, if segment_len is None, output tags of variable lengths that match the sounds detected, otherwise output tags of length segment_len seconds. For non-SED models, segment_len is defined by the model.
overlapfloat0.0Number of seconds overlap for adjacent spectrograms
min_scorefloat0.8Only generate labels when score is at least this
num_threadsint3More threads = faster but more VRAM
max_modelsUnion[int, NoneType]NoneIf specified, limit ensemble size accordingly
autocastboolTrueFaster and less VRAM but less precision
audio_powerfloat0.7Audio power parameter during inference
scaling_coefficientfloat1.0Platt scaling coefficient, to align predictions with probabilities
scaling_interceptfloat0.0Platt scaling intercept, to align predictions with probabilities
label_fieldstr'codes'"names", "codes", "alt_names" or "alt_codes"
block_sizeint200Do this many spectrograms at a time to avoid running out of GPU memory
openvino_block_sizeint100Block size when OpenVINO is used (do not change after creating onnx files)
initial_offsetsUnion[list, NoneType]NoneIf specified, analyze command calls get_overlapping_scores instead of get_recording_scores and passes this array.

MiscConfig

FieldTypeDefaultDescription
force_cpuboolFalseIf true, use CPU (for performance comparisons)
ckpt_folderstr'data/ckpt'Use an ensemble of all checkpoints in this folder for inference
search_ckpt_pathUnion[str, NoneType]NoneFolder with one or more checkpoints for embeddings and search
exclude_liststr'data/exclude.txt'Classes listed in this file are excluded from inference output
source_regexesUnion[list, NoneType]<factory >Sample regexes to map recording names to source names
map_codesUnion[dict, NoneType]NoneDict mapping old to new class codes for checkpoint compatibility

BaseConfig

FieldTypeDefaultDescription
audioAudioConfig
trainTrainingConfig
inferInferenceConfig
miscMiscConfig