Industrial equipment time series anomaly detection method and device
Patent Information
- Application Number
- CN202411528988.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2044-10-30
AI Technical Summary
现有方法在处理错误标记的数据或未标记异常时的抗噪声能力不足,同时在平衡模型的可解释性和有效性方面也存在困难
[0007]本申请提供的技术方案中,通过对工业设备时序数据进行预处理,包括最小-最大标准化和滑动窗口处理,有效消除了不同传感器数据量纲的影响,同时捕捉了时序数据的局部特征,为后续的异常检测奠定了基础。预处理后的数据经过编码和解码处理,利用GRU变分自编码器的强大特征提取能力,不仅能够有效捕捉时序数据的长期依赖关系,还通过引入随机性提高了模型的鲁棒性。这种编码-解码结构使得模型能够学习到数据的低维表示,有助于发现潜在的异常模式。在损失函数的计算中,结合了重构损失、分布损失和噪声预测损失,这种多目标优化策略使得模型在保持重构准确性的同时,也能学习到更加规整的潜空间分布,增强了模型的生成能力和泛化性。通过反向传播算法和Adam优化器对模型参数进行优化,不仅加速了模型的收敛过程,还提高了模型在处理复杂非线性时序数据时的性能。最后,在异常检测阶段,采用动态阈值调整方法,结合了初步阈值和测试数据的特性,使得模型能够适应不同的运行条件和数据分布,提高了异常检测的灵活性和准确性。
Smart Images

