A noise robust machine abnormal sound detection method based on multi-task convolutional autoencoder
By combining multi-task convolutional autoencoders with reconstruction learning, self-supervised classification, and noise-perception contrastive learning, the problem of unstable detection performance of abnormal machine sounds in high-noise environments is solved, achieving stable and efficient detection under complex background noise.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XI'AN UNIVERSITY OF ARCHITECTURE AND TECHNOLOGY
- Filing Date
- 2026-03-11
- Publication Date
- 2026-06-09
AI Technical Summary
Existing methods for detecting abnormal machine sounds struggle to effectively distinguish machine sound characteristics from noise in high-noise environments, leading to unstable detection performance. In particular, when equipment fault samples are scarce, existing methods are difficult to apply in real-world industrial environments.
We employ a multi-task convolutional autoencoder that combines reconstruction learning, self-supervised classification, and noise-aware contrastive learning. By constructing positive and negative sample pairs, we explicitly promote noise-invariant representations, thereby improving detection performance and robustness.
It significantly improves the stability and accuracy of abnormal machine sound detection in high-noise environments, effectively distinguishes machine sound from noise, and enhances the robustness and generalization ability of detection.
Smart Images

Figure CN122177160A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of abnormal machine sound detection technology, and specifically to a noise-robust abnormal machine sound detection method based on a multi-task convolutional autoencoder. Background Technology
[0002] Machine abnormal sound detection is a key technology for predictive maintenance of industrial equipment. It provides early warnings of potential faults by analyzing changes in sound signal characteristics, which is crucial for ensuring production safety and efficiency. However, in real-world industrial scenarios, equipment failures are low-probability events, and abnormal sound samples are extremely scarce, limiting the application of supervised learning methods that rely on large amounts of labeled data. Therefore, current research focuses on semi-supervised paradigms: training models using only normal sound samples to learn the feature distribution representing the "normal state"; during the testing phase, any sound sample that significantly deviates from this distribution is judged as abnormal. This paradigm avoids dependence on abnormal samples, better aligns with actual industrial needs, and is the mainstream technical path for current machine abnormal sound detection systems. One of the challenges faced by machine abnormal sound detection in real-world industrial environments is severe noise interference. Weak abnormal sound features are easily masked by high-intensity, complex background noise, resulting in extremely low signal-to-noise ratios. Furthermore, the non-stationary fluctuations in background noise can cause domain shift problems, further increasing the difficulty of the detection task.
[0003] Currently, semi-supervised machine learning methods for abnormal sound detection are mainly divided into two categories: autoencoder methods based on reconstruction loss and self-supervised classification methods. Autoencoder methods only utilize normal sound samples and use reconstruction loss to train the model, enabling it to accurately reconstruct normal sound samples. When abnormal sounds are input, the reconstruction error increases significantly because their features deviate from the normal data distribution learned by the model. Anomaly detection can be achieved by setting a threshold.
[0004] In existing methods, autoencoder methods based on reconstruction loss, represented by the literature "Anomalous sound detection based on interpolation deep neural network" and Chinese patent "CN117133315A," essentially learn the ability to reconstruct normal data, rather than the ability to reject anomalous data. If the local features of an anomalous sound are similar to normal patterns in the training set, the autoencoder may use known normal segments for "piecemeal" reconstruction, resulting in small reconstruction errors even for anomalous samples, leading to missed detections. Furthermore, although autoencoder methods based on reconstruction loss perform well under clean conditions, they often struggle to effectively separate discriminative machine sound features from irrelevant noise, thus being sensitive to noise and limiting their generalization ability.
[0005] Self-supervised classification methods, such as STgram-MFN and CLP-SCF, construct discriminative feature spaces through auxiliary classification tasks, often achieving detection performance superior to autoencoders. However, their performance heavily relies on the representativeness of noise distribution in the training data. If noise characteristics differ across devices or operating conditions, the model may misclassify noise differences as discriminative features, leading to instability in noise environments. Furthermore, these methods lack explicit mechanisms to mitigate the adverse effects of environmental noise, thus limiting their application in high-noise environments. Summary of the Invention
[0006] To overcome the above technical problems, the present invention aims to provide a noise-robust machine abnormal sound detection method based on a multi-task convolutional autoencoder. This method achieves a balance between feature reconstruction capability and discriminative capability in a unified framework by collaboratively integrating reconstruction learning, self-supervised classification task and noise perception contrastive learning. Furthermore, it utilizes auxiliary clean machine sound samples and pure noise samples to construct positive and negative sample pairs, explicitly promoting the learning of noise-invariant representations, thereby improving detection performance and robustness in strong noise environments.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A noise-robust machine abnormal sound detection method based on a multi-task convolutional autoencoder includes the following steps; Step 1: Construct a training dataset for detecting abnormal machine sounds; Noisy machine sound samples with attribute labels under normal working conditions, clean normal machine sound samples collected when the factory is idle, and pure background noise samples collected when the machine is not running are selected as the dataset, and this dataset is used as the original audio signal. Step 2: Time-frequency feature extraction of audio data: The original audio signal is segmented into fixed lengths, a low-frequency cutoff frequency is set, and the log-Mel spectrum features within this frequency band are extracted as input features. Step 3: Multi-task autoencoder training: A convolutional autoencoder neural network model is established. Normal noisy machine sound samples, as well as auxiliary clean normal machine sound samples and pure background noise samples are used. The model is trained by fusing reconstruction loss, machine attribute classification loss and contrast loss. The output of the encoder is regarded as the embedded representation vector of the input sound signal for subsequent anomaly detection. Step 4: Anomaly Detector Training and Anomaly Detection: The convolutional autoencoder neural network model trained in step 3 is used to extract the embedded representation vectors and reconstruction loss of all normal samples in the training set and concatenate them to form a normal sample feature library. Then, an anomaly detector is trained based on the k-nearest neighbor algorithm. The anomaly score of the test sound sample is defined as the average distance from its feature vector to its K nearest neighbors, thereby realizing machine abnormal sound detection.
[0008] In step 2, when extracting audio features, a low-frequency cutoff frequency related to the machine type is set according to the spectral distribution characteristics of different types of machine sounds and noise, so as to filter out low-frequency noise and retain the core frequency band of the machine sound. The original long audio signal is segmented into fixed lengths, and the log-Mel spectrum features of each audio segment are extracted; the dataset of this invention contains long audio signals from various machine types; The process of extracting log-Mel spectrum features includes: converting the original long audio signal into a two-dimensional time spectrum using short-time Fourier transform; constructing a Mel triangular filter bank based on the low-frequency cutoff frequency to map the frequency dimension from a linear scale to a Mel scale; and finally converting the amplitude to a decibel scale to obtain the log-Mel spectrum features. Record No. i The log-Mel spectrum characteristics of each audio segment are as follows: ,in Indicates the frequency domain dimension, representing the number of Mel filters; Indicates the time domain dimension, which is the number of time domain frames.
[0009] Step 3 specifically involves: Step 3.1: Construct a CAE-SSL-CL model for detecting abnormal machine sounds; Step 3.2: Using the logarithmic Mel spectrum features of the sound signal as the model input, construct the reconstruction error loss function between the input and output; Step 3.3: Construct a self-supervised classification loss function using machine attribute categories as classification labels; Step 3.4: Construct positive and negative sample pairs using machine attribute labels and clean and pure noise samples, and calculate the noise-perceived contrastive learning loss function; Step 3.5: Train the model by fusing reconstruction loss, classification loss, and contrastive loss. The combined loss function is defined as: in and To balance the weights of the various tasks, and given that classification and contrastive learning converge faster than reconstruction, a two-stage training process is adopted: the first stage uses only the reconstruction loss. A pre-trained convolutional autoencoder model is used, and the total loss is used in the second stage to train the complete model.
[0010] The CAE-SSL-CL model includes a convolutional autoencoder and a linear classification layer. The autoencoder layer includes an encoder and a decoder. The encoder compresses the input two-dimensional temporal spectrogram step by step through four convolutional blocks, and finally obtains a 128-dimensional embedding feature vector through average pooling. The decoder then upsamples the embedding vector step by step through a symmetrical four-layer structure to reconstruct a spectrogram with the same size as the input. The normal sound pattern is learned by calculating the reconstruction error.
[0011] Step 3.2 specifically involves: Step 3.2.1: Analyze the log-Mel spectrum features Input a convolutional autoencoder model, and obtain the latent representation through the encoder. The reconstructed output is then obtained through a decoder. Its input-output relationship is expressed as: in Indicates encoder module, , Indicates the channel, frequency domain, and time domain dimensions respectively. This indicates the decoder module. For reconstructed output. Reconstruction error. The calculation formula is defined as follows: in Describing the L2 norm, N Batch size; Step 3.2.2: Convert the encoder output to... Heisei The shape is then calculated, and then averaged over the last dimension after flattening using average pooling to obtain a dimension of... The embedded representation vector, denoted as .
[0012] Step 3.3 specifically involves: The embedded representation vector obtained in step 3.2.2 Follow with a linear classifier to generate classification output. Classification loss is defined as the machine attribute true label. With classifier output Cross-entropy between; Among them, CE ( ) is the cross-entropy function; this classification task encourages the model to focus on features related to machine attributes, enhancing the feature space's ability to distinguish between different categories.
[0013] Step 3.4 specifically involves: Step 3.4.1: For a size of N From the batch, select the first one. i Embedding vector of each sample As the anchor point, all with Samples with the same attribute label (including noisy samples and clean samples) are considered as Positive sample pairs; with Samples with different attribute labels and pure noise samples are considered as Negative sample pairs.
[0014] Step 3.4.2: Calculate the contrastive loss function based on positive and negative sample pairs to maximize the anchor point. The similarity between it and its positive samples is expressed as follows: in: Represents cosine similarity. Temperature coefficient used to scale similarity scores Anchor point The set of positive sample indices yes The number of indexes. The core function of this loss function is to narrow the distance between noisy samples and clean samples of the same machine attribute category, while distinguishing them from pure noise samples. This forces the model to focus on key features related to machine sound, learn "noise-invariant" features that are insensitive to changes in background noise, and improve the feature discrimination ability in high-noise environments.
[0015] The specific process for step 4, which involves training the anomaly detector and determining anomalies, is as follows: Step 4.1: Use the autoencoder trained in Step 3 to extract the embedding representation vectors of all normal samples in the training set, and then reconstruct the error. Embedded vector spliced together 3D eigenvectors To form a normal sample feature library ; Step 4.2: Use the normal sample feature library Train the k-nearest neighbor model to determine the number of nearest neighbors. ; Step 4.3: Anomaly detection stage, analyzing the feature vectors of the test samples. The abnormal score is defined as follows: and The average distance of the nearest neighbors: in express The k A close neighbor; Step 4.4: For all samples in the validation set, calculate their anomaly scores, and select these scores using the p-quantile method. p The critical value at which = 0.9 is used as the detection threshold. If the abnormal score is greater than or equal to If the test sound is abnormal, it is considered normal; otherwise, it is considered normal. The abnormality determination results for the test samples are as follows: .
[0016] The beneficial effects of this invention are: This paper proposes a multi-task learning framework that integrates reconstruction learning, self-supervised classification, and noise-aware contrastive learning objectives into a unified convolutional autoencoder architecture. This framework combines the advantages of reconstruction learning and self-supervised learning, achieving excellent detection performance with a small number of parameters, thus balancing efficiency and detection accuracy. By designing a noise-perception contrast mechanism, positive and negative sample pairs with noise invariance are constructed using auxiliary clean machine sounds and pure noise recordings. This drives the model to pull similar samples closer to each other and away from noise interference in the feature space. This mechanism explicitly enhances the model's robustness to complex background noise, improves feature discriminativeness, and demonstrates more stable and superior performance in real-world high-noise industrial environments. Attached Figure Description
[0017] Figure 1 This is a block diagram illustrating the principle of the present invention.
[0018] Figure 2 This is a structural diagram of the model of the present invention. Detailed Implementation
[0019] The present invention will now be described in further detail with reference to the accompanying drawings.
[0020] like Figure 1 As shown, a noise-robust machine abnormal sound detection method based on a multi-task convolutional autoencoder includes the following steps; Step 1: Construct a training dataset for abnormal machine sound detection, which includes noisy machine sound samples with attribute labels under normal operating conditions, clean and normal machine sound samples collected when the factory is idle, and pure background noise samples collected when the machine is not running.
[0021] Step 2: Time-frequency feature extraction of audio data. The original audio signal is segmented into fixed lengths, a low-frequency cutoff frequency is set, and the log-Mel spectrum features within this frequency range are extracted as input features.
[0022] Step 3: Multi-task autoencoder training. A convolutional autoencoder neural network model is established, using normal noisy machine sound samples as well as auxiliary clean normal machine sound and pure noise samples. The model is trained by fusing reconstruction loss, machine attribute classification loss, and contrastive loss. The encoder output is considered as the embedded representation vector of the input sound signal for subsequent anomaly detection.
[0023] Step 4: Anomaly Detector Training and Anomaly Determination. Using the autoencoder model trained in Step 3, the embedded representation vectors and reconstruction loss of all normal samples in the training set are extracted and concatenated to form a normal sample feature library. Then, the anomaly detector is trained based on the k-nearest neighbor algorithm. The anomaly score of a test sound sample is defined as the average distance from its feature vector to its K nearest neighbors.
[0024] In step 1 of this invention, the training dataset includes normal machine sounds with noise (collected from an actual operating industrial environment, including background noise), clean normal machine sounds (collected in a factory idle or ideally quiet environment with minimal noise interference), and pure noise recordings (collected when the machine is not running).
[0025] In step 2 of this invention, when extracting audio features, a low-frequency cutoff frequency related to the machine type is set according to the spectral distribution characteristics of different types of machine sounds and noises, so as to filter out low-frequency noise and retain the core frequency band of the machine sound. The original long audio signal is segmented into fixed lengths, and the log-Mel spectrum features of each audio segment are extracted; the dataset of this invention contains long audio signals from various machine types; The process of extracting log-Mel spectrum features includes: converting the original long audio signal into a two-dimensional time spectrum using short-time Fourier transform; constructing a Mel triangular filter bank based on the low-frequency cutoff frequency to map the frequency dimension from a linear scale to a Mel scale; and finally converting the amplitude to a decibel scale to obtain the log-Mel spectrum features. Record No. i The log-Mel spectrum characteristics of each audio segment are as follows: ,in Indicates the frequency domain dimension, representing the number of Mel filters; Indicates the time domain dimension, which is the number of time domain frames.
[0026] Step 3 of this invention is the model training part of this invention. The model is trained using a convolutional autoencoder as the backbone network and the training dataset constructed in step 1. During training, three training sub-tasks are integrated: reconstruction task, self-supervised classification task, and noise-aware contrastive learning task.
[0027] Step 3.1: Construct a CAE-SSL-CL model for abnormal machine sound detection. The model structure is as follows: Figure 2The system comprises a convolutional autoencoder and a linear classification layer. The autoencoder layer includes an encoder and a decoder. The encoder progressively compresses the input two-dimensional temporal spectrogram using four convolutional blocks, ultimately obtaining a 128-dimensional embedding feature vector through average pooling. The decoder then progressively upsamples this embedding vector using a symmetrical four-layer structure to reconstruct a spectrogram of the same size as the input. By calculating the reconstruction error, it learns the patterns of normal sound. This 128-dimensional embedding vector is also connected to a linear classification layer to predict machine attribute labels, enhancing the discriminative power of the features through classification tasks. Step 3.2: Using the logarithmic Mel spectrum features of the sound signal as the model input, construct the reconstruction error loss function between the input and output; Step 3.2.1: Analyze the log-Mel spectrum features Input a convolutional autoencoder model, and obtain the latent representation through the encoder. The reconstructed output is then obtained through a decoder. Its input-output relationship is expressed as in Indicates encoder module, , Indicates the channel, frequency domain, and time domain dimensions respectively. This indicates the decoder module. For reconstructed output. Reconstruction error. The calculation formula is defined as follows: in Describing the L2 norm, N This refers to the batch size.
[0028] Step 3.2.2: Convert the encoder output to... Heisei The shape is then calculated, and then averaged over the last dimension after flattening using average pooling to obtain a dimension of... The embedded representation vector, denoted as This embedded representation vector contains key features of the input data, which can be used to distinguish between normal and abnormal data and for anomaly detection in subsequent parts; Step 3.3: Construct a self-supervised classification loss function using machine attribute categories as classification labels; The embedded representation vector obtained in step 3.2.2 Follow with a linear classifier to generate classification output. Classification loss is defined as the machine attribute true label. With classifier output Cross-entropy between; Among them, CE ( ) is the cross-entropy function; this classification task encourages the model to focus on features related to machine attributes, enhancing the feature space's ability to distinguish between different categories.
[0029] Step 3.4: Construct positive and negative sample pairs using machine attribute labels and clean and pure noise samples, and calculate the noise-perceived contrastive learning loss function; Step 3.4.1: For a size of N From the batch, select the first one. i Embedding vector of each sample As the anchor point, all with Samples with the same attribute label (including noisy samples and clean samples) are considered as Positive sample pairs; with Samples with different attribute labels and pure noise samples are considered as Negative sample pairs.
[0030] Step 3.4.2: Calculate the contrastive loss function based on positive and negative sample pairs to maximize the anchor point. The similarity between it and its positive samples is expressed as follows: in: Represents cosine similarity. Temperature coefficient used to scale similarity scores Anchor point The set of positive sample indices yes The number of indexes in the middle. The core function of this loss function is to narrow the distance between noisy samples and clean samples of the same machine attribute category, while distinguishing them from pure noise samples, thereby forcing the model to focus on key features related to machine sound, learn "noise-invariant" features that are not sensitive to changes in background noise, and improve the feature discrimination ability in high-noise environments; Step 3.5: Train the model by fusing reconstruction loss, classification loss, and contrastive loss. The combined loss function is defined as: in and To balance the weights of the various tasks, and given that classification and contrastive learning converge faster than reconstruction, a two-stage training process is adopted: the first stage uses only the reconstruction loss. A pre-trained convolutional autoencoder model is used, and the total loss is used in the second stage to train the complete model.
[0031] In step 4 of this invention, anomaly detector training and anomaly determination are performed, and the processing flow includes: Step 4.1: Use the autoencoder trained in Step 3 to extract the embedding representation vectors of all normal samples in the training set, and then reconstruct the error. and embedding vector spliced together 3D eigenvectors To form a normal sample feature library ; Step 4.2: Use the normal sample feature library Train the k-nearest neighbor model to determine the number of nearest neighbors. ; Step 4.3: Anomaly detection stage, analyzing the feature vectors of the test samples. The abnormal score is defined as follows: and The average distance of the nearest neighbors: in express The k A close neighbor; Step 4.4: For all samples in the validation set, calculate their anomaly scores, and select these scores using the p-quantile method. p The critical value at which = 0.9 is used as the detection threshold. If the abnormal score is greater than or equal to If the test sound is abnormal, it is considered normal; otherwise, it is considered normal. The abnormality determination results for the test samples are as follows: .
[0032] To verify the effectiveness of the technical solution of this invention, experiments were conducted on the DCASE2025 Challenge Task 2 dataset. This dataset contains sound samples from seven machine types: fans, gearboxes, bearings, sliders, toy cars, toy trains, and valves. Each audio segment ranges in length from 5 to 12 seconds, has a sampling rate of 16 kHz, and is mixed with high-intensity background noise. For each machine type, 1000 normal training samples and 200 test samples are provided, along with 100 auxiliary sound samples, which are either clean normal machine data or data containing only noise.
[0033] Table 1 shows the key parameter configurations of the technical solution described in this specification. For each machine type, a low-frequency cutoff frequency fmin is set according to its spectral distribution characteristics with noise to suppress low-frequency noise. When extracting the log-Mel spectrum, a window size of 1024 and a step size of 512 are used to concatenate 64 consecutive frames (approximately 2 seconds) to form an input audio feature of size 128×64. After encoder and average pooling processing, the output embedded representation vector has a dimension of 128. The CAE-SSL-CL model proposed in this specification is trained in two stages: the first stage uses only reconstruction loss for 100 epochs of training, and the second stage uses combination loss for 250 epochs of training, with a learning rate of 0.001 and a batch size of 128. Model performance is measured by two metrics: Area Under the Receiver Operating Characteristic (ROC) curve (AUC) and Partial Area Under the Curve (pAUC) on the test set.
[0034] Table 1 Key parameter configuration of the detection algorithm Table 2 presents the performance comparison results of this invention with several other methods. AE-MSE and AE-MAHALA are reconstruction methods based on linear autoencoders and are the official baseline models of the DCASE2025 challenge. STgram-MFN and CLP-SCF are self-supervised classification models, with CLP-SCF introducing a contrastive learning loss based on machine ID. The results show that the method described in this paper achieves an average AUC of 68.46% and a pAUC of 57.75% on the test set, significantly outperforming several other methods based solely on reconstruction or self-supervised learning.
[0035] Table 2. Comparison of AUC and pAUC (%) between the detection algorithm of this invention and other methods on different machine types. To evaluate the contributions of each component in the proposed multi-task learning framework, Table 3 compares the detection performance using different combined losses. The results show that training the model using three loss functions jointly yields the best detection performance, with both the self-supervised classification module and the contrastive learning module consistently improving detection performance.
[0036] Table 3. Comparison of average AUC and pAUC using different combination losses (%) This method employs a multi-task learning framework to collaboratively optimize reconstruction learning, self-supervised classification, and contrastive learning. It also utilizes auxiliary clean samples and pure noise samples to construct an explicit noise robustness enhancement strategy, enabling the model to learn noise-invariant feature representations. Experiments show that this method maintains more stable and superior anomaly detection capabilities under different noise environments and equipment types, effectively overcoming the problems of feature confusion or insufficient generalization under noise interference in traditional methods. This verifies its superior practical application potential in complex industrial noise scenarios.
Claims
1. A noise-robust machine abnormal sound detection method based on a multi-task convolutional autoencoder, characterized in that, Includes the following steps; Step 1: Select noisy machine sound samples with attribute labels under normal working conditions, clean normal machine sound samples collected when the factory is idle, and pure background noise samples collected when the machine is not running as the dataset, and use this dataset as the original audio signal. Step 2: Perform fixed-length segmentation on the original audio signal, set a low-frequency cutoff frequency, and extract the log-Mel spectrum features within this frequency band as input features; Step 3: Establish a convolutional autoencoder neural network model. Use normal noisy machine sound samples, as well as auxiliary clean normal machine sound samples and pure background noise samples. Fuse reconstruction loss, machine attribute classification loss and contrast loss to train the model. The output of the encoder is regarded as the embedded representation vector of the input sound signal for subsequent anomaly detection. Step 4: Using the convolutional autoencoder neural network model trained in Step 3, extract the embedded representation vectors and reconstruction loss of all normal samples in the training set and concatenate them to form a normal sample feature library. Then, train an anomaly detector based on the k-nearest neighbor algorithm. The anomaly score of the test sound sample is defined as the average distance from its feature vector to its K nearest neighbors, thereby realizing machine abnormal sound detection.
2. The noise-robust machine abnormal sound detection method based on a multi-task convolutional autoencoder according to claim 1, characterized in that, In step 2, when extracting audio features, a low-frequency cutoff frequency related to the machine type is set according to the spectral distribution characteristics of different types of machine sounds and noise, so as to filter out low-frequency noise and retain the core frequency band of the machine sound. The original long audio signal is segmented into fixed lengths, and the log-Mel spectrum features of each audio segment are extracted; the dataset of this invention contains long audio signals from various machine types; The process of extracting log-Mel spectrum features includes: converting the original long audio signal into a two-dimensional time spectrum using short-time Fourier transform; constructing a Mel triangular filter bank based on the low-frequency cutoff frequency to map the frequency dimension from a linear scale to a Mel scale; and finally converting the amplitude to a decibel scale to obtain the log-Mel spectrum features. Record No. i The log-Mel spectrum characteristics of each audio segment are as follows: ,in Indicates the frequency domain dimension, representing the number of Mel filters; Indicates the time domain dimension, which is the number of time domain frames.
3. The noise-robust machine abnormal sound detection method based on a multi-task convolutional autoencoder according to claim 2, characterized in that, Step 3 specifically involves: Step 3.1: Construct a CAE-SSL-CL model for detecting abnormal machine sounds; Step 3.2: Using the logarithmic Mel spectrum features of the sound signal as the model input, construct the reconstruction error loss function between the input and output; Step 3.3: Construct a self-supervised classification loss function using machine attribute categories as classification labels; Step 3.4: Construct positive and negative sample pairs using machine attribute labels and clean and pure noise samples, and calculate the noise-perceived contrastive learning loss function; Step 3.5: Train the model by fusing reconstruction loss, classification loss, and contrastive loss. The combined loss function is defined as: in and To balance the weights of each task, the following two-stage training process is adopted: the first stage uses only the reconstruction loss. A pre-trained convolutional autoencoder model is used, and the total loss is used in the second stage to train the complete model.
4. The noise-robust machine abnormal sound detection method based on a multi-task convolutional autoencoder according to claim 3, characterized in that, The CAE-SSL-CL model includes a convolutional autoencoder and a linear classification layer. The autoencoder layer includes an encoder and a decoder. The encoder compresses the input two-dimensional temporal spectrogram step by step through four convolutional blocks, and finally obtains a 128-dimensional embedding feature vector through average pooling. The decoder then upsamples the embedding vector step by step through a symmetrical four-layer structure to reconstruct a spectrogram with the same size as the input. The normal sound pattern is learned by calculating the reconstruction error.
5. The noise-robust machine abnormal sound detection method based on a multi-task convolutional autoencoder according to claim 3, characterized in that, Step 3.2 specifically involves: Step 3.2.1: Analyze the log-Mel spectrum features Input a convolutional autoencoder model, and obtain the latent representation through the encoder. The reconstructed output is then obtained through a decoder. Its input-output relationship is expressed as: in Indicates encoder module, , Indicates the channel, frequency domain, and time domain dimensions respectively. This indicates the decoder module. For reconstructed output. Reconstruction error. The calculation formula is defined as follows: in Describing the L2 norm, N Batch size; Step 3.2.2: Convert the encoder output to... Heisei The shape is then calculated, and then averaged over the last dimension after flattening using average pooling to obtain a dimension of... The embedded representation vector, denoted as .
6. The noise-robust machine abnormal sound detection method based on a multi-task convolutional autoencoder according to claim 3, characterized in that, Step 3.3 specifically involves: The embedded representation vector obtained in step 3.2.2 Follow with a linear classifier to generate classification output. Classification loss is defined as the machine attribute true label. With classifier output Cross-entropy between; Among them, CE ( ) is the cross-entropy function; this classification task encourages the model to focus on features related to machine attributes, enhancing the feature space's ability to distinguish between different categories.
7. The noise-robust machine abnormal sound detection method based on a multi-task convolutional autoencoder according to claim 3, characterized in that, Step 3.4 specifically involves: Step 3.4.1: For a size of N From the batch, select the first one. i Embedding vector of each sample As the anchor point, all with Samples with the same attribute label are considered as Positive sample pairs; with Samples with different attribute labels and pure noise samples are considered as Negative sample pairs. Step 3.4.2: Calculate the contrastive loss function based on positive and negative sample pairs to maximize the anchor point. The similarity between it and its positive samples is expressed as follows: in: Represents cosine similarity. Temperature coefficient used to scale similarity scores Anchor point The set of positive sample indices yes The number of indexes in the middle.
8. The noise-robust machine abnormal sound detection method based on a multi-task convolutional autoencoder according to claim 3, characterized in that, The specific process for step 4, which involves training the anomaly detector and determining anomalies, is as follows: Step 4.1: Use the autoencoder trained in Step 3 to extract the embedding representation vectors of all normal samples in the training set, and then reconstruct the error. and embedding vector spliced together 3D eigenvectors To form a normal sample feature library ; Step 4.2: Use the normal sample feature library Train the k-nearest neighbor model to determine the number of nearest neighbors. ; Step 4.3: Anomaly detection stage, analyzing the feature vectors of the test samples. The abnormal score is defined as follows: and The average distance of the nearest neighbors: in express The k A close neighbor; Step 4.4: For all samples in the validation set, calculate their anomaly scores, and select these scores using the p-quantile method. p The critical value at which = 0.9 is used as the detection threshold. ; If the abnormal score is greater than or equal to If the test sound is abnormal, it is considered normal; otherwise, it is considered normal. The abnormality determination results for the test samples are as follows: 。
Citation Information
Patent Citations
Machine abnormal sound sample reconstruction method based on convolutional adversarial neural network
CN117133315A