Unsupervised Anomaly Detection and Localization of Machine Audio: A GAN-based Approach

Anbai Jiang, Wei-Qiang Zhang, Yufeng Deng, Pingyi Fan, Jia Liu

Abstract

Machine audio anomaly detection is critical for industrial maintenance but faces challenges due to high-dimensional data, the tendency of autoencoders to over-generalize, and significant domain shifts. We present AEGAN-AD, an unsupervised framework that leverages a Generative Adversarial Network (GAN) to provide feature-level guidance to an autoencoder. By incorporating adversarial training, feature matching loss, and layer normalization, AEGAN-AD achieves state-of-the-art performance on the DCASE 2022 Challenge dataset and enables precise anomaly localization.

Introduction

Detecting machine failures via audio is a challenging unsupervised learning task, as industrial environments typically lack labeled anomalous data. Traditional approaches often rely on autoencoders (AEs) to learn a compressed representation of "normal" audio, assuming that anomalies will result in high reconstruction errors. However, these models frequently fall into a "denoising trap," where they learn to reconstruct anomalous impulses too effectively, rendering them undetectable. Furthermore, domain shifts—variations in operating conditions—can lead to false positives when a model trained on one condition flags a healthy machine in another.

Methodology

The AEGAN-AD framework addresses these issues by integrating an autoencoder as the Generator ($G$) within a GAN architecture. The generator is paired with a Discriminator ($D$) that is trained to distinguish between real spectrograms and those reconstructed by the generator.

The AEGAN-AD architecture, featuring a Generator (Autoencoder) and a Discriminator that provides feature-level guidance.

Key components of the framework include:

  • Adversarial Guidance: The discriminator forces the generator to capture the underlying semantic distribution of normal audio rather than just focusing on superficial noise.
  • Feature Matching Loss: Instead of relying solely on Mean Squared Error (MSE), the generator aims to match internal feature statistics within the discriminator, ensuring semantic consistency.
  • Layer Normalization (LN): By normalizing within individual samples rather than across a batch, LN makes the model more robust to domain shifts by preserving unique sample-specific features.
  • Dual-Perspective Detection: Anomaly scores are calculated from two sources: the reconstruction error from the generator and the distance between embeddings extracted from the discriminator.

Experimental Results

The model was evaluated on the DCASE 2022 Challenge Task 2 dataset, which includes five machine types (Bearings, Fans, Gearboxes, Sliders, and ToyCars) and significant domain shifts. AEGAN-AD demonstrated a 3.84% overall improvement in AUC/pAUC over seven baseline systems. Notably, it achieved a 10.91% performance jump for bearings and a 3.46% improvement for fans. The ensemble version of the model ranked 4th in the DCASE 2022 evaluation set.

Discussion and Insights

A critical insight of this work is that reconstruction error alone is insufficient for robust detection. Standard AEs can sometimes reconstruct anomalous "abrupt impulses" with low error, effectively "denoising" the anomaly out of existence.

Comparison of reconstruction results: (a) shows successful anomaly detection via high error, while (b) illustrates the 'denoising trap' where an AE reconstructs an anomalous impulse too well.

By using the discriminator as a semantic feature extractor, AEGAN-AD avoids this trap. Additionally, the framework enables anomaly localization by comparing query spectrograms against the mean representation of training data, pinpointing anomalies in both time and frequency.

Conclusion

AEGAN-AD provides a robust, unsupervised solution for machine audio monitoring by moving beyond simple reconstruction error to utilize semantic embeddings. While highly effective across most machine types, future work will focus on further bridging domain gaps and refining localization for automated diagnostics.

Summary updated

BibTeX
@inproceedings{jiang2023unsupervised,
  author = {Anbai Jiang and Wei-Qiang Zhang and Yufeng Deng and Pingyi Fan and Jia Liu},
  title = {{Unsupervised Anomaly Detection and Localization of Machine Audio: A GAN-based Approach}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2023},
  doi = {10.1109/icassp49357.2023.10096813},
}
Figure