Time series data anomaly detection method and device based on dynamic condition diffusion model of gradient noise
By combining gradient noise and a dynamic conditional diffusion model, the problem of insufficient reconstruction error due to Gaussian noise's inability to distinguish anomalies is solved, enabling effective detection of different types of anomalies and improving the accuracy and robustness of time series anomaly detection.
Patent Information
- Application Number
- CN202510850986.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2045-06-24
AI Technical Summary
Existing diffusion models suffer from insufficient reconstruction error in time series anomaly detection due to the inability to distinguish between normal and abnormal data caused by Gaussian noise. Furthermore, a single model is difficult to effectively capture the causal mechanisms of different types of anomalies, resulting in poor detection performance.
A dynamic conditional diffusion model based on gradient noise (GNDC-DM) was adopted to design diffusion models for trend noise, seasonal noise, and mixed anomalies. By combining gradient noise and Gaussian noise, the generation process was dynamically guided to detect trend, seasonal, and mixed anomalies, respectively.
It improves the accuracy and robustness of anomaly detection, enhances the reconstruction consistency of normal patterns through gradient noise, and dynamically guides the generation of time series that conform to normal distribution, thus significantly improving the detection performance of mixed anomalies.
Smart Images

Figure CN120632740B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of time series anomaly detection, and in particular to a time series data anomaly detection method and device based on a dynamic conditional diffusion model of gradient noise. BACKGROUND
[0002] Time series anomaly detection refers to identifying data points in a time series that significantly deviate from normal patterns. This technology is of great significance in practical applications, such as fault detection in industrial systems, financial fraud identification, automobile fault diagnosis, and early anomaly warning of mechanical equipment. Accurate detection of anomalies in time series is crucial for ensuring system operation safety, reducing risks, and avoiding significant economic losses. Since obtaining the true label of abnormal data is costly, how to detect anomalies under unsupervised conditions has become one of the main challenges of time series anomaly detection. To this end, researchers have proposed various unsupervised techniques, including autoencoders (AE), normalized flow models, graph neural networks (GNN), and Transformer-based models. These methods usually distinguish between normal and abnormal patterns by learning effective representations or reconstruction errors.
[0003] In contrast, generative models aim to learn the underlying distribution of normal time series data, thereby detecting anomalies based on generative quality or likelihood estimates. By capturing normal patterns, these models can accurately reconstruct normal samples, but have difficulty reconstructing abnormal samples, thus enabling the identification of anomalies through reconstruction errors. Among generative models, generative adversarial networks (GANs) and variational autoencoders (VAEs) have been widely explored, as they have the potential to generate realistic time series data. However, these models often face the problems of limited generative quality and unstable training, resulting in large noise and unrealistic output data, which affects the detection effect. Therefore, in recent years, researchers have proposed time series anomaly detection methods based on diffusion models. This class of methods has stronger generative ability, more stable training process, and higher quality sample reconstruction effect, making it a powerful alternative for achieving robust anomaly detection.
[0004] Despite the progress made, the current methods still have two key limitations: (1) Existing diffusion model methods mostly use Gaussian noise to perturb the input data in the forward diffusion process. However, Gaussian noise does not distinguish between normal and abnormal data, resulting in abnormal data being just as easily reconstructed as normal data during generation. Reconstruction-based anomaly detection methods rely on smoothing the abnormal points, thus producing large reconstruction errors to identify anomalies. The fundamental reason is that this noise mechanism fails to effectively suppress abnormal patterns, due to the frequency spectrum mismatch problem: Gaussian noise has uniform energy distribution in each frequency band, while anomalies in time series are often concentrated in specific frequencies, such as high-frequency spikes or mid-frequency deviations. Therefore, uniform spectral perturbation cannot selectively attenuate frequencies dominated by anomalies, thus failing to significantly increase the reconstruction error of anomalies. (2) Most methods use a unified detection model to identify different types of anomalies, resulting in poor detection performance. Time series anomalies are complex, including seasonal anomalies, trend anomalies, and mixed anomalies. A single model structure often learns intertwined representations, making it difficult to effectively capture the causal mechanisms behind these different types of anomalies. For example, seasonal anomalies require frequency-sensitive detectors, while trend anomalies rely more on robust baseline estimators. This one-size-fits-all approach is not as effective as a specialized detector tailored to specific anomaly types. SUMMARY
[0005] The Summary section of the present application is intended to introduce briefly some concepts related to the present application. These concepts will be described in more detail in the detailed description section of the present application. The Summary section is not intended to identify key or essential features of the claimed technology nor is it intended to be used to limit the scope of the claimed technology.
[0006] Some embodiments of the present application propose a time series data anomaly detection method and device based on a gradient noise-based dynamic conditional diffusion model, to solve one or more of the technical problems mentioned in the background section.
[0007] In a first aspect, some embodiments of the present application provide a time series data anomaly detection method based on a gradient noise dynamic conditional diffusion model, the method comprising: determining a GNDC-DM model, wherein the GNDC-DM model comprises a trend noise diffusion model, a seasonal noise diffusion model, and a mixed anomaly diffusion model; performing trend noise detection processing on acquired initial industrial equipment data based on the trend noise diffusion model included in the GNDC-DM model to generate trend denoising data; performing seasonal noise detection processing on the acquired initial industrial equipment data based on the seasonal noise diffusion model included in the GNDC-DM model to generate seasonal denoising data; and performing mixed anomaly detection processing on the acquired initial industrial equipment data, the trend denoising data, and the seasonal denoising data based on the mixed anomaly diffusion model included in the GNDC-DM model to generate equipment denoising data.
[0008] In a second aspect, some embodiments of the present application provide a time series data anomaly detection device based on a gradient noise dynamic conditional diffusion model, the device comprising: a determination unit configured to determine a GNDC-DM model, wherein the GNDC-DM model comprises a trend noise diffusion model, a seasonal noise diffusion model, and a mixed anomaly diffusion model; a trend noise detection unit configured to perform trend noise detection processing on acquired initial industrial equipment data based on the trend noise diffusion model included in the GNDC-DM model to generate trend denoising data; a seasonal noise detection unit configured to perform seasonal noise detection processing on the acquired initial industrial equipment data based on the seasonal noise diffusion model included in the GNDC-DM model to generate seasonal denoising data; and a mixed noise detection unit configured to perform mixed anomaly detection processing on the acquired initial industrial equipment data, the trend denoising data, and the seasonal denoising data based on the mixed anomaly diffusion model included in the GNDC-DM model to generate equipment denoising data.
[0009] In a third aspect, the present application also provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein the computer program, when executed by the processor, implements the method described in any of the implementations of the first aspect.
[0010] In a fourth aspect, the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program, when executed by a processor, implements the method described in any of the implementations of the first aspect.
[0011] The above various embodiments of the present application have the following beneficial effects: through the time series data anomaly detection method based on the gradient noise dynamic conditional diffusion model of some embodiments of the present application, the method proposes a gradient noise dynamic conditional diffusion model GNDC-DM based on gradient noise for time series anomaly detection. The framework designs three special detection channels respectively for detecting trend anomalies, seasonal anomalies and mixed anomalies. In the trend channel and the seasonal channel, a gradient noise instead of a traditional Gaussian noise is introduced, which can effectively attenuate abnormal points, thereby amplifying the reconstruction error of abnormal points and improving the detection performance. The noise consists of two parts: one is gradient-oriented noise, which can strengthen the normal trend (or seasonal pattern); the second is a random Gaussian component, which is used to maintain sample diversity. Among them, the gradient part uses the feature that abnormal points usually deviate from the normal trend (or seasonal pattern) of their neighborhood in the gradient direction, and aligns with the normal gradient to naturally suppress abnormal fluctuations; and the Gaussian part introduces appropriate randomness to prevent the model from falling into deterministic bias, while maintaining the diversity of samples. By fusing the two parts, the noise design of the present application can disturb the normal pattern as little as possible during the reconstruction process, while systematically migrating abnormal points to the normal manifold, achieving effective suppression of anomalies and robust maintenance of normal structure. In the mixed channel, the trend noise and the seasonal noise are dynamically combined at each time step to serve as a conditional guided diffusion model for time series reconstruction. By aligning the generated data to the normal trend and seasonal pattern, this design effectively suppresses the abnormal components in these two dimensions, making it easier to distinguish and detect mixed anomalies. Unlike static conditions (such as global trend or seasonal average), the method of the present application extracts the trend and seasonal information of the time step step by step, dynamically synchronizing the generation process with the time sequence characteristics of the input data. This design ensures the consistency of the generated output in a local range, and is closer to the distribution of normal data. Finally, data points containing mixed anomalies will often produce greater errors in reconstruction, making detection based on reconstruction scores more effective. BRIEF DESCRIPTION OF DRAWINGS
[0012] The above and other features, advantages and aspects of embodiments of the present application will become more apparent by referring to the following detailed description in conjunction with the accompanying drawings, in which like reference numerals refer to like elements in the several views. It is to be understood that the drawings are schematic, and elements and features do not necessarily appear to scale.
[0013] Figure 1 is a flowchart of some embodiments of the time series data anomaly detection method based on the gradient noise dynamic conditional diffusion model according to the present application;
[0014] Figure 2 is an architecture diagram of the GNDC-DM model of the time series data anomaly detection method based on the gradient noise dynamic conditional diffusion model according to the present application;
[0015] Figure 3 is a structural schematic diagram of some embodiments of a time series data anomaly detection apparatus based on a gradient noise based dynamic conditional diffusion model according to the present application;
[0016] Figure 4 is a structural schematic diagram of a computer device suitable for use to implement some embodiments of the present application;
[0017] Figure 5 is a schematic diagram of some data set descriptions for experimental verification of a time series data anomaly detection method based on a gradient noise based dynamic conditional diffusion model according to the present application;
[0018] Figure 6 is a schematic diagram of performance comparison of GNDC-DM and baseline methods on four data sets according to the present application;
[0019] Figure 7 is a schematic diagram of F1 score comparison of different components;
[0020] Figure 8 is a schematic diagram of influence analysis of parameters in a preset trend seasonal condition according to the present application;
[0021] Figure 9 is a schematic diagram of influence analysis of two key hyperparameters and in a formula of a trend gradient noise according to the present application. DETAILED DESCRIPTION
[0022] Embodiments of the present application will be described below in greater detail with reference to the accompanying drawings. Although some embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms, and should not be interpreted as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided so as to make the present application more thorough and complete. It should be understood that the drawings and embodiments of the present application are only for exemplary purposes, and are not intended to limit the scope of protection of the present application.
[0023] It should also be noted that, for ease of description, only parts related to the relevant invention are shown in the drawings. The embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0024] It should be noted that the concepts of “first”, “second”, etc. mentioned in the present application are only used to distinguish different devices, modules or units, and are not intended to limit the order or interdependence of the functions performed by these devices, modules or units.
[0025] It should be noted that the modification of "one", "multiple" mentioned in the present application is illustrative but not restrictive, and those skilled in the art should understand that unless the context clearly indicates otherwise, it should be understood as "one or more".
[0026] The names of the messages or information exchanged between the plurality of devices in the embodiments of the present application are only for illustrative purposes, and are not intended to limit the scope of the messages or information.
[0027] The present application will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.
[0028] Figure 1 Flow 100 of some embodiments of the time series data anomaly detection method of the gradient noise dynamic conditional diffusion model is shown. The time series data anomaly detection method of the gradient noise dynamic conditional diffusion model includes the following steps:
[0029] Step 101, determining the GNDC-DM model.
[0030] In some embodiments, the subject performing the time series data anomaly detection method based on the gradient noise dynamic conditional diffusion model can determine the GNDC-DM model. Wherein, the above-mentioned GNDC-DM model includes: a trend noise diffusion model, a seasonal noise diffusion model, a mixed anomaly diffusion model. For example, the overall framework of the GNDC-DM (gradient noise dynamic conditional diffusion model) model can refer to Figure 2 , Figure 2 The architecture diagram of the GNDC-DM model of the time series data anomaly detection method based on the gradient noise dynamic conditional diffusion model according to the present application is shown. Thus, the three-channel anomaly detection architecture is innovatively proposed, which respectively detects the trend anomaly, seasonal anomaly and mixed anomaly in the time series through the customized diffusion model. Specifically: (1) Trend / seasonal diffusion model: design a customized gradient noise function, which is derived from the feature learning of normal trend and seasonal patterns. Compared with Gaussian noise, it can selectively destroy the abnormal components in the trend and seasonal signals. In the forward process, the gradient noise is gradually added, so that the noisy data converges to the normal behavior. Through this strong prior constraint, it ensures that the normal trend and seasonal components are reconstructed in the reverse process. (2) Mixed anomaly diffusion model: adopt the information of fusion trend noise and seasonal noise as dynamic conditions to guide the generation process. The forward process also adds gradient noise; the reverse generation stage implements a time step adaptive dynamic condition adjustment mechanism. Compared with static conditions, dynamic conditions can strengthen the expression of normal time series information, significantly improving the quality of normal data generation.
[0031] At step 102, the acquired initial industrial equipment data is subjected to trend noise detection processing based on a trend noise diffusion model included in the GNDC-DM model to generate trend denoised data.
[0032] In some embodiments, the above-mentioned execution subject can subject the acquired initial industrial equipment data to trend noise detection processing based on a trend noise diffusion model included in the GNDC-DM model to generate trend denoised data. The initial industrial equipment data can be acquired from a terminal device through wired or wireless connection. Here, the initial industrial equipment data can be data of an industrial equipment. For example, the industrial equipment can be, but is not limited to, an industrial system device, a car, a mechanical equipment. For example, the initial industrial equipment data can be, but is not limited to, MSL (Mars Science Laboratory), SMD (Server Machine Dataset), SWaT (Secure Water Treatment), PSM (Pooled Server Metrics).
[0033] Optionally, the initial industrial equipment data is subjected to decomposition processing to generate initial trend data, initial seasonal data and initial mixed data.
[0034] In some embodiments, the above-mentioned execution subject can subject the initial industrial equipment data to decomposition processing to generate initial trend data, initial seasonal data and initial mixed data. In practice, the initial industrial equipment data is usually decomposed into three core components: initial trend data, initial seasonal data and initial mixed data, as shown in the following formula:
[0035] ,
[0036] wherein, represents the initial industrial equipment data, represents the initial trend data, represents the initial seasonal data, represents the initial mixed data.
[0037] In practice, the above-mentioned execution subject can subject the initial industrial equipment data to decomposition processing to generate initial trend data, initial seasonal data and initial mixed data by the following steps:
[0038] Firstly, the initial industrial equipment data is subjected to first decomposition processing by the following formula to generate initial trend data:
[0039] ,
[0040] wherein, denotes the coefficient, , denotes the average step size, denotes the sequence number.
[0041] In a second step, the initial industrial equipment data and the initial trend data are subjected to a second decomposition process by the following formula to generate initial seasonal data:
[0042] ,
[0043] wherein, denotes a LOESS (Local Estimate of Smoothing) smoothing function.
[0044] In a third step, the initial industrial equipment data, the initial trend data and the initial seasonal data are subjected to a third decomposition process by the following formula to generate initial mixed data:
[0045] .
[0046] It should be noted that the above wireless connection mode can include but is not limited to 3G / 4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other now known or future developed wireless connection modes.
[0047] Since the trend anomaly in time series data refers to a subsequence that deviates significantly from the overall trend. Therefore, the present application adopts a diffusion model with gradient noise to reconstruct the trend data, and then identifies abnormal points according to the reconstruction error.
[0048] To detect trend anomalies, the present application makes normal points and abnormal points both exhibit normal behavior patterns through data conversion, and then identifies anomalies by analyzing reconstruction errors (the greater the error, the higher the likelihood of anomaly). Inspired by the excellent performance of diffusion models in related tasks, the present application adopts a diffusion-based reconstruction method: the forward process constructs a prior distribution by gradient noise disturbance of the trend data, and the reverse diffusion process optimizes the prior to generate the reconstructed trend. Traditional diffusion models usually use Gaussian white noise to destroy the original data, but this method is insufficient to suppress the influence of abnormal points. Therefore, the present application innovatively introduces a gradient noise mechanism, which can obtain a smoother reconstructed trend, so that abnormal points produce greater reconstruction errors.
[0049] Inspired by the successful application of specific noise in graph data field, the present application proposes a new type of gradient noise to suppress abnormal feature information. This noise mechanism shifts the data distribution towards the normal mode, so that abnormal values are reconstructed as normal values while maintaining the consistency of original normal values. Therefore, abnormal points will exhibit greater reconstruction errors when reconstructed, so they can be effectively identified.
[0050] Anomaly in time series usually presents as a sudden fluctuation deviating from the overall trend, whose gradient direction is significantly different from the surrounding data. Noise generated based on the gradient direction can enhance the potential trend of normal points while weakening the influence of abnormal points. To effectively suppress anomalies in trends, the present application converts standard Gaussian noise into gradient noise by the following two key constraints: (1) directional constraint: align the noise with the local gradient direction, thereby capturing the local dynamic characteristics of the time series; (2) randomness constraint: introduce Gaussian noise to maintain the diversity of generated samples.
[0051] In practice, the above execution subject can perform trend noise detection processing on the acquired initial industrial equipment data based on the trend noise diffusion model included in the above GNDC-DM model to generate trend noise reduction data by the following steps:
[0052] First, determine the trend gradient noise based on the preset constraint condition and Gaussian noise. The preset constraint condition can include: directional constraint and randomness constraint. The directional constraint can be: align the noise with the local gradient direction, thereby capturing the local dynamic characteristics of the time series. The randomness constraint can be: introduce Gaussian noise to maintain the diversity of generated samples. The trend gradient noise can be:
[0053] ,
[0054] wherein, denotes the trend gradient noise, denotes the trend time series, denotes the gradient of the time series , denotes the modulus, denotes a small constant introduced to prevent the trend from approaching zero to avoid division by zero error, thereby ensuring numerical stability, denotes Gaussian noise, , denotes the modulus of the Gaussian noise, and denote adjustable hyperparameters, respectively used to control the relative contribution proportion of the gradient-guided noise component and the random noise component. For example, can be 0.1. can be 0.3. can be 0.7.
[0055] Second, determine the target trend noise data sequence based on the preset trend forward diffusion formula using the above trend gradient noise and the above initial industrial equipment data. The preset trend forward diffusion formula is:
[0056] ,
[0057] wherein, represents the i-th target trend noise data in the target trend noise data sequence, represents the i-th target trend noise data, represents the serial number, , represents the iteration number, , , represents the preset variance scheduling parameter, represents the initial trend data corresponding to the initial industrial equipment data, for example, may be 0.15.
[0058] Since the gradient trend noise obtained by the formula of the trend gradient noise will promote the data to converge to the normal data, after the forward diffusion process, the abnormal information in the prior distribution is significantly weakened.
[0059] In the third step, based on the above target trend noise data sequence, the trend loss function corresponding to the trend noise diffusion model is determined. The trend loss function can be:
[0060] ,
[0061] wherein, represents the trend loss function, represents the expectation, represents the denoising neural network parameterized by the parameter , represents the parameter set in .
[0062] Trend data reconstruction needs to use a denoising neural network to eliminate prior noise and generate clean data. In order to better learn the normal distribution of the trend, the present application uses a U-Net (convolutional network for biomedical image segmentation) architecture based on LDM (Latent Diffusion Model) to realize the denoising network Unlike dynamic condition denoising networks that rely on external conditions such as trends and seasonality in hybrid anomaly detection, trend anomaly detection focuses on learning the distribution of normal samples without additional condition constraints. To this end, the present application removes the condition component in the original LDM design and instead introduces a self-attention mechanism. This mechanism can effectively capture long-range dependencies in the sequence, enabling the network to gain global awareness of the trend structure. Given that normal data usually dominates in anomaly detection tasks, using long-range dependencies can enhance the network's ability to model normal patterns, thereby amplifying the reconstruction error of abnormal points and ultimately improving anomaly detection performance.
[0063] Optionally, the execution subject can adjust the trend noise diffusion model based on the trend loss function by a preset adjustment algorithm. For example, the preset adjustment algorithm can be, but is not limited to, one of the following: Adam optimizer algorithm, back propagation algorithm, or stochastic gradient algorithm.
[0064] In the fourth step, the trend noise diffusion model and the target trend noise data sequence are used to determine the trend denoising data based on a preset trend inverse growth formula.
[0065] In practice, the execution subject can determine the trend denoising data based on the trend inverse growth formula by using the trend noise diffusion model and the target trend noise data sequence through the following steps:
[0066] In the first step, the number of iterations is determined as the trend iteration number.
[0067] In the second step, the last target trend noise data in the target trend noise data sequence is determined as the transit trend noise data.
[0068] In the third step, the following trend iteration steps are performed based on the trend iteration number and the transit trend noise data:
[0069] In the first sub-step, the trend denoising data is determined based on the preset trend inverse growth formula by using the trend noise diffusion model and the transit trend noise data. The preset trend inverse growth formula is:
[0070] ,
[0071] wherein, denotes the trend denoising data, denotes the transit trend noise data;
[0072] In the second sub-step, the difference between the trend iteration number and a preset iteration value is determined as the target trend iteration number. For example, the preset iteration value can be 1.
[0073] In the fourth step, in response to determining that the target trend iteration number meets a preset trend iteration condition, the target trend iteration number is determined as the trend iteration number, and the trend denoising data is determined as the transit trend noise data for re-executing the trend iteration steps. The preset trend iteration condition can be that the target trend iteration number is 0.
[0074] In the fifth step, in response to determining that the target trend iteration number does not meet the preset trend iteration condition, the trend denoising data is determined as the trend denoising data.
[0075] Step 103: Based on the seasonal noise diffusion model included in the GNDC-DM model, seasonal noise detection processing is performed on the acquired initial industrial equipment data to generate seasonal noise reduction data.
[0076] In some embodiments, the aforementioned execution entity may perform seasonal noise detection processing on the acquired initial industrial equipment data based on the seasonal noise diffusion model included in the aforementioned GNDC-DM model, in order to generate seasonal noise reduction data.
[0077] In practice, the aforementioned implementing entity can perform seasonal noise detection processing on the acquired initial industrial equipment data based on the seasonal noise diffusion model included in the GNDC-DM model through the following steps to generate seasonal noise reduction data:
[0078] The first step is to determine the seasonal gradient noise based on preset constraints and Gaussian noise. The specific implementation method and resulting technical effects of determining the seasonal gradient noise based on preset constraints and Gaussian noise can be found in step 102 of the above embodiments, and will not be repeated here.
[0079] The second step involves determining the target seasonal noise data sequence based on a pre-defined seasonal forward diffusion formula, using the aforementioned seasonal gradient noise and initial industrial equipment data. The pre-defined seasonal forward diffusion formula is:
[0080] ,
[0081] in, Represents the first element in the target seasonal noise data sequence. Target seasonal noise data, This represents the initial seasonal data corresponding to the initial industrial equipment data. This represents seasonal gradient noise.
[0082] The third step is to determine the seasonal loss function corresponding to the aforementioned seasonal noise diffusion model based on the target seasonal noise data sequence. The specific implementation method and resulting technical effects of determining the seasonal loss function based on the target seasonal noise data sequence can be found in step 102 of the above embodiments, and will not be repeated here.
[0083] Optionally, the aforementioned execution entity can adjust the seasonal noise diffusion model based on the aforementioned seasonal loss function and the aforementioned preset adjustment algorithm.
[0084] The fourth step involves determining the seasonal noise reduction data based on the preset seasonal reverse growth formula and the aforementioned seasonal noise diffusion model and target seasonal noise data sequence.
[0085] In practice, the aforementioned implementing entity can determine the seasonal noise reduction data based on the preset seasonal inverse growth formula, the aforementioned seasonal noise diffusion model, and the aforementioned target seasonal noise data sequence through the following steps:
[0086] The first step is to determine the number of seasonal iterations. In practice, the aforementioned implementing entity can determine the number of iterations as the number of seasonal iterations.
[0087] The second step is to identify the last target seasonal noise data in the target seasonal noise data sequence as the transit seasonal noise data.
[0088] The third step involves performing the following seasonal iteration steps based on the number of seasonal iterations and the transitional seasonal noise data:
[0089] The first sub-step involves determining the seasonal denoising data based on a pre-defined seasonal inverse growth formula, using the aforementioned seasonal noise diffusion model and intermediate seasonal noise data. The pre-defined seasonal inverse growth formula is as follows:
[0090] ,
[0091] in, This represents seasonally denoised data. This represents seasonal noise data during transit. This represents a denoising neural network.
[0092] The second sub-step is to determine the target number of seasonal iterations as the difference between the number of seasonal iterations and the preset iteration value.
[0093] The fourth step involves determining that the target seasonal iteration count meets the preset seasonal iteration condition. The target seasonal iteration count is then set as the seasonal iteration count, and the seasonally denoised data is designated as intermediate seasonal noise data for re-execution of the aforementioned seasonal iteration steps. The preset seasonal iteration condition can be that the target seasonal iteration count is 0.
[0094] The fifth step is to determine that the number of iterations for the target season does not meet the preset seasonal iteration conditions, and then define the seasonal denoised data as seasonal noise reduction data.
[0095] Therefore, for the seasonal component, this application employs a similar process for data reconstruction. First, referring to the method for processing trend gradient noise, Gaussian noise is converted into seasonal gradient noise. Then, during the forward diffusion process, this customized noise is used to reconstruct the seasonal data. conduct Step perturbation, eventually yielding the prior distribution —This processing method maintains symmetry with the preset forward diffusion formula corresponding to the trend component. Subsequently, a denoising neural network is used. Trained to eliminate noise in the trend and season components. Finally, in the reverse process, by iteratively removing the noise in the trend and season components, clean seasonal data is generated.
[0096] At step 104, based on the mixed abnormal diffusion model included in the GNDC-DM model, the obtained initial industrial equipment data, the trend denoising data and the seasonal denoising data are subjected to mixed abnormal detection processing to generate equipment denoising data.
[0097] In some embodiments, the above execution subject can perform mixed abnormal detection processing on the obtained initial industrial equipment data, the above trend denoising data and the above seasonal denoising data based on the mixed abnormal diffusion model included in the above GNDC-DM model to generate equipment denoising data.
[0098] Since time series usually contain multiple complex components, in addition to the trend term and seasonal anomalies, mixed anomalies are often coexisting in the data. To detect such anomalies, the present application designs a time series diffusion model with dynamic conditions. In the reverse process, by introducing dynamic conditions extracted from the decomposed trend term and seasonal components, the generation of the reconstructed time series is guided. Then the reconstruction error between the generated sequence and the original input is calculated to identify mixed anomalies, and the larger the error is, the higher the possibility of abnormal behavior is.
[0099] Denoising diffusion probability models (DDPMs) have shown great ability to accurately model data distribution in generation tasks. However, existing anomaly detection methods usually rely on static condition mechanisms, which lack the flexibility to provide targeted step-by-step guidance in the generation process, making it difficult to adapt to complex time series dynamic characteristics, and ultimately leading to poor performance in time series data anomaly detection.
[0100] To solve this limitation, the present application proposes a dynamic condition mechanism that integrates noise signals from the trend term and seasonal components during the generation process. This dynamic condition guides the diffusion model to generate time series data that conforms to the normal mode. Specifically, at each time step of the iterative generation process, the present application diffuses the trend term and the seasonal component respectively to obtain the corresponding trend noise and seasonal noise at the same time. These noise components mainly reflect the characteristics of normal data. By combining them as a dynamic condition, the model can be effectively guided to generate time series values that conform to normal behavior. This design ensures that the trend signal and the seasonal signal (both aligned with the normal direction) serve as time-synchronized guidance conditions, matching the time structure characteristics of the data and guiding the generation process towards a normal distribution.
[0101] In practice, the aforementioned implementing entity can perform hybrid anomaly detection processing on the acquired initial industrial equipment data, the aforementioned trend noise reduction data, and the aforementioned seasonal noise reduction data based on the hybrid anomaly diffusion model included in the aforementioned GNDC-DM model through the following steps to generate equipment noise reduction data:
[0102] The first step is to determine the mixed gradient noise based on preset constraints and Gaussian noise. The specific implementation method and resulting technical effects of determining the mixed gradient noise based on preset constraints and Gaussian noise can be found in step 102 of the above embodiments, and will not be repeated here.
[0103] The second step involves determining the target mixed noise data sequence based on a preset mixed forward diffusion formula, using the aforementioned mixed gradient noise and the initial industrial equipment data. The specific implementation method and resulting technical effects of determining the target mixed noise data sequence based on the preset mixed forward diffusion formula and using the aforementioned mixed gradient noise and initial industrial equipment data can be found in step 102 of the above embodiments, and will not be repeated here.
[0104] Therefore, the diffusion process of time series data basically follows the forward diffusion process of the pre-defined forward diffusion formula. Specifically, time series data sampled from the true distribution... ,go through The perturbation of step gradient noise (refer to the method for handling trend gradient noise) ultimately yields the degraded characterization. .
[0105] The third step involves determining the hybrid loss function corresponding to the hybrid anomaly diffusion model based on the initial industrial equipment data, the target mixed noise data sequence, the target trend noise data sequence corresponding to the trend denoising data, and the target seasonal noise data sequence corresponding to the seasonal denoising data. The hybrid loss function is:
[0106] ,
[0107] in, Represents the mixed loss function. Expressing expectations, This represents the initial mixed data corresponding to the initial industrial equipment data. Indicates by A parameterized denoising neural network, whose input is The condition variable is and , Represents the first in the target mixed noise data sequence Mixed noise data for each target Indicating the first [item] in the target trend noise data sequence target trend noise data, denotes the i-th target seasonal noise data in the sequence of target seasonal noise data, denotes the i-th target seasonal noise data.
[0108] Denoising network for time series data , the application introduces dynamic conditional guidance to learn the distribution of normal data. In each step of the denoising process, the predicted output of the previous step is taken as input, while the trend item and the seasonal item corresponding to the same time step are used as conditional variables to predict noise. Subsequently, the predicted noise is used to generate time series data of the previous time step. Therefore, the dynamic conditions of each time step change with the corresponding time step. These dynamic conditions not only ensure consistency between time steps, but also incorporate components with normal directions, effectively guiding the network to reconstruct time series data that conforms to the normal mode.
[0109] Optionally, the execution subject can adjust the hybrid anomaly diffusion model based on the hybrid loss function and the preset adjustment algorithm.
[0110] In the fourth step, the cross-attention model included in the hybrid anomaly diffusion model is determined based on the preset trend and seasonal conditions, wherein the preset trend and seasonal conditions are:
[0111] ,
[0112] wherein, denotes the preset trend and seasonal conditions, denotes a weight coefficient for dynamically adjusting the contribution ratio of the trend item and the seasonal item in condition generation, for example, can be 0.4.
[0113] wherein the cross-attention model is:
[0114] ,
[0115] wherein, denotes the cross-attention model, denotes a query vector, denotes, converted by an embedding layer, denotes the length of the embedding vector , denotes the dimension, , denotes a key, , denotes the time series input representation of each layer of cross-attention, denotes a value, , denotes a query matrix, denotes a key matrix, denotes a value matrix, , and all belong to the matrix weight parameters to be learned.
[0116] However, the time series components in the real world are often not quantitatively distributed, which means that the trend item and the seasonal item in equal proportions as the generation condition may not effectively support the time series generation task. In order to make the condition mechanism more in line with the real time series characteristics, the present application preprocesses the trend and seasonal components before inputting them into the denoising network, ensuring that each component can more efficiently guide sequence generation. Specifically, the present application achieves this goal by dynamically regulating the contribution weight of the trend item and the seasonal item in the condition guidance. The generation process of the condition guidance can be formally expressed as the above preset trend and seasonal condition.
[0117] At each time step, the preset trend and seasonal condition guides the denoising process of the input data through a cross-attention mechanism. The present application uses a U-Net architecture based on LDM (Latent Diffusion Model) as the diffusion network, and enhances it through cross-attention to gradually integrate the preset trend and seasonal condition into the denoising process. To achieve this integration, the present application uses an embedding layer to convert the condition into , where the dimension is aligned with the time series representation . The cross-attention mechanism that integrates the condition is shown in the above formula. This mechanism enables the model to dynamically focus on the most relevant time series patterns in the condition , thereby more accurately generating reconstructed sequences that conform to the normal distribution.
[0118] The output of the cross-attention mechanism will serve as the input for the subsequent U-Net module. Specifically, the query vector is generated from the condition, which contains the mixed trend and seasonal noise at the time step; the key and value are calculated through and respectively, where denotes the time series input representation of each layer of cross-attention. When the condition query and the time series key are both in a normal state, their similarity is high, making the value The attention weight increases significantly during weighted summation; conversely, if Normal and Anomalies and decreased similarity lead to a sharp reduction in weights. This mechanism effectively suppresses anomalous information in the time series, thereby forcing the network to focus on learning the pattern features of normal time series.
[0119] The fifth step involves determining the noise reduction data for the device based on the preset hybrid reverse growth formula and the aforementioned hybrid anomaly diffusion model and target hybrid noise data sequence.
[0120] In practice, the aforementioned implementing entity can determine the equipment noise reduction data based on the preset hybrid inverse growth formula, the aforementioned hybrid anomaly diffusion model, and the aforementioned target hybrid noise data sequence through the following steps:
[0121] The first step is to determine the number of mixed iterations. In practice, the aforementioned execution entity can determine the number of iterations as the number of mixed iterations.
[0122] The second step is to identify the last target mixed noise data in the target mixed noise data sequence as the relay mixed noise data.
[0123] The third step involves performing the following hybrid iteration steps based on the number of hybrid iterations and the intermediate mixed noise data:
[0124] The first sub-step involves determining the mixed denoising data based on a preset hybrid inverse growth formula, using the aforementioned hybrid anomaly diffusion model and intermediate mixed noise data. The preset hybrid inverse growth formula is as follows:
[0125] ,
[0126] in, This represents mixed denoised data. This indicates mixed noise data during relay. This represents the first denoised data sequence in the target trend. Denoising data based on target trends This represents the first denoised data sequence of the target season. The target seasonal denoised data series is determined by the denoised data of each trend and the target trend noise data series. The target seasonal denoised data series is determined by the denoised data of each season and the target seasonal noise data series. Here, the target trend denoised data series is determined through the following steps: First, the denoised data of each trend determined in the above trend iteration steps... Add it to the target trend denoising data sequence, which is initially empty. Then, determine the last target trend noise data in the target trend noise data sequence as the first data in the target trend denoising data sequence. The target trend denoised data. Here, the target seasonal denoised data sequence is determined through the following steps: First, the denoised data for each season determined in the above seasonal iteration steps are... Add it to the target season denoised data sequence, which is initially empty. Then, determine the last target season noise data in the target season noise data sequence as the first data in the target season denoised data sequence. Denoising data for each target season.
[0127] The second sub-step is to determine the target number of mixed iterations as the difference between the number of mixed iterations and the preset iteration value.
[0128] Fourth, in response to the determination that the target number of mixing iterations meets the preset iteration condition, the target number of mixing iterations is determined as the number of mixing iterations, and the mixed denoising data is determined as the intermediate mixed noise data, so that the above mixing iteration steps can be executed again. The preset iteration condition can be: the target number of mixing iterations is 0.
[0129] The fifth step is to determine the mixed denoising data as mixed noise reduction data in response to the determination that the target number of mixed iterations does not meet the preset iteration conditions.
[0130] This application can be tested using the following formula:
[0131] Since the distinction between anomalous and normal time series is based on reconstruction error, a larger error indicates a higher probability of an anomaly. For mixed-type anomalies in time series, this application provides the following definition:
[0132] ,
[0133] in, Indicates mixed outlier scores. Represents the original time series data. This represents the generated time series data. This represents the length of the time series. Simultaneously, the time series in the above formula... Replace with trend item and seasonal items Calculate the trend anomaly score respectively. and seasonal anomaly score Subsequently, by integrating the mixed anomaly score, trend anomaly score, and seasonal anomaly score, the final overall anomaly score is obtained:
[0134] ,
[0135] wherein, represents the overall anomaly score, , and represents the balanced hyper-parameter. For example, can be 0.3, can be 0.3, can be 0.4.
[0136] According to previous research work, the present application calculates the threshold value based on the training data. Given the training data , the corresponding decision threshold is:
[0137] ,
[0138] wherein, represents the decision threshold, represents the average value calculation function. When the detection sample , it is determined as an abnormal sample; otherwise, it is determined as a normal sample.
[0139] The above various embodiments of the present application have the following beneficial effects: through the time series data anomaly detection method of the dynamic condition diffusion model based on gradient noise of some embodiments of the present application, the method proposes a dynamic condition diffusion model GNDC-DM based on gradient noise for time series anomaly detection. The framework designs three special detection channels for detecting trend anomalies, seasonal anomalies and mixed anomalies respectively. In the trend channel and the seasonal channel, a gradient noise instead of a traditional Gaussian noise is introduced, which can effectively attenuate abnormal points, thereby amplifying the reconstruction error of abnormal points and improving the detection performance. The noise consists of two parts: one is gradient-oriented noise, which can strengthen the normal trend (or seasonal pattern); the second is a random Gaussian component, which is used to maintain sample diversity. Among them, the gradient part uses the feature that abnormal points usually deviate from the normal trend (or seasonal pattern) of their neighborhood in the gradient direction, and aligns with the normal gradient to naturally suppress abnormal fluctuations; while the Gaussian part introduces appropriate randomness to prevent the model from falling into deterministic bias, while maintaining the diversity of samples. By fusing the two parts, the noise design of the present application can disturb the normal pattern as little as possible during the reconstruction process, while systematically migrating abnormal points to the normal manifold, achieving effective suppression of anomalies and robust maintenance of normal structure. In the mixed channel, the trend noise and the seasonal noise are dynamically combined at each time step to serve as a condition-guided diffusion model for time series reconstruction. By aligning the generated data to the normal trend and seasonal pattern, this design effectively suppresses the abnormal components in these two dimensions, making it easier to distinguish and detect mixed anomalies. Unlike static conditions (such as global trend or seasonal average), the method of the present application extracts the trend and seasonal information of the time step step by step, dynamically synchronizing the generation process with the time sequence characteristics of the input data. This design ensures the consistency of the generated output in a local range, and is closer to the distribution of normal data. Finally, data points containing mixed anomalies will often produce greater errors in reconstruction, making detection based on reconstruction scores more effective.
[0140] Further reference Figure 3 , as an implementation of the method shown in the above figures, the present disclosure provides some embodiments of a time series data anomaly detection device based on a dynamic condition diffusion model based on gradient noise, which corresponds to the method embodiments shown in Figure 1 , the time series data anomaly detection device based on the dynamic condition diffusion model based on gradient noise can be applied to various electronic devices.
[0141] As Figure 3As shown, the time series data anomaly detection apparatus 300 of the gradient noise based dynamic conditional diffusion model of some embodiments comprises a determination unit 301, a trend noise detection unit 302, a seasonal noise detection unit 303 and a mixed noise detection unit 304. The determination unit 301 is configured to determine a GNDC-DM model, wherein the GNDC-DM model comprises a trend noise diffusion model, a seasonal noise diffusion model and a mixed anomaly diffusion model. The trend noise detection unit 302 is configured to perform trend noise detection processing on the obtained initial industrial equipment data based on the trend noise diffusion model comprised in the GNDC-DM model to generate trend denoising data. The seasonal noise detection unit 303 is configured to perform seasonal noise detection processing on the obtained initial industrial equipment data based on the seasonal noise diffusion model comprised in the GNDC-DM model to generate seasonal denoising data. The mixed noise detection unit 304 is configured to perform mixed anomaly detection processing on the obtained initial industrial equipment data, the trend denoising data and the seasonal denoising data based on the mixed anomaly diffusion model comprised in the GNDC-DM model to generate equipment denoising data.
[0142] It can be understood that the units described in the time series data anomaly detection apparatus 300 of the gradient noise based dynamic conditional diffusion model correspond to the respective steps in the method described above. Figure 1 The operations, features and advantages described above for the method also apply to the time series data anomaly detection apparatus 300 of the gradient noise based dynamic conditional diffusion model and the units contained therein, and will not be described here again.
[0143] The present application also provides a computer device 400. As shown, Figure 4 The computer device 400 comprises a bus 401, a processor 402, a memory 403 and a communication interface 404. The processor 402, the memory 403 and the communication interface 404 communicate through the bus 401. The computer device 400 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in the computer device 400.
[0144] The bus 401 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4Only one bus is shown for simplicity, but there can be more than one bus. Bus 401 can include circuitry that connects the various components in the computer device 400 (e.g., memory 403, processor 402, communication interface 404) and that allows the data to be exchanged between the various components.
[0145] The processor 402 can include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP), among other processors.
[0146] The memory 403 can include volatile memory (e.g., random access memory (RAM)), non-volatile memory (e.g., read-only memory (ROM)), flash memory, a hard disk drive, or a solid-state drive, among others.
[0147] The memory 403 stores executable program code that, when executed by the processor 402, implements the functions of the determination unit, the trend noise detection unit, the seasonal noise detection unit, and the mixed noise detection unit described above, thereby implementing the time series data anomaly detection method based on the gradient noise dynamic conditional diffusion model described above. That is, the memory 403 stores instructions for implementing the time series data anomaly detection method based on the gradient noise dynamic conditional diffusion model described above.
[0148] The communication interface 404 uses a transceiver module such as, but not limited to, a network interface card or a transceiver, to enable communication between the computer device 400 and other devices or communication networks.
[0149] The embodiments of the present application also provide a chip including a processor and a data interface, the processor reading instructions stored on the memory through the data interface to execute the time series data anomaly detection method based on the gradient noise dynamic conditional diffusion model described above.
[0150] The embodiments of the present application also provide a computer readable storage medium. The computer readable storage medium can be any available medium or data storage device that can be accessed by a computing device and includes one or more available media or data storage devices. The available medium can be a magnetic medium, such as a floppy diskette, a hard disk, a magnetic tape, an optical medium, such as a DVD, or a semiconductor medium, such as a solid state hard drive, etc. The computer readable storage medium includes instructions that instruct the computing device to execute the time series data anomaly detection method based on the gradient noise dynamic conditional diffusion model.
[0151] Figure 5 is a schematic diagram of some data sets described according to the experimental verification of the time series data anomaly detection method based on the gradient noise dynamic conditional diffusion model of the present application.
[0152] As shown in Figure 5 , the present application evaluates the effectiveness of the GNDC-DM model on four publicly available and widely used time series anomaly detection benchmark data sets, MSL (Mars Science Laboratory), SMD (Server Machine Dataset), SWaT (Secure Water Treatment), and PSM (Pooled Server Metrics).
[0153] The present application conducts a comprehensive evaluation by comparing GNDC-DM with several baseline methods of different categories: (1) Clustering-based methods (such as DeepSVDD (Deep Support Vector Data Description), THOC (Temporal Hierarchy Open Clustering), and ITAD (Industrial Time-series Anomaly Detection)) group data sequences into clusters and detect anomalies by measuring their distance to the clusters. (2) Prediction-based models (such as LSTM (Long Short-Term Memory), CL-MPPCA (Clustered Mixtures of Probabilistic Principal Component Analyzers)) train prediction models to estimate future values based on previously observed context windows and flag anomalies based on the difference between predicted and actual values. (3) Reconstruction-based methods (such as LSTM-VAE (Long Short-Term Memory Variational Autoencoder), BeatGAN (Beat Generative Adversarial Network), OmniAnomaly (Omnidirectional Anomaly Detection), ATransformer (Anomaly-aware Transformer), and TFMAE (Transformer-based Masked Autoencoder)) encode sub-sequences of normal training time series into a latent space, reconstruct the sequences, and use reconstruction error to detect anomalies. (4) Imputation-based methods (such as DiffAD (Diffusion-based Anomaly Detection) and ImDiffusion (Implicit Diffusion Model)) estimate missing values through imputation techniques and identify anomalies based on the size of the estimation error.
[0154] The experiments were conducted using the PyTorch (a deep learning framework) framework and a single NVIDIA RTX 24GB GPU. All datasets used the Adam optimizer with default parameter configurations, an initial learning rate of , and a batch size of 16. The diffusion step for GNDC-DM was set to 100 steps. The hyperparameters of the baseline models and the detection threshold were adjusted according to the original study's settings.
[0155] Figure 6 is a schematic diagram comparing the performance of GNDC-DM and the baseline method on four datasets according to the present application.
[0156] Figure 6 The precision (P), recall (R), and F1 score (balanced F score) performances of GNDC-DM and the baseline method on multiple datasets are shown. All results were averaged over multiple runs to ensure robustness. GNDC-DM achieved the highest average F1 score on four datasets, outperforming the baseline method, demonstrating its effectiveness in time series anomaly detection. Specifically, the model of the present application achieved F1 scores of 95.27% and 95.34% on the SMD and MSL datasets, respectively. This improvement is attributed to the decoupled anomaly detection modeling approach used in the present application, which effectively captures multiple anomaly types and improves performance. The results on industrial datasets further verify the practical applicability of GNDC-DM - on the SWaT and PSM datasets, the method of the present application achieved F1 scores of 97.77% and 98.07%, respectively, setting new benchmarks in the field. GNDC-DM successfully reduces the anomaly component in time series through gradient noise while maintaining a good precision-recall balance.
[0157] Figure 7 is a schematic diagram comparing the F1 scores of different components.
[0158] The effectiveness of each component in GNDC-DM was evaluated through systematic ablation experiments, and the role of these components in improving anomaly detection performance was explored. Figure 7 The anomaly detection results of different component combinations on all datasets are summarized. It should be noted that all results in the table use F1 score as the evaluation metric, and the values are the average of multiple independent experiments. The functions of each component in Figure 7 are as follows: (i) Noise component: applies gradient noise to the data during diffusion; (ii) Trend component: detects trend-type anomalies through trend decomposition and trend reconstruction; (iii) Seasonal component: detects periodic-type anomalies through seasonal decomposition and seasonal reconstruction; (iv) Hybrid component: detects composite-type anomalies in residual data using hybrid reconstruction methods.
[0159] Figure 7The data shows that the performance improvement is limited when only using gradient noise and hybrid reconstruction components. This indicates that although gradient noise can effectively destroy abnormal patterns (its detection effect is better than Gaussian noise), a single model is still difficult to effectively handle diversified abnormal types. After introducing trend reconstruction or seasonal reconstruction components, the system performance is significantly improved - these two components respectively detect trend anomalies and periodic anomalies, thereby optimizing the overall detection effect.
[0160] Figure 8 is the impact analysis of the two key hyperparameters in the formula of the trend gradient noise according to the present application.
[0161] Here, the present application deeply analyzes the role of key hyperparameters in the two core formulas of GNDC-DM. First, for the parameter in the preset trend seasonal condition, the precision (P), recall (R) and F1 score under different Figure 8 values are tested on four data sets. As shown in the figure, the SMD and PSM data sets reach the best performance when = 0.6 - this is due to the characteristics of the server collected data: anomalies mainly manifest as periodic patterns (such as daily server load cycles) and burst deviations (such as resource contention peaks), so it is necessary to balance the integration detection of time trend and seasonal components. In contrast, the SWaT data set recording the continuous attack of the industrial water treatment system (such as pump control manipulation across multiple operation cycles) performs better at a higher value, highlighting the importance of long-term time series dependence. The MSL data set containing transient anomalies caused by random device failures (such as sensor drift in the Mars environment data) peaks at = 0.4, which focuses more on statistical outlier detection rather than time series modeling, which is consistent with the occasional characteristics of the anomalies in this data set.
[0162] Figure 9 is the impact analysis of the two key hyperparameters and in the formula of the trend gradient noise according to the present application.
[0163] The present application analyzes the sensitivity of the two key hyperparameters and in the formula of the trend gradient noise. As shown in the figure, the experimental results based on four data sets can draw the following important conclusions: Figure 9
[0164] The impact of the
[0165] When Increasing the value from 0.1 to 0.7 significantly improved detection performance across all datasets. This validates that gradient alignment noise effectively suppresses anomalous signals by reinforcing normal temporal trends. However, When the value is too high (>0.7), the performance actually decreases, indicating that over-reliance on gradient direction will distort the normal data pattern and lead to a decrease in overall detection accuracy.
[0166] The influence of parameters:
[0167] when When it is in the range of 0.5 to 0.7, it is moderate. The value can achieve an optimal balance in the following two aspects:
[0168] 1) Diversity: Gaussian noise enhances the model's coverage of anomalous patterns.
[0169] 2) Fidelity: Maintaining the integrity of the temporal characteristics of normal data.
[0170] This indicates that a reasonable level of Gaussian noise can improve the model's generalization ability. However, When the value is too high, excessive randomness will dilute the contribution of normal components in the gradient noise, thereby weakening the model's anomaly detection capability.
[0171] Therefore, the time series data anomaly detection method based on a gradient noise dynamic conditional diffusion model, as described in some embodiments of this application, addresses two core shortcomings of existing methods (poor anomaly suppression effect of standard Gaussian noise and coupling problems in the detection of different types of anomalies) by providing customized solutions through three dedicated detection channels (trend-type, periodic-type, and hybrid anomalies). The gradient noise technique proposed in GNDC-DM—a novel time series anomaly detection framework based on a dynamic conditional diffusion model—integrates gradient-guided and random perturbation elements, completely preserving the normal data structure while disrupting anomaly patterns. The dynamic conditional strategy employed in the hybrid channels enables the model to adapt to complex time series patterns, significantly improving the identification capability of composite anomalies. Extensive experiments on multiple real-world datasets demonstrate that GNDC-DM achieves state-of-the-art levels in both detection accuracy and generalization ability, validating its effectiveness and robustness.
[0172] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0173] The above examples are only used to illustrate the technical solutions of the present application, but not to limit the same; although the present application has been described in detail with reference to the foregoing examples, it should be understood by those of ordinary skill in the art that the technical solutions recorded in the foregoing examples can be modified, or some technical features thereof can be replaced by equivalent ones; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present application.
Claims
1. A time series data anomaly detection method based on a gradient noise-based dynamic condition diffusion model, comprising: determining a GNDC-DM model, wherein the GNDC-DM model comprises: a trend noise diffusion model, a seasonal noise diffusion model, and a mixed anomaly diffusion model; performing trend noise detection processing on the obtained initial industrial equipment data based on the trend noise diffusion model included in the GNDC-DM model to generate trend denoising data; performing seasonal noise detection processing on the obtained initial industrial equipment data based on the seasonal noise diffusion model included in the GNDC-DM model to generate seasonal denoising data; performing mixed anomaly detection processing on the obtained initial industrial equipment data, the trend denoising data, and the seasonal denoising data based on the mixed anomaly diffusion model included in the GNDC-DM model to generate equipment denoising data; wherein the trend noise detection processing on the obtained initial industrial equipment data to generate trend denoising data comprises: determining trend gradient noise based on a preset constraint condition and Gaussian noise, wherein the trend gradient noise is: , wherein, denotes a trend gradient noise, denotes a trend time series, denotes a time series of gradients, denotes a modulus of, denotes a small constant introduced to prevent division by zero when the trend approaches zero, denotes a Gaussian noise, , denotes a modulus of a Gaussian noise, and denotes an adjustable hyperparameter, respectively, for controlling the relative contribution ratio of the gradient-directed noise component and the random noise component; determining a target trend noise data sequence based on the trend gradient noise and the initial industrial equipment data using a preset trend forward diffusion formula, wherein the preset trend forward diffusion formula is: , wherein, represents the i-th target trend noise data in the target trend noise data sequence, represents the i-th target trend noise data, represents the serial number, , represents the iteration number, , , represents the preset variance scheduling parameter, represents the initial trend data corresponding to the initial industrial equipment data; determining a trend loss function corresponding to the trend noise diffusion model based on the target trend noise data sequence, wherein the trend loss function is: , wherein, denotes a trend loss function, denotes expectation, denotes a parameter parameterized denoising neural network, denotes a set of parameters in ; determining trend denoising data based on the trend noise diffusion model and the target trend noise data sequence using a preset trend reverse growth formula; wherein the seasonal noise detection processing on the obtained initial industrial equipment data to generate seasonal denoising data comprises: determining seasonal gradient noise based on a preset constraint condition and Gaussian noise; determining a target seasonal noise data sequence based on the seasonal gradient noise and the initial industrial equipment data using a preset seasonal forward diffusion formula, wherein the preset seasonal forward diffusion formula is: , wherein, represents the i-th target seasonal noise data in the target seasonal noise data sequence, represents the i-th target seasonal noise data, represents the initial seasonal data corresponding to the initial industrial equipment data, represents a seasonal gradient noise; determining a seasonal loss function corresponding to the seasonal noise diffusion model based on the target seasonal noise data sequence; determining seasonal denoising data based on the seasonal noise diffusion model and the target seasonal noise data sequence using a preset seasonal reverse growth formula; wherein the mixed anomaly detection processing on the obtained initial industrial equipment data, the trend denoising data, and the seasonal denoising data to generate equipment denoising data comprises: determining mixed gradient noise based on a preset constraint condition and Gaussian noise; determining a target mixed noise data sequence based on the mixed gradient noise and the initial industrial equipment data using a preset mixed forward diffusion formula; determining a mixed loss function corresponding to the mixed anomaly diffusion model based on the initial industrial equipment data, the target mixed noise data sequence, a target trend noise data sequence corresponding to the trend denoising data, and a target seasonal noise data sequence corresponding to the seasonal denoising data, wherein the mixed loss function is: , in, Represents the mixed loss function. Expressing expectations, This represents the initial mixed data corresponding to the initial industrial equipment data. Indicates by A parameterized denoising neural network, whose input is The condition variable is and , Represents the first in the target mixed noise data sequence Mixed noise data for each target Indicating the first [item] in the target trend noise data sequence Individual target trend noise data, Represents the first element in the target seasonal noise data sequence. Target seasonal noise data; The mixed abnormal diffusion model comprises a cross-attention model determined based on a preset trend seasonal condition, wherein the preset trend seasonal condition is: , wherein, denotes a preset trend season condition, denotes a weight coefficient, The cross-attention model is: , wherein, denotes a cross-attention model, denotes a query vector, denotes a condition converted by an embedding layer, denotes an embedding vector of a length, denotes a dimension, , denotes a key, , denotes a time-series input representation of each layer of cross-attention, denotes a value, , denotes a query matrix, denotes a key matrix, denotes a value matrix; The device denoising data is determined based on the mixed abnormal diffusion model and the target mixed noise data sequence according to a preset mixed reverse growth formula. 2.The time series data anomaly detection method based on gradient noise dynamic condition diffusion model of claim 1, wherein, The trend denoising data is determined based on the trend noise diffusion model and the target trend noise data sequence according to a preset trend reverse growth formula, and the method comprises the following steps: A trend iteration number is determined; A last target trend noise data in the target trend noise data sequence is determined as a transit trend noise data; The following trend iteration steps are performed based on the trend iteration number and the transit trend noise data: The trend denoising data is determined based on the trend noise diffusion model and the transit trend noise data according to a preset trend reverse growth formula, wherein the preset trend reverse growth formula is: , wherein, represents trend denoised data, represents transit trend noise data; A difference between the trend iteration number and a preset iteration value is determined as a target trend iteration number; In response to determining that the target trend iteration number meets a preset trend iteration condition, the target trend iteration number is determined as the trend iteration number, and the trend denoising data is determined as the transit trend noise data for performing the trend iteration steps again; In response to determining that the target trend iteration number does not meet the preset trend iteration condition, the trend denoising data is determined as the trend denoising data. 3.The time series data anomaly detection method based on gradient noise dynamic condition diffusion model of claim 1, wherein, The season denoising data is determined based on the season noise diffusion model and the target season noise data sequence according to a preset season reverse growth formula, and the method comprises the following steps: A season iteration number is determined; A last target season noise data in the target season noise data sequence is determined as a transit season noise data; The following season iteration steps are performed based on the season iteration number and the transit season noise data: The season denoising data is determined based on the season noise diffusion model and the transit season noise data according to a preset season reverse growth formula, wherein the preset season reverse growth formula is: , wherein, denotes the seasonally denoised data, denotes the transit seasonally noisy data, denotes the denoising neural network; A difference between the season iteration number and a preset iteration value is determined as a target season iteration number; In response to determining that the target season iteration number meets a preset season iteration condition, the target season iteration number is determined as the season iteration number, and the season denoising data is determined as the transit season noise data for performing the season iteration steps again; In response to determining that the target season iteration number does not meet the preset season iteration condition, the season denoising data is determined as the season denoising data. 4.The time series data anomaly detection method based on gradient noise dynamic condition diffusion model of claim 1, wherein, The device denoising data is determined based on the mixed abnormal diffusion model and the target mixed noise data sequence according to a preset mixed reverse growth formula, and the method comprises the following steps: A mixed iteration number is determined; A last target mixed noise data in the target mixed noise data sequence is determined as a transit mixed noise data; The following mixed iteration steps are performed based on the mixed iteration number and the transit mixed noise data: The mixed denoising data is determined based on the mixed abnormal diffusion model and the transit mixed noise data according to a preset mixed reverse growth formula, wherein the preset mixed reverse growth formula is: , in, This represents mixed denoised data. This indicates mixed noise data during relay. This represents the first denoised data sequence in the target trend. Denoising data based on target trends This represents the first denoised data sequence of the target season. The target seasonal denoised data consists of target trend denoised data sequences determined by each trend denoised data and target trend noise data sequences, and target seasonal denoised data sequences determined by each seasonal denoised data and target seasonal noise data sequences. A difference between the mixed iteration number and a preset iteration value is determined as a target mixed iteration number; In response to determining that the target mixing iteration number meets the preset iteration condition, determining the target mixing iteration number as the mixing iteration number, and determining the mixed denoising data as the intermediate mixed noise data for performing the mixing iteration step again; In response to determining that the target mixing iteration number does not meet the preset iteration condition, determining the mixed denoising data as the mixed denoising data.
5. A time series data anomaly detection device based on a gradient noise dynamic condition diffusion model, comprising: A determination unit configured to determine a GNDC-DM model, wherein the GNDC-DM model comprises a trend noise diffusion model, a seasonal noise diffusion model, and a mixed anomaly diffusion model; A trend noise detection unit configured to perform trend noise detection processing on the obtained initial industrial equipment data based on the trend noise diffusion model included in the GNDC-DM model to generate trend denoising data; the trend noise detection unit is further configured to: determine a trend gradient noise based on a preset constraint condition and a Gaussian noise, wherein the trend gradient noise is: , wherein, denotes a trend gradient noise, denotes a trend time series, denotes a time series of gradients, denotes a modulus of, denotes a small constant introduced to prevent division by zero when trending towards zero, denotes a Gaussian noise, , denotes a modulus of a Gaussian noise, and denotes an adjustable hyper-parameter, respectively, for controlling the relative contribution ratio of the gradient-directed noise component and the random noise component; determine a target trend noise data sequence based on the trend gradient noise and the initial industrial equipment data based on a preset trend forward diffusion formula, wherein the preset trend forward diffusion formula is: , wherein, represents the i-th target trend noise data in the target trend noise data sequence, represents the i-th target trend noise data, represents the serial number, , represents the iteration number, , , represents a preset variance scheduling parameter, represents initial trend data corresponding to the initial industrial equipment data; determine a trend loss function corresponding to the trend noise diffusion model based on the target trend noise data sequence, wherein the trend loss function is: , wherein, denotes a trend loss function, denotes expectation, denotes a parameter parameterized denoising neural network, denotes a set of parameters in ; determine trend denoising data based on the trend noise diffusion model and the target trend noise data sequence based on a preset trend reverse growth formula; A seasonal noise detection unit configured to perform seasonal noise detection processing on the obtained initial industrial equipment data based on the seasonal noise diffusion model included in the GNDC-DM model to generate seasonal denoising data; the seasonal noise detection unit is further configured to: determine a seasonal gradient noise based on a preset constraint condition and a Gaussian noise; determine a target seasonal noise data sequence based on the seasonal gradient noise and the initial industrial equipment data based on a preset seasonal forward diffusion formula, wherein the preset seasonal forward diffusion formula is: , wherein, represents the i-th target seasonal noise data in the target seasonal noise data sequence, represents the i-th target seasonal noise data, represents the initial seasonal data corresponding to the initial industrial equipment data, represents the seasonal gradient noise; determine a seasonal loss function corresponding to the seasonal noise diffusion model based on the target seasonal noise data sequence; determine seasonal denoising data based on the seasonal noise diffusion model and the target seasonal noise data sequence based on a preset seasonal reverse growth formula; A mixed noise detection unit configured to perform mixed anomaly detection processing on the obtained initial industrial equipment data, the trend denoising data, and the seasonal denoising data based on the mixed anomaly diffusion model included in the GNDC-DM model to generate equipment denoising data; the mixed noise detection unit is further configured to: determine a mixed gradient noise based on a preset constraint condition and a Gaussian noise; determine a target mixed noise data sequence based on the mixed gradient noise and the initial industrial equipment data based on a preset mixed forward diffusion formula; Determine a mixed loss function corresponding to the mixed anomaly diffusion model based on the initial industrial equipment data, the target mixed noise data sequence, a target trend noise data sequence corresponding to the trend denoising data, and a target seasonal noise data sequence corresponding to the seasonal denoising data, wherein the mixed loss function is: , in, Represents the mixed loss function. Expressing expectations, This represents the initial mixed data corresponding to the initial industrial equipment data. Indicates by A parameterized denoising neural network, whose input is The condition variable is and , Represents the first in the target mixed noise data sequence Mixed noise data for each target Indicating the first [item] in the target trend noise data sequence Individual target trend noise data, Represents the first element in the target seasonal noise data sequence. Target seasonal noise data; Determine a cross-attention model included in the mixed anomaly diffusion model based on a preset trend seasonal condition, wherein the preset trend seasonal condition is: , wherein, denotes a preset trend season condition, denotes a weight coefficient, The cross-attention model is: , wherein, denotes a cross-attention model, denotes a query vector, denotes a condition converted by an embedding layer, denotes an embedding vector of a length, denotes a dimension, , denotes a key, , denotes a time-series input representation of each layer of cross-attention, denotes a value, , denotes a query matrix, denotes a key matrix, denotes a value matrix; Determine the equipment denoising data based on a preset mixed reverse growth formula, the mixed anomaly diffusion model, and the target mixed noise data sequence.
6. A computer device, wherein, The computer device includes a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the method according to any one of claims 1-4 are implemented.
7. A computer readable storage medium, wherein, The computer readable storage medium stores a computer program, wherein when the computer program is executed by the processor, the steps of the method according to any one of claims 1-4 are implemented.
Citation Information
Patent Citations
Network flow prediction system based on time sequence decomposition
CN116992986A
Abnormality detection method based on time series data prediction
CN118171214A