Photovoltaic data anomaly detection and fault diagnosis method and system based on variational auto-encoder

By applying a variable division self -encoder and abnormal diagnostic machine learning model in photovoltaic data processing, the problem of insufficient robustness and generalization of photovoltaic data abnormal detection in existing technologies has been solved. Detection and fault diagnosis.

CN119377827APending Publication Date: 2025-01-28SHANGHAI JIAOTONG UNIV

Patent Information

Application Number
CN202310931707.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-27
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

The existing photovoltaic data anomaly detection methods are difficult to effectively handle high-dimensional data and nonlinear feature relationships, and lack a complete set of automated processing and time series anomaly detection systems, resulting in insufficient robustness and generalization.

Method used

The method of automated processing and time sequence abnormal detection of photovoltaic data based on the method based on a variable -based coder is used. The distribution of normal data is learned by constructing a variable division from the encoder. Perform cluster diagnosis.

Benefits of technology

The effective abnormal detection and failure diagnosis of photovoltaic data can be well described as the uncertainty of photovoltaic data, which has strong robustness and explanatoryness, and supports intelligent monitoring and maintenance of photovoltaic equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119377827A_ABST
    Figure CN119377827A_ABST
Patent Text Reader

Abstract

The invention discloses a photovoltaic data anomaly detection and fault diagnosis method and system based on a variational auto-encoder, and the method comprises the steps: carrying out the automatic processing of original production data through a data processing algorithm, enabling the original production data to become standardized input data, and selecting a part of samples to form a training set; constructing a variational auto-encoder model; obtaining information such as abnormal scores and hidden variables of the to-be-detected data according to the trained model; an anomaly diagnosis machine learning model is constructed to cluster hidden variables of the to-be-detected data, and a specific anomaly type is diagnosed; and establishing a manual annotation interface to annotate the test data, and evaluating the model anomaly detection and diagnosis effect by using the annotated data. According to the method, through algorithms such as data automatic processing and time sequence anomaly detection, collection, arrangement, labeling, detection and diagnosis automation of new energy power generation data mainly including photovoltaic power generation data can be realized, and a basic technical support for quantitative evaluation, anomaly detection and fault diagnosis of the photovoltaic industry is formed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electrical digital data processing and neural network technology, and in particular to a photovoltaic data anomaly detection and fault diagnosis method and system based on a variational autoencoder. Background Art

[0002] Photovoltaic power generation has significant energy, environmental and economic benefits, and is one of the best green energy sources. According to the research results of the World Wildlife Fund (WWF): In terms of the effect of reducing carbon dioxide emissions, installing a 1 square meter photovoltaic power generation system is equivalent to planting 100 square meters of trees. At present, the development of renewable energy such as photovoltaic power generation will be one of the effective means to fundamentally solve environmental problems such as haze and acid rain. The data form of photovoltaic power generation records is generally based on time series. Automatic monitoring and diagnosis of photovoltaic power generation data is an important part of increasing production and efficiency in the photovoltaic industry. Time Series Anomaly Detection is one of the most mature applications of time series data analysis at present. It is defined as the process of identifying abnormal events or behaviors from normal time series. Effective time series anomaly detection is widely used in many fields in the real world, such as quantitative trading, network security detection, self-driving cars and daily monitoring and maintenance of large industrial equipment. The general process of applying anomaly detection algorithms to photovoltaic power generation data time series (generally including power generation time series, solar radiation intensity time series, and ambient temperature time series) is: first, evaluate the anomaly score of the data at each time point in the photovoltaic time series based on the adopted subject detection technology; then set a threshold for the anomaly score based on experience or the distribution of anomaly scores, and regard data above the threshold as abnormal data.

[0003] Time series anomaly detection methods used in the photovoltaic field are divided into two categories: traditional methods and neural network methods. Traditional methods include rule-based methods and machine learning methods. Rule-based methods detect anomalies based on rules formulated by experts, such as specifying a photovoltaic power output baseline under specific environmental conditions. This method can only detect significant anomalies and is not flexible enough for environmental conditions and equipment conditions at different sites. Traditional machine learning methods, including clustering models, distance models, tree models, etc., can detect anomalies that are more difficult to find and are easier to migrate to different site conditions. However, these models have limited processing capabilities for nonlinear feature relationships and are prone to the curse of dimensionality and cannot effectively process high-dimensional data. The emergence of neural networks and deep learning has provided new ideas for time series anomaly detection in the photovoltaic field. Existing unsupervised anomaly detection methods based on deep learning are usually divided into two steps. The first step is to use representation learning methods such as autoencoders to represent data in a new representation space. The second step is to define anomaly scores in the new representation space based on reconstruction errors or prediction errors. These representation learning methods generally use absolute error values ​​to measure the degree of anomaly, without modeling the randomness of variables or explicitly modeling the distribution of raw data, making it difficult to cope with the high uncertainty inherent in photovoltaic and other renewable energy power generation data, and lacking good robustness and generalization. At the same time, in terms of system integration, the market currently lacks a complete set of full-featured photovoltaic monitoring systems based on data automation processing and time series anomaly detection, integrating data collection, organization, labeling, detection, and diagnosis. Summary of the invention

[0004] In view of the above-mentioned deficiencies in the prior art, the present invention provides a photovoltaic data anomaly detection and fault diagnosis method and system based on variational autoencoder.

[0005] The present invention is achieved through the following technical solutions.

[0006] According to one aspect of the present invention, a photovoltaic data anomaly detection and fault diagnosis method based on a variational autoencoder is provided, comprising:

[0007] The original production data is automatically processed by data processing algorithms such as trimming, completion, alignment, windowing, and scaling to become standardized input data, and some samples are selected to form a training set;

[0008] Construct a variational autoencoder and use the processed samples for unsupervised training to learn the distribution of normal data;

[0009] According to the trained model, the abnormal scores and hidden variables of the data to be detected are obtained;

[0010] Construct anomaly diagnosis machine learning models to cluster latent variables of the data to be tested and diagnose specific anomaly types;

