Method for generating fault sample of hydroelectric generating set protection device and related equipment
Patent Information
- Application Number
- CN202610856493.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-15
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2046-06-15
AI Technical Summary
该方案强调跨域/跨子域对齐思想,对振动信号等数据形态具有一定适配性,但其技术路线更多聚焦在域变换与双向生成的数据形态迁移:一方面,其数据处理以振动片段转二维结构为例,偏向信号域特征映射;另一方面,其训练稳定性主要依赖W-GP与最小二乘损失的组合,并未围绕保护装置故障诊断的业务需求建立与诊断目标强耦合的生成质量约束与训练过程控制策略,因此在直接迁移到保护装置多源统计特征的故障样本生成任务时,仍可能面临生成样本看起来分布相似但诊断贡献不足、以及训练过程中对少数类、关键模式覆盖不稳的问题
(1)本发明提出的一种水电机组保护装置故障样本生成方法,通过对历史运行数据开展删除异常、填补缺失及归一化处理的针对性预处理流程,有效剔除无效干扰数据、补充缺失信息并统一数据量纲,从源头提升了模型训练输入数据的质量,避免了劣质数据对模型训练效果的负面影响,为后续生成对抗网络模型的稳定训练奠定了可靠的数据基础。
Smart Images

Figure CN122412964B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of fault diagnosis technology for hydropower unit protection devices, and particularly relates to a method for generating fault samples of hydropower unit protection devices and related equipment. Background Technology
[0002] As hydropower accounts for an increasingly larger share of the energy mix, the accuracy and reliability of fault diagnosis for hydropower unit protection devices, as core equipment ensuring the safe and stable operation of the units, are becoming increasingly critical. The training effect of fault diagnosis models heavily relies on high-quality, diverse fault sample data. However, hydropower unit protection devices operate in complex environments with low fault occurrence probabilities, diverse fault types, and uneven distribution characteristics. This results in a scarcity of fault samples and the absence of samples for some fault types in the actual historical operating data collected, making it difficult to meet the training requirements of the diagnostic model. Existing technologies often generate fault samples that lack diversity, have low relevance to real fault characteristics, and are prone to gradient loss of control or pattern forgetting during the training process, failing to provide effective sample support for fault diagnosis.
[0003] To address the issues of insufficient samples and imbalanced data, several data augmentation schemes based on generative adversarial networks (GANs) have been developed. For example, patent CN117370874A proposes a GAN training approach that combines WGAN concepts with differentiable data augmentation. It provides the basic training process for GANs and further introduces Wasserstein distance and its dual form to improve training stability. Simultaneously, it applies differentiable augmentation transformations to both real and generated samples to enhance training robustness and generation performance. However, these schemes are primarily geared towards general data augmentation or task-specific data expansion. They typically rely on adversarial training of random noise, generator, and discriminator, and may not be able to establish fault distribution / association constraints for the operational semantics and fault triggering mechanisms of multi-source operational statistics, such as those in hydropower unit protection devices. Their characterization of the consistency between generated samples and real fault evolution patterns is weak, and they rely heavily on general constraints of WGAN-like losses for training stability control, lacking adaptive shutdown or quality gating mechanisms for fault diagnosis indicators.
[0004] For example, the existing patent CN118013272A discloses a data-driven distribution network fault data augmentation method based on WGAN-GP. Its core includes: collecting and supplementing missing operating condition data, filtering and classifying fault data according to warnings / labels, performing linear normalization processing on data of different fault categories, and building a WGAN-GP model to generate fault data that is highly similar to the original distribution, so as to alleviate the problem of scarce distribution network fault samples and imbalanced datasets. This scheme is relatively complete in the process of missing data supplementation, label filtering, normalization and WGAN-GP generation, but its data objects and fault mechanisms mainly revolve around distribution network operating conditions / power outage scenarios, and the generation target focuses on statistical distribution similarity. For the generation of fault samples of hydropower unit protection devices, the faults of protection devices often exhibit characteristics such as multi-dimensional feature coupling, blurred boundaries between categories, and extreme scarcity of minority classes. Relying solely on general gradient penalty and distribution approximation may still result in problems such as the averaging of minority class features and insufficient coverage of key alarm / maloperation patterns by generated samples, which in turn affects the fault diagnosis model's ability to identify minority classes and critical faults.
[0005] For example, the existing patent CN118897987A proposes a fault diagnosis method for unbalanced datasets of hydropower units generated by adaptive domain transformation. By constructing source and target domains, establishing forward and reverse generators and corresponding domain distinctions, it achieves bidirectional transformation and subdomain alignment from source domain samples to target domain samples. It also constructs a combined objective of Wasserstein-GP loss and least squares loss to improve cross-domain generation and training stability. This scheme emphasizes cross-domain / cross-subdomain alignment and has some adaptability to data forms such as vibration signals. However, its technical approach focuses more on the data form transfer of domain transformation and bidirectional generation: on the one hand, its data processing, taking the transformation of vibration segments into two-dimensional structures as an example, is biased towards signal domain feature mapping; on the other hand, its training stability mainly relies on the combination of W-GP and least squares loss, without establishing generation quality constraints and training process control strategies strongly coupled with the diagnostic objectives to meet the business needs of fault diagnosis of protection devices. Therefore, when directly transferred to the fault sample generation task of multi-source statistical features of protection devices, it may still face problems such as generated samples appearing similar in distribution but insufficient diagnostic contribution, and unstable coverage of minority classes and key patterns during training.
[0006] Therefore, how to improve the diversity of fault sample data of hydropower unit protection devices, while ensuring the consistency between the samples and the actual fault characteristics, and providing high-quality support for fault diagnosis models, has become an urgent technical problem to be solved. Summary of the Invention
[0007] The embodiments of this application provide a method for generating fault samples of hydropower unit protection devices, a computer program product, a computer-readable storage medium, and an electronic device, which can improve the diversity of fault sample data of hydropower unit protection devices to a certain extent.
[0008] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part from practice of this application.
[0009] According to a first aspect of the embodiments of this application, a method for generating fault samples of a hydropower unit protection device is provided. The method includes: extracting historical fault data from historical operating data of the hydropower unit protection device, and performing data preprocessing on the historical fault data, wherein the historical operating data includes device operating time, number of real-time analog quantity anomalies, number of various protection maloperations, number of equipment alarms, and device communication rate; the data preprocessing includes deleting abnormal data, filling in missing data, and normalizing the data; obtaining a pre-constructed generative adversarial network (GAN) model framework, wherein the GAN model framework integrates a dynamic adaptive gradient penalty mechanism, historical fault distribution constraints, and an F1 stability index adaptive early shutdown strategy; training the GAN model framework based on the historical fault data to obtain a GAN model; and generating fault sample data of the hydropower unit protection device through the GAN model.
[0010] In some embodiments of this application, based on the foregoing scheme, the generative adversarial network model framework includes a generator, a discriminator, and an auxiliary classifier; the generator is used to receive random noise and fault-related condition labels as input, learn the distribution pattern of the historical fault data, and generate fault sample data with features similar to the historical fault data; the discriminator is used to receive the historical fault data or the fault sample data, and output the probability that the received data belongs to real fault data, and to coordinate with the auxiliary classifier to output the probability of the fault category to which the received data belongs; the auxiliary classifier is used to identify the fault category of the received data, and output the probability of the corresponding fault category, so as to provide category constraints for the generator to generate fault sample data of the corresponding fault category.
[0011] In some embodiments of this application, based on the foregoing scheme, the dynamic adaptive gradient penalty mechanism includes: adjusting the gradient penalty intensity through adaptive dynamic penalty parameters; wherein, the gradient penalty intensity is calculated using linear interpolation samples between the historical fault data and the fault sample data, the Euclidean norm of the gradient of the discriminator on the linear interpolation samples, and a target gradient norm, and the target gradient norm is set to 1; the adaptive dynamic penalty parameters are determined based on the average gradient norm during the training process of the generative adversarial network model framework, the target gradient norm, and preset weight coefficients, and the adaptive dynamic penalty parameters are within a preset upper and lower limit range, and the value of the preset weight coefficients is between 0 and 1.
[0012] In some embodiments of this application, based on the aforementioned scheme, the historical fault distribution constraint includes: aligning the distribution of the fault sample data with the distribution of the historical fault data using KL divergence; wherein the KL divergence is calculated based on the feature covariance matrix, feature mean vector, and feature dimension of the historical fault data and the fault sample data; the loss function of the generator includes adversarial loss, classification loss, and a historical fault distribution constraint term, the weight of the historical distribution constraint term is adjusted by a preset first weight parameter, the weight of the classification loss is adjusted by a preset second weight parameter, and the historical distribution constraint term is constructed based on the KL divergence.
[0013] In some embodiments of this application, based on the foregoing scheme, the F1 stability index adaptive early stopping strategy includes: fusing the classification F1 metric of the fault sample data with the model loss fluctuation during the training process of the generative adversarial network model framework through a stability index; wherein, the stability index fuses the classification F1 metric with the model loss fluctuation through an exponential function, and the fluctuation weight coefficient of the exponential function is used to control the degree of influence of the model loss fluctuation on the stability index; the model loss fluctuation is determined by the maximum value of the difference between the mean loss of the generator and the mean loss of the discriminator in the first preset training round; when the stability index is greater than a set threshold for a second consecutive preset round, the training of the generative adversarial network model framework is terminated.
[0014] In some embodiments of this application, based on the foregoing scheme, both the generator and discriminator in the generative adversarial network (GAN) model framework adopt a fully connected layer network structure; the output layer of the generator adopts the Sigmoid activation function, and the hidden layer adopts the ReLU activation function; the multi-classification output layer of the discriminator adopts the Softmax activation function, the true / false output layer adopts the Sigmoid activation function, and the hidden layer adopts the ReLU activation function; training the GAN model framework to obtain the GAN model includes: initializing the network parameters of the generator and the discriminator, and establishing a mapping relationship between random noise and the historical fault data through the generator. The generator generates fake samples; these fake samples and the historical fault data are input into the discriminator, which then performs a true / false judgment and a category judgment on the fake samples and the historical fault data, and updates the network parameters of the discriminator through backpropagation to complete one round of training; during the training process, after the discriminator updates its network parameters every third preset round, the generator updates its network parameters once to alternately train the generator and the discriminator, and determines the training termination time based on the adaptive early stopping strategy of the F1 stability index. Training is terminated when the stability index is greater than a set threshold for the second consecutive preset round, thus obtaining the generative adversarial network model.
[0015] In some embodiments of this application, based on the foregoing scheme, the method further includes: using the fault sample data generated by the generative adversarial network model to expand the original imbalanced sample dataset constructed based on the historical fault data to obtain a balanced sample dataset; and inputting the balanced sample dataset into the auxiliary classifier in the generative adversarial network model for fault diagnosis to verify the performance of the generative adversarial network model.
[0016] In some embodiments of this application, based on the aforementioned scheme, after generating fault sample data of the hydropower unit protection device through the generative adversarial network model, the method further includes: constructing a weighted comprehensive evaluation system based on the confusion matrix, combining classification loss, classification accuracy, false negative rate, false positive rate, and F1 stability index (FSI), wherein the weights of each indicator in the evaluation system are preset based on the actual needs of fault diagnosis of the hydropower unit protection device, and the weights of each indicator are independent of each other and satisfy normalization constraints, wherein the weights of false negative rate and false positive rate are higher than those of other indicators; and performing performance evaluation on the fault sample data through the evaluation system.
[0017] According to a second aspect of the embodiments of this application, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium and adapted to be read and executed by a processor to cause a computer device having the processor to perform operations as described in the first aspect above.
[0018] According to a third aspect of the embodiments of this application, a computer-readable storage medium is provided, the computer-readable storage medium storing at least one computer program instruction, the at least one computer program instruction being loaded and executed by a processor to perform the operation as described in the first aspect above.
[0019] According to a fourth aspect of the present application, an electronic device is provided, the electronic device including one or more processors and one or more memories, the one or more memories storing at least one computer program instruction, the at least one computer program instruction being loaded and executed by the one or more processors to perform the operation as described in the first aspect above.
[0020] Based on the technical solution proposed in this application, firstly, by extracting historical fault data from historical operational data and performing targeted preprocessing, invalid data can be removed, missing information supplemented, and data format unified, providing high-quality input data for model training and avoiding interference from inferior data on training results. Secondly, the pre-constructed generative adversarial network model framework integrating three core strategies provides a solid structural foundation for the high-quality generation of fault samples, and is more targeted and superior than traditional model frameworks. Thirdly, training the model and generating fault samples based on preprocessed historical fault data can effectively solve the problems of scarce and unevenly distributed fault samples in existing technologies. The generated sample data can ensure diversity, covering multiple fault types, and closely match the characteristics of real faults, providing effective sample support for the training of fault diagnosis models for hydropower unit protection devices, thereby improving the diagnostic accuracy and reliability of fault diagnosis models and ensuring the safe and stable operation of hydropower unit protection devices.
[0021] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application.
[0022] Compared with the prior art, the present invention, employing the above technical solution, has the following beneficial effects: (1) The present invention proposes a method for generating fault samples of hydropower unit protection device. Through a targeted preprocessing process of deleting anomalies, filling missing information and normalizing historical operating data, it effectively eliminates invalid interference data, supplements missing information and unifies data dimensions, thereby improving the quality of model training input data from the source, avoiding the negative impact of poor data on model training effect, and laying a reliable data foundation for the stable training of subsequent generative adversarial network models.
[0023] (2) This invention constructs an improved generative adversarial network model framework that integrates a dynamic adaptive gradient penalty mechanism, historical fault distribution constraints and an adaptive early stopping strategy based on the F1 stability index. It specifically solves the problems of gradient runaway, pattern collapse and blind iteration that are prone to occur in the training process of traditional generative adversarial networks, significantly improves the stability and controllability of the model training process, and ensures the efficiency and quality of fault sample generation.
[0024] (3) By introducing historical fault distribution constraints based on KL divergence, the present invention makes the distribution of generated fault sample data accurately aligned with the distribution of real historical fault data. While ensuring sample diversity, it closely matches the characteristic distribution and evolution law of real faults of hydropower unit protection devices, effectively alleviating the pain points of scarce fault samples, uneven distribution of categories and missing samples of some rare fault types in the industry.
[0025] (4) This invention uses the generated fault samples to expand the original imbalanced dataset and constructs a weighted comprehensive evaluation system that integrates classification loss, accuracy, false negative rate, false positive rate and F1 stability index. Under the premise of focusing on false negative and false positive indicators, the effectiveness of the samples is fully verified. This provides high-quality and balanced training samples for the fault diagnosis model and significantly improves the accuracy and robustness of fault diagnosis. The modular architecture design also makes the solution have good engineering implementation and scalability. Attached Figure Description
[0026] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings: Figure 1 A flowchart illustrating the method for generating fault samples of hydropower unit protection devices in embodiments of this application is shown; Figure 2 A detailed flowchart of the method for generating fault samples of hydropower unit protection devices in embodiments of this application is shown; Figure 3 This application illustrates the technical framework of the method for generating fault samples of hydropower unit protection devices in its embodiments. Figure 4 A schematic diagram of the structure of the electronic device in an embodiment of this application is shown; Figure 5 The convergence plot of the loss function of the improved ACGAN-GP training generator in the embodiments of this application is shown. Figure 6The convergence plot of the loss function of the improved ACGAN-GP discriminator in the embodiments of this application is shown; Figure 7 A comparison diagram of the distribution of real and generated samples in an embodiment of this application is shown. Detailed Implementation
[0027] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0028] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.
[0029] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices. It should also be noted that, for the sake of simplicity, certain components in the drawings that do not affect the interpretation of the technical solution of this application have been appropriately omitted.
[0030] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined. Therefore, the actual execution order may change depending on the actual situation.
[0031] In the description of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "multiple" means two or more.
[0032] This application proposes a scheme for generating fault samples for hydropower unit protection devices. The aim is to overcome the shortcomings of existing fault sample generation technologies, such as insufficient diversity, low relevance to real fault characteristics, and unstable training. By optimizing the generative adversarial network (GAN) model framework, high-quality, diverse fault sample data that closely matches real fault characteristics is generated, providing effective support for training the fault diagnosis model of hydropower unit protection devices and improving the accuracy and reliability of fault diagnosis.
[0033] The implementation details of the technical solutions in the embodiments of this application are described below: Reference Figure 1 The flowchart illustrates a method for generating fault samples of a hydropower unit protection device in an embodiment of this application. This method can be executed by a device with computational processing capabilities.
[0034] Reference Figure 1 As shown, the method for generating fault samples of the hydropower unit protection device includes at least steps 110 to 140, which are described in detail below: In step 110, historical fault data is extracted from the historical operating data of the hydropower unit protection device, and the historical fault data is preprocessed. The historical operating data includes device operating time, number of real-time analog quantity anomalies, number of various protection malfunctions, number of equipment alarms, and device communication rate. The data preprocessing includes deleting abnormal data, filling in missing data, and normalizing the data.
[0035] In this application, historical operating data refers to various monitoring data accumulated by the hydropower unit protection device during long-term operation. This data can directly reflect the operating status and fault conditions of the protection device. Among these, device operating time can be the cumulative operating time of the protection device from its commissioning to the current moment. For example, a protection device for a hydropower unit has been in operation since January 2020, and has accumulated 8760 hours of operation as of the time of data collection. The number of real-time analog quantity anomalies refers to the number of times key analog quantity parameters such as voltage and current exceed the normal range. For example, if the voltage parameter has experienced 12 abnormal fluctuations and the current parameter has experienced 8 abnormal fluctuations in the past month, then the total number of real-time analog quantity anomalies during this period is 20. The number of various protection maloperations refers to the number of times the protection device erroneously triggers protection actions when there is no fault. For example, if the overcurrent protection maloperates 3 times and the overvoltage protection maloperates 2 times, the total number of various protection maloperations is 5 times. The number of equipment alarms is the number of times the protection device issues alarm signals after detecting abnormal conditions. Assuming that the protection device alarms 4 times due to communication abnormalities and 6 times due to parameter abnormalities during a certain period, the number of equipment alarms is 10 times. The device communication rate refers to the proportion of successful communication between the device and the control system. For example, if the protection device attempts to communicate 1000 times during a certain period and successfully communicates 950 times, then the device communication rate is 95%.
[0036] In this application, when extracting historical fault data from the historical operating data, it is necessary to filter out data records that are associated with the occurrence of the fault. For example, when a device experiences a communication failure, the corresponding device communication rate data, device alarm count data, etc., are all historical fault data. Data preprocessing aims to improve data quality and ensure the accuracy of subsequent model training. This includes removing outlier data that doesn't conform to physical logic or reasonable ranges, such as data with a device communication rate exceeding 120% (out of the 0-100% range) or negative real-time simulation anomalies. These obviously erroneous data can interfere with model learning and must be removed. Filling in missing data addresses missing values caused by equipment malfunctions or transmission interruptions during data acquisition. For example, if device runtime data for a particular day is missing, it can be filled using the average runtime of the device over several adjacent days, or runtime data of similar devices under the same operating conditions. Data normalization maps feature data of different magnitudes to the [0,1] interval. For instance, device runtime might range from 0 to 10,000 hours, and device communication rate from 0% to 100%. Through normalization, 8760 hours of runtime is converted to 0.876, and 95% communication rate is converted to 0.95. This avoids model training bias due to differences in feature magnitudes and improves training efficiency.
[0037] Continue to refer to Figure 1 In step 120, a pre-constructed generative adversarial network model framework is obtained, which integrates a dynamic adaptive gradient penalty mechanism, historical fault distribution constraints, and an adaptive early stopping strategy based on the F1 stability index.
[0038] In this application, the Generative Adversarial Network (AGCAN-GP) framework may include a generator, a discriminator, and an auxiliary classifier, which work together to generate and optimize fault samples.
[0039] In this application, the generator can be used to receive random noise and fault-related condition labels as input, learn the distribution pattern of the historical fault data, and generate fault sample data similar to the characteristics of the historical fault data. Specifically, the generator, as the core component of sample generation, receives random noise and fault-related condition labels as input. The random noise is a set of meaningless random data used to provide randomness for sample generation and ensure the diversity of the generated samples. For example, it can be a set of random vectors with a dimension of 100, where each element takes a value between 0 and 1. The fault-related condition labels are used to specify the type of fault sample to be generated. For example, communication faults are labeled as [1,0,0], protection malfunction faults are labeled as [0,1,0], and analog quantity anomaly faults are labeled as [0,0,1]. After receiving these inputs, the generator learns the distribution pattern of the historical fault data to generate fault sample data similar to the characteristics of the actual fault. For example, when random noise and label [1,0,0] (communication fault) are input, the generator will generate sample data that conforms to the characteristics of communication faults, such as low communication rate and a high number of device alarms.
[0040] In this application, the discriminator is used to receive the historical fault data or the fault sample data, and output the probability that the received data belongs to real fault data, as well as to coordinate with the auxiliary classifier to output the probability of the fault category to which the received data belongs. Specifically, the main function of the discriminator is to distinguish the authenticity of input data and assist in judging the fault category. The input data it receives can be either preprocessed historical fault data (real data) or fault sample data generated by the generator (fake data). The discriminator analyzes the features of these data and outputs the probability that the data belongs to real fault data. For example, for a certain input data, the discriminator outputs a probability of 0.3 that it is real data, indicating that the data is more likely to be fake data generated by the generator. At the same time, the discriminator will also coordinate with the auxiliary classifier to output the probability of the fault category to which the data belongs. For example, the probability that the data belongs to a communication fault is 0.8, the probability that it belongs to a protection malfunction fault is 0.1, and the probability that it belongs to an analog quantity abnormality fault is 0.1.
[0041] In this application, the auxiliary classifier is used to identify the fault category of the received data and output the probability of the corresponding fault category, thereby providing category constraints for the generator to generate fault sample data of the corresponding fault category. Specifically, the core function of the auxiliary classifier is to identify the fault category of the input data, providing category constraints for the generator and ensuring that the generator can generate fault samples of a specific type. For example, when a historical fault data is input, the auxiliary classifier analyzes its features and outputs that the probability of the data belonging to a communication fault is 0.95, and the probability of belonging to other fault types is extremely low. This result is fed back to the generator, allowing the generator to use the features of the real data as a reference when generating communication fault samples, ensuring that the generated samples conform to the category features of communication faults. When fault sample data generated by the generator is input, the auxiliary classifier will determine the probability of its fault category. If the probability of the sample being judged as a communication fault is low, it means that the generated sample does not meet the expected category features. The generator will adjust its parameters based on this feedback to optimize the generation of subsequent samples.
[0042] Based on the above scheme, the collaborative design of the generator, discriminator, and auxiliary classifier enables the generative adversarial network (GAN) model framework to possess comprehensive capabilities in targeted generation, authenticity identification, and class constraint. The generator, by receiving random noise and conditional labels, can generate diverse sample data that meets the requirements of specific fault types, solving the problem of insufficient diversity in traditional sample generation. The discriminator's output on data authenticity and class probability provides clear feedback direction for generator optimization, prompting the generator to continuously improve the authenticity of generated samples. The class constraints provided by the auxiliary classifier ensure that the generated samples accurately match the features of the target fault type, avoiding class confusion. The combined effect of these three components significantly improves the quality and effectiveness of generated fault sample data, providing more targeted sample support for the training of subsequent fault diagnosis models and further ensuring the accuracy of fault diagnosis.
[0043] In this application, the pre-built generative adversarial network model framework is the core carrier for generating fault samples. Its integrated dynamic adaptive gradient penalty mechanism can be used to solve the gradient runaway problem in the model training process. The historical fault distribution constraint can be used to ensure that the generated samples fit the historical fault characteristics. The F1 stability index adaptive early stopping strategy can be used to optimize the training process and avoid blind iteration.
[0044] In this application, the dynamic adaptive gradient penalty mechanism may include: adjusting the gradient penalty intensity by adaptive dynamic penalty parameters.
[0045] In this application, the gradient penalty intensity can be calculated using the linear interpolation sample between the historical fault data and the fault sample data, the Euclidean norm of the gradient of the discriminator on the linear interpolation sample, and the target gradient norm, wherein the target gradient norm is set to 1.
[0046] It should be noted that in this application, the dynamic adaptive gradient penalty mechanism is designed to address the gradient runaway problem that easily occurs during the training of traditional generative adversarial networks. By dynamically adjusting the gradient penalty strength, the stability of model training is ensured. The gradient penalty strength is a key parameter for implementing this mechanism, and its calculation depends on the linear interpolation sample between historical fault data and fault sample data, the Euclidean norm of the gradient of the discriminator on the linear interpolation sample, and the target gradient norm. Linear interpolation samples are transitional data between historical fault data (real data) and fault sample data (fake data). For example, if a communication rate of 0.9 (real data) is selected from a set of historical fault data, and the communication rate of 0.3 (fake data) is selected from the fault sample data generated by the generator, then the linear interpolation samples between the two can be complete data samples corresponding to a series of transitional values such as 0.4, 0.5, and 0.6. The gradient Euclidean norm of the discriminator for this linear interpolation sample is an indicator of the discriminator's sensitivity to changes in the features of this interpolation sample. For example, if the gradient Euclidean norm of a certain linear interpolation sample is calculated to be 1.5, the target gradient norm is set to 1 as an ideal reference standard for gradient changes. The gradient penalty intensity is calculated based on these parameters using a specific formula. For example, when the gradient Euclidean norm of the linear interpolation sample is 1.5 and the target gradient norm is 1, the difference between the two will be calculated and converted into the corresponding gradient penalty intensity.
[0047] In this application, the adaptive dynamic penalty parameter can be determined based on the average gradient norm during the training process of the generative adversarial network model framework, the target gradient norm, and the preset weight coefficient. The adaptive dynamic penalty parameter is within a preset upper and lower limit range, and the value of the preset weight coefficient is between 0 and 1.
[0048] It should be noted that in this application, the adaptive dynamic penalty parameter is used to adjust the magnitude of the gradient penalty. Its value is not fixed but dynamically determined based on the actual situation during model training. This parameter is calculated based on the average gradient norm, target gradient norm, and preset weight coefficients during the training of the generative adversarial network model framework. The average gradient norm is the average value of the Euclidean norm of the gradients of all data samples in a certain training epoch. For example, in the 10th training epoch, the average gradient norm of all data samples is calculated to be 1.2. The preset weight coefficients are between 0 and 1, for example, set to 0.5. The target gradient norm is 1. The specific value of the adaptive dynamic penalty parameter can then be calculated using the formula. Furthermore, to avoid the parameter being too large or too small and affecting the training effect, preset upper and lower limits are set. For example, the upper limit is set to 0.8 and the lower limit to 0.2. When the calculated adaptive dynamic penalty parameter is 0.9, it will be adjusted to 0.8; if the calculated result is 0.1, it will be adjusted to 0.2.
[0049] To enable the art to better understand the dynamic adaptive gradient penalty mechanism, the penalty gradient term is given below. Please refer to formulas (1) to (4) for details: (1) (2) (3) (4) in, For the first The adaptive dynamic penalty parameter for the next iteration This is a linear interpolation sample between historical fault data and fault sample data. For linear interpolation samples The probability distribution, Let be the mathematical expectation operator, representing the expectation of... Expectation calculation, For discriminator, For the discriminator pair gradient, It is an L2 norm; For the first The average gradient norm of the nth iteration, For the first Linear interpolation samples, The number of samples used to calculate the average gradient norm; This represents the target gradient norm and is set to 1. This indicates a preset weighting coefficient with a value between 0 and 1. For the first The adaptive dynamic penalty parameter for the next iteration.
[0050] Based on the above scheme, adjusting the gradient penalty strength through adaptive dynamic penalty parameters is more adaptable to dynamic changes during model training compared to the traditional method of fixing gradient penalty coefficients. The introduction of linear interpolation samples makes the gradient penalty more targeted, accurately capturing the feature transition between real and generated data. By determining the adaptive dynamic penalty parameters through the average gradient norm, the target gradient norm, and preset weight coefficients, and imposing upper and lower limits on these parameters, the gradient penalty strength is ensured to be neither too large (leading to gradient vanishing) nor too small (failing to suppress gradient explosion), effectively solving the gradient runaway problem during model training and improving the stability of model training. A stable training process allows the generator to more consistently learn the distribution patterns and characteristics of historical fault data, thereby generating fault sample data that better matches real fault characteristics and has stronger consistency. This provides high-quality sample support for the fault diagnosis model, further improving the reliability of fault diagnosis.
[0051] In this application, the historical fault distribution constraint may include: aligning the distribution of the fault sample data with the distribution of the historical fault data using KL divergence, where KL divergence is the Kullback-Leibler divergence.
[0052] In this application, the KL divergence is calculated based on the feature covariance matrix, feature mean vector, and feature dimension of the historical fault data and the fault sample data.
[0053] It should be noted that, in this application, the core purpose of the historical fault distribution constraint is to ensure that the distribution of the generated fault sample data is consistent with the distribution of historical fault data, preventing the generator from forgetting historical fault features during training and causing the generated samples to become disconnected from the real fault patterns. This constraint is achieved through KL divergence (KL divergence). KL divergence is an indicator that measures the difference between two probability distributions. Its calculation depends on the feature covariance matrix, feature mean vector, and feature dimension of the historical fault data and fault sample data. The feature covariance matrix reflects the correlation between different features. For example, the covariance matrix between device operating time and the number of equipment alarms in historical fault data can reflect the degree of correlation between the two. The feature mean vector is the average value of each type of feature. For example, it is a vector composed of the mean of device communication rate and the mean of the number of real-time analog quantity anomalies in historical fault data. The feature dimension is the number of fault-related features selected. For example, if five types of features are selected, namely device operating time, number of real-time analog quantity anomalies, number of various protection malfunctions, number of equipment alarms, and device communication rate, then the feature dimension is 5. By substituting these parameters into a specific formula, the KL divergence value, which measures the difference between the distribution of historical fault data and the distribution of fault sample data, can be obtained. For example, if the calculated KL divergence value is 0.3, it indicates that there is a certain difference between the two distributions, and the generator needs to be further optimized.
[0054] In this application, the loss function of the generator includes adversarial loss, classification loss and historical fault distribution constraint term. The weight of the historical distribution constraint term is adjusted by a preset first weight parameter, the weight of the classification loss is adjusted by a preset second weight parameter, and the historical distribution constraint term is constructed based on the KL divergence.
[0055] It should be noted that in this application, the generator's loss function is crucial for guiding the adjustment of generator parameters, and it comprises three parts: adversarial loss, classification loss, and historical distribution constraint term. The adversarial loss can further include generation loss and discriminant loss, which measures the ability of the generator to identify samples as real data by the discriminator. For example, when the probability of the generated samples being identified as real data by the discriminator is low, the adversarial loss value is larger, prompting the generator to adjust its parameters to improve the realism of the samples.
[0056] In this application, the classification loss is used to measure the degree to which the generated sample conforms to the target fault category. For example, when the probability of the generated communication fault sample being identified as a communication fault by the auxiliary classifier is low, the classification loss value is large, which drives the generator to optimize the category features of the sample.
[0057] In this application, the historical distribution constraint term is constructed based on KL divergence. When the KL divergence value is large, the value of the historical distribution constraint term is also large, indicating that the distribution of the generated samples differs significantly from the distribution of historical fault data. The generator needs to adjust its parameters to reduce this difference. A preset first weight parameter is used to adjust the importance of the historical distribution constraint term, for example, set to 0.4. A preset second weight parameter is used to adjust the importance of the classification loss, for example, set to 0.3. By adjusting these weight parameters, the influence of each part of the loss function can be balanced, ensuring that the generator coordinates and optimizes in three aspects: improving sample realism, fitting class features, and maintaining distribution consistency.
[0058] To enable the art to better understand generation loss, discriminant loss, classification loss, and KL divergence, equations (5) to (8) are given below for explanation:
[0059] in, Real historical fault data Distribution; For random noise Distribution; Fault type condition label; Let be the mathematical expectation operator, representing the distribution of real historical fault data. Expectation calculation; Let be the mathematical expectation operator, representing the distribution of fault sample data generated by the generator. Expectation calculation; Let be the mathematical expectation operator, representing the distribution of random noise. Expectation calculation; For the discriminator to process the input data Fault type condition label The output result; For the generator to handle input random noise The output result is generated fault sample data that has similar characteristics to historical fault data. This indicates that the generator is based on random noise. Generated fault sample data Together with fault type condition labels After being input into the discriminator, the discriminator outputs the probability that the sample is real data.
[0060] in, Distribution of historical fault data Distribution of generated fault sample data KL divergence; and They are respectively and The characteristic covariance matrix; and They are respectively and The feature mean vector; For feature dimensions; For matrix trace operations; For matrix determinant operations; subscript Represents historical fault data, subscript Indicates the generation of fault sample data, subscript Indicates the corresponding fault type The data set; and These are the weight parameters for the classification loss and the historical distribution constraint term, respectively, and their values range from 0 to 1; Indicates the distribution of generated data Distribution of historical data KL divergence; Let be the mathematical expectation operator, representing the fault type label corresponding to real historical fault data. Expectation calculation; Let be the mathematical expectation operator, representing the fault type label corresponding to the generated fault sample. Expected calculation.
[0061] Based on the above scheme, historical fault distribution constraints are implemented using KL divergence, which accurately measures the distribution difference between generated fault sample data and historical fault data. This provides a clear basis for generator optimization, effectively avoiding the problem of the generator forgetting historical fault features during training. It ensures that the generated fault sample data is both diverse and closely matches the distribution patterns and characteristic features of historical fault data, solving the problem of disconnect between samples generated by traditional models and real fault data. The generator loss function integrates adversarial loss, classification loss, and historical distribution constraint terms, and adjusts the influence of each component through preset weight parameters. This allows the generator to simultaneously consider the authenticity of samples, class accuracy, and distribution consistency during training, comprehensively improving the quality of generated samples. High-quality fault sample data provides more comprehensive and realistic training material for fault diagnosis models, significantly enhancing the generalization ability of the diagnostic models, improving the accuracy and stability of fault diagnosis, and providing more reliable protection for the safe operation of hydropower unit protection devices.
[0062] In this application, the F1 stability index adaptive early stopping strategy includes: fusing the classification F1 metric of the fault sample data with the model loss fluctuation during the training process of the generative adversarial network model framework through a stability index; wherein, the stability index fuses the classification F1 metric with the model loss fluctuation through an exponential function, and the fluctuation weight coefficient of the exponential function is used to control the degree of influence of the model loss fluctuation on the stability index; the model loss fluctuation is determined by the maximum value of the difference between the mean loss of the generator and the mean loss of the discriminator in the first preset training round; when the stability index is greater than a set threshold for a second consecutive preset round, the training of the generative adversarial network model framework is terminated.
[0063] It should be noted that in this application, the F1 stability index adaptive early stopping strategy is used to optimize the model training process and avoid the waste of computing power or overfitting caused by blind iteration. Its core is to comprehensively evaluate the sample quality and training stability through the stability index, and then decide whether to terminate the training. The stability index is a composite index that integrates the classification F1 metric of fault sample data and the fluctuation of model loss. The classification F1 metric is an index that combines precision and recall, and is used to measure the ability of the generated fault samples to be accurately identified by a classifier that takes precision into account. For example, in a batch of generated communication fault samples, if the precision is 0.85 and the recall is 0.9, then the classification F1 metric value is 2×(0.85×0.9) / (0.85+0.9)≈0.87.
[0064] In this application, model loss fluctuation is used to measure the stability of the training process. It is determined by the maximum difference between the mean loss of the generator and the mean loss of the discriminator in the first preset training round. Assuming the first preset round is set to 8 rounds, the mean loss of the generator in the first 4 rounds is 0.6, the mean loss of the generator in the last 4 rounds is 0.4, and the mean loss difference is 0.2. The mean loss of the discriminator in the first 4 rounds is 0.5, the mean loss of the discriminator in the last 4 rounds is 0.3, and the mean loss difference is 0.2. Then the model loss fluctuation is 0.2.
[0065] In this application, the stability index is achieved by fusing the classification F1 score and model loss fluctuation through an exponential function. The fluctuation weight coefficient of the exponential function is used to control the influence of model loss fluctuation on the stability index. For example, setting the fluctuation weight coefficient to 0.3, when the classification F1 score is 0.87 and the model loss fluctuation is 0.2, the specific value of the stability index is calculated by substituting these values into the exponential function. A threshold is set to determine whether the training has reached a stable state, for example, set to 0.8. The second preset number of rounds is set to 3. When the stability index is greater than 0.8 for 3 consecutive rounds, it indicates that the quality of the generated samples has reached a high level and the training process is stable. At this point, the training of the generative adversarial network model framework is terminated to avoid wasting computational resources and overfitting due to continued iteration. If the stability index is not greater than the set threshold for 3 consecutive rounds, training continues until the condition is met.
[0066] To enable those skilled in the art to better understand this application, formulas (9) to (12) are given below for explanation: (9) (10) (11) (12) in, Evaluation indicators calculated using the classification results; This is the fluctuation weighting coefficient, and its value is between 0 and 1. ; For generator loss fluctuation, For discriminator loss fluctuation; among which, Indicates the training round index; Indicates the first Wheel generator loss; Indicates the first The wheel's discriminator is lost.
[0067] Based on the above scheme, the F1 stability index adaptive early stopping strategy constructs a stability index by integrating the classification F1 metric and model loss fluctuation. This comprehensively evaluates the quality of generated samples and the stability of model training, making it more scientific and reasonable compared to the traditional method of terminating training based on a fixed number of iterations. The fluctuation weight coefficient allows the impact of model loss fluctuation on the stability index to be adjusted according to actual needs, ensuring that the evaluation results better align with the training objectives. Calculating model loss fluctuation through the first preset round accurately captures fluctuations during training, avoiding misjudgments of training stability due to short-term fluctuations. Training is terminated when the stability index exceeds a set threshold for a second consecutive preset round. This ensures high quality and consistency of the generated fault sample data, avoids wasted computational power due to blind iteration, effectively prevents overfitting, improves the efficiency and reliability of model training, and provides a guarantee for quickly obtaining high-quality fault sample data.
[0068] Continue to refer to Figure 1 In step 130, the generative adversarial network model framework is trained based on the historical fault data to obtain the generative adversarial network model.
[0069] In this application, the model framework is trained based on processed historical fault data. This involves teaching the model to learn the distribution patterns and characteristic characteristics of the historical fault data, such as the numerical range and trends of various monitoring data under different fault types. Once the model training reaches a stable state, a generative adversarial network model capable of generating high-quality fault samples can be obtained. In this application, both the generator and discriminator in the generative adversarial network model framework can adopt a fully connected layer network structure; the output layer of the generator can adopt the Sigmoid activation function, and the hidden layer can adopt the ReLU activation function; the multi-class output layer of the discriminator can adopt the Softmax activation function, the true / false output layer can adopt the Sigmoid activation function, and the hidden layer can adopt the ReLU activation function.
[0070] In this application, both the generator and discriminator in the generative adversarial network model framework adopt a fully connected layer network structure. A fully connected layer means that the neurons in each layer of the network are completely connected to all neurons in the next layer. This structure can fully extract the feature information in the data. For example, the fully connected layer of the generator can be set to three layers: the first layer is the input layer, which receives random noise and conditional labels; the second layer is the hidden layer; and the third layer is the output layer, which outputs the generated fault sample data. The fully connected layer of the discriminator can also be set to three layers: the first layer is the input layer, which receives historical fault data or fake sample data; the second layer is the hidden layer; and the third layer is the output layer, which outputs the true / false probability and the class probability.
[0071] In this application, the generator's output layer uses the Sigmoid activation function, which maps output values to the [0,1] interval, consistent with the format of normalized historical fault data, ensuring that the generated fault sample data is within a reasonable range. For example, the device communication rate data output by the generator, after processing with the Sigmoid activation function, takes values between 0 and 1. The hidden layer uses the ReLU activation function, which effectively solves the gradient vanishing problem and improves the model's training efficiency and feature extraction capability. For example, in the generator's hidden layer, the ReLU activation function allows neurons to quickly respond to effective features and ignore invalid features. Similarly, using the ReLU activation function in the discriminator's hidden layer can improve the discriminator's feature recognition capability.
[0072] The multi-class output layer of the discriminator uses the Softmax activation function, which converts the output into a probability distribution to output the probabilities of different fault categories. For example, the probability of outputting a communication fault is 0.7, the probability of a protection malfunction is 0.2, and the probability of an analog signal anomaly is 0.1. The true / false output layer uses the Sigmoid activation function, outputting the probability that the data is a true fault, with a value between 0 and 1. For example, the probability of outputting a certain data as a true fault is 0.6.
[0073] In this application, training the generative adversarial network model framework to obtain the generative adversarial network model can be performed according to the following steps 131 to 133: Step 131: Initialize the network parameters of the generator and the discriminator, and establish a mapping relationship between random noise and historical fault data through the generator to generate false samples.
[0074] Step 132: Input the fake samples and the historical fault data into the discriminator, and the discriminator performs authenticity and category discrimination on the fake samples and the historical fault data, and updates the network parameters of the discriminator through backpropagation to complete one round of training.
[0075] Step 133: During the training process, after the discriminator updates the network parameters every third preset round, the generator updates the network parameters once to train the generator and the discriminator alternately until the generator and the discriminator reach Nash equilibrium, at which point the training is terminated, and the generative adversarial network model is obtained.
[0076] In this application, the model training process follows specific steps. First, the network parameters of the generator and discriminator are initialized. These parameters include weights and biases, and the initial values can be set using a random normal distribution. For example, the initial weights of neurons in each layer of the generator are randomly distributed between [-0.05, 0.05], and the initial biases are set to 0. Then, the generator receives random noise and learns to establish a mapping relationship with historical fault data, generating false samples. For instance, after learning features such as low communication rates and frequent alarms in historical fault data, the generator generates corresponding false sample data. The generated false samples and historical fault data are input into the discriminator. The discriminator performs real / false and category discrimination on these data. For example, the discriminator determines that the probability of a false sample being real data is 0.3, and the probability of it belonging to a communication fault is 0.8. The discrimination results are fed back to the discriminator through backpropagation to update its network parameters, completing one round of training.
[0077] In this application, the third preset round can be set according to actual training needs, such as 5 rounds. During the training process, the network parameters of the discriminator are updated every 5 times, and then the network parameters of the generator are updated once. Through this alternating training method, the generator and the discriminator compete with each other and optimize together until they reach a Nash equilibrium state, that is, the fake samples generated by the generator can be indistinguishable from the real ones, and the discriminator cannot accurately distinguish between real and fake data. At this time, the training is terminated, and the trained generative adversarial network model is obtained.
[0078] like Figure 5 and Figure 6 As shown, Figure 5 This paper illustrates how the generator loss function of the improved ACGAN-GP model in this embodiment changes with the training epochs during training. Figure 6 The diagram illustrates the variation of the discriminator loss function of the improved ACGAN-GP model in this embodiment during training epochs. It can be seen that in the early stages of training, both the generator loss and the discriminator loss exhibit fluctuations to a certain extent. This is due to the continuous parameter adjustments made by the generator and discriminator during adversarial training. As the number of training epochs increases, the amplitude of these fluctuations gradually decreases and stabilizes, indicating that the model gradually enters a relatively stable convergence state in the later stages of training.
[0079] in, Figure 5 This indicates that the generator's ability to fit the distribution of historical fault data gradually increases during the training process, and its loss value gradually stabilizes after fluctuating in the early stage, reflecting that the distribution difference between the generated samples and the real historical fault samples gradually decreases. Figure 6 This indicates that the discriminator's process of distinguishing between real and generated samples gradually stabilizes, and it can continuously provide effective discriminative feedback to the generator during training. Figure 5 and Figure 6 As can be seen, the improved ACGAN-GP model in this application embodiment shows a good convergence trend and training stability during the training phase, providing a model foundation for the subsequent generation of fault sample data.
[0080] Based on the above scheme, the generator and discriminator adopt a fully connected layer network structure, which can fully mine the feature information in the data and provide a solid structural foundation for sample generation, authenticity, and category discrimination. The reasonable combination of different activation functions enables the generator to output sample data that meets the format requirements, while effectively solving the gradient vanishing problem and improving training efficiency. The discriminator can accurately output the authenticity probability and category probability distribution, enhancing the discrimination ability. During the model training process, the steps of initializing network parameters, generating fault sample data, discriminator discrimination and parameter update, and alternating training of the generator and discriminator can ensure the orderliness and effectiveness of the training process. The setting of the third preset round makes the update rhythm of the generator and discriminator reasonable, avoiding over-optimization of one side leading to training imbalance, and combining the F1 Stability Index (FSI) adaptive early stopping strategy to determine the timing of training termination. After the training reaches a stable convergence state, the generated fault sample data has high authenticity and category accuracy, which can provide high-quality training samples for the fault diagnosis model, significantly improve the performance of the fault diagnosis model, and ensure the accuracy and reliability of fault diagnosis of hydropower unit protection devices. The FSI is the F1 Stability Index.
[0081] In this application, steps 134 to 135 may further be performed: Step 134: Using the fault sample data generated by the generative adversarial network model, the original imbalanced sample dataset constructed based on the historical fault data is expanded to obtain a balanced sample dataset.
[0082] Step 135: Input the balanced sample dataset into the auxiliary classifier in the generative adversarial network model for fault diagnosis, so as to verify the performance of the generative adversarial network model.
[0083] In this application, the original imbalanced sample dataset constructed based on historical fault data refers to a dataset where the distribution of fault samples across different fault types is uneven due to the significant differences in the probability of occurrence of different fault types in the hydropower unit's protection devices. For example, the dataset might contain 1000 communication fault samples, 200 protection maloperation fault samples, and only 50 analog quantity anomaly fault samples. This imbalanced dataset can lead to bias in the training of the fault diagnosis model, resulting in low accuracy in identifying fault types with fewer samples. Fault sample data generated using a generative adversarial network (GAN) model can specifically supplement the fault types with fewer samples. For example, 950 samples can be generated for analog quantity anomaly faults, and 800 samples for protection maloperation faults. These generated samples are then merged with the samples in the original imbalanced sample dataset to obtain a balanced sample dataset, where the number of fault samples for each type reaches approximately 1000, resulting in a more balanced distribution.
[0084] In this application, a balanced sample dataset is input into an auxiliary classifier within a generative adversarial network (GAN) model for fault diagnosis. The auxiliary classifier identifies the fault category for each sample in the dataset and outputs the corresponding category probability. For example, for a sample with a simulated abnormal fault, the auxiliary classifier outputs a probability of 0.92 for belonging to a simulated abnormal fault, with lower probabilities for other fault types. By statistically analyzing the auxiliary classifier's recognition accuracy, precision, and recall for all samples, the quality of the fault sample data generated by the GAN model can be verified, thereby evaluating the model's performance. If the recognition accuracy reaches over 90%, it indicates high sample quality and good model performance; if the accuracy is low, the reasons need to be analyzed and the model further optimized.
[0085] Based on the above scheme, expanding the original imbalanced sample dataset with the generated fault sample data effectively solves the problem of imbalanced dataset distribution. The resulting balanced sample dataset provides more comprehensive and balanced material for training the fault diagnosis model, avoiding bias caused by sample imbalance and improving the model's ability to identify various fault types. Inputting the balanced sample dataset into an auxiliary classifier for fault diagnosis to verify model performance allows for a direct evaluation of the quality of samples generated by the generative adversarial network (GAN) model and the overall performance of the model, providing clear feedback for model optimization. This process not only ensures the high validity and reliability of the generated fault sample data but also continuously optimizes the GAN model, making its generated samples more closely aligned with fault diagnosis needs. This provides stronger support for fault diagnosis of hydropower unit protection devices, further improving the accuracy and comprehensiveness of fault diagnosis.
[0086] Continue to refer to Figure 1In step 140, fault sample data of the hydropower unit protection device is generated through the generative adversarial network model.
[0087] In this application, the required fault sample data of hydropower unit protection devices can be generated through the model. These sample data can simulate the characteristics of different fault types, thereby providing rich material for training the fault diagnosis model.
[0088] In this application, after generating fault sample data of the hydropower unit protection device through the generative adversarial network model, the following steps 151 to 152 can also be performed: Step 151: Based on the confusion matrix, a weighted comprehensive evaluation system is constructed by combining classification loss, classification accuracy, false negative rate, false positive rate and F1 stability index (FSI). The weights of each indicator in the evaluation system are preset based on the actual needs of fault diagnosis of hydropower unit protection devices, and the weights of each indicator are independent of each other and meet the normalization constraints. The weights of false negative rate and false positive rate are higher than those of other indicators.
[0089] Step 152: The performance of the fault sample data is evaluated using the evaluation system.
[0090] In this application, the confusion matrix is an important tool for evaluating the performance of classification models. It clearly shows the model's classification results for various types of samples, including four cases: true positives, true negatives, false positives, and false negatives. For example, for communication failure samples, true positives represent the number of samples that are truly experiencing a communication failure and are correctly identified as such by the auxiliary classifier; true negatives represent the number of samples that are truly not experiencing a communication failure and are correctly identified as such; false positives represent the number of samples that are truly not experiencing a communication failure but are misclassified as such; and false negatives represent the number of samples that are truly experiencing a communication failure but are misclassified as such. Based on the confusion matrix, key indicators such as precision and recall can be calculated, providing basic data for sample performance evaluation.
[0091] In this application, classification loss is an indicator that measures the difference between the model's classification result and the true label. For example, when the classifier's classification result for a batch of fault samples is small in difference from the true fault type, the classification loss value is small. Classification accuracy refers to the proportion of samples correctly classified by the classifier to the total number of samples. For example, if 920 out of 1000 samples are correctly classified, the classification accuracy is 92%. The F1 stability index (FSI), as mentioned above, is an indicator that combines the classification F1 metric and model loss fluctuation, used to measure sample quality and the stability of the model training process. Combining these indicators to construct an evaluation system can comprehensively evaluate the performance of fault sample data from multiple dimensions. For example, the evaluation system can set the weights of classification accuracy (0.4), precision (0.2), recall (0.2), classification loss (0.1), and stability index (0.1), and obtain a comprehensive evaluation score through weighted calculation.
[0092] In this application, the performance of the generated fault sample data is evaluated using this evaluation system. For example, if a batch of generated fault sample data has a comprehensive evaluation score of 85 points (out of 100), it indicates that the batch of samples has good performance and can meet the training requirements of the fault diagnosis model. If the comprehensive evaluation score is 60 points, it indicates that the sample performance is poor and the reasons need to be analyzed and the model generation parameters optimized.
[0093] like Figure 7 As shown, Figure 7 This illustrates a comparison of the distribution of real historical fault samples and generated fault samples in the feature space in embodiments of this application. Figure 7 It can be seen that the distribution of real samples and generated samples across the three types of faults shows a good correspondence. Specifically, communication fault samples are mainly distributed in the left region of the feature space, while protection malfunction samples and analog quantity anomaly samples are mainly distributed in the right region, indicating that different fault categories exhibit a certain degree of discriminability under the selected features. Correspondingly, the spatial locations of various generated fault samples are basically consistent with the main clustering areas of their corresponding real fault samples, indicating that the generative adversarial network model in this embodiment can learn the distribution characteristics of different fault categories well.
[0094] Furthermore, the local clustering of samples across different categories reveals that the generated fault samples not only closely resemble the overall distribution trend of real historical fault samples, but also maintain a good match with real samples in dense sample areas, distribution range, and some edge regions. Particularly when there is some overlap between protection malfunction samples and analog quantity anomaly samples in the right-hand region, the generated samples still fall well into the main distribution range of the corresponding real samples, indicating that the generated fault samples retain, to a certain extent, the statistical distribution characteristics of real historical fault data. This further demonstrates that the fault sample data generated in this embodiment can effectively supplement the original historical fault samples, providing more sufficient sample support for subsequent fault diagnosis model training.
[0095] To enable those skilled in the art to better understand this application, formulas (13) to (16) are given below for explanation: (13) (14) (15) (16) In the above formula, TP, TN, FN, and FP represent the probabilities of a true positive, a true negative, a false positive, and a false negative, respectively.
[0096] Among them, precision rate Precision is an indicator of accuracy; a high precision indicates that the classification model has a high reliability in identifying a certain type of fault. Recall, on the other hand, is an indicator of accuracy. Precision is an indicator of completeness; high recall indicates that the classification model misses fewer cases of a particular type of fault. In summary, the model evaluation metric for imbalanced data samples should simultaneously consider precision, recall, and the classifier's classification performance. Therefore, classification accuracy was chosen. , To evaluate the overall performance of the fault sample generation model.
[0097] Based on the above scheme, the evaluation system constructed by combining the confusion matrix with classification loss, classification accuracy, and stability indicators can comprehensively and multidimensionally evaluate the performance of the generated fault sample data. Compared with the traditional evaluation method that only relies on classification accuracy, it can better reflect the practicality and reliability of the samples in actual fault diagnosis. The confusion matrix provides detailed classification result data, which supports the accurate calculation of key indicators such as precision and recall. The classification loss reflects the accuracy of sample classification, the classification accuracy reflects the overall classification effect of the samples, and the stability indicator ensures the consistency of sample quality. By evaluating the performance of fault sample data through this evaluation system, problems with the samples can be identified in a timely manner, providing a clear basis for model optimization and adjustment of sample generation parameters. This ensures that the generated fault sample data has high quality and effectiveness, provides high-quality training material for the fault diagnosis model of hydropower unit protection devices, and ultimately improves the accuracy and reliability of fault diagnosis, ensuring the safe and stable operation of hydropower units.
[0098] To enable those skilled in the art to better understand this application, the following will be provided. Figure 2 and Figure 3 This is to help explain the technical solution proposed in this application.
[0099] For details, please refer to Figure 2 and Figure 3 .in, Figure 2 A detailed flowchart of the method for generating fault samples of hydropower unit protection devices in embodiments of this application is shown; Figure 3 This application illustrates the technical framework of the method for generating fault samples of hydropower unit protection devices in an embodiment of this application.
[0100] Overall, based on the technical solution proposed in this application, by extracting historical fault data from historical operational data and performing targeted preprocessing, invalid data can be removed, missing information supplemented, and data format standardized, providing high-quality input data for model training and avoiding interference from inferior data on training results. The pre-constructed generative adversarial network model framework integrating three core strategies provides a solid structural foundation for high-quality generation of fault samples, exhibiting greater targeting and superiority compared to traditional model frameworks. Training the model and generating fault samples based on preprocessed historical fault data effectively solves the problems of scarce and unevenly distributed fault samples in existing technologies. The generated sample data ensures diversity, covering multiple fault types, and closely matches real fault characteristics, providing effective sample support for training the fault diagnosis model of hydropower unit protection devices, thereby improving the diagnostic accuracy and reliability of the fault diagnosis model and ensuring the safe and stable operation of hydropower unit protection devices.
[0101] Based on the same inventive concept, this application provides a computer program product, which includes computer instructions stored in a computer-readable storage medium and adapted to be read and executed by a processor to cause a computer device having the processor to perform the operations performed by the method for generating fault samples of hydropower unit protection devices as described above.
[0102] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium storing at least one computer program instruction, which is loaded and executed by a processor to perform the operations performed by the method for generating fault samples of hydropower unit protection devices as described above.
[0103] Based on the same inventive concept, this application also provides an electronic device, see reference. Figure 4 The diagram shows a schematic of the structure of an electronic device in an embodiment of this application. The electronic device includes one or more memories 404, one or more processors 402, and at least one computer program (computer program instruction) stored in the memory 404 and executable on the processor 402. When the processor 402 executes the computer program, it implements the method for generating fault samples of hydropower unit protection devices as described above.
[0104] Among them, Figure 4 In this document, a bus architecture (represented by bus 400) is used. Bus 400 may include any number of interconnected buses and bridges, linking various circuits including one or more processors represented by processor 402 and memory represented by memory 404. Bus 400 may also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. Bus interface 405 provides an interface between bus 400 and receiver 401 and transmitter 403. Receiver 401 and transmitter 403 may be the same element, i.e., a transceiver, providing a unit for communicating with various other devices over a transmission medium. Processor 402 is responsible for managing bus 400 and general processing, while memory 404 can be used to store data used by processor 402 during operation.
[0105] The functions described herein may be implemented in hardware, software executed by a processor, firmware, or any combination thereof. If implemented in software executed by a processor, the functions may be stored as one or more instructions or codes on or transmitted via a computer-readable medium. Other examples and embodiments are within the scope and spirit of this application and the appended claims. For example, due to the nature of software, the functions described above may be implemented using software executed by a processor, hardware, firmware, hardwired, or any combination thereof. Furthermore, the functional units may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit.
[0106] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0107] The units described as separate components may or may not be physically separate. Similarly, the components of the control device may or may not be physical units; they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0108] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing computer program instructions, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0109] The above description is merely an embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for generating fault samples of hydropower unit protection devices, characterized in that, The method includes: Historical fault data is extracted from the historical operating data of the hydropower unit protection device, and the extracted historical fault data is preprocessed. The historical operating data includes device operating time, number of real-time analog quantity anomalies, number of various protection malfunctions, number of equipment alarms, and device communication rate. The data preprocessing includes deleting abnormal data, filling in missing data, and normalizing the data. Obtain a pre-built generative adversarial network model framework, which is an improved ACGAN-GP framework and integrates a dynamic adaptive gradient penalty mechanism, historical fault distribution constraints, and an adaptive early stopping strategy based on FSI; the ACGAN-GP framework is a generative adversarial network framework with an auxiliary classifier containing a gradient penalty mechanism, and FSI is the F1 stability index. The FSI-based adaptive early termination strategy includes: using the F1 stability index to fuse the comprehensive precision and recall of fault sample data as a composite evaluation index for classification F1 measurement and the model loss fluctuation during the training process of the generative adversarial network model framework; the model loss fluctuation is determined by the maximum value of the absolute difference between the mean difference of generator loss and the absolute difference of the mean difference of discriminator loss in the first half and the second half of the training with an equal number of training rounds in the first preset round; when the F1 stability index is greater than a set threshold for a second consecutive preset round, the training of the generative adversarial network model framework is terminated; Based on historical fault data, a generative adversarial network (GAN) model framework is trained to obtain the GAN model. Fault sample data of hydropower unit protection devices are generated by using a generative adversarial network model.
2. The method for generating fault samples of hydropower unit protection devices according to claim 1, characterized in that, The generative adversarial network model framework includes a generator, a discriminator, and an auxiliary classifier, which work together to achieve the targeted generation of fault samples and the identification of their authenticity and category. The generator is used to receive random noise and fault type conditional labels as input, learn the distribution pattern of historical fault data, and generate fault sample data with similar characteristics to historical fault data. The discriminator is used to receive historical fault data and fault sample data, and outputs the probability that the received data belongs to real fault data. The discriminator also has a true / false output branch. The auxiliary classifier is used for the true / false output branch of the collaborative discriminator. It identifies the fault category from the received historical fault data and fault sample data, outputs the probability of the corresponding fault category, and provides class constraints for the generator to generate samples of the target fault category. The network parameters of the generator are updated based on the backpropagation of the adversarial loss and the classification loss. The classification loss is constructed by the collaborative work of the auxiliary classifier and the discriminator.
3. The method for generating fault samples of hydropower unit protection devices according to claim 2, characterized in that, The dynamic adaptive gradient penalty mechanism includes: The gradient penalty strength is adjusted by an adaptive dynamic penalty parameter, and the target gradient norm is set to 1. The adaptive dynamic penalty parameter is iteratively updated based on the average gradient norm, the target gradient norm, and preset weight coefficients. The preset weight coefficients are between 0 and 1, and the adaptive dynamic penalty parameter is within a preset upper and lower limit range. Between, among and They are respectively The lower and upper limits; The gradient penalty term satisfies: ; The gradient norm mean satisfies: ; The adaptive dynamic penalty parameters satisfy the update relationship: ; in, For the first The adaptive dynamic penalty parameter for the next iteration This is a linear interpolation sample between historical fault data and fault sample data. For linear interpolation samples The probability distribution, Let be the mathematical expectation operator, representing the expectation of... Expectation calculation, For discriminator, For the discriminator pair gradient, It is an L2 norm; For the first The average gradient norm of the nth iteration, For the first Linear interpolation samples, The number of samples used to calculate the average gradient norm; Denotes the target gradient norm. This indicates the preset weighting coefficient. For the first The adaptive dynamic penalty parameter for the next iteration; Furthermore, the generator's loss function satisfies: ; The loss function of the discriminator satisfies: ; in, Real historical fault data Distribution; For random noise Distribution; Fault type condition label; Let be the mathematical expectation operator, representing the distribution of real historical fault data. Expectation calculation; Let be the mathematical expectation operator, representing the distribution of fault sample data generated by the generator. Expectation calculation; Let be the mathematical expectation operator, representing the distribution of random noise. Expectation calculation; For the discriminator to process the input data Fault type condition label The output result; For the generator to handle input random noise The output result is generated fault sample data that has similar characteristics to historical fault data. This indicates that the generator is based on random noise. Generated fault sample data Together with fault type condition labels After being input into the discriminator, the discriminator outputs the probability that the sample is real data.
4. The method for generating fault samples of hydropower unit protection devices according to claim 3, characterized in that, The historical fault distribution constraint includes: aligning the distribution of the fault sample data with the distribution of the historical fault data using KL divergence. The calculation of KL divergence is based on the premise that the historical fault data and fault sample data conform to a multivariate Gaussian distribution. It is calculated based on the feature statistical parameters of the historical fault data and fault sample data. The feature statistical parameters include at least the feature mean vector and the feature covariance matrix. The calculation of KL divergence includes the operation of matrix trace and the parameter of feature dimension. The generator's loss function includes adversarial loss, classification loss, and historical fault distribution constraint term. The weight of the historical fault distribution constraint term is adjusted by a preset first weight parameter, and the weight of the classification loss is adjusted by a preset second weight parameter. The first weight parameter and the second weight parameter are independent of each other and their values are both between 0 and 1. The historical fault distribution constraint term is constructed based on the calculation results of KL divergence. The KL divergence satisfies: ; in, Distribution of historical fault data Distribution of generated fault sample data KL divergence; and They are respectively and The characteristic covariance matrix; and They are respectively and The feature mean vector; For feature dimensions; For matrix trace operations; For matrix determinant operations; subscript Represents historical fault data, subscript Indicates the generation of fault sample data, subscript Indicates the corresponding fault type The data set; Furthermore, the classification loss function corresponding to the auxiliary classifier satisfies: ; in, and These are the weight parameters for the classification loss and the historical distribution constraint term, respectively, and their values range from 0 to 1; Indicates the distribution of generated data Distribution of historical data KL divergence; Let be the mathematical expectation operator, representing the fault type label corresponding to real historical fault data. Expectation calculation; Let be the mathematical expectation operator, representing the fault type label corresponding to the generated fault sample. Expected calculation.
5. The method for generating fault samples of hydropower unit protection devices according to claim 4, characterized in that, In the FSI-based adaptive early stopping strategy, the FSI satisfies: ; in, Evaluation indicators calculated using the classification results; This is the fluctuation weighting coefficient, and its value is between 0 and 1. ; For generator loss fluctuation, For discriminator loss fluctuation; and and They respectively satisfy: ; ; in, Indicates the training round index; Indicates the first Wheel generator loss; Indicates the first The wheel's discriminator is lost.
6. The method for generating fault samples of hydropower unit protection devices according to claim 5, characterized in that, The generator and discriminator in the generative adversarial network (GAN) model framework both employ a fully connected layer network structure of input layer-hidden layer-output layer; the generator's output layer uses the Sigmoid activation function, and the hidden layer uses the ReLU activation function; the discriminator's multi-class output layer uses the Softmax activation function, the true / false output layer uses the Sigmoid activation function, and the hidden layer uses the ReLU activation function; training the GAN model framework to obtain the GAN model includes: Initialize the network parameters of the generator and discriminator, and establish a mapping relationship between random noise and historical fault data through the generator to generate fault sample data; The generated fault sample data and historical fault data are input into the discriminator, which then performs a true / false judgment and a category judgment on the generated fault sample data and historical fault data, and updates the network parameters of the discriminator through backpropagation to complete one round of training. During training, after the discriminator updates the network parameters every third preset round, the generator updates the network parameters once to alternately train the generator and the discriminator, and determines the training termination time according to the FSI-based adaptive early stopping strategy to obtain the generative adversarial network model; the training of the generative adversarial network model framework uses the Adam optimizer to optimize the loss function.
7. The method for generating fault samples of hydropower unit protection devices according to claim 6, characterized in that, The method further includes: Using the fault sample data generated by the generative adversarial network model, the original imbalanced sample dataset, which was constructed based on the historical fault data and had an imbalance in the number of samples of different fault types and some fault type samples were missing, was expanded to obtain a balanced sample dataset with a balanced distribution of the number of samples of various fault types. The balanced sample dataset is input into the auxiliary classifier in the generative adversarial network model for fault diagnosis, and the precision and recall are calculated based on the confusion matrix as diagnostic indicators to verify the performance of the generative adversarial network model.
8. The method for generating fault samples of hydropower unit protection devices according to any one of claims 1 to 7, characterized in that, After generating fault sample data of the hydropower unit protection device through the generative adversarial network model, the method further includes: Based on the confusion matrix, a weighted comprehensive evaluation system is constructed by combining classification loss, classification accuracy, false negative rate, false positive rate and FSI. The weights of each indicator in the evaluation system are preset based on the actual needs of fault diagnosis of hydropower unit protection devices, and the weights of each indicator are independent of each other and meet the normalization constraints. Among them, the weights of false negative rate and false positive rate are higher than those of other indicators. The performance of fault sample data is evaluated using an evaluation system.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one piece of program code, which is loaded and executed by a processor to perform the operations performed by the method as described in any one of claims 1 to 8.
10. An electronic device, characterized in that, The electronic device includes one or more processors and one or more memories, wherein at least one piece of program code is stored in the one or more memories, and the at least one piece of program code is loaded and executed by the one or more processors to implement the method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
DA-WGAN-SVM-based hydroelectric generating set small sample fault diagnosis method
CN117370874A
Silicon carbide crystal growth equipment fault diagnosis method based on bimodal generative adversarial network
CN121009421A
Multi-source partial discharge fault spectrogram detection and separation method, equipment and medium
CN121921617A
