Transformer area line loss calculation model evaluation method and system
By using the diffusion model to generate samples in the platform line loss calculation model evaluation method and combining sample selection strategies, the model performance evaluation and prediction problems under unbalanced data are solved, and more accurate and reliable model evaluation and optimization are achieved.
Patent Information
- Application Number
- CN202411529380.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-10-30
AI Technical Summary
When facing unbalanced data, the existing platform line loss calculation model is difficult to effectively evaluate and predict model performance, resulting in a shift in classification decisions and affecting the application and optimization of the model.
A method for evaluating the line loss calculation model of the station area is proposed. By obtaining the performance data of different station areas, a performance data set is generated, and a few class samples are generated using the preset diffusion model. Combined with the sample selection strategy, the generated samples that alleviate intra-class imbalance and improve classification accuracy are selected. Finally, the classification model is fitted and predicted to evaluate the model performance.
It effectively alleviates the in-class imbalance of a few class samples, improves the classification performance of the model under unbalanced data, ensures the accuracy and reliability of prediction results, and reduces the cost of model adjustment and optimization.
Smart Images

Figure CN119598138A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric energy metering, and more specifically, to a method and system for evaluating a transformer area line loss calculation model. Background Art
[0002] Under the background of the "dual carbon" goal and the construction of a new power system, loss reduction and energy-saving technology has become the focus of modern power system construction. The construction of a new theoretical line loss calculation model of "source-grid-load-storage" that is suitable for different substation scenarios and different data quality is of great significance to maintaining fair and just trade settlement between power companies and power customers, promoting the reform of the legal supervision model of household electricity meters, and helping the country's "dual carbon" goals. In order to ensure that the constructed new theoretical line loss calculation model of "source-grid-load-storage" meets the design requirements, it is necessary to test the performance of the calculation model to ensure that the calculation results of the model are accurate and reliable. To achieve this goal, it is urgent to evaluate the existing substation line loss calculation model, fully learn the performance level of the substation line loss calculation model in the existing substation, and build a classification model to predict the performance of the line loss calculation model in the real substation, and use this to determine whether the line loss calculation model needs to be modified and optimized in a targeted manner, thereby raising the accuracy and credibility of information measurement to a new level.
[0003] In the performance evaluation of the line loss calculation model in the substation, it is necessary to establish a mapping relationship between the topological structure, power supply area, number of users, power load, substation type and power factor in different substations and the performance level (such as better, good, poor, etc.) of the line loss calculation model in different substations. Its essence is a classification problem. In the performance test process, the substation characteristics and line loss calculation model performance levels collected have far more cases with better performance than those with poor performance, showing an overall imbalance. Directly classifying the unbalanced data will cause the classification decision boundary to shift toward the majority class samples. Therefore, in the actual application process, the classification model in the evaluation method needs to be able to effectively deal with the situation of category imbalance. It is crucial to accurately identify the substation with poor performance of the line loss calculation model on the basis of ensuring the high overall evaluation accuracy, which is crucial for the actual application and optimization adjustment of the substation line loss calculation model.
[0004] At present, there are two main levels for dealing with imbalanced classification problems: algorithm level and data level. Algorithm level methods directly improve the classification algorithm to make it suitable for the original data set to alleviate the negative impact of the class imbalance problem, but these methods are often limited by the selected data set and the specific classification task, and the algorithm has weak universality. Data level methods mainly include sampling methods and generation methods. Among them, sampling methods are represented by oversampling methods. Random oversampling is the most basic method in oversampling methods. It achieves data balance by randomly copying minority class samples, but it is easy to cause overfitting of minority class samples. To address the above problems, synthetic minority oversampling technology (SMOTE) was proposed. SMOTE performs random linear interpolation between minority class samples and their nearest neighbor samples based on the KNN algorithm, which solves the problems of random oversampling to a certain extent. Based on SMOTE, a series of improved oversampling methods have been derived. KMeans-SMOTE uses k-means clustering to filter noise, and adopts boundary safety scheme and unequal probability selection method to select samples, and finally uses linear interpolation method to generate samples; MPP-SMOTE divides minority class samples into two categories: difficult to learn and easy to learn, and performs sample interpolation and feature interpolation to generate samples. Although the above algorithms have solved some problems of the current SMOTE algorithm to a certain extent, there is no suitable decision-making method to ensure the rationality of the synthesized samples, which limits the subsequent classification performance improvement.
[0005] There are two main types of generative methods: variational autoencoders (VAE) and generative adversarial networks (GANs). VAE solves the problem of difficulty in predicting the posterior distribution of generated samples based on hidden coding in variational inference by introducing the evidence lower bound (ELBO), and realizes the generation from hidden variables to samples, but lacks a reliable supervision mechanism and is difficult to ensure the authenticity of generated samples. GAN uses the idea of adversarial games to learn the distribution of original samples, ensuring the authenticity of generated samples, but often encounters mode collapse problems when facing data sets with multiple distribution patterns. In recent years, some studies have tried to solve this problem. CWGAN-GP adds conditional information to WGAN-GP to assist the generative adversarial network in capturing the real data distribution, which alleviates the mode collapse and training instability problems of GAN to a certain extent. RVGAN-TL uses the hidden variables in VAE as the input of GAN, and introduces similarity metric loss in the generator to improve the quality of minority data generated by GAN. The above methods only force the model to generate the required samples through pre-set goals, and do not fundamentally improve the model's ability to learn complex sample distributions, and cannot alleviate the intra-class imbalance of minority classes. The data-level method balances the number of samples of the two categories through sampling or generation operations. However, the sampling method essentially does not have the feature information of the learning samples, does not have the ability to learn the distribution pattern of the samples, cannot explain the rationality of the generated samples, and has no reliable supervision mechanism to ensure the authenticity of the samples obtained by sampling. The generation method combines the deep learning idea to learn the distribution pattern of the original samples, and uses a certain discrimination mechanism to ensure the authenticity of the generated samples to a certain extent. However, the generated samples often have mode collapse and can only cover a few distribution patterns. When faced with an intra-class imbalanced data set, it may even aggravate the intra-class imbalance phenomenon, which is not conducive to the improvement of subsequent classification performance.
[0006] In recent years, the diffusion model has become one of the most advanced deep generative models, breaking the long-term dominance of GAN in image generation tasks and showing very high potential in many fields, including computer vision, natural language processing, and multimodal learning. Existing generative methods based on VAE and GAN often suffer from mode collapse when generating tabular data, and the generated samples cannot cover the various distribution patterns of the original samples. In contrast, the diffusion model gradually understands how the various parts of the original data are related to each other and how these parts change with the increase or decrease of noise in the process of adding noise and denoising the original samples. This progressive learning helps the model understand the intrinsic structure and pattern in the data, and the model can capture the features and details of different scales in the data. Therefore, the diffusion model has a stronger ability to learn the distribution of the original samples, and the generated samples can cover the various distribution patterns of the original minority class samples. However, the generated samples cannot alleviate the intra-class imbalance of the minority class samples, and the effect of alleviating the subsequent classifier decision drift is limited. Therefore, it is a very critical issue to finely control the spatial distribution of the generated samples to improve the intra-class imbalance of the minority class. Summary of the invention
[0007] In view of the above problems, the present invention proposes a method for evaluating a line loss calculation model in an area, which is characterized by comprising:
[0008] Acquire performance data of a target substation line loss calculation model under different substations, generate a performance data set, and divide the performance data set into a plurality of binary classification data sets;
[0009] Generate minority class samples through a preset diffusion model, and use sample selection strategies to screen out generated samples that significantly contribute to alleviating the intra-class imbalance of minority class samples and improving the overall classification accuracy of minority class samples from multimodal samples;
[0010] The generated samples and the binary classification data set are fitted by a preset classification model, and based on the fitting results, the performance of the target substation line loss calculation model in the target substation is predicted to generate a prediction result, and based on the prediction result, the target substation line loss calculation model is evaluated.
[0011] Optionally, a performance data set includes characteristic variables of different stations and corresponding performance labels.
[0012] Optional, characteristic variables include: district topology, power supply area, number of users, power load, station type and power factor.
[0013] Optionally, the performance label includes 5 categories.
[0014] Optionally, the performance data set is divided into multiple binary classification data sets, including:
[0015] The performance data set is classified according to the performance labels, and the samples under each category are used as the minority sample set, and the samples under the remaining categories are used as the majority sample set, so as to convert the performance data set into multiple binary classification data sets.
[0016] Optionally, the number of second-class datasets is the same as the number of performance labels.
[0017] Optionally, the preset diffusion model is established by using a multi-layer perceptron to replace the UNet model in the original diffusion model, and the multi-layer perceptron is used as a denoising model in the reverse calculation process of the original diffusion model.
[0018] Optionally, generate minority class samples through a preset diffusion model, including:
[0019] The two-category data set is denoised and de-noised by a preset diffusion model, and during the denoising and de-noising process, the correlation between the samples in each part of the two-category data set and the dynamic change law of the samples in each part of the two-category data set with the denoising and de-noising are determined. Through the correlation and dynamic change law, the characteristics and detail points of the samples in each part of the two-category data set at different scales are captured, and based on the characteristics and detail points at different scales, the minority class samples of the two-category data set are generated.
[0020] Optionally, among the minority class samples, generated samples that significantly contribute to alleviating the intra-class imbalance of the minority class and to the overall classification accuracy of the minority class are screened out, including:
[0021] Determine the changes in neighbor density and classification probability of the original minority class samples in the two-class data set before and after the diffusion model samples are generated, calculate the density weight and probability weight of the minority class samples in the two-class data set, and determine the weight difference between the density weight and probability weight of the minority class samples in the two-class data set. Based on the weight difference, screen out the generated samples in the multimodal samples that have a significant contribution to alleviating the intra-class imbalance of the minority class and to the overall classification accuracy of the minority class.
[0022] On the other hand, the present invention also proposes a substation line loss calculation model evaluation system, comprising:
[0023] A data acquisition unit, used to acquire performance data of a target substation line loss calculation model under different substations, generate a performance data set, and divide the performance data set into a plurality of binary classification data sets;
[0024] A sample generation unit is used to generate minority class samples through a preset diffusion model, and to screen out generated samples that have significant contributions to alleviating the intra-class imbalance of minority class samples and improving the overall classification accuracy of minority class samples from multi-modal samples through a sample selection strategy;
[0025] An evaluation unit is used to fit the generated samples and the binary classification data set through a preset classification model, predict the performance of the target substation line loss calculation model in the target substation based on the fitting results, generate a prediction result, and evaluate the target substation line loss calculation model based on the prediction result.
[0026] Optionally, a performance data set includes characteristic variables of different stations and corresponding performance labels.
[0027] Optional, characteristic variables include: district topology, power supply area, number of users, power load, station type and power factor.
[0028] Optionally, the performance label includes 5 categories.
[0029] Optionally, the performance data set is divided into multiple binary classification data sets, including:
[0030] The performance data set is classified according to the performance labels, and the samples under each category are used as the minority sample set, and the samples under the remaining categories are used as the majority sample set, so as to convert the performance data set into multiple binary classification data sets.
[0031] Optionally, the number of second-class datasets is the same as the number of performance labels.
[0032] Optionally, the preset diffusion model is established by using a multi-layer perceptron to replace the UNet model in the original diffusion model, and the multi-layer perceptron is used as a denoising model in the reverse calculation process of the original diffusion model.
[0033] Optionally, generate minority class samples through a preset diffusion model, including:
[0034] The two-category data set is denoised and de-noised by a preset diffusion model, and during the denoising and de-noising process, the correlation between the samples in each part of the two-category data set and the dynamic change law of the samples in each part of the two-category data set with the denoising and de-noising are determined. Through the correlation and dynamic change law, the characteristics and detail points of the samples in each part of the two-category data set at different scales are captured, and based on the characteristics and detail points at different scales, the minority class samples of the two-category data set are generated.
[0035] Optionally, among the minority class samples, generated samples that significantly contribute to alleviating the intra-class imbalance of the minority class and to the overall classification accuracy of the minority class are screened out, including:
[0036] Determine the changes in neighbor density and classification probability of the original minority class samples in the two-class data set before and after the diffusion model samples are generated, calculate the density weight and probability weight of the minority class samples in the two-class data set, and determine the weight difference between the density weight and probability weight of the minority class samples in the two-class data set. Based on the weight difference, screen out the generated samples in the multimodal samples that have a significant contribution to alleviating the intra-class imbalance of the minority class and to the overall classification accuracy of the minority class.
[0037] In yet another aspect, the present invention further provides a computing device, comprising: one or more processors;
[0038] a processor for executing one or more programs;
[0039] When the one or more programs are executed by the one or more processors, the above-described method is implemented.
[0040] In yet another aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed, the method described above is implemented.
[0041] Compared with the prior art, the present invention has the following beneficial effects:
[0042] The present invention provides a method for evaluating a line loss calculation model for a substation, which is characterized by comprising: obtaining performance data of a target substation line loss calculation model under different substations, generating a performance data set, and dividing the performance data set into multiple binary classification data sets; generating minority class samples through a preset diffusion model, and screening out generated samples that have made significant contributions to alleviating the imbalance within the minority class samples and the overall classification accuracy of the minority class samples through a sample selection strategy in multi-mode samples; fitting the generated samples and the binary classification data set through a preset classification model, and based on the fitting results, predicting the performance of the target substation line loss calculation model under the target substation, generating prediction results, and evaluating the target substation line loss calculation model based on the prediction results. The present invention avoids the problem of sample data imbalance by classifying the performance data set, so that when the classified data set is used for performance prediction, the prediction result has high accuracy, so the model parameters can be effectively adjusted according to the prediction results, avoiding repeated model building. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 is a flow chart of the method of the present invention;
[0044] Figure 2 It is a flow chart of the evaluation method and system of the line loss calculation model of the substation area in the embodiment of the method of the present invention;
[0045] Figure 3A flow chart of a sample selection strategy for adaptively generating samples based on changes in sample neighbor density and classification probability according to an embodiment of the present invention;
[0046] Figure 4 It is a performance statistical diagram of different substations under the line loss calculation model of the method embodiment of the present invention;
[0047] Figure 5 It is a structural diagram of the system of the present invention. DETAILED DESCRIPTION
[0048] Now, exemplary embodiments of the present invention are described with reference to the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. These embodiments are provided to disclose the present invention in detail and completely and to fully convey the scope of the present invention to those skilled in the art. The terms used in the exemplary embodiments shown in the accompanying drawings are not intended to limit the present invention. In the accompanying drawings, the same units / elements are marked with the same reference numerals.
[0049] Unless otherwise specified, the terms (including technical terms) used herein have the commonly understood meanings to those skilled in the art. In addition, it is understood that the terms defined in commonly used dictionaries should be understood to have the same meanings as those in the context of the relevant fields, and should not be understood as idealized or overly formal meanings.
[0050] Embodiment 1:
[0051] The present invention proposes a method for evaluating the line loss calculation model of the substation area. Figure 1 As shown, including:
[0052] Step 1: Obtain performance data of a target area line loss calculation model under different areas, generate a performance data set, and divide the performance data set into multiple binary classification data sets;
[0053] Step 2: Generate minority class samples through the preset diffusion model, and select the generated samples that significantly contribute to alleviating the intra-class imbalance of minority class samples and improving the overall classification accuracy of minority class samples from the multimodal samples through the sample selection strategy;
[0054] Step 3: Fit the generated samples and the binary classification data set through a preset classification model, and based on the fitting results, predict the performance of the target substation line loss calculation model in the target substation, generate a prediction result, and based on the prediction result, evaluate the target substation line loss calculation model.
[0055] Among them, the performance data set includes characteristic variables of different stations and corresponding performance labels.
[0056] Among them, the characteristic variables include: district topology, power supply area, number of users, power load, substation type and power factor.
[0057] Among them, performance labels include 5 categories.
[0058] The performance data set is divided into multiple binary classification data sets, including:
[0059] The performance data set is classified according to the performance labels, and the samples under each category are used as the minority sample set, and the samples under the remaining categories are used as the majority sample set, so as to convert the performance data set into multiple binary classification data sets.
[0060] Among them, the number of second-category data sets is the same as the number of performance labels.
[0061] Among them, the preset diffusion model is established by using a multi-layer perceptron to replace the UNet model in the original diffusion model, and the multi-layer perceptron is used as a denoising model in the reverse calculation process of the original diffusion model.
[0062] Among them, the minority class samples are generated through the preset diffusion model, including:
[0063] The two-category data set is denoised and de-noised by a preset diffusion model, and during the denoising and de-noising process, the correlation between the samples in each part of the two-category data set and the dynamic change law of the samples in each part of the two-category data set with the denoising and de-noising are determined. Through the correlation and dynamic change law, the characteristics and detail points of the samples in each part of the two-category data set at different scales are captured, and based on the characteristics and detail points at different scales, the minority class samples of the two-category data set are generated.
[0064] Among the minority class samples, the generated samples that have made significant contributions to alleviating the intra-class imbalance of the minority class and improving the overall classification accuracy of the minority class are screened out, including:
[0065] Determine the changes in neighbor density and classification probability of the original minority class samples in the two-class data set before and after the diffusion model samples are generated, calculate the density weight and probability weight of the minority class samples in the two-class data set, and determine the weight difference between the density weight and probability weight of the minority class samples in the two-class data set. Based on the weight difference, screen out the generated samples in the multimodal samples that have a significant contribution to alleviating the intra-class imbalance of the minority class and to the overall classification accuracy of the minority class.
[0066] The present invention is further described below in conjunction with specific implementation cases:
[0067] Implementation steps include:
[0068] (1) The performance of different substations under the line loss calculation model and the characteristics of the substations are used as input data sets, and multiple second-class data sets are obtained, specifically:
[0069] The performance data set under the line loss calculation model of different substations is input. The samples in the data set include six characteristic variables: substation topology, power supply area, number of users, power load, substation type and power factor; its performance labels include five categories: excellent, good, medium, qualified and unqualified; traverse each category of samples in the performance data set, take all samples under this category as the minority class sample set, and all samples in other categories as the majority class sample set, and convert the original data set into five second-class data sets; for each of the second-class data sets, the data set can be described as:
[0070] X=[X min , X maj ]
[0071] Among them, X is a two-category data set, and x is defined i is any sample in the X data set, that is, x i ∈X;X min is the minority class sample set, X min , i For X min Any sample in the data set, that is, X min , i ∈X min , X maj is the majority class sample set. Define X maj , i For X maj Any sample in the data set, that is, X maj , i ∈X maj ;
[0072] (2) Based on the samples of each unbalanced two-class data set, the evaluation method of the substation line loss calculation model and the system balance data set are used, and the basic classifier is used to classify them, specifically:
[0073] In the imbalanced classification problem, the intra-class imbalance of minority class samples will have a negative impact on the dataset and the accurate classification of minority class samples. The classifier will be biased towards the majority class samples during the classification process, that is, it will pay more attention to the accuracy of the majority class samples, resulting in a decrease in the classification accuracy of the minority class samples. When there are different distribution patterns within the minority class samples, and the sample densities of different distribution patterns are also different. During the classification process, the higher density area has a greater impact on the classifier than the lower density area. Therefore, the classifier will focus on the classification accuracy of the higher density area and ignore the lower density area, resulting in a decrease in the classification performance of the classifier.
[0074] The above steps are mainly separated by the following methods, including:
[0075] (1) Multi-modal sample generation method based on diffusion model;
[0076] (2) Adaptively generate sample selection strategies based on changes in sample neighbor density and classification probability.
[0077] Among them, the multi-modal sample generation method based on diffusion model, such as Figure 2 As shown, including:
[0078] For an unbalanced data set, the number of majority class samples is greater than the number of minority class samples. The classifier will be biased towards majority class samples during the classification process, that is, it will pay more attention to the accuracy of majority class samples, resulting in a lower classification accuracy for minority class samples. When there are different distribution patterns within minority class samples, and the sample densities of different distribution patterns are also different. During the classification process, the impact of higher density areas on the classifier is greater than that of lower density areas. The classifier will focus on the classification accuracy of higher density areas and ignore lower density areas, resulting in a decrease in classification performance. Therefore, alleviating the intra-class imbalance of minority class samples while balancing the overall number and distribution of the two types of samples is the key to improving the classification accuracy of the minority class and the overall classification performance.
[0079] The diffusion model is a probabilistic generative model inspired by non-equilibrium thermodynamics. It uses two interrelated Markov chains to achieve data generation, one is the forward chain that perturbs the original data into noise, and the other is the reverse chain that converts the noise back to the original data distribution. The forward process starts with the original data distribution and gradually introduces noise through a series of diffusion steps to convert the original data into a Gaussian distribution. In the reverse process, the model learns how to gradually restore the original data distribution from the Gaussian distribution through a series of denoising steps. The process of generating new samples starts with Gaussian noise, and through the steps of reverse diffusion, denoises step by step to restore new data samples.
[0080] In the forward process, by gradually adding different degrees of Gaussian noise to the original sample x, the distribution of the original sample gradually approaches the normal distribution. This process is shown in formula (1).
[0081]
[0082] Where x0 represents the original data, t represents the tth step of the forward process, and x t represents the data of the tth step in the forward process, ε represents Gaussian noise, Is a hyperparameter that controls the size of the noise. Usually α i is a very small and gradually decreasing constant value.
[0083] In the reverse denoising process, the model needs to predict the noise added in each step of the forward diffusion process, and its loss function is shown in formula (2).
[0084]
[0085] where θ ddpm represents the parameters of the diffusion model, Represents the noise of the sample at step t predicted by the denoising model. The denoising model that has converged in training gradually removes the noise from the Gaussian distribution by predicting and inferring the noise added at each time step, and obtains samples that satisfy the original distribution pattern. The denoising process is shown in formula (3).
[0086]
[0087] Where z represents the standard Gaussian distribution, σ t is the predefined variance at step t.
[0088] The denoising network UNet of the diffusion model is designed to process the complex relationship in the image data. It extracts the spatial relationship and local features of the image through the convolution layer, while the tabular data is usually structured, existing in the form of rows and columns, and does not contain the spatial relationship and local features in the image. Directly using UNet to generate tabular data will result in unclear boundaries between the distribution patterns of the generated samples, and cannot accurately cover the distribution of the original minority class samples. Therefore, the UNet denoising network used by the standard diffusion model cannot effectively extract feature information in the tabular data. The present invention uses a multi-layer perceptron (MLP) to replace UNet as the denoising model in the reverse process, which can more effectively extract the advanced feature information of the tabular data. The pseudo code algorithm for generating samples based on the diffusion model is shown in Table 1.
[0089] Table 1
[0090]
[0091] Compared with VAE-based and GAN-based generative models, the diffusion model gradually understands how the various parts of the original data are related to each other and how they change dynamically with the increase or decrease of noise during the process of adding noise and denoising the original samples. This progressive learning method enables the model to gain insight into the inherent structure and laws of the data. Therefore, the model can effectively capture the characteristics and details of the data at different scales, has a stronger ability to learn the distribution of the original samples, and the generated samples can widely reflect the diverse distribution characteristics of the original data.
[0092] Among them, the adaptive generation sample selection strategy based on the change of sample neighbor density and classification probability is as follows: Figure 3 As shown, including:
[0093] For samples generated based on the diffusion model, it can focus on enhancing the sparse areas in the original minority class samples while maintaining the various distribution patterns of the original minority class samples, but it cannot accurately control the number of samples generated in the sparse areas. If the number of samples generated in the sparse areas is small, it may not be able to effectively enhance them, and the effect on improving the classification performance of the sparse areas of minority class samples is limited; if the number of samples generated in the sparse areas is large, it may cause the subsequent classifier to over-focus on the sparse areas of minority class samples and ignore the classification accuracy of the surrounding majority class samples.
[0094] Therefore, in order to accurately control the number of samples generated by the diffusion model in sparse areas, the present invention proposes an adaptive sample selection strategy based on the change of sample neighbor density and classification probability, and screens the samples generated by the diffusion model to ensure the stability of the subsequent classifier classification performance improvement.
[0095] First, the generated samples are selected based on the change in the density of the neighbors of the original minority class samples before and after the sample generation. Specifically, for the original minority class sample x, the K nearest neighbor algorithm is used to find its K nearest neighbor sample set within the minority class sample before and after the sample generation, which are respectively and Calculate the average distance between the original minority class sample x and its K nearest neighbors before and after the sample is generated, respectively and The present invention defines a density weight den-weight to describe the degree to which the original minority class sample approaches the minority class sparse region. The definition of the density weight den-weight is shown in formula (4).
[0096]
[0097] From the calculation method of density weight, we can know that the larger the difference between the average distance between the sample and its K nearest neighbors before and after the sample is generated, the larger its density weight is, the more likely it is to be located in the sparse area of the original minority class samples, and the generated samples around it need to be retained. The number of generated samples that need to be retained around each original minority class sample is calculated according to the density weight of the sample. The specific calculation process is shown in formula (5).
[0098]
[0099] where num gen To generate the total number of samples, The number of nearest neighbor generated samples that need to be retained for the minority class sample x, and m is the total number of original minority class samples.
[0100] Then, the generated samples are selected based on the changes in the classification probability of the original minority class samples before and after sample generation. Specifically, for the original minority class sample x, the basic classifier is used to fit the denoised training set and the training set of the merged generated samples, and the probability of the original minority class sample x being a minority class before and after sample generation is predicted, which are respectively and The present invention defines a probability weight prob-weight to further describe the degree to which the original minority class sample approaches the minority class sparse region, and its calculation process is shown in formula (6).
[0101]
[0102] From the calculation method of probability weight, we can know that the larger the probability weight value is, the greater the effect of the generated sample on the accurate classification of the original sample is. The original sample is more likely to be located in a sparse area, and the generated samples around it need to be retained. Using the probability weight to replace the density weight in formula (5) to obtain the number of neighbor generated samples to be retained calculated by the probability weight The specific calculation process is shown in formula (7).
[0103]
[0104] comprehensive and Get the number of nearest neighbor generated samples that should be retained for the original minority class sample x. Specifically, if and The difference is small, indicating that the changes in the density gap and probability gap of the nearest neighbors before and after the generated samples are relatively consistent. The generated minority class samples contribute to alleviating the imbalance within the class and improving the accurate classification of minority class samples. It is necessary to retain the nearest neighbor generated samples around them. Finally, the number of nearest neighbor generated samples of x retained is On the contrary, it means that the generated minority class samples have different effects on alleviating the intra-class imbalance and improving the accurate classification of minority class samples. In order to ensure the stability of subsequent classification performance improvement, the number of nearest neighbor generated samples of x is finally retained as According to the changes in the neighbor density and classification probability before and after the generated samples, the number of nearest neighbor generated samples retained by the original minority class samples is adaptively determined. This can effectively screen the generated samples that significantly contribute to alleviating the imbalance within the minority class and the overall classification accuracy of the minority class. The screened generated samples are used to balance the original imbalanced training set, ensuring the stability of subsequent classifier performance improvement. The pseudo code of the adaptive generated sample selection strategy based on the changes in sample neighbor density and classification probability is shown in Table 2.
[0105] Table 2
[0106]
[0107] In the technical solution implemented by the present invention, according to the characteristics of the line loss calculation model in terms of model accuracy and business needs, the performance of different substations under the line loss calculation model is learned based on the diffusion model. The generated samples can balance the number of samples with different performance and cover a variety of distribution patterns in a few samples with poor performance, achieving a balance between samples of substations with different levels of performance under the line loss calculation model. At the same time, an adaptive sample selection strategy is used to screen the generated minority class samples, thereby alleviating the imbalance of multiple distribution patterns of samples in minority class substations. The combination of the above strategies effectively alleviates the decision bias problem of downstream classifiers caused by imbalance between and within sample classes. Taking into account that the effectiveness of the substation line loss calculation model is affected by actual working conditions, the performance of the substation under the line loss calculation model is predicted based on the classification model, and the line loss calculation model is adjusted and optimized in a targeted manner based on the prediction results, thereby avoiding the process of repeatedly building a simulation environment and generating corresponding simulation data, and effectively reducing the application cost of the line loss calculation model.
[0108] According to the performance data collected from 500 substations under the line loss calculation model, the specific performance distribution is as follows: Figure 4 shown.
[0109] In the process of classifying the performance of different areas under the line loss calculation model, a "one-to-many" classification framework is adopted. The main process is as follows:
[0110] (1) Extract samples of each category in the data set as the minority class, and the union of samples of the remaining categories as the majority class. Divide the classification problem of a data set containing N categories into N binary classification problems.
[0111] (2) Train a classifier for each binary classification problem, pass the test set samples through each classifier, and obtain the probability that they belong to the minority class in the classifier. The classifier number with the highest probability of the minority class among all classifiers is its final prediction result.
[0112] In order to verify the improvement effect of the proposed invention over the existing algorithms in multi-classification, typical sampling methods and generation methods are selected, including SMOTE (Chawla NV, Bowyer KW, Hall LO, et al. SMOTE: synthetic minority over-sampling technique [J]. Journal of artificial intelligence research, 2002, 16: 321-357.), Borderline-SMOTE (Han H, Wang WY, Mao BH. Borderline-SMOTE: a new over-sampling method in imbalanced data sets learning [C] / / International conference on intelligent computing. Springer, Berlin, Heidelberg, 2005: 878-887.), LDAS (Yan Y, Jiang Y, Zheng Z, et al. LDAS: Local density-based adaptive sampling for imbalanced data classification [J]. Expert Systems with Applications, 2022,191:116213.), MPP-SMOTE(Wei Z, Zhang L, ZhaoL.Minority-prediction-probability-based oversampling technique for imbalanced learning[J]. Information Sciences, 2023,622:1273-1295.), VAE-GAN(Larsen AB L, SK, Larochelle H, et al. Autoencoding beyond pixels using a learned similarity metric [C] / / International conference on machine learning. PMLR, 2016: 1558-1566.), CTGAN (Xu L, Skoularidou M, Cuesta-Infante A, et al. Modeling tabular data using conditional gan [J]. Advances in neural information processing systems, 2019, 32.) and SSG (Ahsan MM, Ali MS, Siddique Z. Enhancing and improving the performance of imbalanced class data using novel GBO and SSG: A comparative analysis [J]. Neural Networks, 2024, 173: 106157.) algorithms, a total of 7 algorithms. Among them, the implementation of the sampling method is from the imbalanced learning library smote_variants, and the implementation of the generation method is consistent with the original paper. At the same time, the method of taking the average of ten five-fold cross validation is adopted to reduce the randomness of the experimental results. In order to evaluate the effects of different methods on balancing data sets, Random Forest (RF) was used to classify the balanced data sets. The implementation of the classifier is based on the Scikit-Learn library in Python, and the parameters are all default parameters. During the evaluation process, the results of the evaluation using the F1-measure indicator and G-mean are shown in Tables 3 and 4, where the bold data in each row represents the best experimental results under the data set. The bottom row of the table lists the macro mean of the performance indicators of each method under all data sets, reflecting the overall performance of different methods under all categories.
[0113] Table 3
[0114]
[0115] Table 4
[0116]
[0117] According to the comparative experimental results on the performance data sets of the online loss calculation model in different substations, it can be seen that the proposed invention ranks first in both comprehensive indicators and can effectively alleviate the decision deviation phenomenon of the downstream basic classifier. The proposed invention generates samples based on the diffusion model and replaces the traditional UNet denoising network with a fully connected neural network that is more suitable for learning tabular data features. The model has a stronger ability to learn sample distribution, and the generated samples can cover multiple distribution modes of the original minority class, effectively alleviating the inter-class imbalance of samples of different categories. At the same time, the adaptive sample selection strategy is used to screen out the generated samples that have made significant contributions to alleviating the intra-class imbalance of the minority class and improving the classification performance, effectively alleviating the intra-class imbalance of the minority class, and avoiding the phenomenon that the classifier ignores the classification accuracy of the sparse area of the minority class due to the intra-class imbalance of the minority class, thereby achieving better classification results on the downstream classifier.
[0118] Embodiment 2:
[0119] The present invention also proposes a transformer area line loss calculation model evaluation system 200, such as Figure 5 As shown, including:
[0120] A data acquisition unit 201 is used to acquire performance data of a target substation line loss calculation model under different substations, generate a performance data set, and divide the performance data set into multiple binary classification data sets;
[0121] The sample generation unit 202 is used to generate minority class samples through a preset diffusion model, and screen out the generated samples that significantly contribute to alleviating the intra-class imbalance of minority class samples and improving the overall classification accuracy of minority class samples from the multi-modal samples through a sample selection strategy;
[0122] The evaluation unit 203 is used to fit the generated samples and the binary classification data set through a preset classification model, predict the performance of the target substation line loss calculation model in the target substation based on the fitting results, generate prediction results, and evaluate the target substation line loss calculation model based on the prediction results.
[0123] Among them, the performance data set includes characteristic variables of different stations and corresponding performance labels.
[0124] Among them, the characteristic variables include: district topology, power supply area, number of users, power load, substation type and power factor.
[0125] Among them, performance labels include 5 categories.
[0126] The performance data set is divided into multiple binary classification data sets, including:
[0127] The performance data set is classified according to the performance labels, and the samples under each category are used as the minority sample set, and the samples under the remaining categories are used as the majority sample set, so as to convert the performance data set into multiple binary classification data sets.
[0128] Among them, the number of second-category data sets is the same as the number of performance labels.
[0129] Among them, the preset diffusion model is established by using a multi-layer perceptron to replace the UNet model in the original diffusion model, and the multi-layer perceptron is used as a denoising model in the reverse calculation process of the original diffusion model.
[0130] Among them, the minority class samples are generated through the preset diffusion model, including:
[0131] The two-category data set is denoised and de-noised by a preset diffusion model, and during the denoising and de-noising process, the correlation between the samples in each part of the two-category data set and the dynamic change law of the samples in each part of the two-category data set with the denoising and de-noising are determined. Through the correlation and dynamic change law, the characteristics and detail points of the samples in each part of the two-category data set at different scales are captured, and based on the characteristics and detail points at different scales, the minority class samples of the two-category data set are generated.
[0132] Among the minority class samples, the generated samples that have made significant contributions to alleviating the intra-class imbalance of the minority class and improving the overall classification accuracy of the minority class are screened out, including:
[0133] Determine the changes in neighbor density and classification probability of the original minority class samples in the two-class data set before and after the diffusion model samples are generated, calculate the density weight and probability weight of the minority class samples in the two-class data set, and determine the weight difference between the density weight and probability weight of the minority class samples in the two-class data set. Based on the weight difference, screen out the generated samples in the multimodal samples that have a significant contribution to alleviating the intra-class imbalance of the minority class and to the overall classification accuracy of the minority class.
[0134] The present invention avoids the problem of unbalanced sample data by classifying the performance data set. Therefore, when the classified data set is used for performance prediction, the prediction result has high accuracy. Therefore, the model parameters can be effectively adjusted according to the prediction result, avoiding repeated model building.
[0135] Embodiment 3:
[0136] Based on the same inventive concept, the present invention also provides a computer device, which includes a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions in the computer storage medium to implement the corresponding method flow or corresponding functions, so as to implement the steps of the method in the above embodiment.
[0137] Embodiment 4:
[0138] Based on the same inventive concept, the present invention also provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both a built-in storage medium in a computer device and an extended storage medium supported by the computer device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by a processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the steps of the method in the above embodiment.
[0139] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The schemes in the embodiments of the present invention may be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.
[0140] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0141] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0142] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0143] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0144] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for evaluating a line loss calculation model in an area, characterized in that: include: Acquire performance data of a target substation line loss calculation model under different substations, generate a performance data set, and divide the performance data set into a plurality of binary classification data sets; Generate minority class samples through a preset diffusion model, and use sample selection strategies to screen out generated samples that significantly contribute to alleviating the intra-class imbalance of minority class samples and improving the overall classification accuracy of minority class samples from multimodal samples; The generated samples and the binary classification data set are fitted by a preset classification model, and based on the fitting results, the performance of the target substation line loss calculation model in the target substation is predicted to generate a prediction result, and based on the prediction result, the target substation line loss calculation model is evaluated.
2. The method according to claim 1, characterized in that The performance data set includes characteristic variables of different stations and corresponding performance labels.
3. The method according to claim 2, characterized in that The characteristic variables include: district topology, power supply area, number of users, power load, substation type and power factor.
4. The method according to claim 2, characterized in that The performance label includes 5 categories.
5. The method according to claim 1, characterized in that: The step of dividing the performance data set into a plurality of binary classification data sets includes: The performance data set is classified according to the performance labels, and the samples under each category are used as the minority sample set, and the samples under the remaining categories are used as the majority sample set, so as to convert the performance data set into multiple binary classification data sets.
6. According to the method of claim 5, the number of the two types of data sets is the same as the number of performance labels.
7. The method according to claim 1, characterized in that The preset diffusion model is established by using a multi-layer perceptron to replace the UNet model in the original diffusion model, and the multi-layer perceptron is used as a denoising model in the reverse calculation process of the original diffusion model.
8. The method according to claim 1, characterized in that: The generating of minority class samples by using a preset diffusion model includes: The two-category data set is denoised and de-noised by a preset diffusion model, and during the denoising and de-noising process, the correlation between the samples in each part of the two-category data set and the dynamic change law of the samples in each part of the two-category data set with the denoising and de-noising are determined. Through the correlation and dynamic change law, the characteristics and detail points of the samples in each part of the two-category data set at different scales are captured, and based on the characteristics and detail points at different scales, the minority class samples of the two-category data set are generated.
9. The method according to claim 1, characterized in that: Among the minority class samples, the generated samples that significantly contribute to alleviating the intra-class imbalance of the minority class and to the overall classification accuracy of the minority class are screened out, including: Determine the changes in neighbor density and classification probability of the original minority class samples in the two-class data set before and after the diffusion model samples are generated, calculate the density weight and probability weight of the minority class samples in the two-class data set, and determine the weight difference between the density weight and probability weight of the minority class samples in the two-class data set. Based on the weight difference, screen out the generated samples in the multimodal samples that have a significant contribution to alleviating the intra-class imbalance of the minority class and to the overall classification accuracy of the minority class.
10. A substation line loss calculation model evaluation system, characterized in that: include: A data acquisition unit, used to acquire performance data of a target substation line loss calculation model under different substations, generate a performance data set, and divide the performance data set into a plurality of binary classification data sets; A sample generation unit is used to generate minority class samples through a preset diffusion model, and to screen out generated samples that have significant contributions to alleviating the intra-class imbalance of minority class samples and improving the overall classification accuracy of minority class samples from multi-modal samples through a sample selection strategy; An evaluation unit is used to fit the generated samples and the binary classification data set through a preset classification model, predict the performance of the target substation line loss calculation model in the target substation based on the fitting results, generate a prediction result, and evaluate the target substation line loss calculation model based on the prediction result.
11. The system according to claim 10, characterized in that The performance data set includes characteristic variables of different stations and corresponding performance labels.
12. The system according to claim 11, characterized in that The characteristic variables include: district topology, power supply area, number of users, power load, substation type and power factor.
13. The system according to claim 11, characterized in that The performance label includes 5 categories.
14. The system according to claim 10, characterized in that The step of dividing the performance data set into a plurality of binary classification data sets includes: The performance data set is classified according to the performance labels, and the samples under each category are used as the minority sample set, and the samples under the remaining categories are used as the majority sample set, so as to convert the performance data set into multiple binary classification data sets.
15. The system according to claim 14, wherein the number of the two-category data sets is the same as the number of performance labels.
16. The system according to claim 10, characterized in that The preset diffusion model is established by using a multi-layer perceptron to replace the UNet model in the original diffusion model, and the multi-layer perceptron is used as a denoising model in the reverse calculation process of the original diffusion model.
17. The system according to claim 10, characterized in that The generating of minority class samples by using a preset diffusion model includes: The two-category data set is denoised and de-noised by a preset diffusion model, and during the denoising and de-noising process, the correlation between the samples in each part of the two-category data set and the dynamic change law of the samples in each part of the two-category data set with the denoising and de-noising are determined. Through the correlation and dynamic change law, the characteristics and detail points of the samples in each part of the two-category data set at different scales are captured, and based on the characteristics and detail points at different scales, the minority class samples of the two-category data set are generated.
18. The system according to claim 10, characterized in that Among the minority class samples, the generated samples that significantly contribute to alleviating the intra-class imbalance of the minority class and to the overall classification accuracy of the minority class are screened out, including: Determine the changes in neighbor density and classification probability of the original minority class samples in the two-class data set before and after the diffusion model samples are generated, calculate the density weight and probability weight of the minority class samples in the two-class data set, and determine the weight difference between the density weight and probability weight of the minority class samples in the two-class data set. Based on the weight difference, screen out the generated samples in the multimodal samples that have a significant contribution to alleviating the intra-class imbalance of the minority class and to the overall classification accuracy of the minority class.
19. A computer device, characterized in that: include: one or more processors; a processor for executing one or more programs; When the one or more programs are executed by the one or more processors, the method according to any one of claims 1 to 9 is implemented.
20. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Model security assessment method based on de-noising diffusion model
CN116644439A
Method and system for evaluating electric energy meter evaluation calibration model based on category migration
CN117216654A
Continuous casting billet quality prediction method and system based on diffusion model data enhancement
CN118469374A
Method, apparatus, device and storage medium for training model
EP3923160A1
Driving chip, driving circuit, display device, and data communication method
WO2024193173A1