[0011] Build a manual annotation interface to annotate the test data, and use the annotated data to evaluate the model's anomaly detection and diagnosis effects.

[0012] Preferably, the data processing algorithm performs automatic processing such as clipping, completion, alignment, windowing, and scaling on the original production data to become standardized input data, and selects part of the data to form a training set, including:

[0013] First, the original data table exported from the database is trimmed, and the data in the weak light interval is deleted from the daily data;

[0014] Use interpolation and other algorithms to complete missing points;

[0015] After the above processing is performed on multiple data tables, they are aligned according to time to form a multivariate time series;

[0016] Each dimension value of the multivariate time series is scaled and converted into a z-score, eliminating the influence of different dimensions and value ranges. The formula is: where μ is the data [x i |i∈{1,…,T}}, σ is the mean of the data {x i The standard deviation of |i∈{1,…,T}}.

[0017] The multivariate time series is divided into non-overlapping daily samples with a time window size of one day.

[0018] Samples with less noise in the original data are selected to form the training set, and the mean absolute deviation (MAD) of the photovoltaic power generation and irradiation intensity curves is used as the noise index.

[0019] The formula is: Where w is the number of data points in the daily sample, is the value of the power generation dimension of the i-th data point, is the value of the irradiance intensity dimension of the i-th data point.

[0020] Construct a variational autoencoder and use the processed samples for unsupervised training to learn the distribution of normal data, including:

[0021] A variational posterior learner of a variational autoencoder is constructed using neural network technology. The variational posterior learner is used to learn the mapping from original data to posterior latent variables, thereby obtaining a representation of the data in the latent space, which is also a random variable called a variational posterior.

[0022] Use neural network technology to build a data generator for variational autoencoders; use the data generator to learn the mapping of posterior latent variables to original data, thereby learning the probability distribution of the original data.

[0023] Calculate the likelihood probability of the data sample based on the learned probability distribution of the original data, and further calculate the loss function;

[0024] Use the optimization iterator to update the variational autoencoder parameters through multiple iterations, reduce the loss function, and finally obtain the optimized variational autoencoder.

[0025] Preferably, the method of using a variational posterior learner to learn raw data into posterior latent variables comprises:

[0026] The variational posterior learner is: z = Q φ (z|x), get the representation of data in latent space, and realize x i →z i The mapping of z i For x i The corresponding posterior hidden variable, φ is the network structure parameter of the variational posterior learner.

[0027] Preferably, the method of using a data generator to learn the mapping of a posteriori latent variables to original data includes:

[0028] The generator is: x = P θ (x|z), generating raw data from the posterior latent variables to achieve z i →x i The mapping of x i For z i The corresponding original data, θ is the network structure parameter of the generator.

[0029] Preferably, the method for calculating the loss function comprises: The loss function is expressed as: Guided optimization of variational autoencoder models.

[0030] Where π(z) refers to the prior distribution of the latent variable, which is generally a standard Gaussian distribution. φ (z|x i ) is the approximate posterior distribution of the latent variables learned by the variational posterior learner described in Power 4. θ (x i|z) is the probability distribution of the original data learned by the data generator described in power 5; KL refers to the Kullback-Leibler divergence, which is used to measure the difference between the two distributions, and E refers to the mathematical expectation. The first term in the loss function is the KL divergence, which calculates the difference between the latent variable prior distribution and the variational posterior distribution; the second term is the negative log-likelihood, which calculates the likelihood probability value of the original data under the learned distribution.

[0031] Preferably, according to the trained model, information such as abnormal scores and latent variables of the data to be detected is obtained, including:

[0032] The data to be tested is input into the trained variational posterior learner to obtain the corresponding posterior latent variables.

[0033] The posterior latent variables are input into the trained data generator to obtain the learned distribution of the data to be tested.

[0034] The anomaly scorer calculates anomaly scores based on the likelihood that the data to be detected appears under the learned distribution.

[0035] Preferably, the method for calculating the anomaly score by the anomaly scorer comprises:

[0036] The anomaly scorer is: score = -E z~Q [log P θ (x i |z)], E refers to the expectation. The negative log-likelihood probability value of the data to be detected under the learned distribution is taken as its anomaly score.

[0037] Preferably, the construction of the abnormality diagnosis machine learning model clusters the latent variables of the data to be detected and diagnoses the specific abnormality type, including:

[0038] A clusterer of the anomaly diagnosis model is constructed using machine learning technology. The clusterer is used to cluster the posterior latent variables corresponding to the data to be detected to obtain data clusters of different anomaly types, thereby diagnosing different anomaly types.

[0039] Preferably, the method for clustering latent variables of the data to be detected by the clusterer includes:

[0040] The clusterer is represented by: C = Cluster9z i ; ω), cluster the latent variables of the data to be detected to obtain the category C of the data to be detected;

[0041] Cluster refers to machine learning clustering algorithms, such as K-Means, DB-SCAN, etc.; the data to be tested x i The posterior latent variable z i By the variational posterior learner Qφ (z|x i ) is obtained, ω is the parameter of the clusterer.

[0042] Preferably, a manual annotation interface is built to annotate the test data, and the annotated data is used to evaluate the effect of model anomaly detection and diagnosis, including:

[0043] A graphical annotation interface is built for photovoltaic data. Through this interface, test data is read in, data is manually annotated, and the annotation results are saved. The annotation results should include labels for normal or abnormal data, and for abnormal data, its abnormal type can also be annotated.

[0044] Based on the labeled test data, calculate the AUC_ROC and AUC_PR metrics for the variational autoencoder and anomaly diagnosis machine learning model.

[0045] Preferably, the method for calculating the AUC_ROC and AUC_PR indicators of the variational autoencoder and the anomaly diagnosis machine learning model based on labeled test data includes:

[0046] Get test data x according to the variational autoencoder i The abnormal score i , select different thresholds α as the classification criteria for abnormal samples, min{score i}<α<max{score i}, according to the model judgment results and the true labels, calculate the number of true positive examples (TP), false positive examples (FR), false negative examples (FN), and true negative examples (TN), so as to draw the ROC curve and PR curve. The horizontal axis of the ROC curve is the false positive rate (FPR = FP / (FP+TN)) and the true positive rate (TPR = TP / (TP+FN)); the horizontal axis of the PR curve is the recall rate (recall = TP / (TP+FN)), and the vertical axis is the precision rate (precision = TP / (TP+FP)); calculate the area under the two curves to get the two indicators.

[0047] According to the clusterer of the anomaly diagnosis model, the test data x is obtained i Category C i , map the clustering categories with the true labels, select the mapping scheme with the largest AUC_ROC and AUC_PR values, and obtain the corresponding AUC_ROC and AUC_PR values.

[0048] According to another aspect of the present invention, a photovoltaic data anomaly detection and fault diagnosis system based on a variational autoencoder is provided, comprising:

[0049] The data processing module standardizes and filters the data to facilitate the training of the variational autoencoder;

[0050] The model learning module learns the distribution of the original data through the reconstruction process of the original data;

[0051] The anomaly scoring module obtains the anomaly score of the data based on the likelihood probability of the data to be detected appearing under the learned distribution;

[0052] The abnormality diagnosis module clusters the variational posterior latent variables of the data to be detected in the variational autoencoder to obtain the specific abnormality type of the data to be detected;

[0053] The indicator evaluation module quantitatively evaluates the effects of the anomaly detection and anomaly diagnosis modules based on the labeled test data.

[0054] Preferably, the data processing module, the model learning module, and the anomaly scoring module are connected in sequence, the anomaly diagnosis module is connected to the model learning module, and the index evaluation module is connected to the anomaly scoring detection module and the anomaly diagnosis module.

[0055] Preferably, the system further includes any one or more of the following:

[0056] -The data processing module includes a data normalizer and a data selector, wherein the data normalizer performs processing such as low-light interval data clipping, missing value completion, time alignment, and data value scaling on the sensor data to obtain standardized input data. The data selector selects data with less noise in the original data as training data, and uses the MAD of the photovoltaic power and irradiation intensity curve as an indicator.

[0057] -The model learning module includes a variational posterior learner, a data generator and an optimization iterator. The variational posterior learner maps the original data to the posterior latent variables, thereby obtaining the representation of the data in the latent space. The data generator maps the posterior latent variables to the original data, thereby learning the probability distribution of the original data. The optimization iterator guides the variational posterior learner and the data generator to perform optimization iterations according to the gap between the approximate posterior distribution of the latent variables learned by the variational posterior learner and the prior distribution, and the degree of deviation between the distribution of the data learned by the data generator and the distribution of the real data, thereby reducing the degree of deviation of the optimization target.

[0058] -The anomaly scoring module comprises an anomaly scorer, wherein the anomaly scorer calculates the anomaly score of the data to be detected according to the likelihood probability of the data to be detected appearing under the distribution learned in the data generator.

[0059] -The abnormality diagnosis module includes a clusterer, wherein the clusterer performs unsupervised clustering based on the posterior latent variables obtained by inputting the data to be detected into the variational posterior learner to obtain a specific abnormality type of the data to be detected.

[0060] -The indicator evaluation module includes a data annotation interface and an indicator calculator. The test data is read in according to the data annotation interface, and the annotation results are output and saved after manual annotation, including whether it is normal and the specific abnormality type. The indicator calculator calculates the AUC_ROC and AUC_PR indicators of the variational autoencoder and the abnormality diagnosis machine learning model to quantitatively evaluate the model effect.

[0061] Due to the adoption of the above technical solution, the present invention has the following beneficial effects compared with the prior art:

[0062] The photovoltaic data anomaly detection and fault diagnosis method and system based on variational autoencoder provided by the present invention are based on automated data processing and time series anomaly detection algorithms, and use data collection, organization, and annotation methods to convert real production data into multivariate time series that can be processed by the model, and learn the probability distribution of real data through deep learning algorithm modeling and clustering of hidden variables to return anomaly detection and diagnosis results to users. This method can well characterize the uncertainty of photovoltaic and other new energy power generation data, and has strong robustness and interpretability. The system is conducive to forming the basic technical support for quantitative evaluation, anomaly detection, and fault diagnosis of photovoltaic power generation data, and provides support for intelligent monitoring, reasonable evaluation, and later maintenance of photovoltaic equipment, and helps the efficient development of the photovoltaic industry. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Other features, objects and advantages of the present invention will become more apparent upon reading the detailed description of non-limiting embodiments with reference to the following drawings:

[0064] Figure 1 The present invention is a flowchart of a photovoltaic data anomaly detection and fault diagnosis method based on a variational autoencoder in a preferred embodiment of the present invention.

[0065] Figure 2 The module diagram of a photovoltaic data anomaly detection and fault diagnosis system based on a variational autoencoder in a preferred embodiment of the present invention. DETAILED DESCRIPTION

[0066] The following is a detailed description of the embodiments of the present invention: This embodiment is implemented on the premise of the technical solution of the present invention, and a detailed implementation method and a specific operation process are given. It should be pointed out that for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.

[0067] The photovoltaic data anomaly detection and fault diagnosis method and system based on variational autoencoder provided by the present invention are based on automated data processing and time series anomaly detection algorithms, and use data collection, organization, and annotation methods to convert real production data into multivariate time series that can be processed by the model, and learn the probability distribution of real data through deep learning algorithm modeling and clustering of hidden variables to return anomaly detection and diagnosis results to users. This method can well characterize the uncertainty of photovoltaic energy new energy data, and has strong robustness and interpretability. The system is conducive to forming the basic technical support for quantitative evaluation, anomaly detection, and fault diagnosis of photovoltaic power generation data, and provides support for intelligent monitoring, reasonable evaluation, and later maintenance of photovoltaic equipment, and promotes the efficient development of the photovoltaic industry.

