Electric power safety supervision image classification method based on hierarchical attention enhancement network

By adopting a hierarchical attention enhancement network in the power safety monitoring image classification, combining hierarchical feature enhancement, dual-channel interaction and non-local feature balance, the problems of insufficient feature expression and information redundancy in small sample learning are solved, and high-precision and robust power safety monitoring image classification are achieved.

CN120014330APending Publication Date: 2025-05-16STATE GRID GANSU ELECTRIC POWER RESEARCH INSTITUTE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510075543.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

The existing small sample learning methods have problems in the classification of power safety image, such as insufficient feature expression, information redundancy and background interference, insufficient feature channels interaction, and data amplification and overfitting, resulting in low classification accuracy and insufficient model generalization ability.

Method used

Using a method based on hierarchical attention enhancement network, through hierarchical feature enhancement, dual-channel interaction mechanism and non-local feature balance, cross-hierarchical information of the image is captured, feature expression weights are dynamically adjusted, feature expression balanced, redundant information is removed and key features are highlighted.

Benefits of technology

It significantly improves the classification accuracy of power safety monitoring images and the generalization ability of the model, realizes high-precision classification of small samples, and improves robustness and richness of feature expression.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120014330A_ABST
    Figure CN120014330A_ABST
Patent Text Reader

Abstract

The invention provides an electric power safety supervision image classification method based on a hierarchical attention enhancement network, and relates to the technical field of image classification, and the method comprises the steps: obtaining an electric power safety inspection image, and carrying out the data preprocessing, and obtaining a feature image; performing hierarchical feature enhancement on the feature image to obtain a plurality of layers of enhanced feature images, and performing dual-channel interaction processing on the enhanced feature images to obtain a dual-channel interaction feature image; fusing the enhanced feature image and the two-channel interaction feature image through addition calculation; performing non-local feature balance on the fused image to obtain a feature image after image balance; processing the balanced feature image by using a classifier to obtain a final classification result; through hierarchical feature enhancement, a two-channel interaction mechanism and non-local feature balance, the generalization ability and classification effect of the model are significantly improved while the richness of image feature expression is ensured, and small sample high-precision classification of the electric power safety supervision image is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image classification, and in particular to a method for classifying electric power safety monitoring images based on a hierarchical attention enhancement network. Background Art

[0002] At present, small sample learning has made some progress in the classification of power safety and supervision images, but the existing small sample learning methods still face the following objective shortcomings: 1. Insufficient feature expression: It often relies on simple feature extraction and enhancement techniques, which makes it difficult to effectively capture the details and global semantic information in the image, and fails to fully consider the feature relationships at different levels, resulting in low classification accuracy under complex backgrounds; 2. Information redundancy and background interference: In traditional methods, background interference and redundant features often affect the classification effect, especially in power safety and supervision images, where background noise and irrelevant areas are easily misclassified; 3. Feature channels are not interactive enough: Existing methods usually do not fully explore the interactive relationship between feature channels, resulting in insufficient information flow, and unable to achieve effective compensation and redundancy suppression of information; 4. Data augmentation and overfitting: Although data augmentation technology can help alleviate the overfitting problem caused by small samples, for complex power safety and supervision images, traditional enhancement methods are difficult to generate sufficiently diverse training samples, thereby limiting the generalization ability of the model.

[0003] Based on this, this application proposes a power safety image classification method based on a hierarchical attention enhancement network to solve the above problems. Summary of the invention

[0004] The purpose of the present invention is to provide a method for classifying electric power safety and supervision images based on a hierarchical attention enhancement network, which can effectively solve the shortcomings mentioned in the background technology and achieve high-precision classification of small samples of electric power safety and supervision images through innovative technologies such as hierarchical feature enhancement, dual-channel interaction mechanism and non-local feature balance.

[0005] The technical solution of the present invention is:

[0006] In a first aspect, the present application provides a method for classifying electric power safety images based on a hierarchical attention enhancement network, which comprises the following steps:

[0007] S1, acquiring power safety inspection images and performing data preprocessing to obtain feature images;

[0008] S2, performing hierarchical feature enhancement on the feature image to obtain enhanced feature images at multiple levels, and performing dual-channel interactive processing on the enhanced feature image to obtain a dual-channel interactive feature image;

[0009] S3, fusing the enhanced feature images of multiple levels and the dual-channel interactive feature images by summing up the images to obtain a fused image;

[0010] S4, performing non-local feature balancing on the fused image to obtain a feature image after image balancing;

[0011] S5. Use the classifier to process the balanced feature image to obtain the final classification result.

[0012] Furthermore, in step S1, the above data preprocessing includes data enhancement, data normalization and data annotation optimization.

[0013] Furthermore, in step S2, the hierarchical feature enhancement includes:

[0014] Divide the feature image into multiple levels, and perform convolution processing on the feature image of each level;

[0015] The feature image after convolution processing is enhanced through the attention mechanism to obtain enhanced feature images at multiple levels;

[0016] Among them, the calculation formula of the above hierarchical feature enhancement is:

[0017] X′ l =F1(X l )·Attention(X l )

[0018] In the formula, X′ l represents a multi-level enhanced feature image, F1 represents a convolution operation, X l Represents a multi-level feature image, and Attention represents the attention mechanism.

[0019] Furthermore, the calculation formula for the above dual-channel interaction processing includes:

[0020] X′1=F1(X1,X2), X′2=F2(X2,X1)

[0021] Wherein, X′1 represents the multi-level enhanced feature image of the first channel, F1 and F2 both represent convolution operations, X1 represents the multi-level feature image of the first channel, X2 represents the multi-level feature image of the second channel, and X′2 represents the multi-level enhanced feature image of the second channel.

[0022] Furthermore, in step S3, the calculation formula for the above-mentioned summation calculation includes:

[0023]

[0024] In the formula, X fusion represents the fused feature image, L represents the number of layers, l represents the current layer index, and X′ lrepresents a multi-level enhanced feature image, X′1 represents a multi-level enhanced feature image of the first channel, and X′2 represents a multi-level enhanced feature image of the second channel.

[0025] Furthermore, in step S4, the calculation formula for performing non-local feature balance on the fused image includes:

[0026] X balanced =Non-Local(X fusion )

[0027] In the formula, X balanced represents the balanced feature representation, Non represents the non-local operator, Local represents the Local function, and X fusion Represents the fused feature image.

[0028] Furthermore, in step S5, the calculation formula for processing the balanced feature image using the classifier includes:

[0029] y=Soft max(W·X balanced +b)

[0030] In the formula, y represents the final classification result, Soft max is the Soft max function, Local represents the target area function, W is the weight matrix of the classifier, X balanced represents the balanced feature representation, and b is the bias term.

[0031] In a second aspect, the present application provides an electronic device, including:

[0032] A memory for storing one or more programs;

[0033] processor;

[0034] When the one or more programs are executed by the processor, a method for classifying electric power safety images based on a hierarchical attention enhancement network as described in any one of the first aspects is implemented.

[0035] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for classifying electric power safety images based on a hierarchical attention enhancement network as described in any one of the first aspects above.

[0036] Compared with the prior art, the present invention has at least the following advantages or beneficial effects:

[0037] (1) The present invention provides a method for classifying electric power safety supervision images based on a hierarchical attention enhancement network. By adopting hierarchical feature enhancement, the method can efficiently capture cross-level information and dynamically adjust feature expression weights to increase the attention paid to the target area, thereby improving the classification accuracy of the image.

[0038] (2) The present invention introduces a non-local feature balancing module, and through non-local operations, enables the model to aggregate key features in a global scope, rather than being limited to the local convolution receptive field. At the same time, through global relationship modeling, the module can identify areas related to target features and suppress background information irrelevant to the classification task. By dynamically adjusting the weights of feature expression, the relationship between features is made more balanced, avoiding excessive or weak feature expression in certain areas, thereby balancing the feature expression of each area in the power safety supervision image and capturing the correlation between distant areas. In particular, in the presence of interfering background or scattered features, the key area features are better highlighted, while redundant or irrelevant information is suppressed, thereby significantly improving the generalization ability and classification effect of the model, and further improving the small sample classification performance of the power safety supervision image;

