Energy internet fault diagnosis model training method and diagnosis method based on data fusion

The energy Internet fault diagnosis data is processed through multi-task convolutional model of hierarchical clustering and multi-head attention. Combined with Hadamard product and comparison learning tasks, the problem of data redundancy and long-distance dependency is solved, and the problem of uncatched data is improved. Efficiency and accuracy of fault diagnosis.

CN118885960APending Publication Date: 2024-11-01HEILONGJIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410900112.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-05
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

The data redundancy of existing deep learning models is not considered in the energy Internet fault diagnosis, resulting in long training time and reduced accuracy of the model, and the inability to effectively capture long-distance dependencies in the sequence, resulting in inaccurate diagnostic results.

Method used

The multi-task convolution model of hierarchical clustering and multi-head attention is used to cluster the original data, feature fusion is performed through the Hadamard product, and a comparison learning task is introduced to improve the training efficiency and accuracy of the model.

Benefits of technology

It effectively reduces the training time of the model, improves the accuracy and generalization ability of fault diagnosis, and can achieve a higher diagnostic accuracy rate especially when there are fewer training samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118885960A_ABST
    Figure CN118885960A_ABST
Patent Text Reader

Abstract

The invention discloses an energy internet fault diagnosis model training method and diagnosis method based on data fusion, and belongs to the technical field of energy internet fault diagnosis. The method aims to solve the problem that an existing deep learning-based data fusion model neglects the repeatability of a data set, so that the model training time is longer. The method comprises the following steps: constructing a data set by data collected by a plurality of sensors, calculating a Pearson correlation coefficient between each pair of sensor data in a sample, and performing hierarchical clustering based on a correlation coefficient matrix to obtain multiple groups of clustering data; for each group of clustering data, a feature extraction module is adopted to extract fault features; for the classification task and the contrast learning task, performing feature fusion on the fault features correspondingly extracted from each group of clustering data, calculating loss functions based on the fused features, and realizing training of an energy internet fault diagnosis model by using total loss formed by the loss functions of the classification task and the contrast learning task; and fault diagnosis of the energy internet is carried out by using the trained model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of energy internet fault diagnosis, and specifically relates to a training method for an energy internet fault diagnosis model and an energy internet fault diagnosis method. Background Art

[0002] With the continuous development of the Energy Internet and the increasing complexity of system operation, various frequent fault problems have become the norm. In this context, rapid and accurate fault diagnosis has become extremely critical to ensure the stable operation of the Energy Internet. In the past, traditional machine learning models have been widely used in the field of fault diagnosis, such as support vector machines, decision trees, etc. However, these models require manual selection of features from the data, which can be time-consuming and easily affect the final results. In recent years, deep learning models have been applied to the field of fault diagnosis and have achieved good results due to their powerful feature learning and classification capabilities.

[0003] However, fault diagnosis models that use single sensor data in complex industrial systems may easily fail to identify complex faults, resulting in inaccurate diagnostic results. Since multi-sensor data usually contains complementary fault information, using multi-sensor data for fault diagnosis can achieve better diagnostic performance than single sensor data. Therefore, multi-sensor data fusion models based on deep learning have been applied to the field of fault diagnosis. Many studies have shown that deep learning models can extract basic information from raw data, and then gradually fuse this basic information into higher-level representation information. These high-level representation information and intermediate layer decisions are gradually formed, and the final classification results are obtained through layer-by-layer processing and learning. For example, a fusion model based on a multi-input convolutional network, MI-CNN (Multi-Input Convolution Neural Network), is used for accurate diagnosis of induction motor faults. The features of each sensor data are extracted through convolution, and the extracted features are spliced ​​for classification. The paper "Graph learning empowered situationawareness in Internet of energy with graph digital twin" proposed the Graph Digital Twin (GDT), which constructs data into graph structure data, and designed two graph convolution-based classifiers for fault location and stability prediction GCN-FA (Graph Convolutional Network based FaultAnalysis). However, the above models treat all features equally, which may lead to emphasizing irrelevant features and ignoring key features.

[0004] In order to pay more attention to important features during the feature extraction process, the SA-DACNN (Self Attention Dynamic Adaptive Convolutional Neural Network) model is proposed in the "SA-DACNN Gearbox Fault Diagnosis Method Based on Multi-Sensor Data Fusion", which enhances feature learning through adaptive weighted information of feature fusion module and self-attention module. The HMS-MACNN (Hybrid Multi-Scale Convolutional Neural Network model coupled with Multi-Attention) model combines multi-attention mechanism to process system fault diagnosis, captures multi-scale features of gearbox time and frequency, and uses adaptive weighting rules to efficiently consider the impact of different scale features on fault judgment. Although the above model extracts more comprehensive and important features, it does not take into account the redundancy of data and the diagnostic accuracy when the training samples are low.

