Attention mechanism guided electric power field ground oil and water stain identification method

By introducing an attention mechanism into the recognition of ground oil and water stains at power sites, the model is enhanced to pay attention to key areas and important channel information, solving the problem of insufficient recognition capabilities in the existing technology and achieving higher recognition accuracy and adaptability.

CN119323664AInactive Publication Date: 2025-01-17CHINA YANGTZE POWER

Patent Information

Application Number
CN202411229320.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2025-01-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the process of identifying ground oil and water stains on the power site, it is difficult for the prior art to effectively identify key areas, and the identification ability of key channel information during the feature fusion process is insufficient, resulting in the inability to accurately locate the target area.

Method used

Using the method guided by the attention mechanism, by constructing the feature extraction residual block guided by spatial attention and the feature fusion module guided by channel attention, the model is enhanced to pay attention to key areas and important channel information, and the accuracy of feature extraction and fusion is improved. .

Benefits of technology

The model's ability in feature extraction and feature fusion has been significantly improved, and it can more accurately identify and locate oil and water stain areas, improving the accuracy and adaptability of identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119323664A_ABST
    Figure CN119323664A_ABST
Patent Text Reader

Abstract

The invention discloses an attention mechanism-guided electric power field ground oil and water stain identification method, which comprises the following steps of: 1, constructing a feature extraction residual block for spatial attention guidance for guiding a module to pay attention to a key feature region; 2, constructing a multi-scale feature extractor according to the feature extraction residual block, wherein the multi-scale feature extractor is used for obtaining rich semantic features from the input image; 3, constructing a feature fusion module for channel attention guidance, wherein the feature fusion module is used for fusing features from a coder and a decoder; 4, constructing a model decoder according to the feature fusion module; step 5, training the established detection model, storing model parameters and generating a final oil-water stain area detection result; according to the method, the problems that in the electric power field ground oil and water stain identification process, the key area attention capability is weak, and the fusion feature key channel information identification capability is insufficient are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition technology, and in particular to an attention mechanism-guided method for identifying oil and water stains on the ground at an electric power site. Background Art

[0002] Traditional oil and water stain detection methods, such as manual inspections and simple sensors, have problems such as low efficiency, high cost, and susceptibility to environmental influences. Deep learning technology, however, achieves efficient and accurate detection through automated and intelligent image recognition. In particular, convolutional neural networks (CNNs) perform well in the field of image recognition, and can capture and analyze ground images in real time to identify the location and area of ​​oil and water stains. In addition, deep learning models can be continuously optimized through continuous learning of field data to improve detection accuracy and adaptability. In recent years, relevant research and application examples have shown that deep learning has great potential in oil and water stain identification, which can achieve real-time monitoring and early warning, help maintenance personnel respond quickly, and reduce accidents.

[0003] However, in actual application, there are also corresponding problems. For example, the U-shaped network method cannot effectively identify the key areas in the input image. At the same time, the recognition ability of key channel information in the encoder and decoder feature fusion process is insufficient. Therefore, in actual application, it is impossible to accurately locate the target area. Summary of the invention

[0004] The purpose of the present invention is to overcome the above-mentioned shortcomings and provide a method for identifying oil and water stains on the ground at power sites guided by an attention mechanism, so as to solve the problems of weak attention to key areas and insufficient recognition ability of key channel information of fused features in the process of identifying oil and water stains on the ground at power sites.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: a method for identifying oil and water stains on the ground at a power site guided by an attention mechanism, which comprises the following steps:

[0006] Step 1: Construct a spatial attention-guided feature extraction residual block to guide the module to focus on key feature areas;

[0007] Step 2: construct a multi-scale feature extractor based on the feature extraction residual block to obtain rich semantic features from the input image;

[0008] Step 3: Construct a channel attention-guided feature fusion module to fuse features from the encoder and decoder;

[0009] Step 4: Construct a model decoder based on the feature fusion module;

[0010] Step 5: Train the established detection model, save the model parameters and generate the final oil and water stain area detection results.

[0011] Furthermore, the step 1 specifically includes:

[0012] The information of the input module is passed through three basic residual blocks to extract basic semantic features. Then the spatial attention mechanism is used to guide the module to focus on the key areas in the semantic features. Finally, the features enhanced by spatial attention are used as the output of the feature extraction residual block. The process is expressed as:

[0013]

