A transformer oil leakage detection method and system

CN122990246APending Publication Date: 2026-10-27GUANGDONG UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611068888.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-17
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0002]变压器作为电力传输系统中的核心电气设备,其运行状态直接关系到整个电网的安全稳定,渗漏故障是影响变压器可靠运行的常见隐患,电力设备长期处于户外复杂环境中,受温度变化、机械振动、材料老化等因素影响,密封结构易出现失效,进而引发油液渗漏问题,油液渗漏会造成变压器绝缘性能降低、散热效果下降,严重时会引发设备短路、烧毁等安全事故,威胁电网运行安全,当前电力运维行业对设备故障检测的实时性、精准度要求不断提升,传统人工巡检方式依赖人工肉眼观察,存在效率低下、漏检率高、判断主观化等问题,无法实现渗漏状态的量化分析,随着智能监测技术的发展,图像检测技术逐步应用于设备故障监测,但现有技术多聚焦静态图像分析,难以捕捉渗漏的动态演化过程,无法满足变压器渗漏精细化、智能化监测的实际需求

Benefits of technology

本发明通过采集变压器连续的多帧图像并预处理得到有效时序图像序列,为漏油检测提供时序连续、质量可靠的图像输入;通过获取各相邻帧图像间的完整油迹运动矢量场并构建时序特征向量,能够量化表征漏油的时序演化规律,为渗漏状态的动态分析提供数据支撑;采用优化后的YOLO骨干网络提取油迹空间特征图,并基于时空门控融合算法完成时序特征向量与油迹空间特征图的融合处理,生成时空融合特征,可有效提升漏油检测的定位精度与识别准确性,减少误检与漏检情况;最终基于时空融合特征计算得到包括:漏油位置、置信度分数、渗漏速率等级和油污类型的变压器漏油检测结果,为变压器渗漏故障的精准判别提供可靠依据,满足电力设备运维的监测需求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122990246A_ABST
    Figure CN122990246A_ABST
Patent Text Reader

Abstract

The application relates to a transformer oil leakage detection method and system, and belongs to the technical field of power equipment fault detection. First, the application collects continuous multiple frames of images of a transformer and pre-processes the same to obtain an effective time sequence image sequence; then, based on the effective time sequence image sequence, a complete oil trace motion vector field between adjacent frames of images is obtained, and a time sequence feature vector is constructed; subsequently, an optimized YOLO backbone network is used to extract an oil trace spatial feature map, and a spatio-temporal gating fusion algorithm is used to fuse the time sequence feature vector and the oil trace spatial feature map to obtain spatio-temporal fusion features; finally, a transformer oil leakage detection result is output based on the spatio-temporal fusion features. The application can improve the accuracy and stability of oil leakage detection and provide technical support for the operation and maintenance of transformer leakage faults.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of power equipment fault detection technology, and in particular to a method and system for detecting transformer oil leakage. Background Technology

[0002] As a core electrical device in the power transmission system, the operating status of transformers directly affects the safety and stability of the entire power grid. Leakage is a common hidden danger affecting the reliable operation of transformers. Power equipment is exposed to complex outdoor environments for extended periods, and is susceptible to factors such as temperature changes, mechanical vibration, and material aging. This can easily lead to the failure of sealing structures, resulting in oil leakage. Oil leakage reduces the insulation performance and heat dissipation of transformers, and in severe cases, can cause short circuits, burnouts, and other safety accidents, threatening the safe operation of the power grid. Currently, the power operation and maintenance industry has increasingly higher requirements for the real-time and accurate detection of equipment faults. Traditional manual inspection methods rely on visual observation, which suffers from low efficiency, high missed detection rates, and subjective judgment, and cannot achieve quantitative analysis of leakage status. With the development of intelligent monitoring technology, image detection technology is gradually being applied to equipment fault monitoring. However, existing technologies mostly focus on static image analysis, making it difficult to capture the dynamic evolution process of leakage and failing to meet the actual needs of refined and intelligent monitoring of transformer leakage.

[0003] Traditional transformer oil leakage detection technologies have many limitations and are difficult to adapt to the detection requirements of actual operation and maintenance scenarios. Most detection methods rely solely on single-frame static images for analysis, only extracting the spatial morphological features of oil traces, but failing to obtain temporal motion information of oil spread. They lack data support for determining leakage rate and the age of oil contamination. Some detection technologies using optical flow algorithms are prone to incomplete vector information in motion-obstructed areas, failing to fully reconstruct the true movement trajectory of the oil trace, resulting in distorted dynamic feature extraction. Traditional technologies have not achieved effective integration of temporal and spatial features, with the two types of features being isolated from each other. This leads to insufficient accuracy in locating oil leakage targets in the detection model, easily resulting in false positives and false negatives. Furthermore, traditional detection schemes can only determine whether leakage exists, but cannot classify leakage rate or distinguish oil contamination types. The detection results cannot provide operation and maintenance personnel with a reference for the severity of the fault, and their stability in complex outdoor operating environments is poor, making it difficult to support accurate assessment and efficient handling of transformer leakage faults. Summary of the Invention

[0004] To overcome the technical problem of the prior art's inability to accurately detect transformer oil leakage, the present invention provides a method and system for detecting transformer oil leakage.

[0005] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows: A method for detecting transformer oil leakage includes the following steps: S1: Acquire multiple consecutive frames of images of the transformer and preprocess them to obtain an effective time-series image sequence; S2: Based on the effective temporal image sequence, obtain the complete oil trail motion vector field between each adjacent frame image, and construct a temporal feature vector based on the complete oil trail motion vector field between each adjacent frame image; S3: The optimized YOLO backbone network is used to extract the oil trace spatial feature map of the effective temporal image sequence, and the oil trace spatial feature map and temporal feature vector are fused based on the spatiotemporal gating fusion algorithm to obtain spatiotemporal fusion features; S4: Based on the spatiotemporal fusion features, the transformer oil leakage detection result is calculated.

