Implementation:Speechbrain Speechbrain Eval ESC50 Interpret
| Knowledge Sources | |
|---|---|
| Domains | Sound_Classification, Interpretability |
| Last Updated | 2026-02-09 00:00 GMT |
Overview
Concrete tool for out-of-distribution (OOD) evaluation of audio classifier interpreters provided by the SpeechBrain library.
Description
This recipe provides evaluation scripts for assessing interpreter models (L2I and LMAC) under out-of-distribution conditions. It defines the ESCContaminated dataset class that creates contaminated versions of the ESC-50 dataset by mixing with LJSpeech, white noise, or other ESC-50 sounds. Also defines the LJSPEECH_split helper class for train/test splitting of LJSpeech data. The evaluation measures how well interpreters can isolate and identify sound class features even when audio is contaminated with out-of-distribution noise sources.
Usage
Use this recipe to evaluate trained L2I or LMAC interpreter models on contaminated ESC-50 data. Requires the ESC-50 dataset and optionally the LJSpeech dataset. Specify the overlap type (mixtures, ljspeech, or white_noise) to control the contamination source.
Code Reference
Source Location
- Repository: SpeechBrain
- File: recipes/ESC50/interpret/eval.py
Signature
class ESCContaminated(torch.utils.data.Dataset):
def __init__(self, esc50_ds, cont_d, overlap_multiplier=2, overlap_type="mixtures"):
...
def __getitem__(self, idx):
...
class LJSPEECH_split(dts.LJSPEECH):
def __init__(self, root, url, folder_in_archive, download, train=True):
...
Import
python recipes/ESC50/interpret/eval.py hparams/l2i_cnn14.yaml --data_folder /path/to/ESC-50-master --overlap_type mixtures --add_wham_noise False
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| esc50_ds | dataset | Yes | The ESC-50 dataset as prepared for training |
| cont_d | dataset | Yes | The contamination dataset (ESC-50, LJSpeech, or synthetic) |
| overlap_type | str | Yes | One of "mixtures", "ljspeech", or "white_noise" |
Outputs
| Name | Type | Description |
|---|---|---|
| contaminated_samples | tuple | Mixed audio with contamination and original labels |
| interpretation_metrics | dict | Faithfulness and plausibility scores for the interpreter |
Usage Examples
python eval.py hparams/l2i_cnn14.yaml --data_folder /path/to/ESC-50-master --overlap_type mixtures --add_wham_noise False