[0068] This example provides a photovoltaic data anomaly detection and fault diagnosis method based on variational autoencoder, such as Figure 1 As shown, the following steps are included:

[0069] Step S1, using a data processing algorithm to automatically process the original production data (including the power, irradiation, ambient temperature, etc. of the photovoltaic station) by data clipping, completion, alignment, windowing, scaling, etc., to become standardized input data, and select some samples to form a training set;

[0070] Step S2, constructing a variational autoencoder, and using the processed samples for unsupervised training to learn the distribution of normal data;

[0071] Step S3, obtaining information such as abnormal scores and latent variables of the data to be detected according to the trained model;

[0072] Step S4, constructing an abnormality diagnosis machine learning model to cluster the latent variables of the data to be detected and diagnose the specific abnormality type;

[0073] Step S5: build a manual annotation interface to annotate the test data, and use the annotated data to evaluate the effectiveness of the model's anomaly detection and diagnosis.

[0074] As a preferred embodiment, step S1 includes:

[0075] First, the original data table exported from the database is trimmed, and the data in the weak light interval is deleted from the daily data;

[0076] Use interpolation and other algorithms to complete missing points;

[0077] After the above processing is performed on multiple data tables, they are aligned according to time to form a multivariate time series;

[0078] Each dimension value of the multivariate time series is scaled and converted into a z-score, eliminating the influence of different dimensions and value ranges. The formula is: where μ is the data {x i |i∈{1,…,T}}, σ is the mean of the data {x i The standard deviation of |i∈{1,…,T}}.

[0079] The multivariate time series is divided into non-overlapping daily samples with a time window size of one day.

[0080] Samples with less noise in the original data are selected to form the training set, and the mean absolute deviation (MAD) of the photovoltaic power generation and irradiation intensity curves is used as the noise index.

[0081] The formula is: Where w is the number of data points in the daily sample, is the value of the power generation dimension of the i-th data point, is the value of the irradiance intensity dimension of the i-th data point.

[0082] As a preferred embodiment, step S2 includes:

[0083] Step S201, using neural network technology to construct a variational posterior learner of the variational autoencoder; using the variational posterior learner to learn the mapping from original data to posterior latent variables, thereby obtaining a representation of the data in the latent space, which is also a random variable, called a variational posterior.

[0084] Step S202, using neural network technology to construct a data generator for the variational autoencoder; using the data generator to learn the mapping from the posterior latent variables to the original data, thereby learning the probability distribution of the original data.

[0085] Step S203, calculating the likelihood probability of the data sample according to the learned probability distribution of the original data, and further calculating the loss function;

[0086] Step S204, using an optimization iterator to update the variational autoencoder parameters through multiple iterations, reducing the loss function, and finally obtaining an optimized variational autoencoder.

[0087] As a preferred embodiment, in step S201, according to the type of input data being a time series, a sequence deep learning model such as RNN, Transformer, etc. should be selected as a variational posterior learner. In order to model the uncertainty of variables in photovoltaic and other renewable energy power generation data, in this embodiment, a variational recurrent neural network (VRNN) encoder is selected as the corresponding variational posterior learner.

[0088] Where z = Q φ(z|x) is a variational posterior learner that implements x i →z i The mapping of z i For x i The corresponding posterior hidden variable, φ is the network structure parameter of the variational posterior learner.

[0089] As a preferred embodiment, a sequence deep learning model should also be selected in step S202. Here, a VRNN decoder is used as a data generator to learn the mapping from the posterior latent variables to the original data, specifically:

[0090] The generator is: x = P θ (x|z), generating raw data from the posterior latent variables to achieve z i →x i The mapping of x i For z i The corresponding original data, θ is the network structure parameter of the generator.

[0091] As a preferred embodiment, the method for calculating the loss function in step S203 is specifically as follows:

[0092] The loss function is expressed as Loss = ∑ i {KL{π(z),Q φ (z|x i )}-E z~Q [log P θ (x i |z)]}, guiding the optimization of the variational autoencoder model.

[0093] Where π(z) refers to the prior distribution of the latent variable, which is generally a standard Gaussian distribution. φ (z|x i ) is the approximate posterior distribution of the latent variables learned by the variational posterior learner described in Power 4. θ (x i |z) is the probability distribution of the original data learned by the data generator described in power 5; KL refers to the Kullback-Leibler divergence, which is used to measure the difference between the two distributions, and E refers to the mathematical expectation. The first term in the loss function is the KL divergence, which calculates the difference between the prior distribution of the latent variable and the approximate posterior distribution; the second term is the negative log-likelihood, which calculates the likelihood probability value of the original data under the learned distribution.

[0094] Here, the approximate posterior distribution of the latent variables learned by the variational posterior learner and the probability distribution of the original data learned by the data generator are generally modeled as multivariate Gaussian distributions, that is, the corresponding parameters θ and φ are composed of the mean vector and the covariance matrix, that is, θ = (μ0, ∑0), φ = (μ1, ∑1). After modeling with multivariate Gaussian distribution, the KL divergence and negative log-likelihood probability values ​​can be analytically expressed using the above parameters.

[0095] As a preferred embodiment, step S3 includes

[0096] Step S301, input the data to be detected into the trained variational posterior learner to obtain the corresponding posterior latent variables;

[0097] Step S302, input the posterior latent variable into the trained data generator to obtain the learned distribution of the data to be detected.

[0098] Step S303: The anomaly scorer calculates an anomaly score according to the likelihood probability of the detected data appearing under the learned distribution.

[0099] As a preferred embodiment, in step S303, an anomaly scorer is used to calculate an anomaly score according to the likelihood probability of the detected data appearing under the learned distribution, specifically:

[0100] The anomaly scorer is: score = -E z~Q [log P θ (x i |z)], E refers to the expectation. The negative log-likelihood probability value of the data to be detected under the learned distribution is taken as its anomaly score.

[0101] As a preferred embodiment, step S4 includes:

[0102] Step S401, using machine learning technology to build a clusterer of the abnormality diagnosis model, using the clusterer to cluster the latent variables corresponding to the data to be detected, to obtain different abnormality type data clusters, so as to diagnose different abnormality types.

