Transformer-based autoencoder with ID constraint for unsupervised anomalous sound detection

Jian Guan, Youde Liu, Qiuqiang Kong, Feiyang Xiao, Qiaoxi Zhu, Jiantong Tian, Wenwu Wang

Introduction

Anomalous Sound Detection (ASD) serves as a critical "smoke detector" for industrial environments, monitoring machinery such as fans, pumps, and valves to identify potential failures. In real-world factory settings, obtaining recordings of "broken" sounds for training is often impossible, necessitating an unsupervised learning approach where models are trained exclusively on "normal" operational data.

Challenges in Anomalous Sound Detection

Traditional ASD systems primarily utilize Autoencoders (AEs) to learn the compression and reconstruction of normal sounds. Anomaly detection is then based on the reconstruction error: a high error indicates a sound the model has not encountered before. However, two significant hurdles persist:

  1. Generalization Gap: AEs can become overly flexible, learning to reconstruct anomalous sounds as effectively as normal ones, thereby failing to trigger an alert.
  2. Non-Stationary and Short-Lived Sounds: Rapidly changing sounds, such as those from valves, are often averaged out by standard scoring systems, leading to missed detections of brief but critical anomalies.

Proposed Methodology: IDC-TransAE

To address these limitations, this research introduces the ID-constrained Transformer-based autoencoder (IDC-TransAE). This architecture incorporates several innovations designed to tighten the model's definition of "normal" and improve sensitivity to temporal variations.

Center Frame Prediction (CFP)

Unlike standard autoencoders that attempt to reconstruct an entire window of audio, the IDC-TransAE employs Center Frame Prediction. By masking the middle frame of an input sequence and tasking the model with its prediction based on surrounding context, the system becomes more adept at handling non-stationary sounds.

The Center Frame Prediction (CFP) mechanism masks the central frame of the input to force the model to learn contextual dependencies.

System Architecture and ID Constraints

The core of the IDC-TransAE is a Transformer backbone, which captures long-term temporal dependencies more effectively than traditional dense layers. A key innovation is the ID Constraint (IDC): a classifier integrated into the latent space bottleneck. This forces the model to distinguish between specific machine IDs (e.g., different individual pumps), preventing the latent space from becoming too generic and ensuring that anomalies cannot easily "hide" within the distribution.

The complete IDC-TransAE architecture, integrating Transformer blocks, Linear Phase Embeddings, and an ID Classifier to constrain the latent space.

Furthermore, the model utilizes Linear Phase Embedding (LPE), replacing standard positional encodings with embeddings derived from the actual phase of the audio signal. For scoring, the authors implement Global Weighted Ranking Pooling (GWRP), which weights the most suspicious segments of a recording more heavily, preventing short-lived anomalies from being obscured by averaging.

Experimental Results

The IDC-TransAE was evaluated using the DCASE 2020 Challenge Task 2 dataset, which includes real-world sounds from the MIMII and ToyADMOS datasets. The proposed method demonstrated significant performance gains over standard benchmarks:

  • Average AUC: The model achieved an average Area Under the Curve (AUC) of 88.12%, a substantial improvement over the DCASE baseline of 73.10%.
  • Valve Performance: In the notoriously difficult category of valves, the method reached a partial AUC (pAUC) of 98.29%, compared to the baseline's 51.67%.
  • Consistency: The model maintained high stability across different machine IDs, achieving the highest minimum AUC (mAUC) in the study.

Conclusion

The IDC-TransAE represents a significant advancement in unsupervised anomalous sound detection. By constraining the latent space with machine ID labels and utilizing phase-aware Transformer architectures, the model effectively bridges the generalization gap and improves detection for complex, non-stationary industrial noises. Future work will focus on addressing domain shifts and validating the model on more recent, diverse datasets.

Summary updated

BibTeX
@article{guan2023transformer,
  author = {Jian Guan and Youde Liu and Qiuqiang Kong and Feiyang Xiao and Qiaoxi Zhu and Jiantong Tian and Wenwu Wang},
  title = {{Transformer-based autoencoder with ID constraint for unsupervised anomalous sound detection}},
  journal = {EURASIP J. Audio Speech Music. Process.},
  year = {2023},
  doi = {10.1186/s13636-023-00308-4},
}
Figure