[0039] (3) The present invention extracts and strengthens image features layer by layer through a hierarchical feature enhancement mechanism, and uses a dual-channel interaction mechanism to remove redundant information and highlight key feature expressions, thereby significantly improving classification accuracy. It then balances the feature expressions of various regions in the electric power safety and supervision image through non-local feature balancing, thereby significantly improving the feature expression capability when classifying small sample images and suppressing unnecessary noise. This ensures the richness of image feature expression while achieving high-precision classification of small samples of electric power safety and supervision images, thereby improving the robustness and generalization capability of the small sample classification model of electric power safety and supervision images. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0041] Figure 1 A step diagram of a method for classifying electric power safety monitoring images based on a hierarchical attention enhancement network according to the present invention;

[0042] Figure 2 The figure is a schematic structural block diagram of an electronic device according to an embodiment of the present invention.

[0043] Icon: 101, memory; 102, processor; 103, communication interface. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.

[0045] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0046] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0047] It should be noted that, in this article, the term "include" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0048] For those skilled in the art, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0049] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0050] Example 1

[0051] See also Figure 1 , Figure 1 Shown is a step diagram of a method for classifying electric power safety monitoring images based on a hierarchical attention enhancement network provided in an embodiment of the present application.

[0052] The present application provides a method for classifying electric power safety monitoring images based on a hierarchical attention enhancement network, which comprises the following steps:

[0053] S1, acquiring power safety inspection images and performing data preprocessing to obtain feature images;

[0054] S2, performing hierarchical feature enhancement on the feature image to obtain enhanced feature images at multiple levels, and performing dual-channel interactive processing on the enhanced feature image to obtain a dual-channel interactive feature image;

[0055] S3, fusing the enhanced feature images of multiple levels and the dual-channel interactive feature images by summing up the images to obtain a fused image;

[0056] S4, performing non-local feature balancing on the fused image to obtain a feature image after image balancing;

[0057] S5. Use the classifier to process the balanced feature image to obtain the final classification result.

[0058] As a preferred implementation, in step S1, data preprocessing includes data enhancement, data normalization and data annotation optimization.

[0059] It should be noted that data enhancement mainly includes: introducing random cropping, rotation, brightness adjustment, noise superposition and other methods to increase the diversity of training samples while retaining the integrity of key areas of the image, simulating the complexity of actual inspection scenarios; data normalization mainly ensures the consistency of network input data distribution; data labeling optimization includes: for small sample scenarios, introducing semi-supervised learning methods to pseudo-label unlabeled data, thereby further expanding the effective training data set.

[0060] As a preferred implementation, in step S2, the hierarchical feature enhancement includes:

[0061] Divide the feature image into multiple levels, and perform convolution processing on the feature image of each level;

[0062] The feature image after convolution processing is enhanced through the attention mechanism to obtain enhanced feature images at multiple levels;

[0063] Among them, the calculation formula of hierarchical feature enhancement is:

[0064] X′ l =F1(X l )·Attention(X l )

[0065] In the formula, X′ l represents a multi-level enhanced feature image, F1 represents a convolution operation, X l Represents a multi-level feature image, and Attention represents the attention mechanism.

[0066] As a preferred implementation, the calculation formula for dual-channel interactive processing includes:

[0067] X′1=F1( X1, X2), X′2=F2(X2, X1)

[0068] Wherein, X′1 represents the multi-level enhanced feature image of the first channel, F1 and F2 both represent convolution operations, X1 represents the multi-level feature image of the first channel, X2 represents the multi-level feature image of the second channel, and X′2 represents the multi-level enhanced feature image of the second channel.

