Power grid system fault inspection method and system
By designing a multi-stage algorithm and a histogram equalization algorithm that adopts pixel gradient perception, combined with the end-to-end training strategy of comparative learning and multi-task collaboration, the problem that existing grid system fault inspection methods are difficult to achieve real-time monitoring and high accuracy on low-computing platforms is solved, and efficient, accurate detection and positioning of grid faults are achieved.
Patent Information
- Application Number
- CN202510261070.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2045-03-06
AI Technical Summary
The existing power grid system fault inspection methods rely on deep learning, and the computing power demand is high, making it difficult to realize real-time monitoring on low-computing power platforms. The lightweight detection algorithm is difficult to meet the needs of high accuracy, and it is easy to ignore special fault conditions.
A multi-stage algorithm is designed, and histogram equalization algorithm is used for pre-processing with pixel gradient perception. Combining the lightweight first-stage algorithm and the refined second-stage algorithm, it uses an end-to-end training strategy of comparative learning and multi-task collaboration to achieve fault detection, positioning and classification.
It improves the efficiency and accuracy of fault detection, realizes the refined positioning and classification of faults in complex power grid scenarios, reduces calculation overhead and promotion costs, and enhances the ability to identify unknown types of faults.
Smart Images

Figure CN119763050A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image data processing and electric power monitoring, and in particular to a method and system for inspecting faults in a power grid system. Background Art
[0002] Intelligent inspection of power facilities can efficiently monitor the real-time operation of equipment such as cable lines, and respond to various faults in a timely manner to ensure the stable operation of the power grid. Due to the wide range of power grid construction and complex environment, traditional manual inspections are difficult to meet the requirements of high efficiency and high accuracy, and face huge labor costs and time expenses. Therefore, the power grid system is gradually introducing intelligent inspection technology, which uses artificial intelligence algorithms to analyze images taken by fixed cameras or inspection drones, so as to autonomously discover faults in power facilities and notify relevant operation and maintenance personnel.
[0003] However, existing methods rely on deep learning to build detection models, which requires high computing power. It is difficult to achieve real-time monitoring on low-computing platforms, and lightweight detection algorithms are difficult to meet the requirements of high accuracy. In addition, existing methods mainly detect known types of faults and tend to ignore certain special fault conditions.
[0004] Therefore, it is urgent to develop a solution to solve the above problems. Summary of the invention
[0005] The purpose of the present invention is to provide a patrol method and system for power grid system faults. By designing a multi-stage algorithm and proposing an end-to-end training strategy based on contrastive learning and multi-task collaboration, the fault detection efficiency and accuracy are effectively improved, and the refined positioning and classification of faults in complex power grid scenarios are achieved.
[0006] The present invention provides a method and system for inspecting power grid system faults using the following technical solutions: In a first aspect, a method for inspecting a power grid system fault specifically includes: obtaining an image to be inspected of a corresponding power grid line at a current moment, extracting images of the current position at different previous moments, and images of adjacent line positions at the current moment, and preprocessing them using a pixel gradient-aware histogram equalization algorithm; Based on the preprocessed image to be detected and images in different time and space domains, a lightweight first-stage algorithm is applied to perform fault identification to determine whether the image to be detected has an abnormality; For the images to be detected with abnormalities and the corresponding images in different time and space domains, the refined second-stage algorithm is used to detect the fault location and distinguish the fault type. For the faults that are judged as unknown types, the second-stage algorithm is used to extract the features of the fault and perform cluster analysis together with the features of the unknown faults recorded in the database; A comprehensive analysis is performed based on the results of fault location detection, fault type discrimination and cluster analysis to obtain the fault condition of the image to be detected and output an inspection report to complete the intelligent inspection of the power grid fault at the current location.
[0007] Optionally, a pixel gradient-aware histogram equalization algorithm is used to pre-process the image, including: Calculate the gradient strength of each pixel in the image to be detected and generate a gradient weight map;
[0008] The image to be detected is evenly divided into image blocks along the horizontal axis and the vertical axis, and each image block is subjected to equalization processing respectively; The original and equalized images are weightedly fused based on the gradient weight map to suppress the influence of light interference while protecting the visual details, and finally the image pixel value is obtained to complete the preprocessing.
[0009] Optionally, a lightweight first-stage algorithm is applied to perform fault discrimination to determine whether the image to be detected has an abnormality. The lightweight first-stage algorithm adopts a multi-branch collaborative training strategy. The specific training strategy includes: Perform image matching and calibration on the image to be detected and the images in different time and space domains respectively: first extract the ORB feature points of the two images respectively, then match the feature points between the two images and filter out the wrong matching point pairs, and finally calculate the perspective transformation matrix mapped from the images in different time and space domains to the coordinates of the image to be detected and perform image transformation; For the image to be detected and the calibrated images in different time and space domains, three types of visual features are extracted respectively; wherein the three types of visual features include corner point features, color change features and global texture features; The three types of extracted visual features are respectively sent to a detector consisting of a convolutional layer, a fully connected layer, and an activation function layer. The detector first uses the convolutional layer to map various visual features, and then uses the fully connected layer and the activation function layer to perform a binary classification prediction based on a single visual feature to determine whether the image to be detected has an abnormality, and uses the cross entropy function to calculate the training loss; The mapped visual features are stitched together, and then the probability of a device failure in the current image to be predicted is predicted through the fully connected layer and the activation function layer, completing the lightweight first-stage algorithm.
[0010] Optionally, for the image to be detected and the calibrated images in different time and space domains, three types of visual features are extracted respectively, including: When extracting corner features, calculate the response scores of the feature points in the image to be detected and sort them in descending order, select the first K ORB feature points, and if the number of feature points in the image to be detected is less than K, fill them with vectors with all values zero; K is a natural number greater than 1; When extracting color change features, the color histograms of the image to be detected and the images in different time domains or different spatial domains are counted respectively, and the color histogram distance between the two images is calculated. When the image to be detected is an RGB image, the three color channels are counted respectively and the color histogram distance is calculated; When extracting global texture features, the correlation between corner point features is calculated pairwise, and the global texture features are constructed based on the calculation results of the correlation.
[0011] Optionally, a refined second-stage algorithm is applied to detect fault locations and identify fault types. The refined second-stage algorithm adopts an end-to-end training strategy of contrastive learning and multi-task collaboration. The specific training includes: For the input image to be detected and images in different time and space domains, the visual features are extracted by the visual encoder of the pre-trained CLIP model respectively; Constructing a text description sentence based on keywords related to power facilities, and extracting text features based on a text encoder of a pre-trained CLIP model; wherein the visual encoder and the text encoder keep parameters frozen; Based on the visual features and text features, query modeling across time and space is performed to obtain multimodal query features that simultaneously include current scene visual information and text priors related to power facilities; Applying matrix multiplication to the multimodal query feature and the visual feature to obtain a preliminary fault location mask, and sending the multimodal query feature to a classifier composed of a fully connected layer and an activation layer to obtain a fault category probability prediction distribution; Based on the preliminary fault location mask and the predicted distribution of fault category probability, the loss is calculated, a skeleton-aware positive and negative sample balance loss function is designed, and a cross-temporal and spatial contrast learning loss function is constructed based on the visual features to narrow the visual representation between the image to be detected and the images in different temporal and spatial domains, and distinguish the differences in visual representation between images in different temporal domains and different spatial domains; Based on the preliminary fault location mask combined with multimodal query features, the mask is iteratively updated until the maximum number of iterations is reached and the training is terminated, completing the refined second-stage algorithm training.
[0012] Optionally, and / or, the positive and negative sample balance loss function formula is as follows: ; ; In the formula, is the positive and negative sample balance loss, N is the number of pixels in the image, and are the number of pixels in the image that belong to positive and negative samples, respectively. and They are The true label and predicted probability distribution of pixels, is the number of pixels in the skeleton area; The formula for the contrastive learning loss function across time and space is as follows: ; ; ; ; In the formula, , and They represent the visual features extracted from the image to be detected, images in different time domains, and images in different spatial domains, respectively. is the contrastive learning loss function.
[0013] Optionally, query modeling across time and space is performed based on the visual features and text features to obtain multimodal query features that simultaneously contain current scene visual information and power facility-related text priors, including: Feature extraction obtains text features, splices the visual features of the image to be detected and the images in different time and space domains, and combines the text features and the spliced visual features based on the cross-attention mechanism to obtain multimodal query features; The formula for calculating multimodal query features is as follows: ; ; In the formula, is the query vector, is the key vector, is a value vector, , and represents the learnable weight matrix, The number of channels representing features, represents the Softmax function, Text features, It is the visual feature obtained by concatenating the visual features of the image to be detected and the images in different time and space domains. is the multimodal query feature, for The transposed matrix of .
[0014] Optionally, the mask is iteratively updated based on the preliminary fault location mask combined with the multimodal query feature until the maximum number of iterations is reached and the training is terminated, including: Based on the preliminary fault location mask and the feature application matrix of the image to be detected, a fault area feature is obtained; Based on the cross-attention mechanism, the multimodal query features are interacted with the fault area features to update the multimodal query features; The updated multimodal query features are multiplied by the feature matrix of the image to be detected to obtain an updated fault location mask. At the same time, the multimodal query features are sent to a classifier composed of a fully connected layer and an activation layer to obtain an updated fault category probability prediction distribution. The update is performed continuously until the maximum number of iterations is reached to obtain the final fault location mask and fault category probability distribution.
[0015] The beneficial effects of the inspection method for power grid system faults provided by the present invention are: (1) High detection efficiency: The present invention constructs a multi-stage detection algorithm, and the lightweight first-stage algorithm completes the rapid initial screening of a large amount of image data, thereby significantly reducing the overall computing overhead. The first-stage algorithm can be deployed on most low-computing power platforms and realize real-time detection, further reducing the promotion and application costs of the present invention. (2) High detection accuracy: The present invention designs a pixel gradient-aware equalization algorithm based on the characteristics of power grid images, which suppresses light interference while retaining key visual clues. In addition, the present invention introduces both temporal and spatial domain priors in the lightweight first-stage algorithm and designs a multi-branch collaborative training strategy, so that it has better fault detection capabilities. Then, the present invention constructs a refined second-stage algorithm, which iteratively updates the fault mask to achieve accurate detection of small-scale, irregularly shaped fault areas; (3) High robustness: The present invention introduces visual language priors into the refined second-stage algorithm and constructs an end-to-end training strategy based on contrastive learning and multi-task collaboration, thereby effectively improving the algorithm's feature modeling capabilities and its ability to detect faults in various complex environments, thereby improving the robustness of the algorithm. In addition, the present invention performs cluster analysis on unknown types of faults, which improves the practicality of the algorithm.
[0016] In a second aspect, a power grid system fault inspection system specifically includes: The image acquisition preprocessing module is used to obtain the image to be detected of the corresponding power grid line at the current moment, and at the same time extract the images of the current position at different previous moments, as well as the images of the adjacent line position at the current moment, and preprocess them using a pixel gradient-aware histogram equalization algorithm; The anomaly detection module uses a lightweight first-stage algorithm to perform fault discrimination based on the preprocessed image to be detected and images in different time and space domains to determine whether the image to be detected has an anomaly; The discriminant clustering module applies a refined second-stage algorithm to detect fault locations and discriminate fault types for abnormal images to be detected and corresponding images in different time and space domains. For faults that are identified as unknown types, the second-stage algorithm is used to extract the features of the fault and cluster analysis is performed together with the features of unknown faults recorded in the database. The cluster analysis module performs a comprehensive analysis based on the results of fault location detection, fault type identification and cluster analysis, obtains the fault condition of the image to be detected and outputs an inspection report, completing the intelligent inspection of the power grid fault at the current location.
[0017] The beneficial effects of the second aspect can refer to the description of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A flowchart of the overall steps of a method for inspecting a power grid system fault provided by the present invention; Figure 2 The present invention provides a flow chart of a first-stage fault discrimination algorithm of a method for inspecting faults in a power grid system. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Unless otherwise defined, the technical terms or scientific terms used herein should be understood by people with general skills in the field to which the present invention belongs. "Including" and similar words used in this article mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects.
[0020] See also Figure 1 The present invention provides a method for inspecting a power grid system fault, comprising the following steps: S1, obtaining the image to be detected of the corresponding power grid line at the current moment, and extracting the images of the current position at different previous moments, as well as the image of the adjacent line position at the current moment, and preprocessing them using a pixel gradient-aware histogram equalization algorithm; S2. Based on the preprocessed image to be detected and the images in different time and space domains, a lightweight first-stage algorithm is applied to perform fault discrimination to determine whether the image to be detected has an abnormality; S3. For the images to be detected with abnormalities and the corresponding images in different time and space domains, the refined second-stage algorithm is used to detect the fault location and distinguish the fault type. For the faults that are distinguished as unknown types, the second-stage algorithm is used to extract the features of the faults, and cluster analysis is performed together with the features of the unknown faults recorded in the database; S4. Perform a comprehensive analysis based on the results of fault location detection, fault type identification and cluster analysis to obtain the fault condition of the image to be detected and output an inspection report to complete the intelligent inspection of the power grid fault at the current location.
[0021] In some embodiments, when executing step S1, it specifically includes: S1-1, obtaining the image to be detected of the corresponding power grid line at the current moment, and extracting the images of the current position at different previous moments, and the image of the adjacent line position at the current moment; S1-2, pre-processing is performed using a pixel gradient-aware histogram equalization algorithm.
[0022] Specifically, when executing step S1-1, remote monitoring of the power grid line is achieved through a cloud platform or a mobile application. The operation and maintenance personnel can capture, browse videos, and remotely configure the lines through the background management software. The image to be detected of the corresponding power grid line at the current moment is obtained through the cloud platform, and the images of the current position at different previous moments and the images of the adjacent line positions at the current moment are extracted at the same time.
[0023] Specifically, when executing step S1-2, a pixel gradient-aware histogram equalization algorithm is used for preprocessing, including: S1-2-1, calculating the gradient strength of each pixel in the image to be detected and generating a gradient weight map; S1-2-2, dividing the image to be detected evenly into image blocks along the horizontal axis and the vertical axis, and performing equalization processing on each image block; S1-2-3. The original image and the equalized image are weightedly fused based on the gradient weight map to suppress the influence of light interference while protecting the visual details, and finally the image pixel value is obtained to complete the preprocessing.
[0024] In fact, when executing S1-2-1, remember OK The pixels of the column are , whose gradient The calculation formula is:
[0025] Furthermore, it is recorded in OK The gradient weight of the pixels in the column is , the specific calculation formula of the gradient weight map is: ; In the formula, Indicates the maximum value of the gradient strength in the graph and is used to normalize the gradient.
[0026] In fact, when executing S1-2-2, the equalized image pixels are recorded as , the specific calculation formula is: ; ; In the formula, express OK The local contrast value of the column pixels, and Respectively represent the mean and variance of the pixels in the current image block, and They represent the minimum and maximum local contrast in the current image block respectively. The constant 1 is added to the denominator to ensure the numerical stability of the calculation.
[0027] In fact, when executing S1-2-3, the gradient weight map is used to weight the fusion of the equalized image and the original image, thereby suppressing the influence of light interference while protecting key visual details. The final image pixel value is: ; In the formula, the parameters are the same as above; In some embodiments, see Figure 2 When executing step S2, based on the preprocessed image to be detected and the images in different time and space domains, a lightweight first-stage algorithm is applied to perform fault discrimination to determine whether the image to be detected has an abnormality. The lightweight first-stage algorithm adopts a multi-branch collaborative training strategy. The specific training strategy includes: S2-1, perform image matching and calibration on the image to be detected and the images in different time and space domains respectively: first extract the ORB feature points of the two images respectively, then match the feature points between the two images and filter out the wrong matching point pairs, and finally calculate the perspective transformation matrix mapped from the images in different time and space domains to the coordinates of the image to be detected and perform image transformation; S2-2, for the image to be detected and the calibrated images in different time and space domains, three types of visual features are extracted respectively; Furthermore, the three types of visual features include corner features, color change features and global texture features; S2-3. The three types of extracted visual features are respectively sent to a detector consisting of a convolutional layer, a fully connected layer, and an activation function layer. The detector first uses the convolutional layer to map various visual features, and then uses the fully connected layer and the activation function layer to perform a binary classification prediction based on a single visual feature to determine whether the image to be detected has an abnormality, and uses the cross entropy function to calculate the training loss; S2-4. The mapped visual features are stitched together, and then the probability of a device failure in the current image to be predicted is predicted through the fully connected layer and the activation function layer, completing the lightweight first-stage algorithm.
[0028] Specifically, when executing step S2-1, the extracted ORB features are used as corner features.
[0029] Specifically, when executing step S2-2, three types of visual features are extracted from the image to be detected and the calibrated images in different time and space domains, including: S2-2-1. When extracting corner features, calculate the response scores of the feature points in the image to be detected and sort them in descending order, select the first K ORB feature points, and if the number of feature points in the image to be detected is less than K, fill them with vectors whose values are all 0; where K is a natural number greater than 1; S2-2-2 When extracting color change features, the color histograms of the image to be detected and the images in different time domains or different spatial domains are counted respectively, and the color histogram distance between the two images is calculated. When the image to be detected is an RGB image, the three color channels are counted respectively and the color histogram distance is calculated; S2-2-3. When extracting global texture features, the correlation between corner point features is calculated pairwise, and the global texture features are constructed based on the calculation results of the correlation.
[0030] In fact, when executing step S2-2-1, considering that the ORB feature extracted by step S2-1 can better characterize the corner feature around the feature point, and in order to reduce the computational overhead, the ORB feature extracted by S2-1 is directly used as the corner feature.
[0031] In fact, when executing step S2-2-2, the calculation formula of the color histogram distance is as follows: ; In the formula, and are the means of the two histograms, N is the number of intervals of the histogram, and There are two histograms in Values in an interval.
[0032] In fact, when executing step S2-2-3, considering that the corner point features in S2-2-1 can reflect the local texture information to a certain extent, the global texture features Further construction is based on the corner feature, where is the number of corner feature points in the image, Indicates Corner features and The correlation between the corner features is as follows: ; ; In the formula, and Respectively represent and Corner point features, and Respectively represent The horizontal and vertical coordinates of the pixels corresponding to the corner points, Indicates the maximum distance between corner pixels in the current image; Furthermore, when the distance between two corner points is smaller and the orientation angle between the corner point features is smaller, the correlation between the two is greater, and vice versa.
[0033] Specifically, when executing step S2-3, the cross entropy function is used to calculate the training loss. The specific formula is as follows: ; In the formula, represents the sample label, , and Respectively represent the probability distributions predicted based on color, corner points, and global texture features.
[0034] Furthermore, when executing step S2-4, the cross entropy function is also used to calculate the training loss, and the formula is the same as above.
[0035] In some embodiments, when executing step S3, it includes: S3-1. For the images to be detected with abnormalities and the corresponding images in different time and space domains, the refined second-stage algorithm is applied to detect the fault location and identify the fault type;
[0036] S3-2. For a fault that is identified as an unknown type, the second-stage algorithm is used to extract the features of the fault, and cluster analysis is performed together with the features of the unknown faults recorded in the database.
[0037] Specifically, when executing step S3-1, a refined second-stage algorithm is applied to perform fault location detection and fault type discrimination. The refined second-stage algorithm adopts an end-to-end training strategy of contrastive learning and multi-task collaboration. The specific training includes: S3-1-1, for the input image to be detected and images in different time and space domains, respectively extract visual features through the visual encoder of the pre-trained CLIP model; S3-1-2, constructing a text description sentence based on keywords related to power facilities, and extracting text features based on a text encoder of a pre-trained CLIP model; wherein the visual encoder and the text encoder keep parameters frozen; S3-1-3, based on the visual features and text features, cross-temporal and spatial query modeling is performed to obtain multimodal query features that simultaneously include current scene visual information and power facility-related text priors; S3-1-4, applying matrix multiplication to the multimodal query feature and the visual feature to obtain a preliminary fault location mask, and sending the multimodal query feature to a classifier composed of a fully connected layer and an activation layer to obtain a fault category probability prediction distribution; S3-1-5. Based on the preliminary fault location mask and the predicted distribution of fault category probability, the loss is calculated, the positive and negative sample balance loss function of skeleton perception is designed, and the contrast learning loss function across time and space domains is constructed based on the visual features to close the visual representation between the image to be detected and the images in different time and space domains, and distinguish the differences in visual representation between images in different time domains and different space domains; S3-1-6. Based on the preliminary fault location mask and combined with the multimodal query features, the mask is iteratively updated until the maximum number of iterations is reached and the training is terminated, completing the refined second-stage algorithm training.
[0038] In fact, when executing steps S3-1-1 and S3-1-2, the pre-trained CLIP (Contrastive Language-Image Pre-Training) model is a multimodal pre-trained neural network model consisting of two parts: an image encoder and a text encoder. The image encoder is responsible for converting the image into a feature vector, which can be a convolutional neural network (such as ResNet) or a Transformer model (such as ViT). The text encoder is responsible for converting the text into a feature vector, which is usually a Transformer model. The two encoders realize cross-modal information interaction and fusion by sharing a vector space.
[0039] In fact, when executing step S3-1-3, query modeling across time and space is performed based on the visual features and text features to obtain multimodal query features that contain both the current scene visual information and the power facility-related text priors, including: Feature extraction obtains text features, and the visual features of the image to be detected and images in different time and space domains are spliced together. The text features and the spliced visual features are combined based on the cross-attention mechanism to obtain multimodal query features.
[0040] Furthermore, the multimodal query feature calculation formula is as follows: ; ; In the formula, is the query vector, is the key vector, is a value vector, , and represents the learnable weight matrix, The number of channels representing features, represents the Softmax function, Text features, It is the visual feature obtained by concatenating the visual features of the image to be detected and the images in different time and space domains. is the multimodal query feature, for By converting text information into features , converting visual information into features and Features , and then through matrix multiplication by , , Calculated query features , to indicate the possible defect information in the image to be detected.
[0041] In fact, when executing step S3-1-4, the multimodal query feature and the visual features of the image to be detected Apply matrix multiplication to get a preliminary fault location mask , and at the same time, the multimodal query features are sent to the classifier composed of a fully connected layer and an activation layer to obtain a preliminary prediction distribution of the fault category probability. Represents the height and width of the image feature map, Represents the number of feature channels of the image feature map.
[0042] In fact, when executing step S3-1-5, the loss is calculated for the predicted preliminary fault location mask and the probability prediction distribution of the fault category. Considering that the fault area of the power facility is generally small in size or irregularly distributed, the present invention designs a skeleton-aware positive and negative sample balance loss function for mask prediction. The skeleton area is obtained by applying a skeleton extraction algorithm to the mask label. For the probability prediction distribution of the fault category, the cross entropy loss function is used to calculate the training loss; Furthermore, the positive and negative sample balance loss function formula is as follows: ; ; In the formula, is the positive and negative sample balance loss, N is the number of pixels in the image, and are the number of pixels in the image that belong to positive and negative samples, respectively. and They are The true label and predicted probability distribution of pixels, is the number of pixels in the skeleton area.
[0043] In fact, when executing step S3-1-5, a cross-temporal and spatial contrast learning loss is constructed based on the visual features extracted from the image to be detected and the images in different time and space domains, so as to help the algorithm better model the visual correlation between images in different time domains and different space domains, and thus better discover the fault area in the image; Furthermore, the contrastive learning loss function across time and space aims to bring the visual representation between the image to be detected and the images in different time and space closer, while ensuring that the algorithm distinguishes the differences in visual representation between images in different time and space. The formula of the contrastive learning loss function across time and space is as follows: ; ; ; ; In the formula, , and They represent the visual features extracted from the image to be detected, images in different time domains, and images in different spatial domains, respectively. is the contrastive learning loss function.
[0044] In fact, when executing S3-1-6, the mask is iteratively updated based on the preliminary fault location mask combined with the multimodal query features until the maximum number of iterations is reached and the training is terminated, including: Based on the preliminary fault location mask and the feature application matrix of the image to be detected, a fault area feature is obtained; Based on the cross-attention mechanism, the multimodal query features are interacted with the fault area features to update the multimodal query features; The updated multimodal query features are multiplied by the feature matrix of the image to be detected to obtain an updated fault location mask. At the same time, the multimodal query features are sent to a classifier composed of a fully connected layer and an activation layer to obtain an updated fault category probability prediction distribution. The update is performed continuously until the maximum number of iterations is reached to obtain the final fault location mask and fault category probability distribution.
[0045] Furthermore, it should be noted that in the inference deployment phase of the second-stage algorithm, the final prediction result is used directly. For the masks and probability distributions predicted in the iterative process, the loss function described in S3-1-5 is also applied to calculate the training loss. Therefore, the complete training loss is as follows: ; In the formula, and represents the loss calculated based on the predicted probability distribution and mask, Represents the contrastive learning loss across temporal and spatial domains.
[0046] Specifically, when executing step S3-2, the database includes: a relational database, a NoSQL database and a time series database. The relational database is used to store and manage various types of fault data, including known and unknown fault characteristics. The NoSQL database is used to store and manage the massive data generated by the smart grid and Internet of Things devices. The time series database is used to store and manage the real-time operation data of the power grid.
[0047] In some embodiments, when executing step S4, a comprehensive analysis is performed based on the results of fault location detection, fault type identification and cluster analysis to obtain the fault condition of the image to be detected and output an inspection report to complete the intelligent inspection of the power grid fault at the current location.
[0048] Specifically, the input image is preprocessed and multi-stage detected according to the two-stage fault inspection method to determine whether a fault exists. If so, the fault location is located and the fault type is output. Faults of unknown types are summarized and classified, and the inspection result information is obtained to generate an inspection report, which is communicated with the control center and transmitted to the operation and maintenance personnel.
[0049] Although the embodiments of the present invention are described in detail above, it is obvious to those skilled in the art that various modifications and variations can be made to these embodiments. However, it should be understood that such modifications and variations are within the scope and spirit of the present invention as described in the claims. Moreover, the present invention described herein may have other embodiments and may be implemented or realized in a variety of ways.
Claims
1. A method for inspecting a power grid system fault, characterized in that: include: Obtain the image to be detected of the corresponding power grid line at the current moment, and extract the images of the current position at different previous moments, as well as the image of the adjacent line position at the current moment, and pre-process them using a pixel gradient-aware histogram equalization algorithm; Based on the preprocessed image to be detected and images in different time and space domains, a lightweight first-stage algorithm is applied to perform fault identification to determine whether the image to be detected has an abnormality; For the images to be detected with abnormalities and the corresponding images in different time and space domains, the refined second-stage algorithm is used to detect the fault location and distinguish the fault type. For the faults that are judged as unknown types, the second-stage algorithm is used to extract the features of the fault and perform cluster analysis together with the features of the unknown faults recorded in the database; A comprehensive analysis is performed based on the results of fault location detection, fault type discrimination and cluster analysis to obtain the fault condition of the image to be detected and output an inspection report to complete the intelligent inspection of the power grid fault at the current location.
2. A method for inspecting a power grid system fault according to claim 1, characterized in that: The pixel gradient-aware histogram equalization algorithm is used for preprocessing, including: Calculate the gradient strength of each pixel in the image to be detected and generate a gradient weight map; The image to be detected is evenly divided into image blocks along the horizontal axis and the vertical axis, and each image block is subjected to equalization processing respectively; The original and equalized images are weightedly fused based on the gradient weight map to suppress the influence of light interference while protecting the visual details, and finally the image pixel value is obtained to complete the preprocessing.
3. A method for inspecting a power grid system fault according to claim 1, characterized in that: A lightweight first-stage algorithm is applied to perform fault identification to determine whether the image to be detected has an abnormality. The lightweight first-stage algorithm adopts a multi-branch collaborative training strategy. The specific training strategy includes: Perform image matching and calibration on the image to be detected and the images in different time and space domains respectively: first extract the ORB feature points of the two images respectively, then match the feature points between the two images and filter out the wrong matching point pairs, and finally calculate the perspective transformation matrix mapped from the images in different time and space domains to the coordinates of the image to be detected and perform image transformation; For the image to be detected and the calibrated images in different time and space domains, three types of visual features are extracted respectively; wherein the three types of visual features include corner point features, color change features and global texture features; The three types of extracted visual features are respectively sent to a detector consisting of a convolutional layer, a fully connected layer, and an activation function layer. The detector first uses the convolutional layer to map various visual features, and then uses the fully connected layer and the activation function layer to perform a binary classification prediction based on a single visual feature to determine whether the image to be detected has an abnormality, and uses the cross entropy function to calculate the training loss; The mapped visual features are stitched together, and then the probability of a device failure in the current image to be predicted is predicted through the fully connected layer and the activation function layer, completing the lightweight first-stage algorithm.
4. A method for inspecting a power grid system fault according to claim 3, characterized in that: For the image to be detected and the calibrated images in different time and space domains, three types of visual features are extracted respectively, including: When extracting corner features, calculate the response scores of the feature points in the image to be detected and sort them in descending order, select the first K ORB feature points, and if the number of feature points in the image to be detected is less than K, fill them with vectors with all values zero; K is a natural number greater than 1; When extracting color change features, the color histograms of the image to be detected and the images in different time domains or different spatial domains are counted respectively, and the color histogram distance between the two images is calculated. When the image to be detected is an RGB image, the three color channels are counted respectively and the color histogram distance is calculated; When extracting global texture features, the correlation between corner point features is calculated pairwise, and the global texture features are constructed based on the calculation results of the correlation.
5. A method for inspecting a power grid system fault according to claim 1, characterized in that: A refined second-stage algorithm is applied to detect fault locations and identify fault types. The refined second-stage algorithm adopts an end-to-end training strategy of contrastive learning and multi-task collaboration. The specific training includes: For the input image to be detected and images in different time and space domains, the visual features are extracted by the visual encoder of the pre-trained CLIP model respectively; Constructing a text description sentence based on keywords related to power facilities, and extracting text features based on a text encoder of a pre-trained CLIP model; wherein the visual encoder and the text encoder keep parameters frozen; Based on the visual features and text features, query modeling across time and space is performed to obtain multimodal query features that simultaneously include current scene visual information and text priors related to power facilities; Applying matrix multiplication to the multimodal query feature and the visual feature to obtain a preliminary fault location mask, and sending the multimodal query feature to a classifier composed of a fully connected layer and an activation layer to obtain a fault category probability prediction distribution; Based on the preliminary fault location mask and the predicted distribution of fault category probability, the loss is calculated, a skeleton-aware positive and negative sample balance loss function is designed, and a cross-temporal and spatial contrast learning loss function is constructed based on the visual features to narrow the visual representation between the image to be detected and the images in different temporal and spatial domains, and distinguish the differences in visual representation between images in different temporal domains and different spatial domains; Based on the preliminary fault location mask combined with multimodal query features, the mask is iteratively updated until the maximum number of iterations is reached and the training is terminated, completing the refined second-stage algorithm training.
6. A method for inspecting a power grid system fault according to claim 5, characterized in that: And / or, the positive and negative sample balance loss function formula is as follows: ; ; In the formula, is the positive and negative sample balance loss, N is the number of pixels in the image, and are the number of pixels in the image that belong to positive and negative samples, respectively. and They are The true label and predicted probability distribution of pixels, is the number of pixels in the skeleton area; The formula for the contrastive learning loss function across time and space is as follows: ; ; ; ; In the formula, , and They represent the visual features extracted from the image to be detected, images in different time domains, and images in different spatial domains, respectively. is the contrastive learning loss function.
7. A method for inspecting power grid system faults according to claim 5, characterized in that: Based on the visual features and text features, query modeling across time and space is performed to obtain multimodal query features that contain both current scene visual information and text priors related to power facilities, including: Feature extraction obtains text features, splices the visual features of the image to be detected and the images in different time and space domains, and combines the text features and the spliced visual features based on the cross-attention mechanism to obtain multimodal query features; The formula for calculating multimodal query features is as follows: ; ; In the formula, is the query vector, is the key vector, is a value vector, , and represents the learnable weight matrix, The number of channels representing features, represents the Softmax function, Text features, It is the visual feature obtained by concatenating the visual features of the image to be detected and the images in different time and space domains. is the multimodal query feature, for The transposed matrix of .
8. A method for inspecting a power grid system fault according to claim 5, characterized in that: Based on the preliminary fault location mask combined with multimodal query features, the mask is iteratively updated until the maximum number of iterations is reached and the training ends, including: Based on the preliminary fault location mask and the feature application matrix of the image to be detected, a fault area feature is obtained; Based on the cross-attention mechanism, the multimodal query features are interacted with the fault area features to update the multimodal query features; The updated multimodal query features are multiplied by the feature matrix of the image to be detected to obtain an updated fault location mask. At the same time, the multimodal query features are sent to a classifier composed of a fully connected layer and an activation layer to obtain an updated fault category probability prediction distribution. The update is performed continuously until the maximum number of iterations is reached to obtain the final fault location mask and fault category probability distribution.
9. A power grid system fault inspection system, characterized in that: include: The image acquisition preprocessing module is used to obtain the image to be detected of the corresponding power grid line at the current moment, and at the same time extract the images of the current position at different previous moments, as well as the images of the adjacent line position at the current moment, and preprocess them using a pixel gradient-aware histogram equalization algorithm; The anomaly detection module uses a lightweight first-stage algorithm to perform fault discrimination based on the preprocessed image to be detected and images in different time and space domains to determine whether the image to be detected has an anomaly; The discriminant clustering module applies a refined second-stage algorithm to detect fault locations and discriminate fault types for abnormal images to be detected and corresponding images in different time and space domains. For faults that are identified as unknown types, the second-stage algorithm is used to extract the features of the fault and cluster analysis is performed together with the features of unknown faults recorded in the database. The cluster analysis module performs a comprehensive analysis based on the results of fault location detection, fault type identification and cluster analysis, obtains the fault condition of the image to be detected and outputs an inspection report, completing the intelligent inspection of the power grid fault at the current location.
Citation Information
Patent Citations
Method for positioning failure point of power grid
CN102043116A
Power grid fault diagnosis method based on temporal Bayesian knowledge base (TBKB)
CN102721901A
Zero sequence direction security acceleration method based on substation area information
CN103091601A
Online grid fault detection method based on relative protection entropy and nominal transition resistance
CN104316836A
Rail plug pin fault detection method and system based on image alignment and detection network model
CN107292870A