[0006] Preferably, in step S1, the preprocessing includes: performing size normalization, noise filtering, and image quality screening on consecutive multi-frame images to obtain an effective temporal image sequence.

[0007] Preferably, in step S2, the effective temporal image sequence is input into the Transformer enhanced optical flow network to obtain the original oil slick motion vector field between adjacent frames, and the occluded area of ​​the original oil slick motion vector field between adjacent frames is repaired based on the gravity prior optical flow repair algorithm to obtain the complete oil slick motion vector field between adjacent frames.

[0008] Preferably, the gravity-based a priori optical flow repair algorithm is expressed as follows:

[0009] in, Let be the motion vector of the repaired oil trace at coordinates (x, y) at time t. Here, Interp(·) represents the temporal attention weights, and Interp(·) is the bidirectional optical flow interpolation function. Let (x, y) be the motion vector at coordinates (x, y) at time t-1. Let be the motion vector at coordinates (x, y) at time t+1. The a priori coefficients for oil diffusion physics This is a mask for the oil stain region. When the coordinates (x, y) are the oil stain region... When the coordinates (x, y) are in a non-oil-stain region , This is the direction vector of gravity diffusion.

[0010] Preferably, in step S2, constructing a temporal feature vector based on the complete oil trail motion vector field between adjacent frame images includes: extracting the oil leakage dynamic change features of the complete oil trail motion vector field between adjacent frame images through three-dimensional spatiotemporal convolution. The oil leakage dynamic change features include: oil trail diffusion acceleration, oil trail edge growth rate, oil trail coverage area change rate, and oil trail contour extension trend. The oil leakage dynamic change features are arranged in chronological order to obtain a dynamic feature sequence. The dynamic feature sequence is encoded and integrated into a temporal feature vector characterizing the oil leakage evolution process based on a temporal dynamic coding algorithm.

[0011] Preferably, the temporal dynamics coding algorithm is expressed as:

[0012] in, Here, TCATtn(·) represents the temporal feature vector, TCATtn(·) is the temporal cross-attention encoder, and 3DConv(·) is the 3D spatiotemporal convolution operation. This represents the complete oil trail motion vector field between adjacent frames. This is the characteristic normalization matrix.

[0013] Preferably, the optimized YOLO backbone network comprises, in sequence, a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer, a fifth convolutional layer, a sixth convolutional layer, a first downsampling layer, a first feature activation layer, a seventh convolutional layer, an eighth convolutional layer, a second downsampling layer, a second feature activation layer, a ninth convolutional layer, a tenth convolutional layer, a third downsampling layer, a third feature activation layer, an eleventh convolutional layer, a twelfth convolutional layer, a fourth downsampling layer, and a fourth feature activation layer; The first, second, third, fourth, fifth, sixth, eighth, tenth, and twelfth convolutional layers all use 3×3 convolutional kernels; the seventh, ninth, and eleventh convolutional layers use 1×1 convolutional kernels; and each feature activation layer uses the ReLU activation function. Preferably, in step S3, the spatiotemporal gating fusion algorithm is expressed as:

[0014] in, As a feature of spatiotemporal fusion, The Sigmoid activation function; FC For fully connected layer operations, For time series feature vectors, For channel-by-channel multiplication, For the oil trace spatial feature map, Concat(·) represents splicing in the channel dimension; Reshape(·) is the tensor reshaping operation.

[0015] Preferably, the transformer oil leakage detection results include: oil leakage location, confidence score, leakage rate level, and oil contamination type; The leakage rate level and oil stain type are determined based on the dynamic change characteristics of the oil leak, the oil leak location is obtained based on the pixel coordinate information of the oil stain spatial feature map, and the confidence score is calculated based on the spatiotemporal fusion features through a preset classification and regression network.

[0016] A transformer oil leakage detection system, wherein the method described in any one of the above claims is characterized by comprising: Effective time-series image sequence acquisition module: used to acquire and preprocess multiple consecutive frames of images of the transformer to obtain an effective time-series image sequence; Temporal feature vector construction module: used to obtain the complete oil trail motion vector field between each adjacent frame image based on the effective temporal image sequence, and to construct a temporal feature vector based on the complete oil trail motion vector field between each adjacent frame image; Spatiotemporal fusion feature construction module: used to extract the oil slick spatial feature map of the effective temporal image sequence using the optimized YOLO backbone network, and to fuse the oil slick spatial feature map and temporal feature vector based on the spatiotemporal gating fusion algorithm to obtain spatiotemporal fusion features; Oil leakage detection output module: used to calculate the transformer oil leakage detection result based on the spatiotemporal fusion features.

[0017] Compared with the prior art, the beneficial effects of the technical solution of the present invention are: This invention acquires and preprocesses multiple consecutive frames of transformer images to obtain an effective temporal image sequence, providing a temporally continuous and reliable image input for oil leak detection. By obtaining the complete oil trace motion vector field between adjacent frames and constructing a temporal feature vector, the temporal evolution law of oil leaks can be quantitatively characterized, providing data support for dynamic analysis of leakage status. An optimized YOLO backbone network is used to extract the spatial feature map of oil traces, and the temporal feature vector and the spatial feature map of oil traces are fused based on a spatiotemporal gating fusion algorithm to generate spatiotemporal fusion features, which can effectively improve the positioning accuracy and identification accuracy of oil leak detection, and reduce false detections and missed detections. Finally, based on the spatiotemporal fusion features, the transformer oil leak detection results are calculated, including: oil leak location, confidence score, leakage rate level, and oil contamination type, providing a reliable basis for accurate identification of transformer leakage faults and meeting the monitoring needs of power equipment operation and maintenance. Attached Figure Description