[0069] As a preferred implementation, in step S3, the calculation formula for the summation includes:

[0070]

[0071] In the formula, X fusion represents the fused feature image, L represents the number of layers, l represents the current layer index, and X′ l represents a multi-level enhanced feature image, X′1 represents a multi-level enhanced feature image of the first channel, and X′2 represents a multi-level enhanced feature image of the second channel.

[0072] As a preferred implementation, in step S4, the calculation formula for performing non-local feature balance on the fused image includes:

[0073] X balanced =Non-Local(X fusion )

[0074] In the formula, X balanced represents the balanced feature representation, Non represents the non-local operator, Local represents the Local function, and X fusion Represents the fused feature image.

[0075] As a preferred implementation, in step S5, the calculation formula for processing the balanced feature image using the classifier includes:

[0076] y=Softmax(W·X balanced +b)

[0077] In the formula, y represents the final classification result, Soft max is the Soft max function, Local represents the target area function, W is the weight matrix of the classifier, X balanced represents the balanced feature representation, and b is the bias term.

[0078] To implement the above solution, the embodiment of the present invention is implemented through the following steps:

[0079] Step 1: Data preprocessing: Obtain power safety inspection images, and divide all labeled power safety inspection image data into training sets and test sets, where the training set accounts for 20% of the total data and the test set accounts for 80%. Perform data enhancement operations such as random rotation, scale scaling, and color jittering on the training set to simulate image characteristics in different scenarios while ensuring the robustness and generalization ability of the model;

[0080] Step 2, model construction: The model is constructed by using a hierarchical attention enhancement network (HABNet) and a feature recursive compression module (FRCM). HABNet extracts multi-level enhanced feature images through a hierarchical feature enhancement mechanism, and performs dual-channel interactive processing on the enhanced feature images to obtain dual-channel interactive feature images. The enhanced feature images of multiple levels and the dual-channel interactive feature images are fused by summation to obtain a fused image. The fused image is subjected to non-local feature balance to obtain a feature image after image balance. The FRCM module recursively compresses these feature images, removes redundant information, and strengthens the expression of key features.

[0081] Step 3: Model training: The improved cosine annealing learning rate strategy is used in conjunction with the Adam optimizer to optimize the model’s classification loss function and feature enhancement constraint function. After each round of training, the dynamic weight balancing strategy is used to adjust the gradient distribution of the backbone network and auxiliary modules to ensure the performance stability of the model at different stages.

[0082] Step 4: Classification of small samples of power safety supervision images: Input the test set images into the trained model, and the model will complete feature extraction, recursive compression and classification prediction in sequence, output the classification label corresponding to each image, and record the model's predicted probability distribution;

[0083] Step 5: Output classification results and visualization images: After the classification is completed, the system will output statistical information of the classification results, including the classification accuracy and recall rate of each category. At the same time, the key feature areas are displayed through the feature mapping visualization module, so that users can intuitively understand the classification basis and performance of the model.

[0084] Example 2

[0085] See also Figure 2 , Figure 2 A schematic structural block diagram of an electronic device provided in an embodiment of the present application.

[0086] An electronic device includes a memory 101, a processor 102 and a communication interface 103, wherein the memory 101, the processor 102 and the communication interface 103 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The memory 101 can be used to store software programs and modules, and the processor 102 executes various functional applications and data processing by executing the software programs and modules stored in the memory 101. The communication interface 103 can be used to communicate signaling or data with other node devices.

[0087] Among them, the memory 101 can be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc.

[0088] The processor 102 may be an integrated circuit chip with signal processing capability. The processor 102 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0089] It is understood that the structure shown in the figure is only for illustration, and a method for classifying power safety images based on a hierarchical attention enhancement network may also include more or fewer components than those shown in the figure, or have a different configuration than those shown in the figure. Each component shown in the figure may be implemented by hardware, software, or a combination thereof.