Figure CN119414813B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and in particular to a method and apparatus for detecting timing anomalies in industrial equipment. Background Technology
[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 Internet of Things (IoT) ecosystem can collect vast amounts 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, mainly categorized into prediction-based, reconstruction-based, representation-based, and hybrid methods.
[0003] However, existing deep learning-based anomaly detection methods still face numerous challenges. Due to the scarcity and imbalance of anomaly data, as well as the diversity and uncertainty of anomaly types, existing methods often suffer from low anomaly detection recall. Furthermore, in high-dimensional spaces, anomaly features often become hidden and difficult to detect. Efficient learning for semi-supervised or weakly supervised anomaly detection based on limited labeled anomaly data is also a major challenge. Existing methods lack robustness to noise when dealing with mislabeled data or unlabeled anomalies, and also struggle to balance model interpretability and effectiveness. Particularly with time-series data from industrial equipment, the generalization and robustness of existing models remain relatively low due to the complex and variable environment. Summary of the Invention
[0004] This application provides a method and apparatus for detecting timing anomalies in industrial equipment, which improves the accuracy of timing anomaly detection in industrial equipment.
[0005] In a first aspect, this application provides a method for detecting timing anomalies in industrial equipment. The method includes: preprocessing 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; and performing anomaly detection on real-time test data based on the anomaly detection model to obtain an anomaly detection result.
[0006] Secondly, this application provides an industrial equipment timing anomaly detection device, which includes: a processing module for preprocessing collected industrial equipment timing data to obtain preprocessed timing data; an encoding module for encoding and decoding the preprocessed timing data to obtain reconstructed timing data; a calculation module for calculating a loss value based on the reconstructed timing data to obtain a total loss; an optimization module for optimizing preset anomaly detection model parameters based on the total loss to obtain an anomaly detection model; and a detection module for performing anomaly detection on real-time test data based on the anomaly detection model to obtain anomaly detection results.
[0007] The technical solution provided in this application effectively eliminates the influence of different sensor data dimensions by preprocessing industrial equipment time-series data, including min-max normalization and sliding window processing, while capturing local features of the time-series data, laying the foundation for subsequent anomaly detection. The preprocessed data undergoes encoding and decoding, utilizing the powerful feature extraction capabilities of the GRU variational autoencoder to not only effectively capture long-term dependencies in the time-series data but also improve the model's robustness by introducing randomness. This encoding-decoding structure enables the model to learn a low-dimensional representation of the data, facilitating the discovery of potential anomaly patterns. The loss function calculation combines reconstruction loss, distribution loss, and noise prediction loss. This multi-objective optimization strategy allows the model to maintain reconstruction accuracy while learning a more regular latent space distribution, enhancing the model's generative ability and generalization. Optimizing the model parameters through the backpropagation algorithm and the Adam optimizer not only accelerates the model's convergence process but also improves its performance when processing complex nonlinear time-series data. Finally, in the anomaly detection phase, a dynamic threshold adjustment method is adopted, which combines the characteristics of the initial threshold and the test data, enabling the model to adapt to different operating conditions and data distributions, thereby improving the flexibility and accuracy of anomaly detection. Attached Figure Description
[0008] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0009] Figure 1 This is a schematic diagram of one embodiment of the industrial equipment timing anomaly detection method in this application.
[0010] Figure 2 This is a schematic diagram of one embodiment of the industrial equipment timing anomaly detection device in this application. Detailed Implementation
[0011] This application provides a method and apparatus for detecting timing anomalies in industrial equipment. The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0012] For ease of understanding, the specific process of the embodiments of this application is described below. Please refer to [link / reference]. Figure 1 One embodiment of the industrial equipment timing anomaly detection method in this application includes:
[0013] Step S101: Preprocess the collected industrial equipment time series data to obtain preprocessed time series data;
[0014] Step S102: Encode and decode the preprocessed time series data to obtain the reconstructed time series data;
[0015] Step S103: Calculate the loss value based on the reconstructed time series data to obtain the total loss;
[0016] Step S104: Optimize the preset anomaly detection model parameters based on the total loss to obtain the anomaly detection model;
[0017] Step S105: Perform anomaly detection on the real-time test data according to the anomaly detection model to obtain the anomaly detection results.
[0018] It is understood that the executing entity of this application can be an industrial equipment timing anomaly detection device, or it can be a terminal or a server; the specific implementation is not limited here. This application's embodiments use a server as an example for illustration.
[0019] Specifically, the collected time-series data of industrial equipment undergoes preprocessing. This step includes data standardization and sliding window processing. Data standardization uses a min-max standardization method to scale the data to a range of 0 to 1, eliminating the influence of different sensor data units. Sliding window processing divides the time-series data into fixed-size windows to capture local features. For example, for a time-series dataset of industrial equipment containing data from multiple sensors such as temperature, pressure, and vibration, the data from each sensor is first standardized, and then processed using a sliding window with a size of 10 and a step size of 1.
[0020] The preprocessed time-series data undergoes encoding and decoding. This step is implemented using a GRU variational autoencoder. The encoder maps the input data to the latent space, obtaining the mean and log-variance of the latent space distribution. The decoder samples from the latent space to reconstruct the original data. In this process, the idea of a diffusion model is introduced, enhancing the model's generalization ability by progressively adding noise and performing inverse denoising. The GRU (Gated Recurrent Unit) network effectively captures long-term dependencies in the time-series data, while the variational autoencoder improves the model's robustness 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 the reconstruction loss, KL divergence loss, and noise prediction loss from the diffusion model. The reconstruction loss measures the difference between the original and reconstructed data, typically calculated using mean squared error. The KL divergence loss ensures that the latent space distribution approximates a standard normal distribution, contributing to the generation of diverse samples. The noise prediction loss optimizes the diffusion model, improving its performance under different noise levels. These three losses are weighted and summed to obtain the total loss; the weights can be adjusted according to the specific application scenario.
[0021] The pre-set anomaly detection model parameters are optimized based on the total loss to obtain the anomaly detection model. The Adam optimizer is used to calculate gradients via backpropagation and update the model parameters. The Adam optimizer combines momentum and adaptive learning rate methods, effectively handling sparse gradients and non-stationary objectives. During optimization, the model parameters are continuously adjusted to minimize the total loss function. Finally, the trained anomaly detection model is used to detect anomalies on real-time test data. The specific process includes reconstructing the test data, calculating the reconstruction error, and determining whether anomalies exist based on a preset threshold. The threshold is set based on the reconstruction error distribution of the training data; typically, a high quantile (e.g., 99.9%) is chosen as the initial threshold, and then fine-tuned according to the actual application scenario.
[0022] For example, a chemical plant's reactor is equipped with multiple sensors, including those for temperature, pressure, and pH. One month of normal operation data is collected for model training. First, the data is standardized, for example, mapping temperature data from the original 0-200℃ range to the 0-1 interval. Then, a sliding window method is used to construct a time-series window, with a window size of 10 minutes and a step size of 1 minute. The processed data is encoded and decoded to obtain reconstructed data. When calculating the loss function, a higher weight is set for the reconstruction loss, and lower weights are set for the KL divergence loss and noise prediction loss to balance reconstruction accuracy and model generalization ability. After multiple rounds of iterative optimization, an anomaly detection model is obtained. In real-time monitoring, anomaly detection is performed every minute on the data from the most recent 10 minutes. If the reconstruction error exceeds a preset threshold, it is judged as an anomaly, and an alarm is promptly issued to the operators.
[0023] In this embodiment, preprocessing of industrial equipment time-series data, including min-max normalization and sliding window processing, effectively eliminates the influence of different sensor data dimensions and captures local features of the time-series data, laying the foundation for subsequent anomaly detection. The preprocessed data undergoes encoding and decoding, leveraging the powerful feature extraction capabilities of the GRU variational autoencoder. This not only effectively captures long-term dependencies in the time-series data but also improves the model's robustness by introducing randomness. This encoding-decoding structure enables the model to learn low-dimensional representations of the data, facilitating the discovery of potential anomaly patterns. The loss function combines reconstruction loss, distribution loss, and noise prediction loss. This multi-objective optimization strategy allows the model to maintain reconstruction accuracy while learning a more regular latent space distribution, enhancing its generative ability and generalization. Optimizing model parameters through backpropagation and the Adam optimizer not only accelerates the model's convergence process but also improves its performance when processing complex nonlinear time-series data. Finally, in the anomaly detection phase, a dynamic threshold adjustment method is adopted, which combines the characteristics of the initial threshold and the test data, enabling the model to adapt to different operating conditions and data distributions, thereby improving the flexibility and accuracy of anomaly detection.
[0024] In one specific embodiment, preprocessing the collected industrial equipment time-series data to obtain preprocessed time-series data may specifically include the following steps:
[0025] (1) Perform min-max standardization 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 window data to obtain a pure Gaussian noise sequence, and use the pure Gaussian noise sequence as the preprocessed time series data.
[0028] Specifically, min-max normalization aims to eliminate the influence of different sensor data dimensions, mapping all data to the same scale. Specifically, for each sensor's time series data, its minimum and maximum values are identified, and each data point is then mapped to the interval between 0 and 1. After this processing, data from different sensors can be compared and analyzed at the same scale. Next, sliding window processing is performed to capture local features and short-term dynamic changes in the time series data. The sliding window method divides a continuous time series into multiple overlapping subsequences by moving a fixed-size window along the time dimension. Window size and sliding step size are two important parameters that need to be determined based on 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 finer-grained changes but may be affected by noise. The sliding step size determines the degree of overlap between adjacent windows; smaller step sizes can provide more training samples but also increase computational complexity.
[0029] Finally, forward diffusion is performed, which enhances the model's generalization ability by progressively adding noise. The forward diffusion process is a Markov chain; starting with the original data, Gaussian noise is gradually added over multiple time steps until a pure Gaussian noise sequence is obtained. This process can be viewed as a special data augmentation technique, introducing varying levels of noise to enable the model to learn more robust feature representations. The number of forward diffusion steps and the amount of noise added at each step are hyperparameters that need to be tuned, affecting the final model's performance and generalization ability. The combination of these three preprocessing steps not only standardizes and normalizes the original data but also enhances the model's ability to identify various anomalies. Standardization makes data from different sensors comparable, the sliding window captures temporal features, while forward diffusion enhances the model's robustness by introducing controllable noise.
[0030] For example, suppose an industrial cooling system is equipped with three sensors: temperature, pressure, and flow rate, recording data every minute. A week's worth of operational data is collected, totaling 10080 data points (7 days × 24 hours × 60 minutes). First, min-max normalization is performed. For temperature data, assuming the lowest temperature is 15℃ and the highest is 35℃, a temperature data point of 28℃ will be normalized to (28-15) / (35-15) = 0.65. The pressure and flow rate data are normalized similarly. Then, a sliding window is used, setting the window size to 60 (i.e., 1 hour of data) and the sliding step size to 10. Thus, the first window contains data from minute 1 to minute 60, the second window contains data from minute 11 to minute 70, and so on. A total of (10080-60) / 10+1 = 1003 windows will be generated.
[0031] Finally, forward diffusion is performed, with a diffusion step count of 100. For each window's data, Gaussian noise is progressively added from t=1 to t=100. For example, for the temperature data in the first window, Gaussian noise with a mean of 0 and a standard deviation of 0.01 might be added at t=1; Gaussian noise with a mean of 0 and a standard deviation of 0.05 might be added at t=50; and Gaussian noise with a mean of 0 and a standard deviation of 0.1 might be added at t=100. This process is repeated for all windows and all sensor data.
[0032] In one specific embodiment, the forward diffusion processing of time-series window data may specifically include the following steps:
[0033] (1) Set the diffusion step number T and noise figure β y ;
[0034] (2) Calculate the noisy sample using the following formula:
[0035]
[0036] Where, x t Let x be the noisy sample at time t. t-1 Let be the sample at time t-1, ε be the standard normal distribution noise, t be the current time step, and t∈[1,T].
[0037] In one 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 using a GRU encoder to obtain the mean μ and log-variance logσ of the latent space distribution. 2 ;
[0039] (2) Based on the mean μ and log-variance logσ of the latent space distribution 2 Sampling processing is performed to obtain latent space sampling data z;
[0040] (3) The latent space sampled data z is decoded by the GRU decoder to obtain the reconstructed time series data.
[0041] In one specific embodiment, based on the mean μ and log-variance logσ of the latent space distribution 2 Sampling processing can specifically include the following steps:
[0042] Sampling is performed using a reparameterization algorithm based on the following formula:
[0043] z = μ + σ·τ;
[0044] Where z is the latent space data obtained from sampling, τ is the standard normal distribution noise, and σ = exp(0.5·logσ) 2 ).
[0045] Specifically, the GRU (Gated Recurrent Unit) encoder encodes the preprocessed temporal data. GRU is a special recurrent neural network structure capable of effectively capturing long-term dependencies in temporal data. The GRU encoder controls the information flow by updating and resetting gates, thus preserving important information and filtering out irrelevant information in long sequences. The encoding process maps the input temporal data to a latent space, obtaining the mean and log-variance of the latent space distribution. Sampling is then performed based on the obtained mean and log-variance; this step uses a reparameterization technique, a key innovation of the variational autoencoder. The reparameterization technique allows the model to introduce randomness while maintaining differentiability, enabling end-to-end training of the entire network 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 ensures both the randomness of sampling and allows gradients to propagate smoothly forward through the sampling operation.
[0046] Finally, the GRU decoder decodes the sampled latent space data to reconstruct the original temporal data. The decoder's structure is similar to the encoder, also using GRU units, but its task is to remap the low-dimensional latent space representation back to the original high-dimensional space. During decoding, the GRU decoder progressively generates each time step of the temporal data, using latent space information to reconstruct a temporal sequence similar to the original data. The entire encoding-sampling-decoding process constitutes a complete variational autoencoder framework. This framework is particularly effective when processing temporal data because it can not only learn the compressed representation of the data but also capture temporal dependencies.
[0047] In one specific embodiment, the loss value is calculated based on the reconstructed time-series data to obtain the total loss, which may specifically include the following steps:
[0048] (1) Calculate the reconstruction loss L recon :
[0049]
[0050] Where, x i For the original data, x′ i The data is to be reconstructed, where n is the data dimension;
[0051] (2) Calculate the distributed loss L KL :
[0052]
[0053] Where, μ i Let be the mean of the i-th latent space distribution. Let be the log-variance of the i-th latent space distribution;
[0054] (3) Calculate the noise prediction loss L noise :
[0055]
[0056] Where, ε t,i For 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] Where λ1, λ2, λ3, and λ4 are weight coefficients, ∥θ∥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 and reconstructed data. It is calculated using the mean squared error (MSE), which is the sum of the squares of the differences between the original and reconstructed values for each data point, divided by the data dimension to obtain the average. This loss reflects the model's ability to reconstruct the original data; a smaller value indicates a better reconstruction. The distribution loss, on the other hand, 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, contributing to the generation of more diverse and coherent samples. The KL divergence calculation involves the mean and log-variance of the latent space distribution; alignment is achieved by penalizing deviations of these parameters from the standard normal distribution.
[0061] The noise prediction loss is designed for the diffusion model and measures the difference between the model's predicted noise and the actual added noise. This loss is calculated using mean squared error to improve the model's performance under different noise levels and enhance its ability to identify various anomalous patterns. Finally, the total loss is a weighted sum of the three losses mentioned above, plus an L2 regularization term. The weighting coefficients are used to balance the importance of different loss terms and can be adjusted according to specific task requirements. The L2 regularization term prevents overfitting by penalizing the magnitude of the model parameters, thus improving the model's generalization ability.
[0062] In practical applications, the calculation and optimization of these losses are performed iteratively. After each forward propagation, these losses are calculated, the gradients are then calculated using 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 an industrial cooling system records three parameters every minute: temperature, pressure, and flow rate. After preprocessing and encoding-decoding, the system obtains raw and reconstructed data within a time window. Assuming a window size of 60 and a feature dimension of 3, the data dimension n is 180 (60 × 3). To calculate the reconstruction loss, the square of the difference between the raw and reconstructed values for each data point is calculated, summed, and then divided by 180. For example, if the raw temperature value at 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 on all 180 points and sum them up, then divide by 180 to get the average.
[0064] For distributed loss, assuming the latent space has 32 dimensions, we need to calculate and sum the KL divergences across all 32 dimensions. For example, if the mean of the first dimension is 0.1 and the log-variance is -0.5, then the KL divergence contribution for this dimension is exp(-0.5) + 0.1. 2-1 + 0.5 = 0.135. Repeat this calculation for all 32 dimensions and sum the results, then multiply by 0.5 to obtain the distribution loss.
[0065] The calculation of noise prediction loss is similar to that of reconstruction loss, but it compares the predicted noise with the actual noise. For example, if the actual noise at a certain time step is 0.05 and the predicted noise is 0.06, then the contribution at that point is (0.05-0.06). 2 =0.0001.
[0066] Finally, assuming the reconstruction loss weight is set to 0.8, the distribution loss weight to 0.1, the noise prediction loss weight to 0.05, and the L2 regularization weight to 0.05, the total loss is obtained by multiplying each loss term by its corresponding weight and adding the L2 regularization term (assuming the L2 norm squared of the model parameters is 10).
[0067] In one specific embodiment, optimizing the preset anomaly detection model parameters based on the total loss to obtain the anomaly detection model can specifically include the following steps:
[0068] (1) Calculate the gradient of the loss function with respect to each parameter using the backpropagation algorithm to obtain the gradient parameter set;
[0069] (2) Update model parameters using the Adam optimizer based on the gradient parameter set:
[0070]
[0071] Where, θ t Let θ be the parameter at time t. t-1 Let be the parameters at time t-1, η be the learning rate, and m be the parameter. t and v t These are the first-order and second-order momentum estimates, respectively, where ∈ is a constant.
[0072] Specifically, gradients are calculated using the backpropagation algorithm, and model parameters are updated using the Adam optimizer. First, backpropagation is a standard method for calculating gradients in deep learning. It uses the chain rule to calculate the partial derivative of each parameter with respect to the loss function layer by layer. This process leverages the structure of the computation graph to efficiently compute the gradients of all parameters. In this method, backpropagation calculates the gradient of the total loss function with respect to 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, guiding 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 adaptive learning rate optimization algorithm that combines the advantages of momentum and RMSprop. It maintains a first-moment estimate (moving average) and a second-moment estimate (squared moving average) for each parameter, using these estimates to adjust the learning rate for each parameter. This method effectively handles sparse gradients and adaptively adjusts the learning rate, accelerating the convergence process. The update rule of the Adam optimizer involves calculating the first-moment and second-moment estimates, and then using these estimates to update the parameters. The first-moment estimate represents the exponential moving average of the gradient, while the second-moment estimate reflects the exponential moving average of the squared gradient. These two estimates together determine the direction and step size of the parameter updates. In practice, this optimization process is iterative. After processing each batch of data, the loss is calculated, the gradient is obtained through 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 a model in an anomaly detection task for an industrial cooling system contains a GRU layer with 64 hidden units. In a certain iteration, the gradient calculated by the backpropagation algorithm for a certain weight parameter of the GRU layer is 0.05. The Adam optimizer will first update the first-moment and second-moment estimates of this parameter. Assuming the current iteration number is 100, the first-moment estimate might be updated from 0.02 to 0.023, and the second-moment estimate might be updated from 0.001 to 0.00105. Then, the Adam optimizer will use these updated estimates to calculate the parameter update. If the learning rate is set to 0.001, the parameter update might be approximately -0.0002. This means the parameter value will decrease by 0.0002. This seemingly small adjustment, accumulated throughout the training process, can significantly improve the model's performance.
[0075] In this way, the model can progressively adjust its parameters to better capture the characteristics and anomaly patterns of industrial equipment time-series data. For example, during training, the model may gradually learn to pay more attention to the correlation between temperature and pressure, or identify certain time patterns that indicate potential faults. This optimization process allows the model to adapt to specific industrial equipment and operating environments, improving the accuracy and reliability of anomaly detection.
[0076] In one specific embodiment, anomaly detection of real-time test data based on 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 anomaly threshold based on the reconstruction error:
[0079] threshold = threshold init +α·(max(RE test -threshold init );
[0080] Where threshold is the final outlier threshold. init The initial anomaly threshold is α, which is the fine-tuning coefficient, and RE is... test This refers to the reconstruction error of the test data;
[0081] (3) The reconstruction error is judged based on the abnormal threshold to obtain the abnormal detection result.
[0082] Specifically, reconstructing real-time test data involves encoding and decoding new, unseen data using a trained model. This step uses a previously trained GRU variational autoencoder to map the test data into 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, typically calculated using the mean squared error (MSE). The reconstruction error is calculated for each time step and each feature dimension, and then averaged. For example, for an industrial cooling system containing three features: temperature, pressure, and flow rate, 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 for that time step is the average of the squares of the differences between these three values. Calculating this error for all time steps yields the reconstruction error for the entire test sequence.
[0083] Determining the anomaly threshold based on the reconstruction error is a crucial step. This process employs a dynamic threshold adjustment method, combining an initial threshold with the characteristics of the test data. The initial threshold is typically set based on the reconstruction error distribution of the training data; for example, the 99.9th percentile of the reconstruction error in the training data can be chosen as the initial threshold. The fine-tuning coefficient, a value between 0 and 1, controls the degree of threshold adjustment. The maximum reconstruction error of the test data is used to capture potential anomaly patterns in the test data. The advantage of this dynamic threshold adjustment method is its adaptability to different operating conditions and data distributions. For example, if the test data shows larger fluctuations than the training data (but not necessarily anomalies), this method can appropriately increase the threshold to reduce the possibility of false alarms. Conversely, if the fluctuations in the test data are smaller, the threshold will be lowered accordingly to improve detection sensitivity. Finally, the reconstruction error is judged based on the determined anomaly 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 an 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 an anomaly, or considering the combined situation of multiple features.
[0084] For example, suppose an industrial cooling system records temperature, pressure, and flow rate data every minute. After training, the model performs anomaly detection on a day's worth of real-time data (1440 time points). First, the data at each time point is reconstructed. Suppose that 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 the maximum reconstruction error is 0.05. Set the initial threshold (based on training data) to 0.01 and the fine-tuning coefficient to 0.2. Then, the outlier 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 a threshold of 0.018. Suppose 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 an anomaly. Further analysis may reveal an abnormally high temperature at this time point, potentially indicating a malfunction in the cooling system. In this way, the method can promptly detect anomalies in the operation of industrial equipment, providing important information for preventative maintenance and fault diagnosis, thereby improving equipment reliability and production efficiency.
[0086] The method for detecting timing anomalies in industrial equipment in the embodiments of this application has been described above. The device for detecting timing anomalies in industrial equipment in the embodiments of this application is described below. Please refer to [link / reference]. Figure 2 One embodiment of the industrial equipment timing anomaly detection device in this application includes:
[0087] The processing module 201 is used to preprocess the collected industrial equipment time series data to obtain preprocessed time series data;
[0088] Encoding module 202 is used to encode and decode the preprocessed time series data to obtain reconstructed time series data;
[0089] The calculation module 203 is used to calculate the loss value based on the reconstructed time-series data to obtain the total loss;
[0090] The optimization module 204 is used to optimize the preset anomaly detection model parameters according to the total loss to obtain the anomaly detection model;
[0091] The detection module 205 is used to perform anomaly detection on real-time test data according to the anomaly detection model and obtain anomaly detection results.
[0092] Through the collaborative efforts of the aforementioned components, preprocessing of industrial equipment time-series data, including min-max normalization and sliding window processing, effectively eliminates the influence of different sensor data dimensions while capturing local features of the time-series data, laying the foundation for subsequent anomaly detection. The preprocessed data undergoes encoding and decoding, leveraging the powerful feature extraction capabilities of the GRU variational autoencoder to effectively capture long-term dependencies in the time-series data and improve model robustness by introducing randomness. This encoding-decoding structure enables the model to learn low-dimensional representations of the data, facilitating the discovery of potential anomaly patterns. The loss function combines reconstruction loss, distribution loss, and noise prediction loss; this multi-objective optimization strategy allows the model to maintain reconstruction accuracy while learning a more regular latent space distribution, enhancing its generative ability and generalization. Optimizing model parameters through backpropagation and the Adam optimizer not only accelerates the model's convergence process but also improves its performance when handling complex nonlinear time-series data. Finally, in the anomaly detection phase, a dynamic threshold adjustment method is adopted, which combines the characteristics of the initial threshold and the test data, enabling the model to adapt to different operating conditions and data distributions, thereby improving the flexibility and accuracy of anomaly detection.
[0093] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for detecting timing anomalies in industrial equipment, characterized in that, Includes the following steps: The collected industrial equipment time-series data is preprocessed to obtain preprocessed time-series data; The preprocessed time series data is encoded and decoded to obtain the reconstructed time series data; The total loss is obtained by calculating the loss value based on the reconstructed time-series data; The preset anomaly detection model parameters are optimized based on the total loss to obtain the anomaly detection model; Anomaly detection is performed on the real-time test data based on the anomaly detection model to obtain anomaly detection results; The total loss is calculated based on the reconstructed time-series data, including: Calculate reconstruction loss : ; in, This is the original data. The data is to be reconstructed, where n is the data dimension; Calculate distributed loss : ; in, For the first The mean of a latent space distribution, For the first The log-variance corresponding to each latent space distribution; Calculate noise prediction loss : ; in, This is the actual noise. To predict noise; Calculate total loss : ; in, , , , These are the weighting coefficients. For L2 regularization terms, These are the model parameters of a pre-defined anomaly detection model; the noise prediction loss is used to measure the difference between predicted noise and actual noise.
2. The method according to claim 1, characterized in that, The collected industrial equipment time-series data is preprocessed to obtain preprocessed time-series data, including: The time series data of the industrial equipment is subjected to min-max normalization to obtain normalized time series data. The normalized time-series data is processed by a sliding window to obtain multiple time-series window data. The time-series window data is subjected to forward diffusion processing 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 steps for performing forward diffusion processing on the time-series window data include: Set the diffusion step number T and noise figure ; The noisy sample is calculated using the following formula: ; in, Let be the noisy sample at time t. for Samples at time, For standard normally distributed noise, t For the current time step, .
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 using a GRU encoder to obtain the mean of the latent space distribution. and logarithmic variance ; Based on the mean of the latent space distribution and logarithmic variance Sampling processing is performed to obtain latent space sampling data z; The latent space sampled data z is decoded by the GRU decoder to obtain the reconstructed time series data.
5. The method according to claim 4, characterized in that, Based on the mean of the latent space distribution and logarithmic variance Sampling processing includes: Sampling is performed using a reparameterization algorithm based on the following formula: ; in, For the latent space data obtained from sampling, For standard normally distributed noise, .
6. The method according to claim 1, characterized in that, The preset anomaly detection model parameters are optimized based on the total loss to obtain the anomaly detection model, which includes: The gradient of the loss function with respect to each parameter is calculated using the backpropagation algorithm, thus obtaining the gradient parameter set. Based on the gradient parameter set, the model parameters are updated using the Adam optimizer: ; in, Let be the parameters at time t. The parameters at time t-1, For learning rate, and These are first-order and second-order momentum estimates, respectively. It is a constant.
7. The method according to claim 1, characterized in that, Anomaly detection is performed on the real-time test data based on the aforementioned anomaly detection model, including: The real-time test data is reconstructed to obtain the reconstruction error. Determine the anomaly threshold based on the reconstruction error: ; in, This is the final anomaly threshold. This is the initial abnormal threshold. For fine-tuning coefficients, This refers to the reconstruction error of the test data; The reconstruction error is subjected to threshold judgment processing based on the anomaly threshold to obtain the anomaly detection result.
8. An industrial equipment timing anomaly detection device, used to implement the industrial equipment timing anomaly detection method as described in any one of claims 1-7, characterized in that, The industrial equipment timing anomaly detection device includes: The processing module is used to preprocess the collected industrial equipment time-series data to obtain preprocessed time-series data. The encoding module is used to encode and decode the preprocessed time series data to obtain the reconstructed time series data. The calculation module is used to calculate the loss value based on the reconstructed time-series data to obtain the total loss; The optimization module is used to optimize the preset anomaly detection model parameters based on the total loss to obtain the anomaly detection model. The detection module is used to perform anomaly detection on real-time test data according to the anomaly detection model and obtain anomaly detection results; The calculation module is used to calculate the loss value based on the reconstructed time-series data to obtain the total loss, including: calculating the loss value based on the reconstructed time-series data to obtain the total loss, including: Calculate reconstruction loss : ; in, This is the original data. The data is to be reconstructed, where n is the data dimension; Calculate distributed loss : ; in, For the first The mean of a latent space distribution, For the first The log-variance corresponding to each latent space distribution; Calculate noise prediction loss : ; in, This is the actual noise. To predict noise; Calculate total loss : ; in, , , , These are the weighting coefficients. For L2 regularization terms, The noise prediction loss is used to measure the difference between the predicted noise and the actual noise, which are the model parameters of the preset anomaly detection model.
Citation Information
Patent Citations
Unsupervised track anomaly detection method and system based on GRU-VAE model
CN114997296A