[0103] As a preferred embodiment, in step S401, the method in which the clusterer clusters the latent variables of the data to be detected is specifically as follows:

[0104] The clusterer is represented as: C = Cluster (z i ; ω), cluster the latent variables to obtain the category C of the latent variables. Cluster refers to the machine learning clustering algorithm, such as K-Means, DB-SCAN, etc.; the data to be tested x i The posterior latent variable z i By the posterior learner Q φ (z|xi ) is obtained, ω is the parameter of the clusterer.

[0105] As a preferred embodiment, step S5 includes:

[0106] Step S501: Build a graphical annotation interface for photovoltaic data, read test data through the interface, manually annotate data, and save the annotation results. The annotation results should include labels of normal or abnormal data, and support annotating the specific abnormal type for abnormal data.

[0107] Step S502, calculating the AUC_ROC and AUC_PR indicators of the variational autoencoder and the anomaly diagnosis machine learning model based on the labeled test data.

[0108] As a preferred embodiment, in step S502, the method for calculating the AUC_ROC and AUC_PR indicators of the variational autoencoder and the abnormal diagnosis machine learning model according to the labeled test data includes:

[0109] Variational Autoencoder: Get test data x according to the variational autoencoder i The abnormal score i , select different thresholds α as the classification criteria for abnormal samples, min{score i}<α<max{score i}, according to the model judgment results and the true labels, calculate the number of true positive examples (TP), false positive examples (FR), false negative examples (FN), and true negative examples (TN), so as to draw the ROC curve and PR curve. The horizontal axis of the ROC curve is the false positive rate (FPR=FP / (FP+TN)) and the true positive rate (TPR=TP / (TP+FN)); the horizontal axis of the PR curve is the recall rate (recall=TP / (TP+FN)), and the vertical axis is the precision rate (precision=TP / (TP+FP)); calculate the area under the two curves to get the two indicators.

[0110] According to the clusterer of the anomaly diagnosis model, the test data x is obtained i Category C i , map the clustering categories and labels, select the mapping scheme with the largest AUC_ROC and AUC_PR values, and obtain the corresponding AUC_ROC and AUC_PR values.

[0111] Another embodiment of the present invention provides a photovoltaic data anomaly detection and fault diagnosis system based on a variational autoencoder, such as Figure 2 As shown, it includes: data processing module, model learning module, anomaly scoring module, anomaly scoring module, anomaly diagnosis module, and indicator evaluation module, wherein:

[0112] The data processing module standardizes and filters the data to facilitate the training of the variational autoencoder;

[0113] The model learning module learns the distribution of the original data through the reconstruction process of the original data;

[0114] The anomaly scoring module obtains the anomaly score of the data based on the likelihood probability of the data to be detected appearing under the learned distribution;

[0115] The abnormality diagnosis module includes a clusterer, wherein the clusterer performs unsupervised clustering based on the posterior latent variables obtained by inputting the data to be detected into the variational posterior learner to obtain the specific abnormality type of the data to be detected;

[0116] The indicator evaluation module quantitatively evaluates the effect of the model based on the labeled data.

[0117] As a preferred embodiment, the data processing module includes a data normalizer and a data selector, wherein the data normalizer performs processing such as low-light interval data clipping, missing value completion, time alignment, and data value scaling on the sensor data to become standardized input data. The data selector selects data with less noise in the original data as training data, and uses the MAD of the photovoltaic power and irradiation intensity curve as an indicator.

[0118] As a preferred embodiment, the model learning module includes a variational posterior learner, a data generator and an optimization iterator. The variational posterior learner maps the original data to the posterior latent variables, thereby obtaining the representation of the data in the latent space. The data generator maps the posterior latent variables to the original data, thereby learning the probability distribution of the original data. The optimization iterator guides the variational posterior learner and the data generator to perform optimization iterations according to the degree of deviation between the distribution of the data learned by the data generator and the distribution of the real data, thereby reducing the degree of deviation of the optimization target.

[0119] As a preferred embodiment, the anomaly scoring module includes an anomaly scorer, wherein the anomaly scorer calculates the anomaly score of the data to be detected according to the likelihood probability of the data to be detected appearing under the distribution learned in the data generator.

[0120] As a preferred embodiment, the abnormality diagnosis module includes a clusterer, wherein the clusterer performs unsupervised clustering based on the posterior latent variables obtained by inputting the data to be detected into a variational posterior learner to obtain a specific abnormality type of the data to be detected.

[0121] As a preferred embodiment, the index evaluation module includes a data annotation interface and an index calculator. The data annotation interface is used to read the test data, and the annotation results are output and saved after manual annotation, including whether it is normal and the specific abnormality type. The index calculator calculates the AUC_ROC and AUC_PR indicators of the variational autoencoder and the abnormality diagnosis machine learning model to quantitatively evaluate the model effect.

[0122] As a preferred embodiment, among the above five modules, the data processing module, the model learning module, and the anomaly scoring module are connected in sequence, the anomaly diagnosis module is connected to the model learning module, and the indicator evaluation module is connected to the anomaly scoring module and the anomaly diagnosis module.

[0123] The technical solution provided by the above embodiment of the present invention is further described in detail below in conjunction with a specific application example.

[0124] Take the photovoltaic power generation scene that records data such as power generation, irradiation intensity and ambient temperature as an example. The data represents the value and change of power generation and environmental information in the form of multivariate time series. Assuming that the above data is recorded every certain time S, the step length of the multivariate time series is T, which means that the operation status of the photovoltaic station is recorded for a total of T*S time. In mathematical form, X = {x1, x2,…, x T}, where the data dimension of each time step is N, and the data points of each time step are represented by an N-dimensional vector By modeling clean and normal historical data and learning the distribution of normal data, abnormal data can be detected and diagnosed.