[0090] In the embodiments provided in the present application, it should be understood that the disclosed method can also be implemented in other ways. The embodiments described above are merely schematic, for example, the flowchart or block diagram in the accompanying drawings shows the possible implementation architecture, functions and operations of the method and computer program product according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0091] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0092] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0093] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

[0094] It will be apparent to those skilled in the art that the present application is not limited to the details of the exemplary embodiments described above, and that the present application can be implemented in other specific forms without departing from the spirit or essential features of the present application. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the present application is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present application. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.

Claims

1. A method for classifying power safety images based on a hierarchical attention enhancement network, characterized in that: The following steps are involved: S1, acquiring power safety inspection images and performing data preprocessing to obtain feature images; S2, performing hierarchical feature enhancement on the feature image to obtain enhanced feature images at multiple levels, and performing dual-channel interactive processing on the enhanced feature image to obtain a dual-channel interactive feature image; S3, fusing the enhanced feature images of multiple levels and the dual-channel interactive feature images by summing up the images to obtain a fused image; S4, performing non-local feature balancing on the fused image to obtain a feature image after image balancing; S5. Use the classifier to process the balanced feature image to obtain the final classification result.

2. The method for classifying electric power safety monitoring images based on a hierarchical attention enhancement network as claimed in claim 1, characterized in that: In step S1, the data preprocessing includes data enhancement, data normalization and data annotation optimization.

3. The method for classifying electric power safety monitoring images based on a hierarchical attention enhancement network as claimed in claim 1, characterized in that: In step S2, the hierarchical feature enhancement includes: Divide the feature image into multiple levels, and perform convolution processing on the feature image of each level; The feature image after convolution processing is enhanced through the attention mechanism to obtain enhanced feature images at multiple levels; Among them, the calculation formula of the above hierarchical feature enhancement is: X' l =F l (X l )·Attention(X l ) Where X' l represents a multi-level enhanced feature image, F1 represents a convolution operation, X l Represents a multi-level feature image, and Attention represents the attention mechanism.

4. The method for classifying electric power safety monitoring images based on a hierarchical attention enhancement network as claimed in claim 3, characterized in that: The calculation formula of the dual-channel interactive processing include: X'1=F1(X1,X2), X'2=F2(X2,X1) Wherein, X'1 represents the multi-level enhanced feature image of the first channel, F1 and F2 both represent convolution operations, X1 represents the multi-level feature image of the first channel, X2 represents the multi-level feature image of the second channel, and X'2 represents the multi-level enhanced feature image of the second channel.

5. The method for classifying electric power safety monitoring images based on a hierarchical attention enhancement network as claimed in claim 1, characterized in that: In step S3, the calculation formula for the summation is include: Where, X fusion represents the fused feature image, L represents the number of layers, l represents the current layer index, X' l represents a multi-level enhanced feature image, X'1 represents a multi-level enhanced feature image of the first channel, and X'2 represents a multi-level enhanced feature image of the second channel.

6. The method for classifying electric power safety monitoring images based on a hierarchical attention enhancement network as claimed in claim 5, characterized in that: In step S4, the calculation formula for non-local feature balance of the fused image is: include: X balanced =Non-Local(X fusion ) Where, X balanced represents the balanced feature representation, Non represents the non-local operator, Local represents the Local function, and X fusion Represents the fused feature image.

7. The method for classifying electric power safety monitoring images based on a hierarchical attention enhancement network as claimed in claim 6, characterized in that: In step S5, the calculation formula for processing the balanced feature image using the classifier includes: y=Softmax(W·X balanced +b) In the formula, y represents the final classification result, Softmax is the Softmax function, Local represents the target area function, W is the weight matrix of the classifier, X balanced represents the balanced feature representation, and b is the bias term.

8. An electronic device, characterized in that: include: A memory for storing one or more programs; processor; When the one or more programs are executed by the processor, a method for classifying electric power safety monitoring images based on a hierarchical attention enhancement network as described in any one of claims 1 to 7 is implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements a method for classifying electric power safety images based on a hierarchical attention enhancement network as described in any one of claims 1-7.