A one-dimensional time sequence signal anomaly detection method and system
By combining CWT, AE and GAN, the AUTO-GAN model is used to detect anomalies in one-dimensional time series signals, which solves the detection difficulties of existing methods in small data volumes and noisy environments, and achieves efficient and accurate fault identification.
Patent Information
- Application Number
- CN202411775688.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-12-05
AI Technical Summary
Existing signal anomaly detection methods cannot meet the requirements of real-time, efficient and accurate detection, especially when the fault signal component accounts for a small proportion or is masked by strong background noise, the detection and recognition effect deteriorates significantly.
The adversarial autoencoder based on CWT multi-scale analysis combined with AE and GAN is used to detect anomalies in one-dimensional time series signals through the AUTO-GAN model. Continuous wavelet transform is used to extract features and adversarial learning of the discriminator and generator is used to train the discriminator, achieving more accurate anomaly recognition.
It achieves high recognition accuracy with small data volumes, is suitable for implementation in electromechanical equipment and factory production lines, and can effectively identify situations where the fault signal accounts for a small proportion of the full-frequency signal bandwidth or is masked by strong background noise.
Smart Images

Figure CN119884919B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of equipment fault diagnosis, and particularly relates to a one-dimensional time sequence signal anomaly detection method and system. BACKGROUND
[0002] Acoustic vibration signal is a typical one-dimensional time sequence signal, and anomaly detection based on acoustic vibration signal plays a crucial role in modern industry, especially in the fields of device state monitoring and fault diagnosis. With the increase of complexity of industrial devices, traditional fault diagnosis methods have been unable to meet the real-time, efficient and accurate detection requirements. In recent years, anomaly detection based on acoustic vibration signal as an effective diagnostic means has attracted more and more attention from researchers and engineers.
[0003] In recent years, machine learning technology has been introduced into acoustic vibration signal anomaly detection. Machine learning algorithms can automatically extract effective features and perform pattern recognition by learning from a large amount of historical data, significantly improving the accuracy and robustness of detection. Traditional machine learning algorithms such as support vector machine (SVM), random forest (RF) and extreme learning machine (ELM) have shown good application prospects in fault diagnosis. Guiji Tang et al. proposed an improved fast spectral correlation and optimized random forest, which can more effectively extract bearing fault features and accurately identify bearing faults. With the development of deep learning, models such as deep neural network (DNN), convolutional neural network (CNN) and recurrent neural network (RNN) have been increasingly applied in acoustic vibration signal anomaly detection. These deep learning models can automatically learn complex features in signals without manual feature extraction, improving the automation and accuracy of detection. For example, interpolation deep neural network (IDNN) and ID-condition autoencoder learn the features of normal sound by minimizing reconstruction error. Rishikesh Magar et al. proposed a FaultNet based on convolutional neural network for different types of bearing fault detection, and Youde Liu et al. proposed a method based on spectral time fusion and deep learning network to learn the features of normal sound, which achieved better results than the baseline in the anomaly detection of DCASE 2020 Challenge. However, these methods lack in-depth research on feature extraction of acoustic vibration signal, and completely rely on a large amount of data training to obtain better detection recognition results, but it is difficult to collect a large amount of fault data for neural network model training in reality. In addition, when the fault signal component accounts for a small proportion of the full frequency signal bandwidth or is masked by strong background noise, the detection and recognition effect will be significantly deteriorated.
[0004] In summary, the existing signal anomaly detection methods cannot meet the actual use requirements. SUMMARY
[0005] The embodiment of the application provides a one-dimensional time sequence signal anomaly detection method and system, and solves the problem that the existing signal anomaly detection method cannot meet actual use requirements.
[0006] The embodiment of the application provides a one-dimensional time sequence signal anomaly detection method, which comprises the following steps:
[0007] The one-dimensional time sequence signal to be processed is subjected to CWT multi-scale analysis;
[0008] The one-dimensional time sequence signal subjected to CWT multi-scale analysis is processed by using an AE and GAN adversarial autoencoder;
[0009] The one-dimensional time sequence signal subjected to adversarial autoencoding is processed by using an AUTO-GAN model, and a detection result is output.
[0010] Optionally, the mathematical formula of the CWT is specifically as follows:
[0011] ,
[0012] Wherein, t is time, x(t) is an input signal, is a wavelet function, a is a scale parameter, and b is a translation parameter, is a continuous wavelet transform.
[0013] Optionally, the mother wavelet of the CWT is specifically a Morlet wavelet, and the mathematical formula of the bandwidth is specifically as follows:
[0014] ,
[0015] Wherein, is a bandwidth, is a center frequency.
[0016] Optionally, the base wavelet of the CWT is specifically a complex Morlet wavelet, and the mathematical formula is specifically as follows:
[0017] ,
[0018] Wherein, t is time, is a center circular frequency of a wavelet, i is an imaginary unit, is a complex Morlet wavelet transform.
[0019] Optionally, the mathematical formula of the AE is specifically as follows:
[0020] ,
[0021] Wherein, is an input real sample feature, h is a latent space representation of a sample, is a reconstructed sample feature, f andg are the activation functions of the encoder and the decoder respectively, W 1 and W 2 are the weight matrices of the encoder and the decoder respectively, and b1 and b2 are the bias vectors of the encoder and the decoder respectively.
[0022] Optionally, the mathematical formula of the objective function of the GAN is specifically as follows:
[0023] ,
[0024] wherein, is the input real sample feature, is random noise, is the minimum of the generated fake sample, is the maximum of the score of the input real sample, is the objective function, is the score of the input real sample feature by the discriminator, is the fake sample generated by the generator, is the expected value of the score of the input real sample, is the expected value of the score of the generated fake sample.
[0025] Optionally, the mathematical formula of the overall loss function of the generator in the AUTO-GAN model is specifically as follows:
[0026] ,
[0027] wherein, is the overall loss function, is the input real sample feature, is the reconstructed sample feature, is the root mean square error between the input real sample feature and the reconstructed sample feature, is a feature matching loss coefficient, is the feature matching loss.
[0028] Optionally, the mathematical formula of the loss function of the discriminator in the AUTO-GAN model is specifically as follows:
[0029] ,
[0030] wherein, is the input real sample feature, is the reconstructed sample feature, is the mean of the prediction loss of the real sample feature, is the mean of the prediction loss of the reconstructed sample feature, is a gradient penalty term coefficient, is the gradient penalty term.
[0031] In another aspect, the embodiment of the present application also provides a one-dimensional time sequence signal anomaly detection system, comprising:
[0032] a CWT module, configured to perform CWT multi-scale analysis on a one-dimensional time sequence signal to be processed;
[0033] an adversarial autoencoder, configured to process the one-dimensional time sequence signal after CWT multi-scale analysis by using an adversarial autoencoder of AE and GAN;
[0034] an AUTO-GAN model, configured to process the one-dimensional time sequence signal after adversarial autoencoding, and output a detection result.
[0035] The one or more technical solutions provided in the embodiment of the present application have at least the following technical effects or advantages:
[0036] The present application proposes a one-dimensional time sequence signal anomaly detection method, which is a sound and vibration signal anomaly detection method based on continuous wavelet transform and adversarial neural network. The method can more effectively extract typical features of a target time-frequency region through multi-scale analysis by using a specific continuous wavelet transform, further highlight the differences between normal signals and abnormal signals, and provide more valuable discrimination information for subsequent anomaly detection. Meanwhile, an adversarial neural network with an encoder and a decoder as the main architecture is introduced as an anomaly detection model. Through adversarial training, the discriminator strives to provide feature matching guidance for the generator, and the generator learns the feature representation of the sample in the latent space. By reconstructing the feature distribution of the sample, more accurate identification of abnormal signals is achieved. The implementation results show that the proposed method has achieved high recognition accuracy in multiple scene data. The model proposed in the present application has a small size and can obtain good recognition accuracy under small data volume, and is suitable for implementation of mechanical and electrical equipment, various equipment and factory production lines. BRIEF DESCRIPTION OF DRAWINGS
[0037] Figure 1 It is a parameter optimization architecture diagram of the continuous wavelet transform in an embodiment of the present application;
[0038] Figure 2 It is a generator architecture diagram in an embodiment of the present application;
[0039] Figure 3 It is a discriminator architecture diagram in an embodiment of the present application;
[0040] Figure 4 It is a model overall framework in an embodiment of the present application. DETAILED DESCRIPTION
[0041] In order to overcome the deficiencies of the prior art, the present application provides a one-dimensional time sequence signal anomaly detection method and system, which can achieve higher abnormal recognition rate when the fault signal component occupies a small proportion of the full frequency signal bandwidth or is masked by strong background noise.
[0042] A one-dimensional time sequence signal anomaly detection method comprises the following steps:
[0043] The one-dimensional time sequence signal to be processed is analyzed by CWT multi-scale analysis;
[0044] The one-dimensional time sequence signal after CWT multi-scale analysis is processed by an AE and GAN adversarial autoencoder;
[0045] The one-dimensional time sequence signal after adversarial autoencoding is processed by an AUTO-GAN model, and a detection result is output.
[0046] The specific scheme is as follows:
[0047] Continuous wavelet transform
[0048] CWT (Continuous Wavelet Transform) is an effective time-frequency analysis method, which is very suitable for analyzing non-stationary signals and has strong anti-interference ability. The mathematical definition of CWT is as follows:
[0049] ,
[0050] Where t is time, x(t) is the input signal, is the wavelet function, a is the scale parameter, b is the translation parameter, is the continuous wavelet transform.
[0051] The result of continuous wavelet transform is wavelet coefficient, which provides local information of the signal in time and frequency. These wavelet coefficients constitute an image on the time-frequency plane, that is, a time-frequency spectrum. The scale parameter determines the stretching degree of the wavelet. Larger scale corresponds to the analysis of low frequency part, and vice versa, smaller scale corresponds to the analysis of high frequency part. The translation parameter determines the position of the wavelet on the time axis. By adjusting the scale and translation parameters, the local features of the signal can be analyzed in detail.
[0052] The selection of mother wavelet has important influence on the effect of CWT, and the commonly used ones are Morlet, Mexican Hat, Haar, Daubechies, Coiflet and the like. The Morlet is selected in the application to perform continuous wavelet analysis on the signal. The CWT realizes the multi-scale time-frequency analysis on the signal by convolving the signal with wavelets of different scales, and has self-adaptability in the time-frequency domain, and can select appropriate wavelet scale according to the local characteristics of the signal. Therefore, for the non-stationary signal with rapid frequency change or unstable signal, the CWT can provide better time-frequency resolution than the STFT. In addition, the multi-scale analysis of the CWT can capture different characteristics of the signal, so as to more specifically describe the change of the signal. However, the calculation complexity is relatively high, especially when a large amount of data is processed, the calculation cost is significantly increased. At the same time, the wavelet parameters need to be debugged and optimized to ensure the accuracy and effectiveness of the analysis. The CWT parameters are optimized from the wavelet function, center frequency, bandwidth and scale parameter, and the process is as shown in Figure 1
[0053] In the application, the complex Morlet wavelet is selected as the base wavelet of the continuous wavelet transform, and the definition is as follows:
[0054]
[0055] Wherein, t is time, is the center circular frequency of the wavelet, and i is the imaginary unit, is the complex Morlet wavelet transform.
[0056] The complex Morlet wavelet combines the Gaussian window and the sine wave, and is suitable for analyzing high-frequency signals. The bandwidth of the Morlet wavelet is determined by the parameter, and is expressed as the standard deviation in the frequency domain. For the Morlet wavelet, the bandwidth is calculated by the following formula:
[0057]
[0058] Wherein, is the bandwidth, is the center frequency.
[0059] The bandwidth determines the frequency resolution of the wavelet, and the narrower bandwidth provides higher frequency resolution, and the longer bandwidth provides higher time resolution.
[0060] In the CWT, the main parameter affecting the wavelet coefficient is the scale parameter, and the larger the scale parameter, the more attention is paid to the low-frequency characteristics, and the center circular frequency of the Morlet wavelet The main frequency range of the wavelet is determined by the scale parameter a, which controls the stretching of the wavelet and corresponds to different frequency components in the signal. The present invention uses a center frequency function to control the scale range, and the scale parameter is defined as follows:
[0061] ,
[0062] where, is the scale parameter, and the constant M is an empirical parameter, and the constant N represents the number of scales used in the wavelet transform.
[0063] The constant M is used to balance the relationship between the scale range and the frequency range, and its selection is based on how effectively capturing the main features of the signal without causing the scale range to be too narrow or too wide, thereby balancing between computational efficiency and analysis effectiveness. The constant N represents the number of scales used in the wavelet transform, and selecting a larger value can provide higher frequency resolution, which allows more scales to be used in the transform, covering a wider frequency range.
[0064] (2) Adversarial autoencoder
[0065] The combination of AE (Autoencoder) and GAN (Generative Adversarial Network) aims to leverage the advantages of both to enhance the performance of the generative model. AE is good at data dimensionality reduction and feature learning, while GAN excels in generating high-quality data. By combining the feature extraction capability of AE with the generation capability of GAN, a more efficient and powerful generative model can be constructed.
[0066] AE is an unsupervised learning model mainly used for data dimensionality reduction and feature learning. Its basic structure includes an encoder and a decoder. The encoder maps the input data to a low-dimensional latent space, while the decoder reconstructs the input data from the latent space. AE is trained by minimizing the difference between the input data and the reconstructed data. The mathematical representation of AE is as follows:
[0067] ,
[0068] where, is the input real sample feature, h is the latent space representation of the sample, is the reconstructed sample feature, f and g are the activation functions of the encoder and the decoder, respectively, W 1 and W 2 are the weight matrices of the encoder and the decoder, respectively, b 1 andb 2 are the bias vectors of the encoder and the decoder, respectively.
[0069] GAN consists of a generator and a discriminator as shown in Figure 2 , Figure 3 The generator is responsible for generating realistic data, while the discriminator tries to distinguish between real data and generated data. GAN improves the quality of the generated data by adversarial training, so that the discriminator is better "cheated".
[0070] The objective function of the generative adversarial network can be expressed as:
[0071] ,
[0072] where, is the input real sample feature, is random noise, is the minimum of the generated false sample, is the maximum of the input real sample score, is the objective function, is the score of the input real sample feature by the discriminator, is the generated false sample by the generator, is the expected value of the input real sample score, is the expected value of the generated false sample score.
[0073] The adversarial autoencoder optimizes the encoder through adversarial training, so that the distribution of the latent space output by the encoder is close to a certain prior distribution. The generator samples the latent variable from the prior distribution, and the decoder generates data from the latent variable. This method combines the feature learning ability of the autoencoder and the generative adversarial ability of the GAN, not only improves the quality of data generation, but also improves the stability of the model.
[0074] (3) Anomaly detection model based on continuous wavelet transform and adversarial neural network (AUTO-GAN)
[0075] The overall framework of the AUTO-GAN model is shown in Figure 4As shown, in the proposed AUTO-GAN model, the generator G is modified as an autoencoder to reconstruct the wavelet transform time-frequency map, while the discriminator D is trained to distinguish the real and reconstructed spectrograms. The structure of G can be regarded as an inverse cascade of a deep convolutional GAN (DCGAN), where the encoder of G is the discriminator of DCGAN, and the decoder of G is the generator of DCGAN. The structure of D is mainly similar to the encoder of G, except that the last layer is replaced by a deep convolution to facilitate the extraction of semantic embeddings. Mainly using layer normalization (LN), it can improve the training speed, generalization ability and stability of the neural network, especially on deep networks and large-scale datasets.
[0076] The discriminator is trained, and the loss function of the generator is modified as a feature matching loss constraint at the sample level. The generator learns the feature representation of the positive example in the latent space as much as possible, while reducing the reconstruction loss of the reconstructed sample and the original sample during reconstruction. Since the model only accepts positive examples as training data, the feature representation of the abnormal sample in the latent space will be significantly different from that of the normal sample in the encoding stage, and the reconstruction error of the abnormal sample will be significantly larger than that of the normal sample in the decoding reconstruction stage. Based on this idea, the overall loss function of the generator can be constructed by comparing the mean and standard deviation of the extracted embedding from the discriminator:
[0077] ,
[0078] wherein, is the overall loss function, is the input real sample feature, is the reconstructed sample feature, is the root mean square error between the input real sample feature and the reconstructed sample feature, is the feature matching loss coefficient, is the feature matching loss.
[0079] The loss function of the generator combines the difference in statistics with the mean square error (MSE). The first term is expected to improve the denoising performance, while the second term can improve the robustness.
[0080] The loss function of the discriminator is set as:
[0081] ,
[0082] wherein, is the input real sample feature, is the reconstructed sample feature, The mean of the prediction loss of the real sample feature, this part encourages the discriminator to classify the real sample as true, The mean of the prediction loss of the reconstructed sample feature, this part encourages the discriminator to classify the generated sample as false, The coefficient of the gradient penalty term, The gradient penalty term, this part is used to punish the gradient of the discriminator, so as to make the discriminator keep smooth output between the formal sample and the generated sample.
[0083] The model learns the feature distribution of the normal sample through training the normal sample, so that the model gets significantly enlarged reconstruction error when detecting the abnormal sample, and through selecting appropriate reconstruction error threshold, the abnormal sample can be effectively detected.
[0084] The one-dimensional time sequence signal anomaly detection system in the embodiment of the application comprises:
[0085] The CWT module is configured to perform CWT multi-scale analysis on the one-dimensional time sequence signal to be processed.
[0086] The adversarial autoencoder is configured to process the one-dimensional time sequence signal after CWT multi-scale analysis by using the adversarial autoencoder of AE and GAN.
[0087] The AUTO-GAN model is configured to process the one-dimensional time sequence signal after the adversarial autoencoding, and output a detection result. Specific embodiments:
[0089] In the motor production line, the offline detection is a crucial link, which ensures that the quality and performance of the motor meet the standards. In offline detection, the traditional method of listening to abnormal sound by human ear is a common preliminary inspection method. The human ear listens to abnormal sound mainly depends on the experience and auditory acuity of the operator to judge whether the motor has abnormal conditions. However, it should be noted that although the human ear listens to abnormal sound is a simple and fast method, its accuracy and reliability are limited by many factors. Compared with the traditional manual detection method, the intelligent detection system has many advantages. First, the intelligent detection system can realize 24-hour uninterrupted automatic detection, avoiding the omissions and misjudgments of manual detection. Secondly, the intelligent detection system can record and analyze the detection results, providing data support for product quality improvement. In addition, the intelligent detection system can also deal with complex and hidden faults, through fine signal processing and feature extraction algorithm, improve the accuracy and reliability of detection.
[0090] The motor offline detection data is collected in the workshop, the sampling rate is 48k, the time length is about 4s of audio segment, wherein the normal audio segment is 22 segments, and the fault audio segment is 8 segments. The original audio is segmented and sampled with an overlap rate of 25%, each sample length is 1s, and 48000 data points. Each sample is processed by continuous wavelet transform to obtain a time-frequency feature map with a size of 512x512 as an input sample, wherein the training set contains 588 normal samples, and the test set selects 100 fault samples. After data preprocessing, it is found that the data sample produces a fault feature different from the normal training sample in the 400 Hz-600 Hz frequency band. Therefore, the continuous wavelet transform parameter is set to: 'cmor100-10', the center frequency is 100 Hz, the bandwidth is '10', the mother wavelet is Morlet wavelet, the scale parameter constant M is 25, and the scale sequence length constant N is 512.
[0091] For this data set, the method (referred to as AUTO-GAN) proposed in the present application and the method in other literatures are used for abnormal detection test comparison, and the recognition accuracy result is shown in the following table. The results show that the method proposed in the present application is obviously better than other methods in the motor offline detection data set, which proves the superiority of the method proposed in the present application.
[0092] Motor offline detection precision comparison table
[0093]
[0094] The above only describes the preferred embodiments of the present application and does not limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A one-dimensional time series signal anomaly detection method, characterized in that: include: Use CWT multi-scale analysis to analyze the one-dimensional time series signal to be processed; Adopt AE and GAN adversarial autoencoder to process the one-dimensional time series signal after CWT multi-scale analysis; The AUTO-GAN model is used to process the one-dimensional time series signal after the adversarial autoencoding and output the detection results; The mathematical formula of the CWT is specifically: , Where t is time, x(t) is the input signal, is the wavelet function, a is the scale parameter, b is the translation parameter, is the continuous wavelet transform; The mother wavelet of the CWT is specifically the Morlet wavelet, and its bandwidth mathematical formula is specifically: , in, is the bandwidth, is the center frequency; The base wavelet of the CWT is specifically the complex Morlet wavelet, and its mathematical formula is specifically: , Where t is the time, is the central circle frequency of the wavelet, i is the imaginary unit, is the complex Morlet wavelet transform.
2. The method according to claim 1, wherein The mathematical formula of AE is specifically: , in, is the input real sample feature, h is the potential space representation of the sample, To reconstruct sample features, f and g are the activation functions of the encoder and decoder respectively, W 1 and W 2 are the weight matrices of the encoder and decoder, b1 and b2 are the bias vectors of the encoder and decoder, respectively.
3. The method according to claim 1, wherein The mathematical formula of the objective function of the GAN is specifically: , in, is the input real sample feature, is random noise, is to generate fake samples to minimize It is to maximize the score of the input true sample, is the objective function, is the score of the discriminator on the input real sample features, is a fake sample generated by the generator, is the expected value of the score of the input real sample, is the expected value of the generated fake sample ratings.
4. The method according to claim 1, wherein The mathematical formula of the overall loss function of the generator in the AUTO-GAN model is specifically: , in, is the overall loss function, To input the real sample features, To reconstruct sample features, is the root mean square error between the input true sample features and the reconstructed sample features, is the feature matching loss coefficient, is the feature matching loss.
5. The method according to claim 1, wherein The mathematical formula of the loss function of the discriminator in the AUTO-GAN model is specifically: , in, To input the real sample features, To reconstruct sample features, is the mean of the prediction loss of the real sample features, is the mean of the prediction loss of the reconstructed sample features, is the gradient penalty coefficient, is the gradient penalty term.
6. A one-dimensional time series signal anomaly detection system, used to implement the one-dimensional time series signal anomaly detection method according to claim 1, characterized in that: include: CWT module, used to analyze the one-dimensional time series signal to be processed using CWT multi-scale analysis; Adversarial autoencoder, which is used to process one-dimensional time series signals after CWT multi-scale analysis using AE and GAN adversarial autoencoder; The AUTO-GAN model is used to process the one-dimensional time series signal after adversarial autoencoding and output the detection results.
Citation Information
Patent Citations
Bearing cross-working-condition fault prediction method based on adversarial transfer learning
CN114722879A
Industrial internet time series data anomaly detection method and device
CN116522265A