[0125] Corresponding to step S1, the original data is trimmed and the data in the weak light interval is deleted; the missing value points are supplemented by interpolation and other algorithms; after the above processing is performed on multiple data tables, they are aligned according to time to form a multivariate time series. The value of each dimension of the multivariate time series is scaled and converted into a z-score to eliminate the influence of different dimensions and value ranges. The formula is: where μ is the data {x i |i∈{1,…,T}], σ is the mean of the data {x i The standard deviation of |i∈{1,…,T}}.

[0126] Because the PV series has a strong diurnal periodicity, the multivariate time series can be divided into non-overlapping daily samples with one day as the time window size.

[0127] The samples with less noise in the original data are selected to form the training set, which makes the original data cleaner and is conducive to the learning of normal data patterns. The mean absolute deviation MAD of the photovoltaic power generation and irradiation intensity curves is used as the noise size indicator.

[0128] The formula is: Where w is the number of data points in the daily sample, is the value of the power generation dimension of the i-th data point, is the value of the irradiance intensity dimension of the i-th data point.

[0129] Corresponding to steps S201 and S202, based on the data samples, a variational autoencoder is constructed and trained using neural network technology. The model inputs daily time series samples and outputs the probability distribution of these data samples. According to the characteristics of new energy power generation data, the encoder of the variational recurrent neural network VRNN should be selected as the variational posterior learner. For the data generator, the decoder of the variational recurrent neural network VRNN should be selected accordingly. The variational posterior learner is used to learn the posterior latent variables corresponding to the original data, that is, the representation of the original data, and the data generator is used to map the posterior latent variables to the original data, thereby learning the probability distribution of the original data. Expressed in mathematical form, variational posterior learner: z = Q φ (z|x), realize x i →z i The mapping of z i For x i The corresponding posterior hidden variable, φ is the network structure parameter of variational posterior learning. Generator x = P θ (x|z), achieve z i →x i The mapping of x i For z i Corresponding to the original data, θ is the network structure parameter of the generator.

[0130] The corresponding loss function of step S203 is:

[0131] Where π(z) refers to the prior distribution of the latent variable, which is generally a standard Gaussian distribution. φ (z|x i ) is the approximate posterior distribution of the latent variables learned by the variational posterior learner. θ (x|z i ) is the probability distribution of the original data learned by the data generator; KL refers to the Kullback-Leibler divergence, and E refers to the mathematical expectation. The first term in the loss function is the KL divergence, which calculates the difference between the prior distribution of the latent variable and the approximate posterior distribution; the second term is the negative log-likelihood, which calculates the likelihood probability value of the original data under the learned distribution.

[0132] Here, the approximate posterior distribution of the latent variables learned by the variational posterior learner and the probability distribution of the original data learned by the data generator are generally modeled as multivariate Gaussian distribution, that is, the corresponding parameters θ and φ are composed of the mean vector and the covariance matrix, that is, θ = (μ0, ∑0), φ = (μ1, ∑1); after modeling with the multivariate Gaussian distribution, the KL divergence and the negative log-likelihood probability values ​​can be analytically expressed through the above parameters.

[0133] Corresponding to step S204, an iterative optimizer is used to continuously update and iterate the variational autoencoder parameters {θ, φ} with the goal of reducing the loss function, guide the loss function to converge or meet the number of iterations required, and complete the iteration of the variational autoencoder.

[0134] Corresponding to step S3, after the variational autoencoder iteration is completed, the data to be detected is input into the trained variational posterior learner to obtain the corresponding posterior latent variable z; the posterior latent variable is input into the trained data generator to obtain the learned distribution of the data to be detected; the anomaly score is calculated according to the likelihood probability of the data to be detected appearing under the learned distribution, score = -E z~Q [log P θ (x i |z)].

[0135] For the content of step S4, the following example content description can be referred to in the specific implementation: K-Means, TSNE and other machine learning algorithms can be used to construct a clusterer of the abnormal diagnosis model, and the clusterer is used to cluster the latent variables corresponding to the data to be detected to obtain different abnormal type data clusters, thereby distinguishing different abnormal types. Described mathematically: The clusterer is expressed as: C = Cluster (z i ; ω), cluster the latent variables to obtain the category C of the latent variables; the data to be tested x i The posterior latent variable z i By the posterior learner Q φ (z|x i ) is obtained, ω is the parameter of the clusterer.

[0136] For the content of step 5, the following example content description can be referred to in the specific implementation: a graphical annotation interface is built for photovoltaic data, test data is read in through the interface, data is manually annotated, and the annotation results are saved. The annotation results should include labels for normal or abnormal data, and for abnormal data, its abnormal type can also be annotated.

[0137] Based on the labeled test data, calculate the AUC_ROC and AUC_PR indicators of the variational autoencoder and anomaly diagnosis machine learning model. Specifically:

[0138] For the variational autoencoder, obtain the test data x according to the variational autoencoderi The abnormal score s i , select different thresholds α as the classification criteria for abnormal samples, min{score i}<α<max{score i}, according to the model judgment results and the true labels, calculate the number of true positive examples (TP), false positive examples (FR), false negative examples (FN), and true negative examples (TN), so as to draw the ROC curve and PR curve. The horizontal axis of the ROC curve is the false positive rate (FPR=FP / (FP+TN)) and the true positive rate (TPR=TP / (TP+FN)); the horizontal axis of the PR curve is the recall rate (recall=TP / (TP+FN)), and the vertical axis is the precision rate (precision=TP / (TP+FP)); calculate the area under the two curves to get the two indicators.

[0139] For the anomaly diagnosis machine learning model, the test data x is obtained according to the clusterer of the anomaly diagnosis model. i Category C i , map the clustering categories and labels, select the mapping scheme with the largest AUC_ROC and AUC_PR values, and obtain the corresponding AUC_ROC and AUC_PR values.