[0018] Figure 1 This is a flowchart of a transformer oil leakage detection method in Example 1; Figure 2This is a system flowchart of a transformer oil leakage detection system in Example 2. Detailed Implementation

[0019] The accompanying drawings are for illustrative purposes only and should not be construed as limiting the scope of this application. To better illustrate this embodiment, some parts in the accompanying drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions; It will be understood by those skilled in the art that certain well-known structures and their descriptions may be omitted in the accompanying drawings.

[0020] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.

[0021] Example 1 like Figure 1 As shown, this embodiment provides a method for detecting transformer oil leakage, which is applied in the scenario of transformer oil leakage detection; In the specific implementation process, multiple consecutive frames of images of the transformer are acquired and preprocessed to obtain an effective time-series image sequence; In this embodiment, image acquisition equipment is deployed at easily leaking parts of the transformer to continuously acquire video stream data at a fixed high frame rate. According to the detection timing requirements, the current frame image of easily leaking parts such as transformer bushings, flanges, valves, and tank joints, as well as the four consecutive frames before that moment, are acquired and combined to form five consecutive time-series images. For each time-series image, size standardization adjustment and image noise filtering are performed sequentially. Then, the image quality is checked frame by frame using three indicators: grayscale variance, edge sharpness, and pixel saturation. Inferior images that do not meet the detection requirements are eliminated, and qualified images are replaced and supplemented to obtain a valid time-series image sequence that is time-continuous, meets the image quality standards, and has uniform size, providing standardized input data for subsequent optical flow calculation.

[0022] In this embodiment, to ensure that the dynamic changes of the oil slick can be completely captured during the temporal image acquisition and processing, the preset high frame rate is fixed at 8fps. This frame rate can control the amount of data processing while ensuring temporal continuity, adapting to the real-time detection requirements on site. Size normalization adopts the bilinear interpolation method, which can preserve the edge and texture details of the oil slick when scaling the image. Each frame of the original image is uniformly scaled and adjusted to a standard resolution of 640×640 pixels, ensuring the size consistency of subsequent optical flow calculation, feature extraction, and target localization, and avoiding feature distortion caused by inconsistent image sizes. Noise filtering adopts the Gaussian filtering method, setting the convolution kernel size to 3×3 and the standard deviation to 0.5. This parameter can effectively remove Gaussian noise generated during image acquisition. The system effectively eliminates ambient noise and environmental particulate noise while preserving the edge contours and texture features of oil stains to the greatest extent possible, without compromising key detection information. Image quality verification is achieved by calculating and comparing three indicators frame by frame: grayscale variance, edge sharpness, and pixel saturation. Grayscale variance reflects the contrast between light and dark areas of the image, edge sharpness reflects the sharpness of the image contours, and pixel saturation reflects the purity of the image colors. Unqualified images with a grayscale variance below 50, a pixel saturation above 250 or below 20, or an edge sharpness below 0.3 are strictly rejected. In the effective time-series image sequence obtained after screening, each frame of the image meets the quality standards of a grayscale variance of not less than 50, an edge sharpness of not less than 0.3, and a pixel saturation between 20 and 250, ensuring the reliability of the detection data from the source.

[0023] Specifically, temporal image acquisition and processing is the foundation of the entire detection method. Through five standardized operations—fixed frame rate acquisition, temporal cropping, size normalization, Gaussian filtering for noise reduction, and multi-index quality screening—the method avoids interference from problems such as image blurring, excessive noise, temporal disorder, and uneven image quality on subsequent algorithm processing, providing stable, clear, and standardized image data for optical flow vector calculation, feature extraction, and target detection.

[0024] For example, when conducting oil leakage detection on easily leaking parts of a transformer flange, an image acquisition device is first fixedly deployed in front of the location to continuously acquire real-time video streams at a fixed frame rate of 8fps, ensuring that even the slightest dynamic diffusion changes of the oil stains are completely recorded. According to the detection sequence requirements, the image at the current detection moment, along with four consecutive frames preceding that moment, are captured, resulting in five original time-series images to ensure temporal continuity. First, bilinear interpolation is applied to each of the five original images to precisely adjust the pixel size to 640×640, completing size normalization and eliminating size differences caused by different acquisition distances and devices. Then, Gaussian filtering is performed on each normalized image frame. The operation employs a 3×3 convolution kernel with a standard deviation of 0.5 to filter out environmental dust noise and electronic acquisition noise from the image pixel by pixel, while preserving the edge contours and texture details of the oil stains. Finally, the grayscale variance, edge sharpness, and pixel saturation of the image are calculated frame by frame. One frame was found to have a grayscale variance of 45, which is below the quality threshold of 50. This frame was deemed unqualified and discarded due to insufficient contrast. Images that meet the temporal continuity and quality standards were then added to the sequence. Finally, a valid temporal image sequence of five frames was obtained, all of which meet the requirements of grayscale variance ≥ 50, edge sharpness ≥ 0.3, and pixel saturation 20~250. This provides a stable and reliable data foundation for subsequent optical flow vector calculations.

