Anomalous Sound Detection Using Self-Attention-Based Frequency Pattern Analysis of Machine Sounds

Hejing Zhang, Jian Guan, Qiaoxi Zhu, Feiyang Xiao, Youde Liu

Introduction

In industrial environments, Anomalous Sound Detection (ASD) is a cornerstone of predictive maintenance. Detecting machine failure early can prevent catastrophic downtime. However, ASD is inherently challenging because anomalies are rare, meaning models must typically be trained in an unsupervised or self-supervised manner using only "normal" operational sounds.

A significant hurdle in current ASD research is the diversity of acoustic signatures across different machinery, such as fans, pumps, and valves. Traditional state-of-the-art methods often require manual frequency filtering—essentially a "human-in-the-loop" process where experts identify critical frequency bands for each machine type. This paper introduces ASD-AFPA, a method that automates this process using a self-attention mechanism to adaptively identify and weight the most informative frequency components.

System Architecture and Methodology

The proposed ASD-AFPA system builds upon the STgram-MFN backbone, which integrates both spectral and temporal information. The architecture processes machine sounds through two parallel paths: a Temporal Feature Extractor (TgramNet) and a Log-Mel Convertor.

The ASD-AFPA architecture featuring the Self-Attention-Based Frequency Pattern Analysis module.

The core innovation lies within the Self-Attention-Based Frequency Pattern Analysis (AFPA) module. Instead of applying static filters, the system passes Log-Mel spectrograms through a Multi-Head Self-Attention (MHSA) mechanism. This module treats frequency bins as a sequence, calculating "frequency pattern weight matrices" that act as learned, adaptive filters. These weights highlight the spectral components most relevant to identifying a specific machine's identity and state. A residual connection ensures that global spectral information is preserved while the attention mechanism "squints" at the most critical bands.

The resulting fused features are then classified using a MobileFaceNet (MFN) classifier trained with ArcFace loss. This self-supervised task—predicting the specific ID of a machine individual—forces the model to learn highly discriminative features of normal operation.

Visualizing the "Expert Ear"

One of the most compelling aspects of the AFPA module is its interpretability. By visualizing the learned frequency patterns, researchers can observe the model focusing on specific spectral regions that characterize different machine states.

Visualization of (a) Log-Mel Spectrograms, (b) Learnt Frequency Patterns, and (c) resulting Audio Features for normal and anomalous fan sounds.

As shown in the visualizations, the model learns to highlight high-frequency components for fans, effectively replicating the manual filtering strategies previously employed by acoustic engineers. This automation allows the system to scale across diverse machinery without requiring manual expert intervention for every new machine type.

Experimental Results

The ASD-AFPA method was rigorously evaluated using the DCASE 2020 Challenge Task 2 dataset, which includes sounds from fans, pumps, sliders, valves, ToyCars, and ToyConveyors.

The system achieved state-of-the-art performance, with an average AUC of 93.91% and a pAUC of 87.95%. This represents a significant improvement over the baseline STgram-MFN (a 1.55% increase in AUC). The gains were particularly pronounced in categories like "Fan" and "ToyCar," where distinct frequency patterns are prevalent. While the "Valve" category saw no improvement, this was attributed to the backbone already achieving near-perfect results (99.64% AUC).

Conclusion and Future Work

By replacing manual frequency engineering with an automated self-attention mechanism, ASD-AFPA provides a scalable and high-performing solution for industrial sound monitoring. The model successfully "learns" the acoustic signatures of healthy machinery, providing a robust baseline for anomaly detection.

Future research will focus on extending this adaptive spectral analysis to handle domain shift—scenarios where environmental noise or machine loads change between training and deployment. Integrating AFPA with domain-generalization techniques will be a key step toward real-world industrial implementation.

Summary updated

BibTeX
@inproceedings{zhang2023anomalous,
  author = {Hejing Zhang and Jian Guan and Qiaoxi Zhu and Feiyang Xiao and Youde Liu},
  title = {{Anomalous Sound Detection Using Self-Attention-Based Frequency Pattern Analysis of Machine Sounds}},
  booktitle = {Interspeech},
  year = {2023},
  doi = {10.21437/interspeech.2023-2416},
}
Figure