[0140] The photovoltaic data anomaly detection and fault diagnosis method and system based on variational autoencoder provided by the above embodiment of the present invention first standardizes and screens the data to construct standard clean historical data. Then, an end-to-end deep neural network is used to construct a variational autoencoder, and the distribution of the original data is learned by the reconstruction process of the original data. The anomaly score of the data to be tested is calculated by the learned distribution, that is, the degree of deviation from the learned data distribution is used to characterize the degree of abnormality of the sample. Further, clustering is performed using a machine learning algorithm based on the posterior hidden variables extracted in the model learning module to diagnose the specific abnormal type. Finally, the system also provides a data annotation platform, and the effect of the model can be quantitatively evaluated based on the annotated data. The method and system provided by the above embodiment of the present invention can perform automated data processing, including data processing, screening, annotation, etc. to convert real production data into a multivariate time series that can be processed by the model, which is conducive to reducing labor costs; and the probability distribution of real data is modeled by the neural network model and the hidden variables are clustered to return the results of anomaly detection and diagnosis to the user. It can well characterize the uncertainty of new energy data such as photovoltaics, and has strong robustness and interpretability; it is conducive to forming basic technical support for quantitative evaluation, anomaly detection, and fault diagnosis of photovoltaic power generation data, and provides support for intelligent monitoring, reasonable evaluation, and later maintenance of photovoltaic equipment, thereby promoting the efficient development of the photovoltaic industry.

[0141] It should be noted that the steps in the method provided by the present invention can be implemented by using corresponding modules, devices, units, etc. in the system. Those skilled in the art can refer to the technical solution of the system to implement the step flow of the method, that is, the embodiments in the system can be understood as preferred examples of implementing the method, which will not be elaborated here.

[0142] The above specific embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. The above specific implementations can be modified by those skilled in the art without departing from the principles and purpose of the present invention, or some or all of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the present invention.

Claims

1. A photovoltaic data anomaly detection and fault diagnosis method based on variational autoencoder, characterized in that: include: Collect the original data of power, irradiation and ambient temperature of the photovoltaic station, and after automatic processing, form standardized input data, and select a small part of the samples as the training set and most of the samples as the test set; Use the training set for unsupervised training to learn the distribution of normal data and build a variational autoencoder model; According to the variational autoencoder model, anomaly scores and latent variable information of the data to be detected are obtained; Construct anomaly diagnosis machine learning models to cluster latent variables of the data to be tested and diagnose specific anomaly types; Build a manual annotation interface to annotate the test data, and use the annotated data to evaluate the effectiveness of the model's anomaly detection and diagnosis.

2. The photovoltaic data anomaly detection and fault diagnosis method based on variational autoencoder according to claim 1 is characterized in that The automated processing includes data clipping, completion, alignment, windowing and / or scaling, specifically including: Trim the collected raw data table and delete the data in the weak light range; Use interpolation and other algorithms to complete missing points; Align according to time to form a multivariate time series; Each dimension of the multivariate time series is scaled and converted into a z-score, eliminating the influence of different dimensions and value ranges. The formula is: where μ k is the k-th dimension data The mean value, σ k is the k-th dimension data The standard deviation of Taking one day as the time window size, the multivariate time series is divided into non-overlapping daily samples; The samples with small noise in the original data are selected to form the training set, and the mean absolute deviation MAD of the photovoltaic power generation and irradiation intensity curve is used as the noise index. The formula is: Where w is the number of data points in the daily sample, is the value of the power generation dimension of the i-th data point, is the value of the irradiance intensity dimension of the i-th data point.

3. The photovoltaic data anomaly detection and fault diagnosis method based on variational autoencoder according to claim 1 is characterized in that The construction of the variational autoencoder model specifically includes: Using neural network technology to build a variational posterior learner for variational autoencoders; Use the variational posterior learner to learn the mapping from the original data to the posterior latent variables, thereby obtaining the representation of the data in the latent space; Use neural network technology to build a data generator for variational autoencoders; Use the data generator to learn the mapping from the posterior latent variables to the original data, thereby learning the probability distribution of the original data; Calculate the likelihood probability of the data sample based on the learned probability distribution of the original data, and further calculate the loss function; Use the optimization iterator to update the variational autoencoder parameters through multiple iterations, reduce the loss function, and finally obtain the optimized variational autoencoder.

4. The photovoltaic data anomaly detection and fault diagnosis method based on variational autoencoder according to claim 3 is characterized in that: The method of using a variational posterior learner to learn the mapping of original data to posterior latent variables comprises: The variational posterior learner z = Q φ (z|x), get the representation of data in latent space, and realize x i →z i The mapping of z i For x i The corresponding posterior hidden variable, φ is the network structure parameter of the variational posterior learner, Q φ (z|x) is the approximate posterior distribution of the latent variable learned by the variational posterior learner.

5. The photovoltaic data anomaly detection and fault diagnosis method based on variational autoencoder according to claim 3 is characterized in that: The method of using a data generator to learn a mapping from a posteriori latent variables to original data includes: The generator is: x = P θ (x|z), generate the original data from the posterior latent variables, thereby learning the probability distribution of the original data and achieving z i →x i The mapping of x i For z i The corresponding original data, θ is the network structure parameter of the generator, P θ (x|z) is the probability distribution of the original data learned by the data generator.

6. The photovoltaic data anomaly detection and fault diagnosis method based on variational autoencoder according to claim 3 is characterized in that: The method for calculating the loss function comprises: The loss function is expressed as: Among them, π(z) refers to the prior distribution of the latent variable, which takes the standard Gaussian distribution; KL refers to the Kullback-Leibler divergence, which is used to measure the difference between two distributions, and E refers to the mathematical expectation; the first term in the loss function is the KL divergence, which calculates the difference between the prior distribution of the latent variable and the approximate posterior distribution; the second term is the negative log-likelihood, which calculates the likelihood probability value of the original data under the learned distribution.

7. The photovoltaic data anomaly detection and fault diagnosis method based on variational autoencoder according to claim 1 is characterized in that According to the variational autoencoder model, the abnormal score and latent variable information of the data to be detected are obtained, specifically: Input the data to be tested into the trained variational posterior learner to obtain the corresponding posterior latent variables; Input the posterior latent variable into the trained data generator to obtain the learned distribution of the data to be tested; Anomaly scorer score = -E z~Q [logP θ (x i |z)], the negative log-likelihood probability value of the data to be detected under the learned distribution is taken as the anomaly score, where E is the expected value.