[0025] Based on the effective temporal image sequence, the complete oil trail motion vector field between each adjacent frame image is obtained, and a temporal feature vector is constructed based on the complete oil trail motion vector field between each adjacent frame image. In this embodiment, the effective temporal image sequence is input into the Transformer enhanced optical flow network. Utilizing the network's multi-scale feature extraction capability, the feature information of oil slicks of different sizes and levels is comprehensively captured. Initial pixel motion vectors are obtained through inter-frame pixel matching calculations, establishing pixel association relationships between adjacent frame images, and constructing a complete oil slick motion vector field between each adjacent frame image. To address the issues of missing or deviated motion vectors caused by occlusion and overlap during oil slick diffusion, the physical rules of oil gravity diffusion are introduced. A gravity prior optical flow repair algorithm is used to correct and complete the complete oil slick motion vector field between each adjacent frame image in the occluded area. Finally, a complete oil slick motion vector field between each adjacent frame image with spatial resolution consistent with the normalized image, covering the entire pixel area, and temporally complete is generated.

[0026] In the optical flow vector calculation and restoration process, a valid temporal image sequence is input into a Transformer-enhanced optical flow network. The network leverages the global feature capture capability of the Transformer and the local motion calculation capability of the optical flow network to automatically extract multi-scale features of the oil slick, accurately calculate pixel motion vectors between adjacent frames, and establish pixel relationships between frames. During the oil slick diffusion process, situations such as oil slick overlap and device component occlusion can easily occur, leading to missing or numerically inaccurate pixel motion vectors in occluded areas, failing to fully reflect the oil slick's motion state. Therefore, a gravity-prior optical flow restoration algorithm is used to correct and complete these abnormal motion vectors. The final generated oil trail motion vector field has a spatial resolution consistent with the resolution of the single-frame image after size normalization, completely covering the entire pixel distribution area of ​​the five frames corresponding to the effective temporal image sequence. It is arranged based on the two-dimensional plane coordinates of the image, and each coordinate position contains horizontal and vertical motion components. The component values ​​of the motion vector field of each frame are composed of the pixel matching results of adjacent frames and the correction values ​​of motion occlusion areas. The oil trail motion vector field is arranged sequentially along the time dimension to correspond to the time nodes of the five temporal images. The motion vector components corresponding to each time node are accurately recorded in continuous real number form, completely restoring the motion trajectory and diffusion state of the oil trail.

[0027] The mathematical expression for the gravity-based a priori optical flow restoration algorithm is:

[0028] in, Coordinates at time t The motion vector of the repaired oil stain. These are temporal attention weights, used to allocate the proportion of interpolation results for different temporal frames. The bidirectional optical flow interpolation function uses a linear interpolation method, and the initial value of the missing vector is calculated by averaging the vectors of the preceding and following frames. Coordinates at time t-1 The original motion vector at that location, Coordinates at time t+1 The original motion vector at that location, These are the physical prior coefficients for oil diffusion, used to balance the weights of the interpolation results and the physical priors. For the oil stain area mask, coordinates When the area is an oil stain In non-oil-stain areas Repair was performed only on the oil stain area. It represents the vertically downward direction vector of oil diffusion due to gravity, which aligns with the physical laws governing actual oil diffusion.

[0029] Specifically, optical flow vector calculation and repair is the core step in extracting dynamic features of oil traces. By using the Transformer network to improve the comprehensiveness of multi-scale feature extraction, and combining the physical prior rules of oil gravity diffusion, the problem of vector loss and bias caused by motion occlusion is specifically solved, ensuring the integrity, accuracy and physical rationality of the oil trace motion vector field, and providing accurate vector data for subsequent temporal dynamic feature extraction.

[0030] For example, when calculating optical flow vectors for a valid temporal image sequence, five frames of valid temporal images are first input into a Transformer enhanced optical flow network. The network extracts large, medium, and small-scale features of the oil slick layer by layer, calculates pixel motion vectors between adjacent frames frame by frame, and establishes complete inter-frame pixel relationships. After the calculation is completed, it is found that at a certain coordinate position at time t, the motion vector is completely missing due to the overlapping and occlusion of the oil slick itself. This coordinate is determined to belong to the oil slick region, therefore the oil slick region mask is used. For the missing vector, we first calculate the original motion vector of this coordinate at time t-1 and time t+1 using linear interpolation to obtain the initial bidirectional interpolation result, and then combine it with temporal attention weights. The proportion of the interpolation results is allocated to obtain the interpolation correction vector; then, the prior physical coefficients of oil diffusion are introduced. The vector of gravitational diffusion perpendicularly downwards By conforming to the physical law of oil spreading downwards under gravity, the gravity prior optical flow repair algorithm is used to complete the final vector correction. After correction, the problem of missing motion vector at this coordinate position is completely solved, and the vector value conforms to the actual diffusion law of oil trace. Finally, an oil trace motion vector field with a resolution of 640×640 pixels, covering the entire pixel area and with a complete five-frame temporal sequence is generated. The horizontal and vertical components of the motion vector in each frame are accurately recorded in the form of continuous real numbers, completely restoring the motion state of the oil trace.

[0031] A temporal feature vector is constructed based on the complete oil trail motion vector field between each adjacent frame image; In this embodiment, the complete oil slick motion vector field between adjacent frames is used as the processing object. A three-dimensional spatiotemporal convolution operation with specified parameters is used to extract four dynamic change features along the time dimension: oil slick diffusion acceleration, oil slick edge growth rate, oil slick coverage area change rate, and oil slick contour extension trend. The four dynamic features corresponding to the five frames are arranged in chronological order to form a fixed-length dynamic feature sequence. Then, the dynamic feature sequence is encoded, attention-weighted, and normalized using a temporal dynamic coding algorithm to compress the high-dimensional dynamic features into a low-dimensional temporal feature vector, thus completely preserving the temporal evolution information of the oil spill diffusion.

