Fine-grained partial discharge pattern recognition method based on substation equipment knowledge graph

Discharge-type faults are one of the main types of faults in substation equipment, and partial discharge (PD) faults are an important cause of equipment discharge faults. When different types of PD faults occur in equipment, their fault handling plans also vary accordingly. Therefore, the identification of PD types in equipment is very important. Aiming at the problem that the recognition accuracy of the existing methods is not high enough due to the low quality of PD data and unbalanced samples in the process of equipment PD pattern recognition, we propose a fine-grained method to recognize PD patterns based on substation equipment knowledge graph. This model combines a visual encoder with a knowledge graph and uses the fine-grained attribute features and the association feature information of the PD entity provided by the knowledge graph for the research of equipment PD pattern recognition. After experimental verification, the accuracy of PD pattern recognition in our proposed method is significantly higher than that of previous methods.


Introduction
Substation equipment, in its manufacturing or long-term work process, will inevitably produce some security risks, which may lead to various forms of partial discharge (PD) [1].Although PD will not immediately lead to the overall breakdown of equipment insulation, it will seriously endanger the life of equipment insulation.If the fault continues to develop, it will cause a large-scale blackout of the power grid.The phase-resolved partial discharge (PRPD) patterns can visually represent the relationship between the power frequency phase φ, the discharge amount q, and the discharge number n corresponding to the PD pulse by the image, which makes the identification of the PRPD patterns an important means to diagnose the type of insulation defect [2].
In order to improve the accuracy of PD fault pattern recognition in substation equipment, a large number of scholars have conducted research in this field.The traditional PD pattern recognition is mainly based on manually extracting the feature vector of the spectrum and then realizing the recognition of the spectrum through the machine learning model [3] [4].The problem with this method is losing the original information of PD patterns, so the accuracy and robustness of spectrum recognition are relatively low.
With the development of computer technology, the new generation of artificial intelligence technology represented by deep learning has been widely used.This method can automatically learn sample features from massive data and realize the mining of deep information of the data.For the identification of PD patterns, the effect of the deep learning method is significantly better than that of the traditional feature selection method based on artificial.For example, Firuzi et al. [5] automatically extracted the PD characteristics based on the histogram of the oriented gradient and then input it into the support vector machine for pattern recognition.In [6], the feature extraction and pattern recognition of PRPD grayscale images are directly performed by a convolutional neural network.However, this PD pattern recognition method has the problem of poor interpretability, which limits its widespread application.
Therefore, we propose a PD pattern recognition method based on substation equipment knowledge graph enhanced vision transformer (SEKGViT), which combines knowledge graph with computer vision technology to improve the accuracy and interpretability of PRPD pattern recognition.At the same time, the knowledge graph we constructed can be used as the knowledge base basis for downstream applications such as fault information retrieval and intelligent recommendation of substation equipment.It can be effectively applied to equipment operation and maintenance decisionmaking, fault reasoning, and so on [7][8].

PD experiment
The common PD types of substation equipment include point discharge, bubble discharge, surface discharge, and suspended discharge.Due to the rarity of multiple types of partial discharge faults occurring simultaneously in substations, this study obtained PD signal data by means of laboratory simulation.The designed PD model is shown in Figure 1, and the experimental circuit wiring is shown in Figure 2.  Due to the complex electromagnetic environment and high electromagnetic noise of substation equipment in practical engineering, in order to increase the complexity of samples, simulated noise was manually added to the PRPD patterns.

