Characteristic matching-based electricity-related facility component anomaly detection method and device, electronic equipment and storage medium
By constructing a set of feature templates and a set of pseudo-anomaly features, and combining semantic segmentation and feature extraction models, the problem of insufficient sensitivity in the detection of electrical facility components in complex environments is solved, and the accurate identification of hidden dangers in minute structures and the reduction of false alarms and missed detections are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-13
- Publication Date
- 2026-04-10
AI Technical Summary
Existing technologies struggle to distinguish between non-structural environmental disturbances and minute structural hazards in complex environments, resulting in insufficient detection sensitivity for electrical facility components and a tendency to miss or falsely report issues.
By constructing a set of normal feature templates and a set of pseudo-abnormal features, the semantic segmentation model and the feature extraction model are used to divide the structural regions and extract features from the images of power facilities. The minimum matching difference and the maximum similarity of the feature vectors are calculated, and the feature matching difference is determined by combining the weighted coefficients to detect anomalies.
It effectively distinguishes between environmental interference and minor structural hazards, improves detection sensitivity, reduces false alarm and false negative rates, and enables accurate anomaly detection of electrical facility components.
Smart Images

Figure CN121837799A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of intelligent inspection of power-related facilities, and particularly relates to a feature matching-based abnormality detection method and device for power-related facility components, an electronic device and a storage medium. BACKGROUND
[0002] As a key node of the power transmission network, the physical structure integrity of the power-related facility is directly related to the safe and stable operation of the power grid. With the advancement of smart grid construction, using unmanned aerial vehicle inspection images combined with computer vision technology to automatically detect abnormalities in power-related facility components has become an important means to replace traditional manual inspection and improve operational efficiency. Timely and accurate detection of small defects or structural hazards on the surface of the components has a high application value for preventing large-scale power outages.
[0003] However, the existing technology mostly adopts an unsupervised learning paradigm based on single-class classification, that is, only by learning the feature distribution boundary of normal samples, samples falling outside the boundary are determined as abnormal. This method of simply measuring the distance between the target to be measured and the normal state has obvious defects, that is, it ignores the sensitivity difference of the change direction in the feature space. In the complex outdoor environment, the non-structural fluctuations of the power-related facility caused by changes in light or shooting angles are often large in amplitude, while the early small structural hazards usually have a small amount of deviation in the feature space and have a specific direction. Due to the lack of prior reference to the evolution direction of the specific hazard, the existing technology is difficult to effectively distinguish between the large background fluctuations caused by environmental factors and the small feature deviations caused by structural diseases in the feature space, resulting in insufficient detection sensitivity of the system to small hazards and easy to miss detection or false positives caused by environmental interference. SUMMARY
[0004] The embodiment of the present application provides a feature matching-based abnormality detection method and device for power-related facility components, an electronic device and a storage medium, which can solve the problem that the existing technology ignores the sensitivity difference of the change direction in the feature space, and is difficult to distinguish between non-structural environmental interference and small structural hazards in a complex environment, resulting in insufficient detection sensitivity of the system and easy to miss detection or false positives.
[0005] An embodiment of the present application provides a feature matching-based abnormality detection method for power-related facility components, comprising: obtaining a power-related facility image to be detected; dividing the power-related facility image into structural region image blocks by using a preset semantic segmentation model, and extracting a structural region feature vector corresponding to each structural region image block by using a preset feature extraction model; respectively, to obtain normal feature difference values corresponding to the structural region feature vectors; respectively, to obtain pseudo-anomaly feature similarity values corresponding to the structural region feature vectors; wherein the pseudo-anomaly feature set is generated according to the normal feature template set by applying a controlled disturbance along the minimum principal axis direction of the feature distribution of each normal feature template; According to the normal feature difference values and the pseudo-anomaly feature similarity values corresponding to each structural region feature vector, determine the feature matching difference degree corresponding to each structural region image block, and obtain the anomaly detection result of each structural region image block based on the feature matching difference degree; According to the anomaly detection results of each structural region image block, determine the anomaly detection result of the power-related facility image.
[0006] Further, the normal feature template set is constructed in the following way: Obtain multiple power-related facility sample images in a normal state; Divide the structure region of each power-related facility sample image using the preset semantic segmentation model to obtain multiple sample structural region image blocks corresponding to each power-related facility sample image and the structure category corresponding to each sample structural region image block; Extract features from each sample structural region image block using the feature extraction model to obtain sample feature vectors corresponding to each sample structural region image block; Based on the standard deviation of the pixel gray scale in the sample structural region image block, calculate the contrast evaluation index of each sample structural region image block; Based on the difference between the aspect ratio of the bounding rectangle of the sample structural region image block and the typical aspect ratio preset for the corresponding structure category, calculate the spatial compactness index of each sample structural region image block; According to the contrast evaluation index and the spatial compactness index, select sample feature vectors that meet the preset quality conditions to obtain multiple normal feature templates; Classify each normal feature template according to the structure category corresponding to the normal feature template to obtain a normal feature template set.
[0007] Further, the pseudo-anomaly feature set is constructed in the following way: For each normal feature template in the normal feature template set, select a preset number of sample feature vectors with the smallest Euclidean distance from the current normal feature template from the sample feature vectors as the neighboring sample feature group of the current normal feature template; According to the multiple sample feature vectors contained in the neighboring sample feature group, calculate the local covariance matrix; performing eigen-decomposition on the local covariance matrix to obtain a plurality of eigenvalues and eigenvectors corresponding to the eigenvalues; selecting a minimum eigenvalue from the plurality of eigenvalues, and determining an eigenvector corresponding to the minimum eigenvalue as a minimum principal axis direction vector; weighting the minimum principal axis direction vector by using a preset perturbation intensity coefficient, and superimposing the weighted vector to a current normal feature template to obtain a pseudo-anomalous feature vector corresponding to the current normal feature template; converging the pseudo-anomalous feature vectors corresponding to the normal feature templates to obtain a pseudo-anomalous feature set.
[0008] Further, a minimum matching difference between each structural region feature vector and the preset normal feature template set is calculated respectively to obtain a normal feature difference value corresponding to each structural region feature vector, including: For each structural region feature vector, the Euclidean distance between the current structural region feature vector and each normal feature template in the normal feature template set is calculated to generate a feature matching distance set corresponding to the current structural region feature vector; selecting a minimum value from the feature matching distance set, and determining the minimum value as the normal feature difference value corresponding to the current structural region feature vector.
[0009] Further, a maximum similarity between each structural region feature vector and the preset pseudo-anomalous feature set is calculated respectively to obtain a pseudo-anomalous feature similarity value corresponding to each structural region feature vector, including: For each structural region feature vector, the cosine similarity between the current structural region feature vector and each pseudo-anomalous feature vector in the pseudo-anomalous feature set is calculated respectively to obtain a feature similarity set corresponding to the current structural region feature vector; selecting a maximum value from the feature similarity set, and determining the maximum value as the pseudo-anomalous feature similarity value corresponding to the current structural region feature vector.
[0010] Further, according to the normal feature difference value and the pseudo-anomalous feature similarity value corresponding to each structural region feature vector, a feature matching difference degree corresponding to each structural region image block is determined, and an anomaly detection result of each structural region image block is obtained based on the feature matching difference degree, including: For each structural region feature vector, the normal feature difference value and the pseudo-anomalous feature similarity value corresponding to the current structural region feature vector are weighted and summed by using a preset weighting coefficient to obtain a feature matching difference degree corresponding to the current structural region image block; determining whether the feature matching difference degree is greater than a preset anomaly determination threshold; if the feature matching difference degree is greater than an abnormality determination threshold, determining that the current structural region image block is an abnormal region; if the feature matching difference degree is less than or equal to the abnormality determination threshold, determining that the current structural region image block is a normal region.
[0011] Further, according to the abnormality detection results of each structural region image block, the abnormality detection result of the power-related facility image is determined, including: counting the number of the abnormal regions determined in each structural region image block to obtain an abnormal region count value corresponding to the power-related facility image; comparing the abnormal region count value with a preset alarm quantity threshold; if the abnormal region count value is greater than the alarm quantity threshold, determining that the abnormality detection result of the power-related facility image is abnormal; if the abnormal region count value is less than or equal to the alarm quantity threshold, determining that the abnormality detection result of the power-related facility image is normal.
[0012] On the basis of the above-mentioned method embodiment, the application correspondingly provides a device embodiment.
[0013] An embodiment of the application provides a power-related facility component abnormality detection device based on feature matching, including an image acquisition module, an image processing module, a feature matching module and an abnormality determination module. The image acquisition module is used for acquiring a power-related facility image to be detected. The image processing module is used for dividing the power-related facility image into structural region image blocks by using a preset semantic segmentation model, and extracting structural region feature vectors corresponding to each structural region image block by using a preset feature extraction model. The feature matching module is used for calculating minimum matching differences between each structural region feature vector and a preset normal feature template set to obtain normal feature difference values corresponding to each structural region feature vector, and calculating maximum similarities between each structural region feature vector and a preset pseudo-abnormal feature set to obtain pseudo-abnormal feature similarity values corresponding to each structural region feature vector; wherein the pseudo-abnormal feature set is generated by applying controlled disturbance along the minimum principal axis direction of the local distribution of each normal feature template feature according to the normal feature template set. The abnormality determination module is used for determining feature matching difference degrees corresponding to each structural region image block according to the normal feature difference values and the pseudo-abnormal feature similarity values corresponding to each structural region feature vector, and obtaining abnormality detection results of each structural region image block based on the feature matching difference degrees; and determining the abnormality detection result of the power-related facility image according to the abnormality detection results of each structural region image block.
[0014] On the basis of the above-mentioned method item embodiment, the present application correspondingly provides an electronic device item embodiment.
[0015] An embodiment of the present application provides an electronic device, including a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, when the computer program is executed by the processor, the processor implements the feature matching based power-related facility component anomaly detection method in any of the above-mentioned method item embodiments.
[0016] On the basis of the above-mentioned method item embodiment, the present application correspondingly provides a storage medium item embodiment.
[0017] An embodiment of the present application provides a storage medium, which stores a computer program, wherein when the computer program runs, the storage medium controls a device where the storage medium is located to execute the feature matching based power-related facility component anomaly detection method in any of the above-mentioned method item embodiments.
[0018] Compared with the prior art, the present application has the following beneficial effects: The embodiment of the present application provides a feature matching based power-related facility component anomaly detection method, device, electronic device and storage medium. The method obtains a power-related facility image to be detected; a preset semantic segmentation model is used to divide a structure region of the image, a plurality of structure region image blocks are obtained, and a structure feature vector of each image block is extracted through a feature extraction model; a minimum matching difference value of each feature vector and a normal feature template set and a maximum similarity value of each feature vector and a pseudo abnormal feature set are calculated respectively, wherein the pseudo abnormal feature set is generated by applying a controlled disturbance to the normal feature template along a local distribution minimum principal axis direction; a feature matching difference degree of each structure region is obtained according to the difference value and the similarity value, an abnormal situation of the corresponding region is determined, and the overall abnormal detection result of the power-related facility image is determined accordingly.
[0019] The present application uses the pseudo abnormal feature set generated by applying a controlled disturbance to the normal feature template along the local distribution minimum principal axis direction to construct specific reference features for microstructure hidden danger evolution. By including the maximum similarity of the feature vector of each structure region and the pseudo abnormal feature set in the determination logic of the feature matching difference degree, the present application can effectively distinguish non-structural environmental interference and microstructure hidden danger occurring along the minimum principal axis direction, and solve the high false alarm rate and missed detection problem caused by the lack of directionality reference in the prior art. BRIEF DESCRIPTION OF DRAWINGS
[0020] Figure 1 FIG. 1 is a flowchart of a feature matching based power-related facility component anomaly detection method according to an embodiment of the present application.
[0021] Figure 2is a structural schematic diagram of a feature matching-based power-related facility component anomaly detection device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0022] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0023] As Figure 1 shown, to solve the problem that in the prior art, due to the difference in sensitivity of the change direction in the feature space, it is difficult to distinguish non-structural environmental interference from a slight structural hidden danger in a complex environment, resulting in insufficient detection sensitivity of the system and easy occurrence of missed detection or false positives, an embodiment of the present application provides a feature matching-based power-related facility component anomaly detection method, at least including the following steps: Step S1, acquiring a power-related facility image to be detected; Specifically, as a key node of a power transmission network, the integrity of the physical structure of the power-related facility is directly related to the safe and stable operation of the power grid. This step aims to acquire original visual data containing a target component, providing a data basis for subsequent structure division and feature extraction. The power-related facility image is usually obtained from a UAV inspection terminal, a ground inspection robot or a fixed online monitoring device equipped with a high-resolution imaging sensor. In an actual operation scenario, the UAV or the inspection device performs multi-angle shooting on power-related facility components such as a power transmission tower, an insulator string and a conductor fitting according to a predetermined inspection route or a monitoring strategy, thereby collecting the power-related facility image.
[0024] Considering that the power-related facility is usually in a complex outdoor environment, the power-related facility image is easily disturbed by changes in light intensity, shooting angle deviation, weather conditions and background clutter (such as trees and buildings). In order to ensure the data quality of the input subsequent semantic segmentation model, after acquiring the original power-related facility image, a preprocessing operation needs to be performed on the power-related facility image. The preprocessing operation specifically includes image denoising, size normalization and color space conversion.
[0025] Specifically, image denoising aims to eliminate random noise introduced by imaging sensor thermal noise or transmission process, and a Gaussian filter or median filter algorithm can be used to perform smoothing processing on the power-related facility image, reducing noise interference while preserving edge information. Size normalization aims to adjust different resolution power-related facility images to a unified pixel size (W, H) to adapt to the input layer requirements of the preset semantic segmentation model and feature extraction model, where W represents the image width, and H represents the image height. W represents the image width, and H represents the image height. The color space conversion is to convert the power-related facility image from the RGB color space to the grayscale space or the HSV color space according to the subsequent processing requirements, so as to highlight the texture or color features of the power-related facility components. Through the above acquisition and preprocessing means, high-quality and standardized power-related facility images can be obtained, the influence of non-structural environmental factors on the detection accuracy is effectively reduced, and it is ensured that the feature information reflecting the physical state of the components can be accurately extracted from the power-related facility images in the subsequent steps.
[0026] In step S2, a preset semantic segmentation model is used to divide the power-related facility image into structural region, to generate at least one structural region image block, and a preset feature extraction model is used to extract a structural region feature vector corresponding to each structural region image block. Specifically, the preset semantic segmentation model is used to divide the power-related facility image into structural region, to generate at least one structural region image block. The background of the power-related facility image usually contains complex mountain, vegetation or sky interference. In order to accurately locate the key components of the power-related facility, the preset semantic segmentation model is configured as a DeepLabV3+ network architecture based on a deep convolutional neural network. The DeepLabV3+ network architecture includes an encoder part and a decoder part. The encoder part uses Xception as the backbone network, and captures the multi-scale context information of the power-related facility image through the empty space pyramid pooling module. The decoder part fuses the high-level semantic features output by the encoder part and the low-level detail features output by the backbone network, so as to classify the power-related facility image at the pixel level.
[0027] Before being put into use, the preset semantic segmentation model needs to be optimized in parameters based on a supervised training method. A semantic segmentation training data set is constructed, which includes multiple historical power-related facility sample images collected and corresponding pixel-level annotation labels. The pixel-level annotation label marks each pixel point in the power-related facility sample image as a background category or a specific structure category, which includes but is not limited to insulator, shock absorber, clamp and tower material. Considering the diversity of the outdoor environment, in order to improve the generalization ability of the model to different shooting angles and light conditions, data enhancement operation needs to be performed on the semantic segmentation training data set before inputting the model. The data enhancement operation includes random rotation, horizontal flip, brightness adjustment and adding Gaussian noise, so as to expand the diversity of the training samples without increasing the collection cost.
[0028] In the training process, the preset semantic segmentation model updates the network parameters by minimizing the pixel cross-entropy loss function. The calculation formula of the pixel cross-entropy loss function is expressed as: wherein, total number of structure categories, total number of pixels in the sample image of electrical facilities, index of the current pixel, index of the current category. is a symbolic function, taking the value 1 when the pixel belongs to the category , otherwise taking the value 0; represent the probability value of the pixel belonging to the category predicted by the preset semantic segmentation model. By continuously reducing the value of the pixel cross-entropy loss function through the back propagation algorithm, the preset semantic segmentation model can learn the morphological and texture features of different electrical facility components.
[0029] After obtaining the pixel-level classification results of the electrical facility image, the structure region mask is generated according to the connected region of pixels belonging to the same structure category. The circumscribed rectangle frame of the structure region mask is calculated, and the circumscribed rectangle frame is cropped in the electrical facility image to generate at least one structure region image block. Each structure region image block corresponds to an explicit structure category label, which is used for subsequent feature template matching retrieval.
[0030] The structure region feature vector corresponding to each structure region image block is extracted by using the preset feature extraction model. The preset feature extraction model aims to map high-dimensional image pixel information into low-dimensional and discriminative feature vectors. The preset feature extraction model uses ResNet50 residual network as the basic architecture, and removes the fully connected classification layer at the end of the ResNet50 residual network, and retains the convolutional layer structure before the global average pooling layer.
[0031] The training process of the preset feature extraction model adopts a metric learning strategy, aiming to reduce the feature distance of the same type of components and increase the feature distance of different types of components. A feature extraction training data set is constructed, which contains multiple groups of triplets of electrical facility component samples. Each triplet sample is composed of an anchor sample image, a positive sample image and a negative sample image, wherein the anchor sample image and the positive sample image belong to the same structure category and have similar appearance, and the anchor sample image and the negative sample image belong to different structure categories or belong to the same structure category but have large appearance difference. The preset feature extraction model is trained by minimizing the triplet loss function. The calculation formula of the triplet loss function is expressed as: wherein, represents the anchor sample image, represents the positive sample image, represents the negative sample image. representing a feature mapping operation performed by a preset feature extraction model, for outputting a feature vector. representing a Euclidean distance calculation operation, for measuring the similarity between two feature vectors. representing a preset distance interval threshold, for forcing the distance between positive sample pairs to be at least smaller than the distance between negative sample pairs Through the above training, the structure region feature vector output by the preset feature extraction model has extremely sensitive spatial distribution characteristics to the component structure, which can effectively filter out the interference of non-structural factors such as illumination and angle, and provides a high-precision quantitative basis for subsequent feature distance-based anomaly detection.
[0032] Step S3, respectively calculating the minimum matching difference between each structure region feature vector and the preset normal feature template set, obtaining the normal feature difference value corresponding to each structure region feature vector; respectively calculating the maximum similarity between each structure region feature vector and the preset pseudo-abnormal feature set, obtaining the pseudo-abnormal feature similarity value corresponding to each structure region feature vector; wherein the pseudo-abnormal feature set is generated according to the normal feature template set, by applying a controlled disturbance along the minimum principal axis direction of the feature distribution of each normal feature template; In a preferred embodiment, the normal feature template set is constructed by the following way: obtaining multiple normal-state electrical facility sample images; dividing the structure region of each electrical facility sample image by using the preset semantic segmentation model, obtaining multiple sample structure region image blocks corresponding to each electrical facility sample image and the structure category corresponding to each sample structure region image block; performing feature extraction on each sample structure region image block by using the feature extraction model, obtaining a sample feature vector corresponding to each sample structure region image block; calculating the contrast evaluation index of each sample structure region image block based on the standard deviation of the pixel gray scale within the sample structure region image block; calculating the spatial compactness index of each sample structure region image block based on the difference between the aspect ratio of the circumscribed rectangle of the sample structure region image block and the typical aspect ratio preset for the corresponding structure category; According to the contrast evaluation index and the spatial compactness index, the sample feature vectors that meet the preset quality conditions are selected, and multiple normal feature templates are obtained. According to the structure category corresponding to each normal feature template, the normal feature template set is obtained.
[0033] In a preferred embodiment, the pseudo-abnormal feature set is constructed by the following way: For each normal feature template in the normal feature template set, a preset number of sample feature vectors with the smallest Euclidean distance from the current normal feature template are selected from the sample feature vectors as the neighboring sample feature set of the current normal feature template; A local covariance matrix is calculated according to the sample feature vectors in the neighboring sample feature set; The local covariance matrix is subjected to eigenvalue decomposition to obtain a plurality of eigenvalues and eigenvectors corresponding to each eigenvalue; The smallest eigenvalue in the plurality of eigenvalues is selected, and the eigenvector corresponding to the smallest eigenvalue is determined as the minimum principal axis direction vector; The minimum principal axis direction vector is weighted by a preset perturbation intensity coefficient, and the weighted vector is superimposed on the current normal feature template to obtain a pseudo-anomalous feature vector corresponding to the current normal feature template; The pseudo-anomalous feature vectors corresponding to each normal feature template are aggregated to obtain a pseudo-anomalous feature set.
[0034] In a preferred embodiment, the minimum matching difference between each structural region feature vector and the preset normal feature template set is calculated to obtain a normal feature difference value corresponding to each structural region feature vector, including: For each structural region feature vector, the Euclidean distance between the current structural region feature vector and each normal feature template in the normal feature template set is calculated to generate a feature matching distance set corresponding to the current structural region feature vector; The minimum value is selected from the feature matching distance set, and the minimum value is determined as the normal feature difference value corresponding to the current structural region feature vector.
[0035] In a preferred embodiment, the maximum similarity between each structural region feature vector and the preset pseudo-anomalous feature set is calculated to obtain a pseudo-anomalous feature similarity value corresponding to each structural region feature vector, including: For each structural region feature vector, the cosine similarity between the current structural region feature vector and each pseudo-anomalous feature vector in the pseudo-anomalous feature set is calculated to obtain a feature similarity set corresponding to the current structural region feature vector; The maximum value is selected from the feature similarity set, and the maximum value is determined as the pseudo-anomalous feature similarity value corresponding to the current structural region feature vector.
[0036] Specifically, before step S3 is performed, a high-quality preset normal feature template set and a targeted preset pseudo-anomalous feature set need to be constructed in advance. The construction quality of these two sets directly determines the reference accuracy of subsequent anomaly detection.
[0037] The pre-defined normal feature template set is not simply a collection of all normal samples, but rather undergoes rigorous screening to ensure representativeness. First, multiple sample images of power-related facilities in a normal state are acquired. A pre-defined semantic segmentation model is used to divide each sample image into structural regions, resulting in multiple sample structural region image blocks and their corresponding structural categories. Subsequently, a pre-defined feature extraction model is used to extract features from each sample structural region image block, yielding the corresponding sample feature vector.
[0038] To eliminate low-quality samples that are blurry, occluded, or distorted, it is necessary to calculate contrast evaluation metrics and spatial compactness metrics.
[0039] Based on the standard deviation of pixel gray levels within image blocks of sample structural regions, a contrast evaluation index is calculated for each sample structural region image block. Contrast Evaluation Index The calculation formula is as follows: in, This represents the total number of pixels within an image block representing the sample structure region. Indicates the first grayscale value of each pixel. This represents the average gray value of all pixels within the image block of the sample structure region. The larger the value, the clearer the texture of the image block representing the structural region of the sample.
[0040] Based on the difference between the aspect ratio of the bounding rectangle of the sample structural region image patch and the typical aspect ratio preset for the corresponding structural category, the spatial compactness index of each sample structural region image patch is calculated. Spatial compactness index The calculation formula is as follows: in, This represents the width of the bounding rectangle of the image patch representing the sample structure region. This represents the height of the bounding rectangle of the image patch representing the sample structure region. This indicates the preset typical aspect ratio corresponding to this structure category. The closer the value is to 1, the more the shape of the image patch representing the structural region of the sample conforms to the standard geometric features.
[0041] Based on the contrast evaluation index and the spatial compactness index, sample feature vectors that meet preset quality conditions are selected. Specifically, only [feature vectors] are retained. Greater than the preset contrast threshold and The sample feature vectors greater than the preset compactness threshold value are obtained, and a plurality of normal feature templates are obtained. Finally, the normal feature templates are classified according to the structure categories corresponding to the normal feature templates, and a preset normal feature template set is obtained.
[0042] Regarding the construction process of the preset pseudo-abnormal feature set, the prior art often lacks real abnormal samples, and the real abnormal samples are difficult to cover all possible damage conditions. Therefore, the present application generates pseudo-abnormal features using the idea of manifold learning. The pseudo-abnormal feature set is generated by applying a controlled disturbance along the minimum principal axis direction of the feature distribution of each normal feature template according to the normal feature template set. The minimum principal axis direction represents the direction with the smallest variance of data distribution, that is, the normal sample changes very little in this direction, so the disturbance in this direction can best simulate the small hidden danger that destroys the structural consistency, rather than the large fluctuation caused by environmental light.
[0043] The specific construction process is as follows: for each normal feature template in the normal feature template set, a preset number of sample feature vectors with the smallest Euclidean distance from the normal feature template are selected from the sample feature vectors as the neighboring sample feature group of the normal feature template. Let the preset number be The neighboring sample feature group is represented as In actual application, the preset number is too small, which will lead to inaccurate estimation of local feature distribution, and the preset number is too large, which will introduce non-relevant noise samples. Usually, the preset number is set to an integer between 5 and 20, preferably 10, to balance the accuracy and computational efficiency of the covariance matrix calculation.
[0044] According to the plurality of sample feature vectors contained in the neighboring sample feature group, a local covariance matrix is calculated. The local covariance matrix is calculated according to the following formula: wherein, represents the i-th sample feature vector in the neighboring sample feature group, represents the mean vector of the neighboring sample feature group, represents the matrix transpose operation.
[0045] The local covariance matrix is subjected to eigenvalue decomposition, and a plurality of eigenvalues and the eigenvectors corresponding to each eigenvalue are obtained. The minimum eigenvalue in the plurality of eigenvalues is selected, and the eigenvector corresponding to the minimum eigenvalue is determined as the minimum principal axis direction vector, denoted as .
[0046] The minimum principal axis direction vector is weighted using a preset perturbation intensity coefficient, and the weighted vector is then superimposed onto the normal feature template to obtain the pseudo-anomaly feature vector corresponding to the normal feature template. The calculation formula is as follows: in, This represents the normal feature template currently being processed. This represents the preset disturbance intensity coefficient. The value of determines the severity of the simulated anomaly. If If the value is too large, the generated pseudo-anomaly feature vector may deviate too far from the normal feature manifold, resulting in a mismatch with the true characteristics of minor potential hazards; if... If the value is too small, it will be impossible to effectively distinguish between normal fluctuations and abnormal offsets. The preset disturbance intensity coefficient is typically set... Set within the range of 0.1 to 0.5 to accurately simulate the offset of early, minor defects in the feature space.
[0047] Finally, the pseudo-abnormal feature vectors corresponding to each normal feature template are aggregated to obtain a preset set of pseudo-abnormal features.
[0048] The calculation of normal feature difference values involves calculating the minimum matching difference between the feature vector of each structural region and the preset set of normal feature templates, thus obtaining the normal feature difference value corresponding to the feature vector of each structural region. This process aims to find the nearest neighbor of the feature to be tested in the normal space.
[0049] Specifically, this includes: for each structural region feature vector, calculating the Euclidean distance between the structural region feature vector and each normal feature template in the normal feature template set, and generating a feature matching distance set corresponding to the structural region feature vector. Assume the structural region feature vector is... Any normal feature template is The Euclidean distance between the two The calculation is as follows: in, The dimension of the feature vector. and The vectors at the th The numerical value in the dimension. The minimum value is selected from the set of feature matching distances, and this minimum value is determined as the normal feature difference value corresponding to the feature vector of the structural region.
[0050] The maximum similarity of each structural region feature vector and the preset pseudo-anomaly feature set is calculated respectively to obtain the pseudo-anomaly feature similarity value corresponding to each structural region feature vector. This process aims to determine whether the to-be-detected feature has a trend of deviation along the direction of the minimum principal axis.
[0051] Specifically, for each structural region feature vector, the cosine similarity between the structural region feature vector and each pseudo-anomaly feature vector in the pseudo-anomaly feature set is calculated respectively to obtain a feature similarity set corresponding to the structural region feature vector. Assuming that the structural region feature vector is , and any pseudo-anomaly feature vector is , the cosine similarity between the two is The calculation is as follows: wherein, denotes vector dot product operation, denotes the L2 norm of a vector. The maximum value is selected from the feature similarity set, and the maximum value is determined as the pseudo-anomaly feature similarity value corresponding to the structural region feature vector.
[0052] In the above manner, the degree of deviation of the to-be-detected target from the normal state is measured, and the trend of evolution of the to-be-detected target to a specific hidden danger is also measured, thereby constructing a dual criterion considering distance and direction, and significantly improving the detection sensitivity of small structural hidden dangers of power-related facilities.
[0053] In step S4, the feature matching difference degree corresponding to each structural region image block is determined according to the normal feature difference value and the pseudo-anomaly feature similarity value corresponding to each structural region feature vector, and the anomaly detection result of each structural region image block is obtained based on the feature matching difference degree. The anomaly detection result of the power-related facility image is determined according to the anomaly detection results of the structural region image blocks.
[0054] In a preferred embodiment, determining the feature matching difference degree corresponding to each structural region image block according to the normal feature difference value and the pseudo-anomaly feature similarity value corresponding to each structural region feature vector, and obtaining the anomaly detection result of each structural region image block based on the feature matching difference degree, includes: For each structural region feature vector, the normal feature difference value and the pseudo-anomaly feature similarity value corresponding to the current structural region feature vector are weighted and summed by using a preset weighting coefficient to obtain the feature matching difference degree corresponding to the current structural region image block. It is determined whether the feature matching difference degree is greater than a preset anomaly determination threshold. If the feature matching difference degree is greater than the anomaly determination threshold, the current structural region image block is determined as an abnormal region. If the feature matching difference degree is less than or equal to an abnormality determination threshold, it is determined that the current structural region image block is a normal region.
[0055] In a preferred embodiment, according to the abnormality detection results of each structural region image block, the abnormality detection result of the power-related facility image is determined, including: The number of structural region image blocks determined as abnormal regions is counted to obtain an abnormal region count value corresponding to the power-related facility image; The abnormal region count value is compared with a preset alarm number threshold; If the abnormal region count value is greater than the alarm number threshold, it is determined that the abnormality detection result of the power-related facility image is abnormal; If the abnormal region count value is less than or equal to the alarm number threshold, it is determined that the abnormality detection result of the power-related facility image is normal.
[0056] Specifically, this step aims to establish a comprehensive evaluation system that integrates distance measure and direction measure, and to realize accurate diagnosis of the health status of the power-related facility through hierarchical determination logic from local regions to the whole image.
[0057] Regarding the calculation and determination of the feature matching difference degree of the local region, in a preferred embodiment, according to the normal feature difference value and the pseudo-abnormal feature similarity value corresponding to each structural region feature vector, the feature matching difference degree corresponding to each structural region image block is determined. This process is not simply a list of numerical values, but a weighted fusion strategy is used to unify two different physical meaning measurement indicators into a scalar space.
[0058] Specifically, for each structural region feature vector, the normal feature difference value and the pseudo-abnormal feature similarity value corresponding to the structural region feature vector are weighted and summed using a preset weighting coefficient to obtain the feature matching difference degree corresponding to the structural region image block. The calculation formula of the feature matching difference degree is expressed as follows: wherein, represents the normal feature difference value corresponding to the structural region feature vector, which reflects the degree of deviation of the target to be tested from the normal distribution center; represents the pseudo-abnormal feature similarity value corresponding to the structural region feature vector, which reflects the trend strength of the target to be tested along the direction of the minimum principal axis; represents a preset first weighting coefficient, used to adjust the sensitivity of the model to the overall distribution deviation; represents a preset second weighting coefficient, used to adjust the sensitivity of the model to the small hidden danger in a specific direction. and The specific values are set according to statistical characteristics of historical samples or expert experience, and generally require Through the above formula, the feature matching difference degree can capture both large background fluctuations and small structural defects, thereby achieving comprehensive coverage of different types of abnormalities.
[0059] In one embodiment, before the preset weighting coefficient is used to weight and sum the normal feature difference value and the pseudo abnormal feature similarity value corresponding to each structural region feature vector, in order to eliminate the difference in dimension and numerical range between Euclidean distance and cosine similarity, and prevent indicators with larger values from dominating the calculation results, the normal feature difference value and the pseudo abnormal feature similarity value need to be normalized first, so that they are mapped to the same numerical interval (such as the interval [0, 1]), and then the weighted sum is performed based on the normalized values to obtain the feature matching difference degree corresponding to the structural region image block.
[0060] Subsequently, the abnormality detection result of each structural region image block is obtained based on the feature matching difference degree. It is determined whether the feature matching difference degree is greater than a preset abnormality determination threshold. The preset abnormality determination threshold is a boundary line for distinguishing between normal fluctuations and pathological defects.
[0061] If the feature matching difference degree is greater than the preset abnormality determination threshold, it indicates that the structural region image block significantly deviates from the normal template in the feature space and has a tendency to evolve into a pseudo abnormal feature, and therefore the structural region image block is determined to be an abnormal region.
[0062] If the feature matching difference degree is less than or equal to the preset abnormality determination threshold, it indicates that the feature change of the structural region image block is within the allowable tolerance range, or the change direction does not conform to the evolution law of structural defects, and therefore the structural region image block is determined to be a normal region.
[0063] Regarding the determination of the overall detection result of the power-related facility image, in one preferred embodiment, the abnormality detection result of the power-related facility image is determined according to the abnormality detection results of each structural region image block. Considering that there may be isolated noise points or errors in individual segmentation edges in the power-related facility image, if only the abnormality of a single structural region image block is used to determine the abnormality of the entire image, the false positive rate may increase. Therefore, the present application introduces a fault-tolerant determination mechanism based on quantity statistics.
[0064] Specifically, it includes: counting the number of structural region image blocks determined to be abnormal regions, to obtain an abnormal region count value corresponding to the power-related facility image. The count value directly reflects the scale or frequency of suspected defective components in the power-related facility.
[0065] The abnormal region count value is compared with a preset alarm quantity threshold. The preset alarm quantity threshold is used to set the tolerance of the system to the existence of abnormal regions.
[0066] If the abnormal region count value is greater than the preset alarm quantity threshold, it means that there are components in the power-related facility that exhibit abnormal characteristics beyond the tolerance limit. At this time, the system should issue an alarm, so it is determined that the abnormality detection result of the power-related facility image is abnormal.
[0067] If the abnormal region count value is less than or equal to the alarm quantity threshold, it means that although there are individual suspected abnormal regions, their number does not reach the level of a substantial hidden danger. It may be an occasional false positive caused by environmental transient interference (such as a flying bird blocking, a strong highlight point), so it is determined that the abnormality detection result of the power-related facility image is normal.
[0068] Through the above hierarchical decision logic, the present application can ensure high sensitivity to minor hidden dangers while effectively suppressing false alarms caused by environmental noise through the dual mechanisms of weighted fusion and quantity threshold filtering, significantly improving the robustness and accuracy of power-related facility component abnormality detection.
[0069] On the basis of the above-mentioned method embodiment, the present application correspondingly provides a device embodiment.
[0070] As shown in Figure 2 An embodiment of the present application provides a power-related facility component abnormality detection device based on feature matching, which comprises an image acquisition module, an image processing module, a feature matching module and an abnormality determination module. The image acquisition module is used to acquire a power-related facility image to be detected. The image processing module is used to divide the power-related facility image into structural region image blocks by using a preset semantic segmentation model, and extract structural region feature vectors corresponding to each structural region image block by using a preset feature extraction model. The feature matching module is used to calculate the minimum matching difference between each structural region feature vector and a preset normal feature template set, to obtain the normal feature difference value corresponding to each structural region feature vector; and calculate the maximum similarity between each structural region feature vector and a preset pseudo-abnormal feature set, to obtain the pseudo-abnormal feature similarity value corresponding to each structural region feature vector; wherein the pseudo-abnormal feature set is generated by applying controlled disturbance along the minimum principal axis direction of the local distribution of each normal feature template feature according to the normal feature template set. The anomaly determination module is configured to determine a feature matching difference degree of each structural region image block according to the normal feature difference value and the pseudo-anomaly feature similarity value corresponding to the structural region feature vector, and obtain an anomaly detection result of each structural region image block based on the feature matching difference degree; and determine the anomaly detection result of the power-related facility image according to the anomaly detection result of each structural region image block.
[0071] Specifically, an embodiment of the present application provides a power-related facility component anomaly detection device based on feature matching, which comprises an image acquisition module, an image processing module, a feature matching module and an anomaly determination module.
[0072] The image acquisition module is configured to acquire a power-related facility image to be detected from a UAV inspection terminal or a fixed online monitoring device. In order to ensure the quality of input data and eliminate random noise introduced by an imaging sensor, the image acquisition module is further configured to perform denoising processing and size normalization processing on the power-related facility image, and adjust the power-related facility image to a unified specification suitable for subsequent model input.
[0073] The image processing module is configured to perform pixel-level structural region division on the power-related facility image by using a preset semantic segmentation model. The preset semantic segmentation model adopts a deep convolutional neural network architecture, can identify and segment insulating substation, shock absorber and wire clamp power-related facility components, generate a structural region mask according to the segmentation result, and cut to obtain at least one structural region image block. The image processing module further encodes each structural region image block by using a preset feature extraction model, and extracts a structural region feature vector that implicitly contains component texture and morphological information. The preset feature extraction model is trained by a metric learning strategy, and can map visual information into a discriminative low-dimensional vector representation.
[0074] The feature matching module is configured to perform a feature comparison operation based on a dual reference system. On one hand, the feature matching module traverses a preset normal feature template set, calculates Euclidean distances between the structural region feature vector and each normal feature template, and determines a minimum value in the set of calculated Euclidean distances as a normal feature difference value, so as to quantify a degree of deviation of the target to be tested from a normal distribution center. On the other hand, the feature matching module traverses a preset pseudo-abnormal feature set, calculates cosine similarities between the structural region feature vector and each pseudo-abnormal feature vector, and determines a maximum value in the set of calculated cosine similarities as a pseudo-abnormal feature similarity value, so as to quantify a trend of evolution of the target to be tested along a specific hidden danger direction. In particular, the generation logic of the pseudo-abnormal feature set is as follows: for each normal feature template in the normal feature template set, a minimum principal axis direction vector in a neighborhood of the normal feature template is extracted by principal component analysis, and a controlled disturbance is superimposed on the minimum principal axis direction vector by using a preset disturbance intensity coefficient, so as to construct a reference feature that specifically simulates a micro-structure hidden danger.
[0075] The abnormality determination module is configured to perform weighted summation on the normal feature difference value and the pseudo-abnormal feature similarity value according to a preset weighting coefficient, and calculate a feature matching difference degree corresponding to each structural region image block. The abnormality determination module compares the feature matching difference degree with a preset abnormality determination threshold value, and determines that the corresponding structural region image block is an abnormal region if the feature matching difference degree is greater than the preset abnormality determination threshold value. After completing the local determination of all regions, the abnormality determination module counts a number of abnormal regions in the power-related facility image, obtains an abnormal region count value, and compares the abnormal region count value with a preset alarm quantity threshold value. If the abnormal region count value is greater than the preset alarm quantity threshold value, the abnormality determination module outputs a detection result representing that the power-related facility image is in an abnormal state. Through the cooperative work of the above modules, the power-related facility component abnormality detection device based on feature matching can effectively combine the advantages of distance measurement and direction measurement, accurately distinguish non-structural environmental interference and micro-structure hidden danger in a complex outdoor environment, and significantly improve the automation level and fault detection rate of power inspection.
[0076] In a preferred embodiment, the power-related facility component abnormality detection device based on feature matching is constructed in the following manner: A plurality of power-related facility sample images in a normal state are obtained. The preset semantic segmentation model is used to divide the structural regions of each power-related facility sample image, to obtain a plurality of sample structural region image blocks corresponding to each power-related facility sample image and a structural category corresponding to each sample structural region image block. extracting features of each sample structure region image block by using the feature extraction model to obtain a sample feature vector corresponding to each sample structure region image block; calculating a contrast evaluation index of each sample structure region image block based on a standard deviation of pixel gray levels in the sample structure region image block; calculating a spatial compactness index of each sample structure region image block based on a difference between an aspect ratio of a circumscribed rectangle of the sample structure region image block and a typical aspect ratio preset for the corresponding structure category; selecting sample feature vectors satisfying a preset quality condition according to the contrast evaluation index and the spatial compactness index to obtain a plurality of normal feature templates; classifying the normal feature templates according to the structure categories corresponding to the normal feature templates to obtain a normal feature template set.
[0077] In a preferred embodiment, the electrical facility component anomaly detection device based on feature matching constructs a pseudo-anomaly feature set by the following method: For each normal feature template in the normal feature template set, a preset number of sample feature vectors with the smallest Euclidean distance from the current normal feature template are selected from the sample feature vectors as a neighboring sample feature group of the current normal feature template; calculating a local covariance matrix according to the plurality of sample feature vectors contained in the neighboring sample feature group; performing eigenvalue decomposition on the local covariance matrix to obtain a plurality of eigenvalues and eigenvectors corresponding to each eigenvalue; selecting the smallest eigenvalue from the plurality of eigenvalues and determining the eigenvector corresponding to the smallest eigenvalue as a minimum principal axis direction vector; weighting the minimum principal axis direction vector by a preset perturbation intensity coefficient and superimposing the weighted vector to the current normal feature template to obtain a pseudo-anomaly feature vector corresponding to the current normal feature template; converging the pseudo-anomaly feature vectors corresponding to each normal feature template to obtain a pseudo-anomaly feature set.
[0078] In a preferred embodiment, the feature matching module calculates the minimum matching difference between each structure region feature vector and the preset normal feature template set to obtain a normal feature difference value corresponding to each structure region feature vector, including: For each structure region feature vector, calculating the Euclidean distance between the current structure region feature vector and each normal feature template in the normal feature template set to generate a feature matching distance set corresponding to the current structure region feature vector; selecting the minimum value from the feature matching distance set and determining the minimum value as the normal feature difference value corresponding to the current structure region feature vector.
[0079] In a preferred embodiment, the feature matching module calculates the maximum similarity between each structural region feature vector and the preset pseudo-anomaly feature set respectively, to obtain the pseudo-anomaly feature similarity value corresponding to each structural region feature vector, including: For each structural region feature vector, the cosine similarity between the current structural region feature vector and each pseudo-anomaly feature vector in the pseudo-anomaly feature set is calculated respectively, to obtain a feature similarity set corresponding to the current structural region feature vector; The maximum value is selected from the feature similarity set, and the maximum value is determined as the pseudo-anomaly feature similarity value corresponding to the current structural region feature vector.
[0080] In a preferred embodiment, the anomaly determination module determines the feature matching difference degree corresponding to each structural region image block according to the normal feature difference value and the pseudo-anomaly feature similarity value corresponding to each structural region feature vector, and obtains the anomaly detection result of each structural region image block based on the feature matching difference degree, including: For each structural region feature vector, the normal feature difference value and the pseudo-anomaly feature similarity value corresponding to the current structural region feature vector are weighted and summed using a preset weighting coefficient, to obtain the feature matching difference degree corresponding to the current structural region image block; It is judged whether the feature matching difference degree is greater than a preset anomaly determination threshold; If the feature matching difference degree is greater than the anomaly determination threshold, the current structural region image block is determined as an abnormal region; If the feature matching difference degree is less than or equal to the anomaly determination threshold, the current structural region image block is determined as a normal region.
[0081] In a preferred embodiment, the anomaly determination module determines the anomaly detection result of the power-related facility image according to the anomaly detection results of each structural region image block, including: The number of structural region image blocks determined as abnormal regions is counted, to obtain an abnormal region count value corresponding to the power-related facility image; The abnormal region count value is compared with a preset alarm quantity threshold; If the abnormal region count value is greater than the alarm quantity threshold, the anomaly detection result of the power-related facility image is determined as abnormal; If the abnormal region count value is less than or equal to the alarm quantity threshold, the anomaly detection result of the power-related facility image is determined as normal.
[0082] It should be noted that the above-described embodiments of the device correspond to the above-described embodiments of the application, and can realize any one of the above-described feature matching-based power-related facility component anomaly detection methods. In addition, the above-described embodiments of the device are only illustrative, and the modules described as separate components can or can not be physically separated, and the components displayed as modules can or can not be physical units, i.e., they can be located in one place or distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the present embodiment. In addition, the connection relationship between the modules in the device embodiment provided by the present application indicates that there is a communication connection between them, which can be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement it without creative labor.
[0083] On the basis of the above-described method embodiments of the present application, an electronic device embodiment is correspondingly provided.
[0084] An embodiment of the present application provides an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, when the processor executes the computer program, realizing the feature matching-based power-related facility component anomaly detection method according to any one of the embodiments of the present application, or when the processor executes the computer program, realizing the functions of the modules in the above-described device embodiments.
[0085] For example, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present application. The one or more modules can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program in the terminal device.
[0086] The terminal device can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing devices. The terminal device can include, but is not limited to, a processor and a memory.
[0087] The processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The processor is a control center of the terminal device, and connects all parts of the terminal device through various interfaces and lines.
[0088] The memory can be used to store the computer program and / or modules, and the processor realizes various functions of the terminal device by running or executing the computer program and / or modules stored in the memory, and calling data stored in the memory. The memory can mainly include a program storage area and a data storage area. The program storage area can store an operating system, at least one application program required by a function, etc.; and the data storage area can store data created according to use of the mobile phone, etc. In addition, the memory can include a high-speed random access memory, and can also include a nonvolatile memory, for example, a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state memory devices.
[0089] On the basis of the above-mentioned method embodiment, the application provides a storage medium embodiment; Another embodiment of the application provides a storage medium, which comprises a stored computer program, wherein when the computer program runs, the device where the storage medium is located performs any one of the above-mentioned power facility component anomaly detection methods based on feature matching.
[0090] The storage medium is a computer readable storage medium, and the computer program includes computer program code in the form of source code, object code, an executable file, or some intermediate form, etc. The computer readable medium can include any entity or device capable of carrying the computer program code, a recording medium, a U disk, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, a software distribution medium, etc.
[0091] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example" or "some examples" means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the specific features, structures, materials or characteristics described can be combined in any suitable manner in any one or more embodiments or examples. In addition, the person skilled in the art can combine and combine the different embodiments or examples described in the present specification and the features of the different embodiments or examples without contradiction.
[0092] The above is the preferred embodiment of the present application. It should be noted that for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, which are also considered within the scope of protection of the present application.
Claims
1. A method for detecting anomalies in electrical facility components based on feature matching, characterized in that, include: Acquire images of the electrical facilities to be inspected; The image of the power facility is divided into structural regions using a preset semantic segmentation model to generate at least one structural region image block, and the structural region feature vector corresponding to each structural region image block is extracted using a preset feature extraction model. Calculate the minimum matching difference between the feature vector of each structural region and the preset set of normal feature templates to obtain the normal feature difference value corresponding to the feature vector of each structural region; The maximum similarity between the feature vector of each structural region and the preset pseudo-anomaly feature set is calculated to obtain the pseudo-anomaly feature similarity value corresponding to the feature vector of each structural region; wherein, the pseudo-anomaly feature set is generated by applying controlled perturbation along the minimum principal axis direction of the local distribution of each normal feature template based on the normal feature template set; Based on the normal feature difference value and pseudo-abnormal feature similarity value corresponding to the feature vector of each structural region, the feature matching difference degree corresponding to each structural region image block is determined, and the abnormal detection result of each structural region image block is obtained based on the feature matching difference degree. Based on the anomaly detection results of image blocks in each structural region, the anomaly detection results of the image of the electrical facility are determined.
2. The method for detecting anomalies in electrical facility components based on feature matching as described in claim 1, characterized in that, Construct a set of normal feature templates using the following method: Acquire multiple sample images of power-related facilities in normal condition; The preset semantic segmentation model is used to divide the structural regions of each power-related facility sample image to obtain multiple sample structural region image blocks corresponding to each power-related facility sample image and the structural category corresponding to each sample structural region image block. The feature extraction model is used to extract features from image blocks of each sample structural region to obtain sample feature vectors corresponding to each sample structural region image block. Based on the standard deviation of pixel gray levels within image blocks of sample structural regions, the contrast evaluation index of each sample structural region image block is calculated. Based on the difference between the aspect ratio of the bounding rectangle of the sample structural region image block and the typical aspect ratio preset for the corresponding structural category, the spatial compactness index of each sample structural region image block is calculated. Based on the contrast evaluation index and the spatial compactness index, sample feature vectors that meet the preset quality conditions are selected to obtain multiple normal feature templates. The normal feature templates are categorized according to their corresponding structural categories to obtain a set of normal feature templates.
3. The method for anomaly detection of electrical facility components based on feature matching as described in claim 2, characterized in that, The pseudo-anomaly feature set is constructed using the following method: For each normal feature template in the normal feature template set, a preset number of sample feature vectors with the smallest Euclidean distance to the current normal feature template are selected from the sample feature vectors and used as the neighboring sample feature group of the current normal feature template. Calculate the local covariance matrix based on the multiple sample feature vectors contained in the neighboring sample feature group; The local covariance matrix is subjected to eigenvalue decomposition to obtain multiple eigenvalues and eigenvectors corresponding to each eigenvalue; Select the smallest eigenvalue from the plurality of eigenvalues, and determine the eigenvector corresponding to the smallest eigenvalue as the smallest principal axis direction vector; The minimum principal axis direction vector is weighted using a preset disturbance intensity coefficient, and the weighted vector is superimposed on the current normal feature template to obtain the pseudo-abnormal feature vector corresponding to the current normal feature template. By aggregating the pseudo-abnormal feature vectors corresponding to each normal feature template, a set of pseudo-abnormal features is obtained.
4. The method for anomaly detection of electrical facility components based on feature matching as described in claim 3, characterized in that, Calculate the minimum matching difference between the feature vector of each structural region and the preset set of normal feature templates to obtain the normal feature difference value corresponding to the feature vector of each structural region, including: For each structural region feature vector, calculate the Euclidean distance between the current structural region feature vector and each normal feature template in the normal feature template set, and generate the feature matching distance set corresponding to the current structural region feature vector. The minimum value is selected from the feature matching distance set, and the minimum value is determined as the normal feature difference value corresponding to the current structural region feature vector.
5. The method for anomaly detection of electrical facility components based on feature matching as described in claim 4, characterized in that, Calculate the maximum similarity between the feature vector of each structural region and the preset set of pseudo-anomaly features to obtain the pseudo-anomaly feature similarity value corresponding to the feature vector of each structural region, including: For each structural region feature vector, calculate the cosine similarity between the current structural region feature vector and each pseudo-abnormal feature vector in the pseudo-abnormal feature set to obtain the feature similarity set corresponding to the current structural region feature vector. The maximum value is selected from the set of feature similarities, and the maximum value is determined as the pseudo-anomaly feature similarity value corresponding to the current structural region feature vector.
6. The method for anomaly detection of electrical facility components based on feature matching as described in claim 5, characterized in that, Based on the normal feature difference value and pseudo-abnormal feature similarity value corresponding to the feature vectors of each structural region, the feature matching difference degree corresponding to each structural region image patch is determined, and the anomaly detection result of each structural region image patch is obtained based on the feature matching difference degree, including: For each structural region feature vector, the normal feature difference value and pseudo-abnormal feature similarity value corresponding to the current structural region feature vector are weighted and summed using preset weighting coefficients to obtain the feature matching difference degree corresponding to the current structural region image block. Determine whether the feature matching difference is greater than a preset anomaly detection threshold; If the feature matching difference is greater than the anomaly determination threshold, then the current structural region image block is determined to be an anomaly region. If the feature matching difference is less than or equal to the anomaly determination threshold, then the current structural region image block is determined to be a normal region.
7. The method for anomaly detection of electrical facility components based on feature matching as described in claim 6, characterized in that, Based on the anomaly detection results of image blocks in each structural region, the anomaly detection results of the image of the electrical facility are determined, including: The number of abnormal regions identified in each structural region image block is counted to obtain the abnormal region count value corresponding to the image of the power-related facility. The abnormal area count value is compared with a preset alarm quantity threshold; If the count value of the abnormal area is greater than the alarm quantity threshold, then the abnormal detection result of the image of the electrical facility is determined to be abnormal; If the abnormal area count is less than or equal to the alarm quantity threshold, the abnormal detection result of the image of the electrical facility is determined to be normal.
8. A device for detecting anomalies in electrical facility components based on feature matching, characterized in that, include: Image acquisition module, image processing module, feature matching module, and anomaly detection module; The image acquisition module is used to acquire images of the electrical facilities to be detected; The image processing module is used to divide the image of the power facility into structural regions using a preset semantic segmentation model, generate at least one structural region image block, and extract the structural region feature vector corresponding to each structural region image block using a preset feature extraction model. The feature matching module is used to calculate the minimum matching difference between the feature vector of each structural region and the preset normal feature template set, and obtain the normal feature difference value corresponding to the feature vector of each structural region; and to calculate the maximum similarity between the feature vector of each structural region and the preset pseudo-abnormal feature set, and obtain the pseudo-abnormal feature similarity value corresponding to the feature vector of each structural region; wherein, the pseudo-abnormal feature set is generated by applying controlled perturbation along the minimum principal axis direction of the local distribution of features of each normal feature template set based on the normal feature template set; The anomaly determination module is used to determine the feature matching difference degree corresponding to each structural region image block based on the normal feature difference value and pseudo-anomaly feature similarity value corresponding to the feature vector of each structural region, and to obtain the anomaly detection result of each structural region image block based on the feature matching difference degree; and to determine the anomaly detection result of the image of the power-related facility based on the anomaly detection result of each structural region image block.
9. An electronic device, characterized in that, The method includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the feature-matching-based anomaly detection method for electrical facility components as described in any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device where the storage medium is located to perform the feature matching-based anomaly detection method for electrical facility components as described in any one of claims 1 to 7.