Skip to content

speech_architecture.mmd

Speech Commands architecture diagram - 59 lines. View on GitHub (speech/speech_architecture.mmd).

Rendering diagram…

graph TD
    INPUT["Speech Command Input<br/><i>N × 1s Waveform (16kHz)</i>"]

    subgraph PP["Preprocessing"]
        direction LR
        DS["Downsample<br/>16kHz → 8kHz"]
        TG["TorchGate<br/>Spectral Denoising"]
        PRE["Preemphasis<br/>α = 0.97"]
        DS --> TG --> PRE
    end

    subgraph FE["Feature Extraction"]
        direction LR
        MEL["Mel Spectrogram<br/>n_fft=1024, hop=80<br/><i>80 bands × ~101 frames</i>"]
        MFCC["MFCC<br/><i>80 coefficients × ~101 frames</i>"]
        CAT["Concatenate<br/><i>160 × ~101</i>"]
        DY["DyNED<br/>256 levels"]
        MEL --> CAT
        MFCC --> CAT
        CAT --> DY
    end

    subgraph SL["cAdLIF Spiking Layers"]
        direction LR
        S1["Linear + LN + Delay<br/>cAdLIF + Drop 0.1<br/><i>160 → 2048</i><br/>Surrogate: ATan"]
        S2["Linear + LN + Delay<br/>cAdLIF + Drop 0.1<br/><i>2048 → 1024</i><br/>Surrogate: ATan"]
        S3["Linear + LN + Delay<br/>cAdLIF + Drop 0.1<br/><i>1024 → 512</i><br/>Surrogate: ATan"]
        S4["Readout LIF<br/>Softmax Accumulation<br/><i>512 → 35</i>"]
        S1 --> S2 --> S3 --> S4
    end

    TS["~101 Time Steps per Input<br/><i>One Mel/MFCC frame = one SNN timestep</i>"]

    SC["Softmax Vote<br/><i>Accumulated over ~101 steps</i>"]
    CLASS["35 Speech Commands"]

    INPUT --> PP
    PP --> FE
    FE --> SL
    TS -.- SL
    SL --> SC
    SC --> CLASS

    classDef inputStyle fill:#27AE60,stroke:#1E8449,color:white,font-weight:bold,font-size:20px
    classDef prepStyle fill:#2C3E50,stroke:#1B2631,color:white,font-weight:bold,font-size:20px
    classDef freqStyle fill:#3498DB,stroke:#2471A3,color:white,font-weight:bold,font-size:20px
    classDef dynedStyle fill:#E67E22,stroke:#CA6F1E,color:white,font-weight:bold,font-size:20px
    classDef snnStyle fill:#C0392B,stroke:#922B21,color:white,font-weight:bold,font-size:20px
    classDef classStyle fill:#2C3E50,stroke:#1B2631,color:white,font-weight:bold,font-size:20px
    classDef noteStyle fill:#F5F5F5,stroke:#999,color:#333,font-style:italic,font-size:20px

    class INPUT inputStyle
    class DS,TG,PRE prepStyle
    class MEL,MFCC,CAT freqStyle
    class DY dynedStyle
    class S1,S2,S3,S4 snnStyle
    class SC,CLASS classStyle
    class TS noteStyle