Transformer early-stage oil leakage small target detection method based on cavity convolution
By adding feature enhancement modules, improved feature fusion modules and adding normalized attention mechanism modules to the YOLOv8 model, the accuracy problem of small object detection of oil leakage in the early stage of transformers is solved, and higher detection accuracy and safety are achieved.
Patent Information
- Application Number
- CN202411682752.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-14
AI Technical Summary
It is difficult to accurately detect small oil leakage targets in the early stages of transformers, and traditional manual inspections are inefficient and have safety hazards.
The early oil leakage small object detection method of transformer based on cavity convolution is adopted. By adding feature enhancement modules after the C2f module in the first three stages of the backbone network of the YOLOv8 model, the feature fusion module of the head network and the normalized attention mechanism module are added to improve the detection accuracy.
It improves the accuracy of early oil leakage detection of transformers, enhances the accuracy and effectiveness of feature extraction, and reduces the safety risks of manual inspection.
Smart Images

Figure CN119625257A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer vision and target detection, and in particular to a small target detection method for early transformer oil leakage based on dilated convolution. Background Art
[0002] Transformers are an indispensable core component in industrial production. Their safe and stable operation plays a vital role in ensuring the smoothness and efficiency of the entire industrial production process. As a key link in the power transmission and distribution system, transformers are responsible for converting electrical energy from one voltage level to another, thereby meeting the power needs of various industrial equipment. Once a transformer fails or operates unstably, it will directly affect the continuity and efficiency of industrial production. Therefore, ensuring the safe and stable operation of transformers is of great significance to maintaining the normal order of industrial production and ensuring production efficiency and product quality.
[0003] Traditional transformer early oil leakage detection methods mainly rely on manual inspections, which is not only inefficient but also has potential safety hazards that cannot be ignored. Manual inspections are limited by the experience and observation of inspectors, and it is often difficult to quickly and accurately capture the early signs of transformer leakage. In addition, during the inspection process, inspectors need to come into close contact with high-voltage equipment, which undoubtedly increases the safety risks during the operation. Therefore, the traditional manual inspection method has obvious limitations in early transformer leakage detection, and there is an urgent need to seek more efficient and safe detection methods. Summary of the invention
[0004] The purpose of the present invention is to provide a small target detection method for early transformer oil leakage based on void convolution, so as to solve the problem that small targets of early transformer oil leakage are difficult to detect accurately.
[0005] To achieve the above object, the technical solution adopted by the present invention is: a transformer early oil leakage small target detection method based on void convolution, comprising the following steps:
[0006] Step 1: Data collection and division: Collect early transformer oil leakage images, annotate the image data, and divide the data set;
[0007] Step 2, data preprocessing: Mosaic data enhancement is performed on the data set, and then geometric transformation data enhancement is performed to obtain a preprocessed data set;
[0008] Step 3, construct a detection model: the detection model optimizes the backbone network and head network of the original YOLOv8 model, uses the detection head of the head network for detection, and obtains the coordinates, category and confidence of the target object; the optimization of the original YOLOv8 model is as follows: a feature enhancement module is added after the C2f module in the first three stages of the backbone network, and the feature enhancement module extracts multiple discriminative semantic information through three branch structures; the feature fusion module of the head network adopts an improved feature fusion module, and introduces learnable weight parameters to adaptively adjust the weights of channel features; a normalized attention mechanism module is added to the head network, and the feature map obtained after feature extraction by the C2f module in the head network is fused with feature maps of other sizes after the normalized attention mechanism module to enhance the features of useful channels;
[0009] Step 4: Training model: Use the preprocessed data set to train and evaluate the constructed detection model to obtain the optimal network model;
[0010] Step 5: Use the optimal network model to detect early transformer oil leakage.
[0011] Furthermore, the specific method of step 1 is:
[0012] Step 101, collecting n original images of early transformer oil leakage;
[0013] Step 102: annotate the image described in step 101 in YOLO format to obtain an image data set, where the annotation information includes category information and coordinate information of the target object;
[0014] Step 103: divide the data set described in step 102 into a training set, a validation set, and a test set in a ratio of 7:2:1.
[0015] Furthermore, the geometric transformation in step 2 includes rotation, translation and scaling.
[0016] Furthermore, the structure of the feature enhancement module in step 3 is as follows: first, a basic convolution block BasicConv is defined, BasicConv includes a convolution layer, batch normalization and an activation function, and the feature enhancement module extracts multiple discriminative semantic information through a three-branch structure;
[0017] In the first branch, BasicConv is called twice, and the size of the convolution kernel of BasicConv is set to 1*1 and 3*3 respectively; the second branch calls BasicConv four times, the first call to BasicConv sets the convolution kernel size to 1*1, the second call to BasicConv sets the convolution kernel size to 1*3 to extract features along the width direction, the third call to BasicConv sets the convolution kernel size to 3*1 to capture features along the height direction, and the fourth call to BasicConv uses an expanded convolution with a convolution kernel size of 3*3 to cover a larger receptive field; the third branch calls BasicConv four times, the first call to BasicConv sets the convolution kernel size to 1*1, the second call to BasicConv sets the convolution kernel size to 3*1 to capture features along the height direction, the third call to BasicConv sets the convolution kernel size to 1*3 to extract features along the width direction, and the fourth call to BasicConv uses an expanded convolution with a convolution kernel size of 3*3 to cover a larger receptive field;
[0018] The features extracted by the above three branches are spliced along the channel dimension, the spliced feature map is linearly transformed, the number of channels is adjusted, and the number of channels is adjusted again through a convolution layer, and finally through the ReLU activation function. The operation flow formula of the three branches is as follows: Y=(W 1, W 2, W3)
[0019] In the formula, F represents the input feature, Represents a convolution layer with a convolution kernel size of 1*1. Represents a convolution layer with a convolution kernel size of 3*3. Represents a convolution layer with a convolution kernel size of 1*3. Represents a convolution layer with a convolution kernel size of 3*1. represents a convolutional layer with a kernel size of 3*3 and a void ratio of 5. W1, W2, and W3 represent the outputs of the three branches respectively. Y represents the concatenated feature map of W1, W2, and W3. ReLu(·) represents the ReLu activation function.
[0020] Furthermore, the improved feature fusion module in step 3 is used to fuse the two feature maps input to the module. The specific implementation process is: first, a weight parameter α that can be learned during the training process is set, and its initial value is a tensor of all 1s, and the size is the total number of channels of the two input feature maps; then the weight values of the two input feature maps are extracted in the weight parameter α to ensure that these weights can cover the number of channels of the two input feature maps; then the weights are normalized so that the sum of all weights is 1, and then the input feature maps are weighted, each input is reshaped into a four-dimensional tensor and multiplied by the corresponding weight, and then its shape is adjusted back to the original four-dimensional format, and finally the weighted feature maps are spliced along the channel dimension; the normalization calculation formula is as follows:
[0021] In the formula, weight represents the normalized weight, α represents the learnable weight parameter, and α i represents the weight value on channel i, ∈ is a small constant, and C1 and C2 are the number of channels of the two feature maps of the input respectively.
[0022] Further, the head network extracts feature maps P3, P4 and P5 output by the backbone network, the head network upsamples the feature map P5, and then fuses the upsampled feature map with the feature map P4 through an improved feature fusion module, and after feature fusion, the feature map C4 is processed by the C2f module to obtain the feature map C4, and after upsampling, the feature map C4 is fused with the feature map P3 through the improved feature fusion module, and after feature fusion, the feature map P'3 is processed by the C2f module to obtain the feature map P'3, and the feature map P'3 is processed by the normalized attention mechanism module and fused with the feature map C4 through the improved feature fusion module, and after feature fusion, the feature map P'4 is processed by the C2f module to obtain the feature map P'4, and the feature map P'4 is processed by the normalized attention mechanism module and fused with the feature map P5 through the improved feature fusion module, and after feature fusion, the feature map P'5 is processed by the C2f module, and the feature maps P'3, P'4 and P'5 are input into the detection head module.
[0023] Furthermore, the normalized attention mechanism module in step 3 includes a channel attention mechanism module and a spatial attention mechanism module, and the output features of the channel attention module are further processed as input of the spatial attention mechanism module.
[0024] Furthermore, the channel attention mechanism module is implemented as follows: the input feature map is processed by a normalization layer, affine is set to True in the normalization layer, and trainable weights are introduced, specifically including:
[0025] (1) The normalized weight of each channel in the normalization layer is obtained by the following formula;
[0026] In the formula, represents the normalized weight of channel i, C is the number of channels, Represents the weight parameter ω generated by the normalization layer j The absolute value sum of i Represents the weight parameter on channel i;
[0027] (2) Multiply the feature map of each channel by the normalized weight of the channel The weighted feature map is obtained. After being processed by the sigmoid activation function, the weighted feature map is multiplied element-by-element with the initial input feature map to realize the residual connection.
[0028] Furthermore, the implementation process of the spatial attention mechanism module is as follows: first, the mean of the input feature map is calculated along the channel dimension to generate a mean feature map, then the maximum value of the input feature map is calculated along the channel dimension to generate a maximum feature map, and then the mean feature map and the maximum feature map are concatenated on the channel dimension, a convolution operation is applied to the concatenated feature map, and finally the Sigmoid activation function is used to obtain the spatial attention weight map, and the generated spatial attention weight map is multiplied with the original input feature map to weight each spatial position of the input feature map.
[0029] Furthermore, the training model method in step 4 is:
[0030] Step 401, select a stochastic gradient descent optimizer to update model parameters;
[0031] Step 402: Use cosine learning rate scheduling to smoothly adjust the learning rate;
[0032] Step 403: input the training set into the constructed detection model to obtain parameters that meet the requirements;
[0033] Step 404: Evaluate the model on the validation set, and then obtain the optimal network model based on the results.
[0034] By adopting the above technical solution, the present invention can achieve the following beneficial effects:
[0035] The present invention adds a feature enhancement module to the backbone network part of the original YOLOv8 model, and extracts multiple discriminative information in different directions with a multi-branch structure; by introducing a hole convolution in the branch, a wider range of context information can be obtained without increasing the amount of calculation; the feature fusion module is improved in the head network of YOLOv8, and different weights are assigned to different features by setting learnable parameters to achieve feature fusion, and the channel weights of the feature map are continuously optimized during the model training process to highlight or weaken the features; and a normalized attention mechanism module is added to the head of YOLOv8, and the weighted output of the channel is realized by using the residual connection method, so as to enhance the features of the useful channels and suppress the useless features, thereby enhancing the extraction and expression capabilities of the effective features and improving the accuracy of the feature extraction. The present invention can obtain a higher accuracy rate of early transformer oil leakage detection by optimizing the YOLOv8 model. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 This is the overall structure diagram of the original YOLOv8 model;
[0037] Figure 2 It is a structural framework diagram of the optimized YOLOv8 model in an embodiment of the present invention;
[0038] Figure 3 is a structural diagram of a feature enhancement module in an embodiment of the present invention;
[0039] Figure 4 It is a structural diagram of an improved feature fusion module in an embodiment of the present invention;
[0040] Figure 5 2 is a structural diagram of the channel attention mechanism module in an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0042] The present invention discloses a small target detection method for early transformer oil leakage based on YOLOv8 improvement, comprising the following steps:
[0043] Step 1: Data collection and division:
[0044] Step 101, collecting n original images of early transformer oil leakage;
[0045] Step 102: annotate the image described in step 101 in YOLO format to obtain an image data set, where the annotation information includes category information and coordinate information of the target object;
[0046] Step 103: divide the data set described in step 102 into a training set, a validation set, and a test set in a ratio of 7:2:1.
[0047] Step 2: Data preprocessing:
[0048] Step 201, using Mosaic data enhancement;
[0049] Step 202: Perform geometric transformation data enhancement to obtain a preprocessed image. The geometric change data enhancement is set to random perturbation data enhancement, and the geometric change includes rotation, translation and scaling. The rotation transformation angle range is 30 degrees; the image translation amplitude is 10% up and down; and the image scaling transformation range is 20%-120%.
[0050] Step 3: Build the backbone network of the model: Build the detection model: The detection model optimizes the backbone network and head network of the original YOLOv8 model, uses the detection head of the head network to detect, and obtains the coordinates, category and confidence of the target object; the original YOLOv8 model is as follows Figure 1 As shown, the backbone network includes sequentially connected preset convolutional layers and 4 stage layers, each stage layer includes a preset convolutional layer and a C2f module, and the last stage layer is connected with an SPPF module after the C2f module; the present invention optimizes the original YOLOv8 model as follows:
[0051] A feature enhancement module is added after the C2f module in the first three stages of the backbone network. The feature enhancement module extracts multiple discriminative semantic information through three branch structures; the feature fusion module of the head network adopts an improved feature fusion module, which introduces learnable weight parameters to adaptively adjust the weights of channel features; a normalized attention mechanism module is added to the head network, and the feature map obtained after feature extraction by the C2f module in the head network is fused with feature maps of other sizes after passing through the normalized attention mechanism module to enhance the features of useful channels.
[0052] It should be noted that the cross-stage fusion module in this embodiment adopts the C2f module of the original YOLOv8 model.
[0053] Due to the weak shape and texture features of the small target of early transformer oil leakage, especially when the image is taken from a long distance, the target object is difficult to distinguish from the background. In addition, the small target occupies a relatively small area in the image and is easily lost in low-resolution or large feature maps. Therefore, a self-designed feature enhancement module is added to the backbone network of the YOLOv8 model. The structure of the optimized YOLOv8 model is as follows: Figure 2 shown.
[0054] The specific implementation process of the backbone network of the present invention is as follows: after the preprocessed image is input into the network, a preliminary feature is first extracted through a convolution operation and recorded as a feature map P1. Subsequently, the feature map P1 is further processed through a convolution operation and a cross-stage fusion module to obtain a feature map P2. Next, the feature map P2 is enhanced by a feature enhancement module to obtain a feature map P2′. The feature map P2′ is then processed by a convolution operation and a cross-stage fusion module to obtain a feature map P3, and the feature map P3 is processed by a feature enhancement module to obtain a feature map P3′. Then, the feature map P3′ is again processed by a convolution operation and a cross-stage fusion module to obtain a feature map P4. The feature map P4 is passed through a feature enhancement module to obtain an enhanced feature map P4′. Finally, the feature map P4′ is processed by a convolution module and a cross-stage fusion module, and then processed by spatial pyramid pooling to obtain a feature map P5.
[0055] The specific structure of the feature enhancement module of the present invention is as follows Figure 3 As shown in the figure, specifically: first define a basic convolution block BasicConv, which contains convolution layers, batch normalization and activation functions. The feature enhancement module extracts multiple discriminative semantic information through a three-branch structure. In the first branch, BasicConv is called twice, and the size of the convolution kernel of BasicConv is set to 1*1 and 3*3 respectively. The second branch calls BasicConv four times. The first call to BasicConv sets the convolution kernel size to 1*1 to change the number of channels without changing the spatial size of the feature map; the second call to BasicConv sets the convolution kernel size to 1*3 to extract features along the width direction; the third call to BasicConv sets the convolution kernel size to 3x1 to capture features along the height direction; the fourth call to BasicConv uses an expanded convolution with a convolution kernel size of 3*3 to cover a larger perception. The third branch calls BasicConv four times. The difference from the third branch is that the third branch sets the convolution kernel size to 3*1 in the second call to BasicConv to capture features along the height direction; the third call to BasicConv sets the convolution kernel size to 1*3 to extract features along the width direction; the features extracted by the three branches are concatenated along the channel dimension, and then the concatenated feature map is linearly transformed, the number of channels is adjusted, and then the number of channels is adjusted through a convolution layer, and finally through the ReLU activation function. The operation flow formula of the three branches is as follows: Y=(W 1, W 2, W3)
[0056] Among them, F represents the input feature, Represents a convolution layer with a convolution kernel size of 1*1. Represents a convolution layer with a convolution kernel size of 3*3. Represents a convolution layer with a convolution kernel size of 1*3. Represents a convolution layer with a convolution kernel size of 3*1. represents a convolutional layer with a kernel size of 3*3 and a void ratio of 5. W1, W2, and W3 represent the outputs of the three branches respectively. Y represents the concatenated feature map of W1, W2, and W3. ReLu(·) represents the ReLu activation function.
[0057] The head network of the YOLOv8 model uses an improved feature fusion module. This is because the features of small targets such as early transformer oil leakage are very important for the detection task. In the feature fusion stage, the features of small targets will become less obvious during the fusion process and be obscured by background information. Feature fusion is achieved by assigning different weights to different features, and the channel weights of the feature map are continuously optimized during the model training process to enhance the extraction of effective features.
[0058] The structure of the improved feature fusion module is as follows: Figure 4 As shown in Figure 2, the implementation process of the improved feature fusion module is as follows:
[0059] First, set a learnable weight parameter α during training, whose initial value is a tensor of all 1s, and whose size is the total number of channels of the two input feature maps; then extract the weight values of the two input feature maps in the weight parameter α to ensure that these weights can cover the number of channels of the two input feature maps; then normalize the weights so that the sum of all weights is 1 to avoid excessive weight of a certain channel; then weight the input feature maps, reshape each input into a four-dimensional tensor and multiply it with the corresponding weight, then adjust its shape back to the original four-dimensional format, and finally splice the weighted feature maps along the channel dimension. The normalization calculation formula is as follows:
[0060] In the formula, weight represents the normalized weight, α represents the learnable weight parameter, and α i represents the weight value on channel i, ∈ is a small constant, and C1 and C2 are the number of channels of the two feature maps of the input respectively.
[0061] The input feature maps are then weighted by reshaping each input into a four-dimensional tensor and multiplying it with the corresponding weights, then adjusting its shape back to the original four-dimensional format, and finally concatenating the weighted feature maps along the channel dimension.
[0062] The present invention adds a normalized attention mechanism module to the head of YOLOv8. After fusing features of multiple scales and sources, global semantic information is included. In order to highlight the small target feature channels that are beneficial to the task, the normalized attention mechanism module is set to suppress useless features and enhance the extraction and expression capabilities of effective features.
[0063] like Figure 2 As shown, the calculation process of the head network of the detection model is as follows: the head network extracts the feature map P3, feature map P4 and feature map P5 output by the backbone network, the head network upsamples the feature map P5, and then fuses the upsampled feature map with the feature map P4 through an improved feature fusion module, and after feature fusion, the feature map C4 is processed by the C2f module to obtain the feature map C4, and after upsampling, the feature map C4 is fused with the feature map P3 through the improved feature fusion module, and after feature fusion, the feature map P'3 is processed by the C2f module to obtain the feature map P'3, and the feature map P'3 is processed by the normalized attention mechanism module and fused with the feature map C4 through the improved feature fusion module, and after feature fusion, the feature map P'4 is processed by the C2f module to obtain the feature map P'4, and the feature map P'4 is processed by the normalized attention mechanism module and fused with the feature map P5 through the improved feature fusion module, and after feature fusion, the feature map P'5 is processed by the C2f module, and the feature maps P'3, P'4 and P'5 are input into the detection head module.
[0064] The normalized attention mechanism module includes a channel attention mechanism and a spatial attention mechanism. The features of the channel attention output are further processed as inputs of the spatial attention mechanism.
[0065] The implementation process of the channel attention mechanism module is as follows: the input feature map is processed by the normalization layer, affine is set to True in the normalization layer, and trainable weights are introduced, including:
[0066] (1) The normalized weight of each channel in the normalization layer is obtained by the following formula;
[0067] In the formula, represents the normalized weight of channel i, C is the number of channels, Represents the weight parameter ω generated by the normalization layer j The absolute value sum of i Represents the weight parameter on channel i;
[0068] (2) Multiply the feature map of each channel by the normalized weight of the channel The weighted feature map is obtained, and the channel-weighted feature map is processed by the sigmoid activation function. Finally, the channel-weighted feature map is element-by-element multiplied with the initial input feature map to realize the residual connection. The obtained feature map contains the scaling information of the channel weight and also retains part of the original feature information.
[0069] The implementation process of the spatial attention mechanism module is as follows: First, the mean of the input feature map is calculated along the channel dimension to generate a mean feature map. Then the maximum value of the input feature map is calculated along the channel dimension to generate a maximum feature map. Then the mean feature map and the maximum feature map are concatenated in the channel dimension. A convolution operation is applied to the concatenated feature map, and finally a Sigmoid activation function is used to obtain a spatial attention weight map. The generated spatial attention weight map is multiplied with the original input feature map to weight each spatial position of the input feature map.
[0070] Step 4: Use the detection head to detect the features and obtain the coordinates, category and confidence of the target object;
[0071] Specifically, the three detection heads detect the feature map P10, the feature map P9, and the feature map P8 respectively to obtain the coordinates, category, and confidence of the target object;
[0072] Step 4: Train the model; input the training set into the constructed model to obtain parameters that meet the requirements. Then evaluate the model on the validation set and derive the optimal network model based on the results. The specific steps include the following:
[0073] Step 401, select the stochastic gradient descent (SGD) optimizer to update the model parameters;
[0074] Step 402: Use cosine learning rate scheduling to smoothly adjust the learning rate;
[0075] Step 403: input the training set into the constructed model to obtain parameters that meet the requirements;
[0076] Step 404: Evaluate the model on the validation set and obtain the optimal network model based on the experimental results.
[0077] Step 5: Use the optimal network model obtained in step 4 to detect early transformer oil leakage.
[0078] Step 501, setting the weight file to the optimal network model obtained in step 4;
[0079] Step 502: Input the transformer early oil leakage image to be detected into the network to perform transformer early leakage detection.
[0080] The effectiveness of the present invention is verified by comparative experiments. Table 1 shows the comparative experimental results of the method of the present invention and other methods. Compared with the original YOLOv8, the method proposed in the present invention has improved in all indicators, among which the accuracy, recall rate and mAP50 have increased by 7.7%, 9.3% and 5.9% respectively.
[0081] Compared with YOLOv3, YOLOv5 and YOLOv6, the indicators of the proposed method are also improved. In general, the model proposed in the present invention shows better performance in the detection of small targets of early transformer oil leakage than other methods. Table 1 Comparative experimental results of the method of the present invention and other methods Model Accuracy (%) Recall rate (%) mAP50(%) YOLOv3 89.3 51.7 62.8 YOLOv5 81.4 61.2 75.9 YOLOv6 76.9 49.5 56.9 Original YOLOv8 84.9 61.9 75.9 Method of the present invention 92.6 71.2 81.8
[0082] Finally, it should be noted that the parts of the present invention that are not described in detail are all prior art. Those of ordinary skill in the art can understand that the above are only preferred examples of the invention and are not intended to limit the invention. Although the invention is described in detail with reference to the aforementioned examples, those of ordinary skill in the art can still modify the technical solutions recorded in the aforementioned examples, or replace some of the technical features therein with equivalents. Any modifications, equivalent replacements, etc. made within the spirit and principles of the invention should be included in the scope of protection of the invention.
Claims
1. A small target detection method for early transformer oil leakage based on dilated convolution, characterized in that: The steps include: Step 1: Data collection and division: Collect early transformer oil leakage images, annotate the image data, and divide the data set; Step 2, data preprocessing: Mosaic data enhancement is performed on the data set, and then geometric transformation data enhancement is performed to obtain a preprocessed data set; Step 3: Build a detection model: The detection model optimizes the backbone network and head network of the original YOLOv8 model, uses the detection head of the head network for detection, and obtains the coordinates, category, and confidence of the target object; the optimization of the original YOLOv8 model is as follows: A feature enhancement module is added after the C2f module in the first three stages of the backbone network. The feature enhancement module extracts multiple discriminative semantic information through a three-branch structure. The feature fusion module of the head network adopts an improved feature fusion module, which introduces learnable weight parameters to adaptively adjust the weights of channel features. A normalized attention mechanism module is added to the head network. The feature map obtained after feature extraction by the C2f module in the head network is fused with feature maps of other sizes after passing through the normalized attention mechanism module to enhance the features of useful channels. Step 4: Training model: Use the preprocessed data set to train and evaluate the constructed detection model to obtain the optimal network model; Step 5: Use the optimal network model to detect early transformer oil leakage.
2. According to the method of detecting small targets of transformer early oil leakage based on dilated convolution in claim 1, it is characterized in that: The specific method of step 1 is: Step 101, collecting n original images of early transformer oil leakage; Step 102: annotate the image described in step 101 in YOLO format to obtain an image data set, where the annotation information includes category information and coordinate information of the target object; Step 103: divide the data set described in step 102 into a training set, a validation set, and a test set in a ratio of 7:2:
1.
3. According to claim 1, a transformer early oil leakage small target detection method based on void convolution is characterized in that: The geometric transformation in step 2 includes rotation, translation and scaling.
4. According to claim 1, a transformer early oil leakage small target detection method based on void convolution is characterized in that: The structure of the feature enhancement module in step 3 is as follows: first, a basic convolution block BasicConv is defined, BasicConv includes a convolution layer, batch normalization and an activation function, and the feature enhancement module extracts multiple discriminative semantic information through a three-branch structure; In the first branch, BasicConv is called twice, and the size of the convolution kernel of BasicConv is set to 1*1 and 3*3 respectively; The second branch calls BasicConv four times. The first call to BasicConv sets the convolution kernel size to 1*1. The second call to BasicConv sets the convolution kernel size to 1*3 to extract features along the width direction. The third call to BasicConv sets the convolution kernel size to 3*1 to capture features along the height direction. The fourth call to BasicConv uses an expanded convolution with a convolution kernel size of 3*3 to cover a larger receptive field. The third branch calls BasicConv four times. The first call to BasicConv sets the convolution kernel size to 1*1. The second call to BasicConv sets the convolution kernel size to 3*1 to capture features along the height direction. The third call to BasicConv sets the convolution kernel size to 1*3 to extract features along the width direction. The fourth call to BasicConv uses an expanded convolution with a convolution kernel size of 3*3 to cover a larger receptive field. The features extracted by the above three branches are spliced along the channel dimension, the spliced feature map is linearly transformed, the number of channels is adjusted, and the number of channels is adjusted again through a convolution layer, and finally through the ReLU activation function. The operation flow formula of the three branches is as follows: Y=(W 1, W 2, W3) In the formula, F represents the input feature, Represents a convolution layer with a convolution kernel size of 1*1. Represents a convolution layer with a convolution kernel size of 3*3. Represents a convolution layer with a convolution kernel size of 1*3. Represents a convolution layer with a convolution kernel size of 3*1. represents a convolutional layer with a kernel size of 3*3 and a void ratio of 5. W1, W2, and W3 represent the outputs of the three branches respectively. Y represents the concatenated feature map of W1, W2, and W3. ReLu(·) represents the ReLu activation function.
5. According to the method of detecting small targets of transformer early oil leakage based on dilated convolution in claim 1, it is characterized in that: The improved feature fusion module in step 3 is used to fuse the two feature maps input to the module. The specific implementation process is: first, a learnable weight parameter α is set during the training process, and its initial value is a tensor of all 1s, and the size is the total number of channels of the two input feature maps; then, the weight values of the two input feature maps are extracted in the weight parameter α to ensure that these weights can cover the number of channels of the two input feature maps; then, the weights are normalized so that the sum of all weights is 1, and then the input feature maps are weighted, each input is reshaped into a four-dimensional tensor and multiplied by the corresponding weight, and then its shape is adjusted back to the original four-dimensional format, and finally the weighted feature maps are spliced along the channel dimension; the normalization calculation formula is as follows: In the formula, weight represents the normalized weight, α represents the learnable weight parameter, and α i represents the weight value on channel i, ∈ is a small constant, and C1 and C2 are the number of channels of the two feature maps of the input respectively.
6. According to claim 1, a small target detection method for early transformer oil leakage based on dilated convolution is characterized by: The head network extracts feature maps P3, P4 and P5 output by the backbone network. The head network upsamples the feature map P5, and then fuses the upsampled feature map with the feature map P4 through an improved feature fusion module. After feature fusion, it is processed by the C2f module to obtain feature map C4. After upsampling, feature map C4 is fused with feature map P3 through an improved feature fusion module. After feature fusion, it is processed by the C2f module to obtain feature map P'3. The feature map P'3 is processed by the normalized attention mechanism module and then fused with the feature map C4 through the improved feature fusion module. After feature fusion, the feature map P'4 is obtained by processing it through the C2f module. Feature map P'4 is processed by the normalized attention mechanism module and then fused with feature map P5 through the improved feature fusion module. After feature fusion, it is processed by the C2f module to obtain feature map P'5. Feature maps P'3, P'4, and P'5 are input into the detection head module.
7. According to claim 1, a transformer early oil leakage small target detection method based on void convolution is characterized in that: The normalized attention mechanism module in step 3 includes a channel attention mechanism module and a spatial attention mechanism module, and the output features of the channel attention module are further processed as inputs of the spatial attention mechanism module.
8. According to claim 7, a method for detecting small targets of early transformer oil leakage based on dilated convolution is characterized in that: The implementation process of the channel attention mechanism module is as follows: the input feature map is processed by the normalization layer, affine is set to True in the normalization layer, and trainable weights are introduced, which specifically includes: (1) obtaining the normalized weight of each channel in the normalization layer through the following formula; In the formula, represents the normalized weight of channel i, C is the number of channels, Represents the weight parameter ω generated by the normalization layer j The absolute value sum of i Represents the weight parameter on channel i; (2) Multiply the feature map of each channel by the normalized weight of the channel The weighted feature map is obtained. After being processed by the sigmoid activation function, the weighted feature map is multiplied element-by-element with the initial input feature map to realize the residual connection.
9. According to claim 7, a method for detecting small targets of early transformer oil leakage based on dilated convolution is characterized in that: The implementation process of the spatial attention mechanism module is as follows: first, the mean of the input feature map is calculated along the channel dimension to generate a mean feature map, then the maximum value of the input feature map is calculated along the channel dimension to generate a maximum feature map, and then the mean feature map and the maximum feature map are concatenated on the channel dimension, a convolution operation is applied to the concatenated feature map, and finally the Sigmoid activation function is used to obtain the spatial attention weight map, and the generated spatial attention weight map is multiplied with the original input feature map to weight each spatial position of the input feature map.
10. According to claim 1, a transformer early oil leakage small target detection method based on dilated convolution is characterized in that: The training model method in step 4 is: Step 401, select a stochastic gradient descent optimizer to update model parameters; Step 402: Use cosine learning rate scheduling to smoothly adjust the learning rate; Step 403: input the training set into the constructed detection model to obtain parameters that meet the requirements; Step 404: Evaluate the model on the validation set, and then obtain the optimal network model based on the results.
Citation Information
Cited By
Transformer equipment oil leakage target detection method and related device
CN121787479A
Oil leakage detection method and equipment
CN122289795A
Transformer oil leakage detection method, device and equipment based on physical information
CN122313105A