8. The photovoltaic data anomaly detection and fault diagnosis method based on variational autoencoder according to claim 1 is characterized in that: The abnormality diagnosis machine learning model is constructed to cluster the latent variables of the data to be detected and diagnose the specific abnormality type, specifically: The clusterer C=Cluster(z i ;ω); Use the clusterer to detect the data x i The corresponding posterior latent variable z i Clustering is performed to obtain different abnormal type data clusters C, so as to diagnose different abnormal types, where Cluster refers to the machine learning clustering algorithm and ω is the parameter of the clusterer.

9. The photovoltaic data anomaly detection and fault diagnosis method based on variational autoencoder according to claim 1, characterized in that: The manual annotation interface is built to annotate the test data, and the annotated data is used to evaluate the effect of model anomaly detection and diagnosis, specifically: A graphical annotation interface is built for photovoltaic data. Test data is read in through the interface, data is manually annotated, and the annotation results are saved. The annotation results should include labels indicating whether the data is normal or abnormal. For abnormal data, the specific abnormal type can also be annotated. Based on the labeled test data, the AUC_ROC and AUC_PR indicators of the variational autoencoder and anomaly diagnosis machine learning model are calculated, including: Get test data x based on the trained model i The abnormal score i , select different thresholds α as the classification criteria for abnormal samples, min{score i }<α <max{score i }, According to the model judgment results and the true labels, the number of true positive examples (TP), false positive examples (FR), false negative examples (FN), and true negative examples (TN) are calculated to draw the ROC curve and PR curve. The horizontal axis of the ROC curve is the false positive rate (FPR = FP / (FP+TN)), and the vertical axis is the true positive rate (TPR = TP / (TP+FN)); the horizontal axis of the PR curve is the recall rate (recall = TP / (TP+FN)), and the vertical axis is the precision rate (precision = TP / (TP+FP)); By calculating the area under these two curves, we can get these two indicators; According to the clusterer of the anomaly diagnosis model, the test data x is obtained i Category C i , map the clustering categories with the true labels, select the mapping scheme with the largest AUC_ROC and AUC_PR values, and obtain the corresponding AUC_ROC and AUC_PR values.

10. A photovoltaic data anomaly detection and fault diagnosis system based on variational autoencoder, characterized in that: include: The data processing module standardizes and filters the data to facilitate the training of the variational autoencoder; The model learning module learns the distribution of the original data through the reconstruction process of the original data; The anomaly scoring module obtains the anomaly score of the data based on the likelihood probability of the data to be detected appearing under the learned distribution; The abnormality diagnosis module clusters the variational posterior latent variables of the data to be detected in the variational autoencoder to obtain the specific abnormality type of the data to be detected; The indicator evaluation module quantitatively evaluates the effects of the anomaly detection and anomaly diagnosis modules based on the labeled test data.

11. A photovoltaic data anomaly detection and fault diagnosis system based on variational autoencoder according to claim 10, characterized in that: The data processing module, the model learning module, and the anomaly scoring module are sequentially connected, the anomaly diagnosis module is connected to the model learning module, and the index evaluation module is connected to the anomaly scoring module and the anomaly diagnosis module.

12. The photovoltaic data anomaly detection and fault diagnosis system based on variational autoencoder according to claim 10 or 11, characterized in that: The system also includes any one or more of the following: -The data processing module includes a data normalizer and a data selector, wherein the data normalizer performs processing such as data clipping in the weak light interval, missing value completion, time alignment, and data value scaling on the sensor data to make it standardized input data. The data selector selects data with less noise in the original data as training data, and uses the MAD of the photovoltaic power and irradiation intensity curve as an indicator. -The model learning module includes a variational posterior learner, a data generator and an optimization iterator. The variational posterior learner maps the original data to the posterior latent variables, thereby obtaining the representation of the data in the latent space. The data generator maps the posterior latent variables to the original data, thereby learning the probability distribution of the original data. The optimization iterator guides the variational posterior learner and the data generator to perform optimization iterations according to the gap between the approximate posterior distribution of the latent variables learned by the variational posterior learner and the prior distribution, and the degree of deviation between the distribution of the data learned by the data generator and the distribution of the real data, thereby reducing the degree of deviation of the optimization target. -The anomaly scoring module comprises an anomaly scorer, wherein the anomaly scorer calculates the anomaly score of the data to be detected according to the likelihood probability of the data to be detected appearing under the distribution learned in the data generator. -The abnormality diagnosis module includes a clusterer, wherein the clusterer performs unsupervised clustering based on the posterior latent variables obtained by inputting the data to be detected into the variational posterior learner to obtain a specific abnormality type of the data to be detected. -The indicator evaluation module includes a data annotation interface and an indicator calculator. The test data is read in according to the data annotation interface, and the annotation results are output and saved after manual annotation, including whether it is normal and the specific abnormality type. The indicator calculator calculates the AUC_ROC and AUC_PR indicators of the variational autoencoder and the abnormality diagnosis machine learning model to quantitatively evaluate the model effect.

Citation Information

Patent Citations

  • Photovoltaic power station fault diagnosis algorithm based on automatic encoder and K-means clustering

    CN112085108A

  • Data abnormity judgment method and system based on deep learning and extreme value theory

    CN112163624A

  • Information intelligent recommendation method based on deep clustering

    CN112417289A

  • Photovoltaic array fault diagnosis method based on fine tuning dense connection convolutional neural network

    CN112787591A

  • Abnormity detection method and system based on self-adversarial variational auto-encoder

    CN114707577A

Cited By

  • Photovoltaic data anomaly detection method and system based on time sequence variation auto-encoder

    CN121188360A

  • Photovoltaic data anomaly detection method and system based on time-series variational autoencoder

    CN121188360B