[0014] Among them, Fea in Represents the original information of the input feature extraction residual block, Fea raw Represents the basic semantic features extracted by three basic residual blocks, Fea out represents the output of the feature extraction residual block; f i represents the basic residual block consisting of two convolutional layers, f spa It is the spatial attention mechanism.

[0015] Furthermore, the step 2 specifically includes:

[0016] The convolutional layer, BN layer and ReLU function are used as the first layer of the multi-scale feature extractor; the feature extraction residual blocks constructed in step 1 are used to construct the 2nd to 5th layers of the multi-scale feature extractor respectively; the multi-scale feature extraction residual blocks are connected by a maximum pooling layer with a kernel size of 2×2 and a step size of 2 to implement the downsampling operation; the process is expressed as follows:

[0017]

[0018] Input represents the picture of the input model. Represents the features obtained by the multi-scale feature extractor; Conv 3×3 is a convolutional layer with a kernel size of 3×3 and a stride of 1, BN represents the BN layer, and ReLU is the ReLU activation function; Pool max is the maximum pooling layer, f E-i It is the 2nd to 4th layer operation of the multi-scale feature extractor.

[0019] Furthermore, the step three specifically includes:

[0020] The features from the encoder and decoder are concatenated along the channel dimension, and the channel attention mechanism is used to guide the concatenated features to focus on important channel dimension information; the process is expressed as:

[0021]

[0022] where f charepresents the channel attention mechanism, Cat represents the feature concatenation along the channel dimension, Up 2 Indicates upsampling of bilinear interpolation with a magnification of 2; represents the features obtained by the multi-scale feature extractor, Indicates the features of decoder layers 2 to 5, Represents the features after the channel attention mechanism.

[0023] Furthermore, the step 4 specifically includes:

[0024] Two convolutional layers with a convolution kernel size of 3×3 are used to construct basic residual blocks, and three basic residual blocks are used to construct each layer of the model decoder. The model decoder is used to process the features after the channel attention mechanism is concerned to generate decoder features. The process can be expressed as:

[0025]

[0026] in represents the corresponding layer feature of the decoder, f D-i represents the operation of the decoder layer i, Represents the features after the channel attention mechanism.

[0027] Furthermore, the step five specifically includes:

[0028] The images were uniformly resized to 256×256, and then 8 times larger by rotating them by 90°, 180°, 270°, and horizontal mirroring. The batch size was set to 8, and the SGD optimizer was used for parameter update. The initial learning rate was set to 1.5×10 -2 ; The model is deployed using the Pytorch framework, and the cross entropy loss function is used to calculate the loss.

[0029] Beneficial effects of the present invention:

[0030] 1. The present invention introduces a spatial attention mechanism in a multi-scale feature extractor, which helps the model to enhance its attention to spatial information during the feature extraction process; specifically, the multi-scale feature extractor can capture features of different scales in the image, and by introducing the spatial attention mechanism, the model can selectively focus on image regions at different scales; this mechanism enables the model to better identify important regions in the image, thereby improving the accuracy and effectiveness of feature extraction; the spatial attention mechanism generates a spatial weight map, so that the features of important regions are enhanced, while the features of unimportant regions are weakened, so that this information can be more effectively utilized in the subsequent feature processing stage, thereby improving the overall performance of the model.

[0031] 2. The present invention introduces a channel attention mechanism in the feature fusion module, which helps to guide the model to focus on the more important channel dimension information in the fused features; feature fusion is the process of combining features from different sources or different levels. By introducing the channel attention mechanism, the model can automatically identify and emphasize the channels that contribute most to the final task during the feature fusion process; this mechanism assigns different weights to each channel, so that important channel information is strengthened and unimportant channel information is weakened, thereby improving the effect of feature fusion; the channel attention mechanism can not only improve the performance of the model in the feature fusion stage, but also further improve the model's understanding and analysis capabilities of image content.

[0032] 3. The present invention can significantly improve the feature extraction and feature fusion capabilities of the model by combining the spatial attention mechanism and the channel attention mechanism; by introducing these two attention mechanisms, the model can allocate resources and focus more intelligently, thereby showing higher accuracy in the identification of oil and water stains on the ground at power sites; it solves the problems of weak attention to key areas and insufficient identification of key channel information of fused features during the identification of oil and water stains on the ground at power sites. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 is a schematic diagram of the feature extraction residual block;