[0032] In the temporal feature encoding generation, the three-dimensional spatiotemporal convolution uses a 1×3×3 convolution kernel with a stride of 1 and padding of 1. This parameter setting allows for frame-by-frame feature extraction along the time dimension of the five-frame oil slick motion vector field without changing the feature size, while preserving the temporal correlation information of the oil slick motion. The extracted dynamic change features of the oil leak include four categories: oil slick diffusion acceleration, oil slick edge growth rate, oil slick coverage area change rate, and oil slick contour extension trend. These four types of features characterize the dynamic evolution of the oil leak from different dimensions. The oil slick diffusion acceleration is obtained by dividing the difference in oil slick motion velocity between two adjacent frames by the time interval, with the time interval being fixed. The time interval is 0.125 seconds, which matches the 8fps acquisition frame rate. The oil slick edge growth rate is obtained by the average movement speed of the oil slick edge pixels in two adjacent frames, reflecting the expansion speed of the oil slick edge. The oil slick coverage area change rate is obtained by the ratio of the difference in the number of oil slick covered pixels in two adjacent frames to the number of covered pixels in the previous frame, reflecting the expansion range of the oil slick area. The oil slick contour extension trend is obtained by statistically analyzing the movement direction of the oil slick edge pixels, reflecting the diffusion direction of the oil slick. The above four dynamic change features are arranged in chronological order to form a dynamic feature sequence of length 5. Each frame of the image corresponds to a set of four-dimensional feature data, completely preserving the dynamic change information of five frames of images.

[0033] The mathematical expression for the time-series dynamic coding algorithm is:

[0034] in, The temporal feature vector is of dimension 1×256. High-dimensional dynamic features are compressed into low-dimensional vectors to facilitate subsequent fusion processing. This is a temporal cross-attention encoder containing two attention heads and a hidden layer dimension of 256. It can automatically focus on key temporal information related to the dynamic changes in oil stains. This method enables the simultaneous extraction of temporal and spatial features through 3D spatiotemporal convolution operations with a kernel size of 1x3×3 and a stride of 1. to This represents the motion vector field of the oil stain after restoration for five consecutive frames, with a time range from t-4 to t0, covering the complete detection time sequence. It is a feature normalization matrix with dimensions of 256×256 and element values ​​ranging from 0 to 1. It is used to normalize the encoded feature vector to the interval between 0 and 1, eliminate the difference in feature dimensions, and improve the stability of subsequent fusion.

[0035] Specifically, the temporal feature encoding generation transforms the continuous oil spill motion vector field into a compact temporal feature vector. It mines the physical dynamics of oil spill diffusion through three-dimensional spatiotemporal convolution, focuses key dynamic information by relying on the temporal cross-attention encoder, and then unifies the feature scale through normalization processing to achieve a digital and standardized representation of the oil spill evolution process, providing high-quality temporal feature input for spatiotemporal feature fusion.

[0036] For example, five complete frames of oil slick motion vector fields are input into a three-dimensional spatiotemporal convolution module. Using a 1×3×3 convolution kernel, stride of 1, and padding of 1, four types of dynamic change features are extracted frame by frame along the time dimension. For each frame, the difference in oil slick motion velocity between adjacent frames is calculated, and this difference is divided by a fixed time interval of 0.125 seconds to obtain the oil slick diffusion acceleration. Then, the motion velocity of all pixels at the oil slick edge is counted, and the average value is calculated to obtain the oil slick edge growth rate. Next, the number of pixels covered by the oil slick between adjacent frames is counted, and the difference in pixel count between the later and earlier frames is divided by the number of pixels in the earlier frame to obtain the oil slick coverage area. The rate of change; finally, the motion direction of all pixels at the edge of the oil stain is counted, and the extension trend of the oil stain contour is determined by the proportion of the direction; the four-dimensional dynamic features corresponding to each frame image are arranged in the time order from t-4 to t0 to form a dynamic feature sequence of length 5; this sequence is input into a temporal cross-attention encoder containing 2 attention heads and a hidden layer dimension of 256, and key temporal features are extracted by 3D spatiotemporal convolution operation, and then the encoded feature vector is normalized to the interval of 0 to 1 by a 256×256 feature normalization matrix, finally generating a temporal feature vector of dimension 1×256, which completely and compactly represents the temporal evolution process of the oil leak.

[0037] The optimized YOLO backbone network is used to extract the oil smudge spatial feature map of the effective temporal image sequence, and the oil smudge spatial feature map and temporal feature vector are fused based on the spatiotemporal gating fusion algorithm to obtain spatiotemporal fusion features; In this embodiment, the latest frame image in the effective temporal image sequence is selected and input into the optimized YOLO backbone network. Through multi-layer convolution, downsampling, and activation operations, four spatial features—oil stain texture details, contour shape, spatial distribution location, and color difference—are extracted layer by layer and combined to generate a fixed-size oil stain spatial feature map. The temporal feature vector and the oil stain spatial feature map are then input into the spatiotemporal gating fusion module. First, the temporal features are converted into spatial feature-adaptive weight information through a fully connected layer. The spatial feature map is then dynamically weighted channel by channel. Finally, the reshaped temporal features are concatenated with the weighted spatial features along the channel dimension to generate a spatiotemporal fusion feature that integrates temporal dynamic information and spatial static information.

