# yucongzh/asd_benchmark architecture

> Architecture diagram of the GitHub repository yucongzh/asd_benchmark, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yucongzh/asd_benchmark
- Repository: https://github.com/yucongzh/asd_benchmark

## Overview

ASD Benchmark evaluates frozen audio representations on DCASE 2020–2025 anomalous-sound tasks, with optional lightweight adaptation. The principal workflow loads official dev/eval splits, extracts embeddings, optionally adapts them, scores anomalies against a memory bank, and reports year-aware AUC/pAUC. The graph also retains result extraction as a separate reporting capability. Relationship evidence is limited to the README and indexed source references; unsampled tester internals are not assumed beyond documented behavior.

Main entry points: [`core/dcase_tester.py`](https://github.com/yucongzh/asd_benchmark/blob/master/core/dcase_tester.py) (DCASE tester), [`evaluate_dcase.py`](https://github.com/yucongzh/asd_benchmark/blob/master/evaluate_dcase.py) (Evaluation CLI), [`core/data_loader/dcase_data_loader.py`](https://github.com/yucongzh/asd_benchmark/blob/master/core/data_loader/dcase_data_loader.py) (DCASE splits), [`core/memory_bank/dcase_memory_bank.py`](https://github.com/yucongzh/asd_benchmark/blob/master/core/memory_bank/dcase_memory_bank.py) (DCASE memory bank)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Evaluation entry"]
  node_entrypoint["Evaluation CLI<br/>[evaluate_dcase.py]"]
  node_runner["DCASE tester<br/>[dcase_tester.py]"]
  node_dataset["DCASE splits"]
  node_eval_lists["Year eval lists"]
end

subgraph group_features["Feature pipeline"]
  node_extractor_api["Extractor interface<br/>[base_extractor.py]"]
  node_example_extractors["Example extractors"]
  node_adaptation["Feature adaptation"]
end

subgraph group_scoring["Anomaly scoring"]
  node_memory_bank[("DCASE memory bank")]
  node_bank_api["Memory-bank API"]
  node_year_rules["Year scoring rules<br/>[dcase_tester.py]"]
end

subgraph group_reporting["Metrics and results"]
  node_metrics["AUC and pAUC<br/>[evaluator.py]"]
  node_result_files["Evaluation outputs<br/>[dcase_tester.py]"]
  node_result_reader["Result reader"]
  node_summary_parser["Summary parser"]
end

node_engineer(("Benchmark user"))

node_engineer -->|"runs"| node_entrypoint
node_entrypoint -->|"starts evaluation"| node_runner
node_runner -->|"loads splits"| node_dataset
node_dataset -->|"uses year lists"| node_eval_lists
node_runner -->|"extracts features"| node_extractor_api
node_example_extractors -.->|"implements"| node_extractor_api
node_runner -->|"optionally adapts"| node_adaptation
node_runner -->|"scores against"| node_memory_bank
node_memory_bank -->|"implements"| node_bank_api
node_runner -->|"applies scoring"| node_year_rules
node_runner -->|"evaluates scores"| node_metrics
node_runner -->|"writes results"| node_result_files
node_engineer -->|"runs report"| node_result_reader
node_result_reader -->|"extracts summaries"| node_summary_parser

click node_entrypoint "https://github.com/yucongzh/asd_benchmark/blob/master/evaluate_dcase.py"
click node_runner "https://github.com/yucongzh/asd_benchmark/blob/master/core/dcase_tester.py"
click node_dataset "https://github.com/yucongzh/asd_benchmark/blob/master/core/data_loader/dcase_data_loader.py"
click node_eval_lists "https://github.com/yucongzh/asd_benchmark/tree/master/supplements/eval_lists"
click node_extractor_api "https://github.com/yucongzh/asd_benchmark/blob/master/core/base_extractor.py"
click node_example_extractors "https://github.com/yucongzh/asd_benchmark/tree/master/examples"
click node_adaptation "https://github.com/yucongzh/asd_benchmark/blob/master/core/dcase_adaptation.py"
click node_memory_bank "https://github.com/yucongzh/asd_benchmark/blob/master/core/memory_bank/dcase_memory_bank.py"
click node_bank_api "https://github.com/yucongzh/asd_benchmark/blob/master/core/memory_bank/base_memory_bank.py"
click node_year_rules "https://github.com/yucongzh/asd_benchmark/blob/master/core/dcase_tester.py"
click node_metrics "https://github.com/yucongzh/asd_benchmark/blob/master/core/evaluator.py"
click node_result_files "https://github.com/yucongzh/asd_benchmark/blob/master/core/dcase_tester.py"
click node_result_reader "https://github.com/yucongzh/asd_benchmark/blob/master/result_extractor.py"
click node_summary_parser "https://github.com/yucongzh/asd_benchmark/blob/master/extract_dcase_results.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entrypoint,node_runner,node_dataset,node_eval_lists,node_engineer toneBlue
class node_extractor_api,node_example_extractors,node_adaptation toneAmber
class node_memory_bank,node_bank_api,node_year_rules toneMint
class node_metrics,node_result_files,node_result_reader,node_summary_parser toneRose
```

## Components

### Evaluation entry

- [Evaluation CLI](https://github.com/yucongzh/asd_benchmark/blob/master/evaluate_dcase.py): `evaluate_dcase.py`
- [DCASE tester](https://github.com/yucongzh/asd_benchmark/blob/master/core/dcase_tester.py): `core/dcase_tester.py`
- [DCASE splits](https://github.com/yucongzh/asd_benchmark/blob/master/core/data_loader/dcase_data_loader.py): `core/data_loader/dcase_data_loader.py`
- [Year eval lists](https://github.com/yucongzh/asd_benchmark/tree/master/supplements/eval_lists): `supplements/eval_lists`

### Feature pipeline

- [Extractor interface](https://github.com/yucongzh/asd_benchmark/blob/master/core/base_extractor.py): `core/base_extractor.py`
- [Example extractors](https://github.com/yucongzh/asd_benchmark/tree/master/examples): `examples`
- [Feature adaptation](https://github.com/yucongzh/asd_benchmark/blob/master/core/dcase_adaptation.py): `core/dcase_adaptation.py`

### Anomaly scoring

- [DCASE memory bank](https://github.com/yucongzh/asd_benchmark/blob/master/core/memory_bank/dcase_memory_bank.py): `core/memory_bank/dcase_memory_bank.py`
- [Memory-bank API](https://github.com/yucongzh/asd_benchmark/blob/master/core/memory_bank/base_memory_bank.py): `core/memory_bank/base_memory_bank.py`
- [Year scoring rules](https://github.com/yucongzh/asd_benchmark/blob/master/core/dcase_tester.py): `core/dcase_tester.py`

### Metrics and results

- [AUC and pAUC](https://github.com/yucongzh/asd_benchmark/blob/master/core/evaluator.py): `core/evaluator.py`
- [Evaluation outputs](https://github.com/yucongzh/asd_benchmark/blob/master/core/dcase_tester.py): `core/dcase_tester.py`
- [Result reader](https://github.com/yucongzh/asd_benchmark/blob/master/result_extractor.py): `result_extractor.py`
- [Summary parser](https://github.com/yucongzh/asd_benchmark/blob/master/extract_dcase_results.py): `extract_dcase_results.py`

### Other components

- **Benchmark user**

## Connections

- Benchmark user → Evaluation CLI: runs (evidence: `README.md`)
- Evaluation CLI → DCASE tester: starts evaluation (evidence: `evaluate_dcase.py`)
- DCASE tester → DCASE splits: loads splits (evidence: `core/dcase_tester.py`)
- DCASE splits → Year eval lists: uses year lists (evidence: `README.md`)
- DCASE tester → Extractor interface: extracts features (evidence: `README.md`)
- Example extractors → Extractor interface: implements
- DCASE tester → Feature adaptation: optionally adapts (evidence: `README.md`)
- DCASE tester → DCASE memory bank: scores against (evidence: `README.md`)
- DCASE memory bank → Memory-bank API: implements (evidence: `core/memory_bank/dcase_memory_bank.py`)
- DCASE tester → Year scoring rules: applies scoring (evidence: `README.md`)
- DCASE tester → AUC and pAUC: evaluates scores (evidence: `core/dcase_tester.py`)
- DCASE tester → Evaluation outputs: writes results (evidence: `README.md`)
- Benchmark user → Result reader: runs report (evidence: `README.md`)
- Result reader → Summary parser: extracts summaries (evidence: `result_extractor.py`)