[0005] Therefore, there are some problems with existing deep learning models: 1) Although multi-sensor data contains richer information, most works do not consider data redundancy, resulting in longer model training time and more memory usage; 2) Equal attention is paid to the features extracted from the data, which weakens relevant features and enhances irrelevant features, and cannot effectively capture long-distance dependencies in the sequence, resulting in decreased accuracy; 3) A large amount of labeled data is required to train the model, which requires the collection of a large amount of data and high labeling costs, and does not emphasize the extraction of complementary fault features, reducing the accuracy of fault diagnosis. Summary of the invention

[0006] In order to solve the problem that the existing deep learning-based data fusion model ignores the repeatability of the data set, resulting in longer model training time, and fails to effectively capture the long-distance dependencies in the sequence, resulting in decreased accuracy.

[0007] A method for training an energy Internet fault diagnosis model based on data fusion, comprising:

[0008] First, the original data is clustered using the HC model. The specific process includes:

[0009] Construct a dataset from data collected by multiple sensors; calculate the Pearson correlation coefficient between each pair of sensor data in the sample n represents the nth sample, a and b represent any two sensors among the multiple sensors;

[0010] Then, based on the correlation coefficient matrix corresponding to the obtained correlation coefficients, the matrix composed of the medians of the sensor data is determined:

[0011]

[0012] m a,b =median(v a,b ) (4)

[0013] M(a,b)=[m a,b ]∈R m×m ,a,b=1,…m (5)

[0014] Where m represents the number of sensors, N represents the number of samples, and v a,b represents the vector composed of the Pearson correlation coefficient between the a-th sensor data and the b-th sensor data in all samples; median(·) represents the median, m a,b represents the median of the Pearson correlation coefficient between the a-th sensor data and the b-th sensor data in all samples, and M(a,b) represents the new matrix after the median calculation;

[0015] Based on the matrix composed of medians, a hierarchical clustering algorithm is used to cluster and obtain multiple groups of cluster data; for each group of cluster data, a feature extraction module is used to extract fault features;

[0016] For the classification task and contrastive learning task, the fault features corresponding to each group of clustered data are fused based on the Hadamard product, and then the loss function is calculated based on the features obtained by the feature fusion method; the total loss composed of the loss functions of the classification task and contrastive learning task is used to realize the training of the energy Internet fault diagnosis model;

[0017] The energy internet fault diagnosis model includes a feature extraction module part and a network module part in the classification task.

[0018] Furthermore, the feature extraction module is a feature extraction module based on a 1DCNN network and a multi-head attention network. The 1DCNN network includes multiple convolution units, each convolution unit includes a convolution layer and a pooling layer, and the convolution layer is sent to the pooling layer after passing through an activation function.

[0019] Preferably, the 1DCNN network includes three convolution units, and the convolution layers in the three convolution units are as follows:

[0020] The first convolution layer has 32 channels and a convolution kernel size of (1, 2).

[0021] The second convolution layer has 64 channels and a convolution kernel size of (1, 129).

[0022] The last convolution layer has 192 channels and a convolution kernel size of (1, 29).

[0023] Preferably, in the process of clustering to obtain multiple groups of cluster data using a hierarchical clustering algorithm, the hierarchical clustering algorithm is used to cluster the data into 4 groups of cluster data.

[0024] Furthermore, the extracted fault features corresponding to each group of cluster data are fused based on the Hadamard product, and then the process of calculating the loss function based on the features obtained by the feature fusion method includes:

[0025] Suppose the features extracted from each sample in the four cluster group data are:

[0026]

[0027] Among them, m' represents the dimension of extracting feature information;

[0028] The calculation of fusion features is as follows:

[0029] f= f1⊙f2⊙f3⊙f4=[f1,f2,…,f m' ]∈R m′ (12)

[0030] Where, ⊙ represents the Hadamard product;

[0031] The fused feature f is sent to the MLP network, and then the energy Internet fault diagnosis type recognition result is obtained through the softmax function;

[0032] The fault category classification task uses the cross entropy loss function L categ Calculate the classification loss.

[0033] Furthermore, the cross entropy loss function used in the fault category classification task is as follows:

[0034]

[0035] in, represents the true label of the i-th fault category, Represents the probability of energy Internet fault diagnosis type calculated by the softmax function.

[0036] Furthermore, for the contrastive learning task, the fault features corresponding to each group of clustered data are fused based on the Hadamard product, and then the process of calculating the loss function based on the features obtained by the feature fusion method includes:

[0037] Suppose the features extracted from each sample in the four cluster group data are:

[0038]

[0039] Among them, m' represents the dimension of extracting feature information;

[0040] The features extracted from the four cluster group data are:

[0041]

[0042] Among them, the superscript of the element g represents the data group, the subscript represents the number of samples, each element in G1 is f1 corresponding to a sample, and each g in G2, G3, and G4 is a feature extracted from a sample;

[0043] G1 and G2 are fused to obtain U1, and G3 and G4 are fused to obtain U2;

[0044]

[0045] Then U1 and U2 are respectively passed through the multi-layer perceptron network to obtain Z (1) , Z (2) Two feature maps are recorded as two views; the different grouping data of the same sample in the two views are regarded as positive samples. and are different grouping data in the same sample, they are positive samples to each other; other samples are regarded as negative samples. and They are each other’s negative samples, i≠j;

[0046] The contrastive loss function for the contrastive learning task is as follows:

[0047]

[0048] Among them, sim(.) represents cosine similarity and τ represents temperature parameter.

[0049] Furthermore, the total loss composed of the loss functions of the classification task and the contrastive learning task is as follows:

[0050] L=λ·L categ +(1-λ)·L cl

[0051] Among them, λ is the weight, L categ It is the loss function corresponding to the fault category classification task.

[0052] Furthermore, the Pearson correlation coefficient between each pair of sensor data in the sample is calculated as follows:

[0053]

[0054] in, represents the value of sensor a at the i-th moment in the n-th sample, represents the value of sensor b at the i-th moment in the n-th sample, m is the number of sensors, and N is the number of samples; represents the Pearson correlation coefficient between the a-th sensor data and the b-th sensor data in the n-th sample, d represents the dimension of the vector, and They represent the mean of the a-th sensor data and the b-th sensor data respectively.

[0055] A method for energy internet fault diagnosis based on data fusion adopts an energy internet fault diagnosis model to perform energy internet fault diagnosis. The energy internet fault diagnosis model is an energy internet fault diagnosis model trained according to a method for training an energy internet fault diagnosis model based on data fusion.

[0056] Beneficial effects:

[0057] The present invention proposes a multi-task convolutional model based on hierarchical clustering and multi-head attention, which clusters the original data through a novel HC model, merges similar data, and reduces redundant data, which can effectively reduce the training time of the model and improve the efficiency of fault diagnosis. In addition, the present invention also effectively extracts fault features by fusing one-dimensional convolution and multi-head attention models, enhances data understanding and sequence dependency capture, accelerates training and improves generalization capabilities, and accurately fuses features through Hadamard products, significantly optimizing the processing effect of complex tasks, thereby improving the model training effect and improving the prediction accuracy of the model. In addition, the present invention also proposes a multi-task deep learning framework based on which comparative learning tasks are introduced, so that the model can improve the training effect of the model even when there are fewer training samples, and use the model to achieve a higher diagnostic accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 This is the HCMHC model framework diagram.

[0059] Figure 2 This is a schematic diagram of data level fusion.

[0060] Figure 3 The grouping results of hierarchical clustering on dataset 2.

[0061] Figure 4 Feature extraction model based on 1DCNN and multi-head attention.

[0062] Figure 5 For the New England system, which has 39 buses and 10 generators.

[0063] Figure 6 This is the accuracy curve of model training and verification on dataset I.

[0064] Figure 7 Loss curves for model training and validation on dataset I.

[0065] Figure 8 is the total loss curve of the model on dataset I.

[0066] Fig. 9 Comparison results of different models on dataset 1.

[0067] Fig.10 Comparison results of different models on dataset 2.

[0068] Fig.11 This is the result of the ablation experiment on the model on dataset 1.

[0069] Fig.12 The results of the ablation experiment of the model on dataset 2.

[0070] Fig.13 The experimental results of the model with and without contrastive learning in the training set and validation set ratio of dataset 1.

[0071] Fig.14 The experimental results of the model with and without contrastive learning in the training set and validation set ratio of dataset 2.

[0072] Fig.15 Is the confusion matrix of different models (multi-task deep learning models) on dataset 1.

[0073] Fig.16 Is the confusion matrix of different models (multi-input convolutional models) on dataset 1.

[0074] Fig.17 This is the t-SNE effect diagram of different models (multi-task deep learning model) on dataset 1.

[0075] Fig.18 This is the t-SNE effect diagram of different models (multi-input convolutional model) on dataset 1. DETAILED DESCRIPTION

[0076] In view of the problems that the data fusion model based on deep learning in related work ignores the repeatability of the data set, the extraction of fault features is not comprehensive enough (it cannot effectively capture the long-distance dependencies in the sequence), and the accuracy is poor when the training samples are insufficient, the present invention proposes the HCMHC model (Hierarchical Clustering and Multi-Headattention Convolutional neural network model), that is, the multi-task convolution model HCMHC of hierarchical clustering HC (HierarchicalClustering) and multi-head attention, which clusters the original data through a novel HC model, merges similar data, and reduces redundant data, which can effectively reduce the training time of the model and improve the fault diagnosis efficiency. In addition, by introducing the comparative learning task, the training effect of the model can be improved when the training samples are low, and the model can achieve a higher diagnostic accuracy. The present invention is further described below in conjunction with the specific implementation method. Before the specific description, the parameters and definition descriptions are first given, as shown in Table 1.

[0077]

[0078]

[0079] Specific implementation method 1: Combination Figure 1 To explain this embodiment,

[0080] This implementation is an energy Internet fault diagnosis method based on data fusion, which includes the following steps:

[0081] S100, clustering the original data through the HC model, merging similar data, reducing redundant data, and improving fault diagnosis efficiency;

[0082] S200, a feature extraction module based on 1DCNN and multi-head attention extracts deeper and richer fault features from multi-sensor data; the 1DCNN is a one-dimensional convolutional network;

[0083] S300, multiplying the corresponding positions of the features by Hadamard product to achieve fine-grained feature fusion;

[0084] S400, introduce contrastive learning tasks to train the model, extract more complementary fault features by comparing the differences between different fault categories, and then use the trained model to perform fault diagnosis.

[0085] in,

[0086] S100, the process of clustering the original data by using the HC model includes the following steps:

[0087] Using data from multiple sensors to diagnose faults can be more reliable than using data from a single sensor, so the present invention constructs a data set from data collected by multiple sensors. However, different sensor data contain redundant information, which reduces the training efficiency of the model and requires more memory. Data-level fusion based on the HC model, such as Figure 2 As shown, the HC model is used to group sensors with high correlation together and separate sensors with weak correlation. In order to treat sensor information in the same group equally, multiple similar sensor data are replaced by calculating the average value. The specific process includes the following steps:

[0088] First, the Pearson correlation coefficient between each pair of sensor data in the sample is calculated, as shown in formula (1):

[0089]

[0090] in, represents the value of sensor a at the i-th moment in the n-th sample, represents the value of sensor b at the i-th moment in the n-th sample, m is the number of sensors, and N is the number of samples; represents the Pearson correlation coefficient between the a-th sensor data and the b-th sensor data in the n-th sample, d represents the dimension of the vector, and They represent the mean of the a-th sensor data and the b-th sensor data respectively.

[0091] Then the Pearson correlation coefficient matrix is ​​formed by the Pearson correlation coefficients between the sensor data, as shown in formula (2):

[0092]

[0093] Among them, S n (a, b) represents the Pearson correlation coefficient matrix of the samples, N represents the number of samples, and m represents the number of sensor data in the samples.

[0094] Then, hierarchical clustering is performed based on the obtained correlation coefficient matrix. Considering that the correlation coefficient matrix obtained for each sample is different, the grouping results are also different, which increases the difficulty of model training. In order to solve this problem, the median of the corresponding position of the correlation coefficient matrix obtained by calculation for each sample is taken to form a new matrix M(a,b)∈R m×m , as shown in formulas (3) to (5):

[0095]

[0096] m a,b =median(v a,b) (4)

[0097] M(a,b)=[m a,b ]∈R m×m ,a,b=1,…m (5)

[0098] Where m represents the number of sensors, N represents the number of samples, and v a,b represents the vector composed of the Pearson correlation coefficient between the a-th sensor data and the b-th sensor data in all samples; median(·) represents the median, m a,b represents the median of the Pearson correlation coefficient between the a-th sensor data and the b-th sensor data in all samples, and M(a,b) represents the new matrix after the median calculation.

[0099] The median is chosen to construct a new matrix because it is insensitive to extreme values ​​and noise and has strong noise resistance and robustness. When the data distribution is asymmetric or there are outliers, the median can more accurately reflect the central trend of the data and avoid the significant impact of extreme values ​​on the results. In addition, the median can retain the local characteristics of each sample matrix, better reflect the overall trend, and make the model training more stable and reliable.

[0100] Finally, based on the matrix composed of medians, the HC algorithm is used to sample the sensors to obtain the final clustering result. The HC algorithm is a hierarchical clustering algorithm. When the HC algorithm is used for grouping, the optimal number of clusters needs to be determined. The present invention determines the number of clusters in the HC step by maximizing cluster separation, as shown in formula (6):

[0101]

[0102] Among them, d b It represents the minimum distance between any two clusters in the bth (b≥1)th step of the HC step; Indicates d b+1 -d b The maximum corresponding iteration step, in the iteration step The total number of clusters generated in is the desired number of clusters.

[0103] from Figure 3 As can be seen in the figure, the number of clusters is set to 4 in this implementation. The HC algorithm achieves data compression and reduces redundant data; it also reflects data-level fusion. In other words, by dividing the data into 4 groups, the complexity of the data is effectively reduced, and similar data points are grouped together, thereby reducing redundant information. This HC model helps to extract key features from the data and present them in a more compact form for further analysis and utilization.

[0104] S200, the process of extracting fault features from multi-sensor data by the feature extraction module based on 1DCNN and multi-head attention includes:

[0105] For each cluster group data, feature extraction is performed based on 1DCNN (1-Dimensional Convolutional Neural Network) and multi-head attention feature extraction modules. First, 1DCNN is used to extract deeper fault features from the input data, and then the extracted features are input into the multi-head attention model to assign higher weights to similar features and lower weights to irrelevant features, thereby extracting more prominent fault features and improving diagnostic accuracy. The multi-head attention model can extract diversified features by learning fault information in different representation spaces and capture richer fault feature information.

[0106] The 1DCNN model includes multiple convolutional units, such as Figure 4 As shown, each convolution unit includes a convolution layer and a pooling layer, wherein the convolution layer is sent to the pooling layer after the activation function; the specific structure adopted by the 1DCNN model in this embodiment is: first, the first convolution layer has 32 channels and a convolution kernel size of (1, 2), followed by a pooling layer. Then there is the second convolution layer with 64 channels and a convolution kernel size of (1, 129), followed by another pooling layer. Finally, there is a convolution layer with 192 channels and a convolution kernel size of (1, 29). This structure can effectively extract and compress features in the data. Assume that the input of the lth convolution layer is x∈R d , the output of the model is shown in formula (7):

[0107]

[0108] in, Represents the input feature of the kth convolution kernel of the lth convolution layer, represents the feature extracted by the kth convolution kernel of the lth convolution layer, and K′ represents the number of convolution kernels. In the convolution operation, the convolution step size 1 and zero padding are applied, so

[0109] The output of the pooling layer is shown in formula (8):

[0110]

[0111] After obtaining the features extracted by 1DCNN, it is expressed as Z = [z1, z2, …, z K′ ], where z1,z2,…,z K′ is an element in Z; the feature Z extracted by 1DCNN is input into the multi-head attention network as shown in formula (9):

[0112]

[0113] in, is the linear transformation matrix in the attention mechanism;

[0114] The output of the multi-head attention is formed by concatenating K′ features as follows, as shown in formula (10):

[0115] MultiHead(Z Q ,Z K ,Z V )=Concat(Attention1,…,Attention K′ ) (10)

[0116] Then, the final result of the feature extraction model is shown in formula (11):

[0117] MHA=MultiHead(Z Q ,Z K ,Z V )W O (11)

[0118] Among them, W O Linear transformation matrix in attention mechanism;

[0119] S300, the process of multiplying the corresponding positions of the features by Hadamard product to achieve fine-grained feature fusion includes:

[0120] Suppose the features extracted from the four cluster group data are:

[0121]

[0122] Among them, m' represents the dimension of extracting feature information;

[0123] The calculation of fusion features is shown in formula (12):

[0124] f= f1⊙f2⊙f3⊙f4=[f1,f2,...,f m' ]∈R m′ (12)

[0125] Where ⊙ represents the Hadamard product.

[0126] The extracted features are fused in a fine-grained manner using the Hadamard product. The effective fusion of features can greatly improve the accuracy of fault diagnosis.

[0127] S400, in actual use, a multi-layer perceptron (MLP) is used to obtain the final representation, and then a classifier is used to classify energy Internet fault diagnosis. Before actual use, the feature extraction module based on 1DCNN and multi-head attention and MLP need to be trained. There are two learning tasks in the training model of the present invention, including a fault category classification task and a comparative learning task.

[0128] A. Introducing contrastive learning tasks, the process of extracting more complementary fault features by comparing the differences between different fault categories includes:

[0129] Contrastive learning is introduced into fault diagnosis. By bringing positive samples closer and negative samples further away, the model fuses similar fault features and distinguishes different fault features, thereby extracting more complementary information. In addition, the introduction of contrastive learning solves the problem of insufficient training samples in the real world. Good embedding effects can also be achieved without sample labels or with only a small number of sample labels. The feature extraction module based on 1DCNN and multi-head attention extracts features from four sets of data respectively, performs feature fusion to form two views, and feeds these two views into the multi-layer perceptron machine MLP to obtain the final representation. Sensors from the same sample in the two views are defined as positive samples, and other samples are defined as negative samples.

[0130] First, the features are extracted from the four sets of data.

[0131]

[0132] In fact, the superscript of g indicates the data group, and the subscript indicates the number of samples. Each corresponding g in is actually the f1 corresponding to a sample. Each g in the equation is actually the f2 corresponding to a sample. Each g in the equation is actually the f3 corresponding to a sample. Each corresponding g in is actually the f4 corresponding to a sample.

[0133] G1 and G2 are fused to obtain U1, and G3 and G4 are fused to obtain U2;

[0134]

[0135] U1 and U2 are respectively obtained through the multi-layer perceptron network. (1) ,Z (2) Two views (two views are sets of data features of different groups of all samples), as shown in equations (15) and (16):

[0136] Z (1)=MLP(U1)∈R N×m' (15)

[0137] Z (2) =MLP(U2)∈R N×m' (16)

[0138] Among them, N represents the number of samples, and m' represents the dimension of extracting feature information.

[0139] The different grouping data of the same sample in the two views are regarded as positive samples. and are different grouping data in the same sample, so they are positive samples to each other; other samples are regarded as negative samples, that is, and They are each other’s negative samples, i≠j, and then the contrast loss is constructed as shown in formula (17):

[0140]

[0141] Among them, sim(.) represents cosine similarity, τ represents the temperature parameter, and the smaller the value of τ is, the greater the distance between negative samples is under the constraint of the loss function.

[0142] B. Complementary features are based on different features. The contrastive learning model integrates similar fault features by pulling positive samples closer and pushing negative samples farther away, distinguishing different fault features, and thus extracting more complementary fault information. The fault category classification task makes the extracted features more effective for fault diagnosis. These two tasks work together to make the fault features more complementary. By fusing these more complementary fault features together, the accuracy of fault diagnosis will be greatly improved.

[0143] The softmax function is used for fault classification. The feature vector f=[f1,f2,...,f m' ]∈R m′ , sent to the MLP network, for the convenience of representation, the MLP network output features are still represented by f1,f2,...,f m' Represented, then the formula of the softmax function is shown in formula (18):

[0144]

[0145] The fault category classification task uses the cross entropy loss function to calculate the classification error, as shown in formula (19):

[0146]

[0147] in, represents the true label of the i-th fault category, represents softmax(f i )

[0148] The present invention proposes a multi-task model, so the total loss of the model consists of two parts: contrast loss and classification loss. The calculation of the total loss is shown in formula (30):

[0149] L=λ·L categ +(1-λ)·L cl (20)

[0150] The model focuses more on the accuracy of the classification task and sets the value of λ to 0.65.

[0151] The model is trained based on the total loss to obtain a trained energy internet fault diagnosis model. In actual use, the trained energy internet fault diagnosis model is used to perform energy internet fault diagnosis classification.

[0152] Example

[0153] The experiments were conducted on the New England test system, which has 39 buses and 10 generators. Figure 5 shown.

[0154] 1. Dataset description:

[0155] The present invention uses two data sets for experimental verification. Data set 1 consists of voltage data of 39 buses, and data set 2 consists of current data of 10 generators. Both data sets include 1000 samples, each sample is generated within 5 seconds, and each sensor data has 512 dimensions. The data is normalized before input into the model to obtain accurate and reliable data. The data is divided into normal data and four types of fault data. Fault types include: generator fault, short circuit fault, switch fault and load fault, as shown in Table 2.

[0156] Table 2 Fault types, labels and number of samples for each fault type

[0157]

[0158]

[0159] 2. Data preprocessing

[0160] The data set may contain invalid, duplicate, erroneous data and missing data, resulting in poor data quality and low training accuracy. Data preprocessing can make the data in the data set more accurate and reliable. The data is processed using a standardized method, as shown in formula (20):

[0161]

[0162] Among them, x 均值 、x 标准差 represent the mean and standard deviation of sample x respectively.

[0163] The model of the present invention is verified on Dataset 1 and Dataset 2. The present invention only shows the training and verification results of the model on Dataset 1. Figure 6-Figure 8 The training and validation accuracy, training and validation loss, and total loss of the model are displayed. It can be seen that after 13 rounds of training, the training accuracy and validation accuracy are close to 1; the training and validation loss are very close to 0; and the total loss of the model decreases steadily and tends to 0.

[0164] In order to evaluate the impact of multi-sensor data fusion model on the performance of energy Internet fault diagnosis, the classification accuracy of single sensor (i.e., sensor 1-4) and multi-sensor data, as well as the data-level and feature-level fusion model accuracy of multi-sensors are compared on two datasets. Tables 3 and 4 provide the diagnosis results using different sensors on datasets 1 and 2, respectively. It can be observed that for the same model, using multi-sensor data can identify faults more accurately than single sensor data, and the feature-level fusion model has a higher accuracy than the data-level fusion model.

[0165] Table 3 Accuracy of single sensor and multi-sensor on dataset 1

[0166] sensor Accuracy / % Sensor 1 98.5 Sensor 2 94.0 Sensor 3 93.8 Sensor 4 98.5 Multi-sensor (data level fusion) 99.0 Multi-sensor (feature-level fusion) 99.8

[0167] Table 4 Accuracy of single sensor and multi-sensor on dataset 2

[0168] sensor Accuracy / % Sensor 1 94.0 Sensor 2 92.5 Sensor 3 94.0 Sensor 4 97.0 Multi-sensor (data level fusion) 98.8 Multi-sensor (feature-level fusion) 99.5

[0169] On these two datasets, the proposed model was compared with the neural network model: MLP; deep learning models: 1DCNN-Simple concatenate (1-Dimensional Convolutional Neural Network based Simpleconcatenate), MI-CNN, GCN-FA, 2DCNN, CWCNN-FA, LeNet5-MDFM (LeNet5-basedMultisensory Data Fusion Model). The results of dataset 1 and dataset 2 are shown in Figure 2. Figure 9-10 As shown in the results, it can be found that the model of the present invention performs best among all the compared models.

[0170] In order to demonstrate the robustness of the proposed model, experiments were conducted with other models on sensor data of different dimensions, as shown in Table 5. The classification results obtained on datasets 1 and 2 are shown in Tables 6 and 7. It can be observed that the accuracy of all models generally decreases with decreasing dimensionality. However, on data of different dimensions, the accuracy of the proposed model is much higher than that of other models.

[0171] Table 5 Data dimensions and corresponding labels

[0172] Data Dimensions Label Original data dimensions A 75% of the original data dimensions B 50% of the original data dimensions C 25% of the original data dimensions D 5% of the original data dimension E

[0173] Table 6 Accuracy of the proposed model and the comparative model in different data dimensions on dataset 1

[0174]

[0175]

[0176] Table 7 Accuracy of the proposed model and the comparative model in different data dimensions on dataset 2

[0177]

[0178] Ablation experiment:

[0179] In order to demonstrate the importance of each module in the model of the present invention, ablation experiments were conducted on two datasets. Figure 11-Figure 12 It can be seen that the accuracy of HCMHC on datasets 1 and 2 is 99.8% and 99.5% respectively; the accuracy of removing the data-level fusion module based on hierarchical clustering is 95.3% and 95.8% respectively; the accuracy of removing the multi-head attention module is 97.7% and 96.8% respectively, and the accuracy of removing the contrastive learning module is 99.3% and 98.9% respectively; the accuracy of removing the feature fusion module of Hadamard product is 99.5% and 98.5% respectively. It can be observed that the accuracy of the model will decrease in the absence of any component.

[0180] In order to prove that even with a small number of training samples, the introduction of the contrastive learning model can enable the model to achieve a higher accuracy, experiments were conducted on Dataset 1 and Dataset 2, respectively, with the training / test sets divided into 80 / 20, 60 / 40, 50 / 50, 40 / 60, and 20 / 80 ratios. Figure 13-14 It can be seen that with the reduction of training samples, the accuracy of the model with contrastive learning and without contrastive learning decreases, but the accuracy of the model introducing contrastive learning task is higher, which proves that the model of the present invention has a high accuracy even with a small number of training samples, and also proves the robustness of the model.

[0181] To further demonstrate the performance of the model of the present invention, a multi-class confusion matrix is ​​used on Dataset 1 to visualize the classification accuracy of the two models. Figure 15-16 It can be seen that the classification accuracy of the HCMHC model is higher than that of the MI-CNN model.

[0182] In order to further demonstrate the performance of the proposed model in maintaining the interaction relationship between different sensors, t-distributed Stochastic Neighbor Embedding (t-SNE) is used on dataset 1.

[30] Visualize the characteristics of the two models and analyze the results. Figure 17-Figure 18 It can be seen that MI-CNN is coupled between different sensor fault features, while HCMHC shows good separability between different fault features. It can be concluded that the HCMHC deep learning model is an effective multi-sensor data fusion and separation method that can fully maintain the interactive relationship between different sensors.

[0183] The above calculation examples of the present invention are only used to explain the calculation model and calculation process of the present invention in detail, and are not intended to limit the implementation methods of the present invention. For ordinary technicians in the relevant field, other different forms of changes or modifications can be made based on the above description. It is impossible to list all the implementation methods here. All obvious changes or modifications derived from the technical solution of the present invention are still within the scope of protection of the present invention.

Claims

1. A method for training an energy internet fault diagnosis model based on data fusion, characterized in that: include: First, the original data is clustered using the HC model. The specific process includes: Construct a dataset from data collected by multiple sensors; calculate the Pearson correlation coefficient between each pair of sensor data in the sample n represents the nth sample, a and b represent any two sensors among the multiple sensors; Then, based on the correlation coefficient matrix corresponding to the obtained correlation coefficients, the matrix composed of the medians of the sensor data is determined: m a,b =median(v a,b ) (4) M(a,b)=[m a,b ]∈R m×m ,a,b=1,…m (5) Where m represents the number of sensors, N represents the number of samples, and v a,b represents the vector composed of the Pearson correlation coefficient between the a-th sensor data and the b-th sensor data in all samples; median(·) represents the median, m a,b represents the median of the Pearson correlation coefficient between the a-th sensor data and the b-th sensor data in all samples, and M(a,b) represents the new matrix after the median calculation; Based on the matrix composed of medians, a hierarchical clustering algorithm is used to cluster and obtain multiple groups of cluster data; for each group of cluster data, a feature extraction module is used to extract fault features; For the classification task and contrastive learning task, the fault features corresponding to each group of clustered data are fused based on the Hadamard product, and then the loss function is calculated based on the features obtained by the feature fusion method; the total loss composed of the loss functions of the classification task and contrastive learning task is used to realize the training of the energy Internet fault diagnosis model; The energy internet fault diagnosis model includes a feature extraction module part and a network module part in the classification task.

2. According to the data fusion-based energy internet fault diagnosis model training method of claim 1, it is characterized in that: The feature extraction module is a feature extraction module based on a 1DCNN network and a multi-head attention network. The 1DCNN network includes multiple convolution units, each of which includes a convolution layer and a pooling layer. The convolution layer is sent to the pooling layer after passing through an activation function.

3. According to the data fusion-based energy internet fault diagnosis model training method of claim 2, it is characterized in that: The 1DCNN network consists of three convolutional units. The convolutional layers in the three convolutional units are as follows: The first convolution layer has 32 channels and a convolution kernel size of (1, 2). The second convolution layer has 64 channels and a convolution kernel size of (1, 129). The last convolution layer has 192 channels and a convolution kernel size of (1, 29).

4. According to the data fusion-based energy internet fault diagnosis model training method of claim 1, it is characterized in that: In the process of clustering multiple groups of cluster data using the hierarchical clustering algorithm, the hierarchical clustering algorithm is used to cluster the data into 4 groups of cluster data.

5. According to the data fusion-based energy internet fault diagnosis model training method of claim 4, it is characterized in that: For the classification task, the fault features corresponding to each group of clustered data are fused based on the Hadamard product, and then the process of calculating the loss function based on the features obtained by the feature fusion method includes: Suppose the features extracted from each sample in the four cluster group data are: Among them, m' represents the dimension of extracting feature information; The calculation of fusion features is as follows: f= f1⊙f2⊙f3⊙f4=[f1,f2,…,f m' ]∈R m′ (12) Where, ⊙ represents the Hadamard product; The fused feature f is sent to the MLP network, and then the energy Internet fault diagnosis type recognition result is obtained through the softmax function; The fault category classification task uses the cross entropy loss function L categ Calculate the classification loss.

6. According to the data fusion-based energy internet fault diagnosis model training method of claim 5, it is characterized in that: The cross entropy loss function used for the fault category classification task is as follows: in, represents the true label of the i-th fault category, Represents the probability of energy Internet fault diagnosis type calculated by the softmax function.

7. According to the data fusion-based energy internet fault diagnosis model training method of claim 4, it is characterized in that: For the contrastive learning task, the fault features corresponding to each group of clustered data are fused based on the Hadamard product, and then the process of calculating the loss function based on the features obtained by the feature fusion method includes: Suppose the features extracted from each sample in the four cluster group data are: Among them, m' represents the dimension of extracting feature information; The features extracted from the four cluster group data are: Among them, the superscript of the element g represents the data group, the subscript represents the number of samples, each element in G1 is f1 corresponding to a sample, and each g in G2, G3, and G4 is a feature extracted from a sample; G1 and G2 are fused to obtain U1, and G3 and G4 are fused to obtain U2; Then U1 and U2 are respectively passed through the multi-layer perceptron network to obtain Z (1) , Z (2) Two feature maps are recorded as two views; the different grouping data of the same sample in the two views are regarded as positive samples. and are different grouping data in the same sample, they are positive samples to each other; other samples are regarded as negative samples. and They are each other’s negative samples, i≠j; The contrastive loss function for the contrastive learning task is as follows: Among them, sim(.) represents cosine similarity and τ represents temperature parameter.

8. The method for training an energy internet fault diagnosis model based on data fusion according to claim 7 is characterized in that: The total loss composed of the loss functions of the classification task and the contrastive learning task is as follows: L=λ·L categ +(1-λ)·L cl Among them, λ is the weight, L categ It is the loss function corresponding to the fault category classification task.

9. The method for training an energy internet fault diagnosis model based on data fusion according to claim 1 is characterized in that: Calculate the Pearson correlation coefficient between each pair of sensor data in the sample as follows: in, represents the value of sensor a at the i-th moment in the n-th sample, represents the value of sensor b at the i-th moment in the n-th sample, m is the number of sensors, and N is the number of samples; represents the Pearson correlation coefficient between the a-th sensor data and the b-th sensor data in the n-th sample, d represents the dimension of the vector, and They represent the mean of the a-th sensor data and the b-th sensor data respectively.

10. An energy Internet fault diagnosis method based on data fusion, characterized in that: An energy internet fault diagnosis model is used to perform energy internet fault diagnosis, wherein the energy internet fault diagnosis model is an energy internet fault diagnosis model trained according to an energy internet fault diagnosis model training method based on data fusion according to any one of claims 1 to 9.