Sample generation method and apparatus, electronic device, and storage medium
By using an initial fault diagnosis model to screen unlabeled sample data and expand labeled sample data in photovoltaic power plants, the problems of insufficient number and distribution differences of labeled samples in photovoltaic fault diagnosis are solved, thereby improving the accuracy and generalization ability of the fault diagnosis model.
Patent Information
- Application Number
- CN202211469478.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-22
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2042-11-22
AI Technical Summary
Existing photovoltaic fault diagnosis methods face problems such as insufficient number of labeled samples and differences in the distribution of labeled and unlabeled datasets in photovoltaic power plants, which leads to a decrease in model accuracy.
By collecting sample operation data of photovoltaic modules, the initial fault diagnosis model is used to detect faults in unlabeled sample data. Based on the prediction results, target unlabeled data is selected, and labeled sample data is expanded to form a high-quality training set, thereby improving the accuracy of the fault diagnosis model.
By expanding the labeled sample data, the data quality of the photovoltaic power station training set was improved, ensuring the accuracy and generalization ability of the fault diagnosis model, overcoming the problems of model overfitting and underfitting, and improving the accuracy of fault diagnosis.
Smart Images

Figure CN115859099B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fault diagnosis technology, and specifically to a sample generation method, apparatus, electronic device, and storage medium. Background Technology
[0002] Environmental pollution, energy shortages, and the growing concern over sustainable development are serious problems. For most countries in the world, fossil fuels consumed by power plants are one of the main causes of carbon emissions. Studies on greenhouse gas emissions (primarily carbon dioxide) show that over 40% of carbon emissions are generated by the combustion of fossil fuels during power generation. As a clean and renewable energy source, solar energy is considered a low-carbon development direction with broad market prospects, and photovoltaic (PV) power generation is one of the main ways to utilize solar energy. PV modules are the core component of a PV system and mostly operate in harsh outdoor conditions. PV systems face many potential common failures during daily operation. Since different types of failures have varying degrees of impact on the power generation efficiency, operational safety, and economic benefits of PV systems, quickly and accurately diagnosing the type of failure after a PV module malfunction is crucial for maintaining the reliability of the PV system, ensuring sustainable power generation, and reducing economic losses during power generation.
[0003] Currently, photovoltaic (PV) power plants only record electrical data monitored by the system during daily operation. This data includes both normal and fault samples. To save on operation and maintenance costs, only a small portion of these samples are labeled by relevant technicians and experts, leaving the vast majority unlabeled. This severely impacts the accuracy of the local model obtained in each round and the final global accuracy of existing federated learning methods. Therefore, if the sample library of a real PV power plant only contains a small number of labeled samples (with the majority being unlabeled data), existing PV fault diagnosis methods will be unable to accurately extract and distinguish the characteristics of different faults, leading to a significant reduction in the accuracy of the final diagnostic model. Summary of the Invention
[0004] This invention provides a sample generation method, apparatus, electronic device, and storage medium to address the problem of limited samples in existing photovoltaic fault diagnosis.
[0005] On one hand, embodiments of the present invention provide a sample generation method, the method comprising:
[0006] Collect sample operation data of at least one photovoltaic module, the sample operation data including tagged sample data and untagged sample data;
[0007] The initial model is trained based on the labeled sample data to obtain the initial fault diagnosis model;
[0008] The unlabeled sample data is input into the initial fault diagnosis model for fault detection, and the prediction results corresponding to the unlabeled sample data are obtained.
[0009] Based on the prediction results corresponding to the unlabeled sample data, the unlabeled sample data is filtered to obtain the target unlabeled data;
[0010] Based on the target unlabeled data and the labeled sample data, a sample training set is obtained.
[0011] On the other hand, embodiments of the present invention provide a sample generation apparatus, the apparatus comprising:
[0012] The acquisition module is used to acquire sample operation data of at least one photovoltaic module, wherein the sample operation data includes tagged sample data with labels and untagged sample data without labels;
[0013] The training module is used to train the initial model based on the labeled sample data to obtain the initial fault diagnosis model;
[0014] The prediction module is used to input the unlabeled sample data into the initial fault diagnosis model for fault detection and obtain the prediction result corresponding to the unlabeled sample data.
[0015] The filtering module is used to filter the unlabeled sample data according to the prediction results corresponding to the unlabeled sample data to obtain the target unlabeled data;
[0016] The sample module is used to obtain a sample training set based on the target unlabeled data and the labeled sample data.
[0017] On the other hand, embodiments of the present invention provide an electronic device, the electronic device comprising:
[0018] At least one processor; and
[0019] A memory communicatively connected to the at least one processor; wherein,
[0020] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the sample generation method.
[0021] On the other hand, embodiments of the present invention provide a storage medium storing a plurality of instructions for causing a computer to execute the sample generation method.
[0022] This invention collects sample operational data from at least one photovoltaic module. The sample operational data includes tagged sample data and untagged sample data. An initial model is trained based on the tagged sample data to obtain an initial fault diagnosis model. The untagged sample data is then input into the initial fault diagnosis model for fault detection, yielding prediction results corresponding to the untagged sample data. Based on the prediction results, the untagged sample data is filtered to obtain target untagged data. A sample training set is obtained based on the target untagged data and the tagged sample data. By combining small-sample techniques, the invention addresses the training set data quality issues faced in the actual operation and maintenance of photovoltaic power plants, significantly improving the training set data quality and enhancing the accuracy of subsequent diagnostic models through sample expansion. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a schematic flowchart of a sample generation method provided in an embodiment of the present invention;
[0025] Figure 2 This is a schematic diagram of the photovoltaic module's operational data acquisition scenario provided in an embodiment of the present invention;
[0026] Figure 3 This is a schematic diagram of the structure of the initial model provided in the embodiment of the present invention;
[0027] Figure 4 This is a flowchart illustrating the method for obtaining a joint diagnostic model based on federated learning, as provided in an embodiment of the present invention.
[0028] Figure 5 This is a schematic diagram of a sample generation device provided in an embodiment of the present invention;
[0029] Figure 6 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0030] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0031] As described in the background section, existing artificial intelligence-based methods in the field of photovoltaic fault diagnosis can be mainly divided into three categories: The first category focuses on improving the accuracy of fault diagnosis based on a series of deep neural network methods under ideal conditions where there are sufficient types and quantities of fault samples; the second category studies fault diagnosis techniques when the number of fault-labeled samples is small or the sample types are limited, mainly based on semi-supervised learning, federated learning and other methods to expand the number of samples or jointly model, thereby making full use of the remaining unlabeled data or improving the generalization ability of the model, thereby improving the fault diagnosis accuracy of the model; the third category focuses on the execution efficiency of the algorithm, based on transfer learning and other methods to reduce the model training cost in the process of building photovoltaic fault diagnosis models, thereby improving modeling efficiency.
[0032] The first and third types of fault diagnosis methods mentioned above establish fault diagnosis models under relatively ideal training data conditions. However, since manually collecting and labeling photovoltaic module fault data requires a significant amount of manpower and resources, it is often difficult for a single photovoltaic power station's operation and maintenance system to establish a complete photovoltaic fault database. Therefore, the second type of fault diagnosis method is more in line with the practical applications of those skilled in the art.
[0033] Existing fault diagnosis methods based on photovoltaics, such as semi-supervised learning and federated learning, only separately address the issues of sample expansion when the initial training sample size is insufficient and model generalization improvement when sample types are limited. However, these methods have significant shortcomings and cannot meet the needs of practical applications. Specifically, existing semi-supervised learning methods ignore the potential problems of limited label sample types and sample imbalance in the initial training set. Limited label sample types mean that the fault database of a photovoltaic power station contains only a small number of fault types. Due to differences in geographical location, the age of system equipment, and weather conditions, a single photovoltaic power station can only collect samples of a subset of fault types. This low-quality data situation limits the types of faults the model can identify, significantly reducing model generalization and accuracy. Imbalanced label samples mean that the number of samples for different fault types varies significantly. In fact, for those skilled in the art, this situation better reflects the actual operation of photovoltaic power stations. Photovoltaic power stations operate normally most of the time, resulting in far more samples in normal states than in fault states. Due to environmental and system-specific factors, the frequency of various common faults varies, leading to significant differences in the number of samples for different fault types. This leads to overfitting of existing models to normal states and underfitting to samples of fault states, thus significantly reducing the accuracy of the models. In addition, existing methods do not consider the distribution differences between labeled and unlabeled datasets. When the distributions of the two datasets differ significantly (or even are opposite), the accuracy of the fault diagnosis models obtained by existing methods will be greatly reduced.
[0034] Based on this, in order to solve the problem of limited samples in existing photovoltaic fault diagnosis, this invention provides a sample generation method to address the issues of insufficient labeled samples in the photovoltaic power plant sample library and significant distribution differences between labeled and unlabeled datasets. This method uses the prediction results corresponding to the unlabeled sample data obtained from the initial fault diagnosis model to expand the labeled sample data with target unlabeled data selected from the unlabeled sample data based on the prediction results. This solves the problem of insufficient labeled samples in the photovoltaic power plant sample library, significantly improves the quality of the training set data of photovoltaic power plants, and thus ensures the accuracy of the fault diagnosis model trained based on the sample training set.
[0035] like Figure 1 As shown, Figure 1 This is a schematic flowchart of a sample generation method provided in an embodiment of the present invention. The sample generation method shown is applied to an electronic device, which is deployed in a photovoltaic power station.
[0036] It should be noted that in this embodiment of the invention, there is at least one photovoltaic power station, and each photovoltaic power station is equipped with electronic equipment. Each electronic device deployed in a photovoltaic power station can obtain the sample training set of that photovoltaic power station according to steps 101-105. For ease of description, in... Figure 1 The sample generation method shown only illustrates the method for generating samples from one photovoltaic power station. It is understandable that when multiple photovoltaic power stations exist, a method can be used for each power station according to the provided method. Figure 1 The illustrated sample generation method yields a sample training set. In some embodiments of the present invention, the electronic device may be a computer, an industrial computer, etc. Specifically, Figure 1 The sample generation method shown includes steps 101 to 105:
[0037] 101. Collect sample operation data for at least one photovoltaic module.
[0038] The sample operation data includes tagged sample data and untagged sample data. The labels represent the true results of the sample operation data, including whether the sample operation data has faults and, if so, the corresponding fault types. Fault types include, but are not limited to, aging, short circuit, open circuit, and obstruction.
[0039] In some embodiments of the present invention, the sample operating data may be historical operating data of the current photovoltaic power station over a past period of time. This historical operating data includes the current-voltage characteristic curve of the photovoltaic modules over a past period of time, along with the corresponding temperature and irradiance. In some embodiments of the present invention, the past period of time is not specifically limited; for example, it may be the past week, the past month, or the past year.
[0040] In some embodiments of the present invention, the electronic equipment deployed in each photovoltaic power station can collect operating data of each photovoltaic module through a current-voltage tester and an environmental tester equipped with Bluetooth communication function, and store the data in the database of the electronic equipment. Accessing the database allows for the acquisition of historical operating data over a past period to obtain sample operating data. For example, as shown... Figure 2 As shown, Figure 2 This is a schematic diagram of the photovoltaic module operation data acquisition scenario provided in the embodiment of the present invention. Each photovoltaic power station includes multiple photovoltaic modules. A current-voltage tester and an environmental tester equipped with Bluetooth communication function are used to collect the current-voltage characteristic curves of the photovoltaic array and the corresponding temperature and irradiance, respectively.
[0041] In some embodiments of the present invention, in the collection of photovoltaic module operation data, in order to solve the operation and maintenance costs, only a portion of the collected operation data is labeled with the true results, while the remaining operation data is unlabeled data. This results in the sample operation data including two types of operation data: labeled sample data with labels and unlabeled sample data without labels.
[0042] 102. The initial model is trained based on the labeled sample data to obtain the initial fault diagnosis model.
[0043] In some embodiments of the present invention, the initial model can be a machine learning model, such as a model based on logistic regression, decision tree, support vector machine, k-nearest neighbor, Naive Bayes, or random forest; the initial model can also be a neural network model, such as a model based on convolutional neural networks (CNN), deconvolutional neural networks (DN), deep neural networks (DNN), deep convolutional inverse graphics networks (DCIGN), region-based convolutional networks (RCNN), fast region-based convolutional networks (Faster RCNN), and models based on bidirectional encoder representations from transformers (BERT); understandably, the initial fault diagnosis model can also be a machine learning model or a neural network model.
[0044] In some embodiments of the present invention, step 102 includes: obtaining an initial model; inputting label sample data into the initial model to obtain the training recognition result corresponding to the label sample data; determining the training loss value based on the training recognition result and the actual result corresponding to the label sample data using a preset loss function; adjusting the model parameters of the initial model according to the training loss value until the initial model meets a preset convergence condition to obtain an initial fault diagnosis model. The preset convergence condition may be that the training loss value is less than or equal to a preset loss threshold, or that the number of training iterations of the initial model is greater than or equal to a preset number of iterations threshold.
[0045] In some embodiments of the present invention, considering that the number of labeled sample data in the sample operation data is relatively small, the generalization ability of the initial fault diagnosis model trained using the labeled sample data is poor, which in turn leads to low accuracy of subsequent photovoltaic module fault diagnosis results. Based on this, after obtaining the initial fault diagnosis model, the embodiments of the present invention use the initial fault diagnosis model to perform fault detection on unlabeled sample data to obtain the prediction results corresponding to the unlabeled sample data. Based on the prediction results corresponding to the unlabeled sample data, sample screening is performed, and labeled sample data is expanded based on the sample screening results. The initial fault diagnosis model is then trained using the expanded labeled sample data, thereby improving the model accuracy and generalization ability of the trained fault diagnosis model.
[0046] 103. Input the unlabeled sample data into the initial fault diagnosis model for fault detection and obtain the prediction results corresponding to the unlabeled sample data.
[0047] The prediction results include whether there are faults in the unlabeled sample data, and if so, the type of fault.
[0048] 104. Based on the prediction results corresponding to the unlabeled sample data, the unlabeled sample data is filtered to obtain the target unlabeled data.
[0049] In some embodiments of the present invention, step 104 includes: selecting first pseudo-label sample data with faults in the unlabel sample data according to the prediction results corresponding to the unlabel sample data, selecting second pseudo-label sample data corresponding to each fault type from the first pseudo-label sample data with faults, and obtaining target unlabeled data according to the second pseudo-label sample data corresponding to each fault type selected from the unlabel sample data.
[0050] In some embodiments of the present invention, the second pseudo-labeled sample data corresponding to each fault type selected from the unlabeled sample data can be set as the target unlabeled data. In some embodiments of the present invention, the second pseudo-labeled sample data corresponding to each fault type selected from a preset number of unlabeled sample data can be set as the target unlabeled data.
[0051] 105. Based on the target unlabeled data and labeled sample data, a sample training set is obtained.
[0052] In some embodiments of the present invention, step 105 includes: setting the target unlabeled data as predicted labeled data, and combining the predicted labeled data and the labeled sample data to obtain a sample training set.
[0053] In some embodiments of the present invention, step 105 includes: setting the target unlabeled data as predicted labeled data; obtaining an initial sample training set based on the set of predicted labeled data and labeled sample data; training an initial fault diagnosis model based on the initial sample training set to obtain a fault diagnosis model; performing fault prediction on the unlabeled sample data based on the fault diagnosis model to obtain a new prediction result corresponding to the unlabeled sample data; obtaining new target unlabeled data according to step 104 based on the new prediction result corresponding to the unlabeled sample data; and obtaining a sample training set based on the set composed of the new target unlabeled data and labeled sample data.
[0054] The sample generation method provided in this invention uses the prediction results corresponding to the unlabeled sample data obtained from the initial fault diagnosis model to expand the labeled sample data with target unlabeled data selected from the unlabeled sample data through the prediction results. This solves the problem of insufficient labeled samples in the photovoltaic power station sample library, greatly improves the quality of the training set data of the photovoltaic power station, and thus ensures the accuracy of the fault diagnosis model trained based on the sample training set.
[0055] In some embodiments of the present invention, it can be carried out according to Figure 2 The data acquisition method shown collects the current-voltage characteristic curves of the photovoltaic power station and the corresponding temperature and irradiance to obtain sample operating data of the photovoltaic modules.
[0056] In some embodiments of the present invention, considering the inconsistencies in data dimensions, missing data in the current-voltage characteristic curves and corresponding temperature and irradiance of the collected photovoltaic power stations, uneven distribution of current and voltage sampling points, and data redundancy, the classified data needs to undergo further data preprocessing before it can be constructed into sample operation data, thereby ensuring the fault identification accuracy of the identification model trained based on the sample training set. Specifically, the method for obtaining sample operation data includes steps a1 to a6:
[0057] Step a1: Obtain the volt-ampere characteristic curve of the photovoltaic power station and the corresponding temperature and irradiance to obtain the initial operating data.
[0058] In some embodiments of the present invention, the current-voltage characteristic curve of the photovoltaic power station and the corresponding temperature and irradiance can be collected at preset time intervals.
[0059] In some embodiments of the present invention, the current-voltage characteristic curves and corresponding temperatures and irradiance of a photovoltaic power station over a historical period can be obtained from the operating database.
[0060] Step a2: Detect missing values based on the initial running data to obtain the degree of missing values; if the degree of missing values is greater than the preset degree threshold, perform data filling, and then execute step a3; if the degree of missing values is less than or equal to the preset degree threshold, then execute step a3.
[0061] In some embodiments of the present invention, missing values can be detected by comparing the current-voltage characteristic curve with a pre-stored benchmark current-voltage characteristic curve.
[0062] In some embodiments of the present invention, data filling can be performed by interpolation; data filling can also be performed by statistically analyzing the mean, median, or mode of the current-voltage characteristic curve. Common data filling methods such as average filling, caloric filling, and K-nearest neighbor mean can also be used.
[0063] Step a3: Resample the current-voltage characteristic curve to obtain a preset number of current-voltage data points.
[0064] In some embodiments of the present invention, the open-circuit voltage Vo and short-circuit current Isc can be recorded based on the volt-ampere characteristic curve. The data is downsampled by resampling 20 voltage VRx points at equal intervals within the range [0, Vo] and 20 current IRx points at equal intervals within the range [0, Isc]. The data is then completed, and the voltage values corresponding to the 20 resampled current IRx points and the current values corresponding to the 20 resampled voltage VRx points are calculated. The resampled volt-ampere characteristic curve is obtained, and the 40 resampled points are arranged in descending order of voltage to obtain a 40*2 array. This 40*2 array is then used as the volt-ampere data points. The volt-ampere data points obtained after resampling contain only 40 sampling points, but can still effectively reflect the fault characteristic information implicit in the curve, while avoiding data redundancy and saving computational costs.
[0065] Step a4: Based on the volt-ampere data points, the temperature and irradiance corresponding to the volt-ampere characteristic curves, the data is reconstructed to obtain the running array.
[0066] In some embodiments of the present invention, since temperature and irradiance have a significant impact on the operating status of photovoltaic modules, it is necessary to further combine these two environmental information when analyzing specific fault types. Therefore, a data reconstruction method is used, inserting the corresponding temperature and irradiance as 40*2 environmental vectors into a 40*2 volt-ampere data pair, reconstructing a 40*4 operating array as sample data for photovoltaic fault diagnosis.
[0067] Step a5: Determine the initial running data containing real recognition results, set the real recognition results as labels, and add the labels to the running array corresponding to the initial running data containing real recognition results.
[0068] Step a6: Based on the running data after adding tags, set the running array with added tags as tagged sample data, and set the running array without added tags as untagged sample data to obtain sample running data.
[0069] In some embodiments of the present invention, after obtaining the sample running data, the label sample data can be input into the initial model for training according to step 102 to obtain the initial fault diagnosis model.
[0070] In some embodiments of the present invention, the label sample data in the sample operation data is a 40*4 two-dimensional array. Considering the limited computing power of actual photovoltaic power plants, complex deep neural networks may not be usable. Therefore, embodiments of the present invention build an initial model based on a convolutional neural network, for example, as shown below. Figure 3 As shown, Figure 3 This is a schematic diagram of the structure of the initial model provided in the embodiment of the present invention. The initial model shown includes a two-dimensional convolutional layer, a dimensionality reduction layer, a one-dimensional convolutional layer, a max pooling layer, a fully connected layer, and a linear classification layer.
[0071] Specifically, the labeled sample data is input into the two-dimensional convolutional layer of the initial model for convolutional operations to perform preliminary feature extraction; the output of the two-dimensional convolutional layer is input into the dimensionality reduction layer for data dimensionality compression; the output of the dimensionality reduction layer is input into the one-dimensional convolutional layer to mine the hidden fault feature information in the data; the output of the one-dimensional convolutional layer is input into the max pooling layer; the output of the max pooling layer is input into the fully connected layer to obtain the probability vector of sample fault type prediction; the output of the fully connected layer is input into the linear classification layer for fault prediction, and the training and recognition results of the labeled sample data are output.
[0072] The one-dimensional convolutional layer includes a first convolutional unit, a second convolutional unit, a first pooling unit, a third convolutional unit, a second pooling unit, and a fourth convolutional unit connected in sequence; the linear classification layer includes a fully connected classifier and a Softmax function.
[0073] In some embodiments of the present invention, the preset loss function may be the cross-entropy loss function.
[0074] In some embodiments of the present invention, considering the problem of imbalance in the sample running data, the embodiments of the present invention establish a preset loss function by assigning different weights to different types of sample data. Where N represents the number of types of operational states of the photovoltaic module. The probability vector representing the prediction type, γ n It is a regulatory factor, α n This is used to control the weights of different types of sample data. In some embodiments of the present invention, an adjustment factor can be set according to the number of samples of each fault type in the labeled sample data.
[0075] In some embodiments of the present invention, since the accurately classified sample types have a high y-value... n The value is set accordingly, therefore its corresponding γ is set. nApproaching 0. Conversely, for sample types that are not accurately classified, set their corresponding γ. n Approaching 1. α n It is a predefined constant value between 0 and 1, used to balance different types of sample data. The preset loss function provided in this embodiment of the invention increases the weight of difficult-to-classify sample types (types with few labeled samples in the labeled sample data) in the preset loss function. This means that the preset loss function can pay more attention to difficult-to-classify sample types, which can, to some extent, prevent the neural network model from deviating from the optimal parameters due to imbalanced sample data during training, and is beneficial to improving the accuracy of the model.
[0076] In some embodiments of the present invention, after training an initial model based on labeled sample data to obtain an initial fault diagnosis model, considering that the initial fault diagnosis model is trained based on labeled sample data and has poor generalization ability, using the initial fault diagnosis model as a diagnostic model for fault diagnosis may lead to inaccurate fault diagnosis results. To overcome the problems of model overfitting and underfitting while fully expanding the initial limited labeled sample data, the embodiments of the present invention, after obtaining the initial fault diagnosis model, input unlabeled sample data into the initial fault diagnosis model for fault detection, obtaining prediction results for the unlabeled sample data. These prediction results are then used as labels for the unlabeled sample data to obtain pseudo-labeled sample data. This pseudo-labeled sample data is added to the labeled sample data to expand the labeled sample data. The expanded labeled sample data is then used to train the initial fault model, thereby solving the problem of insufficient labeled sample data in the photovoltaic power station sample library. This overcomes the problems of model overfitting and underfitting while fully expanding the initial limited labeled sample data. In some embodiments of the present invention, the prediction results characterize whether the unlabeled sample data has a fault and, if so, the corresponding fault type.
[0077] Considering that photovoltaic power plants operate normally most of the time, the number of samples in normal conditions far exceeds the number of samples in fault conditions. Furthermore, due to environmental and system-specific factors, the frequency of various common faults varies, resulting in significant differences in the number of samples for different fault types. Therefore, there is a clear imbalance in the initial labeled sample data of different types, and there may be significant distributional differences between labeled and unlabeled sample data. Existing methods require high-quality initial labeled training sets. In the case of low-quality data, it is impossible to accurately predict and add pseudo-labels to unlabeled sample data, leading to a large number of mislabeled samples in the expanded training set. Simultaneously, since existing technologies do not consider a mechanism for removing mislabeled samples, these erroneous samples will significantly reduce the accuracy of the final fault diagnosis model. To overcome the shortcomings of existing methods and ensure the accuracy of the data in the final training set, after obtaining the prediction results corresponding to the unlabeled sample data, a screening process can be performed to select target unlabeled data whose prediction results meet the requirements. Specifically, the method for selecting target unlabeled data includes steps b1 to b2:
[0078] Step b1: Determine the confidence threshold for each fault type based on the labels in the label sample data; the labels in the label sample data are the fault type labels of the label sample data.
[0079] In some embodiments of the present invention, the fault type of the tag sample data can be determined based on the tags in the tag sample data, and preset threshold data can be queried to obtain the confidence threshold corresponding to each fault type. The threshold data includes multiple fault types and the confidence threshold corresponding to each fault type.
[0080] In some embodiments of the present invention, the amount of tag sample data corresponding to each fault type in the tag sample data can be counted based on the tags in the tag sample data. Then, based on the proportion of the tag sample data corresponding to each fault type in the total amount of tag sample data, a pre-stored mapping data between the proportion and a threshold can be queried to obtain the confidence threshold corresponding to each fault type. The mapping data between the proportion and the threshold includes multiple numerical ranges of the proportion and the confidence threshold corresponding to each numerical range.
[0081] Considering that when screening pseudo-labels based on a uniform confidence threshold, if the initial labeled training set has significant sample imbalance, setting the uniform threshold too high will fail to filter out effective fault samples from the unlabeled data, while setting it too low will incorrectly identify some fault samples as normal samples. This means that a small number of types are difficult to predict in the initial stage, leading to a large number of mislabeled pseudo-label samples being added to the training set during semi-supervised learning, thereby reducing the model's accuracy. Therefore, this embodiment of the invention sets separate confidence thresholds for pseudo-labels for different fault types. For fault types with a large number of labeled samples, a higher confidence threshold is set. Conversely, for fault types with a small number of labeled samples, a lower confidence threshold is set. This allows for the accurate screening of pseudo-label samples with high confidence from a large amount of unlabeled sample data while maintaining both accuracy and efficiency in pseudo-label sample screening. This overcomes the overfitting problem that occurs in existing methods when dealing with imbalanced data, ensuring that samples of various fault types in the unlabeled sample data can be accurately identified. Specifically, the methods for determining the confidence threshold include:
[0082] (1) Based on the labels in the label sample data, determine the number of fault types included in the obtained label sample data, and the amount of label sample data corresponding to each fault type.
[0083] (2) Determine the confidence threshold for each fault type based on the number of fault types, the amount of label sample data corresponding to each fault type, and the amount of theoretical sample data corresponding to each fault type.
[0084] In some embodiments of the present invention, based on the number N of fault types and the amount of tag sample data corresponding to each fault type... And the theoretical sample data volume θ corresponding to each fault type, according to The confidence threshold for each fault type was calculated. This represents the confidence threshold for pseudo-label type i in the t-th round of semi-supervised learning. It should be noted that the 20 rounds of semi-supervised learning in the above formula for calculating the confidence threshold is merely an example; the number of training rounds for semi-supervised learning can be set according to the actual application scenario.
[0085] Step b2 involves filtering the unlabeled sample data based on the confidence threshold for each fault type and the prediction results for the unlabeled sample data to determine the target unlabeled data. The prediction results represent the confidence level of the unlabeled sample data belonging to each fault type.
[0086] In some embodiments of the present invention, step b2 includes: determining the confidence level of the unlabeled sample data for each fault type based on the prediction results corresponding to the unlabeled sample data; comparing the confidence level of the unlabeled sample data for each fault type with the confidence level threshold corresponding to the fault type; if the confidence level of each fault type is less than the confidence level threshold corresponding to the fault type, then the unlabeled sample data is determined to be a normal sample; if there is a fault type with a confidence level greater than or equal to the confidence level threshold corresponding to the fault type, then the unlabeled sample data is determined to be a fault sample, and the fault type is set as a pseudo label; removing normal samples from the unlabeled sample data, setting the fault samples as target unlabeled data, and determining the pseudo label corresponding to the target unlabeled data.
[0087] In some embodiments of the present invention, after obtaining the target unlabeled data, the pseudo-labels of the target unlabeled data can be added to the labeled sample data to expand the labeled sample data. The expanded labeled sample data is then used to train the initial fault diagnosis model to obtain a new initial fault diagnosis model. Fault detection is then performed on the remaining unlabeled sample data (excluding the target unlabeled data) according to the new initial fault diagnosis model to obtain the prediction results corresponding to the remaining unlabeled sample data. Following steps b1 to b2, new target unlabeled data is selected from the remaining unlabeled sample data and added to the expanded labeled sample data to obtain new expanded labeled sample data. The new initial fault diagnosis model is then trained based on the new expanded labeled sample data. This process is repeated for multiple rounds of sample expansion. In each round of sample expansion, the historical training round number is compared with a preset round number threshold. If the historical training round number is greater than or equal to the preset round number threshold, the previously expanded labeled sample data is used. The data is set as the sample training set, and the initial fault diagnosis model obtained from the previous training round is set as the fault diagnosis model. When the number of historical training rounds is less than the preset round threshold, the initial fault diagnosis model obtained from the previous training round is trained based on the expanded labeled sample data from the previous round to obtain the current round's initial fault diagnosis model. Based on the current round's initial fault diagnosis model, fault detection is performed on the remaining unlabeled sample data after filtering the unlabeled sample data from the previous round to obtain the current round's target unlabeled sample data. Based on the current round's target unlabeled sample data, the previously expanded labeled sample data is expanded again to obtain the current round's expanded labeled sample data. The number of historical training rounds is obtained, and the number of rounds in the current round is obtained by adding 1 to the number of historical training rounds. When the number of rounds is greater than or equal to the preset round threshold, the current round's expanded labeled sample data is set as the sample training set, and the current round's initial fault diagnosis model is set as the fault diagnosis model. When the number of rounds is less than the preset round threshold, the sample expansion continues according to the above sample expansion method. For example, when the round number threshold is 20 and the historical training round number is 19, since the historical training round number is less than the preset round number threshold, the initial fault diagnosis model obtained from the previous round is trained based on the expanded labeled sample data from the previous round to obtain the current round's initial fault diagnosis model. Based on the current round's initial fault diagnosis model, fault detection is performed on the remaining unlabeled sample data after filtering the unlabeled sample data from the previous round to obtain the current round's target unlabeled sample data. Based on the current round's target unlabeled sample data, the previously expanded labeled sample data is expanded again to obtain the current round's expanded labeled sample data, and the historical training round number is obtained. Through the historical training round number, the current round number is 20. Since the round number is equal to the preset round number threshold, the current round's expanded labeled sample data is set as the sample training set, and the current round's initial fault diagnosis model is set as the fault diagnosis model.
[0088] In some embodiments of the present invention, considering that the labeled sample data used to train the initial fault diagnosis model has data imbalance, which will lead to inconsistent recognition accuracy of the model for various fault types, in order to solve this problem, the embodiments of the present invention obtain the number of samples to be selected from the target unlabeled sample data for each fault type based on the amount of labeled sample data corresponding to each fault type in the labeled sample data, and obtain the sample training set. Specifically, the method for determining the sample training set includes steps c1 to c5:
[0089] Step c1: Based on the labels in the label sample data, determine the amount of label sample data corresponding to each fault type in the label sample data, as well as the total amount of sample data in the label sample data. Here, the labels in the label sample data are the fault type labels of the label sample data.
[0090] Step c2: Determine the sample expansion rate for each fault type based on the amount of tag sample data corresponding to each fault type, the total number of tag sample data, and the preset scaling factor.
[0091] The sample expansion rate represents the amount of additional sample data required for each type of fault in the labeled sample data.
[0092] In some embodiments of the present invention, step c2 includes: determining the proportion of the tag sample data volume of each fault type in the total number of samples based on the tag sample data volume corresponding to each fault type and the total number of tag sample data samples; and performing an exponential calculation based on the proportion and a preset proportional factor to obtain the sample expansion rate for each fault type. For example, based on the tag sample data volume corresponding to each fault type, the total number of tag sample data samples, and a preset proportional factor, through... The sample augmentation rate for each fault type was calculated. Here, t represents the number of semi-supervised learning rounds. Let represent the number of samples with label type i in the training set during the t-th round of semi-supervised learning. β represents the total number of samples of all types in the training set, and β represents the augmentation ratio adjustment factor. Let represent the sample augmentation rate of type i during the t-th round of semi-supervised learning.
[0093] In some embodiments of the present invention, the proportion of the label sample data of each fault type in the total number of samples can be determined based on the amount of label sample data corresponding to each fault type and the total number of label sample data. The pre-stored sample expansion data can be queried to obtain the sample expansion rate corresponding to the proportion of the label sample data of each fault type in the total number of samples. The sample expansion data includes multiple proportion values and the sample expansion rate corresponding to each proportion value.
[0094] In some embodiments of the present invention, the amount of tag sample data corresponding to each fault type, the total number of tag sample data, and a preset scaling factor can be input into a preset expansion rate calculation model to obtain the sample expansion rate corresponding to each fault type. The preset expansion rate calculation model can be a machine learning model, a neural network model, or a probability calculation model.
[0095] Step c3: Based on the prediction results of the target unlabeled data, determine the pseudo-labels for the target unlabeled data. The pseudo-labels are the fault type labels predicted from the target unlabeled data.
[0096] In some embodiments of the present invention, the fault type of the target unlabeled data is determined based on the prediction result of the target unlabeled data, and the fault type of the target unlabeled data is set as the pseudo label of the target unlabeled data.
[0097] Step c4: Based on the sample augmentation rate corresponding to each fault type and the pseudo-label of the target unlabeled data, select the predicted label data corresponding to each fault type from the target unlabeled data.
[0098] In some embodiments of the present invention, based on the pseudo-labels of the target unlabeled data, the types of faults existing in the target unlabeled data and the number of samples corresponding to each fault type are counted. Based on the number of samples corresponding to each fault type in the target unlabeled data and the sample expansion rate corresponding to each fault type, the amount of target sample data to be extracted for each fault type in the target unlabeled data is calculated. Pseudo-label samples of the amount of target sample data to be extracted for each fault type are selected from the target unlabeled data, and the selected pseudo-label samples of the amount of target sample data to be extracted for each fault type are set as the predicted label data corresponding to that fault type.
[0099] Step c5: Obtain the sample training set based on the predicted label data, the pseudo-labels of the predicted label data, and the label sample data.
[0100] In some embodiments of the present invention, the predicted label data can be labeled according to the pseudo-labels of the predicted label data, and the labeled predicted label data can be added to the label sample data to obtain a sample training set.
[0101] In some embodiments of the present invention, in order to improve the accuracy of sample labels in the sample training set, multiple rounds of sample expansion can be performed. In each round of sample expansion, the initial fault diagnosis model obtained in the previous round is trained based on the expanded labeled sample data from the previous round, resulting in the current round's initial fault diagnosis model. Fault detection is then performed on the remaining unlabeled sample data after filtering the unlabeled sample data from the previous round based on the current round's initial fault diagnosis model, resulting in the current round's target unlabeled sample data. The current round's sample expansion rate for each fault type is determined based on the total sample data volume, fault type, and the amount of labeled sample data corresponding to each fault type in the expanded labeled sample data from the previous round. The current round's sample expansion rate for each fault type is then determined based on the current... The round sample augmentation rate and the prediction results of the current round target unlabeled sample data are used to select the current round predicted label data from the current round target unlabeled sample data. This current round predicted label data is then added to the previously augmented label sample data for sample augmentation, resulting in the current round augmented label sample data. The current round's initial fault diagnosis model is trained using this augmented label sample data to obtain the next round's initial fault diagnosis model. This process is repeated until the number of rounds is greater than or equal to a preset round number threshold. At this point, the augmented label sample data from that round (when the number of rounds is greater than or equal to the preset round number threshold) is set as the sample training set, and the initial fault diagnosis model from that round (when the number of rounds is greater than or equal to the preset round number threshold) is set as the fault diagnosis model. Here, the number of rounds refers to the number of times the sample is augmented. For example, when the preset round number threshold is 20, during each round of sample expansion, the historical round number is compared with the preset round number threshold. If the historical round number is greater than or equal to the preset round number threshold, the expanded label sample data from the previous round is set as the sample training set, and the initial fault diagnosis model obtained from the previous round is set as the fault diagnosis model. If the historical round number is less than the preset round number threshold, the sample expansion is performed according to the above sample expansion method to obtain the expanded label sample data and the initial fault diagnosis model for the current round. After each round of sample expansion, the current round number is compared with the preset round number threshold. If the current round number is greater than or equal to the preset round number threshold, sample expansion is stopped, the expanded label sample data is set as the sample training set, and the initial fault diagnosis model for the current round is set as the fault diagnosis model. If the current round number is less than the preset round number threshold, the next round of sample expansion continues. Specifically, the sample expansion method includes:
[0102] (1) Based on the target unlabeled data and labeled sample data, the initial sample training set is obtained.
[0103] In some embodiments of the present invention, an initial sample training set can be obtained based on the target unlabeled data and labeled sample data, following steps c1 to c5.
[0104] (2) The initial fault diagnosis model is trained based on the initial sample training set to obtain the intermediate fault diagnosis model.
[0105] (3) Input the remaining unlabeled sample data (excluding the target unlabeled data) into the intermediate fault diagnosis model to obtain the prediction results corresponding to the remaining unlabeled sample data.
[0106] (4) Based on the prediction results corresponding to the remaining unlabeled sample data, the remaining unlabeled sample data is filtered to obtain the remaining target unlabeled data.
[0107] In some embodiments of the present invention, the remaining target unlabeled data can be filtered out from the remaining unlabeled sample data according to steps b1 to b2.
[0108] (5) Based on the remaining unlabeled target data and the initial sample training set, the sample training set is obtained.
[0109] In some embodiments of the present invention, a new initial sample training set can be obtained by repeating steps c1 to c5 based on the remaining unlabeled target data and the initial sample training set. A new round of sample expansion can be performed based on the new initial sample training set according to the above sample expansion method, and the number of sample expansion rounds can be recorded. When the number of sample expansion rounds is greater than or equal to a preset round threshold, the newly obtained initial sample training set is set as the sample training set, and the sample expansion is stopped.
[0110] In some embodiments of the present invention, considering that during the sample expansion process, due to the initial fault diagnosis model's recognition accuracy, incorrect predicted label data may be added to the label sample data, affecting the accuracy of the model after training, it is necessary to further screen the predicted label data during sample expansion to ensure the accuracy of the labels in the final sample training set. Specifically, this includes steps d1 to d3:
[0111] Step d1: Obtain the number of training rounds for the intermediate fault diagnosis model.
[0112] Step d2: If the number of training rounds of the intermediate fault diagnosis model meets the preset round number threshold, then the sample training set is obtained based on the remaining unlabeled target data and the initial sample training set.
[0113] In some embodiments of the present invention, if the number of training rounds is greater than or equal to a preset rounds threshold, it is determined that the number of training rounds of the intermediate fault diagnosis model meets the preset rounds threshold, and the sample is expanded according to steps c1 to c5 based on the remaining unlabeled target data and the initial sample training set to obtain the sample training set.
[0114] Step d3: If the number of training rounds of the intermediate fault diagnosis model does not meet the preset round number threshold, determine whether the number of training rounds of the intermediate fault diagnosis model meets the preset round number interval. Based on the determination result of whether the number of training rounds of the intermediate fault diagnosis model meets the preset round number interval, determine the sample training set.
[0115] In some embodiments of the present invention, if the number of training rounds is less than a preset rounds threshold, it is determined that the number of training rounds of the intermediate fault diagnosis model does not meet the preset rounds threshold.
[0116] In some embodiments of the present invention, in order to remove erroneous samples in a timely manner, when the number of training rounds of the intermediate fault diagnosis model does not meet the preset round threshold, fault detection can be performed on the unlabeled sample data according to the initial fault diagnosis model obtained in the current round at preset round intervals. Based on the test results of the unlabeled sample data, the predicted label data is re-selected, and erroneous samples in the unlabeled sample data are removed. The label accuracy in the training sample set is improved by using the initial fault diagnosis model with better identification accuracy. The preset round interval can be the interval between the training rounds of the first sample expansion, or the interval between the current training round and the previous historical round for fault detection of unlabeled sample data. For example, taking the preset round interval as the interval between the current training round and the previous historical round for fault detection of unlabeled sample data as an example, when the preset round threshold is 20 and the preset round interval is 4, starting from the first round of training, every 4 rounds, the initial fault diagnosis model obtained from the current round of training is used to detect faults in the unlabeled sample data. Based on the test results of the unlabeled sample data, the predicted label data is re-selected. That is, every 4 rounds, the initial sample training set obtained after 4 rounds of expansion is deleted, and the initial fault diagnosis model obtained from the current round of training is used to detect faults in the unlabeled sample data to obtain a new initial sample training set. Thus, by using the initial fault diagnosis model with better recognition accuracy, erroneous samples in the unlabeled sample data are removed, improving the label accuracy of the final sample training set. Specifically, the sample secondary screening method includes:
[0117] (1) If the number of training rounds of the intermediate fault diagnosis model meets the preset round interval, the unlabeled sample data is input into the intermediate fault diagnosis model to obtain the second target unlabeled data. Based on the second target unlabeled data and the labeled sample data, a new initial sample training set is obtained. The intermediate fault diagnosis model is trained according to the new initial sample training set until the number of training rounds of the intermediate fault diagnosis model is greater than or equal to the preset round threshold, and then the sample training set is obtained.
[0118] (2) If the number of training rounds of the intermediate fault diagnosis model does not meet the preset round interval, the initial sample training set is updated based on the remaining target unlabeled data to obtain a new initial sample training set. The intermediate fault diagnosis model is trained according to the new initial sample training set. When the number of training rounds of the intermediate fault diagnosis model meets the preset round interval, the unlabeled sample data is input into the intermediate fault diagnosis model that meets the preset round interval. The sample training set is obtained when the number of training rounds of the intermediate fault diagnosis model is greater than or equal to the preset round threshold.
[0119] In some embodiments of the present invention, the training interval between the number of training epochs of the intermediate fault diagnosis model and the number of training epochs of the first sample expansion can be calculated, and the training interval can be compared with a preset training interval. If the training interval is equal to the preset training interval, it is determined that the number of training epochs of the intermediate fault diagnosis model meets the preset training interval; if the training interval is greater than or less than the preset training interval, it is determined that the number of training epochs of the intermediate fault diagnosis model does not meet the preset training interval.
[0120] In some embodiments of the present invention, the difference in the number of training rounds of the intermediate fault diagnosis model and the number of training rounds of the first sample expansion is calculated, and the remainder between this difference and a preset difference in the number of rounds is determined. If the remainder is 0, it is determined that the number of training rounds of the intermediate fault diagnosis model meets the preset interval; if the remainder is not 0, it is determined that the number of training rounds of the intermediate fault diagnosis model does not meet the preset interval. For example, when the preset difference in the number of rounds is 4, if the number of training rounds of the intermediate fault diagnosis model is 4 or a multiple of 4, it is determined that the number of training rounds of the intermediate fault diagnosis model meets the preset interval, that is, an erroneous sample is removed every 3 rounds of sample expansion; when the preset difference in the number of rounds is 5, if the number of training rounds of the intermediate fault diagnosis model is 5 or a multiple of 5, it is determined that the number of training rounds of the intermediate fault diagnosis model meets the preset interval, that is, an erroneous sample is removed every 4 rounds of sample expansion.
[0121] In some embodiments of the present invention, if the number of training rounds of the intermediate fault diagnosis model meets the preset round interval, then unlabeled sample data is input into the intermediate fault diagnosis model to obtain second target unlabeled data. Based on the second target unlabeled data and labeled sample data, a new initial sample training set is obtained according to steps c1 to c5. The intermediate fault diagnosis model is trained according to the new initial sample training set until the number of training rounds of the intermediate fault diagnosis model is greater than or equal to the preset round threshold, and then the sample training set is obtained.
[0122] In some embodiments of the present invention, if the number of training rounds of the intermediate fault diagnosis model does not meet the preset round interval, the initial sample training set is updated based on the remaining unlabeled target data according to the above sample expansion method to obtain a new initial sample training set. The intermediate fault diagnosis model is then trained based on the new initial sample training set. When the number of training rounds of the intermediate fault diagnosis model meets the preset round interval, the unlabeled sample data is input into the intermediate fault diagnosis model that meets the preset round interval. This process continues until the number of training rounds of the intermediate fault diagnosis model is greater than or equal to the preset round threshold, at which point the sample training set is obtained.
[0123] In some embodiments of the present invention, when the number of training rounds of the intermediate fault diagnosis model is greater than or equal to a preset round number threshold, a sample training set is obtained. Test samples are then input into the intermediate fault diagnosis model at this time for testing. If the recognition accuracy of the test results is greater than or equal to a preset accuracy threshold, sample expansion is stopped, a sample training set is obtained, and the intermediate fault diagnosis model at this time is set as a fault diagnosis model. If the recognition accuracy of the test results is less than the preset accuracy threshold, the sample training set is input into the intermediate fault diagnosis model at this time for training, and a fault diagnosis model is obtained.
[0124] In some embodiments of the present invention, if the recognition accuracy of the test result is less than a preset accuracy threshold, the intermediate fault diagnosis model at this time is set as the initial model, and the labeled sample data is input into the initial model for training according to the sample generation method described above to obtain the initial fault diagnosis model. Based on the initial fault diagnosis model, fault detection is performed on the unlabeled sample data to obtain the prediction result of the unlabeled sample data. The unlabeled sample data is filtered according to the prediction result of the unlabeled sample data to obtain the target unlabeled data. Based on the target unlabeled data and the labeled sample data, a sample training set is obtained. This process is repeated until the test accuracy and recognition accuracy of the intermediate fault diagnosis model at this time are greater than or equal to the preset accuracy threshold, and the fault diagnosis model is obtained.
[0125] This invention selects target unlabeled data based on a confidence threshold and ensures that unlabeled sample data is accurately labeled by calculating the sample augmentation rate and using a secondary sample screening method. This achieves the augmentation of labeled sample data, significantly improving the data quality of photovoltaic power plants. At the same time, it gradually improves the imbalance in the number of different types of samples, overcomes the network training overfitting and underfitting problems that occur when existing methods process imbalanced data, and thus ensures the accuracy of subsequent fault diagnosis.
[0126] In some embodiments of the present invention, after obtaining the sample training set, the fault diagnosis model can be trained based on the sample training set to obtain the trained fault diagnosis model corresponding to each photovoltaic power station. Based on the trained fault diagnosis model corresponding to each photovoltaic power station, the operating data of the photovoltaic modules of the photovoltaic power station can be identified to determine whether there is a fault in the operation of the photovoltaic power station and the corresponding fault type when a fault exists.
[0127] In some embodiments of the present invention, considering that each photovoltaic power station can only collect samples of a subset of fault types, this means that a fault diagnosis model built based on the sample training set of a single photovoltaic power station can only identify a subset of faults, and cannot diagnose fault types not covered in the sample training set. Based on this, embodiments of the present invention perform federated learning on fault diagnosis models built from multiple photovoltaic power stations to obtain a joint diagnosis model. Each photovoltaic power station uses this joint diagnosis model to identify the operating data of its photovoltaic modules, determining whether a fault exists in the operation of the photovoltaic power station and, if so, the corresponding fault type. Specifically, as... Figure 4 As shown, Figure 4 This is a flowchart illustrating a method for obtaining a joint diagnostic model based on federated learning, as provided in an embodiment of the present invention. The method is applied to a server and specifically includes steps 401 to 403.
[0128] 401. Obtain the fault diagnosis model parameters sent by each electronic device. These parameters include, but are not limited to, the weights, number of network layers, and network layer sizes. For example, when the fault diagnosis model is based on a convolutional network, the parameters include, but are not limited to, the weights, number of convolutional layers, kernel size, stride, pooling kernel size, pooling stride, and pooling method. The fault diagnosis model is trained using the sample training set obtained through the sample generation method described above. Each photovoltaic power station deploys one electronic device, and each electronic device corresponds to at least one set of fault diagnosis model parameters.
[0129] 402. The parameters of each fault diagnosis model are aggregated to obtain the initial joint model parameters.
[0130] In some embodiments of the present invention, the parameters of each fault diagnosis model can be accumulated to obtain the initial joint model parameters.
[0131] In some embodiments of the present invention, the weight of each fault diagnosis model can be determined, and the initial joint model parameters are obtained by accumulating the weight of each fault diagnosis model and its fault diagnosis model parameters. In some embodiments of the present invention, the weight of each fault diagnosis model can be determined according to the amount of sample data in the sample training set corresponding to each fault diagnosis model. For example, the ratio between the amount of sample data in the sample training set corresponding to each fault diagnosis model and the total amount of sample data in the sample training sets corresponding to all fault diagnosis models can be set as the weight of the fault diagnosis model.
[0132] 403. Based on the initial joint model parameters, the joint diagnostic model is obtained.
[0133] In some embodiments of the present invention, a joint diagnostic model can be obtained by establishing a model based on the initial joint model parameters.
[0134] In some embodiments of the present invention, after obtaining the joint diagnostic model, the joint diagnostic model is sent to the electronic devices deployed in each photovoltaic power station. After receiving the joint diagnostic model, the electronic devices train the joint diagnostic model according to the sample training set, and test the model by inputting the test sample values to obtain the test accuracy. When the test accuracy is greater than or equal to the preset accuracy threshold, the trained joint diagnostic model is obtained.
[0135] In some embodiments of the present invention, since the number of sample training sets generated by each photovoltaic power station is different, the weight of each fault diagnosis model parameter can be determined based on the number of sample training sets generated by each photovoltaic power station during parameter aggregation. However, the number of sample training sets and computing power of the electronic devices deployed in each photovoltaic power station are different, resulting in different times for each electronic device to obtain the sample training set and send the fault diagnosis model parameters. If parameter aggregation is performed only after all the fault diagnosis model parameters corresponding to all electronic devices have been received, it will lead to low data transmission efficiency and long model parameter aggregation time. To solve the above problems, embodiments of the present invention record the number of received fault diagnosis models. When the number reaches a preset proportion threshold of the number of all electronic devices, model parameter aggregation is performed. Specifically, the initial joint model parameter determination method includes steps e1 to e3:
[0136] Step e1: Determine the first number of received fault diagnosis model parameters.
[0137] Step e2: If the first quantity is greater than the preset quantity threshold, then determine the sample proportion of the training sample size of the fault diagnosis model corresponding to each electronic device.
[0138] In some embodiments of the present invention, if the first quantity is less than or equal to a preset quantity threshold, then the process continues to wait.
[0139] In some embodiments of the present invention, a preset quantity threshold can be obtained based on the theoretical number of fault diagnosis model parameters participating in federated learning and the predicted proportion threshold. The theoretical number of fault diagnosis model parameters participating in federated learning refers to the number of photovoltaic power plants participating in the joint modeling. The embodiments of the present invention do not limit the specific value of the preset proportion threshold; for example, it can be 60% or 70%.
[0140] In some embodiments of the present invention, step e2 includes:
[0141] (1) Determine the amount of data in the sample training set of the fault diagnosis model corresponding to each electronic device.
[0142] (2) Summarize the data volume of the sample training set of the fault diagnosis model corresponding to each electronic device to obtain the total data volume of the sample training set of the fault diagnosis model corresponding to each electronic device.
[0143] (3) By determining the proportion of the training set of the fault diagnosis model corresponding to each electronic device in the total data, the proportion of the training sample size of the fault diagnosis model corresponding to each electronic device is obtained.
[0144] Step e3: Based on the sample ratio of the training sample size of the fault diagnosis model corresponding to each electronic device and the parameters of the fault diagnosis model corresponding to each electronic device, the initial joint model parameters are obtained.
[0145] In some embodiments of the present invention, the training sample size ratio of the fault diagnosis model corresponding to each electronic device and the parameters of the fault diagnosis model corresponding to each electronic device can be used to... The initial joint model parameters are calculated. Where, d x G represents the data size of the sample training set for photovoltaic power station x, K and D represent the first number of received fault diagnosis model parameters and the total data size of the sample training set, respectively. t This represents the initial joint model parameters obtained after aggregation.
[0146] In some embodiments of the present invention, considering that the number of sample training sets and the computing power of the electronic devices deployed in each photovoltaic power station are different, the time for each electronic device to obtain the sample training set and send the fault diagnosis model parameters is different. If the parameter aggregation is performed only after all the fault diagnosis model parameters corresponding to the electronic devices are received, it will lead to low data transmission efficiency and long model parameter aggregation time. Therefore, the fault diagnosis model parameters received within a preset time period can be aggregated according to the above-mentioned initial joint model parameter determination method to obtain the initial joint model parameters.
[0147] In some embodiments of the present invention, a first number of fault diagnosis model parameters received within a preset time period can be determined. When the first number is greater than a preset number threshold, the parameters are aggregated according to steps e2 to e3 to obtain initial joint model parameters.
[0148] In some embodiments of the present invention, after obtaining the initial joint model parameters, a model can be established based on the initial joint model parameters to obtain an initial joint diagnostic model. The initial joint diagnostic model is then sent to an electronic device that sends fault diagnostic models within a preset time period. The electronic device tests the received initial joint diagnostic model. If the test accuracy is greater than or equal to a preset accuracy threshold, the initial joint diagnostic model is set as a joint diagnostic model. If the test accuracy is less than the preset accuracy threshold, feedback information is sent to the server, so that the server adjusts the initial joint model parameters based on the received feedback information to obtain an adjusted initial joint diagnostic model. The adjusted initial joint diagnostic model is then sent to the power plant equipment. This process is repeated until the test accuracy of the adjusted initial joint diagnostic model is greater than or equal to the preset accuracy threshold, thus obtaining a joint diagnostic model. Specifically, the method for establishing the joint diagnostic model includes steps f1 to f3:
[0149] Step f1: Based on the initial joint model parameters, establish the initial joint diagnostic model.
[0150] Step f2: Send the initial joint diagnostic model to each electronic device and receive the first target feedback information returned by each electronic device. The first target feedback information is generated based on the first test accuracy obtained by inputting test sample data into the initial joint diagnostic model. This first test accuracy is less than a preset accuracy threshold.
[0151] In some embodiments of the present invention, after receiving the initial joint diagnostic model, the electronic device obtains a sample training set through the above-described sample generation method to train the initial joint diagnostic model, thereby obtaining a trained initial joint diagnostic model; the test sample data is input into the trained initial joint diagnostic model for model testing, and the test results corresponding to the test sample data are obtained; based on the test results corresponding to the test sample data and the actual recognition results corresponding to the test sample data, a first test accuracy is obtained; the first test accuracy is compared with a preset accuracy threshold; if the first test accuracy is less than the preset accuracy threshold, a first target feedback information is generated based on the difference between the first test accuracy and the preset accuracy threshold, and the first target feedback information is sent to the server; if the first test accuracy is greater than or equal to the preset accuracy threshold, a confirmation information is sent to the server, and the trained initial joint diagnostic model is set as the joint diagnostic model.
[0152] Step f3: Based on the first target feedback information returned by each electronic device, adjust the initial joint model parameters to obtain the joint diagnostic model.
[0153] In some embodiments of the present invention, when the server receives the first target feedback information returned by each electronic device, it adjusts the initial joint model parameters according to the first target feedback information returned by each electronic device to obtain the adjusted initial joint model parameters. Based on the adjusted initial joint model parameters, an intermediate joint diagnostic model is obtained and sent to the electronic device. Step f2 is then executed to obtain the second target feedback information returned by each electronic device. Based on the second target feedback information, the adjusted initial joint model parameters are adjusted again to obtain a new intermediate joint diagnostic model. The new intermediate joint diagnostic model is sent to the electronic device, and this process is repeated until a preset stopping condition is reached. The new intermediate joint diagnostic model at this point is then set as the joint diagnostic model. The preset stopping condition can be that the number of times the initial joint model parameters are adjusted is greater than or equal to a preset threshold, or that the number of received confirmation messages is greater than or equal to a preset threshold.
[0154] In some embodiments of the present invention, in order to save server caching and storage resources, in the establishment of the joint diagnostic model, after each initial fault diagnosis model based on the initial joint model parameters obtained from aggregation is sent to the electronic device, the received fault diagnosis model parameters are cleared, and feedback from the electronic device is awaited. Specifically, this includes: establishing an initial joint diagnostic model based on the initial joint model parameters; sending the initial joint diagnostic model to each electronic device; the electronic device using the above-mentioned sample generation method to obtain a sample training set to train the initial joint diagnostic model, obtaining a trained initial joint diagnostic model; inputting test sample data into the trained initial joint diagnostic model to perform model testing, obtaining test results corresponding to the test sample data; and based on the number of test samples... Based on the corresponding test results and the actual recognition results corresponding to the test sample data, a first test accuracy is obtained; the first test accuracy is compared with a preset accuracy threshold; if the first test accuracy is less than the preset accuracy threshold, the trained initial joint diagnostic model is set as the parameters of the new fault diagnosis model for the electronic device, and the new fault diagnosis model parameters are sent to the server; upon receiving the new fault diagnosis model parameters of a preset number threshold, the server aggregates them again according to the above method for determining the initial joint model parameters to obtain a new initial diagnostic joint model, and sends the new initial diagnostic joint model to the electronic device, repeating this process until the test accuracy of the currently obtained new initial joint diagnostic model is greater than or equal to the preset accuracy threshold, at which point the currently obtained new initial joint diagnostic model is set as the joint diagnostic model.
[0155] In some embodiments of the present invention, during the aggregation process, if fault diagnosis model parameters are received within a preset time period, these parameters can be cached and used as fault diagnosis model parameters for the next parameter aggregation. This avoids wasting computational resources and accelerates the aggregation frequency. Especially for photovoltaic power plants where electronic equipment models update slowly, this asynchronous update and caching mechanism allows them to participate in parameter aggregation in subsequent rounds.
[0156] This invention addresses the low data quality issues of insufficient number of labeled samples, limited types, type imbalance, and significant distribution differences between labeled and unlabeled sample data in actual photovoltaic power plants. By combining small sample technology, it solves the training set data quality problem faced in the actual operation and maintenance of photovoltaic power plants, significantly improving the training set data quality. Through sample expansion, it improves the accuracy of subsequent diagnostic models. Furthermore, through a federated learning mechanism, it enables joint modeling of multiple photovoltaic power plants and optimizes model caching, thereby fully utilizing the fault types of multiple photovoltaic power plants while ensuring privacy and communication efficiency, and significantly improving the generalization of the model.
[0157] In some embodiments of the present invention, after obtaining the joint diagnostic model, fault diagnosis can be performed on each electronic device deployed on a photovoltaic power station using the joint diagnostic model to obtain fault diagnosis results. Specifically, the fault diagnosis method based on the joint diagnostic model includes:
[0158] (1) Collect the operating data of the photovoltaic module to be tested.
[0159] (2) Input the operating data into the joint diagnostic model for fault diagnosis and obtain the fault diagnosis results of the photovoltaic module to be tested.
[0160] The sample generation method provided in this invention solves the problem of training set data quality in the actual operation and maintenance of photovoltaic power plants by using small sample merging technology, which greatly improves the training set data quality of photovoltaic power plants and improves the accuracy of subsequent diagnostic models by expanding the samples.
[0161] To better implement the sample generation method provided in the embodiments of the present invention, based on the sample generation method, the embodiments of the present invention provide a sample generation apparatus, such as... Figure 5 As shown, Figure 5 This is a schematic diagram of a sample generation device provided in an embodiment of the present invention. The sample generation device shown includes:
[0162] The data acquisition module is used to collect sample operation data of at least one photovoltaic module; the sample operation data includes tagged sample data and untagged sample data.
[0163] The training module is used to train the initial model based on the labeled sample data to obtain the initial fault diagnosis model;
[0164] The prediction module is used to input unlabeled sample data into the initial fault diagnosis model for fault detection and obtain the prediction results corresponding to the unlabeled sample data.
[0165] The filtering module is used to filter unlabeled sample data based on the prediction results corresponding to the unlabeled sample data to obtain the target unlabeled data.
[0166] The sample module is used to obtain a sample training set based on the target unlabeled data and labeled sample data.
[0167] In some embodiments of the present invention, the filtering module is used to: determine the confidence threshold corresponding to each fault type based on the labels in the labeled sample data; the labels in the labeled sample data are the fault type labels of the labeled sample data; filter the unlabeled sample data based on the confidence threshold corresponding to each fault type and the prediction results corresponding to the unlabeled sample data to determine the target unlabeled data; the prediction results characterize the confidence level of the unlabeled sample data belonging to each fault type.
[0168] In some embodiments of the present invention, the filtering module is configured to: determine the number of fault types included in the obtained label sample data and the amount of label sample data corresponding to each fault type based on the labels in the label sample data; and determine the confidence threshold corresponding to each fault type based on the number of fault types, the amount of label sample data corresponding to each fault type and the amount of theoretical sample data corresponding to each fault type.
[0169] In some embodiments of the present invention, the sample module is configured to: determine the amount of label sample data corresponding to each fault type in the label sample data, and the total amount of sample data in the label sample data, based on the labels in the label sample data; the labels in the label sample data are fault type labels of the label sample data; determine the sample expansion rate corresponding to each fault type based on the amount of label sample data corresponding to each fault type, the total number of samples in the label sample data, and a preset scaling factor; determine the pseudo label of the target unlabeled data based on the prediction result of the target unlabeled data; the pseudo label is the fault type label predicted by the target unlabeled data; select the predicted label data corresponding to each fault type from the target unlabeled data based on the sample expansion rate corresponding to each fault type and the pseudo label of the target unlabeled data; and obtain a sample training set based on the predicted label data, the pseudo label of the predicted label data, and the label sample data.
[0170] In some embodiments of the present invention, the sample module is used to: obtain an initial sample training set based on target unlabeled data and labeled sample data; train an initial fault diagnosis model based on the initial sample training set to obtain an intermediate fault diagnosis model; input the remaining unlabeled sample data (excluding target unlabeled data) into the intermediate fault diagnosis model to obtain prediction results corresponding to the remaining unlabeled sample data; filter the remaining unlabeled sample data based on the prediction results corresponding to the remaining unlabeled sample data to obtain the remaining target unlabeled data; and obtain a sample training set based on the remaining target unlabeled data and the initial sample training set.
[0171] In some embodiments of the present invention, the sample module is used to: obtain the number of training rounds of the intermediate fault diagnosis model;
[0172] If the number of training rounds of the intermediate fault diagnosis model meets the preset round threshold, then the sample training set is obtained based on the remaining unlabeled target data and the initial sample training set; if the number of training rounds of the intermediate fault diagnosis model does not meet the preset round threshold, then it is determined whether the number of training rounds of the intermediate fault diagnosis model meets the preset round interval, and the sample training set is determined based on the determination result of whether the number of training rounds of the intermediate fault diagnosis model meets the preset round interval.
[0173] In some embodiments of the present invention, the sample module is used for: if the number of training rounds of the intermediate fault diagnosis model meets a preset round interval, then inputting unlabeled sample data into the intermediate fault diagnosis model to obtain second target unlabeled data; obtaining a new initial sample training set based on the second target unlabeled data and labeled sample data; and training the intermediate fault diagnosis model according to the new initial sample training set until the number of training rounds of the intermediate fault diagnosis model is greater than or equal to a preset round threshold, thereby obtaining a sample training set; if the number of training rounds of the intermediate fault diagnosis model does not meet the preset round interval, then updating the initial sample training set based on the remaining target unlabeled data to obtain a new initial sample training set; training the intermediate fault diagnosis model according to the new initial sample training set; and inputting unlabeled sample data into the intermediate fault diagnosis model that meets the preset round interval when the number of training rounds of the intermediate fault diagnosis model meets the preset round interval, until the number of training rounds of the intermediate fault diagnosis model is greater than or equal to a preset round threshold, thereby obtaining a sample training set.
[0174] The sample generation device provided in this embodiment of the invention solves the problem of training set data quality faced in the actual operation and maintenance of photovoltaic power plants by combining small samples, which greatly improves the training set data quality of photovoltaic power plants and improves the accuracy of subsequent diagnostic models by expanding the samples.
[0175] This invention also provides an electronic device, such as... Figure 6 As shown, it illustrates a structural schematic diagram of the electronic device involved in an embodiment of the present invention, specifically:
[0176] The electronic device may include components such as a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, a power supply 603, and an input unit 604. Those skilled in the art will understand that... Figure 6 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:
[0177] The processor 601 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines, and performs various functions and processes data by running or executing software programs and / or modules stored in the memory 602, and by calling data stored in the memory 602, thereby providing overall monitoring of the electronic device. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 601.
[0178] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 602 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.
[0179] The electronic device also includes a power supply 603 that supplies power to the various components. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 603 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0180] The electronic device may also include an input unit 604, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0181] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 601 in the electronic device loads the executable files corresponding to the processes of one or more applications into the memory 602 according to the following instructions, and the processor 601 runs the applications stored in the memory 602 to realize various functions, as follows:
[0182] Collect sample operation data for at least one photovoltaic module; the sample operation data includes tagged sample data and untagged sample data.
[0183] The initial model is trained based on the labeled sample data to obtain the initial fault diagnosis model;
[0184] Unlabeled sample data is input into the initial fault diagnosis model for fault detection, and the prediction results corresponding to the unlabeled sample data are obtained.
[0185] Based on the prediction results corresponding to the unlabeled sample data, the unlabeled sample data is filtered to obtain the target unlabeled data;
[0186] Based on the target unlabeled data and labeled sample data, a sample training set is obtained.
[0187] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0188] To this end, embodiments of the present invention provide a storage medium storing a plurality of instructions that can be loaded by a processor to execute steps in any of the sample generation methods provided in the embodiments of the present invention. For example, the instructions can execute the following steps:
[0189] Collect sample operation data for at least one photovoltaic module; the sample operation data includes tagged sample data and untagged sample data.
[0190] The initial model is trained based on the labeled sample data to obtain the initial fault diagnosis model;
[0191] Unlabeled sample data is input into the initial fault diagnosis model for fault detection, and the prediction results corresponding to the unlabeled sample data are obtained.
[0192] Based on the prediction results corresponding to the unlabeled sample data, the unlabeled sample data is filtered to obtain the target unlabeled data;
[0193] Based on the target unlabeled data and labeled sample data, a sample training set is obtained.
[0194] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0195] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0196] Since the instructions stored in the storage medium can execute the steps in any of the sample generation methods provided in the embodiments of the present invention, the beneficial effects that any of the sample generation methods provided in the embodiments of the present invention can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.
[0197] The foregoing has provided a detailed description of a sample generation method, apparatus, electronic device, and storage medium provided by embodiments of the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, those skilled in the art will recognize that there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method of sample generation, characterized by, The method comprises: Collecting sample operation data of at least one photovoltaic module, wherein the sample operation data comprises labeled sample data with labels and unlabeled sample data without labels; Training an initial model according to the labeled sample data to obtain an initial fault diagnosis model; Inputting the unlabeled sample data into the initial fault diagnosis model for fault detection to obtain a prediction result corresponding to the unlabeled sample data; According to the prediction result corresponding to the unlabeled sample data, performing screening processing on the unlabeled sample data to obtain target unlabeled data; Based on the target unlabeled data and the labeled sample data, obtaining a sample training set; According to the prediction result corresponding to the unlabeled sample data, performing screening processing on the unlabeled sample data to obtain target unlabeled data, comprising: According to the labels in the labeled sample data, determining a confidence threshold corresponding to each fault type; the labels in the labeled sample data are fault type labels of the labeled sample data; According to the confidence threshold corresponding to each fault type and the prediction result corresponding to the unlabeled sample data, performing data screening on the unlabeled sample data to determine target unlabeled data; the prediction result represents the confidence of the unlabeled sample data belonging to each fault type; Based on the target unlabeled data and the labeled sample data, obtaining a sample training set, comprising: According to the labels in the labeled sample data, determining the amount of labeled sample data corresponding to each fault type in the labeled sample data, and the total amount of sample data of the labeled sample data; the labels in the labeled sample data are fault type labels of the labeled sample data; According to the amount of labeled sample data corresponding to each fault type, the total amount of sample data of the labeled sample data, and a preset proportion factor, determining a sample expansion rate corresponding to each fault type; According to the prediction result of the target unlabeled data, determining a pseudo label of the target unlabeled data; the pseudo label is a predicted fault type label of the target unlabeled data; According to the sample expansion rate corresponding to each fault type and the pseudo label of the target unlabeled data, selecting predicted label data corresponding to each fault type from the target unlabeled data; According to the predicted label data, the pseudo label of the predicted label data, and the labeled sample data, obtaining a sample training set.
2. The sample generation method of claim 1, wherein, According to the labels in the labeled sample data, determining a confidence threshold corresponding to each fault type, comprising: According to the labels in the labeled sample data, determining the type number of fault types included in the labeled sample data, and the amount of labeled sample data corresponding to each fault type; According to the type number of fault types, the amount of labeled sample data corresponding to each fault type, and the theoretical sample data amount corresponding to each fault type, determining a confidence threshold corresponding to each fault type.
3. The sample generation method of claim 1, wherein, Based on the target unlabeled data and the labeled sample data, obtaining a sample training set, comprising: obtaining an initial sample training set based on the target unlabeled data and the labeled sample data; training the initial fault diagnosis model according to the initial sample training set to obtain an intermediate fault diagnosis model; inputting the remaining unlabeled sample data except the target unlabeled data into the intermediate fault diagnosis model to obtain a prediction result corresponding to the remaining unlabeled sample data; screening the remaining unlabeled sample data according to the prediction result corresponding to the remaining unlabeled sample data to obtain remaining target unlabeled data; obtaining a sample training set based on the remaining target unlabeled data and the initial sample training set.
4. The sample generation method of claim 3, wherein, The obtaining of the sample training set based on the remaining target unlabeled data and the initial sample training set comprises: obtaining the number of training rounds of the intermediate fault diagnosis model; if the number of training rounds of the intermediate fault diagnosis model meets a preset round threshold, obtaining a sample training set based on the remaining target unlabeled data and the initial sample training set; if the number of training rounds of the intermediate fault diagnosis model does not meet the preset round threshold, determining whether the number of training rounds of the intermediate fault diagnosis model meets a preset round interval, and determining the sample training set according to a determination result of whether the number of training rounds of the intermediate fault diagnosis model meets the preset round interval.
5. The sample generation method of claim 4, wherein, The determination of the sample training set according to the determination result of whether the number of training rounds of the intermediate fault diagnosis model meets the preset round interval comprises: if the number of training rounds of the intermediate fault diagnosis model meets the preset round interval, inputting the unlabeled sample data into the intermediate fault diagnosis model to obtain second target unlabeled data, obtaining a new initial sample training set based on the second target unlabeled data and the labeled sample data, and training the intermediate fault diagnosis model according to the new initial sample training set until the number of training rounds of the intermediate fault diagnosis model is greater than or equal to the preset round threshold, thereby obtaining the sample training set; if the number of training rounds of the intermediate fault diagnosis model does not meet the preset round interval, updating the initial sample training set based on the remaining target unlabeled data to obtain a new initial sample training set, training the intermediate fault diagnosis model according to the new initial sample training set, and inputting the unlabeled sample data into the intermediate fault diagnosis model that meets the preset round interval when the number of training rounds of the intermediate fault diagnosis model meets the preset round interval, until the number of training rounds of the intermediate fault diagnosis model is greater than or equal to the preset round threshold, thereby obtaining the sample training set.
6. A sample generating apparatus, characterized by comprising: The device comprises: a collection module configured to collect sample operation data of at least one photovoltaic module, wherein the sample operation data comprises labeled sample data and unlabeled sample data; a training module configured to train an initial model according to the labeled sample data to obtain an initial fault diagnosis model; The prediction module is configured to input the unlabeled sample data into the initial fault diagnosis model to perform fault detection, and obtain a prediction result corresponding to the unlabeled sample data. The screening module is configured to perform screening processing on the unlabeled sample data according to the prediction result corresponding to the unlabeled sample data, and obtain target unlabeled data. The sample module is configured to obtain a sample training set based on the target unlabeled data and the labeled sample data. The screening module is configured to determine a confidence threshold corresponding to each fault type according to a label in the labeled sample data, determine target unlabeled data by performing data screening on the unlabeled sample data according to the confidence threshold corresponding to each fault type and the prediction result corresponding to the unlabeled sample data, and the prediction result represents a confidence of the unlabeled sample data belonging to each fault type. The sample module is configured to determine a sample data amount of labeled sample data corresponding to each fault type in the labeled sample data and a total sample data amount of the labeled sample data according to a label in the labeled sample data, determine a sample expansion rate corresponding to each fault type according to the sample data amount of the labeled sample data corresponding to each fault type, the total sample data amount of the labeled sample data, and a preset proportion factor, determine a pseudo label of the target unlabeled data according to the prediction result of the target unlabeled data, the pseudo label being a fault type label predicted by the target unlabeled data, and select prediction label data corresponding to each fault type from the target unlabeled data according to the sample expansion rate corresponding to each fault type and the pseudo label of the target unlabeled data, and obtain a sample training set according to the prediction label data, the pseudo label of the prediction label data, and the labeled sample data.
7. An electronic device, comprising: The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the sample generation method of any one of claims 1 to 5.
8. A storage medium, characterized by The storage medium stores a plurality of instructions for causing a computer to execute the sample generation method according to any one of claims 1-5.
Citation Information
Patent Citations
Early fault diagnosis method and device
CN113408371A
Quality variable prediction method and device under auxiliary training framework, terminal and medium
CN114186732A