Time sequence anomaly detection method based on iterative feedback and adaptive diffusion model
By optimizing the selection of observation points through an iterative feedback mechanism, and combining an adaptive conditional diffusion model and a dynamic weight smoothing strategy, the problem of observation point selection relying on human experience and boundary inconsistencies in existing time series anomaly detection is solved, thereby improving detection accuracy and robustness.
Patent Information
- Application Number
- CN202511283861.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-09
- Publication Date
- 2026-01-16
AI Technical Summary
Existing time series anomaly detection methods rely on human experience in selecting observation points, the models are not sensitive enough to anomalies, and there are boundary inconsistencies at the junction of missing and observed regions, resulting in insufficient detection accuracy and robustness.
An observation point selection mechanism based on iterative feedback is adopted, which combines an adaptive conditional diffusion model and a dynamic weight smoothing strategy. The observation point selection is optimized through a multi-round iterative feedback mechanism. An adaptive weight driven by anomaly scores is introduced, and the fusion ratio of real observations and generated values is dynamically adjusted during the back diffusion process to alleviate the boundary inconsistency problem.
It significantly improves the rationality of observation point selection and the accuracy of filling results, enhances the model's sensitivity to outliers, reduces error distortion caused by boundary discontinuities, and achieves higher detection accuracy and robustness.
Smart Images