Ontology layer and entity layer construction
The structure of a knowledge graph can typically be categorized into two layers: the pattern layer and the data layer.The pattern layer, also referred to as the ontology layer, serves as a descriptive framework for entities and their relationships.On the other hand, the data layer, also known as the entity layer, stores the entity and relationship information that corresponds to the ontology layer.The information within both layers is often represented in the form of 'entity-relation-entity'.In this study, the Selenium framework was used to obtain the open knowledge corpus of substation equipment operation and maintenance literature, including more than 1000 technical literature related to substation equipment, more than 500 accident reports of substation equipment operation and maintenance, and a total of about 1.2 million words.The contents include fault diagnosis methods of substation equipment, fault operation and maintenance schemes of substation equipment, etc.Under the guidance of domain experts in the field of electric power, a comprehensive analysis of the corpus is conducted.This analysis involves an in-depth examination of the text corpus to extract entity information and their relationships.Based on this analysis, the ontology layer is constructed, ensuring that it captures and represents the key concepts and their connections within the domain of electric power.To construct the entity layer of a knowledge graph, natural language processing technology is employed to extract entities from a vast amount of unstructured and semi-structured text data generated during the operation, maintenance, and daily management of substation equipment.These extracted entities are then populated into the constructed ontology, enriching the knowledge graph with relevant information from the field.

Knowledge graph construction method of substation equipment
Some of the main methods for constructing knowledge graphs include knowledge-driven top-down, data-driven bottom-up, and a combination of the two.
Under the guidance of experts in the electric power field, this study refines text information from the corpus to form ontology concepts like equipment models, components, faults, attributes, test methods, protection methods, and their interrelationships for constructing the ontology layer.

Traditional feature extraction module
SEKGViT combines color features and outline features as traditional manual feature vectors.For each input PRPD pattern, the color moment is used as the image color representation, defined as fc.The outline features fo are extracted based on edge detection algorithms.The final traditional features fMF are obtained by concatenating the above two features:

Substation equipment knowledge graph embedding
This study utilizes graph attention networks (GAT) [9] to map the substation equipment knowledge graph into neural network modules that can be trained.GAT  The training of knowledge graph embedding includes two steps: first, the labels of the input PRPD pattern are indexed in the knowledge graph to obtain the attribute feature vectors of the corresponding nodes of this type of PD fault in the knowledge graph, denoted as fCF.Then, cosine similarity calculation with manual feature vectors is performed to obtain similarity loss Ls: In the equation, k represents the dimension of the feature vector, which is equal to the total number of PD categories.fMFi represents the i-th component of the manual feature vector fMF, and fCFi represents the i-th component of the attribute feature vector fCF.Equation ( 2 loss Ls, which aims to measure the similarity between manual feature vectors and attribute feature vectors in the knowledge graph.During the training process, it is hoped to minimize the loss of similarity in order to make the manual features more consistent with the attribute features in the knowledge graph.
During testing, the manual feature vectors of each PRPD pattern are used to calculate cosine similarity with the feature vectors corresponding to all nodes representing PD categories in the substation equipment knowledge graph and combine them to obtain attribute similarity feature vectors fCL.

PRPD pattern high-level semantic representation extraction network ViT
ViT [10] is an image classification model proposed by the Google team in 2020.By introducing the Transformer mechanism in visual tasks, ViT has demonstrated good performance and scalability and is now widely used in various visual tasks.This study uses ViT as the backbone network for extracting high-level semantic representation information from images.
For input image X∈R H×W×C .The height, width, and number of channels are H, W, and C, respectively.ViT will first segment them into multiple sub-blocks and flatten them into a onedimensional input sequence.Make the block size P×P.Then, the sequence of sub-blocks is represented as: In the equation, N represents the number of sub-blocks.Next, each sub-block is projected into a vector of fixed length D and input it into the Transformer encoder, resulting in the following: Embedding special characters CLS at the head of the sequence transforms the visual problem into a seq2seq problem.After position encoding, layer normalization, and dimensional transformation by multi-layer perceptron, the final image representation output vector is obtained, denoted as fSF.

Classifier
SEKGViT combines image attribute features extracted from knowledge graphs with high-level semantic representation features extracted from ViT for training classifiers.The fused features ftrain and ftest during training and testing are represented as: The classifier consists of a fully connected network and a Softmax function.The input is the PRPD patterns feature vector ftrain or ftest, and the output is the PD category.The model loss L is represented by the cross entropy loss function Lc and the cosine loss function Ls: L c =-∑ y i lg p y i i (7) L=L c -L s (8) In the equation, yi and ˆi y represent the true and predicted labels of the input pest image, respectively, while ∋ ( p y represents the prediction probability of ŷ .

Training process of the model
The method and principle for training the model are as follows: The knowledge graph provides advanced information about PD for the model through a structured representation of domain knowledge.Using GAT to encode the knowledge graph, a feature vector is generated for each concept node.These feature vectors can be considered as attribute features of the PD category.
2) High-level semantic representation feature extraction.High-level semantic representation features are extracted from PRPD spectra using ViT.ViT divides the image into fixed-size blocks and linearly embeds them into the feature space, then applies a Transformer structure for feature extraction.In this way, ViT can capture global contextual information in the image, thereby generating feature representations with high-level semantics.
3) Training phase.The PD attribute features extracted from the knowledge graph are integrated with the high-level semantic representation features extracted from ViT. Fusion is achieved through feature addition operations.The fused feature vector contains attribute information on PD and advanced semantic information on PRPD patterns, which can better represent the category of PD and improve classification performance.This can further guide the model to focus on features related to the target category and reduce the impact of background noise.

