Substation component anomaly diagnosis method and system, electronic device, and storage medium
By creating a positive sample library and combining mask segmentation and defect detection models, the problem that substation component anomaly diagnosis cannot accurately reflect the abnormal state has been solved, and accurate diagnosis of component anomalies and elimination of hidden dangers have been achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUAYAN INTELLIGENT TECH (GRP) CO LTD
- Filing Date
- 2026-05-19
- Publication Date
- 2026-06-19
AI Technical Summary
Existing technologies cannot directly reflect the abnormal state of substation components, nor can they accurately control the degree of harm caused by abnormal states to components.
By acquiring scene images of normal substation components, a positive sample library is created. Similarity calculation and mask annotation are performed. Combined with the substation component mask segmentation model and defect detection model, component segmentation and defect detection are performed to comprehensively diagnose abnormal conditions.
It enables accurate diagnosis of anomalies in substation components, timely elimination of potential hazards, and improves the accuracy and speed of diagnosis.
Smart Images

Figure CN122244023A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power equipment technology, specifically to a method, system, electronic device, and storage medium for diagnosing abnormalities in substation components. Background Technology
[0002] Oil leaks are common in substation components such as oil-filled equipment like oil conservators, riser mounts, coolers, and submersible pumps. Meanwhile, components like surge arrester grading rings, reactor bushings, circuit breaker leads, and busbar leads are frequently affected by floating debris. Therefore, effectively diagnosing abnormal conditions in substation components and promptly eliminating potential hazards has become a pressing expectation and goal in substation component anomaly diagnosis.
[0003] Currently, target detection algorithms are often used for abnormal diagnosis of substation components. Although target detection algorithms can diagnose internal and external defects of components in substations, such as oil leaks and floating objects, they cannot directly reflect the specific components with abnormal conditions, and therefore cannot accurately control the degree of harm caused by abnormal conditions to components. Summary of the Invention
[0004] In view of the above-mentioned shortcomings of the prior art, this application provides a method, system, electronic device and storage medium for abnormal diagnosis of substation components, which effectively solves the problem that the existing methods cannot directly reflect the specific components with abnormal states.
[0005] In a first aspect, this application provides a method for diagnosing abnormalities in substation components, the method comprising: Obtain multiple scene images of normal substation components, perform similarity calculation and mask annotation based on each of the normal substation component scene images, and create a positive sample library; Obtain a scene image of the substation component under test, and perform positive sample search and matching based on the scene image of the substation component under test and the positive sample library to obtain positive sample component mask targets; The scene image of the substation component under test is input into the substation component mask segmentation model to perform component segmentation and obtain negative sample component mask targets. The scene diagram of the substation component to be tested is input into the substation component defect detection model for defect detection to obtain negative sample defect detection targets. Anomaly diagnosis is performed based on the positive sample component mask target, the negative sample component mask target, and the negative sample defect detection target to obtain the anomaly diagnosis result of the substation component.
[0006] In an optional implementation, the step of performing comprehensive anomaly diagnosis based on the positive sample component mask target, the negative sample component mask target, and the negative sample defect detection target to obtain the substation component anomaly diagnosis result includes: The difference overlap rate is calculated based on the positive sample component mask target and the negative sample component mask target to obtain the target difference overlap rate; The target difference overlap rate is compared with the difference overlap rate threshold to obtain the negative sample component occlusion diagnosis result; The first variation overlap rate is obtained by calculating the variation overlap rate based on the negative sample defect detection target and the negative sample component mask target. The second variation overlap rate is obtained by calculating the variation overlap rate based on the negative sample defect detection target and the positive sample component mask target. The first variation overlap rate is compared with the first variation overlap rate threshold, and the second variation overlap rate is compared with the second variation overlap rate threshold to obtain the negative sample component defect diagnosis result; Based on the occlusion diagnosis results and defect diagnosis results of the negative sample components, a comprehensive diagnosis is performed to obtain the abnormal diagnosis results of the substation components.
[0007] In an optional implementation, the formula for calculating the difference overlap rate based on the positive sample component mask target and the negative sample component mask target is as follows:
[0008] In the above formula, Indicates component type is The i A positive sample component mask target The corresponding component type is The Negative sample component mask target The difference overlap rate, This represents the matrix union operation. This represents the matrix summation operation. This represents the absolute value operation; The formula for calculating the variation overlap rate based on the negative sample defect detection target and the negative sample component mask target is as follows:
[0009] In the above formula, Indicates the defect type as The Target for detecting defects in individual negative samples With component type The Negative sample component mask target The overlap rate of the variation, This represents the matrix intersection operation. This represents the matrix summation operation; The formula for calculating the variation overlap rate based on the negative sample defect detection target and the positive sample component mask target is as follows:
[0010] In the above formula, Indicates the defect type as The Target for detecting defects in individual negative samples With component type The i A positive sample component mask target The overlap rate of the variation, This represents the matrix intersection operation. This represents the matrix summation operation.
[0011] In an optional implementation, the step of performing a comprehensive diagnosis based on the negative sample component occlusion diagnosis result and the negative sample component defect diagnosis result to obtain the substation component anomaly diagnosis result includes: If the target difference overlap rate is less than the difference overlap rate threshold, then the negative sample component target is not occluded, and if the first variation overlap rate is less than the first variation overlap rate threshold, then the negative sample component target is not defective, and the substation component diagnosis result is normal. If the target difference overlap rate is less than the difference overlap rate threshold, then the negative sample component target is not occluded. If the first variation overlap rate is greater than or equal to the first variation overlap rate threshold, then the negative sample component target has a defect. The negative sample component mask target is bound to the corresponding negative sample defect detection target as the substation component anomaly diagnosis result. If the target difference overlap rate is greater than or equal to the difference overlap rate threshold, then the negative sample component target is occluded; and if the second variation overlap rate is less than the second variation overlap rate threshold, then the negative sample component target has no defect, and the substation component diagnosis result is normal. If the target difference overlap rate is greater than or equal to the difference overlap rate threshold, the negative sample component target is occluded. If the second variation overlap rate is greater than or equal to the second variation overlap rate threshold, the negative sample component target has a defect. The positive sample component mask target is bound to the corresponding negative sample defect detection target as the substation component anomaly diagnosis result.
[0012] In an optional implementation, the substation component defect detection model includes a backbone network, a feature pyramid network, and a decoupled network. The feature pyramid network includes a scale interaction attention module and a channel interaction attention module. The step of inputting the scene image of the substation component under test into the substation component defect detection model for defect detection to obtain negative sample defect detection targets includes: The scene map of the substation component under test is input into the backbone network for feature extraction to obtain the first layer feature map, the second layer feature map and the third layer feature map; The second-layer feature map and the third-layer feature map are input into the scale interaction attention module to obtain the first scale interaction attention feature map; The first-scale interactive attention feature map is concatenated with the second-layer feature map to obtain the first fused feature map; The first fused feature map and the first layer feature map are input into the scale interaction attention module to obtain the second scale interaction attention feature map. The second-scale interactive attention feature map is concatenated with the first-layer feature map to obtain the second fused feature map; The second fused feature map is convolved to generate a first intermediate feature map with the same resolution as the first fused feature map, and the first intermediate feature map is concatenated with the first fused feature map to obtain a third fused feature map. The third fused feature map is convolved to generate a second intermediate feature map with the same resolution as the third layer feature map, and the second intermediate feature map is concatenated with the third layer feature map to obtain a fourth fused feature map; The second fused feature map, the third fused feature map, and the fourth fused feature map are respectively input into the channel interaction attention module for feature enhancement to obtain the first target feature map, the second target feature map, and the third target feature map; The first target feature map, the second target feature map, and the third target feature map are input into the decoupled network for classification and regression to obtain the negative sample defect detection target.
[0013] In an optional implementation, the step of performing similarity calculations and mask annotations based on each of the normal substation component scene images to create a positive sample library includes: Calculate the perceptual hash value of each of the normal substation component scene diagrams, and save the perceptual hash values to a text file to obtain a positive sample text file; For each of the aforementioned normal substation component scene diagrams, component mask annotations are performed, and the annotated component mask targets are saved sequentially to [the appropriate file system]. json Multiple positive samples were obtained from the file. json document; Bind each of the aforementioned normal substation component scene diagrams to the corresponding positive samples. json The file is used to bind the corresponding perceptual hash value in the positive sample text file to obtain the positive sample library.
[0014] In an optional implementation, the step of performing positive sample search matching based on the scene diagram of the substation component under test and the positive sample library to obtain positive sample component mask targets includes: Calculate the target perception hash value of the scene map of the substation component under test; Parse the positive sample text file in the positive sample library to obtain a list of positive sample perceptual hash values; Traverse the list of positive sample perceptual hash values and calculate the Hamming distance between each positive sample perceptual hash value and the target perceptual hash value; Select the positive sample corresponding to the minimum Hamming distance as the target positive sample, and read the positive sample corresponding to the target positive sample. json The file is used to obtain the positive sample component mask target.
[0015] Secondly, this application provides a substation component anomaly diagnosis system, the system comprising: The positive sample creation module is used to acquire multiple scene images of normal substation components, perform similarity calculation and mask annotation based on each of the normal substation component scene images, and create a positive sample library. The positive sample search module is used to acquire a scene image of the substation component under test, and perform positive sample search and matching based on the scene image of the substation component under test and the positive sample library to obtain positive sample component mask targets. The negative sample segmentation module is used to input the scene image of the substation component under test into the substation component mask segmentation model to segment the component and obtain the negative sample component mask target. The negative sample detection module is used to input the scene diagram of the substation component under test into the substation component defect detection model for defect detection and obtain negative sample defect detection targets. The negative sample diagnosis module is used to perform comprehensive anomaly diagnosis based on the positive sample component mask target, the negative sample component mask target, and the negative sample defect detection target, and obtain the anomaly diagnosis result of the substation component.
[0016] Thirdly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the substation component anomaly diagnosis method as described in the first aspect of this application.
[0017] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the substation component anomaly diagnosis method as described in the first aspect of this application.
[0018] The substation component anomaly diagnosis method, system, electronic equipment, and storage medium provided in this application introduce positive and negative sample images for negative sample anomaly diagnosis. This not only effectively diagnoses the defect targets of the substation components under test but also accurately diagnoses the impact of defects on specific components, providing strong support for timely elimination of potential defects in specific substation components. Simultaneously, negative sample diagnosis is introduced through component occlusion diagnosis and component defect diagnosis, respectively, to diagnose negative sample component anomalies and achieve anomaly diagnosis of the substation components under test. Based on an improved target detection network, high-level feature maps are given detail attention in low-level feature maps, and fine-grained learning of target features is performed, enhancing the high-level semantic feature expression of the target and accelerating feature computation efficiency, thus ensuring the accuracy and speed of defect detection. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic flowchart of the substation component anomaly diagnosis method provided in the embodiments of this application; Figure 2 This is a schematic diagram of the substation component defect detection model in the embodiments of this application; Figure 3 This is a schematic diagram of the scale interaction attention module in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of the channel interaction attention module in an embodiment of this application; Figure 5 This is a schematic diagram of the substation component anomaly diagnosis system provided in the embodiments of this application; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0021] Explanation of key component symbols: 200. Substation component anomaly diagnosis system; 210. Positive sample creation module; 220. Positive sample search module; 230. Negative sample segmentation module; 240. Negative sample detection module; 250. Negative sample diagnosis module; 300. Electronic equipment; 310. Processor; 320. Communication interface; 330. Memory; 340. Communication bus. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be further described clearly and completely below with reference to the accompanying drawings of the embodiments. It should be noted that the described embodiments are merely some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0023] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of this application.
[0025] Currently, substation component anomaly diagnosis often employs target detection algorithms, such as the YOLO and DETR series, but these only diagnose internal and external defects in components. On the other hand, some methods stitch together a 3D network model of the entire scene based on the position of each component in a point cloud, but this doesn't analyze the component's state and cannot diagnose abnormal conditions. Furthermore, equipment fault diagnosis based on temperature distribution along the equipment outline lacks visual defect analysis and cannot assess the equipment's defect status. Therefore, current methods cannot directly reflect the specific component with an abnormal state, thus failing to accurately control the degree of harm caused by abnormal conditions.
[0026] Example 1 This application provides a method for diagnosing abnormalities in substation components, effectively solving the problem that existing methods cannot directly reflect the specific components with abnormal states, and thus cannot accurately control the degree of harm caused by abnormal states to components. Figure 1This is a schematic flowchart of the substation component anomaly diagnosis method provided in the embodiments of this application, such as... Figure 1 As shown, the method includes the following steps: S100. Obtain multiple scene images of normal substation components, perform similarity calculation and mask annotation based on each scene image of normal substation components, and create a positive sample library.
[0027] In this embodiment, positive and negative sample matching can be performed based on the scene map of the substation component under test to achieve component anomaly diagnosis. The scene map of the substation component under test is regarded as a negative sample. In order to match the negative sample with the most similar positive sample scene so as to obtain the component mask target corresponding to the positive sample, a positive sample library needs to be created in advance.
[0028] Optionally, multiple images of normal substation component scenes under different lighting conditions can be obtained for each normal substation component scene to construct a positive sample library. The number of normal substation component scene images can be set according to actual needs, for example, to 5 images. The steps for creating positive samples are as follows: S110. Calculate the perceptual hash value of each normal substation component scene diagram, and save the perceptual hash value to a text file to obtain a positive sample text file.
[0029] As an optional implementation of this application, the perceptual hash value of the normal substation component scene diagram can be calculated based on the classic search matching algorithm, and then uniformly saved as a hexadecimal string. txt The file saves the perception hash values of all normal substation component scene diagrams to a single file. txt The file contains a positive sample text file.
[0030] For example, the perceptual hash value of a normal substation component scene diagram can be calculated using a perceptual hash algorithm, with the following steps: First, the scene image of a normal substation component is reduced to a fixed, smaller size, such as 32×32 pixels. This removes details and size differences from the image, retaining only the most basic structural and brightness information, while significantly reducing the computational load in subsequent steps. The reduced-size color image is then converted to grayscale, further reducing the amount of data to be processed and allowing the perceptual hashing algorithm to focus more on the image's brightness information.
[0031] Then, a discrete cosine transform (DCT) is performed on the grayscale image to convert it from the pixel domain to the frequency domain, extracting the image's frequency features. After the transform, the image's energy is concentrated in the upper left corner, representing the low-frequency information, i.e., the main outline and structure of the image, while the lower right corner represents high-frequency information, i.e., details and noise. The 8×8 matrix in the upper left corner of the DCT result is retained, while other information is discarded. The 8×8 matrix contains the most important low-frequency information of the image and can represent the overall content of the image. By discarding the high-frequency components, the algorithm becomes more robust to changes in image details, minor cropping, or noise.
[0032] The arithmetic mean of the 64 coefficients in the resulting 8×8 matrix is then calculated and used as the benchmark for subsequent binarization comparisons. Each coefficient in the 8×8 matrix is iterated over and compared with the arithmetic mean. If the coefficient is greater than the arithmetic mean, the result is recorded as 1; otherwise, it is recorded as 0. In this way, each normal substation component scene diagram yields a set of ordered 64-bit binary encoded strings.
[0033] Finally, this 64-bit binary encoded string is converted into a 16-bit hexadecimal string to obtain the perceptual hash value of the scene image of a normal substation component. Converting it to a 16-bit hexadecimal string facilitates storage and display; for example, "d0d2d4e9a53465cd".
[0034] S120. Perform component mask annotation on each normal substation component scene diagram, and save the annotated component mask targets sequentially to... json Multiple positive samples were obtained from the file. json document.
[0035] Optionally, a mask annotation can be performed on the substation component targets in each normal substation component scene image using an image annotation tool to obtain component mask targets. These substation component targets include, but are not limited to, oil-filled equipment oil tanks, riser supports, coolers, submersible pumps, surge arrester equalizing rings, reactor bushings, circuit breaker leads, and busbar leads. The annotated component mask targets are then saved sequentially to... json Multiple positive samples were obtained from the file. json The document contains a diagram of a normal substation component scenario, which corresponds to one positive sample and one... json document.
[0036] S130. Bind each normal substation component scene diagram to its corresponding positive sample. json The file is used to bind the corresponding perceptual hash value in the positive sample text file to obtain the positive sample library.
[0037] By comparing each normal substation component scene diagram with the target of the stored component mask... jsonThe files are bound together, and simultaneously bound to the perceptual hash values of the image identifiers stored in the positive sample text files, thus obtaining a standardized positive sample library.
[0038] Based on this, by constructing a structured and searchable standardized positive sample library, a high-fidelity and normal benchmark for component alignment is provided for subsequent negative samples, ensuring the semantic comparability of positive and negative samples under the same component type and similar perspective, and providing a reliable reference for occlusion diagnosis and defect localization.
[0039] S200: Obtain the scene map of the substation component under test, and perform positive sample search and matching based on the scene map of the substation component under test and the positive sample library to obtain the positive sample component mask target.
[0040] In this embodiment of the application, in order to accurately measure the abnormal state of the substation components under test, obtain the component mask target corresponding to the positive sample, and accelerate the comparison efficiency of positive and negative samples, it is necessary to perform positive sample search using the scene map of the substation components under test. The positive sample search specifically includes the following steps: S210. Calculate the target perception hash value of the scene map of the substation component to be tested.
[0041] It is understandable that the target perceptual hash value can also be calculated using the perceptual hash algorithm in step S110 above, and will not be discussed again here.
[0042] S220. Parse the positive sample text files in the positive sample library to obtain a list of positive sample perceptual hash values.
[0043] In this embodiment of the application, a list of positive sample perceptual hash values is obtained by reading the positive sample text file storing the perceptual hash values in the positive sample library and parsing out all the perceptual hash values of the normal substation component scene diagrams.
[0044] S230. Traverse the list of positive sample perceptual hash values and calculate the Hamming distance between each positive sample perceptual hash value and the target perceptual hash value.
[0045] The target perceptual hash value is compared bit by bit with the perceptual hash value of each positive sample, and the number of different characters at corresponding positions is counted, which is the Hamming distance. The smaller the Hamming distance, the higher the image structural similarity. This allows for accurate matching of the closest normal scene positive sample, supporting subsequent component-level anomaly quantitative diagnosis. For example, it is generally believed that when the Hamming distance is less than 5, the two images are very similar, and if it is greater than 10, they are likely to be different images.
[0046] S240. Select the positive sample corresponding to the minimum Hamming distance as the target positive sample, and read the positive sample corresponding to the target positive sample. json The file is used to obtain the positive sample component mask target.
[0047] In this embodiment, by comparing the magnitudes of various Hamming distances, the perceptual hash value of the positive sample corresponding to the smallest Hamming distance is obtained. Based on this perceptual hash value, the corresponding target positive sample can be matched, and the positive sample of the target positive sample can be read. json The document ultimately yields positive sample component mask targets. These positive sample component mask targets include, but are not limited to, oil tanks, riser seats, coolers, submersible pumps, surge arrester equalizing rings, reactor bushings, circuit breaker leads, and busbar leads of oil-filled equipment.
[0048] Based on this, positive sample search achieves rapid and robust localization of the negative sample to be tested to the most similar positive sample by matching perceptual hash values with Hamming distance, thereby avoiding component misalignment caused by manual specification or hard template matching. Even under actual inspection interference such as changes in illumination and slight viewpoint shifts, it can still stably retrieve normal reference images of the same component, ensuring the spatial consistency and semantic alignment of subsequent component mask targets, and significantly improving the reliability of the diagnostic starting point.
[0049] S300. Input the scene image of the substation component to be tested into the substation component mask segmentation model to perform component segmentation and obtain the negative sample component mask target.
[0050] In this embodiment of the application, in order to better perceive the visual impact of defects on the substation components under test, it is necessary to segment the scene image of the substation components under test, thereby laying the foundation for the subsequent comparison and quantification of positive sample component mask targets and negative sample component mask targets.
[0051] As an optional implementation method of this application, it can be based on RT-DETR-l The instance segmentation algorithm is used to train the model and obtain the substation component mask segmentation model. The scene image of the substation component to be tested is input into the substation component mask segmentation model for component segmentation to obtain negative sample component mask targets. These negative sample component mask targets include, but are not limited to, targets such as oil-filled equipment oil tanks, riser seats, coolers, submersible pumps, surge arrester equalizing rings, reactor bushings, circuit breaker leads, and busbar leads.
[0052] For example, the training process for a substation component mask segmentation model can be as follows: First, obtain the original image library of the substation components. Then, construct an augmented image library of the substation components based on the original image library. Image augmentation methods include, but are not limited to, left / right flipping, angle rotation, and Gaussian noise operations. Next, merge the original image library and the augmented image library of the substation components to obtain a training sample library for the substation components. Finally, train the model based on the substation component training sample library. RT-DETR-l The instance segmentation algorithm yields a mask segmentation model of substation components.
[0053] Based on this, the substation component mask segmentation model can accurately extract pixel-level mask targets of various substation components, providing a spatial positioning benchmark for subsequent anomaly diagnosis. Especially when there is occlusion or defect interference, it can still output the complete substation component outline, making up for the coarse-grained defects of simple detection boxes.
[0054] S400. Input the scene diagram of the substation component to be tested into the substation component defect detection model for defect detection and obtain negative sample defect detection targets.
[0055] In this embodiment of the application, in order to quickly capture the defects generated inside the substation component under test and the interference received outside the component, it is necessary to perform defect detection on the scene map of the substation component under test. That is, the scene map of the substation component under test is input into the substation component defect detection model to obtain negative sample defect detection targets. The negative sample defect detection targets include, but are not limited to, defect detection types such as oil leakage on the component surface, insulator breakage, and foreign floating objects.
[0056] As a further implementation of this application, given the complex and varied nature of substation scenarios, the diverse types of defects, and the varying sizes of targets, in order to quickly and accurately detect defect types, the substation component defect detection model in this application can be constructed and trained using an improved YOLO12-m target detection model. Therefore, the substation component defect detection model can not only effectively cover the scale range of various defect types but also effectively perceive the detailed features of each defect. Furthermore, through TensorRT model conversion, defect detection of the substation component scene image under test can be quickly completed.
[0057] Figure 2 This is a schematic diagram of the substation component defect detection model in the embodiments of this application, as shown below. Figure 2 As shown, the substation component defect detection model includes a backbone network, a feature pyramid network, and a decoupled network. To accurately capture detailed defect features and quickly extract defect targets, a scale interaction attention module is introduced into the feature pyramid network, making it more attentive to scale changes in the defect. Furthermore, a channel interaction attention module is introduced after the three-layer fused feature map, enabling the feature pyramid network to capture fine-grained defect features. The defect detection based on the substation component defect detection model specifically includes the following steps: S410. Input the scene map of the substation component to be tested into the backbone network for feature extraction to obtain the first layer feature map, the second layer feature map and the third layer feature map.
[0058] In this embodiment, the backbone network adopts a residual high-efficiency layer aggregation network architecture. It uses stacked C3K2 and A2C2F modules to form three convolutional layers (Conv3, Conv4, and Conv5) as the core of feature extraction, achieving multi-scale feature extraction. The Conv3 layer is mainly composed of C3K2 modules, responsible for shallow feature extraction, emphasizing local texture and shape information. The Conv4 layer uses a combination of C3K2 and A2C2F modules, gradually introducing global context awareness. The Conv5 layer is primarily composed of A2C2F modules, strengthening high-level semantic features and long-distance dependency modeling. The scene image of the substation components under test is processed layer by layer through Conv3 to Conv5 in the backbone network to obtain the first-layer feature map F3, the second-layer feature map F4, and the third-layer feature map F5, which are then input into the improved feature pyramid network.
[0059] S420. Input the second-layer feature map and the third-layer feature map into the scale interaction attention module to obtain the first-scale interaction attention feature map.
[0060] After the second-layer feature map F4 and the third-layer feature map F5 are input into the feature pyramid network, multi-scale feature extraction and cross-scale interactive fusion are performed through the Scale Interactive Attention (SIAM) module to obtain the first-scale interactive attention feature map SIAF1. The SIAM module explicitly models the cross-scale similarity between high- and low-layer features, enabling the network to adaptively weight key regions such as oil leak edges and floating object contours during fusion, significantly improving the localization accuracy of small targets. This is suitable for complex scenarios with large differences in the scale of substation components and frequent occlusion. Figure 3 This is a schematic diagram of the scale interaction attention module in an embodiment of this application, as shown below. Figure 3 As shown, the specific steps for processing through the scale interaction attention module are as follows: First, the low-level high-resolution feature map is processed by a 1×1 convolution operation to obtain a convolutional feature map with the same resolution. Then, the high-level low-resolution feature map is processed by an upsampling operation to generate an upsampled feature map with the same resolution as the low-level high-resolution feature map.
[0061] Then, the convolutional feature maps are convolved with 1×1 to obtain the projection matrix. Q The upsampled feature map is convolved with a 1×1 matrix to obtain the projection matrix. K Projection matrix Q With projection matrix K Similarity matching is performed to obtain a similarity matching matrix, which is then passed through a ReLU activation function to obtain an attention weighting matrix. W .
[0062] Simultaneously, the convolutional feature map and the upsampled feature map are concatenated through channels to obtain a fused feature map. The fused feature map is then subjected to a 1×1 convolution to obtain a half-channel fused feature map, which is then further convolved with a 1×1 convolution to obtain the projection matrix. V .
[0063] Finally, the projection matrix V With attention weighting matrix W Performing matrix multiplication yields the scale-interactive attention feature map. The specific formula for obtaining the scale-interactive attention feature map is as follows:
[0064] In the above formula, Represents the scale-based interactive attention feature map. Q This represents the projection matrix obtained by convolving the convolutional feature map. K This represents the projection matrix obtained by convolving the upsampled feature map. Represents the projection matrix K The vector dimension in V This represents the projection matrix obtained by convolving the half-channel fused feature map.
[0065] S430. Concatenate the first-scale interactive attention feature map with the second-layer feature map to obtain the first fused feature map.
[0066] Since the second-layer feature map F4 retains the spatial details of the original high-resolution features, such as component edges and bolt textures, the first-scale interactive attention feature map SIAF1 and the second-layer feature map F4 are concatenated to obtain the first fused feature map P41. This allows subsequent convolutions to focus more on abnormally sensitive regions and avoids the loss of structural information caused by the attention feature map directly replacing the original features.
[0067] S440. Input the first fused feature map and the first layer feature map into the scale interaction attention module to obtain the second scale interaction attention feature map.
[0068] Similarly, the first fused feature map P41 and the first layer feature map F3 are used to perform multi-scale feature extraction and cross-scale interactive fusion through the scale interactive attention module to obtain the second scale interactive attention feature map SIAF2.
[0069] S450. Concatenate the second-scale interactive attention feature map with the first-layer feature map to obtain the second fused feature map.
[0070] Since the first-layer feature map F3 has original high-resolution spatial fidelity, the second-scale interactive attention feature map SIAF2 is concatenated with the first-layer feature map F3 to obtain the second fused feature map P3. This enables the network to perceive high-level semantic constraints at the finest-grained layer, effectively alleviating the problem of shallow feature semantic poverty.
[0071] S460. Convolve the second fused feature map to generate a first intermediate feature map with the same resolution as the first fused feature map, and concatenate the first intermediate feature map with the first fused feature map to obtain a third fused feature map.
[0072] The second fusion feature map P3 is convolved through a convolutional layer to generate a first intermediate feature map PAF1 with the same resolution as the first fusion feature map P41. The first intermediate feature map PAF1 is then concatenated with the first fusion feature map P41 to achieve bottom-up fine-grained information injection, generating a third fusion feature map P4. This third fusion feature map P4 maintains a medium semantic level while incorporating the high-precision spatial structure carried by the second fusion feature map P3, enhancing the ability to model abnormal shapes such as local deformation of components and occlusion edges.
[0073] S470. Convolve the third fused feature map to generate a second intermediate feature map with the same resolution as the third layer feature map, and concatenate the second intermediate feature map with the third layer feature map to obtain the fourth fused feature map.
[0074] Similarly, the third fusion feature map P4 is convolved through a convolutional layer to generate a second intermediate feature map PAF2 with the same resolution as the third feature map F5. The second intermediate feature map PAF2 is then concatenated with the third feature map F5 to generate a fourth fusion feature map P5, which enhances the global discrimination capability of the fourth fusion feature map P5 for large-scale anomalies.
[0075] S480. Input the second fused feature map, the third fused feature map and the fourth fused feature map into the channel interaction attention module for feature enhancement to obtain the first target feature map, the second target feature map and the third target feature map.
[0076] In this embodiment, the second fused feature map P3, the third fused feature map P4, and the fourth fused feature map P5 are enhanced by the Channel Interaction Attention (CIAM) module to quickly obtain cross-level fine-grained feature maps from top to bottom and bottom to top, namely the first target feature map T3, the second target feature map T4, and the third target feature map T5. The CIAM module generates fine-grained attention weights by modeling the semantic relationships between features from different channels, dynamically enhancing discriminative channels and suppressing redundant noise channels. Simultaneously, its lightweight design avoids the overhead of full connectivity, significantly improving the channel-level sensitivity and classification confidence of the substation component defect detection model for low-contrast defects. Figure 4 This is a schematic diagram of the channel interaction attention module in an embodiment of this application, as shown below. Figure 4 As shown, the specific steps for processing through the channel interaction attention module are as follows: First, the fused feature map is split in half according to channels to obtain the encoded feature map. X With encoding feature map Y .
[0077] Then, the encoded feature map X Perform a 1×1 convolution to obtain the projection matrix. R For the encoded feature map Y Perform a 1×1 convolution to obtain the projection matrix. S Projection matrix R With projection matrix S Similarity matching is performed to obtain a similarity matching matrix, which is then processed through an activation function to obtain an attention weighting matrix. T .
[0078] Simultaneously, the fused feature map is convolved with 1×1 to generate a half-channel fused feature map with half the number of channels. Then, a 1×1 convolution is performed on the half-channel fused feature map to obtain the projection matrix. U .
[0079] Finally, the projection matrix U With attention weighting matrix T Perform matrix multiplication to obtain the channel interaction attention feature map. The specific formula for obtaining the channel interaction attention feature map is as follows:
[0080] In the above formula, Represents the channel interaction attention feature map. R Represents the encoded feature map X The projection matrix obtained by convolution, S Represents the encoded feature map Y The projection matrix obtained by convolution, Represents the projection matrix S The vector dimension of similarity matching. U This represents the projection matrix obtained by convolving the half-channel fused feature map, and softmax() represents the normalized exponential function.
[0081] S490. Input the first target feature map, the second target feature map and the third target feature map into the decoupled network for classification and regression to obtain the negative sample defect detection target.
[0082] In this embodiment, the first target feature map T3, the second target feature map T4, and the third target feature map T5 obtained by the feature pyramid network are input into the decoupled network, and classification and regression processing are performed respectively to obtain the corresponding defect types and defect bounding boxes, thereby completing the defect detection task of the substation component scene map under test and obtaining negative sample defect detection targets.
[0083] Based on this, the substation component defect detection model uses a scale-interactive attention module to give high-level feature maps attention to details in low-level feature maps, and uses a channel-interactive attention module to perform fine-grained learning of target features, which enhances the high-level semantic feature expression of the target, accelerates feature calculation efficiency, and ensures the accuracy and speed of defect detection.
[0084] S500: Perform comprehensive anomaly diagnosis based on positive sample component mask targets, negative sample component mask targets, and negative sample defect detection targets to obtain anomaly diagnosis results for substation components.
[0085] In this embodiment of the application, in order to accurately quantify the abnormal states of the substation components under test, including internal defects and external intrusions, a comprehensive diagnosis of the abnormalities of the substation components under test can be performed by combining positive sample component mask targets, negative sample component mask targets, and negative sample defect detection targets. Specifically, this includes the following steps: S510. Calculate the difference overlap rate based on the positive sample component mask target and the negative sample component mask target to obtain the target difference overlap rate.
[0086] It should be noted that before calculating the overlap rate, it is necessary to match the negative sample component mask targets corresponding to each positive sample component mask target. Specifically, firstly, based on the component type of the positive sample component mask target, negative sample component mask targets of the same component type are selected. Then, the mask overlap rate between these negative sample component mask targets of the same component type and the positive sample component mask targets is calculated. Finally, the negative sample component mask target with the maximum mask overlap rate is selected as the negative sample component mask target corresponding to the positive sample component mask target of the same component type, thus obtaining the target matching result. The overlap rate between the positive sample component mask targets and their corresponding negative sample component mask targets in the target matching result is calculated as the target overlap rate. The formula for calculating the overlap rate is as follows:
[0087] In the above formula, Indicates component type is The i A positive sample component mask target The corresponding component type is The Negative sample component mask target The difference in overlap rate reflects the degree of occlusion of negative sample components. This represents the matrix union operation. This represents the matrix summation operation. This represents the absolute value operation, where, , m This indicates the number of target components in the substation.
[0088] S520. Compare the target difference overlap rate with the difference overlap rate threshold to obtain the negative sample component occlusion diagnosis result.
[0089] For example, negative sample component occlusion diagnosis can be performed based on a component occlusion diagnosis formula. The target difference overlap rate is compared with a difference overlap rate threshold. If the target difference overlap rate is less than the threshold, it indicates no occlusion; if the target difference overlap rate is greater than or equal to the threshold, it indicates occlusion. This yields the negative sample component occlusion diagnosis result. The specific component occlusion diagnosis formula is as follows:
[0090] In the above formula, Indicates component type is The Negative sample mask target Is there any obstruction? If it is 1, it means... Occlusion occurs; a value of 0 indicates... No obstruction occurred. Indicates component type is The threshold for the difference overlap rate can be set according to the actual situation and human experience.
[0091] S530. Calculate the mutation overlap rate based on the negative sample defect detection target and the negative sample component mask target to obtain the first mutation overlap rate.
[0092] In this embodiment of the application, for the negative sample component mask target in the target matching result, the variation overlap rate between each negative sample defect detection target and the negative sample component mask target is calculated, and the calculation formula is as follows:
[0093] In the above formula, Indicates the defect type as The Target for detecting defects in individual negative samples With component type The Negative sample component mask target The variation overlap rate reflects the defect coverage of negative sample components. This represents the matrix intersection operation. This represents the matrix summation operation.
[0094] Based on the various mutation overlap rates, the largest mutation overlap rate is selected as the first mutation overlap rate. The negative sample defect detection target corresponding to this first mutation overlap rate has the highest matching degree with the negative sample component mask target in the target matching result, and can be used as the basis for subsequent negative sample component defect diagnosis.
[0095] S540. Calculate the mutation overlap rate based on the negative sample defect detection target and the positive sample component mask target to obtain the second mutation overlap rate.
[0096] In this embodiment of the application, for the positive sample component mask target in the target matching result, the variation overlap rate between each negative sample defect detection target and the positive sample component mask target is calculated, and the calculation formula is as follows:
[0097] In the above formula, Indicates the defect type as The Target for detecting defects in individual negative samples With component type The i A positive sample component mask target The variation overlap rate reflects the defect coverage of positive sample components in negative samples. This represents the matrix intersection operation. This represents the matrix summation operation.
[0098] Based on the various mutation overlap rates, the largest mutation overlap rate is selected as the second mutation overlap rate. The negative sample defect detection target corresponding to this second mutation overlap rate has the highest matching degree with the positive sample component mask target in the target matching result, and can also be used as the basis for subsequent negative sample component defect diagnosis.
[0099] S550. Compare the first variation overlap rate with the first variation overlap rate threshold, and compare the second variation overlap rate with the second variation overlap rate threshold to obtain the defect diagnosis result of the negative sample component.
[0100] For example, negative sample component defect diagnosis can be performed based on a component defect diagnosis formula. This involves comparing a first variation overlap rate with a first variation overlap rate threshold, and comparing a second variation overlap rate with a second variation overlap rate threshold, to obtain the negative sample component defect diagnosis result. The specific component defect diagnosis formula is as follows:
[0101] In the above formula, Indicates component type is The Negative sample mask target Does a defect exist? If the value is 1, it means... There is a defect; if the value is 0, it means... No defects; Indicates component type is The i Positive sample mask target Does a defect exist at the same location in the negative sample? If the value is 1, it means there is a defect; if the value is 0, it means there is no defect. Indicates component type is The first mutation overlap rate threshold, Indicates component type is The second variation overlap rate threshold can be set according to the actual situation and human experience; n This indicates the number of negative sample defect detection targets.
[0102] S560. Based on the negative sample component occlusion diagnosis results and the negative sample component defect diagnosis results, a comprehensive diagnosis is performed to obtain the substation component anomaly diagnosis results.
[0103] In this embodiment of the application, the substation component anomaly diagnosis result is obtained by combining the negative sample component occlusion diagnosis result and the negative sample component defect diagnosis result, as follows: If the target difference overlap rate is less than the difference overlap rate threshold, that is If the value is 0, then the target component in the negative sample is not occluded, and if the first mutation overlap rate is less than the first mutation overlap rate threshold, that is... If the value is 0, then the negative sample component target is not affected by the defect, and the substation component diagnosis result is normal.
[0104] If the target difference overlap rate is less than the difference overlap rate threshold, that is If the value is 0, then the target component in the negative sample is not occluded, and if the first mutation overlap rate is greater than or equal to the first mutation overlap rate threshold, that is... If the value is 1, then the negative sample component target has a defect and is affected by one or more defects. The negative sample component mask target is bound to the corresponding one or more negative sample defect detection targets as the substation component anomaly diagnosis result.
[0105] It should be noted that if the negative sample component target is occluded, the negative sample component mask target segmented based on the substation component mask segmentation model will be incomplete. If the degree of occlusion is significant, the scene image of the substation component under test may not even be able to segment the negative sample component mask target. In this case, the positive sample component mask target is used for anomaly diagnosis of the negative sample component, as follows: If the target difference overlap rate is greater than or equal to the difference overlap rate threshold, that is If the value is 1, then the target component of the negative sample is occluded, and if the second mutation overlap rate is less than the second mutation overlap rate threshold, that is... If the value is 0, then the negative sample component target has no defects, but is affected by interference from other environmental targets, and the substation component diagnosis result is normal.
[0106] If the target difference overlap rate is greater than or equal to the difference overlap rate threshold, that is If the value is 1, then the target component of the negative sample is occluded, and if the second mutation overlap rate is greater than or equal to the second mutation overlap rate threshold, that is... If the value is 1, then the negative sample component target has a defect and is affected by one or more defects. The positive sample component mask target is bound to the corresponding one or more negative sample defect detection targets as the substation component anomaly diagnosis result.
[0107] Based on this, by integrating positive sample component mask targets, negative sample component mask targets, and negative sample defect detection targets, a dual criterion for occlusion diagnosis and defect diagnosis is constructed, realizing comprehensive anomaly diagnosis of substation components. It can not only identify whether defects such as oil leaks and floating objects are actually affecting the target component, but also distinguish between two fundamentally different anomaly mechanisms: substation component occlusion and substation component defects. This significantly improves the interpretability and positioning accuracy of the diagnosis, thereby precisely controlling the degree of harm of abnormal states to components.
[0108] The substation component anomaly diagnosis method provided in this application, based on a constructed positive sample library, uses a perceptual hash algorithm to search for positive sample images and positive sample component mask targets corresponding to the scene diagram of the substation component under test in the positive sample library. It then introduces both positive and negative sample images for negative sample anomaly diagnosis, effectively diagnosing not only the defect targets of the negative samples but also accurately diagnosing the defect impact on specific components. Simultaneously, through component occlusion diagnosis and component defect diagnosis, negative sample component occlusion diagnosis and negative sample component defect diagnosis are performed respectively, thereby diagnosing the anomaly results of the negative sample components and achieving anomaly diagnosis of the substation component under test.
[0109] Example 2 Based on the same technical concept as Embodiment 1 above, this application provides a substation component anomaly diagnosis system. Figure 5 This is a schematic diagram of the substation component anomaly diagnosis system provided in this application embodiment, as shown below. Figure 5 As shown, the substation component anomaly diagnosis system 200 includes: The positive sample creation module 210 is used to acquire multiple normal substation component scene images, perform similarity calculation and mask annotation based on each of the normal substation component scene images, and create a positive sample library.
[0110] The positive sample search module 220 is used to obtain a scene map of the substation component under test, and to perform positive sample search and matching based on the scene map of the substation component under test and the positive sample library to obtain positive sample component mask targets.
[0111] The negative sample segmentation module 230 is used to input the scene image of the substation component to be tested into the substation component mask segmentation model for component segmentation to obtain the negative sample component mask target.
[0112] The negative sample detection module 240 is used to input the scene diagram of the substation component to be tested into the substation component defect detection model for defect detection and to obtain negative sample defect detection targets.
[0113] The negative sample diagnosis module 250 is used to perform comprehensive anomaly diagnosis based on the positive sample component mask target, the negative sample component mask target, and the negative sample defect detection target, and obtain the anomaly diagnosis results of substation components.
[0114] The substation component anomaly diagnosis system provided in this application introduces positive and negative sample images for negative sample anomaly diagnosis, providing strong support for timely elimination of potential defects in specific substation components. Simultaneously, it performs negative sample component occlusion diagnosis and negative sample component defect diagnosis, thereby comprehensively diagnosing the abnormal state of the substation component under test, providing a new approach to substation component anomaly diagnosis.
[0115] It is understood that the implementation method of the substation component abnormality diagnosis method in Embodiment 1 above is also applicable to this embodiment and can achieve the same technical effect, so it will not be described again here.
[0116] Example 3 Based on the same concept, this application also provides an electronic device. Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 6 As shown, the electronic device 300 may include a processor 310, a communication interface 320, a memory 330, and a communication bus 340, wherein the processor 310, the communication interface 320, and the memory 330 communicate with each other via the communication bus 340. The processor 310 can call logical instructions in the memory 330 to execute the steps of the substation component anomaly diagnosis method as described in the above embodiments. For example, this includes: S100. Obtain multiple scene images of normal substation components, perform similarity calculation and mask annotation based on each scene image of normal substation components, and create a positive sample library. S200: Obtain the scene map of the substation component under test, and perform positive sample search and matching based on the scene map of the substation component under test and the positive sample library to obtain the positive sample component mask target. S300. Input the scene image of the substation component to be tested into the substation component mask segmentation model to perform component segmentation and obtain the negative sample component mask target. S400: Input the scene diagram of the substation component to be tested into the substation component defect detection model to perform defect detection and obtain negative sample defect detection targets; S500: Perform comprehensive anomaly diagnosis based on positive sample component mask targets, negative sample component mask targets, and negative sample defect detection targets to obtain anomaly diagnosis results for substation components.
[0117] The processor 310 can be a central processing unit (CPU). The processor can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations of the above types of chips.
[0118] Furthermore, the logical instructions in the aforementioned memory 330 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0119] The memory 330 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the processor, etc. Furthermore, the memory may include high-speed random access memory and non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include memory remotely located relative to the processor, which can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0120] Example 4 Based on the same concept, embodiments of this application also provide a computer-readable storage medium storing a computer program containing at least one piece of code executable by a master control device to control the master control device to implement the steps of the substation component anomaly diagnosis method as described in the above embodiments. For example, it includes: S100. Obtain multiple scene images of normal substation components, perform similarity calculation and mask annotation based on each scene image of normal substation components, and create a positive sample library. S200: Obtain the scene map of the substation component under test, and perform positive sample search and matching based on the scene map of the substation component under test and the positive sample library to obtain the positive sample component mask target. S300. Input the scene image of the substation component to be tested into the substation component mask segmentation model to perform component segmentation and obtain the negative sample component mask target. S400: Input the scene diagram of the substation component to be tested into the substation component defect detection model to perform defect detection and obtain negative sample defect detection targets; S500: Perform comprehensive anomaly diagnosis based on positive sample component mask targets, negative sample component mask targets, and negative sample defect detection targets to obtain anomaly diagnosis results for substation components.
[0121] Based on the same technical concept, this application also provides a computer program, which, when executed by a main control device, is used to implement the above-described method embodiments.
[0122] The computer program may be stored, in whole or in part, on a computer-readable storage medium packaged with the processor, or in part or in whole on a memory not packaged with the processor.
[0123] Based on the same technical concept, this application also provides a processor for implementing the above-described method embodiments. The processor can be a chip.
[0124] In summary, the substation component anomaly diagnosis method, system, electronic equipment, and storage medium provided in this application introduce positive and negative sample images for negative sample anomaly diagnosis. This not only effectively diagnoses the defect targets of the substation components under test but also accurately diagnoses the impact of defects on specific components, providing strong support for timely elimination of potential defects in specific substation components. Simultaneously, the introduction of negative sample diagnosis, through component occlusion diagnosis and component defect diagnosis, respectively, diagnoses negative sample component anomalies, thereby achieving anomaly diagnosis of the substation components under test. Based on an improved target detection network, high-level feature maps are given detail attention in low-level feature maps, and fine-grained learning of target features is performed, enhancing the high-level semantic feature expression of the target and accelerating feature computation efficiency, thus ensuring the accuracy and speed of defect detection.
[0125] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0126] The embodiments described above are merely examples of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these modifications and improvements all fall within the protection scope of this application.
[0127] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for diagnosing abnormalities in substation components, characterized in that, The method includes: Obtain multiple scene images of normal substation components, perform similarity calculation and mask annotation based on each of the normal substation component scene images, and create a positive sample library; Obtain a scene image of the substation component under test, and perform positive sample search and matching based on the scene image of the substation component under test and the positive sample library to obtain positive sample component mask targets; The scene image of the substation component under test is input into the substation component mask segmentation model to perform component segmentation and obtain negative sample component mask targets. The scene diagram of the substation component to be tested is input into the substation component defect detection model for defect detection to obtain negative sample defect detection targets. Anomaly diagnosis is performed based on the positive sample component mask target, the negative sample component mask target, and the negative sample defect detection target to obtain the anomaly diagnosis result of the substation component; The step of performing comprehensive anomaly diagnosis based on the positive sample component mask target, the negative sample component mask target, and the negative sample defect detection target to obtain the substation component anomaly diagnosis result includes: The difference overlap rate is calculated based on the positive sample component mask target and the negative sample component mask target to obtain the target difference overlap rate; The target difference overlap rate is compared with the difference overlap rate threshold to obtain the negative sample component occlusion diagnosis result; The first variation overlap rate is obtained by calculating the variation overlap rate based on the negative sample defect detection target and the negative sample component mask target. The second variation overlap rate is obtained by calculating the variation overlap rate based on the negative sample defect detection target and the positive sample component mask target. The first variation overlap rate is compared with the first variation overlap rate threshold, and the second variation overlap rate is compared with the second variation overlap rate threshold to obtain the negative sample component defect diagnosis result; Based on the occlusion diagnosis results and defect diagnosis results of the negative sample components, a comprehensive diagnosis is performed to obtain the abnormal diagnosis results of the substation components.
2. The substation component anomaly diagnosis method according to claim 1, characterized in that, The formula for calculating the difference overlap rate based on the positive sample component mask target and the negative sample component mask target is as follows: In the above formula, Indicates component type is The i A positive sample component mask target The corresponding component type is The Negative sample component mask target The difference overlap rate, This represents the matrix union operation. This represents the matrix summation operation. This represents the absolute value operation; The formula for calculating the variation overlap rate based on the negative sample defect detection target and the negative sample component mask target is as follows: In the above formula, Indicates the defect type as The Target for detecting defects in individual negative samples With component type The Negative sample component mask target The overlap rate of the variation, This represents the matrix intersection operation. This represents the matrix summation operation; The formula for calculating the variation overlap rate based on the negative sample defect detection target and the positive sample component mask target is as follows: In the above formula, Indicates the defect type as The Target for detecting defects in individual negative samples With component type The i A positive sample component mask target The overlap rate of the variation, This represents the matrix intersection operation. This represents the matrix summation operation.
3. The substation component anomaly diagnosis method according to claim 1, characterized in that, The step of performing a comprehensive diagnosis based on the occlusion diagnosis results and the defect diagnosis results of the negative sample components to obtain the abnormality diagnosis results of the substation components includes: If the target difference overlap rate is less than the difference overlap rate threshold, then the negative sample component target is not occluded, and if the first variation overlap rate is less than the first variation overlap rate threshold, then the negative sample component target is not defective, and the substation component diagnosis result is normal. If the target difference overlap rate is less than the difference overlap rate threshold, then the negative sample component target is not occluded. If the first variation overlap rate is greater than or equal to the first variation overlap rate threshold, then the negative sample component target has a defect. The negative sample component mask target is bound to the corresponding negative sample defect detection target as the substation component anomaly diagnosis result. If the target difference overlap rate is greater than or equal to the difference overlap rate threshold, then the negative sample component target is occluded; and if the second variation overlap rate is less than the second variation overlap rate threshold, then the negative sample component target has no defect, and the substation component diagnosis result is normal. If the target difference overlap rate is greater than or equal to the difference overlap rate threshold, the negative sample component target is occluded. If the second variation overlap rate is greater than or equal to the second variation overlap rate threshold, the negative sample component target has a defect. The positive sample component mask target is bound to the corresponding negative sample defect detection target as the substation component anomaly diagnosis result.
4. The substation component anomaly diagnosis method according to claim 1, characterized in that, The substation component defect detection model includes a backbone network, a feature pyramid network, and a decoupled network. The feature pyramid network includes a scale interaction attention module and a channel interaction attention module. The step of inputting the scene image of the substation component under test into the substation component defect detection model for defect detection, and obtaining negative sample defect detection targets, includes: The scene map of the substation component under test is input into the backbone network for feature extraction to obtain the first layer feature map, the second layer feature map and the third layer feature map; The second-layer feature map and the third-layer feature map are input into the scale interaction attention module to obtain the first scale interaction attention feature map; The first-scale interactive attention feature map is concatenated with the second-layer feature map to obtain the first fused feature map; The first fused feature map and the first layer feature map are input into the scale interaction attention module to obtain the second scale interaction attention feature map. The second-scale interactive attention feature map is concatenated with the first-layer feature map to obtain the second fused feature map; The second fused feature map is convolved to generate a first intermediate feature map with the same resolution as the first fused feature map, and the first intermediate feature map is concatenated with the first fused feature map to obtain a third fused feature map. The third fused feature map is convolved to generate a second intermediate feature map with the same resolution as the third layer feature map, and the second intermediate feature map is concatenated with the third layer feature map to obtain a fourth fused feature map; The second fused feature map, the third fused feature map, and the fourth fused feature map are respectively input into the channel interaction attention module for feature enhancement to obtain the first target feature map, the second target feature map, and the third target feature map; The first target feature map, the second target feature map, and the third target feature map are input into the decoupled network for classification and regression to obtain the negative sample defect detection target.
5. The substation component anomaly diagnosis method according to claim 1, characterized in that, The process of creating a positive sample library based on similarity calculations and mask annotations of each of the normal substation component scene images includes: Calculate the perceptual hash value of each of the normal substation component scene diagrams, and save the perceptual hash values to a text file to obtain a positive sample text file; For each of the aforementioned normal substation component scene diagrams, component mask annotations are performed, and the annotated component mask targets are saved sequentially to [the appropriate file system]. json Multiple positive samples were obtained from the file. json document; Bind each of the aforementioned normal substation component scene diagrams to the corresponding positive samples. json The file is used to bind the corresponding perceptual hash value in the positive sample text file to obtain the positive sample library.
6. The substation component anomaly diagnosis method according to claim 5, characterized in that, The step of performing positive sample search and matching based on the scene diagram of the substation component under test and the positive sample library to obtain positive sample component mask targets includes: Calculate the target perception hash value of the scene map of the substation component under test; Parse the positive sample text file in the positive sample library to obtain a list of positive sample perceptual hash values; Traverse the list of positive sample perceptual hash values and calculate the Hamming distance between each positive sample perceptual hash value and the target perceptual hash value; Select the positive sample corresponding to the minimum Hamming distance as the target positive sample, and read the positive sample corresponding to the target positive sample. json The file is used to obtain the positive sample component mask target.
7. A substation component anomaly diagnosis system, characterized in that, The system includes: The positive sample creation module is used to acquire multiple scene images of normal substation components, perform similarity calculation and mask annotation based on each of the normal substation component scene images, and create a positive sample library. The positive sample search module is used to acquire a scene image of the substation component under test, and perform positive sample search and matching based on the scene image of the substation component under test and the positive sample library to obtain positive sample component mask targets. The negative sample segmentation module is used to input the scene image of the substation component under test into the substation component mask segmentation model to segment the component and obtain the negative sample component mask target. The negative sample detection module is used to input the scene diagram of the substation component under test into the substation component defect detection model for defect detection and obtain negative sample defect detection targets. The negative sample diagnosis module is used to perform comprehensive anomaly diagnosis based on the positive sample component mask target, the negative sample component mask target, and the negative sample defect detection target, and obtain the anomaly diagnosis result of the substation component; The step of performing comprehensive anomaly diagnosis based on the positive sample component mask target, the negative sample component mask target, and the negative sample defect detection target to obtain the substation component anomaly diagnosis result includes: The difference overlap rate is calculated based on the positive sample component mask target and the negative sample component mask target to obtain the target difference overlap rate; The target difference overlap rate is compared with the difference overlap rate threshold to obtain the negative sample component occlusion diagnosis result; The first variation overlap rate is obtained by calculating the variation overlap rate based on the negative sample defect detection target and the negative sample component mask target. The second variation overlap rate is obtained by calculating the variation overlap rate based on the negative sample defect detection target and the positive sample component mask target. The first variation overlap rate is compared with the first variation overlap rate threshold, and the second variation overlap rate is compared with the second variation overlap rate threshold to obtain the negative sample component defect diagnosis result; Based on the occlusion diagnosis results and defect diagnosis results of the negative sample components, a comprehensive diagnosis is performed to obtain the abnormal diagnosis results of the substation components.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the substation component anomaly diagnosis method as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the substation component anomaly diagnosis method as described in any one of claims 1-6.