[0038] In the spatiotemporal feature weighted fusion, the latest single-frame image from the effective temporal image sequence is selected and input into the optimized YOLO backbone network. The optimized YOLO backbone network includes the following convolutional layers connected in series: first convolutional layer, second convolutional layer, third convolutional layer, fourth convolutional layer, fifth convolutional layer, sixth convolutional layer, first downsampling layer, first feature activation layer, seventh convolutional layer, eighth convolutional layer, second downsampling layer, second feature activation layer, ninth convolutional layer, tenth convolutional layer, third downsampling layer, third feature activation layer, eleventh convolutional layer, twelfth convolutional layer, fourth downsampling layer, and fourth feature activation layer. The first to sixth convolutional layers all use 3×3 convolutional kernels with a stride of 1 and padding of 1, used to extract shallow texture and edge detail features of the oil stains layer by layer; the seventh, ninth, and eleventh convolutional layers use 1×1 convolutional kernels to adjust the number of channels in the feature map; the eighth, tenth, and twelfth convolutional layers use 3×3 convolutional kernels with a stride of 1 and padding of 1, used to further deepen spatial feature extraction after adjusting the number of channels; Each downsampling layer is implemented using max pooling with a 2×2 kernel size and a stride of 2, which is used to gradually reduce the size of the feature map and increase the receptive field; the thirteenth feature activation layer is set at the output end of the fourth downsampling layer and is used to activate the final output spatial feature map; The backbone network extracts the texture details, contour features, spatial distribution features, and color difference features between the oil stain and the background step by step through the above-mentioned hierarchical structure, and integrates the above-mentioned multiple spatial features to finally generate an oil stain spatial feature map.

[0039] The mathematical expression for the spatiotemporal gating fusion algorithm is:

[0040] in, It is a spatiotemporal fusion feature with dimensions of 20×20×320, fusing all temporal and spatial information. The Sigmoid activation function maps the weight information to the 0-1 range, ensuring the weighting is reasonable. For a fully connected layer operation consisting of two fully connected layers, the first layer maps a 1×256 temporal feature vector to a 20×20×64 feature map to match the size of the spatial feature map. The second layer performs dimensionality fine-tuning. It is a 1×256 time series feature vector. To achieve dynamic weighting of spatial features through channel-by-channel dot product operations, A spatial feature map of oil traces measuring 20×20×64. This indicates that splicing is performed along the channel dimension to expand the amount of feature information. Reshape the 1×256 time series feature vector as follows: The tensor is matched with the weighted spatial feature size.

[0041] After the temporal feature vector is transformed by a fully connected layer, weight information with a size of 20×20×64 is obtained. The value of each element ranges from 0 to 1, and the weight corresponds to the importance of the spatial feature. The weight information and the oil trace spatial feature map are weighted one channel at a time. That is, each channel of the weight information is multiplied element-wise with the corresponding channel of the oil trace spatial feature map to highlight key spatial features and weaken redundant features. The size of the weighted oil trace spatial feature map is still 20×20×64. After the temporal feature vector is reshaped to 20×20×256, it is spliced ​​with the weighted oil trace spatial feature map in the channel dimension to fully integrate the temporal and spatial information and form a spatiotemporal fusion feature with a size of 20×20×320.

[0042] Specifically, the spatiotemporal feature weighted fusion achieves the complementary advantages of temporal dynamic features and spatial static features. The YOLO backbone network accurately extracts the spatial features of oil traces, and the spatiotemporal gating fusion algorithm dynamically allocates feature weights to avoid the limitations of single feature detection, improve the anti-interference ability and accuracy of oil leak detection, and provide comprehensive feature support for subsequent graded detection.

[0043] For example, the latest single-frame 640×640 standard image from the effective temporal image sequence is input into a customized YOLO backbone network to extract the oil slick spatial feature map. The 1×256 temporal feature vector is input into two fully connected layers. The first layer maps the vector to a 20×20×64 feature map, and the second layer fine-tunes the dimension to obtain weight information with values ​​from 0 to 1. After Sigmoid activation, the weight information is multiplied by the oil slick spatial feature map channel by channel to complete the dynamic weighting of the spatial features. At the same time, the 1×256 temporal feature vector is reshaped into a 20×20×256 tensor and concatenated with the weighted 20×20×64 spatial feature map in the channel dimension to finally generate a spatiotemporal fusion feature with a size of 20×20×320, which fully integrates the temporal dynamic information and spatial static information of the oil slick.

[0044] Based on the spatiotemporal fusion features, the transformer oil leakage detection results are calculated.

[0045] In this embodiment, four types of detection indicators are calculated simultaneously based on spatiotemporal fusion features: First, the pixel coordinates of the oil leak target in the image are located based on the pixel coordinate information of the oil trace spatial feature map to obtain the oil leak location; Second, the leakage rate is calculated and the leakage rate level is classified according to the dynamic change characteristics of the oil trace; Third, the oil pollution type is distinguished according to the dynamic change state of the oil trace; Fourth, the detection confidence score is calculated through an existing preset classification regression network based on the spatiotemporal fusion features; Finally, a standardized detection result containing the oil leak pixel coordinates, detection confidence score, leakage rate level, and oil pollution type is output, providing intuitive and accurate data support for transformer operation and maintenance.

[0046] Example 2 like Figure 2 As shown, this embodiment provides a transformer oil leakage detection system, comprising the following components connected in sequence: Effective time-series image sequence acquisition module 201: used to acquire and preprocess multiple consecutive frames of images of the transformer to obtain an effective time-series image sequence; Temporal feature vector construction module 202: used to obtain the complete oil trail motion vector field between each adjacent frame image based on the effective temporal image sequence, and construct a temporal feature vector based on the complete oil trail motion vector field between each adjacent frame image; Spatiotemporal fusion feature construction module 203: used to extract the oil trace spatial feature map of the effective temporal image sequence using the optimized YOLO backbone network, and to fuse the oil trace spatial feature map and temporal feature vector based on the spatiotemporal gating fusion algorithm to obtain spatiotemporal fusion features; Oil leakage detection output module 204: used to calculate the transformer oil leakage detection result based on the spatiotemporal fusion features.

