Method and device for detecting time sequence anomaly of industrial equipment
By preprocessing the timing data of industrial equipment and using GRU variational autoencoder for feature extraction, combining multi-objective loss function and dynamic threshold adjustment method, the problems of low abnormal detection recall and insufficient noise resistance in the prior art are solved. , improves the accuracy and robustness of the detection.
Patent Information
- Application Number
- CN202411528988.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-02-11
AI Technical Summary
The existing deep learning anomaly detection methods have problems such as low recall, insufficient noise resistance and low model generalization in industrial equipment timing data, especially in high-dimensional spaces, which are hidden and difficult to detect.
Capture local features by preprocessing the timing data of industrial equipment, including minimum-maximum standardization and sliding window processing. Then, GRU variational autoencoder is used for encoding and decoding processing, and the low-dimensional representation of the data is learned. The loss function combines reconstruction loss, distribution loss and noise prediction loss, and optimizes model parameters through backpropagation algorithm and Adam optimizer. Finally, the dynamic threshold adjustment method is used for detection in the abnormality detection stage.
It improves the accuracy and robustness of timing abnormality detection of industrial equipment, enhances the generalization ability and noise resistance of the model, and adapts to different operating conditions and data distribution.
Smart Images

Figure CN119414813A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a method and device for detecting timing anomalies of industrial equipment. Background Art
[0002] In recent years, the development of smart industry and Industry 4.0 has made it possible to automatically monitor production lines and detect anomalies before problems become serious. The IoT ecosystem is able to collect a large amount of data from industrial machinery, including time series data such as temperature, pressure, vibration, and power consumption, providing a rich source of information for anomaly detection. Traditional anomaly detection methods include statistical models, clustering methods, distance-based methods, and density-based methods. With the rapid development of deep learning technology, deep learning-based anomaly detection methods have gradually replaced traditional methods, which are mainly divided into prediction-based, reconstruction-based, representation-based, and hybrid methods.
[0003] However, existing deep learning anomaly detection methods still face many challenges. Due to the scarcity and imbalance of abnormal data, as well as the diversity and uncertainty of anomaly types, existing methods often suffer from low anomaly detection recall. In addition, in high-dimensional space, abnormal features often become hidden and difficult to detect. Efficient learning of semi-supervised or weakly supervised anomaly detection based on a small amount of labeled anomaly data is also a major challenge. Existing methods have insufficient noise resistance when dealing with mislabeled data or unlabeled anomalies, and also have difficulties in balancing the interpretability and effectiveness of the model. Especially in terms of industrial equipment time series data, due to the complex and changeable environment, the generalization and robustness of existing models are still at a relatively low level. Summary of the invention
[0004] The present application provides a method and device for detecting timing anomalies of industrial equipment, which are used to improve the accuracy of detecting timing anomalies of industrial equipment.
[0005] In a first aspect, the present application provides a method for detecting timing anomalies of industrial equipment, the method comprising: preprocessing the collected timing data of industrial equipment to obtain preprocessed timing data; encoding and decoding the preprocessed timing data to obtain reconstructed timing data; calculating a loss value based on the reconstructed timing data to obtain a total loss; optimizing preset anomaly detection model parameters based on the total loss to obtain an anomaly detection model; performing anomaly detection on real-time test data based on the anomaly detection model to obtain an anomaly detection result.
[0006] In the second aspect, the present application provides an industrial equipment timing anomaly detection device, which includes: a processing module, which is used to preprocess the collected industrial equipment timing data to obtain preprocessed timing data; an encoding module, which is used to encode and decode the preprocessed timing data to obtain reconstructed timing data; a calculation module, which is used to calculate the loss value according to the reconstructed timing data to obtain the total loss; an optimization module, which is used to optimize the preset anomaly detection model parameters according to the total loss to obtain the anomaly detection model; a detection module, which is used to perform anomaly detection on real-time test data according to the anomaly detection model to obtain anomaly detection results.
[0007] In the technical solution provided by the present application, by preprocessing the time series data of industrial equipment, including minimum-maximum standardization and sliding window processing, the influence of different sensor data dimensions is effectively eliminated, and the local characteristics of the time series data are captured, laying the foundation for subsequent anomaly detection. The preprocessed data is encoded and decoded, and the powerful feature extraction capability of the GRU variational autoencoder is utilized to effectively capture the long-term dependencies of the time series data, and also improve the robustness of the model by introducing randomness. This encoding-decoding structure enables the model to learn a low-dimensional representation of the data, which helps to discover potential abnormal patterns. In the calculation of the loss function, reconstruction loss, distribution loss and noise prediction loss are combined. This multi-objective optimization strategy enables the model to learn a more regular latent space distribution while maintaining reconstruction accuracy, enhancing the generation ability and generalization of the model. The model parameters are optimized by the back propagation algorithm and the Adam optimizer, which not only accelerates the convergence process of the model, but also improves the performance of the model when processing complex nonlinear time series data. Finally, in the anomaly detection stage, a dynamic threshold adjustment method is adopted, which combines the characteristics of the preliminary threshold and the test data, so that the model can adapt to different operating conditions and data distributions, improving the flexibility and accuracy of anomaly detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0009] Figure 1 A schematic diagram of an embodiment of a method for detecting timing anomalies of industrial equipment in an embodiment of the present application;
[0010] Figure 2 Schematic diagram of an embodiment of a device for detecting timing anomalies of industrial equipment in an embodiment of the present application. DETAILED DESCRIPTION
[0011] The embodiment of the present application provides a method and device for detecting anomalies in timing of industrial equipment. The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described here can be implemented in an order other than that illustrated or described here. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0012] For ease of understanding, the specific process of the embodiment of the present application is described below. Figure 1 , an embodiment of the method for detecting timing anomalies of industrial equipment in the embodiment of the present application includes:
[0013] Step S101, preprocessing the collected time series data of industrial equipment to obtain preprocessed time series data;
[0014] Step S102: Encode and decode the preprocessed time series data to obtain reconstructed time series data;
[0015] Step S103, calculating the loss value according to the reconstructed time series data to obtain the total loss;
[0016] Step S104: Optimizing the preset anomaly detection model parameters according to the total loss to obtain an anomaly detection model;
[0017] Step S105: perform anomaly detection on the real-time test data according to the anomaly detection model to obtain anomaly detection results.
[0018] It is understandable that the execution subject of the present application may be an industrial equipment timing anomaly detection device, or a terminal or a server, which is not limited here. The present application embodiment is described by taking a server as the execution subject as an example.
[0019] Specifically, the collected time series data of industrial equipment is preprocessed. This step includes data normalization and sliding window processing. Data normalization uses the minimum-maximum normalization method to scale the data to the range of 0 to 1 to eliminate the impact of different sensor data dimensions. Sliding window processing divides the time series data into fixed-size windows to capture local features. For example, for an industrial equipment time series data set containing multiple sensor data such as temperature, pressure, and vibration, the data of each sensor is first standardized and then processed using a sliding window of size 10 and step size 1.
[0020] The preprocessed time series data is encoded and decoded. This step is implemented using the GRU variational autoencoder. The encoder maps the input data to the latent space and obtains the mean and logarithmic variance of the latent space distribution. The decoder samples from the latent space and reconstructs the original data. In this process, the idea of the diffusion model is introduced to enhance the generalization ability of the model by gradually adding noise and inverse denoising. The GRU (Gated Recurrent Unit) network can effectively capture the long-term dependencies of time series data, while the variational autoencoder improves the robustness of the model by introducing randomness. Then, the loss value is calculated based on the reconstructed time series data to obtain the total loss. The loss function includes reconstruction loss, KL divergence loss, and noise prediction loss of the diffusion model. The reconstruction loss measures the difference between the original data and the reconstructed data, and is usually calculated using the mean square error. The KL divergence loss ensures that the latent space distribution is close to the standard normal distribution, which helps to generate diverse samples. The noise prediction loss is used to optimize the diffusion model and improve the performance of the model under different noise levels. The three losses are weighted summed to obtain the total loss, and the weights can be adjusted according to the specific application scenario.
[0021] The preset anomaly detection model parameters are optimized according to the total loss to obtain the anomaly detection model. Using the Adam optimizer, the gradient is calculated through the back-propagation algorithm, and the model parameters are updated. The Adam optimizer combines the momentum method and the adaptive learning rate method, which can effectively handle sparse gradients and non-stationary targets. During the optimization process, the model parameters are continuously adjusted to minimize the total loss function. Finally, the trained anomaly detection model is used to perform anomaly detection on the real-time test data. The specific process includes reconstructing the test data, calculating the reconstruction error, and judging whether there is an anomaly based on the preset threshold. The setting of the threshold is based on the reconstruction error distribution of the training data. Usually a higher quantile (such as 99.9%) is selected as the initial threshold, and then fine-tuned according to the actual application scenario.
[0022] For example, the reactor device of a chemical plant is equipped with multiple sensors, including temperature, pressure, pH value, etc. One month of normal operation data is collected for model training. First, the data is standardized, for example, the temperature data is mapped from the original 0-200℃ range to the 0-1 interval. Then the sliding window method is used to construct the time series window, with the window size set to 10 minutes and the step length set to 1 minute. The processed data is encoded and decoded to obtain the reconstructed data. When calculating the loss function, the reconstruction loss weight is set higher, and the KL divergence loss and noise prediction loss weights are set lower to balance the reconstruction accuracy and model generalization ability. After multiple rounds of iterative optimization, the anomaly detection model is obtained. In real-time monitoring, anomaly detection is performed on the data of the last 10 minutes every minute. If the reconstruction error exceeds the preset threshold, it is judged as an anomaly and an alarm is issued to the operator in time.
[0023] In the embodiment of the present application, by preprocessing the time series data of industrial equipment, including minimum-maximum standardization and sliding window processing, the influence of different sensor data dimensions is effectively eliminated, and the local characteristics of the time series data are captured, laying the foundation for subsequent anomaly detection. The preprocessed data is encoded and decoded, and the powerful feature extraction ability of the GRU variational autoencoder is used to effectively capture the long-term dependencies of the time series data, and the robustness of the model is improved by introducing randomness. This encoding-decoding structure enables the model to learn a low-dimensional representation of the data, which helps to discover potential abnormal patterns. In the calculation of the loss function, reconstruction loss, distribution loss and noise prediction loss are combined. This multi-objective optimization strategy enables the model to learn a more regular latent space distribution while maintaining reconstruction accuracy, enhancing the generation ability and generalization of the model. The model parameters are optimized by the back propagation algorithm and the Adam optimizer, which not only accelerates the convergence process of the model, but also improves the performance of the model when processing complex nonlinear time series data. Finally, in the anomaly detection stage, a dynamic threshold adjustment method is adopted, which combines the characteristics of the preliminary threshold and the test data, so that the model can adapt to different operating conditions and data distributions, improving the flexibility and accuracy of anomaly detection.
[0024] In a specific embodiment, preprocessing the collected time series data of industrial equipment to obtain the preprocessed time series data may specifically include the following steps:
[0025] (1) Perform minimum-maximum normalization on the time series data of industrial equipment to obtain normalized time series data;
[0026] (2) Perform sliding window processing on the normalized time series data to obtain multiple time series window data;
[0027] (3) Perform forward diffusion processing on the time series window data to obtain a pure Gaussian noise sequence, and use the pure Gaussian noise sequence as the preprocessed time series data.
[0028] Specifically, the minimum-maximum normalization process aims to eliminate the impact of different sensor data dimensions and map all data to the same scale range. Specifically, for the time series data of each sensor, find its minimum and maximum values, and then map each data point to the interval from 0 to 1. After this processing, the data of different sensors can be compared and analyzed at the same scale. Next, the sliding window process is performed to capture the local characteristics and short-term dynamic changes of the time series data. The sliding window method divides the continuous time series into multiple overlapping subsequences by moving a fixed-size window in the time dimension. The window size and sliding step size are two important parameters that need to be determined according to the specific application scenario and data characteristics. Larger windows can capture longer-term patterns, but may lose some short-term fluctuations; smaller windows can capture more fine-grained changes, but may be affected by noise. The sliding step size determines the degree of overlap between adjacent windows. A smaller step size can provide more training samples, but it also increases the computational complexity.
[0029] Finally, there is the forward diffusion process, which enhances the generalization ability of the model by gradually adding noise. The forward diffusion process is a Markov chain, starting from the original data, gradually adding Gaussian noise through multiple time steps, and finally obtaining a pure Gaussian noise sequence. This process can be regarded as a special data enhancement technique, which enables the model to learn more robust feature representations by introducing different degrees of noise. The number of forward diffusion steps and the amount of noise added in each step are hyperparameters that need to be adjusted, which affect the performance and generalization ability of the final model. The combination of these three preprocessing steps can not only standardize and normalize the original data, but also enhance the model's ability to recognize various abnormal patterns. Standardization makes the data of different sensors comparable, the sliding window captures the time series characteristics, and forward diffusion enhances the robustness of the model by introducing controllable noise.
[0030] For example, suppose there is an industrial cooling system equipped with three sensors for temperature, pressure, and flow, which record data once a minute. A week of operating data is collected, with a total of 10,080 data points (7 days × 24 hours × 60 minutes). First, perform minimum-maximum normalization. For temperature data, assuming the minimum temperature is 15°C and the maximum temperature is 35°C, then a temperature data point of 28°C will be normalized to (28-15) / (35-15)=0.65. Similarly, normalize the pressure and flow data. Then perform sliding window processing, set the window size to 60 (i.e., 1 hour of data), and the sliding step size to 10. In this way, the first window contains data from the 1st to the 60th minute, the second window contains data from the 11th to the 70th minute, and so on. A total of (10,080-60) / 10+1=1003 windows will be generated.
[0031] Finally, forward diffusion is performed, and the number of diffusion steps is set to 100. For each window of data, Gaussian noise is gradually added from t = 1 to t = 100. For example, for the temperature data of the first window, Gaussian noise with a mean of 0 and a standard deviation of 0.01 may be added at t = 1; Gaussian noise with a mean of 0 and a standard deviation of 0.05 may be added at t = 50; and Gaussian noise with a mean of 0 and a standard deviation of 0.1 may be added at t = 100. This process is repeated for all windows and all sensor data.
[0032] In a specific embodiment, forward diffusion processing is performed on the time series window data, which may specifically include the following steps:
[0033] (1) Set the diffusion step number T and noise coefficient β y ;
[0034] (2) Calculate the noised sample using the following formula:
[0035]
[0036] Among them, x t is the noise sample at time t, x t-1 is the sample at time t-1, ε is the standard normal distribution noise, t is the current time step, t∈[1,T].
[0037] In a specific embodiment, encoding and decoding the preprocessed time series data to obtain reconstructed time series data may specifically include the following steps:
[0038] (1) The preprocessed time series data is encoded through the GRU encoder to obtain the mean μ and logarithmic variance logσ of the latent space distribution 2 ;
[0039] (2) According to the mean μ and logarithmic variance logσ of the latent space distribution 2 Perform sampling processing to obtain latent space sampling data z;
[0040] (3) The latent space sampling data z is decoded through the GRU decoder to obtain the reconstructed time series data.
[0041] In a specific embodiment, according to the mean μ and logarithmic variance logσ of the latent space distribution 2 The sampling process may specifically include the following steps:
[0042] Sampling is performed using a reparameterized algorithm based on the following formula:
[0043] z=μ+σ·τ;
[0044] Where z is the latent space data obtained by sampling, τ is the standard normal distribution noise, σ=exp(0.5·logσ 2 ).
[0045] Specifically, the GRU (Gated Recurrent Unit) encoder encodes the preprocessed time series data. GRU is a special recurrent neural network structure that can effectively capture long-term dependencies in time series data. The GRU encoder controls the flow of information by updating gates and resetting gates, thereby retaining important information and filtering irrelevant information in long sequences. The encoding process maps the input time series data to the latent space and obtains the mean and logarithmic variance of the latent space distribution. Sampling is performed based on the obtained mean and logarithmic variance. This step uses the reparameterization technique, which is the key innovation of the variational autoencoder. The reparameterization technique allows the model to introduce randomness while maintaining differentiability, so that the entire network can be trained end-to-end through backpropagation. Specifically, the sampling process uses random noise from a standard normal distribution, combined with the learned mean and variance, to generate sampling points in the latent space. This method not only ensures the randomness of the sampling, but also allows the gradient to be smoothly propagated forward through the sampling operation.
[0046] Finally, the GRU decoder decodes the sampled latent space data and reconstructs the original time series data. The structure of the decoder is similar to that of the encoder and also uses GRU units, but its task is to remap the low-dimensional latent space representation to the original high-dimensional space. During the decoding process, the GRU decoder gradually generates each time step of the time series data and uses the latent space information to reconstruct a time series sequence similar to the original data. The entire encoding-sampling-decoding process constitutes a complete variational autoencoder framework, which is particularly effective when processing time series data because it can not only learn the compressed representation of the data, but also capture the time series dependencies.
[0047] In a specific embodiment, calculating the loss value according to the reconstructed time series data to obtain the total loss may specifically include the following steps:
[0048] (1) Calculate the reconstruction loss L recon :
[0049]
[0050] Among them, x i is the original data, x′ i is the reconstructed data, n is the data dimension;
[0051] (2) Calculate the distribution loss L KL :
[0052]
[0053] Among them, μ i is the mean of the ith latent space distribution, is the logarithmic variance corresponding to the i-th latent space distribution;
[0054] (3) Calculate the noise prediction loss L noise :
[0055]
[0056] Among them, ε t,i is the actual noise, ε′ t,i To predict noise;
[0057] (4) Calculate the total loss L total :
[0058] L total =λ 1 ·L recon +λ 2 ·L KL +λ 3 ·L noise +λ 4 ·∥θ∥ 2 ;
[0059] Among them, λ 1 ,λ 2 ,λ 3 ,λ 4 is the weight coefficient, ∥θ∥ 2 is the L2 regularization term, and θ is the model parameter of the preset anomaly detection model.
[0060] Specifically, the reconstruction loss measures the difference between the original data and the reconstructed data. It is calculated using the mean square error (MSE), which sums the squares of the difference between the original value and the reconstructed value of each data point, and then divides it by the data dimension to get the average value. This loss reflects the ability of the model to reconstruct the original data. The smaller the loss, the better the reconstruction effect. The distribution loss is calculated based on the Kullback-Leibler (KL) divergence, which measures the difference between the latent space distribution and the standard normal distribution. This loss term encourages the model to learn a regular latent space distribution, which helps to generate more diverse and coherent samples. The calculation of the KL divergence involves the mean and logarithmic variance of the latent space distribution, and the distribution alignment is achieved by penalizing the deviation of these parameters from the standard normal distribution.
[0061] The noise prediction loss is designed for the diffusion model part. It measures the difference between the model's predicted noise and the actual added noise. This loss is calculated using the mean squared error, with the aim of improving the model's performance at different noise levels and enhancing its ability to recognize various abnormal patterns. Finally, the total loss is the weighted sum of the above three losses, plus an L2 regularization term. The weight coefficient is used to balance the importance of different loss terms and can be adjusted according to specific task requirements. The L2 regularization term prevents overfitting and improves the generalization ability of the model by penalizing the size of the model parameters.
[0062] In practical applications, the calculation and optimization process of these losses is iterative. After each forward propagation, these losses are calculated, and then the gradients are calculated through the backpropagation algorithm, and the model parameters are updated using an optimizer (such as Adam). This process is repeated many times until the model converges or reaches a preset stopping condition.
[0063] For example: Suppose there is an industrial cooling system that records three parameters: temperature, pressure, and flow rate every minute. After preprocessing and encoding-decoding process, the original data and reconstructed data within a time window are obtained. Assuming the window size is 60 and the feature dimension is 3, then the data dimension n is 180 (60×3). When calculating the reconstruction loss, the square of the difference between the original value and the reconstructed value is calculated for each data point, and then the sum is divided by 180. For example, if the original value of the temperature in the first time step is 0.5 and the reconstructed value is 0.48, then the contribution of this point is (0.5-0.48) 2 = 0.0004. Perform this calculation for all 180 points and sum them up, and finally divide by 180 to get the average value.
[0064] For the distribution loss, assuming the latent space dimension is 32, the KL divergence over 32 dimensions needs to be calculated and summed. For example, if the mean of the first dimension is 0.1 and the log variance is -0.5, then the KL divergence contribution of this dimension is exp(-0.5)+0.1 2-1 + 0.5 = 0.135. Repeat this calculation for 32 dimensions and sum them, then multiply by 0.5 to get the distribution loss.
[0065] The calculation of noise prediction loss is similar to reconstruction loss, but the predicted noise is compared with the actual noise. For example, if the actual noise at a time step is 0.05 and the predicted noise is 0.06, then the contribution of this point is (0.05-0.06) 2 =0.0001.
[0066] Finally, assume that the reconstruction loss weight is set to 0.8, the distribution loss weight is set to 0.1, the noise prediction loss weight is set to 0.05, and the L2 regularization weight is set to 0.05. Multiply each loss term by the corresponding weight, and add the L2 regularization term (assuming that the L2 norm square of the model parameters is 10) to get the total loss.
[0067] In a specific embodiment, optimizing the preset anomaly detection model parameters according to the total loss to obtain the anomaly detection model may specifically include the following steps:
[0068] (1) Calculate the gradient of the loss function with respect to each parameter through the back propagation algorithm to obtain the gradient parameter set;
[0069] (2) Based on the gradient parameter set, the model parameters are updated through the Adam optimizer:
[0070]
[0071] Among them, θ t is the parameter at time t, θ t-1 is the parameter at time t-1, η is the learning rate, m t and v t are the first-order and second-order momentum estimates respectively, and ∈ is a constant.
[0072] Specifically, the gradient is calculated by the back-propagation algorithm, and the model parameters are updated using the Adam optimizer. First, the back-propagation algorithm is a standard method for calculating gradients in deep learning. It uses the chain rule to start from the loss function and calculate the partial derivatives of each parameter with respect to the loss layer by layer. This process takes advantage of the structure of the computational graph to effectively calculate the gradients of all parameters. In this method, the back-propagation algorithm calculates the gradient of the total loss function for all parameters in the model. This includes the weights and biases of the GRU encoder and decoder, as well as the parameters used to calculate the latent space distribution. The resulting set of gradients reflects the degree of influence of each parameter on the total loss and guides the direction and magnitude of parameter updates.
[0073] After obtaining the gradient, the Adam optimizer is used to update the model parameters. The Adam optimizer is an optimization algorithm with adaptive learning rate, which combines the advantages of the momentum method and RMSprop. It maintains the first-order moment estimate (moving average) and the second-order moment estimate (square of the moving average) of each parameter, and uses these estimates to adjust the learning rate of each parameter. This method can effectively handle sparse gradients, and can adaptively adjust the learning rate to accelerate the convergence process. The update rule of the Adam optimizer includes calculating the first-order moment estimate and the second-order moment estimate, and then using these estimates to update the parameters. The first-order moment estimate represents the exponential moving average of the gradient, while the second-order moment estimate reflects the exponential moving average of the square of the gradient. These two estimates together determine the direction and step size of the parameter update. In practical applications, this optimization process is iterative. After each batch of data is processed, the loss is calculated, the gradient is obtained by backpropagation, and finally the parameters are updated using the Adam optimizer. This process is repeated many times until the model performance reaches the expected level or no longer improves significantly.
[0074] For example: suppose that in an anomaly detection task for an industrial cooling system, the model contains a GRU layer with 64 hidden units. In a certain iteration, for a certain weight parameter of the GRU layer, the gradient value calculated by the backpropagation algorithm is 0.05. The Adam optimizer will first update the first-order moment estimate and the second-order moment estimate of this parameter. Assuming that the current number of iterations is 100, the update of the first-order moment estimate may change from 0.02 to 0.023, and the second-order moment estimate may change from 0.001 to 0.00105. The Adam optimizer will then use these updated estimates to calculate the update amount of the parameter. If the learning rate is set to 0.001, the update amount of this parameter may be about -0.0002. This means that the value of the parameter will decrease by 0.0002. This seemingly small adjustment, accumulated over the entire training process, can significantly improve the performance of the model.
[0075] In this way, the model is able to gradually adjust its parameters to better capture the characteristics and abnormal patterns of industrial equipment time series data. For example, during the training process, the model may gradually learn to pay more attention to the correlation between temperature and pressure, or recognize that certain specific time patterns indicate potential failures. This optimization process enables the model to adapt to specific industrial equipment and operating environments, improving the accuracy and reliability of anomaly detection.
[0076] In a specific embodiment, performing anomaly detection on real-time test data according to an anomaly detection model may specifically include the following steps:
[0077] (1) Reconstruct the real-time test data to obtain the reconstruction error;
[0078] (2) Determine the abnormal threshold based on the reconstruction error:
[0079] threshold=threshold init +α·(max(RE test )-threshold init );
[0080] Among them, threshold is the final abnormal threshold, threshold init is the initial abnormal threshold, α is the fine-tuning coefficient, RE test is the reconstruction error of the test data;
[0081] (3) Perform threshold judgment processing on the reconstruction error according to the abnormal threshold to obtain the abnormal detection result.
[0082] Specifically, the reconstruction of real-time test data is the process of encoding and decoding new, unseen data using a trained model. This step uses the previously trained GRU variational autoencoder to map the test data to a latent space, and then reconstructs the original data space from the latent space. The reconstruction error is the difference between the original test data and the reconstructed data, and is usually calculated using the mean square error (MSE). The reconstruction error is calculated for each time step and each feature dimension, and then the average is taken. For example, for an industrial cooling system with three features: temperature, pressure, and flow, if the original data at a certain time step is [0.5, 0.3, 0.7] and the reconstructed data is [0.48, 0.31, 0.69], then the reconstruction error at this time step is the average of the sum of the squares of the differences between these three values. Calculating this error for all time steps gives the reconstruction error for the entire test sequence.
[0083] Determining the anomaly threshold based on the reconstruction error is a key step. This process uses a dynamic threshold adjustment method that combines the characteristics of the preliminary threshold and the test data. The preliminary threshold is usually set based on the reconstruction error distribution of the training data. For example, the 99.9% quantile of the reconstruction error of the training data can be selected as the preliminary threshold. The fine-tuning coefficient is a value between 0 and 1 that controls the degree of threshold adjustment. The maximum reconstruction error of the test data is used to capture possible abnormal patterns in the test data. The advantage of this dynamic threshold adjustment method is that it can adapt to different operating conditions and data distributions. For example, if there is a larger fluctuation in the test data than in the training data (but not necessarily anomaly), this method can appropriately increase the threshold to reduce the possibility of false positives. On the contrary, if the fluctuation of the test data is small, the threshold will be reduced accordingly to improve the detection sensitivity. Finally, the reconstruction error is judged according to the determined abnormal threshold to obtain the anomaly detection result. This process is usually performed point by point or window by window. For each time point or time window, if its reconstruction error exceeds the set threshold, it is marked as anomaly. Additional rules can be introduced here to improve the reliability of detection, such as requiring multiple consecutive points to exceed the threshold before marking as anomaly, or considering the comprehensive situation of multiple features.
[0084] For example, suppose an industrial cooling system records temperature, pressure, and flow data every minute. After the model is trained, it performs anomaly detection on real-time data for one day (1440 time points). First, the data at each time point is reconstructed. Suppose at a certain time point, the original data is [0.7, 0.4, 0.6] (normalized), and the reconstructed data is [0.68, 0.41, 0.59]. Then the reconstruction error at this time point is ((0.7-0.68) 2 +(0.4-0.41) 2 +(0.6-0.59) 2 ) / 3≈0.0002. After calculating the reconstruction error for all 1440 time points, assume that the maximum reconstruction error is 0.05. The initial threshold (based on the training data) is set to 0.01, and the fine-tuning coefficient is set to 0.2. Then, the anomaly threshold is calculated as: 0.01+0.2×(0.05-0.01)=0.018.
[0085] The reconstruction error at each time point is judged using this threshold of 0.018. Assuming that at the 1000th time point, the reconstruction error suddenly rises to 0.025, exceeding the threshold of 0.018, this time point will be marked as abnormal. Further analysis may reveal that the abnormal increase in temperature data at this time point may indicate a failure in the cooling system. In this way, the method can promptly detect abnormal conditions in the operation of industrial equipment, providing an important basis for preventive maintenance and fault diagnosis, thereby improving equipment reliability and production efficiency.
[0086] The above describes the method for detecting anomaly of industrial equipment timing sequence in the embodiment of the present application. The following describes the device for detecting anomaly of industrial equipment timing sequence in the embodiment of the present application. Figure 2 In the embodiment of the present application, an embodiment of the device for detecting abnormality of timing of industrial equipment includes:
[0087] The processing module 201 is used to preprocess the collected industrial equipment time series data to obtain preprocessed time series data;
[0088] The encoding module 202 is used to encode and decode the preprocessed time series data to obtain reconstructed time series data;
[0089] A calculation module 203 is used to calculate the loss value according to the reconstructed time series data to obtain the total loss;
[0090] An optimization module 204 is used to optimize the preset anomaly detection model parameters according to the total loss to obtain an anomaly detection model;
[0091] The detection module 205 is used to perform anomaly detection on the real-time test data according to the anomaly detection model to obtain anomaly detection results.
[0092] Through the synergy of the above components, the influence of different sensor data dimensions is effectively eliminated by preprocessing the time series data of industrial equipment, including minimum-maximum normalization and sliding window processing, while capturing the local characteristics of the time series data, laying the foundation for subsequent anomaly detection. The preprocessed data is encoded and decoded, and the powerful feature extraction capability of the GRU variational autoencoder is used to effectively capture the long-term dependencies of the time series data and improve the robustness of the model by introducing randomness. This encoding-decoding structure enables the model to learn a low-dimensional representation of the data, which helps to discover potential abnormal patterns. In the calculation of the loss function, the reconstruction loss, distribution loss and noise prediction loss are combined. This multi-objective optimization strategy enables the model to learn a more regular latent space distribution while maintaining the reconstruction accuracy, enhancing the generation ability and generalization of the model. The model parameters are optimized by the back-propagation algorithm and the Adam optimizer, which not only accelerates the convergence process of the model, but also improves the performance of the model when processing complex nonlinear time series data. Finally, in the anomaly detection stage, a dynamic threshold adjustment method is adopted, which combines the characteristics of the preliminary threshold and the test data, so that the model can adapt to different operating conditions and data distributions, improving the flexibility and accuracy of anomaly detection.
[0093] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for detecting timing anomalies of industrial equipment, characterized in that: The following steps are involved: Preprocessing the collected time series data of industrial equipment to obtain preprocessed time series data; Encoding and decoding the preprocessed time series data to obtain reconstructed time series data; Calculating the loss value according to the reconstructed time series data to obtain the total loss; Optimizing preset anomaly detection model parameters according to the total loss to obtain an anomaly detection model; Anomaly detection is performed on the real-time test data according to the anomaly detection model to obtain an anomaly detection result.
2. The method according to claim 1, characterized in that: The collected time series data of industrial equipment is preprocessed to obtain preprocessed time series data, including: Performing minimum-maximum normalization processing on the industrial equipment time series data to obtain normalized time series data; Performing sliding window processing on the normalized time series data to obtain multiple time series window data; The time series window data is forward diffused to obtain a pure Gaussian noise sequence, and the pure Gaussian noise sequence is used as the preprocessed time series data.
3. The method according to claim 2, characterized in that The step of performing forward diffusion processing on the time series window data includes: Set the diffusion step number T and noise coefficient β t ; The noised samples are calculated using the following formula: Among them, x t is the noise sample at time t, x t-1 is the sample at time t-1, ε is the standard normal distribution noise, t is the current time step, t∈[1,T].
4. The method according to claim 1, characterized in that The preprocessed time series data is encoded and decoded to obtain reconstructed time series data, including: The preprocessed time series data is encoded by the GRU encoder to obtain the mean μ and logarithmic variance logσ of the latent space distribution. 2 ; According to the mean μ and logarithmic variance logσ of the latent space distribution 2 Perform sampling processing to obtain latent space sampling data z; The latent space sampling data z is decoded by a GRU decoder to obtain reconstructed time series data.
5. The method according to claim 4, characterized in that According to the mean μ and logarithmic variance logσ of the latent space distribution 2 Perform sampling processing, including: Sampling is performed using a reparameterized algorithm based on the following formula: z=μ+σ·τ; Where z is the latent space data obtained by sampling, τ is the standard normal distribution noise, σ=exp(0.5·logσ 2 ).
6. The method according to claim 1, characterized in that The loss value is calculated according to the reconstructed time series data to obtain the total loss, including: Calculate the reconstruction loss L recon : Among them, x i is the original data, x′ i is the reconstructed data, n is the data dimension; Calculate the distribution loss L KL : Among them, μ i is the mean of the ith latent space distribution, is the logarithmic variance corresponding to the i-th latent space distribution; Calculate the noise prediction loss L noise : Among them, ε t,i is the actual noise, ε′ t,i To predict noise; Calculate the total loss L total : L total =λ1·L recon +λ2·L KL +λ3·L noise +λ4·||θ||2; Among them, λ1, λ2, λ3, λ4 are weight coefficients, ||θ||2 is the L2 regularization term, and θ is the model parameter of the preset anomaly detection model.
7. The method according to claim 1, characterized in that The preset anomaly detection model parameters are optimized according to the total loss to obtain an anomaly detection model, including: The gradient of the loss function to each parameter is calculated through the back propagation algorithm to obtain the gradient parameter set; Based on the gradient parameter set, the model parameters are updated by the Adam optimizer: Among them, θ t is the parameter at time t, θ t-1 is the parameter at time t-1, η is the learning rate, m t and v t are the first-order and second-order momentum estimates respectively, and ∈ is a constant.
8. The method according to claim 1, characterized in that Performing anomaly detection on real-time test data according to the anomaly detection model includes: Reconstruct the real-time test data to obtain the reconstruction error; Determine the abnormal threshold value according to the reconstruction error: threshold=threshold init +α·(max(RE test )-threshold init ); Among them, threshold is the final abnormal threshold, threshold init is the initial abnormal threshold, α is the fine-tuning coefficient, RE test is the reconstruction error of the test data; The reconstruction error is subjected to threshold judgment processing according to the abnormal threshold to obtain an abnormality detection result.
9. An industrial equipment timing anomaly detection device, used to implement the industrial equipment timing anomaly detection method according to any one of claims 1 to 8, characterized in that: The industrial equipment timing anomaly detection device comprises: A processing module, used for preprocessing the collected time series data of industrial equipment to obtain preprocessed time series data; An encoding module, used for encoding and decoding the preprocessed time series data to obtain reconstructed time series data; A calculation module, used to calculate the loss value according to the reconstructed time series data to obtain the total loss; An optimization module, used for optimizing preset anomaly detection model parameters according to the total loss to obtain an anomaly detection model; The detection module is used to perform anomaly detection on the real-time test data according to the anomaly detection model to obtain anomaly detection results.
Citation Information
Patent Citations
Time sequence anomaly detection method and equipment based on variational self-encoding time sequence decomposition
CN114626479A
Unsupervised track anomaly detection method and system based on GRU-VAE model
CN114997296A
Industrial control system-oriented anomaly detection system and method
CN115484102A
Time sequence state data reconstruction method of industrial equipment and related device
CN116662811A
Variable auto-encoder power battery anomaly detection method, system and device and storage medium
CN117074961A
Cited By
Data cleaning method and device and electronic equipment
CN121681210A