ASDKit is a toolkit for anomalous sound detection (ASD) task.
ASDKit provides recipes for various ASD methods and supports evaluation on the DCASE 2020-2024 Task 2 datasets.
1. Clone and install this repository
How to
[somewhere]$ git clone https://github.com/TakuyaFujimura/dcase-asd-toolkit.git
[somewhere]$ cd dcase-asd-toolkit
[dcase-asd-toolkit]$ pip install -e . # Requires Python 3.10+
[dcase-asd-toolkit]$ pip install -r requirements.txt # The full environment used in our experiments2. Download the DCASE Task 2 datasets
How to
- Specify both
data_diranddcaseinjobs/download/run.sh. data_dir: The directory where the dataset will be stored. By default, it is set to the parent directory of this repository. If you change this, make sure to updatedata_dirin the other scripts accordingly.dcase: The name of the dataset. Available options are:dcase2021,dcase2022,dcase2023,dcase2024, anddcase2025.
[dcase-asd-toolkit]$ cd jobs/download
[dcase-asd-toolkit/jobs/download]$ bash run.shResult
<data_dir>
βββ original
βββ <dcase>3. Format the dataset
This process creates a formatted dataset in which the filename format and dataset structure are unified across all DCASE versions.
Additionally, it assigns ground-truth normal/anomalous labels to the test data. These labels are concealed during the challenge and released by the organizers afterward.
How to
- Specify
data_dir,dcase, andlink_modeinjobs/format/run.sh. link_mode:- If set
link_modetosymlink, symbolic links with formatted filenames will be created. This mode does not modify the original files. - If set to
link_modetomv, the original files will be directly renamed using the formatted filenames.
- If set
- On Windows, creating symbolic links needs to be allowed (
Settings > System > For Developers).
[dcase-asd-toolkit]$ cd jobs/format
[dcase-asd-toolkit/jobs/format]$ bash run.shResult
<data_dir>
βββ original
β βββ <dcase>
βββ formatted
βββ <dcase>(Setups to use pre-trained models)
To use pre-trained models, please follow the additional setup steps below.
This setups is required for the following recipes:
raw_beats, raw_eat, dis_beats_scac_trainable, and dis_eat_scac_trainable
For raw_beats and dis_beats_scac_trainable
- Download the BEATs pre-trained model from this URL (e.g.,
BEATs_iter3Pre-trained Model) - Place the downloaded file into
dcase-asd-toolkit/pretrained_models/beats/
For raw_eat and dis_eat_scac_trainable
- Download the EAT pre-trained model from this URL (e.g., EAT-base_epoch10_pt)
- Place the downloaded file into
dcase-asd-toolkit/pretrained_models/eat/ - Install fairseq by running the following commands:
cd dcase-asd-toolkit/jobs/install
bash install_fairseq.sh4. Execute the training and evaluation recipe
This script automatically performs the training and evaluation processes.
How to
- Specify
data_dirinconfig/train/main.yamlandconfig/extract/main.yaml. - Specify
dcaseinjobs/asd/call/?.sh(andseedif needed).
[dcase-asd-toolkit]$ cd jobs/asd/call
[dcase-asd-toolkit/jobs/asd/call]$ bash dis_spec_scac_trainable.shResult
dcase-asd-toolkit
βββ asdkit
βββ ...
βββ results
βββ <name> # `recipe`
βββ <dcase>
βββ <version> # `dis_spec_scac_trainable
βββ <seed> # `0`
βββ model
β βββ <model_ver> # all
β βββ .hydra
β βββ checkpoints/
β βββ events.out.tfevents.*
β βββ hparams.yaml
β βββ train.log
βββ output
βββ <infer_ver> # `last`
βββ bandsaw
βββ bearing
βββ ...
βββ valve
β βββ test_evaluate.csv # Evaluation results
β βββ test_extract.npz # Extracted test data information
β βββ test_score.csv # Anomaly scores for test data
β βββ train_extract.npz # Extracted training data information
β βββ train_score.csv # Anomaly scores for training data
β βββ visualize/ # UMAP visualization
βββ dev_official23.csv # Summarized evaluation results for dev subsets
βββ ...
βββ eval_official23.csv # Summarized evaluation results for eval subsetsASDKit supports the DCASE 2020-2024 conditions. Across these conditions, the machine types, the provided meta-information labels, and the evaluation scores differ. For all conditions, the datasets are divided into official dev and eval subsets, and evaluation scores are aggregated separately for each subset. The evaluation score is based on a combination of several types of AUC. ASDKit automatically computes the official evaluation scores according to the respective DCASE year.
| Metrics | Description |
|---|---|
| s_auc / s_pauc | AUC / pAUC computed using normal and anomalous sounds in the source domain. |
| t_auc / t_pauc | AUC / pAUC computed using normal and anomalous sounds in the target domain. |
| mix_auc / mix_pauc | AUC / pAUC computed using normal and anomalous sounds from both the source and target domains. |
| smix_auc | AUC computed using normal and anomalous sounds in the source domain and anomalous sounds in the target domain. |
| tmix_auc | AUC computed using normal and anomalous sounds in the target domain and anomalous sounds in the source domain. |
| official20-24 | Official evaluation score for DCASE 2020-2024 Challenge Task2. These are computed combining the above metrics. |
ASDKit handles various ASD methods in a unified framework.
All ASD methods consist of frontend and backend modules, where the frontend extracts some features from audio signals, and the backend computes anomaly scores after processing these features.
Recipes in jobs/asd/recipe/ define the processing flow within this framework.
Call scripts in jobs/asd/call/ serve as wrappers for these recipes, allowing easy execution with different seeds, datasets, and configurations.
In the following, we explain the ASD methods supported by ASDKit and their processing pipelines within this four-step framework.
Autoencoder
- AE-based official DCASE baseline
- Description: This method trains an AE network to reconstruct audio features of normal sounds. It computes anomaly scores based on the reconstruction error for a given observation.
- Call Script:
jobs/asd/call/ae.sh - Recipe:
jobs/asd/recipe/ae.sh- This method directly computes anomaly scores based on the reconstruction error of encountered test samples in the second step, and in the third step, the backend simply copies these anomaly scores.
- The AE is independently trained for each machine type, repeating steps 1-4 for each machine type.
# jobs/asd/recipe/ae.sh
experiments_train="ae" # config/train/experiments/ae.yaml
experiments_extract="restore/machinewise" # config/extract/experiments/restore/machinewise.yaml
experiments_score="no_backend" # config/score/experiments/no_backend.yaml
for machine in $machines; do
asdkit_train machine="${machine}" experiments="${experiments_train}"
asdkit_extract experiments="${experiments_extract}"
asdkit_score experiments="${experiments_score}"
asdkit_evaluate
doneDiscriminative Methods
| Component | Supported Options |
|---|---|
| Frontend | Dual-branch CNN, Multi-branch CNN, BEATs and EAT w/ LoRA |
| Loss Function | ArcFace, AdaCos, Sub-cluster AdaCos, AdaProj |
| Data Augmentation | Mixup, SpecAug |
| Other Techniques | FeatEx, Subspace Loss |
| Backend | kNN, kNN w/ Kmeans, kNN w/ SMOTE, kNN w/ Rescaling |
- Description: This approach trains a discriminative feature extractor to classify meta-information labels associated with normal training data, and then computes anomaly scores in the discriminative feature space.
- Call Script:
jobs/asd/call/dis_*.sh - Recipe:
jobs/asd/recipe/dis_any.sh- The discriminative methods train a common frontend using data from all machine types, and then independently train the backend for each machine type by repeating steps 2-4 for each machine type.
# jobs/asd/recipe/dis_any.sh
experiments_train="dis_*" # config/train/experiments/dis_*.yaml
experiments_extract="restore/shared" # config/extract/experiments/restore/shared.yaml
experiments_score="default" # config/score/experiments/default.yaml
asdkit_train experiments="${experiments_train}"
for machine in $machines; do
asdkit_extract experiments="${experiments_extract}"
asdkit_score experiments="${experiments_score}"
asdkit_evaluate
doneRaw Feature Methods
| Component | Supported Options |
|---|---|
| Frontend | Spectrogram, BEATs, EAT |
| Backend | kNN, kNN w/ Kmeans, kNN w/ SMOTE, kNN w/ Rescaling |
- Description: In this method, a frontend extracts raw features without training of meta-information label classification.
- Call Script:
jobs/asd/call/raw_*.sh - Recipe:
jobs/asd/recipe/raw_*.sh- This method repeats steps 2-4 for each machine type, skipping the frontend training in the first step.
# jobs/asd/recipe/raw_*.sh
experiments_extract="scratch/raw_*" # config/extract/experiments/scratch/raw_*.yaml
experiments_score="default" # config/score/experiments/default.yaml
for machine in $machines; do
asdkit_extract experiments="${experiments_extract}"
asdkit_score experiments="${experiments_score}"
asdkit_evaluate
donePseudo labels
- Description: This method generates pseudo-labels for training the discriminative feature extractor.
- Call Script:
jobs/asd/pseudo_label/example.sh
We re-evaluated various ASD methods using ASDKit on multiple datasets, conducting four independent trials for each.
The recipes shown in the figure are provided in jobs/asd/call/.
Third Party Code and Licenses
This project includes the following third-party components:
BEATs
- Source: https://github.com/microsoft/unilm/tree/master/beats
- License: MIT
- Location:
asdkit/models/pretrained_models/beats - Copyright (c) Microsoft Corporation
EAT
- Source: https://github.com/cwx-worst-one/EAT
- License: MIT
- Location:
asdkit/models/pretrained_models/eat - Copyright (c) 2024 Wenxi Chen
Takuya Fujimura, Nagoya University, Japan
E-mail: fujimura.takuya@g.sp.m.is.nagoya-u.ac.jp
Kevin Wilkinghoff, Aalborg University and Pioneer Centre for Artificial Intelligence, Denmark
@inproceedings{fujimura2025asdkit,
author = "Fujimura, Takuya and Wilkinghoff, Kevin and Imoto, Keisuke and Toda, Tomoki",
title = "{ASDKit}: A Toolkit for Comprehensive Evaluation of Anomalous Sound Detection Methods",
booktitle = "Proceedings of the 10th Workshop on Detection and Classification of Acoustic Scenes and Events (DCASE 2025)",
address = "Barcelona, Spain",
month = "October",
year = "2025",
pages = "40--44",
isbn = "978-84-09-77652-8",
doi = "10.5281/zenodo.17251589"
}



