A supervised data generation method for photovoltaic power plants based on generative adversarial networks
Through the photovoltaic power station with supervised data generation method based on a generative adversarial network, the problem of unstable K-means clustering results is solved, and synthetic data with similar characteristics to real data is generated, quantitative evaluation of the generated data quality is realized, and data quality and detail restoration capabilities are improved.
Patent Information
- Application Number
- CN202411857055.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-12-17
AI Technical Summary
Traditional K-means clustering is susceptible to randomness in the initial center selection, resulting in unstable clustering results, difficulty in accurately dividing feature clusters, lack of quantitative analysis of the quality of generated data, and difficulty in judging the diversity and authenticity of generated data.
The supervised data generation method of photovoltaic power stations based on generative adversarial network is adopted. By initializing the generator and discriminator, the training sample training generator and discriminator is used to generate a synthetic data set that conforms to the distribution of the photovoltaic power station data set, and the characteristics of the synthetic data set and the real data set are clustered through the K-means clustering algorithm to evaluate the quality of the synthetic data set.
Through the adversarial training between the generator and the discriminator, the generator can learn the distribution mode of real photovoltaic power station data, generate synthetic data with similar characteristics to the real data, improve data quality and detail restoration capabilities, effectively avoid the initial center selection deviation during the clustering process, and realize the quantitative evaluation of the generated data quality.
Smart Images

