---
title: 'SSDPT: Transformer & DSTBC Systems'
url: https://www.emergentmind.com/topics/ssdpt
type: topic
---

# SSDPT: Transformer & DSTBC Systems

SSDPT refers to two distinct topics in the scientific literature: (1) the Self-Supervised Dual-Path Transformer for anomalous sound detection in machine condition monitoring [2208.03421], and (2) Single-Symbol ML Decodable Distributed Space-Time Block Codes for partially-coherent cooperative networks (“SSD DSTBCs” in [0708.3019]). This entry addresses both, given their prominent association with the acronym “SSDPT.”

## 1. Self-Supervised Dual-Path Transformer (SSDPT) for Anomalous Sound Detection

SSDPT is a machine learning architecture for unsupervised anomaly detection in industrial machine audio, focusing on scenarios where only normal-operation sound is available for training. The framework combines dual-path Transformer modeling of time and frequency dependencies with self-supervised learning objectives, achieving state-of-the-art performance under domain shift conditions [2208.03421].

### Key Principles

SSDPT is predicated on two innovations:

- **Dual-Path Transformer (DPT):** Stacks Transformer encoders that alternately aggregate temporal and spectral (frequency) relations within short spectrogram segments.
- **Self-supervised learning:** Uses only normal recordings, with random masking and reconstruction as an auxiliary task, and machine-ID classification as the primary task.

This architecture supports training in environments where anomaly instances are rare or unavailable.

## 2. Acoustic Feature Extraction and Segmentation

- **Input:** Audio at 16 kHz.
- **Transformation:** Short-Time Fourier Transform (STFT, 1024 window, 512 hop), then mapped to 128 Mel bins, followed by $\log$ scaling to produce $W \in \mathbb{R}^{T \times F}$, $F=128$.
- **Segmentation:** $W$ is divided into overlapping $P \times F$ patches $X_t$, segment length $P \in \{64, 128, 256\}$, training hop $H=8$, testing hop $H=1$.
- **Assignment:** Each segment inherits machine-ID label $\ell \in \{1, \dotsc, I\}$.

Segmentation enables the DPT to model both local and contextual structure in the acoustic data.

## 3. Dual-Path Transformer Block Architecture

- **Composition:** Each DPT block processes segment $X_t$ via two sequential Transformer encoders:
    - **Time Encoder $\mathcal{E}_s$:** Processes $P$-length sequence of $F$-dimensional vectors.
    - **Frequency Encoder $\mathcal{E}_f$:** After transposing, processes $F$-length sequences of $P$-dimensional vectors; result is transposed back.

- **Transformer mechanics (per encoder, input $Y \in \mathbb{R}^{L \times d}$):**
    1. **Multi-Head Scaled Dot-Product Attention (MHSA):** For head $h$, queries, keys, and values are projected and computed as:
        \[
        \text{Attention}^h(Q^h, K^h, V^h) = \operatorname{softmax}\left(\frac{Q^h {K^h}^\top}{\sqrt{d_k}}\right) V^h
        \]
    2. **Residual and LayerNorm:** $X_{\text{Mid}} = \operatorname{LayerNorm}(Y + X_{\text{MHSA}})$.
    3. **Feed-Forward Network (FFN):** $FFN(X_{\text{Mid}}) = \operatorname{ReLU}(X_{\text{Mid}} W_1 + b_1) W_2 + b_2$.
    4. **Second Residual and LayerNorm:** $X_{\text{O}} = \operatorname{LayerNorm}(X_{\text{Mid}} + FFN(X_{\text{Mid}}))$.

- **Stacking:** $M$ DPT blocks are stacked, alternating between time and frequency encoding.

This cascading interaction allows for interleaved modeling of temporal and spectral dependencies, both crucial for anomalous sound discrimination.

## 4. Self-Supervised Training Objectives

SSDPT employs two concurrent self-supervised tasks on normal sound segments $X_t$:

- **4.1. Random Masking & Reconstruction:** Applies $K$ square patch masks (e.g., $K=3$, $5 \times 5$) to $X_t$ yielding $\tilde X_t$, with DPT reconstructing $\hat X_t$. The mean squared error (MSE) reconstruction loss:
    \[
    \mathcal{L}_{\text{rec}} = \| X_t - \hat X_t \|_2^2
    \]
- **4.2. Machine-ID Classification:** After final DPT block, max-pool over $P$ to obtain $v_t \in \mathbb{R}^d$; softmax classifier outputs machine-ID predictions $z_t$. Cross-entropy loss:
    \[
    \mathcal{L}_{\text{cls}} = -\sum_{i=1}^I y_i \log z_{t,i}
    \]