[0034] Figure 2 is a schematic diagram of a multi-scale feature extractor;

[0035] Figure 3 is a schematic diagram of the feature fusion module;

[0036] Figure 4 This is the effect diagram of oil and water stain identification. DETAILED DESCRIPTION

[0037] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0038] Example 1: Figure 1-3 As shown, a method for identifying oil and water stains on the ground at a power site guided by an attention mechanism includes the following steps:

[0039] Step 1: Construct a spatial attention-guided feature extraction residual block to guide the module to focus on key feature areas;

[0040] Step 2: construct a multi-scale feature extractor based on the feature extraction residual block to obtain rich semantic features from the input image;

[0041] Step 3: Construct a channel attention-guided feature fusion module to fuse features from the encoder and decoder;

[0042] Step 4: Construct a model decoder based on the feature fusion module;

[0043] Step 5: Train the established detection model, save the model parameters and generate the final oil and water stain area detection results.

[0044] Furthermore, the step 1 specifically includes:

[0045] The information of the input module is passed through three basic residual blocks to extract basic semantic features. Then the spatial attention mechanism is used to guide the module to focus on the key areas in the semantic features. Finally, the features enhanced by spatial attention are used as the output of the feature extraction residual block. The process is expressed as:

[0046]

[0047] Among them, Fea in Represents the original information of the input feature extraction residual block, Fea raw Represents the basic semantic features extracted by three basic residual blocks, Fea out represents the output of the feature extraction residual block; f i represents the basic residual block consisting of two convolutional layers, f spa It is the spatial attention mechanism.

[0048] Furthermore, the step 2 specifically includes:

[0049] The convolutional layer, BN layer and ReLU function are used as the first layer of the multi-scale feature extractor; the feature extraction residual blocks constructed in step 1 are used to construct the 2nd to 5th layers of the multi-scale feature extractor respectively; the multi-scale feature extraction residual blocks are connected by a maximum pooling layer with a kernel size of 2×2 and a step size of 2 to implement the downsampling operation; the process is expressed as follows:

[0050]

[0051] Input represents the picture of the input model. Represents the features obtained by the multi-scale feature extractor; Conv 3×3 is a convolutional layer with a kernel size of 3×3 and a stride of 1, BN represents the BN layer, and ReLU is the ReLU activation function; Pool max is the maximum pooling layer, f E-i It is the 2nd to 4th layer operation of the multi-scale feature extractor.

[0052] Furthermore, the step three specifically includes:

[0053] The features from the encoder and decoder are concatenated along the channel dimension, and the channel attention mechanism is used to guide the concatenated features to focus on important channel dimension information; the process is expressed as:

[0054]

[0055] where f cha represents the channel attention mechanism, Cat represents the feature concatenation along the channel dimension, Up 2 Indicates upsampling of bilinear interpolation with a magnification of 2; represents the features obtained by the multi-scale feature extractor, Indicates the features of decoder layers 2 to 5, Represents the features after the channel attention mechanism.

[0056] Furthermore, the step 4 specifically includes:

[0057] Two convolutional layers with a convolution kernel size of 3×3 are used to construct basic residual blocks, and three basic residual blocks are used to construct each layer of the model decoder. The model decoder is used to process the features after the channel attention mechanism is concerned to generate decoder features. The process can be expressed as:

[0058]

[0059] in represents the corresponding layer feature of the decoder, f D-i represents the operation of the decoder layer i, Represents the features after the channel attention mechanism.

[0060] Furthermore, the step five specifically includes:

[0061] The images were uniformly resized to 256×256, and then 8 times larger by rotating them by 90°, 180°, 270°, and horizontal mirroring. The batch size was set to 8, and the SGD optimizer was used for parameter update. The initial learning rate was set to 1.5×10 -2 ; The model is deployed using the Pytorch framework, and the cross entropy loss function is used to calculate the loss.

[0062] Embodiment 2:

[0063] like Figure 4 As shown in the figure, the first row shows the original images of oil and water stains on the ground in two scenarios, indoors and outdoors, the second row is the true value image of the oil and water stain area detection result, and the third row is the detection result image of the method of the present invention. It can be seen that the detection result of the method of the present invention is highly consistent with the true value image, indicating that its detection accuracy is excellent. In addition, the method of the present invention shows good performance in both indoor and outdoor scenes. Therefore, the proposed method not only has excellent detection performance, but also has strong scene adaptability.

