# microsoft/dns-challenge architecture

> Architecture diagram of the GitHub repository microsoft/dns-challenge, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/microsoft/dns-challenge
- Repository: https://github.com/microsoft/dns-challenge

## Overview

##### Project Type and Purpose
- This is a data-processing and evaluation pipeline for the ICASSP 2023 Deep Noise Suppression (DNS) Challenge.
- It automates:
- Downloading raw speech, noise, and RIR datasets
- Synthesizing noisy/clean speech pairs for training
- Evaluating enhancement models via DNSMOS metrics and Word Accuracy (WAcc)

A. Data Acquisition
1. Download scripts (bash files `download-dns-challenge-5-*.sh`)
2. Destination folder `datasets_fullband/` (data store)
B. Data Synthesis
1. Configuration file (`noisyspeech_synthesizer.cfg`)
2. Synthesizer script (`noisyspeech_synthesizer_singleprocess.py` or `pdns_noisyspeech_synthesizer_singleprocess.py`)
3. Support modules (`audiolib.py`, `utils.py`)
4. Unit tests (`unit_tests_synthesizer.py`)
C. Evaluation
1. DNSMOS models (/DNSMOS folder with ONNX files)
2. pDNSMOS (personalized DNSMOS)
3. WAcc script (`WAcc/WAcc.py`)
4. External services: SpeechBrain speaker-embedding model, torchaudio

##### Architectural Patterns and Principles
- Linear pipeline: Acquisition → Synthesis → Validation → Evaluation
- Clear separation of concerns: each stage is a standalone script/module
- Config-driven: behavior of synthesizer is controlled by `*.cfg` file

##### Technologies and Frameworks
- Python 3.6+
- Audio I/O: soundfile, librosa, torchaudio
- Model inference: ONNX runtime (for DNSMOS)
- Speaker embeddings: SpeechBrain (`speechbrain/spkrec-ecapa-voxceleb`)
- Unit testing: standard Python unittest

##### Step-by-Step Flowchart Outline
[Download Scripts]
↓
[datasets_fullband/ (raw speech, noise, RIR)]
↓
[noisyspeech_synthesizer_singleprocess.py (uses cfg, audiolib, utils)]
↓
[Noisy/Clean Pairs Output Folder]
↙           ↘
[unit_tests_synthesizer.py]   [DNSMOS ONNX Models]
↘           ↙
[Validation OK]          [Quality Scores (SIG, BAK, OVRL)]
↓
[WAcc/WAcc.py] → Word Accuracy

## Diagram (Mermaid)

```mermaid
flowchart TD
    download["Download Scripts"]:::process
    datasets[(datasets_fullband/)]:::datastore
    synth["Synthesizer Script"]:::process
    output[(Noisy/Clean Output)]:::datastore
    tests["unit_tests_synthesizer.py"]:::process
    dnsmos["DNSMOS ONNX Models"]:::eval
    quality["Quality Scores (SIG,BAK,OVRL)"]:::eval
    wacc["WAcc/WAcc.py"]:::eval
    accuracy(("Word Accuracy Score")):::eval

    download -->|"raw audio files"| datasets
    datasets -->|"cfg + raw data"| synth
    synth -->|"synthesized pairs"| output
    output -->|"test data"| tests
    tests -->|"validation ok"| wacc
    output -->|"enhanced audio"| dnsmos
    dnsmos -->|"SIG,BAK,OVRL"| quality
    quality -->|"scores fed"| wacc
    wacc -->|"compute"| accuracy

    click download "https://github.com/microsoft/dns-challenge/blob/master//download-dns-challenge-*.sh"
    click datasets "https://github.com/microsoft/dns-challenge/tree/master//datasets_fullband/"
    click synth "https://github.com/microsoft/dns-challenge/blob/master//noisyspeech_synthesizer_singleprocess.py"
    click tests "https://github.com/microsoft/dns-challenge/blob/master//unit_tests_synthesizer.py"
    click dnsmos "https://github.com/microsoft/dns-challenge/blob/master//DNSMOS/DNSMOS/*.onnx"
    click wacc "https://github.com/microsoft/dns-challenge/blob/master//WAcc/WAcc.py"

    classDef datastore fill:#bbdefb,stroke:#1e88e5,color:#0d47a1;
    classDef process fill:#c8e6c9,stroke:#43a047,color:#1b5e20;
    classDef eval fill:#ffe0b2,stroke:#fb8c00,color:#e65100;
```