Figure CN121350899A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of time series anomaly detection, and in particular to a time series anomaly detection method based on an iterative feedback and adaptive diffusion model. Background Technology
[0002] With the widespread application and rapid development of information technology in fields such as industrial production, aerospace telemetry, financial risk control, cybersecurity, and healthcare, time series anomaly detection technology is playing an increasingly important role in ensuring system stability and security. The core objective of time series anomaly detection is to promptly identify points or segments in data that significantly deviate from normal patterns, thereby discovering potential faults or abnormal events. However, due to the high dimensionality, strong dependencies, non-stationarity, and complex noise characteristics of real-world time series data, achieving accurate and efficient anomaly detection remains a highly challenging task.
[0003] Existing time series anomaly detection methods mainly include three types: prediction-based methods, reconstruction-based methods, and imputation-based methods. Prediction-based methods predict future values using historical data and use the deviation between the predicted and actual values to identify anomalies. These methods are simple in structure, but their prediction accuracy often drops significantly in complex and variable time series environments, leading to unstable detection performance. Reconstruction-based methods rely on learning the latent distribution of normal samples to reconstruct the input data and identify anomalies based on the reconstruction error. They can achieve certain results when the data distribution is relatively stable, but when the data has heterogeneity or complex dependencies, the model's generalization ability is insufficient, reconstruction accuracy decreases, and anomalies are often difficult to identify accurately. In recent years, imputation-based methods have gradually gained attention. Their basic idea is to use some points as observation points and the rest as missing values, then use imputation algorithms to estimate the missing values and determine anomalies based on the deviation between the estimated and actual values. With the introduction of diffusion models, imputation-based methods have shown strong modeling capabilities in time series anomaly detection, achieving better results than traditional methods. However, these methods still have significant shortcomings: on the one hand, the selection of observation points mainly relies on human experience, and the common method of selecting points at equal intervals is prone to misselecting outliers as observation points, thereby weakening the overall detection effect; on the other hand, all observation points are treated equally during the filling process, failing to reflect the differences in the "normality" of different observation points, and the model cannot highlight normal points with high confidence (i.e., points with lower outlier scores), resulting in insufficient sensitivity to outliers; in addition, at the boundary between the missing area and the observation area, there is often a discontinuity between the filled value and the true observed value, causing the so-called "boundary inconsistency" problem, which further leads to distorted estimation errors and reduces the accuracy of anomaly detection.
[0004] Therefore, while existing methods can accomplish time series anomaly detection tasks to a certain extent, they still face significant shortcomings in practical applications, such as a lack of adaptability in observation point selection, insufficient sensitivity to anomalies, and inconsistent boundary handling. Thus, there is an urgent need to propose a new method that, while maintaining the powerful modeling capabilities of diffusion models, effectively addresses the issues of observation point selection and filling quality, thereby further improving the accuracy and robustness of anomaly detection.
[0005] To address the problems of existing time series anomaly detection methods, such as reliance on manual experience in observation point selection, insufficient model sensitivity to outliers, and boundary inconsistencies at the boundary between missing and observed regions, this invention proposes an Iterative Feedback-based Anomaly Detection (IFAD) method based on an adaptive diffusion model. This method automatically optimizes observation point selection during anomaly detection by introducing an iterative feedback mechanism, gradually increasing the proportion of high-confidence normal points and reducing performance degradation caused by misselected outliers. Simultaneously, this invention introduces adaptive weight allocation based on anomaly scores during the diffusion model backpropagation process, giving higher weight to high-confidence normal points in the filled results, thereby amplifying the differences between outliers and normal points and improving detection sensitivity. Furthermore, the proposed dynamic weight smoothing strategy gradually merges real and generated values during the filling process, effectively alleviating boundary inconsistencies and ensuring the smoothness and continuity of the filled results.
[0006] Through the above improvements, this invention, while maintaining the powerful modeling capabilities of the diffusion model, effectively enhances the rationality of observation point selection and the accuracy of the filling results, significantly strengthens the model's sensitivity to outliers, and reduces error distortion caused by boundary discontinuities. Experimental results show that this method significantly outperforms existing methods on multiple public datasets, achieving higher detection accuracy and robustness, and providing a novel and efficient solution for time series anomaly detection. Summary of the Invention
[0007] The purpose of this invention is to address the shortcomings of existing technologies by providing a time series anomaly detection method based on iterative feedback and adaptive diffusion models.
[0008] To achieve the above objectives, this invention provides a time series anomaly detection method based on iterative feedback and adaptive diffusion models, comprising the following steps:
[0009] Step 1: Adaptive Observation Point Selection: Divide the time series data to be tested into several non-overlapping time windows, and use a density ratio-based change point scoring method to identify possible behavioral abrupt changes in the time series; in the time windows where no abrupt changes are determined, traverse each time point within the window and calculate its probability of being selected as an observation point; the higher the probability value, the more likely the point is to be selected as an observation point; the remaining unselected points will be treated as missing values and enter the subsequent imputation process;
[0010] Step 2: Adaptive Conditional Diffusion Model Fills Missing Values: After the observation points are selected, the adaptive conditional diffusion model is used to fill missing values for the unselected time points; an adaptive weight driven by outlier scores is introduced in the back diffusion process, so that points with lower outlier scores have a larger weight in the filling process, while points with higher outlier scores have a smaller weight, thereby effectively improving the distinction between outlier points and normal points.
[0011] Step 3: Data update based on dynamic weights: Based on conditional diffusion filling of missing values, a smooth update mechanism based on dynamic weights is introduced; the fusion ratio of real observations and generated values is dynamically adjusted at different stages of the back diffusion process;
[0012] Step 4: Anomaly Detection Criteria: After adaptive observation point selection, conditional diffusion missing value filling, and dynamic weight smoothing update, anomaly detection criteria are proposed to finally determine whether each time point in the time series is an anomaly. The degree of anomaly is measured by comparing the difference between the actual observed value and the model estimate.
[0013] Furthermore, in step 1, the variable point scoring method based on density ratio includes calculating the density ratio of the time window and the variable point score of the window;
[0014] The density ratio of time window k to g k The formula for calculating (x) is as follows:
[0015]
[0016] Where x is the sample point, f k-1 (x) and f k (x) represents the probability density function estimates in adjacent windows k-1 and k, respectively;
[0017] Window variable point score The calculation formula is:
[0018]
[0019] Where s is the length of the window, x i This represents the value at the i-th time point; if the window score A larger value indicates that the window is more likely to contain a mutation point.
[0020] Furthermore, in step 2, the weight w of the current point is calculated based on the anomaly score of the previous iteration. l (c i The formula is as follows:
[0021]
[0022] Among them, c i AS represents the actual observed value at the i-th time point. l-1 (c i ) represents the anomaly score at the i-th time point in the (l-1)-th iteration, where l represents the iteration number and α is a hyperparameter;
[0023] During the initialization phase, the model initially fills in some missing points using the bicubic interpolation function g(·) and then integrates it with Gaussian noise. The initial state x is obtained by fusion. T :
[0024]
[0025] Where x ob Let κ be the set of observation points, and κ be the equilibrium parameter.
[0026] In the reverse diffusion process, the conditional probability distribution is modeled as follows:
[0027]
[0028] in, To generate values for the diffusion model, x t x is the input at step t. ob These are actual observations. Let I be a constant, and μ be the identity matrix. θ (·) represents the estimated mean of the generation process;
[0029] The mean of this distribution depends on the denoising network f. θ (·), and its optimization objective is:
[0030]
[0031] in, Indicates expectations regarding the data. This represents the expectation for the time step, and ∈ represents noise.
[0032] Furthermore, during the iteration process, the conditional mean is expressed as:
[0033]
[0034] in,
[0035] The generation steps are given by the following formula:
[0036]
[0037] Where x t Let α be the input at step t. t =1-β t , It is a constant. This represents Gaussian noise; through adaptive weight control, the model can gradually strengthen normal points and weaken abnormal points during the generation process, thereby improving the sensitivity of anomaly detection.
[0038] Furthermore, in step 3, the weighting function h(·) is defined as follows:
[0039] h(t-1)=N0e -λ(t-1) (9)
[0040] Where N0 is the initial weight value, λ is the decay coefficient, and t represents the t-th step; as the number of iterations increases, the weight gradually increases, enabling the observation point to play a greater role in later iterations;
[0041] At each iteration update, the smoothing result is given by the following formula:
[0042]
[0043] Among them, s m Here is the mask matrix for the observation points, where ⊙ denotes element-wise multiplication. To generate values for the diffusion model, x ob W1 represents the weighting factor determined by the set of observation points, which is the actual observation value. This formula ensures that the generated results are mainly relied upon in the early stage of the iteration to avoid introducing noise interference too early, while the influence of the observation points is gradually increased in the later stage, so that the results can balance smoothness and authenticity when converging.
[0044] Furthermore, in step 4, the anomaly score at time point i is calculated, and its definition is as follows:
[0045]
[0046] Among them, c i This represents the actual observed value at the i-th time point. This represents the estimated value obtained at that time point after conditional diffusion and dynamic smoothing, where d represents the dimension of the time series. and These are the true value and the estimated value in the k-th dimension, respectively; the larger the anomaly score, the greater the deviation of that point from the normal pattern.
[0047] Furthermore, after calculating the outlier scores at all time points, a threshold discrimination method is used to distinguish between normal points and outliers; when the outlier score AS(c) at a certain time point... i If the time exceeds the preset threshold τ, the time point is determined as an abnormal point; otherwise, it is determined as a normal point.
[0048] The beneficial effects of this invention are as follows: Compared with existing methods, the core innovations of this invention are reflected in the following three aspects: First, this invention proposes an observation point selection mechanism based on iterative feedback. Traditional filling methods usually directly fill missing values after selecting observation points once, which easily leads to outliers being mistakenly selected as observation points. This invention gradually updates the observation point set through a multi-round iterative feedback mechanism, re-evaluating the credibility of observation points based on historical outlier scores in each iteration, thereby ensuring that more normal points are selected as observation points, significantly improving the accuracy and stability of filling. Second, this invention designs an adaptive conditional diffusion model. Based on the traditional diffusion model, dynamic weights driven by outlier scores are introduced, making high-confidence observation points have a greater influence in the diffusion reverse iteration process, while low-confidence points are suppressed, thereby reducing the bias introduced by outliers. Third, this invention proposes a data smoothing strategy based on dynamic weights. In each step of the reverse diffusion, by dynamically adjusting the fusion ratio of real observations and generated values, the model relies on generated results in the early stage of iteration and gradually strengthens the role of real observations in the later stage of iteration, thereby generating filling values that are both real and smooth, effectively alleviating the boundary abruptness problem.
[0049] Compared with existing methods, the IFAD method of this invention has significant differences and advantages in specific technical means. Compared with prediction-based methods, this invention does not rely on a single time-dependent modeling, but directly estimates missing values through a filling framework, making the anomaly detection process more robust. Compared with reconstruction-based methods, this invention uses a diffusion-generative model to progressively approximate the true distribution, avoiding the problem of overfitting outliers in the potential space. Compared with traditional filling methods, the combination of iterative feedback observation point selection, adaptive conditional diffusion, and dynamic smoothing strategies in this invention can effectively alleviate the performance degradation problem caused by anomaly concentration, thereby achieving higher detection accuracy and robustness.
[0050] In summary, the IFAD method proposed in this invention significantly improves the performance of time series anomaly detection through innovative mechanisms such as iterative feedback observation point selection, adaptive conditional diffusion generation, and dynamic weight smoothing update. This method not only demonstrates superiority on multiple public datasets but also provides a novel technical path for anomaly detection based on generative models, possessing significant research value and broad application prospects. Attached Figure Description
[0051] Figure 1 This is a framework diagram of the method of the present invention;
[0052] Figure 2 This is a schematic diagram of the ablation experiment results in an embodiment of the present invention;
[0053] Figure 3 This is a schematic diagram of the detection results of IFAD under different iterations of the present invention. Detailed Implementation
[0054] This invention proposes a diffusion model-based time series anomaly detection method based on an iterative feedback mechanism. Its core idea is to improve the accuracy and robustness of time series anomaly detection through an adaptive observation point selection strategy, a conditional diffusion generation model with feedback weights, and a boundary smoothing mechanism.
[0055] The system model of the present invention is as follows: Figure 1 As shown, the system contains three parts: (1) an observation point selection scheme based on iterative feedback, which identifies and selects more normal points as observation points through multiple rounds of iteration; (2) an adaptive conditional diffusion module, which fills in missing values by applying adaptive weights to the observation points using a diffusion model; and (3) a data smoothing strategy based on dynamic weights, which dynamically updates the observation values in each reverse iteration.
[0056] The time series anomaly detection method based on an iterative feedback conditional diffusion model proposed in this invention comprises the following steps:
[0057] Step 1: Adaptive Observation Point Selection
[0058] The time series data to be tested is divided into several non-overlapping time windows. To identify potential behavioral abrupt changes in the time series, this invention employs a change point scoring method based on density ratio. Specifically, the density ratio g of time window k... k The formula for calculating (x) is as follows:
[0059]
[0060] Where x is the sample point, f k-1 (x) and f k(x) represents the probability density function estimates in adjacent windows k-1 and k, respectively.
[0061] Based on this, the window's variable point score The calculation formula is:
[0062]
[0063] Where s is the length of the window, x i This represents the value at the i-th time point. If the window score... A larger value indicates that the window is more likely to contain a mutation point.
[0064] Within a time window where no mutation points are identified, this invention iterates through each time point within the window and calculates the probability of it being selected as an observation point. The higher the probability value, the more likely the point is to be selected as an observation point; the remaining unselected points will be treated as missing values and enter the subsequent imputation process. This adaptive observation point selection method effectively reduces the risk of outliers being mistakenly selected as observation points, providing a more reliable foundation for subsequent missing value imputation and anomaly detection.
[0065] Step 2: Implanting missing values using an adaptive conditional diffusion model
[0066] After the observation points are selected, this invention uses an adaptive conditional diffusion model to fill in missing values for the unselected time points. Unlike traditional diffusion models, this invention introduces anomaly score-driven adaptive weights during the reverse diffusion process, giving points with lower anomaly scores a larger weight during the filling process, while giving points with higher anomaly scores a smaller weight, thereby effectively improving the distinction between anomaly points and normal points.
[0067] Specifically, the weight w of the current point is first calculated based on the outlier score from the previous iteration. l (c i The formula is as follows:
[0068]
[0069] Among them, c i AS represents the actual observed value at the i-th time point. l-1 (c i Let represent the anomaly score at time point i in the (l-1)th iteration, where l represents the iteration number and α is a hyperparameter. Therefore, when point c... i The larger the abnormal score, the smaller its weight value, and vice versa.
[0070] During the initialization phase, the model initially fills in some missing points using the bicubic interpolation function g(·) and then integrates it with Gaussian noise. The initial state x is obtained by fusion. T:
[0071]
[0072] Where x ob Let be the set of observation points, and κ be the equilibrium parameter.
[0073] In the reverse diffusion process, the conditional probability distribution is modeled as follows:
[0074]
[0075] in, To generate values for the diffusion model, x t x is the input at step t. ob These are actual observations. Let I be a constant, and μ be the identity matrix. θ (·) represents the estimated mean of the generation process.
[0076] The mean of this distribution depends on the denoising network f. θ (·), and its optimization objective is:
[0077]
[0078] in, Indicates expectations regarding the data. This represents the expectation for the time step, and ∈ represents noise.
[0079] During the iteration process, the conditional mean can be expressed as:
[0080]
[0081] in,
[0082] The generation steps are given by the following formula:
[0083]
[0084] Where x t Let α be the input at step t. t =1-β t , It is a constant. This represents Gaussian noise. Through this adaptive weight control, the model can gradually strengthen normal points and weaken outliers during the generation process, thereby improving the sensitivity of anomaly detection.
[0085] Step 3: Data Update Based on Dynamic Weights
[0086] Building upon conditional diffusion for filling missing values, this invention further introduces a smoothing update mechanism based on dynamic weights to alleviate the discrepancy between observed points and filled values in the boundary region. The core idea is to dynamically adjust the fusion ratio of the true observed values and generated values at different stages of the reverse diffusion process, ensuring that the filling result maintains both accuracy and smoothness.
[0087] Specifically, the weighting function h(·) is defined as follows:
[0088] h(t-1)=N0e -λ(t-1) (9)
[0089] Where N0 is the initial weight value and λ is the decay coefficient. As the number of iterations increases, the weights gradually increase, allowing the observation points to play a greater role in later iterations.
[0090] At each iteration update, the smoothing result is given by the following formula:
[0091]
[0092] Among them, s m Here is the mask matrix for the observation points, where ⊙ denotes element-wise multiplication. To generate values for the diffusion model, x ob For the actual observations, W1 represents the weighting factor determined by the set of observation points. This formula ensures that the initial iterations primarily rely on the generated results to avoid premature noise interference, while gradually increasing the influence of the observation points in the later stages, so that the results balance smoothness and realism upon convergence.
[0093] By employing a dynamic weight smoothing strategy, this invention can maintain continuous filling results near anomaly points, eliminating errors caused by boundary inconsistencies, thereby further improving the final anomaly detection performance.
[0094] Step 4: Anomaly Detection Criteria
[0095] After adaptive observation point selection, conditional diffusion missing value imputation, and dynamic weight smoothing update, this invention further proposes an anomaly detection criterion to ultimately determine whether each time point in the time series is an anomaly. Its core idea is to measure the degree of anomaly by comparing the difference between the actual observed values and the model estimates.
[0096] Specifically, the anomaly score at time point i is first calculated, as defined below:
[0097]
[0098] Among them, c i This represents the actual observed value at the i-th time point. This represents the estimated value obtained at that time point after conditional diffusion and dynamic smoothing, where d represents the dimension of the time series. and These are the true value and the estimated value in the k-th dimension, respectively. The larger the anomaly score, the greater the deviation from the normal pattern at that point.
[0099] After calculating the anomaly scores at all time points, this invention uses a threshold discrimination method to distinguish between normal points and anomaly points. When the anomaly score AS(c) at a certain time point... i If the time point exceeds a preset threshold τ, it is considered an outlier; otherwise, it is considered a normal point. The threshold τ can be set according to the specific application scenario. For example, it can be set by statistical methods to the mean of all outlier scores plus a certain number of standard deviations, or the optimal value can be obtained through validation set experiments.
[0100] Based on the above discrimination criteria, this invention can achieve high-precision anomaly detection in complex multidimensional time series, effectively cope with various complex situations such as sparse, clustered or heterogeneous anomalies, and ensure the accuracy and robustness of the detection results.
[0101] Example 1
[0102] This invention validates the performance of the proposed time-series anomaly detection method (IFAD) based on an iterative feedback conditional diffusion model through extensive simulation experiments. The experiments were conducted in a Python environment, with the core diffusion model implemented in PyTorch. The experimental data covers several publicly available benchmark datasets for time-series anomaly detection, as shown in Table 1, including the SMAP, MSL, SMD, SWaT, and PSM datasets. These datasets are widely used in industrial equipment monitoring and system safety research, and are characterized by multi-dimensionality, long-term time series, and low anomaly ratios, thus comprehensively validating the effectiveness and robustness of the proposed method.
[0103] Table 1 Statistical information of the dataset
[0104] Dataset Application scenarios Dimensions Data points Abnormal percentage (%) MSL aerospace 55 132,046 10.50% SWAT Water treatment 51 944,919 12.10% PSM server 25 220,322 27.80% SMAP aerospace 25 562,800 12.80% SMD server 38 1,416,825 4.20%
[0105] To ensure fairness in the comparison, this invention selects several existing advanced methods as benchmarks, including: prediction-based methods (such as LSTM prediction models), reconstruction-based methods (such as AutoEncoder variational autoencoders), padding-based methods (such as the USAD padding detection model), and the latest diffusion probability model detection methods. All baseline methods utilize publicly available source code or parameter settings from published papers.
[0106] 1. Anomaly Detection Performance Comparison
[0107] The experiments first tested the performance of the proposed method against several mainstream methods on five publicly available benchmark datasets (SMAP, MSL, SMD, SWAT, and PSM). The comparison methods included prediction-based methods (such as LSTM and Informer), reconstruction-based methods (such as AutoEncoder and USAD), and state-of-the-art diffusion model detection methods. The evaluation metrics used were Precision, Recall, and F1-score.
[0108] The results show that the proposed IFAD outperforms the comparative methods on all five datasets. Especially in scenarios with densely distributed outliers, the recall rates of traditional prediction and reconstruction methods significantly decrease, while the proposed method maintains a high detection rate. The results demonstrate that the proposed method achieves a good balance between precision and recall, ultimately achieving the best performance on the F1-score.
[0109] Table 2 shows the detection performance of the present invention and various comparison methods on the SMAP and MSL datasets. It can be seen that IFAD achieves the highest F1 score on both datasets, verifying its effectiveness in spacecraft system monitoring scenarios.
[0110] Table 2 Comparison of Anomaly Detection Performance
[0111]
[0112] 2. Ablation experiment
[0113] To analyze the role of each module in this invention, an ablation experiment was further designed to compare the performance of different variants, such as removing the iterative feedback mechanism, removing adaptive conditional diffusion, and removing the dynamic smoothing strategy.
[0114] Experimental results show that removing the iterative feedback mechanism decreases the accuracy of observation point selection, leading to a reduction in the quality of filled values and a significant decrease in detection performance. Removing adaptive conditional diffusion weakens the suppression of outliers and increases the false alarm rate. Removing the dynamic smoothing strategy easily causes boundary distortion during the back diffusion process, causing filled values to deviate from the true distribution. The detection performance degradation is greatest when all three mechanisms are missing simultaneously.
[0115] like Figure 2 As shown, the comparison curves of ablation experiment results are displayed, which can intuitively reflect the contribution of each module to the final detection performance. The complete IFAD method proposed in this invention consistently maintains the highest detection accuracy, indicating that the three modules work together to improve the detection effect.
[0116] 3. Analysis of the impact of iteration number
[0117] To further investigate the convergence and effectiveness of the iterative feedback mechanism, experiments were conducted at different iteration counts. The experiments tested the detection performance variations across the SMD and PSM datasets, examining iteration counts from 1 to 15.
[0118] Experimental results show that the F1-score gradually increases with the number of iterations, reaching a stable convergence state around 10 iterations. In a few cases, excessive iterations do not bring additional benefits, but in most scenarios, the iteration mechanism significantly improves the reliability of observation point selection, thereby improving detection performance.
[0119] like Figure 3 As shown, the F1-score trend curves are displayed for different number of iterations. It can be seen that the IFAD method converges within 10 iterations, indicating that the method is not only effective but also computationally efficient.
Claims
1. A time series anomaly detection method based on iterative feedback and adaptive diffusion model, characterized in that, The method comprises the following steps: Step 1: adaptive observation point selection: the time series data to be detected is divided into several disjoint time windows, a density ratio-based change point score method is used to identify possible behavior mutation points in the time series; in the time window where no mutation point is determined, each time point in the window is traversed, and the probability of being selected as an observation point is calculated; the greater the probability value, the more likely the point is to be selected as an observation point; the remaining unselected points will be missing values into the subsequent filling link; Step 2: adaptive conditional diffusion model fills in missing values: after the observation point selection is completed, the adaptive conditional diffusion model is used to fill in the missing values of the unselected time points; In the reverse diffusion process, an adaptive weight driven by the anomaly score is introduced, so that the points with lower anomaly scores occupy a larger weight in the filling process, and the points with higher anomaly scores occupy a smaller weight, thereby effectively improving the distinction between abnormal points and normal points; Step 3: data update based on dynamic weight: on the basis of filling in missing values by conditional diffusion, a smoothing update mechanism based on dynamic weight is introduced; The fusion ratio of real observation value and generated value is dynamically adjusted at different stages of the reverse diffusion process; Step 4: abnormal detection criterion: after adaptive observation point selection, conditional diffusion missing value filling and dynamic weight smoothing update, an abnormal detection criterion is proposed to determine whether each time point in the time series is an abnormal point, and the abnormal degree is measured by comparing the difference between the actual observation value and the model estimated value.
2. The time series anomaly detection method based on iterative feedback and adaptive diffusion model according to claim 1, characterized in that, In step 1, the density ratio-based change point score method comprises calculating the density ratio of the time window and the change point score of the window; Density ratio g of time window k k (x) The calculation formula is as follows: where x is a sample point, f k-1 (x) and f k (x) are the probability density function estimates in the adjacent windows k-1 and k, respectively. Windowing inflection point score The formula is: where s is the length of the window, x i represents the value at the i-th time point; if the score of the window is larger, it indicates that the window is more likely to contain a mutation point. 3.The time series anomaly detection method based on iterative feedback and adaptive diffusion model according to claim 1, wherein, In step 2, the weight w of the current point is calculated according to the anomaly score of the last iteration l (c i ), as follows: where c i represents the actual observation value at the i-th time point, AS l-1 (c i ) represents the anomaly score at the i-th time point in the l-1th iteration, l represents the iteration number, and a is a hyperparameter; In the initialization stage, the model fills in the missing points with a bicubic interpolation function g(·) and adds Gaussian noise The initial state x T is obtained by fusing where x ob is a set of observation points, and k is a balancing parameter. In the reverse diffusion process, the conditional probability distribution is modeled as: where, is the value generated for the diffusion model, x t is the input for the t-th step, x ob is the true observation, is a constant, I denotes the identity matrix, μ θ (·) denotes the estimated mean of the generation process; The mean of this distribution depends on the denoising network f θ (·), which optimizes the objective: wherein, denotes the expectation over data, denotes the expectation over time steps, ∈ denotes noise.
4. The time series anomaly detection method based on iterative feedback and adaptive diffusion model according to claim 3, characterized in that, In the iteration process, the conditional mean is expressed as: wherein The generation step is given by the following formula: where x t is the input of the tth step, a t = 1 - b t , is a constant, represents Gaussian noise; through adaptive weight control, the model can gradually strengthen normal points and weaken abnormal points during the generation process, thereby improving the sensitivity of anomaly detection.
5. The time series anomaly detection method based on iterative feedback and adaptive diffusion model according to claim 1, characterized in that, In step 3, the weight function h(·) is defined as follows: h(t - 1) = N0e -λ(t-1) (9); Where N0 is the initial weight value, λ is the decay coefficient, and t represents the t-th step; As the number of iteration steps increases, the weight gradually increases, so that the observation point plays a greater role in the later iteration; In each round of iteration update, the smoothing result is given by the following formula: where s m is the mask matrix of the observation points, and represents the element-wise multiplication, is the diffusion model generated value, x ob is the real observation value, and W1 represents the weight factor determined by the observation point set; this formula ensures that the generated result is mainly relied on in the early stage of iteration, avoiding the introduction of noise interference too early, and gradually increasing the influence of the observation points in the later stage, so that the result considers both smoothness and authenticity when converging. 6.The time series anomaly detection method based on iterative feedback and adaptive diffusion model according to claim 1, wherein, In step 4, the anomaly score of time point i is calculated, which is defined as follows: where c i represents the actual observation at the i-th time point, represents the estimated value at this time point after the conditional diffusion and dynamic smoothing, d represents the dimension of the time series, and are the true value and the estimated value in the k-th dimension, respectively; the larger the anomaly score, the higher the degree of deviation from the normal pattern.
7. The time series anomaly detection method based on iterative feedback and adaptive diffusion model according to claim 6, characterized in that, After the abnormality scores of all time points are calculated, a threshold discrimination method is used to distinguish normal points from abnormal points; when the abnormality score AS(c i ) of a time point exceeds a preset threshold τ, the time point is determined as an abnormal point, otherwise it is determined as a normal point.