[0047] In the specific implementation process, the effective temporal image sequence acquisition module 201 acquires continuous video images of easily leaking parts of the transformer and completes preprocessing and quality screening, outputting a compliant effective temporal image sequence. This module connects to the front-end image acquisition equipment, extracts multiple consecutive frames of temporal images at a preset high frame rate, performs size normalization and Gaussian noise filtering in sequence, and verifies the image quality frame by frame using three indicators: grayscale variance, edge sharpness, and pixel saturation. After removing unqualified images, a temporally continuous, uniformly sized, and compliant effective temporal image sequence is formed, providing standardized input for the subsequent feature extraction stage.

[0048] After receiving a valid temporal image sequence, the temporal feature vector construction module 202 first calculates the original oil slick motion vector between adjacent frames using a Transformer enhanced optical flow network. After identifying the motion occlusion area, it uses a gravity prior optical flow repair algorithm to correct and complete the vector information of the occluded area, generating a complete oil slick motion vector field between each adjacent frame image. Then, it extracts four types of dynamic change features—oil slick diffusion acceleration, edge growth rate, area change rate, and contour extension trend—from the complete oil slick motion vector field between each adjacent frame image through three-dimensional spatiotemporal convolution, forming a dynamic feature sequence. Finally, it is compressed and integrated by a temporal dynamic coding algorithm into a temporal feature vector characterizing the oil leak evolution law.

[0049] The spatiotemporal fusion feature construction module 203, based on the optimized YOLO backbone network, selects the latest single-frame image from the effective temporal image sequence and extracts four types of spatial features—oil smudge texture details, contour morphology, spatial distribution location, and color difference—through multi-layer convolution and downsampling to generate an oil smudge spatial feature map. Subsequently, the spatiotemporal gating fusion algorithm is called to first convert the temporal feature vector into spatial weight information and dynamically weight the spatial feature map channel by channel. Then, the temporal feature vector is reshaped and concatenated with the weighted spatial features in the channel dimension to output a spatiotemporal fusion feature that simultaneously contains temporal dynamic information and spatial morphological information.

[0050] After receiving the spatiotemporal fusion features, the oil leak detection output module 204 simultaneously performs three types of calculation tasks: oil leak target localization, leakage rate classification, and oil contamination type differentiation. Based on spatial feature information, it outputs the pixel coordinates of the oil leak location and the detection confidence score. Based on dynamic feature information, it determines the leakage rate level and oil contamination type. Finally, it outputs a standardized oil leak detection result containing location coordinates, confidence score, rate level, and oil contamination type to support subsequent operation and maintenance alarms and fault handling.

[0051] This system breaks through the limitations of traditional single-frame static detection by deeply integrating temporal dynamic features and spatial static features. It can accurately identify leakage faults and quantify the degree of leakage, and can meet the needs of online monitoring of transformer oil leakage in complex outdoor environments of substations.

[0052] Example 3 This embodiment provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set. The at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor, causing the processor to perform some or all of the steps of the method provided in Embodiment 1 of this application.

[0053] It is understood that the storage medium can be transient or non-transient. Exemplarily, the storage medium includes, but is not limited to, USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, and other media capable of storing program code.

[0054] By way of example, the processor may be a central processing unit (CPU), a microprocessor unit (MPU), a digital signal processor (DSP), or a field-programmable gate array (FPGA), etc.

[0055] By way of example, the read-only memory includes, but is not limited to, MASKROM, PROM, EPROM, EEPROM, Flash, etc.

[0056] By way of example, the random access memory includes, but is not limited to, DRAM, SRAM, SDRAM, DDR SDRAM, etc.

[0057] In some examples, a computer program product is provided, which can be implemented by hardware, software, or a combination thereof. As a non-limiting example, the computer program product can be embodied in the storage medium, or it can be embodied in a software product, such as an SDK (Software Development Kit).

[0058] As a non-limiting example, a computer program product is provided, comprising a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer program or computer-executable instructions from the computer-readable storage medium, and executes the computer-executable instructions, causing the electronic device to perform some or all of the steps of the method described in the embodiments of this application.

[0059] In some examples, a computer program is provided, including computer-readable code, wherein, when the computer-readable code is run in a computer device, a processor in the computer device performs some or all of the steps for implementing the method.

[0060] This embodiment also proposes an electronic device, including a memory and a processor. The memory stores at least one instruction, at least one program, code set, or instruction set. When the processor executes the at least one instruction, at least one program, code set, or instruction set, it implements some or all of the steps of the method described in Embodiment 1.

[0061] In some examples, a hardware entity of the electronic device is provided, including: a processor, a memory, and a communication interface; wherein the processor typically controls the overall operation of the electronic device; the communication interface is used to enable the electronic device to communicate with other terminals or servers via a network; the memory is configured to store instructions and applications executable by the processor, and may also cache data to be processed or already processed (including but not limited to image data, audio data, voice communication data, and video communication data) to be processed by the processor and various modules in the electronic device, and may be implemented by flash memory (FLASH), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or random access memory (RAM).

[0062] A processor may include one or more processing elements. Therefore, a processor may include one or more integrated circuits (ICs) configured to perform the functions of the processor. Furthermore, each integrated circuit may include circuitry (e.g., a first circuit, a second circuit, and other circuitry, etc.) configured to perform the functions of the processor.

[0063] Furthermore, data can be transferred between the processor, communication interface, and memory via a bus, which can include any number of interconnected buses and bridges, connecting various circuits of one or more processors and memories together.

[0064] It is understood that the options in Embodiment 1 above also apply to this embodiment, so they will not be described again here.

[0065] The same or similar labels correspond to the same or similar parts; The terms used to describe positional relationships in the accompanying drawings are for illustrative purposes only and should not be construed as limiting this application. Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.

Claims