Figure CN119322954B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data augmentation technology, and more specifically, to a supervised data generation method for a photovoltaic power station based on a generative adversarial network. Background Art
[0002] Artificial intelligence, a hot technology in recent years, has achieved remarkable results in many fields. The rapid development of deep learning technology has provided new algorithms for photovoltaic power plants to increase the number of risk data sets. The results achieved by deep learning in image feature extraction are superior to the more traditional machine learning methods that use manually designed features. It uses deep network models with learning capabilities to automatically extract image features.
[0003] Generative Adversarial Networks (GANs) are a new type of unsupervised network architecture, consisting primarily of two components: a generator and a discriminator. The generator's goal is to capture the distribution of real data as closely as possible, generating data that closely approximates the true distribution and thereby deceives the discriminator. The discriminator, on the other hand, aims to distinguish whether the input data distribution originates from real data or generated data. Through a continuous optimization game (constantly updating their parameters to minimize overall loss), the two components ultimately generate images that are indistinguishable from real or fake. Due to their exceptional generative capabilities, this model and its derivatives have been applied in various fields, achieving particularly remarkable results in image generation, achieving near-real results in many tasks.
[0004] Traditional methods use fully connected layers to extract data features, which is computationally intensive and inefficient, making it difficult to capture local features in complex data sets. Traditional GAN methods also struggle to ensure distribution consistency between generated data and real data, resulting in poor quality and lack of authenticity. Furthermore, traditional K-means clustering is susceptible to randomness in initial center selection, leading to unstable clustering results and difficulty in accurately dividing feature clusters. The lack of quantitative analysis of the quality of generated data makes it difficult to judge the diversity and authenticity of generated data.
[0005] Currently, no effective solutions have been proposed for the problems in related technologies. Summary of the Invention
[0006] In order to overcome the above problems, the present invention aims to propose a supervised data generation method for photovoltaic power stations based on a generative adversarial network, with the aim of solving the problems that traditional K-means clustering is easily affected by randomness in the initial center selection, resulting in unstable clustering results, difficulty in accurately dividing feature clusters, lack of quantitative analysis of the quality of generated data, and difficulty in judging the diversity and authenticity of the generated data.
[0007] To this end, the specific technical solutions adopted in the present invention are as follows:
[0008] A method for generating supervised data for a photovoltaic power station based on a generative adversarial network, comprising the following steps:
[0009] S1. Initialize the generator and discriminator, preprocess the PV power station dataset containing environmental features and corresponding power generation labels, and randomly extract training samples;
[0010] S2. Use the training samples to train the generator and discriminator, and use the generator to generate a synthetic dataset that conforms to the distribution of the photovoltaic power plant dataset. During the training process, the parameters of the generator and discriminator are optimized based on the discriminator's loss function, and the difference between the synthetic dataset and the photovoltaic power plant dataset is evaluated using a numerical evaluation method.
[0011] S3. Cluster the features of the synthetic dataset and the photovoltaic power plant dataset using the K-means clustering algorithm, observe the cluster centers and feature distribution, and evaluate the difference in feature distribution between the synthetic dataset and the real dataset using an unsupervised clustering method to assess the quality of the synthetic dataset.
[0012] The features of the synthetic dataset and the photovoltaic power plant dataset are clustered using the K-means clustering algorithm. The cluster centers and feature distributions are observed. The unsupervised clustering method is used to evaluate the difference in feature distribution between the synthetic dataset and the real dataset. The quality evaluation of the synthetic dataset includes the following steps:
[0013] S31. Extracting image features of the synthetic dataset and the real dataset using a scale-invariant feature transformation operator to obtain a feature vector set;
[0014] S32. Cluster the feature vectors of the synthetic dataset and the real dataset based on the K-means clustering algorithm, calculate the cluster center of each cluster, and obtain the representative feature vector of each class;
[0015] S33. Analyze the size and distribution of clusters and evaluate the quality of the synthesized dataset. If the comprehensive evaluation score of the generator is higher than the preset threshold, it indicates that the synthesized data has diversity. If the comprehensive evaluation score of the generator is lower than the preset threshold, it indicates that the generator has mode collapse.
[0016] S34. Draw a graph showing the relationship between the number of clusters and the classification error, determine the number of clusters using the elbow point method, and compare the trends of the classification error of the synthetic dataset and the real dataset as the number of clusters changes.
[0017] S35. Based on the cluster analysis results, evaluate the difference in feature distribution between the synthetic dataset and the real dataset.
[0018] Optionally, initializing the generator and the discriminator, preprocessing the photovoltaic power station dataset containing environmental features and corresponding power generation labels, and randomly extracting training samples include the following steps:
[0019] S11. Introduce a generative adversarial network model consisting of a generator and a discriminator, and use the ReLU activation function in the hidden layer of the generator, the tanh activation function in the output layer, and the sigmoid activation function in the fully connected layer of the discriminator;
[0020] S12, preprocessing a photovoltaic power station dataset containing environmental features and corresponding power generation labels, and randomly extracting training samples from the photovoltaic power station dataset;
[0021] S13. Based on the environmental characteristics and the corresponding power generation labels, convolutional layers are used in the generator and discriminator to extract features, and the parameters of the generative adversarial network model are optimized through the back-propagation algorithm.
[0022] Optionally, the expression of the generative adversarial network model is:
[0023] ;
[0024] Where, x Represents real data;
[0025] Indicates the distribution that the real data set obeys;
[0026] Representation discrimination x The probability of being the true data;
[0027] Z represents a randomly selected training sample from the photovoltaic power station dataset;
[0028] Indicates the probability distribution that the training sample Z obeys;
[0029] represents synthetic data;
[0030] Indicates that the discriminator judges the synthetic data in the generator The probability of being the true data; Represents the input real image x The expected value that the discriminator can discriminate; Represents the synthetic data input to the generator The probability that the discriminator can distinguish;
[0031] Represents the sum of the expected values of the discriminator D and the generator G.
[0032] Optionally, based on the environmental characteristics and the corresponding power generation labels, extracting features using convolutional layers in the generator and the discriminator, and optimizing the parameters of the generative adversarial network model using a backpropagation algorithm include the following steps:
[0033] S131. Using a convolutional transpose layer in the generator to generate a feature map, and using a convolutional layer in the discriminator to extract environmental features and corresponding power generation labels of the photovoltaic power station dataset;
[0034] S132, configure the convolutional layers of the generator and discriminator according to the filter size, stride, and padding;
[0035] S133: Input the environmental features and the corresponding power generation labels into the generator to generate synthetic data, and input them into the discriminator for classification;
[0036] S134. Use the cross entropy loss function to calculate the losses of the generator and discriminator, and adjust the parameters of the generator and discriminator through backpropagation and Adam optimizer.
[0037] Optionally, the generator and the discriminator are trained using the training samples, and a synthetic dataset that conforms to the distribution of the photovoltaic power plant dataset is generated by the generator; during the training process, the parameters of the generator and the discriminator are optimized based on the loss function of the discriminator, and the difference between the synthetic dataset and the photovoltaic power plant dataset is evaluated by a numerical evaluation method, including the following steps:
[0038] S21. Use the photovoltaic power station dataset to train the generator and discriminator. The generator generates synthetic data similar to the photovoltaic power station dataset by learning the distribution of real data.
[0039] S22. During the training process, based on the loss functions of the generator and discriminator, the parameters of the generator and discriminator are optimized by backpropagation and Adam optimizer respectively;
[0040] S23. Evaluate the quality of the synthetic data generated by the generator through the Inception Score to obtain the Inception Score value;
[0041] S24. Use KL divergence to calculate the difference between the conditional distribution of the synthetic data and the marginal distribution of the real data to obtain the KL divergence value. KL divergence (Kullback-Leibler Divergence) is used to measure the difference between two probability distributions and is usually used to evaluate the distribution difference between synthetic data and real data.
[0042] S25. Based on the KL divergence value, combined with the initial score value and standard deviation value, comprehensively evaluate the quality of the synthetic data.
[0043] Optionally, the expression for evaluating the quality of synthetic data generated by the generator through the initial score is:
[0044] ;
[0045] Where, represents a metric that quantifies the quality and diversity of generated images;
[0046] Indicates the sample expectations;
[0047] represents KL divergence;
[0048] represents the conditional distribution;
[0049] represents the marginal distribution.
[0050] Optionally, based on the KL divergence value, combined with the initial score value and the standard deviation value, comprehensively evaluating the quality of the synthesized data includes the following steps:
[0051] S251, respectively set the weights of the KL divergence value, the initial score value, and the standard deviation value;
[0052] S252. Use the weighted average method to integrate the KL divergence value, the initial score value, and the standard deviation value, and calculate the comprehensive evaluation score;
[0053] S253. Based on the calculation results, optimize the weight distribution of the KL divergence value, the initial score value, and the standard deviation value, and obtain the best comprehensive evaluation score;
[0054] S254. Use the best comprehensive evaluation score to evaluate the performance of the generator and obtain the performance of the generator in terms of the quality of the synthesized data.
[0055] Optionally, the expression for calculating the comprehensive evaluation score is:
[0056] ;
[0057] Where, represents the comprehensive evaluation score of synthetic data;
[0058] Represents the KL divergence value between the conditional distribution of synthetic data and the marginal distribution of real data;
[0059] Represents the weight of the KL divergence value;
[0060] represents the initial score value;
[0061] The weight representing the initial score value;
[0062] represents the standard deviation value;
[0063] Indicates the weight of the standard deviation value.
[0064] Optionally, clustering the feature vectors of the synthetic dataset and the real dataset based on the K-means clustering algorithm, calculating the cluster center of each cluster, and obtaining the representative feature vector of each class includes the following steps:
[0065] S321, calculating the density value of each feature vector in the synthetic data set and the real data set, and sorting them from high to low based on the density value;
[0066] S322, selecting two eigenvectors with the largest density values, and dividing the feature space into grids according to the distance between the two eigenvectors;
[0067] S323, repeating step S322 until the distance of the farthest feature vector in the grid is less than a set threshold or the number of feature vectors in the grid reaches a predetermined minimum value;
[0068] S324. In each grid, determine the initial cluster center according to the density and distance of the feature vectors;
[0069] S325, using the cluster center as the starting point of the K-means algorithm, clustering the feature vectors in the grid, and iteratively adjusting the cluster center until the cluster center reaches a preset standard to obtain clusters in each grid;
[0070] S326. Calculate the final cluster center of each cluster in each grid to obtain the representative feature vector of each class.
[0071] Optionally, in each grid, determining the initial cluster center according to the density and distance of the feature vectors includes the following steps:
[0072] S3241. In each grid, select feature vectors as candidate objects in descending order according to the calculated density values;
[0073] S3242, sequentially selecting two groups of eigenvectors with the highest density as candidate cluster centers;
[0074] S3243, calculating the distance between the two groups of feature vectors with the highest density, and comparing it with a preset distance threshold and radius;
[0075] S3244. If the distance is greater than a preset distance threshold, the two sets of eigenvectors with the highest density are selected in sequence as initial cluster centers. If the distance is greater than a preset radius but less than a preset distance threshold, the eigenvector with the highest density is retained as a single initial cluster center. If the distance is less than the radius, the line segment formed by the two sets of eigenvectors with the highest density as endpoints is used as an extended cluster center.
[0076] S3245. Continue to select the next candidate feature vector from the remaining high-density feature vectors, and repeat steps S3242-S3244 until all feature vectors in each grid have been evaluated, and finally all initial cluster centers in the grid are determined.
[0077] Compared with the existing technology, this application has the following beneficial effects:
[0078] 1. The generator of the present invention adopts the ReLU activation function, while the discriminator adopts the LeakyReLU and Sigmoid functions, which solves the gradient vanishing problem and ensures the stability of the network during training. The convolutional layer is used to extract the environmental features and power generation labels in the photovoltaic power station dataset. In particular, the convolutional neural network used in DCGAN replaces the fully connected layer, so that the generated synthetic data can better capture complex data features, improve the quality and detail restoration capabilities; the losses of the generator and discriminator are calculated through the cross-entropy loss function, and the model parameters are adjusted through back propagation and Adam optimizer. The generation quality and discrimination ability of the model are further improved, and samples with a similar distribution to real data can be effectively generated.
[0079] 2. The adversarial training between the generator and the discriminator of the present invention enables the generator to gradually learn the distribution pattern of real photovoltaic power station data. By continuously optimizing the parameters of the generator and the discriminator, synthetic data with similar characteristics to the real data is generated.
[0080] 3. The SIFT algorithm of the present invention performs stable key point extraction on the image features of synthetic data and real data, and generates a set of feature vectors with characteristics such as rotation and scale invariance. The K-means clustering algorithm divides the feature vectors of synthetic data and real data sets into multiple clusters, and obtains the representative feature vector of each cluster. Through steps such as density value sorting and initial center selection, fine clustering is achieved, so that the clustering results can reflect the diversity and distribution characteristics of the data set. Combined with the calculation of density values and grid division methods, the initial center selection bias in the clustering process is effectively avoided, so that the clusters can be evenly distributed in the feature space. By analyzing the number, size and distribution of clusters, the quality of the synthetic data set is comprehensively evaluated. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] The above characteristics, features and advantages of the present invention and their implementation methods and methods will become more clearly understood in conjunction with the following description of the embodiments, which will be described in detail in conjunction with the accompanying drawings. Here, a schematic diagram is shown:
[0082] Figure 1 is a flowchart of a method for generating supervised data for a photovoltaic power station based on a generative adversarial network according to an embodiment of the present invention;
[0083] Figure 2 (a) is a graph showing the loss value after training using experimental method 1 according to an embodiment of the present invention;
[0084] Figure 2 (b) is a graph showing the loss value after training using the second experimental method according to an embodiment of the present invention;
[0085] Figure 2 (c) is a graph showing the loss value after training using experimental method 3 according to an embodiment of the present invention;
[0086] Figure 2 (d) is a graph showing the loss value after training using experimental method 4 according to an embodiment of the present invention;
[0087] Figure 3 (a) is a curve showing the value change of the generator loss function according to an embodiment of the present invention;
[0088] Figure 3 (b) is a curve showing the value change of the discriminator loss function according to an embodiment of the present invention;
[0089] Figure 4 (a) is a curve of the total category error between the original image and the generated image before normalization according to an embodiment of the present invention;
[0090] Figure 4 (b) is a curve of the total category error between the normalized original image and the generated image according to an embodiment of the present invention. DETAILED DESCRIPTION
[0091] In order to help those skilled in the art better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0092] According to an embodiment of the present invention, a method for generating supervised data for a photovoltaic power station based on a generative adversarial network is provided.
[0093] The present invention will now be further described with reference to the accompanying drawings and specific embodiments. Figures 1-4 As shown, the method for generating supervised data for a photovoltaic power station based on a generative adversarial network according to an embodiment of the present invention includes the following steps:
[0094] S1. Initialize the generator and discriminator, preprocess the PV power station dataset containing environmental features and corresponding power generation labels, and randomly extract training samples.
[0095] Preferably, initializing the generator and the discriminator, preprocessing the photovoltaic power station dataset containing environmental features and corresponding power generation labels, and randomly extracting training samples include the following steps:
[0096] S11. Introduce a generative adversarial network model consisting of a generator and a discriminator, and use the ReLU activation function in the hidden layer of the generator, the tanh activation function in the output layer, and the sigmoid activation function in the fully connected layer of the discriminator;
[0097] S12, preprocessing a photovoltaic power station dataset containing environmental features and corresponding power generation labels, and randomly extracting training samples from the photovoltaic power station dataset;
[0098] It is important to explain that a PV power plant dataset containing environmental features and power generation labels is loaded. Environmental features include temperature, humidity, irradiance, wind speed, and so on, while the labels are the corresponding power generation data. Environmental features (such as temperature and humidity) and corresponding power generation labels are separated into two different datasets, serving as input features and target outputs, respectively. Missing values or outliers are handled. If there are missing environmental features or power generation records in the dataset, these can be addressed through interpolation, deletion of incomplete records, or mean filling. Numerical features are normalized or standardized. Because PV power plant environmental features (such as temperature and irradiance) can have different dimensions, they need to be normalized. For example, the data must be scaled to between 0 and 1 or standardized to a distribution with a mean of 0 and a standard deviation of 1. Random samples are then sampled from the preprocessed dataset for training. Based on the size of the dataset, you can set a random sampling method with a certain ratio (such as 80% for training and 20% for testing) to ensure that the samples are representative. The randomly selected training samples can be divided into a training set and a validation set (for example, 80% of the training data is used for model training and 20% of the data is used to verify the model effect) so that the model performance can be evaluated during the training process and overfitting can be prevented.
[0099] S13. Based on the environmental characteristics and the corresponding power generation labels, convolutional layers are used in the generator and discriminator to extract features, and the parameters of the generative adversarial network model are optimized through the back-propagation algorithm.
[0100] Preferably, the expression of the generative adversarial network model is:
[0101] ;
[0102] Where, x Represents real data;
[0103] Indicates the distribution that the real data set obeys;
[0104] Representation discrimination x The probability of being the true data;
[0105] Z represents a randomly selected training sample from the photovoltaic power station dataset;
[0106] Indicates the probability distribution that the training sample Z obeys;
[0107] represents synthetic data;
[0108] Indicates that the discriminator judges the synthetic data in the generator The probability of being the true data; Represents the input real image x The expected value that the discriminator can discriminate; Represents the synthetic data input to the generator The probability that the discriminator can distinguish;
[0109] Representation Discriminator D With the generator G The sum of the expected values of .
[0110] Preferably, according to the environmental characteristics and the corresponding power generation labels, extracting features using convolutional layers in the generator and the discriminator, and optimizing the parameters of the generative adversarial network model by the back propagation algorithm include the following steps:
[0111] S131. Using a convolutional transpose layer in the generator to generate a feature map, and using a convolutional layer in the discriminator to extract environmental features and corresponding power generation labels of the photovoltaic power station dataset;
[0112] S132, configure the convolutional layers of the generator and discriminator according to the filter size, stride, and padding;
[0113] S133: Input the environmental features and the corresponding power generation labels into the generator to generate synthetic data, and input them into the discriminator for classification;
[0114] S134. Use the cross entropy loss function to calculate the losses of the generator and discriminator, and adjust the parameters of the generator and discriminator through backpropagation and Adam optimizer.
[0115] It needs to be explained that the initialization generator G and the discriminator D The network parameters, the input matrix size is 64×64×3, and the output matrix size of the generator is changed to 400×400×3. 12,000 fireworks image data, including smoke and flame image data, were obtained from on-site bridge photography and web crawling as a training set. A single sample was randomly selected, and the generator generated a single sample using the defined noise distribution. Fixed generator G , train the discriminator D , so that it can distinguish real image data from virtual image data as much as possible. Cyclic update of fixed times discriminator D After that, update the generator once G , making it as difficult as possible for the discriminator to distinguish between real image data and virtual image data.
[0116] The ReLU function solves the vanishing gradient problem. Its gradient has only two options: 0 and 1. When the input is less than 0, the gradient is always 0, and the neuron chain stops forward propagation. When the input is greater than 0, the gradient is always 1, and the neuron chain's value remains unchanged and continues forward propagation. Considering that both the input and output are positive numbers, the ReLU function, as an activation function, can simplify the calculation process and improve computational efficiency while ensuring training effectiveness.
[0117] A variant of GAN is selected, namely Deep Convolutional Generative Adversarial Networks (DCGAN). This network uses convolutional neural networks instead of multi-layer perceptrons in the generator and discriminator, and replaces the fully connected layer with a convolution layer. It uses strided convolution instead of upsampling to better extract image features.
[0118] When the generator loss is less than 0.00001, the learning rate is readjusted to 0.002 to avoid the situation where the model cannot jump out of the layout minimum during training. At this time, the generator loss function tends to stabilize after oscillation, and the discriminator loss function first increases and then rapidly decreases and tends to stabilize.
[0119] In the generator, except for the last layer, the activation function uses the ReLU function, and the last layer uses the Tanh function. The reason is that the last layer needs to output an image. When the ReLU function is less than 0, the output is 0, while the output of the Tanh function is between -1 and 1. The output of the Tanh function changes linearly, and the Tanh output value After the formula: , pixel values of 0 to 255 can be obtained; in the discriminator, LeakyReLU is used as the activation function to prevent gradient sparseness. The LeakyReLU function is similar to the ReLU function, but when the input is a negative number, the LeakyReLU function is no longer 0, but a smaller number, usually 0.01, which effectively solves the problem of neuron death.
[0120] Inception Score is a commonly used metric for evaluating the quality of data generated by a generator. It uses a pre-trained Inception model (commonly used in image generation tasks) to evaluate the diversity and quality of synthetic data. Specifically, it includes the following descriptions:
[0121] 1. Calculate the classification probability of each synthetic data: Input the generated data into the pre-trained Inception model and calculate the probability distribution of each sample belonging to a certain category.
[0122] 2. Calculate the entropy value: Use the category distribution of the generated data to calculate its information entropy. A higher entropy value indicates better diversity of the generated data.
[0123] 3. Inception Score: The Inception model generates a score based on the category distribution and predicted entropy. A higher score indicates better diversity and authenticity of the generated data.
[0124] S2. Use the training samples to train the generator and discriminator, and use the generator to generate a synthetic dataset that conforms to the distribution of the photovoltaic power plant dataset. During the training process, the parameters of the generator and discriminator are optimized based on the discriminator's loss function, and the difference between the synthetic dataset and the photovoltaic power plant dataset is evaluated using a numerical evaluation method.
[0125] Preferably, the generator and the discriminator are trained using the training samples, and a synthetic data set that conforms to the distribution of the photovoltaic power plant data set is generated by the generator; during the training process, the parameters of the generator and the discriminator are optimized based on the loss function of the discriminator, and the difference between the synthetic data set and the photovoltaic power plant data set is evaluated by a numerical evaluation method, including the following steps:
[0126] S21. Use the photovoltaic power station dataset to train the generator and discriminator. The generator generates synthetic data similar to the photovoltaic power station dataset by learning the distribution of real data.
[0127] The generator and discriminator are trained using a photovoltaic power plant dataset. The generator learns the distribution of real data to generate synthetic data similar to the photovoltaic power plant dataset. The detailed description is as follows: A real photovoltaic power plant dataset, including environmental characteristics and corresponding power generation, is input. The generator generates synthetic data similar to real data based on random noise, while the discriminator learns to distinguish between real and generated data to determine authenticity. The parameters of the generator and discriminator are optimized using a loss function. The generator continuously improves the quality of its generated data by attempting to "fool" the discriminator, ultimately generating synthetic data similar to real photovoltaic power plant data.
[0128] S22. During the training process, based on the loss functions of the generator and discriminator, the parameters of the generator and discriminator are optimized by backpropagation and Adam optimizer respectively;
[0129] S23. Evaluate the quality of the synthetic data generated by the generator through the initial score (IS) to obtain the initial score value;
[0130] S24. Calculate the difference between the conditional distribution of the synthetic data and the marginal distribution of the real data using KL divergence to obtain a KL divergence value;
[0131] The KL divergence is used to calculate the difference between the conditional distribution of the synthetic data and the marginal distribution of the real data. The specific description of the KL divergence value is as follows: the conditional distribution of the generated synthetic data is calculated to represent the probability distribution of power generation under different conditions (such as different combinations of environmental characteristics); then, the corresponding marginal distribution is calculated from the real data set to represent the actual probability distribution of power generation under these conditions. The KL divergence of the conditional distribution of the synthetic data and the marginal distribution of the real data is then calculated to quantify the difference between the two. The smaller the KL divergence value, the closer the distribution of the synthetic data is to the distribution of the real data.
[0132] S25. Based on the KL divergence value, combined with the initial score value and standard deviation value, comprehensively evaluate the quality of the synthetic data.
[0133] It's important to note that the generator and discriminator of a generative adversarial network (GAN) are trained using a photovoltaic power plant dataset. The generator's goal is to generate synthetic data with similar characteristics to real data by learning the distribution patterns of real photovoltaic data, while the discriminator needs to determine whether the generated data is real data. During training, the parameters of the generator and discriminator are optimized using a loss function. The generator's loss measures the similarity between the generated data and real data, while the discriminator's loss measures its ability to correctly distinguish between real and fake data. Parameters are updated using the Adam optimizer, and backpropagation continuously improves the model. The Inception Score (IS) is a commonly used metric for evaluating the quality of data generated by the generator. It uses a pre-trained Inception model (commonly used in image generation tasks) to assess the diversity and quality of generated images. The KL divergence (Kullback-Leibler Divergence) measures the difference between two probability distributions and is often used to assess the distributional difference between synthetic and real data. The smaller the KL divergence, the closer the distribution of the generated data is to the distribution of the real data. The quality of the generated data is comprehensively evaluated using multiple metrics, including the KL divergence value, the Inception Score (IS), and the standard deviation. These metrics can be used to comprehensively assess the authenticity and diversity of the generated data.
[0134] During the training process, in order to distinguish real images from virtual images generated by the generator, should be The maximum value, that is, for For the real distribution, To be close to 1, From the generated distribution, To be close to 0; should be Take the smallest value and try to generate real images to deceive the discriminator. From the generated distribution, Close to 1. When the discriminator's recognition accuracy for any test image is 0.5, the discriminator cannot distinguish between real images and virtual images generated by the generator.
[0135] The learning rate is a crucial hyperparameter in deep learning. It represents the step size used by the model during parameter optimization, adjusting the weights in the opposite direction of the gradient. It controls the magnitude of weight adjustments during optimization. A high learning rate results in larger weight updates, reducing the time required to find a new set of weights that minimizes network training loss. However, a high learning rate can also lead to excessively large weight updates, preventing the update from reaching the optimal point. A low learning rate ensures that no local minima are missed, but it also means that convergence will take longer. Therefore, the following two experimental methods compare four methods to determine the appropriate learning rate for model training.
[0136] In addition, in order to find a training model that is more suitable for dataset expansion, the following four training methods were designed. The initial learning rate of the four experiments was 0.002. The experimental methods are:
[0137] Experimental method 1: exponentially slowing down the learning rate, with a slowing exponent of 0.95;
[0138] Experimental method 2: The learning rate is exponentially slowed down with a slowdown exponent of 0.95. The original fixed discrimination target (0 or 1) of the discriminator is replaced with a random number in the range of [0, 0.3] or [0.7, 1].
[0139] Experimental method 3: The learning rate is exponentially slowed down with a slowdown exponent of 0.95. The images generated by the generator three times are imported into the discriminator to calculate the common loss function. ,in is the mean square error, It is The predicted value indicates that the model The prediction results of input samples, No. The true value indicates the value of the The actual results of the samples;
[0140] Experimental method 4: Use a periodic learning rate, slow down the learning rate exponentially, and set the slowdown exponent to 0.95. When the generator loss is less than 0.00001, readjust the learning rate to 0.002.
[0141] The loss values during the four experiments are as follows Figure 2 As shown in the figure, in the four experiments, as the number of generations increases, the generator loss value of the deep convolutional adversarial neural network tends to be stable, and the generator loss value gradually decreases. The data analysis for each experiment is as follows:
[0142] For experimental method 1, the loss value curve after training is completed, such as Figure 2As shown in (a), at the 52nd generation, the generator loss value dropped to 0.1542 and then stopped decreasing, then slowly increased. However, the discriminator loss value was 1.6534, still maintaining a downward trend and tending to converge. The reason why the generator loss value stopped decreasing is that the discriminator effect is too accurate, and the generator cannot deceive the discriminator. Finally, the generator and discriminator loss values converged to 3.3023 and 0.06 respectively.
[0143] For the loss value curve after the training of experimental method 2, as shown in Figure 2 As shown in (b), since the original fixed discriminant target of 0 or 1 is changed to a random number in the range of [0, 0.3] or [0.7, 1], the loss values of the discriminator and generator are smaller than those in other experiments. In this experiment, the loss values of the discriminator and generator did not stabilize until 820 generations, and the discriminator loss value remained around 0.031. The convergence speed slowed down. Although changing the target to a random number in the range of [0, 0.3] or [0.7, 1] reduced the possibility of missing the minimum value to a certain extent, it also increased the uncertainty of gradient descent.
[0144] For experimental method three, the loss value curve after training is completed, as shown in the following figure: Figure 2 As shown in (c), the generator's loss is larger than in other experiments because the images generated by the generator three times are fed into the discriminator to calculate the common loss. In this experiment, the discriminator and generator losses stabilize after 200 generations, eventually converging to 1.8624, which is faster than in other experiments.
[0145] For experimental method 4, the loss value curve after training is completed is as follows: Figure 2 As shown in (d), when the generator loss is less than 0.00001, the learning rate is readjusted to 0.002, which avoids the situation where the model cannot jump out of the layout minimum during training. In 2000 generations, the learning rate is readjusted 3 times. The loss value tends to be stable within 70 generations after the adjustment, which is in line with the expected effect.
[0146] 12,000 fireworks images, including smoke and flames, were obtained by photographing bridges on site and crawling the web. After training, a generator was obtained and used to generate images. The loss function value change curves of the generator and discriminator during training are shown in the figure below. Figure 3 shown.
[0147] from Figure 3 As can be seen in (a), the generator loss function tends to be stable after the shock, which is given by Figure 3 As can be seen in (b), the discriminator loss function first rises and then drops rapidly and tends to be stable.
[0148] Table 1 Average gradient table of average synthetic data
[0149]
[0150] As shown in Table 1, the results of Experiment 2 are not ideal, while the other results are similar. Experiment 4 has the best effect, which is 2.20% higher than Experiment 1, 16.06% higher than Experiment 2, and 0.40% higher than Experiment 3. In terms of the effect of graph synthesis data generation, the data generated by Experiment 4 is the clearest.
[0151] Table 2 GAN quantitative analysis evaluation value table
[0152]
[0153] Table 2 shows that when the number of synthetic input data is between 100 and 400, the IS value increases with the number of input images, while the STD value fluctuates slightly. This indicates that image diversity improves with the number of images, while image quality remains essentially unchanged. When the number of input images is between 500 and 1000, the IS value fluctuates slightly with the number of input images, while the STD value shows a decreasing trend. This indicates that image diversity remains stable, while image quality improves with the number of images. Considering both the diversity and quality of generated images, the optimal number of samples for augmenting the dataset is around 800 to 1000.
[0154] Preferably, the expression for evaluating the quality of the synthetic data generated by the generator through the initial score is:
[0155] ;
[0156] ;
[0157] ;
[0158] Where, Represents the samples in the generative adversarial network generation model , its conditional probability distribution The expected value of the entropy;
[0159] Represents the samples in the generative model The conditional probability distribution of The expected value of the entropy;
[0160] i Represents the index or identity of different elements in the sample space;
[0161] Represents the entire generated sample set The marginal probability distribution of Entropy;
[0162] Represents the samples in the generative model The probability distribution of
[0163] express The marginal probability distribution of irrelevant Probability of occurrence;
[0164] represents a metric that quantifies the quality and diversity of generated images;
[0165] Express expectations;
[0166] represents KL divergence;
[0167] represents the conditional distribution;
[0168] represents the marginal distribution.
[0169] Preferably, based on the KL divergence value, combined with the initial score value and the standard deviation value, comprehensively evaluating the quality of the synthesized data includes the following steps:
[0170] S251, respectively set the weights of the KL divergence value, the initial score value, and the standard deviation value;
[0171] S252. Use the weighted average method to integrate the KL divergence value, the initial score value, and the standard deviation value, and calculate the comprehensive evaluation score;
[0172] S253. Based on the calculation results, optimize the weight distribution of the KL divergence value, the initial score value, and the standard deviation value, and obtain the best comprehensive evaluation score;
[0173] S254. Use the best comprehensive evaluation score to evaluate the performance of the generator and obtain the performance of the generator in terms of the quality of the synthesized data.
[0174] Preferably, the expression for calculating the comprehensive evaluation score is:
[0175] ;
[0176] Where, represents the comprehensive evaluation score of synthetic data;
[0177] Represents the KL divergence value between the conditional distribution of synthetic data and the marginal distribution of real data;
[0178] Represents the weight of the KL divergence value;
[0179] represents the initial score value;
[0180] The weight representing the initial score value;
[0181] represents the standard deviation value;
[0182] Indicates the weight of the standard deviation value.
[0183] S3. Cluster the features of the synthetic dataset and the photovoltaic power station dataset using the K-means clustering algorithm, observe the cluster centers and feature distribution, and evaluate the feature distribution differences between the synthetic dataset and the real dataset using an unsupervised clustering method to evaluate the quality of the synthetic dataset.
[0184] The features of the synthetic dataset and the photovoltaic power plant dataset are clustered using the K-means clustering algorithm. The cluster centers and feature distributions are observed. The unsupervised clustering method is used to evaluate the difference in feature distribution between the synthetic dataset and the real dataset. The quality evaluation of the synthetic dataset includes the following steps:
[0185] S31. Use a scale-invariant feature transformation operator to extract image features of the synthetic dataset and the real dataset to obtain a set of feature vectors.
[0186] It should be noted that the use of the scale-invariant feature transform operator to extract image features from the synthetic and real datasets, resulting in a set of feature vectors, is described as follows: The synthetic and real datasets are converted to image format, and the images are preprocessed to enhance feature detail. Next, the SIFT operator is applied to each image for feature extraction. The SIFT algorithm identifies key points and calculates local image descriptors for these key points. Finally, a set of feature vectors is generated for each image, which is used to analyze the similarity between the synthetic and real datasets.
[0187] S32. Cluster the feature vectors of the synthetic dataset and the real dataset based on the K-means clustering algorithm, calculate the cluster center of each cluster, and obtain the representative feature vector of each class.
[0188] Preferably, clustering the feature vectors of the synthetic dataset and the real dataset based on the K-means clustering algorithm, calculating the cluster center of each cluster, and obtaining the representative feature vector of each class includes the following steps:
[0189] S321, calculating the density value of each feature vector in the synthetic data set and the real data set, and sorting them from high to low based on the density value;
[0190] S322, selecting two eigenvectors with the largest density values, and dividing the feature space into grids according to the distance between the two eigenvectors;
[0191] S323, repeating step S322 until the distance of the farthest feature vector in the grid is less than a set threshold or the number of feature vectors in the grid reaches a predetermined minimum value;
[0192] S324. In each grid, determine the initial cluster center according to the density and distance of the feature vectors;
[0193] S325, using the cluster center as the starting point of the K-means algorithm, clustering the feature vectors in the grid, and iteratively adjusting the cluster center until the cluster center reaches a preset standard to obtain clusters in each grid;
[0194] S326. Calculate the final cluster center of each cluster in each grid to obtain the representative feature vector of each class.
[0195] It should be explained that the density value of each eigenvector in the synthetic data set and the real data set is calculated. The density value represents the density of points in the neighborhood of a certain eigenvector. Then, all eigenvectors are sorted from high to low according to the density value, and the two eigenvectors with the largest density values are selected, and the distance between them is calculated. The feature space is preliminarily gridded based on the distance between the two eigenvectors to ensure that the grid after division contains eigenvectors that are as uniform as possible. The grid division step of S322 is repeated, and the two eigenvectors with the largest density are continuously selected in each divided grid for refinement until the distance of the farthest eigenvector in the grid is less than the preset threshold, or the number of eigenvectors in the grid reaches the set minimum value. In each grid, the initial cluster center is determined based on the density of the eigenvectors and the distance between them. Usually, points with higher density and more uniform distribution are selected as the initial cluster center to ensure the accuracy of the clustering results. The initially determined cluster center is used as the starting point of the K-means algorithm to start clustering the eigenvectors in the grid. By repeatedly iteratively adjusting the position of the cluster center until the cluster center is stable and no longer changes significantly, the clusters within each grid are obtained. After the K-means algorithm converges, the final cluster center of each cluster is calculated to obtain the representative feature vector of each cluster for subsequent analysis and feature extraction.
[0196] Specific examples are as follows:
[0197] Consider a photovoltaic power plant dataset containing two feature vectors: temperature and irradiance. A similar synthetic dataset has been generated. The goal is to perform feature clustering on these two datasets using the K-means clustering algorithm and find the representative feature vector for each cluster.
[0198] Assume that in a real dataset, certain eigenvectors (such as temperature 30°C and irradiance 800W / m²) appear densely in local areas with high density values. For each eigenvector, calculate the neighborhood density and sort the density values from high to low to prioritize high-density areas.
[0199] Select the two eigenvectors with the highest density (e.g., 800 W / m² for irradiance at 30°C and 850 W / m² for irradiance at 28°C). If the distance between them is large, use them as the centers of two grids, dividing the entire feature space into regions of different densities.
[0200] In the divided grid, continue to select high-density eigenvectors and divide the grid in sequence. If the distance between the farthest eigenvectors in a grid is less than a threshold (such as a set distance of 10 units), stop dividing.
[0201] In a given grid, the eigenvector with the highest density (e.g., temperature 32°C, irradiance 780W / m²) is selected as the initial cluster center. If the distance between adjacent eigenvectors is within a set radius, one of them is selected as the extended initial cluster center.
[0202] Starting from the determined initial cluster centers, the K-means algorithm is applied for iterative clustering. In each iteration, the feature vector (e.g., temperature 28°C, irradiance 850W / m²) is assigned to the nearest cluster center, and the new center position is calculated until the center stabilizes.
[0203] After clustering converges, calculate the final cluster center for each cluster. For example, assume the center of a cluster is at a temperature of 29°C and an irradiance of 820 W / m². This center represents the typical environmental characteristics of the cluster and provides a reference for subsequent data analysis.
[0204] Preferably, in each grid, determining the initial cluster center according to the density and distance of the feature vectors includes the following steps:
[0205] S3241. In each grid, select feature vectors as candidate objects in descending order according to the calculated density values;
[0206] S3242, sequentially selecting two groups of eigenvectors with the highest density as candidate cluster centers;
[0207] S3243, calculating the distance between the two groups of feature vectors with the highest density, and comparing it with a preset distance threshold and radius;
[0208] S3244. If the distance is greater than a preset distance threshold, the two sets of eigenvectors with the highest density are selected in sequence as initial cluster centers. If the distance is greater than a preset radius but less than a preset distance threshold, the eigenvector with the highest density is retained as a single initial cluster center. If the distance is less than the radius, the line segment formed by the two sets of eigenvectors with the highest density as endpoints is used as an extended cluster center.
[0209] S3245. Continue to select the next candidate feature vector from the remaining high-density feature vectors, and repeat steps S3242-S3244 until all feature vectors in each grid have been evaluated, and finally all initial cluster centers in the grid are determined.
[0210] S33. Analyze the size and distribution of clusters and evaluate the quality of the synthesized data set. If the comprehensive evaluation score of the generator is higher than the preset threshold, it indicates that the synthesized data has diversity; if the comprehensive evaluation score of the generator is lower than the preset threshold, it indicates that the generator has mode collapse.
[0211] S34. Draw a graph showing the relationship between the number of clusters and the classification error, determine the number of clusters using the elbow point method, and compare the trends of the classification error of the synthetic dataset and the real dataset as the number of clusters changes.
[0212] It should be noted that the specific description of plotting the relationship between the number of clusters and classification error, determining the number of clusters using the elbow point method, and comparing the classification error trends of the synthetic and real datasets with the number of clusters is as follows: Multiple cluster analyses are performed on the synthetic and real datasets, each using a different number of clusters (e.g., from 2 to 20). The classification error for each number of clusters is calculated (for example, using mean squared error, or SSE). The number of clusters is then plotted against the corresponding classification error to observe the trend of error as the number of clusters increases. Using the elbow point method, the optimal number of clusters is determined by finding the point in the graph where the rate of decline of the classification error significantly slows down, i.e., the elbow point. Finally, the classification error trends of the synthetic and real datasets with different numbers of clusters are compared and analyzed.
[0213] S35. Based on the cluster analysis results, evaluate the difference in feature distribution between the synthetic dataset and the real dataset.
[0214] It should be noted that the specific description of evaluating the feature distribution differences between synthetic and real datasets based on cluster analysis results is as follows: Cluster analysis is performed on each synthetic and real dataset to obtain their respective clusters and corresponding feature vector distributions. Next, the cluster centers, number, size, and distribution of clusters for each dataset are calculated, and similarity metrics (such as mean and variance) are calculated for each feature. Finally, by comparing the differences in cluster center locations, cluster size, and morphology between the generated data and the real data, the feature distribution differences between the synthetic and real datasets are quantitatively evaluated, thereby determining the distribution quality and authenticity of the generated data.
[0215] like Figure 4 In order to avoid the problem that the numerical differences between features are too large, which may lead to the low contribution of some features to the model, Figure 4 (b) Both the original and generated data are normalized before classification. Figure 4 (a) is the total category error curve of the original image and the generated image before normalization. Figure 4 (b) is the total error curve of the original image and the generated image after normalization, which is given by Figure 4 (a) with Figure 4 (b) As can be seen, as the number of categories increases, the total category error decreases rapidly and begins to stabilize when the number of categories reaches 5. When the number of categories exceeds the critical value of 5, the total category error tends to be stable with minimal change. This critical value is the optimal number of categories.
[0216] In summary, with the help of the above technical solution of the present invention, the generator of the present invention adopts the ReLU activation function, and the discriminator adopts the LeakyReLU and Sigmoid functions, which solves the gradient disappearance problem and ensures the stability of the network during training. The convolutional layer is used to extract the environmental features and power generation labels in the photovoltaic power station data set. In particular, the convolutional neural network used in DCGAN replaces the fully connected layer, so that the generated synthetic data can better capture the complex data features and improve the quality and detail restoration capabilities; the losses of the generator and the discriminator are calculated by the cross entropy loss function, and the model parameters are adjusted through the process of back propagation and Adam optimizer, which further improves the generation quality and discrimination ability of the model, and can effectively generate samples with similar distribution to real data; the adversarial training of the generator and the discriminator of the present invention enables the generator to gradually learn the real data. The distribution pattern of real photovoltaic power station data is analyzed. By continuously optimizing the parameters of the generator and discriminator, synthetic data with similar characteristics to the real data is generated. The SIFT algorithm of the present invention performs stable key point extraction on the image features of the synthetic data and the real data, and generates a set of feature vectors with characteristics such as rotation and scale invariance. The K-means clustering algorithm divides the feature vectors of the synthetic data and the real data set into multiple clusters, and obtains the representative feature vector of each cluster. Through steps such as density value sorting and initial center selection, the fine division of clusters is achieved, so that the clustering results can reflect the diversity and distribution characteristics of the data set. Combined with the calculation of density values and the grid division method, the initial center selection bias in the clustering process is effectively avoided, so that the clusters can be evenly distributed in the feature space. By analyzing the number, size and distribution of clusters, the quality of the synthetic data set is comprehensively evaluated.
[0217] Although the present invention has been disclosed above with reference to preferred embodiments, the embodiments are merely examples for the purpose of illustration and are not intended to limit the present invention. Those skilled in the art may make various modifications and alterations without departing from the spirit and scope of the present invention. The scope of protection claimed by the present invention shall be subject to the claims.
Claims
1. A supervised data generation method for photovoltaic power plants based on generative adversarial networks, characterized in that: include: S1, initialize the generator and discriminator, pre-process the photovoltaic power station data set containing environmental features and corresponding power generation labels, and randomly extract training samples; S2. Use the training samples to train the generator and the discriminator, and use the generator to generate a synthetic data set that conforms to the distribution of the photovoltaic power plant data set; during the training process, optimize the parameters of the generator and the discriminator based on the loss function of the discriminator, and evaluate the difference between the synthetic data set and the photovoltaic power plant data set through a numerical evaluation method; S3. Cluster the features of the synthetic dataset and the PV power plant dataset using the K-means clustering algorithm, observe the cluster centers and feature distribution, and evaluate the feature distribution differences between the synthetic dataset and the real dataset using an unsupervised clustering method to evaluate the quality of the synthetic dataset. The step S3 comprises: S31, extracting image features of the synthetic data set and the real data set using a scale-invariant feature transformation operator to obtain a feature vector set; S32, clustering the feature vectors of the synthetic data set and the real data set based on the K-means clustering algorithm, calculating the cluster center of each cluster, and obtaining the representative feature vector of each class; S33, analyze the size and distribution of clusters and evaluate the quality of the synthetic data set. If the comprehensive evaluation score of the generator is higher than the preset threshold, it indicates that the synthetic data has diversity; if the comprehensive evaluation score of the generator is lower than the preset threshold, it indicates that the generator has mode collapse; S34, plotting the relationship between the number of clusters and the classification error, determining the number of clusters by the elbow point method, and comparing the classification error trends of the synthetic data set and the real data set as the number of clusters changes; S35. Based on the cluster analysis results, evaluate the difference in feature distribution between the synthetic dataset and the real dataset.
2. According to claim 1, a method for generating supervised data for a photovoltaic power station based on a generative adversarial network is characterized in that: The initialization of the generator and the discriminator, preprocessing of the photovoltaic power station data set including environmental features and corresponding power generation labels, and random extraction of training samples include the following steps: S11. Introduce a generative adversarial network model consisting of a generator and a discriminator, and use the ReLU activation function in the hidden layer of the generator, the tanh activation function in the output layer, and the sigmoid activation function in the fully connected layer of the discriminator; S12, preprocessing a photovoltaic power station data set including environmental features and corresponding power generation labels, and randomly extracting training samples from the photovoltaic power station data set; S13. According to the environmental characteristics and the corresponding power generation labels, the convolutional layers are used in the generator and the discriminator to extract features, and the parameters of the generative adversarial network model are optimized through the back propagation algorithm.
3. According to claim 2, a method for generating supervised data for a photovoltaic power station based on a generative adversarial network is characterized in that: The expression of the generative adversarial network model is: ; In the formula, x Represents real data; Indicates the distribution that the real data set obeys; Indicates discrimination x The probability of being the true data; Z represents the randomly selected training samples from the PV power station dataset; Indicates the probability distribution that the training sample Z obeys; represents synthetic data; Indicates that the discriminator judges the synthetic data in the generator The probability of being the true data; Represents the input real image x The expected value that the discriminator can distinguish; Represents synthetic data input to the generator The probability that the discriminator can distinguish; Represents the sum of the expected values of the discriminator D and the generator G.
4. According to claim 3, a method for generating supervised data for a photovoltaic power station based on a generative adversarial network is characterized in that: The method of extracting features using convolutional layers in the generator and the discriminator according to the environmental features and the corresponding power generation labels, and optimizing the parameters of the generative adversarial network model by the back propagation algorithm includes the following steps: S131, using a convolutional transpose layer in the generator to generate a feature map, and using a convolutional layer in the discriminator to extract environmental features and corresponding power generation labels of a photovoltaic power station data set; S132, configuring the convolutional layers of the generator and the discriminator according to the filter size, stride, and padding; S133, inputting the environmental features and the corresponding power generation labels into the generator to generate synthetic data, and inputting the synthetic data into the discriminator for classification; S134. Use the cross entropy loss function to calculate the losses of the generator and the discriminator, and adjust the parameters of the generator and the discriminator through back propagation and Adam optimizer.
5. According to claim 1, a method for generating supervised data for a photovoltaic power station based on a generative adversarial network is characterized in that: The method of using the training samples to train the generator and the discriminator, generating a synthetic data set that conforms to the distribution of the photovoltaic power plant data set by the generator; during the training process, optimizing the parameters of the generator and the discriminator based on the loss function of the discriminator, and evaluating the difference between the synthetic data set and the photovoltaic power plant data set by a numerical evaluation method includes the following steps: S21. Use the photovoltaic power station dataset to train the generator and the discriminator. The generator generates synthetic data similar to the photovoltaic power station dataset by learning the distribution of real data. S22. During the training process, based on the loss functions of the generator and the discriminator, the parameters of the generator and the discriminator are optimized by back propagation and Adam optimizer respectively; S23, evaluating the quality of the synthetic data generated by the generator through the initial score to obtain an initial score value; S24, using KL divergence to calculate the difference between the conditional distribution of the synthetic data and the marginal distribution of the real data, to obtain a KL divergence value; S25. Based on the KL divergence value, combined with the initial score value and the standard deviation value, the quality of the synthetic data is comprehensively evaluated.
6. The method for generating supervised data for a photovoltaic power station based on a generative adversarial network according to claim 5, characterized in that: The expression for evaluating the quality of the synthetic data generated by the generator through the initial score is: ; In the formula, represents a metric that quantifies the quality and diversity of generated images; Indicates the sample expectations; represents KL divergence; represents the conditional distribution; represents the marginal distribution.
7. A method for generating supervised data for a photovoltaic power station based on a generative adversarial network according to claim 6, characterized in that: The method of comprehensively evaluating the quality of synthetic data based on the KL divergence value, combined with the initial score value and the standard deviation value, includes the following steps: S251, respectively set the weights of the KL divergence value, the initial score value and the standard deviation value; S252, using the weighted average method to fuse the KL divergence value, the initial score value and the standard deviation value, and calculate the comprehensive evaluation score; S253. Based on the calculation results, optimize the weight distribution of the KL divergence value, the initial score value, and the standard deviation value, and obtain the best comprehensive evaluation score; S254. Use the best comprehensive evaluation score to evaluate the performance of the generator and obtain the performance of the generator in terms of the quality of synthetic data.
8. The method for generating supervised data for a photovoltaic power station based on a generative adversarial network according to claim 7, characterized in that: The expression for calculating the comprehensive evaluation score is: ; In the formula, represents the comprehensive evaluation score of synthetic data; Represents the KL divergence value between the conditional distribution of synthetic data and the marginal distribution of real data; Represents the weight of the KL divergence value; represents the initial score value; The weight representing the initial score value; represents the standard deviation value; Represents the weight of the standard deviation value.
9. The method for generating supervised data for a photovoltaic power station based on a generative adversarial network according to claim 1, characterized in that: The method of clustering the feature vectors of the synthetic data set and the real data set based on the K-means clustering algorithm, calculating the cluster center of each cluster, and obtaining the representative feature vector of each class includes the following steps: S321, calculating the density value of each feature vector in the synthetic data set and the real data set, and sorting them from high to low based on the density value; S322, selecting two eigenvectors with the largest density values, and dividing the feature space into grids according to the distance between the two eigenvectors; S323, repeating the step of S322 until the distance of the farthest feature vector in the grid is less than a set threshold or the number of feature vectors in the grid reaches a predetermined minimum value; S324, in each grid, determining an initial cluster center according to the density and distance of the feature vector; S325, using the cluster center as the starting point of the K-means algorithm, clustering the feature vectors in the grid, and iteratively adjusting the cluster center until the cluster center reaches a preset standard to obtain a cluster cluster in each grid; S326. Calculate the final cluster center of the clusters in each grid to obtain the representative feature vector of each category.
10. A method for generating supervised data for a photovoltaic power station based on a generative adversarial network according to claim 9, characterized in that: Determining the initial cluster center in each grid according to the density and distance of the feature vector comprises the following steps: S3241. In each grid, according to the calculated density values, feature vectors are selected in descending order as candidate objects; S3242, selecting two groups of feature vectors with the highest density as candidate cluster centers in turn; S3243, calculating the distance between the two groups of feature vectors with the highest density, and comparing it with a preset distance threshold and radius; S3244, if the distance is greater than a preset distance threshold, two groups of feature vectors with the highest density are selected in turn as initial cluster centers; if the distance is greater than a preset radius and less than a preset distance threshold, the feature vector with the highest density is retained as a single initial cluster center; if the distance is less than the radius, the line segment formed by the two groups of feature vectors with the highest density as endpoints is used as an extended cluster center; S3245. Continue to select the next candidate feature vector from the remaining high-density feature vectors, and repeat steps S3242-S3244 until all feature vectors in each grid have been evaluated, and finally all initial cluster centers in the grid are determined.
Citation Information
Patent Citations
Large-scale image online clustering system and method based on comparison learning
CN112668627A
Wheat germplasm recommendation method based on clustering algorithm
CN115203527A