[0064] The above embodiments are only preferred technical solutions of the present invention and should not be regarded as limiting the present invention. The protection scope of the present invention shall be the technical solutions recorded in the claims, including equivalent replacement solutions of the technical features in the technical solutions recorded in the claims. That is, equivalent replacement improvements within this scope are also within the protection scope of the present invention.

Claims

1. A method for identifying oil and water stains on the ground at a power site guided by an attention mechanism, characterized in that: It includes the following steps: Step 1: Construct a spatial attention-guided feature extraction residual block to guide the module to focus on key feature areas; Step 2: construct a multi-scale feature extractor based on the feature extraction residual block to obtain rich semantic features from the input image; Step 3: Construct a channel attention-guided feature fusion module to fuse features from the encoder and decoder; Step 4: Construct a model decoder based on the feature fusion module; Step 5: Train the established detection model, save the model parameters and generate the final oil and water stain area detection results.

2. The method for identifying oil and water stains on the ground at a power site guided by the attention mechanism according to claim 1 is characterized by: The step 1 specifically includes: The information of the input module is passed through three basic residual blocks to extract basic semantic features. Then the spatial attention mechanism is used to guide the module to focus on the key areas in the semantic features. Finally, the features enhanced by spatial attention are used as the output of the feature extraction residual block. The process is expressed as: Among them, Fea in Represents the original information of the input feature extraction residual block, Fea raw Represents the basic semantic features extracted by three basic residual blocks, Fea out represents the output of the feature extraction residual block; f i represents the basic residual block consisting of two convolutional layers, f spa It is the spatial attention mechanism.

3. The method for identifying oil and water stains on the ground at a power site guided by the attention mechanism according to claim 1 is characterized by: The step 2 specifically includes: The convolutional layer, BN layer and ReLU function are used as the first layer of the multi-scale feature extractor; the feature extraction residual blocks constructed in step 1 are used to construct the 2nd to 5th layers of the multi-scale feature extractor respectively; the multi-scale feature extraction residual blocks are connected by a maximum pooling layer with a kernel size of 2×2 and a step size of 2 to implement the downsampling operation; the process is expressed as follows: Input represents the picture of the input model. Represents the features obtained by the multi-scale feature extractor; Conv 3×3 is a convolutional layer with a kernel size of 3×3 and a stride of 1, BN represents the BN layer, and ReLU is the ReLU activation function; Pool max is the maximum pooling layer, f E-i It is the 2nd to 4th layer operation of the multi-scale feature extractor.

4. The method for identifying oil and water stains on the ground at a power site guided by the attention mechanism according to claim 1 is characterized by: The step three specifically includes: The features from the encoder and decoder are concatenated along the channel dimension, and the channel attention mechanism is used to guide the concatenated features to focus on important channel dimension information; the process is expressed as: where f cha represents the channel attention mechanism, Cat represents the feature concatenation along the channel dimension, and Up2 represents the upsampling of bilinear interpolation with a magnification of 2; represents the features obtained by the multi-scale feature extractor, Indicates the features of decoder layers 2 to 5, Represents the features after the channel attention mechanism.

5. The method for identifying oil and water stains on the ground at a power site guided by the attention mechanism according to claim 4 is characterized by: The step 4 specifically includes: Two convolutional layers with a convolution kernel size of 3×3 are used to construct basic residual blocks, and three basic residual blocks are used to construct each layer of the model decoder. The model decoder is used to process the features after the channel attention mechanism is concerned to generate decoder features. The process can be expressed as: in represents the corresponding layer feature of the decoder, f D-i represents the operation of the decoder layer i, Represents the features after the channel attention mechanism.

6. The method for identifying oil and water stains on the ground at a power site guided by the attention mechanism according to claim 1 is characterized by: The step five specifically includes: The images were uniformly resized to 256×256, and then 8 times larger by rotating them by 90°, 180°, 270°, and horizontal mirroring. The batch size was set to 8, and the SGD optimizer was used for parameter update. The initial learning rate was set to 1.5×10 -2 ; The model is deployed using the Pytorch framework, and the cross entropy loss function is used to calculate the loss.

Citation Information

Patent Citations

  • Robot inspection cleaning method and device, robot and storage medium

    CN112287834A

Cited By

  • Stain detection method and device based on spectrum abnormal region perception

    CN120375331A