Power system data generation method based on outlier detection and deep generative model
By combining outlier detection and a deep generative model with a CAD-TCN-Adaptive Skip-LSTM adversarial autoencoder, the problems of timing deviation and outliers in power system data generation are solved, achieving high-quality data generation and expansion, and improving data integrity and accuracy.
Patent Information
- Application Number
- CN202511706418.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-20
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2045-11-20
AI Technical Summary
Existing power system data generation methods are ineffective in processing high-dimensional, strongly correlated power system data, resulting in deviations in the generated samples in terms of time-series evolution trends and local fluctuation details. Furthermore, they fail to effectively identify and remove outliers, affecting the usability and accuracy of the data.
A method based on outlier detection and deep generative models, including outlier detection, data completion, and an adversarial autoencoder model based on CAD-TCN-Adaptive Skip-LSTM, is used to fit power system data, capture local temporal and long-range dependencies, and generate new power system data samples.
It improves the integrity and accuracy of power system data, ensuring that the generated data is consistent with the real data in terms of time sequence and local details, and enhances the usability and representativeness of the data in complex scenarios.
Smart Images

Figure CN121167313B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method for generating power system data based on outlier detection and a deep generative model. Background Technology
[0002] As the penetration rate of renewable energy sources such as wind power and photovoltaics continues to increase in the power system, the operating environment of the power system is becoming increasingly complex. Compared with traditional thermal power units, new energy power generation exhibits significant volatility, intermittency, and uncertainty, resulting in diverse operating states of the system at different times. In actual operation, key indicators of the power system, such as bus voltage and phase angle, load active power and reactive power, are not only numerous but also exhibit significant high-dimensional characteristics and time-series correlations. The power system state at different points in time is often interconnected, and short-term fluctuations can affect long-term operating trends. Simultaneously, spatially, changes between variables such as various buses and load points are highly coupled. This complex dynamic evolution pattern makes power system data highly nonlinear in both time and spatial dimensions.
[0003] In this context, obtaining sufficient and balanced data has become a major challenge. First, data samples corresponding to extreme operating scenarios or rare special events (such as large-scale rapid grid connection of new energy sources, sudden load fluctuations, or equipment malfunctions) are extremely limited. This scarcity of data for these critical scenarios directly impacts the reliability of system analysis, simulation, and strategy formulation. Second, routine operating state data constitutes the vast majority, while the distribution of data across different types or time periods varies significantly, resulting in a severe imbalance in the data itself. If this imbalance is ignored when training generative models or expanding data, the generated samples often favor frequently occurring states, while rare but crucial operating modes may not be effectively generated, thus weakening the representativeness and effectiveness of the generated data in engineering applications.
[0004] Existing data generation and expansion methods also have significant limitations in addressing these issues. While traditional autoencoders or generative adversarial networks (GANs) can generate new samples, they typically focus on reconstructing overall numerical values or aligning sample distributions, making it difficult to simultaneously ensure the latent space rationality of the generated data and the consistency of time-series dynamic features. For example, generated data may approximate real samples at the point value level, but deviations exist in temporal evolution trends, spectral characteristics, or local fluctuation details, leading to errors in simulating dynamic processes or training downstream algorithms. For high-dimensional, strongly correlated power system data, traditional methods struggle to fully capture local temporal context and long-range dependencies, often resulting in inaccurate local details in the generated samples, further impacting data usability in complex scenarios. On the other hand, effective data quality assurance is crucial before data generation and expansion. Actual power system measurement data typically contains a certain proportion of outliers, caused by factors such as sampling bias, equipment failure, or sensor errors. Failure to identify and remove these data will interfere with subsequent processing, reducing accuracy and robustness. Furthermore, if a uniform detection method is adopted without fully considering the distribution characteristics of different variables, normal data may be misjudged and incorrectly removed. Summary of the Invention
[0005] In view of this, the present invention provides a power system data generation method based on outlier detection and deep generation model to improve the integrity of power system data.
[0006] In a first aspect, the present invention provides a power system data generation method based on outlier detection and a deep generation model, the method comprising:
[0007] Step 1: Collect raw operating data of the power system, and detect and remove outliers from the raw operating data;
[0008] Step 2: After detecting and removing outliers, use cubic spline interpolation and moving average to complete the missing and removed data;
[0009] Step 3: Fit the completed data based on the constructed CAD-TCN-Adaptive Skip-LSTM-based adversarial autoencoder model to capture the local temporal and long-range dependencies of the data.
[0010] Step 4: Use the fitted model to generate new power system data samples to expand the data volume.
[0011] Optionally, step 1 includes: identifying abnormal data using statistical analysis and clustering methods based on the distribution characteristics of the original operating data;
[0012] First, examine the potential distribution characteristics of the original running data, using D'Agostino'K... 2 The test, used to assess normality by standardizing skewness and kurtosis, constructs a test statistic that approximates a chi-square distribution, thereby quantifying the deviation of a sample from a normal distribution; D'Agostino'K 2 The p-value is compared with the significance level α1, where the p-value represents the probability of the current or extreme test statistic occurring under the null hypothesis. A larger p-value indicates a higher probability of rejecting the null hypothesis, suggesting the data follows a normal distribution. If p > α1, the data also follows a normal distribution, and under this condition, the p-value is used. Outlier detection is performed in principle. The outlier detection interval is: Sample points that exceed the outlier detection range are identified as outliers and removed.
[0013] Secondly, for raw data that does not follow a normal distribution, K-means and interquartile range (IQR) are combined for detection. K-means is used to divide the data into internally consistent subsets, and IQR is used to identify outliers. The raw data is first clustered, and then outliers are identified within each cluster. The optimal number of clusters is determined using the silhouette coefficient method. Select the one with the largest corresponding contour coefficient. As the final cluster number:
[0014] ;
[0015] in, After determining the optimal number of clusters, K-means clustering is used, and outliers are detected within the j-th cluster based on IQR; the first quartile distance is calculated. Third and fourth intervals and interquartile range The expression for non-normal or skewed distributed data is: ;according to Determine the interval for judging outliers within the cluster: Sample points that exceed the outlier judgment range within the cluster are identified as outliers and removed.
[0016] Optionally, step 2 includes:
[0017] After outliers were detected and removed, the missing data was imputed using a nonlinear interpolation method, namely cubic spline interpolation; the spline interpolation was performed in each interval. Construct a local cubic polynomial, whose expression is:
[0018] ;
[0019] in, The coefficients are uniquely determined by the interpolation conditions and the continuity conditions of the first and second derivatives at the nodes;
[0020] A moving average is used to impute missing values at the beginning and end of the data sequence. A fixed-length sliding window is set, and the mean of adjacent known data within the window is calculated and used as a substitute for the missing value. The window then moves forward or backward in steps until all boundary missing values are imputed. The expression is as follows:
[0021] ,or ;
[0022] in, This is the estimated value for the t-th missing value; and represents the known data adjacent to the missing point; k is the length of the sliding window.
[0023] Optionally, step 3 includes:
[0024] Complex high-dimensional temporal data is modeled and generated by fusing a cellular automata-driven temporal convolutional network (CAD-TCN) and an adaptive skip long short-term memory (LSTM) network. An adversarial autoencoder (AAE) serves as the core framework, introducing adversarial regularization into the latent space to ensure the encoder output conforms to a pre-defined Gaussian distribution. This enhances continuity and sampleability while maintaining reconstruction accuracy, generating samples that match the characteristics of real data through standard normal sampling. The data is then normalized and subjected to sliding window sampling before being input into the encoder.
[0025] The CAD-TCN module, as one of the core feature extractors in the encoder, is used for hierarchical, multi-scale, and dynamically interactive representation learning of high-dimensional temporal data. First, the CAD-TCN module uses causal dilated convolution as the initial transformation: for the input at time step t... Applying a one-dimensional causal dilated convolution yields the initial feature vector. :
[0026] ;
[0027] Where d is the dilation rate, which takes values of 8, 4, 2, and 1; K is the kernel size; and W... k The convolution weights are followed by batch normalization (BN) and the activation function LeakyReLU to stabilize training and increase non-linear representation.
[0028] Building upon the initial convolutional features, the CAD-TCN module employs differentiable cellular automata evolutionary units to model dynamic interactions between local neighborhoods; each feature... The state vector is considered as a cell. Define a lightweight rule network. The rule network is a multilayer perceptron (MLP) used to learn from the neighborhood. Generate state update quantity:
[0029] ;
[0030] To facilitate parallel computation and boundary handling, the input undergoes symmetrical padding in the time dimension, neighborhood indices are constructed in batches, and neighborhood information is extracted using efficient tensor operations before being flattened and fed into the rule network. Cellular evolution transforms neighborhood interactions from linear mixing with fixed convolutional kernels into learnable nonlinear updates, allowing the model to adaptively determine how information propagates over time within a local range. Cellular evolution is executed iteratively, updating with small step sizes at each step to ensure stability; its expression is:
[0031] ;
[0032] Where α2 is the update step size and k is the number of evolution iterations;
[0033] Residual connections and projection mappings are preserved in each CAD-TCN module. The final output of the CAD-TCN module is expressed as the sum of the evolved features and the linearly mapped input.
[0034] ;
[0035] in, Use 1×1 convolutions or linear transformations for dimension alignment;
[0036] The CAD-TCN module combines the multi-scale receptive field of dilated convolution with neighborhood-based learnable cell evolution to improve the ability to model temporal patterns; and provides high-order features for the learned latent distribution in the generative framework of AAE; the high-order features extracted by the CAD-TCN module are passed to the Adaptive Skip-LSTM module to further integrate cross-step-size dependencies and adaptively retain information of key time steps, working together to generate and expand temporal data;
[0037] The Adaptive Skip-LSTM module, another important component of the encoder, is responsible for modeling key moments, highlighting important information in local time slices while ensuring efficiency. The Adaptive Skip-LSTM module uses a gating mechanism to dynamically determine the update of the hidden state based on the difference between the current input and historical states. This includes:
[0038] Let the input sequence be x t The hidden state in the previous time step was h. t-1The memory state is c t-1 Then the gate function g t The expression is:
[0039] ;
[0040] in, W is the sigmoid function. g With b g The weight parameters and bias terms of the gating are used to output the gating value. Indicates the update strength or update frequency at the current time step; when g t When g approaches 1, it indicates that the information at the current time step is important, and the model will update the hidden and memory states; when g approaches 1... t When g approaches 0, the model tends to skip updates and inherit the state from the previous time step; if g... t If the value is in the middle, a partial update, or soft update, is performed, achieving a smooth transition by weighted merging of the old and new states:
[0041] ;
[0042] ;
[0043] in, and This represents the update result of the standard LSTM unit at the current moment;
[0044] In the entire encoder design, the input power system time-series data first passes through a four-layer CAD-TCN module, with dilation rates d of 1, 2, 4, and 8 for each module, and convolutional kernel numbers of 32, 64, 128, and 256, respectively, to extract local temporal dynamics. The CAD-TCN module, based on causal dilated convolution to capture multi-scale temporal dependencies, uses a learnable cellular automata-driven mechanism to treat the features at each time step as a cell. Subsequently, the dependency information is integrated through an Adaptive Skip-LSTM module to model the key global temporal structure. Finally, a fully connected layer maps the high-dimensional temporal features to a latent space representation z. The discriminator uses the latent variables output by the encoder. As input, the data passes through three fully connected layers containing 128 neurons each and the LeakyReLU activation function, finally passing through a single-neuron output layer to obtain a discriminant value, used to determine the authenticity of the input sample. During the AAE fitting process, to ensure that the latent variable z output by the encoder approximates the preset true distribution, a discriminator is introduced to achieve distribution matching in the latent space. The discriminator's input includes two latent vectors: one is the latent representation obtained by the encoder from the original running data, which follows the posterior distribution Q learned by the model. z The other is from the standard normal distribution. The real samples obtained from the sampling in the middle; the goal of the discriminator is to learn to distinguish samples from the real distribution P. z The sample and the output Q from the encoder z The samples are distinguished; the discriminator optimization objective is based on Wasserstein distance:
[0045] ;
[0046] Where D(•) represents the output of the discriminator;
[0047] Meanwhile, the optimization objective of the encoder is to make its output latent vector distribution Q z With the true distribution P z To achieve convergence and thus an adversarial effect; the encoder's loss function is:
[0048] ;
[0049] To further verify the consistency between the encoder output latent spatial distribution and the preset standard normal distribution, the maximum mean difference (MMD) is introduced to measure the difference between the two distributions:
[0050] ;
[0051] Where z and These are samples from the real distribution and the encoder distribution, respectively. For kernel functions;
[0052] Subsequently, the decoder maintains a mirror-symmetric relationship with the encoder in its overall structure. Its input is the latent vector z. First, it recovers temporal dependencies using a RepeatVector operation and an Adaptive Skip-LSTM layer. Then, it achieves layer-by-layer reconstruction of multi-scale features through four layers of CAD-TCN modules with progressively decreasing dilation rates and convolutional kernels. The dilation rates d are designed to be 8, 4, 2, and 1, and the number of convolutional kernels are 256, 128, 64, and 32. Finally, it generates the output sequence using time-step residual connections, thus completing the mapping process from the latent space to the original data space. The mean squared error (MSE) is used as the reconstruction loss function to measure the difference between the reconstructed samples output by the decoder and the original input samples.
[0053] ;
[0054] in, This represents the original input sample. This represents the sample reconstructed by the decoder;
[0055] To further improve the continuity and authenticity of the data, a temporal consistency loss is introduced to constrain the dynamic change characteristics of the generated data:
[0056] ;
[0057] The total loss consists of the above three items: ; The reconstruction loss is used to ensure the accuracy of point value reconstruction in the sample space of the generated sequence; Maximum mean difference loss is used to make the encoded z close to the preset prior. Temporal consistency loss is used to ensure that the dynamic evolution characteristics of generated samples are consistent with the real sequence;
[0058] During training, the weights of the multiple loss functions are dynamically adjusted using an adaptive mechanism. First, three core loss values are calculated for each batch t during training, and then an exponential moving average is applied to each type of loss value.
[0059] ;
[0060] in, Let α represent the smoothed value of the i-th loss at the t-th iteration, where α3 is the smoothing coefficient, ranging from [0.9, 0.99], used to balance historical trends with the current value; This is the original loss value;
[0061] After obtaining the smoothed loss values, the reciprocals of each loss are calculated as the corresponding initial weights:
[0062] ;
[0063] in, Let i be the original weight of the i-th loss term in batch t. This is a small constant used to prevent the denominator from being zero; its value is 1 × 10⁻⁶. -8 ;
[0064] Normalize all initial weights:
[0065] ;
[0066] in, Let represent the final weight of the i-th loss term in batch t, with the denominator being the sum of all initial weights. After normalization, the sum of all loss weights is always equal to 1 to maintain consistency in the numerical scale of the total loss. The final training objective function is obtained by weighting all loss functions with adaptive weights.
[0067] ;
[0068] The decoder's structure is designed to be symmetrical with the encoder to ensure that the latent features are restored to the original temporal space. The decoder first receives the latent vector output by the encoder and expands it to a preset time step length through RepeatVector to form a temporally sequenced input. On this basis, Adaptive Skip-LSTM and CAD-TCN modules, which are symmetrical with the encoder, are introduced to recover the temporal dependencies and feature dimensions at different scales layer by layer. Finally, the features of each time step are mapped to the original input dimension through the temporal distribution layer TimeDistributed to output the complete reconstructed sequence.
[0069] Optionally, step 4 includes: after the model has completed training and fitting and the overall loss function has converged, using the decoder obtained from the training to map the latent space vector to generate new power system operation data samples;
[0070] First, the saved decoder parameters are loaded to ensure structural consistency between the generation and training phases; then, latent vectors are randomly sampled from a standard normal distribution. The data is then input into the decoder, and through stepwise temporal unrolling and convolutional feature recovery, temporal samples with the same dimension as the original data are generated. In this process, the model decodes the latent distribution information learned by the encoder into a new data sequence. Finally, the generated results are denormalized to restore them to the same scale as the original running data. Through this process, the number of samples is increased while ensuring the consistency of data features.
[0071] In a second aspect, embodiments of the present invention provide a computer-readable storage medium comprising a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to execute the power system data generation method based on outlier detection and deep generation model in the first aspect or any possible implementation thereof.
[0072] Thirdly, embodiments of the present invention provide an electronic device, including: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions that, when executed by the device, cause the device to perform the power system data generation method based on outlier detection and deep generation model in the first aspect or any possible implementation of the first aspect.
[0073] The technical solution provided by this invention includes collecting raw operating data of the power system, detecting and removing outliers from the raw operating data, completing the missing and removed data using cubic spline interpolation and moving average after outlier detection and removal, fitting the completed data to capture the local temporal and long-range dependencies of the data based on a constructed adversarial autoencoder model based on CAD-TCN-Adaptive Skip-LSTM, and using the fitted model to generate new power system data samples to expand the data volume. This method improves the integrity of power system data. Attached Figure Description
[0074] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0075] Figure 1 A flowchart illustrating the power system data generation method based on outlier detection and deep generation model provided in this embodiment of the invention;
[0076] Figure 2 A schematic diagram of an adversarial autoencoder model based on CAD-TCN-Adaptive Skip-LSTM provided for an embodiment of the present invention;
[0077] Figure 3 A line graph showing the adversarial loss between the generator and discriminator provided in an embodiment of the present invention;
[0078] Figure 4 A line graph of the reconstruction loss provided in an embodiment of the present invention;
[0079] Figure 5 A line graph showing the maximum mean difference loss provided in an embodiment of the present invention;
[0080] Figure 6 A line graph illustrating the timing consistency loss provided in an embodiment of the present invention;
[0081] Figure 7 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0082] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0083] It should be understood that the described embodiments are merely some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0084] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” used in the embodiments of this invention are also intended to include the plural forms unless the context clearly indicates otherwise.
[0085] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0086] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."
[0087] Figure 1 The flowchart of the power system data generation method based on outlier detection and deep generation model provided in the embodiments of the present invention is as follows: Figure 1 As shown, the method includes:
[0088] Step 1: Collect raw operating data of the power system, and detect and remove outliers from the raw operating data.
[0089] In this embodiment of the invention, step 1 includes: identifying abnormal data using statistical analysis and clustering methods based on the distribution characteristics of the original running data;
[0090] First, examine the potential distribution characteristics of the original running data, using D'Agostino'K...2 The test, used to assess normality by standardizing skewness and kurtosis, constructs a test statistic that approximates a chi-square distribution, thereby quantifying the deviation of a sample from a normal distribution; D'Agostino'K 2 The p-value is compared with the significance level α1 (α1=0.05), where the p-value represents the probability of the current or extreme test statistic occurring if the null hypothesis is true. A larger p-value indicates that it is more difficult to reject the null hypothesis, and the data follows a normal distribution. If p > α1, the data follows a normal distribution, and under this condition, the p-value is used. Outlier detection is performed in principle. The outlier detection interval is: Sample points that exceed the outlier detection range are identified as outliers and removed.
[0091] Secondly, for raw data that does not follow a normal distribution, K-means and IQR are combined for detection. K-means is used to divide the data into internally consistent subsets, while IQR is used to identify outliers. This combination effectively mitigates threshold distortion caused by global distribution differences. The raw data is first clustered, and then outliers are identified within each cluster. Since K-means is sensitive to the number of clusters, the silhouette coefficient method is used to determine the optimal number of clusters. Select the one with the largest corresponding contour coefficient. As the final cluster number:
[0092] ;
[0093] in, After determining the optimal number of clusters, K-means clustering is used, and outliers are detected within the j-th cluster based on IQR; the first quartile distance is calculated. Third and fourth intervals and interquartile range The expression for non-normal or skewed distributed data is: ;according to Determine the interval for judging outliers within the cluster: Sample points that exceed the outlier judgment range within the cluster are identified as outliers and removed.
[0094] Step 2: After detecting and removing outliers, use cubic spline interpolation and moving average to complete the missing and removed data.
[0095] In this embodiment of the invention, step 2 includes:
[0096] After outliers are detected and removed, missing values need to be appropriately filled in to ensure data integrity. Due to the complex and variable operating conditions of power systems, measurement data often exhibit significant nonlinear characteristics. To more accurately reflect the changing trends of the data, a nonlinear interpolation method, namely cubic spline interpolation, is used to fill in the missing data; the spline interpolation is performed in each interval... Construct a local cubic polynomial, whose expression is:
[0097] ;
[0098] in, The coefficients are uniquely determined by the interpolation conditions and the continuity conditions of the first and second derivatives at the nodes. Compared with traditional high-order polynomial interpolation, spline interpolation has better numerical stability and local adaptability, and can effectively avoid oscillations.
[0099] However, spline interpolation has limitations in its applicability and is insufficient for handling boundary data. Since spline interpolation relies on adjacent data points to determine the interpolation polynomial, when missing values appear at the beginning or end of a data sequence, the lack of necessary nearby known data points makes it difficult to effectively construct the interpolation function, hindering its application in data completion at both ends of the sequence. Therefore, a moving average method based on the mean of data within a local neighborhood is used to estimate missing values at the beginning and end of the data sequence. A fixed-length sliding window is set, and the mean of adjacent known data within the window is calculated and used as a substitute for the missing value. The window then moves forward or backward in a certain step until all boundary missing values are filled. The expression is as follows:
[0100] ,or ;
[0101] in, This is the estimated value for the t-th missing value; and represents the known data adjacent to the missing point; k is the length of the sliding window. The length of the sliding window can be flexibly set according to the data characteristics to balance smoothness and the ability to preserve local features.
[0102] Step 3: Fit the completed data based on the constructed CAD-TCN-Adaptive Skip-LSTM-based adversarial autoencoder model to capture the local temporal and long-range dependencies of the data.
[0103] In this embodiment of the invention, the completed data is fitted to capture the local temporal and long-range dependencies of the data, so that the adversarial autoencoder model can learn the features of the original running data.
[0104] In embodiments of the present invention, such as Figure 2 As shown, step 3 includes:
[0105] Complex high-dimensional temporal data is modeled and generated by fusing a cellular automata-driven temporal convolutional network (CAD-TCN) and an adaptive skip long short-term memory (LSTM) network. An adversarial autoencoder (AAE) serves as the core framework, introducing adversarial regularization into the latent space to ensure the encoder output conforms to a pre-defined Gaussian distribution. This enhances continuity and sampleability while maintaining reconstruction accuracy, generating samples that match the characteristics of real data through standard normal sampling, thus improving model stability and generalization ability. Data is normalized and sampled using a sliding window method before being input into the encoder. First, a sliding window sampling method is used, where windows slide sequentially across the entire time series, extracting data from each consecutive time interval as an independent sample, forming a set of sequence segments containing local temporal correlations. The data within each window maintains its temporal order to capture short-term dynamic features and enhance the temporal continuity of the samples. Subsequently, all window samples are standardized, and the standardized windowed data is input into the encoder for feature extraction and latent representation learning.
[0106] The CAD-TCN module, as one of the core feature extractors in the encoder, is used for hierarchical, multi-scale, and dynamically interactive representation learning of high-dimensional temporal data. First, the CAD-TCN module uses causal dilated convolution as the initial transformation: for the input at time step t... Applying a one-dimensional causal dilated convolution yields the initial feature vector. :
[0107] ;
[0108] Where d is the dilation rate, which takes values of 8, 4, 2, and 1; K is the kernel size; and W... k The convolution weights are used for the convolution; after convolution, batch normalization (BN) and the activation function LeakyReLU are applied to stabilize training and increase non-linear expression; dilated causal convolution can preserve causality while exponentially expanding the receptive field without significantly increasing the number of parameters, and can efficiently capture short-term details.
[0109] Building upon the initial convolutional features, the CAD-TCN module employs differentiable cellular automata-driven units to model dynamic interactions between local neighborhoods; each feature... The state vector is considered as a cell. Define a lightweight rule network. The rule network is a multilayer perceptron (MLP) used to learn from the neighborhood. Generate state update quantity:
[0110] ;
[0111] To facilitate parallel computation and boundary handling, the input undergoes symmetrical padding in the time dimension, neighborhood indices are constructed in batches, and neighborhood information is extracted using efficient tensor operations before being flattened and fed into the rule network. Cellular evolution transforms neighborhood interactions from linear mixing with fixed convolutional kernels to learnable nonlinear updates, allowing the model to adaptively determine how information propagates over time locally, thereby improving sensitivity and modeling ability for non-stationary or locally coupled patterns. For generation tasks, this local evolution makes the encoded features better reflect the short-term dynamic propagation patterns in real sequences, thus forming a more coherent and sampleable distribution in the latent space. Cellular evolution is executed iteratively, updating with small steps at each step to ensure stability, and its expression is:
[0112] ;
[0113] Where α2 is the update step size, and k is the number of evolution iterations; α2 takes the value 0.1;
[0114] By progressively accumulating local updates, the multi-scale information extracted by convolution is preserved, while the temporal consistency and smoothness of the features are enhanced. To avoid information loss or gradient degradation during multi-step evolution, residual connections and projection mappings are retained in each CAD-TCN module. The final output of the CAD-TCN module is expressed as the sum of the evolved features and the linearly mapped input.
[0115] ;
[0116] in, Use 1×1 convolutions or linear transformations for dimension alignment;
[0117] The CAD-TCN module combines the multi-scale receptive field of dilated convolution with neighborhood-based learnable cell evolution to improve the ability to model temporal patterns. It also provides smoother, more consistent, and controllable high-order features for the learned latent distribution within the AAE generative framework, thereby directly improving the continuity and robustness of sequence generation. The high-order features extracted by the CAD-TCN module are passed to the Adaptive Skip-LSTM module to further integrate cross-step-length dependencies and adaptively retain information from key time steps, working together to generate and expand high-quality temporal data.
[0118] The Adaptive Skip-LSTM module, another important component of the encoder, is responsible for modeling key moments, highlighting important information in local time slices while ensuring efficiency. Unlike traditional Skip-LSTM with fixed step size, the Adaptive Skip-LSTM module uses a gating mechanism to dynamically determine the update of the hidden state based on the difference between the current input and historical states. This enables automatic skipping of redundant computations and preservation of key moment information, including:
[0119] Let the input sequence be x t The hidden state in the previous time step was h. t-1 The memory state is c t-1 Then the gate function g t The expression is:
[0120] ;
[0121] in, W is the sigmoid function. g With b g The weight parameters and bias terms of the gating are used to output the gating value. Indicates the update strength or update frequency at the current time step; when g t When g approaches 1, it indicates that the information at the current time step is important, and the model will update the hidden and memory states; when g approaches 1... t When g approaches 0, the model tends to skip updates and inherit the state from the previous time step; if g... t If the value is in the middle, a partial update, or soft update, is performed, achieving a smooth transition by weighted merging of the old and new states:
[0122] ;
[0123] ;
[0124] in, and This represents the update result of a standard LSTM unit at the current moment. This design ensures that the model is fully updated at critical moments, while conserving computational resources during redundant or stable phases. Adaptive Skip-LSTM can automatically adjust its update strategy based on changes in input data, enabling the model to capture bursty information and thus achieve efficient feature representation in high-dimensional time series modeling of power systems.
[0125] In the entire encoder (generator) design, the input power system time-series data first passes through a four-layer CAD-TCN module, with dilation rates d of 1, 2, 4, and 8 for each module, and convolutional kernel numbers of 32, 64, 128, and 256, respectively, to extract local temporal dynamics. Building upon causal dilated convolution to capture multi-scale temporal dependencies, the CAD-TCN module employs a learnable cellular automata-driven mechanism, treating the features at each time step as a cell. This mechanism enables the model to capture complex dynamic patterns while maintaining temporal causality. Subsequently, the dependency information is integrated through an Adaptive Skip-LSTM module to model the key global temporal structure. Finally, a fully connected layer maps the high-dimensional temporal features to a latent space representation z. The discriminator uses the latent variables output by the encoder. As input, the data passes through three fully connected layers containing 128 neurons each and the LeakyReLU activation function, finally passing through a single-neuron output layer to obtain a discriminant value, used to determine the authenticity of the input sample. During the AAE fitting process, to ensure that the latent variable z output by the encoder approximates the preset true distribution, a discriminator is introduced to achieve distribution matching in the latent space. The discriminator's input includes two latent vectors: one is the latent representation obtained by the encoder from the original running data, which follows the posterior distribution Q learned by the model. z The other is from the standard normal distribution. The real samples obtained from the sampling in the middle; the goal of the discriminator is to learn to distinguish samples from the real distribution P. z The sample and the output Q from the encoder z The samples are distinguished; the discriminator optimization objective is based on Wasserstein distance:
[0126] ;
[0127] Where D(•) represents the output of the discriminator;
[0128] Compared to traditional cross-entropy or JS divergence, Wasserstein distance can alleviate training instability and gradient vanishing problems. At the same time, it can still provide effective optimization signals when the support sets of the generated distribution and the real distribution do not overlap, thereby improving the effect of latent space distribution matching and model training stability.
[0129] Meanwhile, the optimization objective of the encoder is to make its output latent vector distribution Q z With the true distribution P z To achieve convergence and thus an adversarial effect; the encoder's loss function is:
[0130] ;
[0131] To further verify the consistency between the encoder output latent spatial distribution and the preset standard normal distribution, the maximum mean difference (MMD) is introduced to measure the difference between the two distributions. MMD is a nonparametric distance metric based on the reproducing kernel Hilbert space, which can effectively measure the difference between the moment characteristics of two distributions in high-dimensional space.
[0132] ;
[0133] Where z and These are samples from the real distribution and the encoder distribution, respectively. For kernel functions;
[0134] The smaller the MMD value, the closer the generated latent variable distribution is to the standard normal distribution, and the more the latent space structure learned by the model conforms to expectations.
[0135] Subsequently, the decoder maintains a mirror-symmetric relationship with the encoder in its overall structure. Its input is the latent vector z. First, it recovers temporal dependencies using a RepeatVector operation and an Adaptive Skip-LSTM layer. Then, it achieves layer-by-layer reconstruction of multi-scale features through four layers of CAD-TCN modules with progressively decreasing dilation rates and convolutional kernels. The dilation rates d are designed to be 8, 4, 2, and 1, and the number of convolutional kernels are 256, 128, 64, and 32. Finally, it generates the output sequence using time-step residual connections, thus completing the mapping process from the latent space to the original data space. The mean squared error (MSE) is used as the reconstruction loss function to measure the difference between the reconstructed samples output by the decoder and the original input samples.
[0136] ;
[0137] in, This represents the original input sample. This represents the sample reconstructed by the decoder;
[0138] MSE can effectively measure the difference in numerical magnitude between the reconstructed sample and the original sample, but it only guarantees similar magnitude and cannot guarantee consistent dynamic behavior, which is insufficient to guarantee the smoothness and rationality of the generated sequence in the time dimension.
[0139] To further improve the continuity and authenticity of the data, a temporal consistency loss is introduced to constrain the dynamic change characteristics of the generated data:
[0140] ;
[0141] This loss constraint, by constraining the difference between adjacent time steps, enables the generated sequence to better conform to the variation pattern of the original sequence while maintaining overall numerical accuracy, thereby achieving effective preservation and optimization of temporal features.
[0142] The total loss consists of the above three items: ; The reconstruction loss is used to ensure the accuracy of point value reconstruction in the sample space of the generated sequence; The maximum mean difference loss is used to make the encoded z close to the preset prior, ensuring that the latent vector obtained from the prior sampling is a reasonable sample after decoding, thus solving the problem of poor sample quality generated from the prior sampling. Temporal consistency loss is used to ensure that the dynamic evolution characteristics of generated samples are consistent with the real sequence;
[0143] During training, the weights of multiple loss functions are dynamically adjusted using an adaptive mechanism. The importance of different loss functions varies at different stages; therefore, dynamic weight adjustment achieves comprehensive optimization of reconstruction accuracy, distribution constraints, and temporal consistency. First, three core loss values are calculated for each batch t during training. This process allows the model to comprehensively capture information from different levels, from single-point accuracy to global distribution and temporal continuity, providing foundational data for subsequent weight adjustments. Since neural networks often experience gradient oscillations or local outliers during training, directly using the original loss values may lead to overly drastic weight updates, thus affecting model stability. Therefore, exponential moving averages are applied to all loss values.
[0144] ;
[0145] in, Let α represent the smoothed value of the i-th loss at the t-th iteration, where α3 is the smoothing coefficient, ranging from [0.9, 0.99], used to balance historical trends with the current value; This is the original loss value; by introducing this mechanism, the impact of instantaneous fluctuations can be effectively reduced, making the weight adjustment process more robust and ensuring that the training direction always revolves around the overall optimization goal.
[0146] After obtaining the smoothed loss values, the reciprocals of each loss are calculated as the corresponding initial weights:
[0147] ;
[0148] in, Let i be the original weight of the i-th loss term in batch t. This is a small constant used to prevent the denominator from being zero; its value is 1 × 10⁻⁶. -8This embodies the idea of reciprocal weighting, where a larger loss value results in a lower weight, and vice versa. A smaller loss value indicates that the objective is relatively easy to optimize, thus receiving a higher weight. The advantage of this design is that it achieves dynamic equilibrium among different objectives, preventing any single loss value from dominating model updates in the long term, thereby maintaining overall consistency in the training process.
[0149] Since the initial weights for different losses may fall within different numerical ranges, directly using them could lead to inconsistencies in the overall scale of the loss function. Therefore, all initial weights are normalized:
[0150] ;
[0151] in, Let represent the final weight of the i-th loss term in batch t, with the denominator being the sum of all initial weights. After normalization, the sum of all loss weights is always equal to 1, ensuring the total loss maintains consistency on the numerical scale. This mechanism guarantees that different losses are combined on the same numerical scale, thus preventing a particular type of loss from being too large or too small and thus compromising the overall optimization objective. The final training objective function is obtained by weighting all loss functions with adaptive weights.
[0152] ;
[0153] In this way, the model achieves layer-by-layer optimization from global distribution to local fitting, adaptively allocating focus points at different training stages. This avoids excessive dominance by a single objective while ensuring coordination between different optimization goals. This dynamic weight adjustment mechanism not only ensures that the model considers multiple objectives but also improves the overall robustness and convergence efficiency of the process.
[0154] In this embodiment of the invention, the changes in various losses during the model training process were experimentally recorded, such as... Figures 3 to 6 As shown, the loss trends indicate that with increasing iterations, the various loss values generally show a pattern of first decreasing and then stabilizing, indicating that the model gradually converges. Specifically, the adversarial loss between the encoder and discriminator fluctuates significantly in the early stages of training before stabilizing, suggesting a stable adversarial process without pattern collapse. The reconstruction loss and maximum mean difference loss decrease in the early stages of training and then remain at low levels, demonstrating that the model effectively learns the features of the original data and gradually approximates the standard normal distribution. The temporal consistency loss decreases steadily, further validating the model's advantages in maintaining temporal relevance and dynamic smoothness, with the generated sequences maintaining consistency with the real data in both overall trend and local variations.
[0155] The decoder's structure is designed to be symmetrical with the encoder to ensure that the latent features are restored to the original temporal space. The decoder first receives the latent vector output by the encoder and expands it to a preset time step length through RepeatVector to form a temporally sequenced input. On this basis, Adaptive Skip-LSTM and CAD-TCN modules, which are symmetrical with the encoder, are introduced to recover the temporal dependencies and feature dimensions at different scales layer by layer. Finally, the features of each time step are mapped to the original input dimension through the temporal distribution layer TimeDistributed to output the complete reconstructed sequence.
[0156] Step 4: Use the fitted model to generate new power system data samples to expand the data volume.
[0157] In this embodiment of the invention, step 4 includes: after the model has completed training and fitting and the overall loss function has converged, using the decoder obtained from the training to map the potential space vector to generate new power system operation data samples and alleviate the problem of unbalanced data distribution.
[0158] First, the saved decoder parameters are loaded to ensure structural consistency between the generation and training phases; then, latent vectors are randomly sampled from a standard normal distribution. The data is then input into the decoder, where it undergoes progressive temporal unrolling and convolutional feature recovery to generate temporal samples with the same dimensions as the original data. During this process, the model decodes the latent distribution information learned by the encoder into new data sequences. Finally, the generated results are denormalized to restore them to the same scale as the original running data. This process ensures the consistency of data features while expanding the number of samples and alleviating the imbalance in the original data, thereby improving the data support capability and the robustness of model training in subsequent tasks.
[0159] It should be noted that the encoder in this invention performs the function of the generator in a generative adversarial network (GAN), and the encoder can be referred to as the generator in the adversarial training part.
[0160] This invention compares different metrics (mean squared error, maximum mean difference loss, temporal consistency loss, generator loss, and discriminator loss), and the experimental results are shown in Table 1. The adversarial autoencoder model based on CAD-TCN-AdaptiveSkip-LSTM proposed in this invention significantly outperforms the traditional LSTM-GAN model in all key performance indicators. In comparison, the difference between the generated samples and real samples is significantly reduced, and the model has a stronger ability to capture time dependence and dynamic evolution patterns. Overall, the model of this invention shows significant advantages in generation accuracy, temporal consistency, and training stability, indicating that this method can more effectively learn the distribution characteristics of complex temporal data and achieve high-fidelity, stable, and generalizable data generation.
[0161] Table 1 Comparative Experimental Results
[0162] .
[0163] This invention combines outlier detection with a constructed adversarial autoencoder model based on CAD-TCN-Adaptive Skip-LSTM to generate and expand data. This increases the number of samples, alleviates data imbalance, and generates high-quality samples while preserving the original data characteristics and dynamic evolution patterns. Before data generation, outlier detection and processing are performed on the original running data based on the statistical characteristics of the variables themselves to remove outliers and fill in missing data, ensuring the quality of the subsequently generated input data. Then, a cellular automata-driven temporal convolutional network (CAD-TCN) is added to the encoder and decoder to capture complex local temporal correlations. An adaptive skip long short-term memory network (Adaptive Skip-LSTM) is combined to dynamically update the state based on the differences between the input and historical data, maintaining the integrity of temporal information. The combination of these two methods achieves efficient modeling of complex high-dimensional temporal features while ensuring temporal causality. By combining an adversarial autoencoder framework with a dynamic weighting strategy using multiple loss functions, a three-part weighted loss is employed, including reconstruction loss, maximum mean difference loss, and temporal consistency loss, to ensure the reliability of the generated data in terms of both numerical and dynamic evolution characteristics. This invention not only compensates for the deficiencies in historical data but also provides reliable generated data, offering data support for power system analysis and research, and meeting the urgent need for high-quality data in high-penetration renewable energy power systems.
[0164] The technical solution provided by this invention includes collecting raw operating data of the power system, detecting and removing outliers from the raw operating data, completing the missing and removed data using cubic spline interpolation and moving average after outlier detection and removal, fitting the completed data to capture the local temporal and long-range dependencies of the data based on a constructed adversarial autoencoder model based on CAD-TCN-Adaptive Skip-LSTM, and using the fitted model to generate new power system data samples to expand the data volume. This method improves the integrity of power system data.
[0165] The various steps in the embodiments of the present invention can be performed by an electronic device. This electronic device includes, but is not limited to, tablet computers, portable PCs, and desktop computers.
[0166] This invention provides a computer-readable storage medium including a stored program, wherein, when the program is running, it controls the electronic device containing the computer-readable storage medium to execute the above-described embodiment of the power system data generation method based on outlier detection and deep generation model.
[0167] Figure 7 A schematic diagram of an electronic device provided in an embodiment of the present invention, such as... Figure 7 As shown, the electronic device 21 includes a processor 211, a memory 212, and a computer program 213 stored in the memory 212 and executable on the processor 211. When the computer program 213 is executed by the processor 211, it implements the power system data generation method based on outlier detection and deep generation model in the embodiment. To avoid repetition, it will not be described in detail here.
[0168] Electronic device 21 includes, but is not limited to, processor 211 and memory 212. Those skilled in the art will understand that... Figure 7 This is merely an example of electronic device 21 and does not constitute a limitation on electronic device 21. It may include more or fewer components than shown, or combine certain components, or different components. For example, electronic device may also include input / output devices, network access devices, buses, etc.
[0169] The processor 211 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0170] The memory 212 can be an internal storage unit of the electronic device 21, such as a hard disk or RAM of the electronic device 21. The memory 212 can also be an external storage device of the electronic device 21, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or FlashCard equipped on the electronic device 21. Furthermore, the memory 212 can include both internal and external storage units of the electronic device 21. The memory 212 is used to store computer programs and other programs and data required by network devices. The memory 212 can also be used to temporarily store data that has been output or will be output.
[0171] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0172] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A power system data generation method based on outlier detection and a deep generation model, characterized in that, The method includes: Step 1: Collect raw operating data of the power system, and detect and remove outliers from the raw operating data; Step 2: After detecting and removing outliers, use cubic spline interpolation and moving average to complete the missing and removed data; Step 3: Fit the completed data based on the constructed CAD-TCN-Adaptive Skip-LSTM-based adversarial autoencoder model to capture the local temporal and long-range dependencies of the data. Step 4: Use the fitted model to generate new power system data samples to expand the data volume; Step 3 includes: Complex high-dimensional temporal data is modeled and generated by fusing a cellular automata-driven temporal convolutional network (CAD-TCN) and an adaptive skip long short-term memory (LSTM) network. An adversarial autoencoder (AAE) serves as the core framework, introducing adversarial regularization into the latent space to ensure the encoder output conforms to a pre-defined Gaussian distribution. This enhances continuity and sampleability while maintaining reconstruction accuracy, generating samples that match the characteristics of real data through standard normal sampling. The data is then normalized and subjected to sliding window sampling before being input into the encoder. The CAD-TCN module, as one of the core feature extractors in the encoder, is used for hierarchical, multi-scale, and dynamically interactive representation learning of high-dimensional temporal data. First, the CAD-TCN module uses causal dilated convolution as the initial transformation: for the input at time step t... Applying a one-dimensional causal dilated convolution yields the initial feature vector. : ; Where d is the dilation rate, which takes values of 8, 4, 2, and 1; K is the kernel size; and W... k The convolution weights are followed by batch normalization (BN) and the activation function LeakyReLU to stabilize training and increase non-linear representation. Building upon the initial convolutional features, the CAD-TCN module employs differentiable cellular automata evolutionary units to model dynamic interactions between local neighborhoods; each feature... The state vector is considered as a cell. Define a lightweight rule network. The rule network is a multilayer perceptron (MLP) used to learn from the neighborhood. Generate state update quantity: ; To facilitate parallel computation and boundary handling, the input undergoes symmetrical padding in the time dimension, neighborhood indices are constructed in batches, and neighborhood information is extracted using efficient tensor operations before being flattened and fed into the rule network. Cellular evolution transforms neighborhood interactions from linear mixing with fixed convolutional kernels into learnable nonlinear updates, allowing the model to adaptively determine how information propagates over time within a local range. Cellular evolution is executed iteratively, updating with small step sizes at each step to ensure stability; its expression is: ; Where α2 is the update step size and k is the number of evolution iterations; Residual connections and projection mappings are preserved in each CAD-TCN module. The final output of the CAD-TCN module is expressed as the sum of the evolved features and the linearly mapped input. ; in, Use 1×1 convolutions or linear transformations for dimension alignment; The CAD-TCN module combines the multi-scale receptive field of dilated convolution with neighborhood-based learnable cell evolution to improve the ability to model temporal patterns; and provides high-order features for the learned latent distribution in the generative framework of AAE; the high-order features extracted by the CAD-TCN module are passed to the Adaptive Skip-LSTM module to further integrate cross-step-size dependencies and adaptively retain information of key time steps, working together to generate and expand temporal data; The Adaptive Skip-LSTM module, another important component of the encoder, is responsible for modeling key moments, highlighting important information in local time slices while ensuring efficiency. The Adaptive Skip-LSTM module uses a gating mechanism to dynamically determine the update of the hidden state based on the difference between the current input and historical states. This includes: Let the input sequence be x t The hidden state in the previous time step was h. t-1 The memory state is c t-1 Then the gate function g t The expression is: ; in, W is the sigmoid function. g With b g The weight parameters and bias terms of the gating are used to output the gating value. Indicates the update strength or update frequency at the current time step; when g t When g approaches 1, it indicates that the information at the current time step is important, and the model will update the hidden and memory states; when g approaches 1... t When g approaches 0, the model tends to skip updates and inherit the state from the previous time step; if g... t If the value is in the middle, a partial update, or soft update, is performed, achieving a smooth transition by weighted merging of the old and new states: ; ; in, and This represents the update result of the standard LSTM unit at the current moment; In the entire encoder design, the input power system time-series data first passes through a four-layer CAD-TCN module, with dilation rates d of 1, 2, 4, and 8 for each module, and convolutional kernel numbers of 32, 64, 128, and 256, respectively, to extract local temporal dynamics. The CAD-TCN module, based on causal dilated convolution to capture multi-scale temporal dependencies, uses a learnable cellular automata-driven mechanism to treat the features at each time step as a cell. Subsequently, the dependency information is integrated through an Adaptive Skip-LSTM module to model the key global temporal structure. Finally, a fully connected layer maps the high-dimensional temporal features to a latent space representation z. The discriminator uses the latent variables output by the encoder. As input, the data passes through three fully connected layers containing 128 neurons each and the LeakyReLU activation function, finally passing through a single-neuron output layer to obtain a discriminant value, used to determine the authenticity of the input sample. During the AAE fitting process, to ensure that the latent variable z output by the encoder approximates the preset true distribution, a discriminator is introduced to achieve distribution matching in the latent space. The discriminator's input includes two latent vectors: one is the latent representation obtained by the encoder from the original running data, which follows the posterior distribution Q learned by the model. z The other is from the standard normal distribution. The real samples obtained from the sampling in the middle; the goal of the discriminator is to learn to distinguish samples from the real distribution P. z The sample and the output Q from the encoder z The samples are distinguished; the discriminator optimization objective is based on Wasserstein distance: ; Wherein, D( () indicates the output of the discriminator; Meanwhile, the optimization objective of the encoder is to make its output latent vector distribution Q z With the true distribution P z To achieve convergence and thus an adversarial effect; the encoder's loss function is: ; To further verify the consistency between the encoder output latent spatial distribution and the preset standard normal distribution, the maximum mean difference (MMD) is introduced to measure the difference between the two distributions: ; Where z and These are samples from the real distribution and the encoder distribution, respectively. For kernel functions; Subsequently, the decoder maintains a mirror-symmetric relationship with the encoder in its overall structure. Its input is the latent vector z. First, it recovers temporal dependencies using a RepeatVector operation and an Adaptive Skip-LSTM layer. Then, it achieves layer-by-layer reconstruction of multi-scale features through four layers of CAD-TCN modules with progressively decreasing dilation rates and convolutional kernels. The dilation rates d are designed to be 8, 4, 2, and 1, and the number of convolutional kernels are 256, 128, 64, and 32. Finally, it generates the output sequence using time-step residual connections, thus completing the mapping process from the latent space to the original data space. The mean squared error (MSE) is used as the reconstruction loss function to measure the difference between the reconstructed samples output by the decoder and the original input samples. ; in, This represents the original input sample. This represents the sample reconstructed by the decoder; To further improve the continuity and authenticity of the data, a temporal consistency loss is introduced to constrain the dynamic change characteristics of the generated data: ; The total loss consists of the above three items: ; The reconstruction loss is used to ensure the accuracy of point value reconstruction in the sample space of the generated sequence; Maximum mean difference loss is used to make the encoded z close to the preset prior. Temporal consistency loss is used to ensure that the dynamic evolution characteristics of generated samples are consistent with the real sequence; During training, the weights of the multiple loss functions are dynamically adjusted using an adaptive mechanism. First, three core loss values are calculated for each batch t during training, and then an exponential moving average is applied to each type of loss value. ; in, Let α represent the smoothed value of the i-th loss at the t-th iteration, where α3 is the smoothing coefficient, ranging from [0.9, 0.99], used to balance historical trends with the current value; This is the original loss value; After obtaining the smoothed loss values, the reciprocals of each loss are calculated as the corresponding initial weights: ; in, Let i be the original weight of the i-th loss term in batch t. This is a small constant used to prevent the denominator from being zero; its value is 1 × 10⁻⁶. -8 ; Normalize all initial weights: ; in, Let represent the final weight of the i-th loss term in batch t, with the denominator being the sum of all initial weights. After normalization, the sum of all loss weights is always equal to 1 to maintain consistency in the numerical scale of the total loss. The final training objective function is obtained by weighting all loss functions with adaptive weights. ; The decoder's structure is designed to be symmetrical with the encoder to ensure that the latent features are restored to the original temporal space. The decoder first receives the latent vector output by the encoder and expands it to a preset time step length through RepeatVector to form a temporally sequenced input. On this basis, Adaptive Skip-LSTM and CAD-TCN modules, which are symmetrical with the encoder, are introduced to recover the temporal dependencies and feature dimensions at different scales layer by layer. Finally, the features of each time step are mapped to the original input dimension through the temporal distribution layer TimeDistributed to output the complete reconstructed sequence.
2. The method according to claim 1, characterized in that, Step 1 includes: identifying abnormal data using statistical analysis and clustering methods based on the distribution characteristics of the original operating data; First, examine the potential distribution characteristics of the original running data, using D'Agostino'K... 2 The test, used to assess normality by standardizing skewness and kurtosis, constructs a test statistic that approximates a chi-square distribution, thereby quantifying the deviation of a sample from a normal distribution; D'Agostino'K 2 The p-value is compared with the significance level α1, where the p-value represents the probability of the current or extreme test statistic occurring under the null hypothesis. A larger p-value indicates a higher probability of rejecting the null hypothesis, suggesting the data follows a normal distribution. If p > α1, the data also follows a normal distribution, and under this condition, the p-value is used. Outlier detection is performed in principle. The outlier detection interval is: Sample points that exceed the outlier detection range are identified as outliers and removed. Secondly, for raw data that does not follow a normal distribution, K-means and interquartile range (IQR) are combined for detection. K-means is used to divide the data into internally consistent subsets, and IQR is used to identify outliers. The raw data is first clustered, and then outliers are identified within each cluster. The optimal number of clusters is determined using the silhouette coefficient method. Select the one with the largest corresponding contour coefficient. As the final cluster number: ; in, After determining the optimal number of clusters, K-means clustering is used, and outliers are detected within the j-th cluster based on IQR; the first quartile distance is calculated. Third and fourth intervals and interquartile range The expression for non-normal or skewed distributed data is: ;according to Determine the interval for judging outliers within the cluster: Sample points that exceed the outlier judgment range within the cluster are identified as outliers and removed.
3. The method according to claim 2, characterized in that, Step 2 includes: After outliers were detected and removed, the missing data was imputed using a nonlinear interpolation method, namely cubic spline interpolation; the spline interpolation was performed in each interval. Construct a local cubic polynomial, whose expression is: ; in, The coefficients are uniquely determined by the interpolation conditions and the continuity conditions of the first and second derivatives at the nodes; A moving average is used to impute missing values at the beginning and end of the data sequence. A fixed-length sliding window is set, and the mean of adjacent known data within the window is calculated and used as a substitute for the missing value. The window then moves forward or backward in steps until all boundary missing values are imputed. The expression is as follows: ,or ; in, This is the estimated value for the t-th missing value; and represents the known data adjacent to the missing point; k is the length of the sliding window.
4. The method according to claim 1, characterized in that, Step 4 includes: after the model has completed training and fitting and the overall loss function has converged, using the decoder obtained from the training to map the potential space vector to generate new power system operation data samples. First, the saved decoder parameters are loaded to ensure structural consistency between the generation and training phases; then, latent vectors are randomly sampled from a standard normal distribution. The data is then input into the decoder, and through stepwise temporal unrolling and convolutional feature recovery, temporal samples with the same dimension as the original data are generated. In this process, the model decodes the latent distribution information learned by the encoder into a new data sequence. Finally, the generated results are denormalized to restore them to the same scale as the original running data. Through this process, the number of samples is increased while ensuring the consistency of data features.
5. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device containing the computer-readable storage medium to perform the power system data generation method based on outlier detection and deep generation model as described in any one of claims 1 to 4.
6. An electronic device, characterized in that, include: One or more processors; Memory; And one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs including instructions that, when executed by the device, cause the device to perform the power system data generation method based on outlier detection and deep generation model as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Long-term pavement monitoring data enhancement method based on highway sensor network layout
CN115374903A
Deep sea manned submersible unsupervised anomaly detection method and system based on multi-modal feature fusion
CN120805012A