- **4.3. Joint Loss:** For $N$ segments:
    \[
    \mathcal{L} = \frac{1}{N} \sum_{t=1}^N \left(\mathcal{L}_{\text{cls}} + \lambda_{\text{rec}} \mathcal{L}_{\text{rec}}\right)
    \]
    with $\lambda_{\text{rec}}=0.001$.

The auxiliary reconstruction task complements the classification, improving generalization under domain shift [2208.03421].

## 5. Evaluation Protocol and Performance

- **Dataset:** DCASE2021 Task 2 (seven machine types, two domains, three sections). Training: 1000 source-domain normal, 3 target normal; Testing: 100 normals + 100 anomalous per domain/section.
- **Anomaly Scoring:** Each test clip is segmented. For each segment, compute:
    - **Classification score:**
        \[
        \mathcal{A}_c = \frac{1}{B} \sum_{t=1}^B \log\frac{1 - p(z'_t)}{p(z'_t)}
        \]
        where $p(z'_t)$ is softmax probability for correct machine-ID.
    - **Reconstruction score:**
        \[
        \mathcal{A}_r = \frac{1}{B} \sum_{t=1}^B \|X'_t - \hat X'_t\|_2^2
        \]
    - **Final anomaly score:**
        \[
        \mathcal{A} = \mathcal{A}_c + \beta \mathcal{A}_r
        \]
        with $\beta=0.001$.
- **Metrics:**
    - Area under ROC curve (AUC)
    - Partial AUC at FPR $=0.1$ (pAUC)
    - Harmonic mean AUC/pAUC (h-AUC, h-pAUC) per machine type.

| Method                | h-AUC | h-pAUC |
|-----------------------|-------|--------|
| Baseline AE           | 0.619 | 0.533  |
| Baseline MobileNetV2  | 0.597 | 0.564  |
| MNv2 + LOF            | 0.694 | 0.616  |
| WaveNet-ensemble      | 0.705 | 0.625  |
| SSDPT (no auxiliary)  | 0.713 | 0.607  |
| SSDPT (full)          | 0.722 | 0.611  |
| SSDPT-ensemble        | 0.739 | 0.626  |

The DPT model alone outperforms prior methods. The auxiliary task brings a further $+0.009$ h-AUC, and ensembling pushes h-AUC to $0.739$, an increase of $\sim 3.4$ points over the previous state-of-the-art [2208.03421].

## 6. Connections: Distributed STBCs and SSD Property

The acronym SSDPT can also refer to **Single-Symbol ML Decodable Distributed Space-Time Block Codes** (DSTBCs) for partially-coherent relay networks [0708.3019]. Here, the “SSD” property ensures each real channel symbol is decodable independently with maximum-likelihood complexity $O(T_1)$ rather than exponential in $T_1$.

- **Classical SSD conditions (co-located):** Decoupling (block diagonal) conditions on code matrices $A_j$ over $N$ transmit antennas, ensuring the equivalent Gramian is block-diagonal.
- **Distributed extension (PCRC):** In cooperative amplify-and-forward with partially-coherent relays (backward phase CSI only), additional “three-relay” block-diagonal constraints ensure that both signal and noise covariances decouple, preserving single-symbol ML decodability.
- **Code constructions:** Alamouti $(N=2)$, coordinate-interleaved ODs $(N=4)$, and stacked ROD-based complex ODs (rate $1/2$, any $N$) meet the necessary and sufficient conditions for SSD in the distributed partially-coherent setting.

This alternative use of SSDPT highlights its relevance for signal processing in communication systems, independent of anomaly detection.

## 7. Practical Considerations and Design Trade-offs

For anomalous sound detection [2208.03421]:

- **Hyperparameters:** $M=3$ DPT blocks, $P=64/128$, $H=8 (1)$ for train (test), embedding $d=P/F$, $8$ MHSA heads, FFN $d_{ff}=32$.
- **Optimization:** AdamW with $10^{-4}$ initial learning rate.
- **Masking:** $K=3$ patches of $5 \times 5$ for the self-supervised task.

For distributed STBCs in PCRC [0708.3019]:

- **Optimal SSD-ML:** Satisfy both co-located and three-relay constraints; phase compensation at relays raises rate from $2/N$ to $1/2$.
- **Coding gain:** Sub-optimal SSD (neglecting noise covariance) retains full diversity but loses $1$–$3$ dB in coding gain.
- **Design guidelines:** Choose codes satisfying all algebraic decoupling constraints; verify additional PCRC constraints for best performance.

In both contexts, the unifying theme is the exploitation of algebraic structures (Transformer or code orthogonality) and self-supervision (masking or phase compensation) to provide efficient, robust modeling and inference.

Source: https://www.emergentmind.com/topics/ssdpt