1. A method for detecting transformer oil leakage, characterized in that, Includes the following steps: S1: Acquire multiple consecutive frames of images of the transformer and preprocess them to obtain an effective time-series image sequence; S2: Based on the effective temporal image sequence, obtain the complete oil trail motion vector field between each adjacent frame image, and construct a temporal feature vector based on the complete oil trail motion vector field between each adjacent frame image; S3: The optimized YOLO backbone network is used to extract the oil trace spatial feature map of the effective temporal image sequence, and the oil trace spatial feature map and temporal feature vector are fused based on the spatiotemporal gating fusion algorithm to obtain spatiotemporal fusion features; S4: Based on the spatiotemporal fusion features, the transformer oil leakage detection result is calculated.

2. The method for detecting transformer oil leakage according to claim 1, characterized in that, In step S1, the preprocessing includes: performing size normalization, noise filtering, and image quality screening on multiple consecutive frames of images to obtain an effective temporal image sequence.

3. The method for detecting transformer oil leakage according to claim 1, characterized in that, In step S2, the effective temporal image sequence is input into the Transformer enhanced optical flow network to obtain the original oil slick motion vector field between adjacent frames. The occluded areas of the original oil slick motion vector field between adjacent frames are repaired based on the gravity prior optical flow repair algorithm to obtain the complete oil slick motion vector field between adjacent frames.

4. The transformer oil leakage detection method according to claim 3, characterized in that, The gravity-based prior optical flow repair algorithm is expressed as follows: in, Let be the motion vector of the repaired oil trace at coordinates (x, y) at time t. Here, Interp(·) represents the temporal attention weights, and Interp(·) is the bidirectional optical flow interpolation function. Let (x, y) be the motion vector at coordinates (x, y) at time t-1. Let be the motion vector at coordinates (x, y) at time t+1. The a priori coefficients for oil diffusion physics This is a mask for the oil stain region. When the coordinates (x, y) are the oil stain region... When the coordinates (x, y) are in a non-oil-stain region , This is the direction vector of gravity diffusion.

5. The method for detecting transformer oil leakage according to claim 1, characterized in that, In step S2, constructing a temporal feature vector based on the complete oil trail motion vector field between adjacent frames includes: extracting the oil leakage dynamic change features of the complete oil trail motion vector field between adjacent frames through three-dimensional spatiotemporal convolution. The oil leakage dynamic change features include: oil trail diffusion acceleration, oil trail edge growth rate, oil trail coverage area change rate, and oil trail contour extension trend. The oil leakage dynamic change features are arranged in chronological order to obtain a dynamic feature sequence. The dynamic feature sequence is encoded and integrated into a temporal feature vector characterizing the oil leakage evolution process based on a temporal dynamic coding algorithm.

6. The method for detecting transformer oil leakage according to claim 5, characterized in that, The temporal dynamics coding algorithm is expressed as follows: in, Here, TCATtn(·) represents the temporal feature vector, TCATtn(·) is the temporal cross-attention encoder, and 3DConv(·) is the 3D spatiotemporal convolution operation. This represents the complete oil trail motion vector field between adjacent frames. This is the characteristic normalization matrix.

7. The method for detecting transformer oil leakage according to claim 1, characterized in that, The optimized YOLO backbone network comprises, in sequence, a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer, a fifth convolutional layer, a sixth convolutional layer, a first downsampling layer, a first feature activation layer, a seventh convolutional layer, an eighth convolutional layer, a second downsampling layer, a second feature activation layer, a ninth convolutional layer, a tenth convolutional layer, a third downsampling layer, a third feature activation layer, an eleventh convolutional layer, a twelfth convolutional layer, a fourth downsampling layer, and a fourth feature activation layer; The first, second, third, fourth, fifth, sixth, eighth, tenth, and twelfth convolutional layers all use 3×3 convolutional kernels; the seventh, ninth, and eleventh convolutional layers use 1×1 convolutional kernels. Each feature activation layer uses the ReLU activation function.

8. The method for detecting transformer oil leakage according to claim 1, characterized in that, In step S3, the spatiotemporal gating fusion algorithm is expressed as follows: in, As a feature of spatiotemporal fusion, The Sigmoid activation function; FC For fully connected layer operations, For time series feature vectors, For channel-by-channel multiplication, For the oil trace spatial feature map, Concat(·) represents splicing in the channel dimension; Reshape(·) is the tensor reshaping operation.

9. A method for detecting transformer oil leakage according to any one of claims 1-8, characterized in that, The transformer oil leakage detection results include: oil leakage location, confidence score, leakage rate level, and oil contamination type; The leakage rate level and oil stain type are determined based on the dynamic change characteristics of the oil leak, the oil leak location is obtained based on the pixel coordinate information of the oil stain spatial feature map, and the confidence score is calculated based on the spatiotemporal fusion features through a preset classification and regression network.

10. A transformer oil leakage detection system, using the method described in any one of claims 1-9, characterized in that, include: Effective time-series image sequence acquisition module: used to acquire and preprocess multiple consecutive frames of images of the transformer to obtain an effective time-series image sequence; Temporal feature vector construction module: used to obtain the complete oil trail motion vector field between each adjacent frame image based on the effective temporal image sequence, and to construct a temporal feature vector based on the complete oil trail motion vector field between each adjacent frame image; Spatiotemporal fusion feature construction module: used to extract the oil slick spatial feature map of the effective temporal image sequence using the optimized YOLO backbone network, and to fuse the oil slick spatial feature map and temporal feature vector based on the spatiotemporal gating fusion algorithm to obtain spatiotemporal fusion features; Oil leakage detection output module: used to calculate the transformer oil leakage detection result based on the spatiotemporal fusion features.