Dataset and model training
1000 PRPD patterns of 4 types of PD defects were obtained from experiments.200 PRPD patterns are randomly selected for each type of PD defect to form a test set with a total of 800 patterns, while the remaining 3200 patterns are used to train the pattern recognition model.
The SEKGViT model proposed in this article adopts a two-layer GAT network with an MLP hidden layer dimension of 16, and an attention head Z set to 4. ViT uses default parameter configuration.Before inputting the image into the network for feature extraction, the spatial scale is ensured to be 224×224 through scaling operations.The training round is set to 100, and the learning rate is 0.001.The training is conducted on a computer equipped with Nvidia RTX 4080 GPU and Intel Core i7 13700KF CPU.

Comparison of pattern recognition performance of different models
To verify the superiority of the SEKGViT method we proposed, the same training method was used to train the ordinary ViT model and the two baseline models, VGG-16 and ResNet-50, for image classification tasks, respectively.The pattern recognition performance of four models was tested, and the specific data is shown in Table 1.

SEKGViT(ours) 97.85%
From Table 1, it can be seen that the ViT model, with its global perspective and attention mechanism, can model input images in a serialized manner, enabling ViT to capture more global image features.Its pattern recognition accuracy has been improved by 2.08% and 1.72% compared to VGG-16 and ResNet-50, respectively.The SEKGViT proposed in this study further improves the recognition accuracy of ViT by 2.49% by introducing knowledge graphs to obtain detailed information about different types of PDs.

Figure 3 .
Figure 3. PRPD patterns.Due to the complex electromagnetic environment and high electromagnetic noise of substation equipment in practical engineering, in order to increase the complexity of samples, simulated noise was manually added to the PRPD patterns.
For constructing the entity layer of the substation equipment knowledge graph, entity extraction, and relationship extraction are performed based on the concepts from the ontology layer.Initially, unstructured text is labeled to create a training dataset.Then, the deep learning algorithms BERT-BiLSTM-CRF and BERT-BiLSTM-Attention are utilized to extract entities and relationships from the operation and maintenance text of substation equipment.Finally, triples are constructed and stored in the graph database.The constructed knowledge graph of substation equipment is shown in Figure 4, which includes 7246 entities and 4396 relations.

Figure 4 .
Figure 4. Substation equipment knowledge graph.4. Introduction of SEKGViT model The SEKGViT model proposed in this study adopts a two-branch structure, including equipment attribute feature and fault correlation feature extraction branch based on substation equipment knowledge graph and high-level semantic representation extraction branch of PRPD patterns based on

Figure 5 .
Figure 5. Illustration of the SEKGViT model.The segmentation of the PRPD pattern is automatically achieved by the VIT to meet the input requirements of the transformer encoder.

1 )
Image attribute feature extraction.The concept nodes in the knowledge graph and their relations are used to capture attribute information in the PRPD patterns.
is a graph neural network model proposed by VELICKOVIC et al. in 2018.It is composed of stacked graph attention layers and utilizes a self-attention mechanism to aggregate neighbor node information.By adaptively learning neighbor weights during the training process, the model has good interpretability and accuracy.
) calculates the similarity