Abstract
Detecting transformer oil leakage from infrared thermal images is challenging due to complex thermal backgrounds, low contrast, and sensor noise. To address these issues, this study proposes IR-OilNet, a lightweight CNN–Transformer fusion network designed for real-time infrared leakage detection in inspection robots. This research contributes to SDG 6 by preventing industrial water pollution resulting from transformer oil runoff, thereby protecting vital water sources in remote environments. The proposed framework integrates three key components: (1) a parameter-free Thermal Noise Suppression (TNS) module that reduces high-frequency thermal noise while preserving structural information; (2) a compact CNN backbone for local thermal texture extraction; and (3) a lightweight Transformer branch for global contextual modeling. To further enhance feature integration, a Dynamic Weight Fusion (DWF) module is introduced to adaptively balance local and global representations. Experiments on an expanded dataset of 2700 infrared thermal images demonstrate that IR-OilNet achieves an accuracy of 0.9992, F1-score of 0.9992, and AUC of 0.9993, while maintaining only 0.20 M parameters and 0.19 GFLOPs with real-time inference at 433 FPS. Compared with representative CNN and Transformer models, the proposed method achieves a superior trade-off between accuracy and computational efficiency, making it suitable for deployment in resource-constrained inspection systems.
1. Introduction
Power transformers are critical components in electrical substations, oil leakage defects account for 20% to 33.1% of all transformer faults, ranking among the most frequent defects of transformers in substations. Leakage caused by seal failure of flanges, valves and bushings collectively contributes to over 66% of all oil leakage points on transformers, making these two categories the primary sources of oil leakage [1]. Transformer oil leakage is predominantly induced by deteriorated sealing components, structural defects of metal tanks and auxiliary fittings, abnormal operating pressure and temperature arising from overload or internal electrical faults, improper installation/maintenance operations, and progressive deterioration of insulating oil that exacerbates material corrosion and seal failure [2,3]. Furthermore, Transformer oil leakage can lead to multiple severe consequences, including degradation of insulation and heat dissipation performance, increased risk of equipment failure and power outages, and potential fire hazards [4,5]. In addition, oil leakage may result in environmental contamination and generate significant economic costs associated with oil replenishment, maintenance, and environmental remediation, while also posing safety risks to field operators [6].
Therefore, reliable and efficient detection of transformer oil leakage is of critical importance for ensuring safe substation operation, particularly in inspection robot-based monitoring systems [7,8,9]. From an environmental perspective, leaked insulating oil can contaminate surrounding soil and water resources [10], potentially leading to industrial water pollution; thus, early detection and prevention are essential for protecting vital water sources, especially in remote environments in alignment with SDG 6.
In recent years, with the rapid development of smart grids and unmanned substations, inspection robots have become an important technological platform for the operation and maintenance of intelligent substations [11,12,13]. Relevant studies indicate that such systems integrate mobile robotic platforms with multi-source sensing technologies, enabling round-the-clock autonomous inspection in complex electromagnetic environments. By leveraging multi-modal sensing methods such as visible-light imaging and infrared thermal imaging, they can effectively perform condition monitoring and anomaly detection of power equipment [14,15]. Meanwhile, continuous advances in key technologies, including navigation and path planning [16,17,18], environmental perception [19], and multi-source information fusion and intelligent decision-making [20], have significantly enhanced the autonomy and environmental adaptability of inspection robots, driving their development toward higher levels of intelligence and system integration. Against this background, transformer oil leakage detection based on infrared images has gradually become an important research topic. However, in practical scenarios with complex background interference, varying imaging conditions, and thermal noise, accurate identification of leakage regions still remains a significant challenge [21,22,23,24,25,26].
Early studies on transformer oil leakage detection primarily relied on handcrafted features and rule-based methods, such as color descriptors, change detection techniques, histogram analysis, and temperature-difference thresholds, to identify abnormal leakage regions in infrared images [21,27,28,29]. These approaches typically depend on manually designed visual contrasts between leakage areas and background regions, which limits their robustness under complex thermal environments.
Similar contrast-driven detection strategies have also been widely studied in the broader field of oil spill analysis in remote sensing applications. For example, Al-Ruzouq et al. [30] provided a comprehensive review of oil spill detection using multiple remote sensing modalities, where classical machine learning methods such as support vector machines (SVM) and k-nearest neighbor (KNN) classifiers were commonly used in classical machine learning methods. However, these methods rely heavily on handcrafted feature representations and therefore exhibit limited generalization capability in complex and noisy imaging conditions [31].
More recent advances have shifted toward deep learning-based approaches, including convolutional neural networks (CNNs), YOLO-based detectors, U-Net segmentation models, and Transformer-based architectures, which enable automatic feature learning from raw image data and significantly improve detection and segmentation performance [32,33].
Despite these advances, infrared thermography sensors used in transformer inspection still suffer from inherent challenges, including thermal noise, environmental interference, and sensor-specific artifacts. These factors significantly degrade image quality and make accurate leakage detection difficult for conventional image-based methods, highlighting the need for more robust feature extraction and denoising mechanisms.
To address these limitations, we propose IR-OilNet, a lightweight CNN–Transformer fusion network with Thermal Noise Suppression (TNS) and Dynamic Weight Fusion (DWF) modules. Both IR-Oil Net and CNN extract features from infrared thermal images and perform excellently on unobstructed exposed components such as outer tank walls, flange sealing surfaces, welding seams, exposed radiator connectors and outer bushing flanges. Oil evaporation from leakage reduces surface temperature and generates distinct cold thermal spots with prominent infrared signatures, enabling deep learning networks to accurately capture oil stain textures and abnormal thermal features at a low missing detection rate. The network combines local feature extraction with global contextual modeling, achieves high accuracy with minimal computational cost, and is suitable for deployment on resource-constrained inspection robots. Our contributions are:
- (1)
- A lightweight CNN–Transformer fusion framework for infrared oil leakage detection.
- (2)
- A parameter-free TNS module for robust input-level noise suppression.
- (3)
- A Dynamic Weight Fusion (DWF) module for adaptive integration of local and global features.
- (4)
- Extensive experiments and ablation studies demonstrating state-of-the-art accuracy, efficiency, and robustness.
2. Methodology
2.1. Overall Framework
The proposed IR-OilNet consists of three main components: a Thermal Noise Suppression (TNS) module, a CNN-based local feature extractor, and a Transformer-based global feature modeling branch, followed by a Dynamic Weight Fusion (DWF) module for adaptive integration. The overall architecture of the proposed IR-OilNet is illustrated in Figure 1.
Figure 1.
The overall architecture of the proposed IR-OilNet.
Given a single-channel infrared input image, the TNS module is first applied to reduce high-frequency thermal noise. This module uses reflective padding and a local median filtering operation to estimate the background thermal distribution. A residual correction mechanism is then used to suppress noise while preserving structural edges, producing a denoised input for subsequent feature extraction.
The denoised image is then processed by a convolutional backbone composed of a stem convolution layer and two dense convolutional blocks. The CNN branch focuses on extracting local thermal textures, edge structures, and small-scale anomalies, which are critical for identifying oil leakage regions.
To capture global dependencies, the CNN feature map is divided into non-overlapping patches and projected into a high-dimensional embedding space via a single PatchEmbed operation. The resulting token sequence is processed by multiple Transformer encoder layers to model long-range spatial relationships. The output tokens are reshaped back into a 2D feature map to form global semantic representations.
Finally, the CNN and Transformer features are fused using the Dynamic Weight Fusion module. Specifically, global average pooling is applied to both feature maps to generate channel-wise descriptors. These descriptors are concatenated and passed through a lightweight fully connected network followed by a Softmax function to generate normalized fusion weights. The final feature representation is computed as a weighted combination of CNN and Transformer features, enabling adaptive balancing between local detail and global context.
This design ensures robust feature representation under complex thermal conditions while maintaining computational efficiency for real-time deployment.
2.2. Thermal Noise Suppression Module (TNS)
The Thermal Noise Suppression (TNS) module is designed to reduce high-frequency noise and local thermal fluctuations in infrared images while preserving structural edges relevant to oil leakage detection. The detailed workflow of this Module, as illustrated in Figure 2, proceeds as follows:
Figure 2.
Thermal Noise Suppression Module.
The input is first symmetrically padded using reflective padding:
where is the input infrared image, is the batch size, and is the number of channels. Here, since the input infrared images are single-channel, and and are the spatial dimensions.
This ensures that pixels near the image edges are treated consistently with interior pixels in subsequent operations. The padded image is then unfolded into overlapping windows, generating local patches suitable for neighborhood processing:
Within each patch, a median filter is applied to compute a robust estimate of the local background:
The residual thermal noise is obtained by subtracting this median estimate from the original input:
Finally, the denoised output is generated by applying a weighted residual correction, attenuating the noise while preserving the underlying thermal patterns:
Equivalently, the entire TNS operation can be expressed compactly as:
Through this sequence of operations—reflective padding, local median filtering, residual computation, and weighted correction—the TNS module produces a clean and stable infrared input that is well-suited for subsequent CNN and Transformer feature extraction, enhancing the overall performance of the IR-OilNet framework.
2.3. Dynamic Weight Fusion Module (DWF)
The Dynamic Weight Fusion (DWF) Module, as illustrated in Figure 3, is a key innovation in IR-OilNet that adaptively integrates local features from the CNN branch and global features from the Transformer branch. Let the high-level CNN feature map be and the Transformer feature map be . To align spatial dimensions, is upsampled via bilinear interpolation and passed through a convolution to match the channel number of CNN features:
Figure 3.
Dynamic Weight Fusion Module.
Next, global average pooling (GAP) is applied to both feature maps to obtain channel-wise descriptors:
These descriptors are concatenated and fed into a lightweight fully connected network with ReLU activation and Softmax normalization to generate adaptive fusion weights and :
The final fused feature map is computed as a weighted combination of the two branches:
By dynamically assigning weights based on the input feature distributions, the DWF module allows the network to adaptively balance local texture information and global contextual dependencies, mitigating potential feature interference between branches. This mechanism is particularly effective in small-sample scenarios and contributes significantly to the overall robustness and discriminative power of IR-OilNet.
2.4. Advantages and Limitations of the Proposed Algorithm
As a lightweight CNN–Transformer fusion network, IR-OilNet is well designed for real-time transformer oil leakage detection with infrared thermal images. The TNS module effectively suppresses thermal noise inherent to infrared devices without additional parameters or computational overhead. The collaborative work of the CNN backbone and Transformer branch realizes complementary extraction of local and global features, and the DWF module solves the problem of feature conflict between branches. The overall network maintains an excellent balance among detection accuracy, model size and inference efficiency, and shows strong generalization and anti-interference performance under diverse working environments.
Despite the above advantages, the algorithm has obvious shortcomings in practical application. Long-term oil leakage will lead to corrosion of the transformer steel tank and deterioration of grounding performance, whereas the current model cannot identify tank corrosion. In addition, it lacks the function of quantifying the number of leaked oil droplets. We plan to carry out a series of follow-up experiments and conduct in-depth algorithm optimization to make up for these deficiencies in our future work.
To ensure reproducibility and provide a clear description of the training configuration, all optimization and data-related hyperparameters are summarized in Table 1. The table includes key components such as the optimizer settings, learning rate strategy, regularization terms, batch size, and cross-validation protocol, which collectively define the training procedure of IR-OilNet.
Table 1.
Training Hyperparameter Settings.
Specifically, stochastic gradient descent (SGD) is adopted as the optimizer with a momentum of 0.9 to stabilize convergence. A learning rate of 0.001 is used and optimized empirically for convergence efficiency. Weight decay is set to 1 × 10−4 to reduce overfitting. All input images are normalized using dataset-level statistics to ensure consistent feature scaling. The model is trained with a batch size of 32, and performance evaluation is conducted using 5-fold cross-validation to ensure unbiased assessment under limited data conditions.
The complete training configuration is presented in Table 1.
3. Experiment
3.1. Dataset Description
The infrared thermal image dataset used in this study is constructed based on a laboratory-scale transformer oil leakage simulation platform. The dataset is expanded from 1200 images in our previous work [32] to 2700 images in this study to improve data diversity and environmental coverage.
The dataset includes four transformer components (bushings, top covers, radiators, and oil valves) under three operating temperature conditions (30 °C, 50 °C, and 70 °C) and three environmental conditions (dry, humid, and foggy), ensuring variation in thermal background distributions.
Each image is annotated into two categories: normal and oil leakage. Oil leakage samples are identified based on the presence of localized low-temperature thermal anomalies caused by oil evaporation, while normal samples exhibit spatially smooth thermal distributions without abnormal cold spots.
To ensure annotation reliability, a double-review labeling strategy is adopted, where each sample is independently annotated by two experienced inspectors, and inconsistent labels are resolved through consensus discussion.
It should be noted that the partitioned or segmented acquisition refers only to data collection under different experimental conditions and independent acquisition sessions, and does not impose any constraint on the subsequent random five-fold cross-validation splitting strategy.
3.2. Experimental Setup Five-Fold Cross-Validation
The proposed IR-OilNet is implemented using the PyTorch (2.11.0+cu128) framework. All experiments are conducted on a workstation equipped with an NVIDIA RTX GPU and an AMD Ryzen processor (Table 2).
All input infrared images are resized to 224 × 224 and normalized before being fed into the network. The model output is a two-class prediction corresponding to normal and oil leakage states.
The network is trained using stochastic gradient descent (SGD) with a momentum of 0.9 and a weight decay of 1 × 10−4. The initial learning rate is set to 0.001 and decayed using a cosine annealing schedule. The batch size is set to 32.
To prevent overfitting, early stopping is applied with a patience of 10 epochs based on validation loss.
Table 2.
Training Hardware configuration.
3.3. Evaluation Metrics
To comprehensively evaluate model performance, we adopt Accuracy, Precision, Recall, F1-score, and AUC as evaluation metrics, as defined in Sokolova and Lapalme [33].
Based on the confusion matrix, true positive (TP), true negative (TN), false positive (FP), and false negative (FN) were used to define the evaluation metrics as follows:
Accuracy reflects the overall classification correctness, while precision and recall measure the reliability and completeness of oil leakage recognition, respectively. The F1-score provides a balanced evaluation between precision and recall, which is important for fault diagnosis scenarios where both false alarms and missed detections should be minimized. In addition, AUC was used to assess the threshold-independent discriminative ability of the model, with a higher AUC indicating better separation between normal and oil leakage samples.
To further evaluate the practical applicability of the proposed model, computational complexity and inference efficiency were also analyzed. Specifically, the number of parameters, GFLOPs, and frames per second (FPS) were used to measure model size, computational cost, and inference speed, respectively. These metrics provide a comprehensive assessment of whether IR-OilNet is suitable for efficient deployment in infrared transformer monitoring applications.
3.4. Training Convergence Analysis
The convergence behavior of IR-OilNet was analyzed under the five-fold cross-validation protocol to evaluate the stability and generalization capability of the model. In each fold, the dataset was divided into training and validation subsets, and the training and validation accuracy and loss show stable convergence behavior throughout the training process.
As observed in Fold 1, the training loss drops rapidly within the first 20 epochs, followed by steady convergence, and validation accuracy closely matches training accuracy, indicating stable learning. Fold 2 has slight fluctuations in validation loss at the early stage due to the unique sample distribution of this subset, while both accuracy curves converge consistently after 30 epochs. Fold 3 and Fold 4 show similar trends: training loss decreases steadily and accuracy rises gradually with minor oscillations during training. Fold 5 presents the smoothest curves with a tiny gap between training and validation results, benefiting from balanced data partitioning.
Across all folds, the gap between training and validation curves remains narrow, indicating negligible overfitting and good generalization ability. Minor fluctuations in several folds are normal artifacts of five-fold cross-validation and do not interfere with final convergence. From Fold 1 to Fold 5, all groups complete stable convergence, which demonstrates that IR-OilNet can effectively learn discriminative features from infrared images. The overall training process is well-regulated, and the convergence status is acceptable for subsequent experiments.
Overall, the convergence analysis confirms that IR-OilNet achieves stable and effective training under different data partitions, providing a solid foundation for subsequent comparative experiments and performance evaluation. The five-fold cross-validation results also reinforce the robustness of the model and the reliability of the reported metrics.
Figure 4: Training and validation accuracy and loss curves of IR-OilNet under the five-fold cross-validation protocol, illustrating convergence stability across different folds.
Figure 4.
Training and Validation Accuracy and Loss over 5-fold Cross-validation.
3.5. Comparison with State-of-the-Art Models
To evaluate the recognition performance of IR-OilNet, we compared it with a range of representative CNN- and Transformer-based models, including ResNet, VGG, MobileNet, ShuffleNetV2, EfficientNet, ConvNeXt-Tiny, ViT, and Swin Transformer variants. The full quantitative results are presented in Table 3, while the classification performance in terms of accuracy, F1-score, and AUC is further illustrated in Figure 5.
Table 3.
Training parameter configuration.
Figure 5.
Visualization of classification performance in terms of AUC, F1-score, and accuracy for different models.
As shown in Table 4 and Figure 5, most CNN-based models achieve near-saturated performance on this dataset, with competitive accuracy, F1-score, and AUC values. This indicates that infrared oil leakage images contain distinct local thermal patterns that can be effectively captured by convolutional architectures. However, many of these CNN models require substantially larger parameter sizes or higher computational costs. For example, VGG models have over 128 million parameters, and ResNet models are considerably larger than IR-OilNet. Although these models deliver high classification accuracy, their computational burden may limit their application in edge-based monitoring systems.
Table 4.
Quantitative comparison of model performance and efficiency.
In contrast, some Transformer-based models show less consistent performance. Specifically, Swin-B and Swin-S exhibit much lower accuracy, F1-score, and AUC compared with most CNN-based models and IR-OilNet. This discrepancy may be attributed to the fact that infrared oil leakage recognition heavily relies on local thermal gradients, boundary structures, and regional temperature variations, which are more effectively learned by convolutional networks. Transformer models, especially larger ones, typically require substantial training data to develop robust visual representations. In scenarios with limited infrared fault data, pure Transformer models may not be able to fully exploit their potential for recognizing oil leakage patterns.
Compared with these representative models, IR-OilNet achieves a more favorable balance between recognition accuracy and computational efficiency. Since the differences among the models in the left panel of Figure 5 are visually subtle, a zoomed-in local view is provided on the right to facilitate a clearer comparison. Specifically, IR-OilNet achieves an accuracy of 0.9992, an F1-score of 0.9992, and an AUC of 0.9993. Although several heavyweight CNN models, such as ResNet101, ResNet152, and EfficientNet-V2-S, obtain marginally higher or comparable metric values, they require substantially more parameters and computational cost. In contrast, IR-OilNet achieves near-saturated recognition performance with only 0.20 M parameters and 0.19 GFLOPs, while reaching the highest inference speed of 433.54 FPS. These results demonstrate that IR-OilNet is more suitable for efficient infrared oil leakage detection, particularly in real-time and edge-based monitoring scenarios.
The superior efficiency and robust performance of IR-OilNet can be attributed to its task-specific architecture. The Thermal Noise Suppression module reduces high-frequency thermal interference in infrared images, thereby enhancing the reliability of discriminative thermal patterns. The CNN branch extracts local texture and structural cues associated with oil leakage regions, while the Transformer branch models global contextual dependencies across the thermal scene. Furthermore, the Dynamic Weight Fusion module adaptively integrates complementary local and global representations, allowing the network to emphasize the most informative features for different samples. Benefiting from this collaborative design, IR-OilNet forms a compact yet highly discriminative feature representation, enabling accurate and real-time classification of normal and oil leakage states.
All comparison models are trained under identical settings for fairness, including the SGD optimizer (momentum 0.9), initial learning rate of 0.001, cosine annealing schedule, identical data augmentation pipeline, and early stopping with patience of 10.
To visually analyze the feature focusing ability and decision interpretability of IR-OilNet, this study employs the classification performance visualization method to generate heatmaps for the model’s inference process, as is shown in Figure 6. In conjunction with the network structure, IR-OilNet utilizes the Thermal Noise Suppression (TNS) module to filter out redundant noise in infrared images, while also leveraging the CNN’s local detail representation and the Transformer’s multi-head self-attention global modeling capabilities. The Dynamic Weight Fusion (DWF) module adaptively balances the contributions of both branches.
Figure 6.
Heatmap visualization of IR-OilNet for oil leakage and normal infrared thermal images.
As shown in the figure, when presented with oil leakage defect samples, the model’s attention heatmap accurately focuses on the key regions of the oil leakage hot spot, effectively capturing the inherent infrared features of the leakage defect. In contrast, for normal non-leakage samples, the network produces almost no response in the background areas and only shows weak and uniform attention to the equipment itself. These results strongly demonstrate that IR-OilNet does not rely on shortcut features such as background textures for classification decisions. It can independently distinguish between oil leakage defects and normal equipment regions, showcasing its strong feature learning robustness in complex infrared conditions.
3.6. Model Complexity and Inference Efficiency Analysis
For practical infrared transformer monitoring, a model should not only achieve high recognition accuracy but also meet the requirements of low computational cost and real-time inference. Therefore, the number of parameters, GFLOPs, and FPS were used to evaluate the deployment efficiency of different models.
As shown in Table 3 and Figure 7, several CNN-based models, such as VGG and deep ResNet variants, achieve strong classification performance but require significantly larger parameter sizes. Transformer-based models also introduce non-negligible computational overhead due to self-attention operations and high-dimensional embeddings. These characteristics can limit their application in edge monitoring systems, where storage capacity and computing resources are constrained.
Figure 7.
Visualization of parameters, GFLOPs, and FPS for different models. Note: FPS represents inference speed, where higher values indicate faster processing. GFLOPs denotes computational complexity, where lower values indicate lower computational cost. Param (M) indicates the number of model parameters, where lower values correspond to a more lightweight model.
In contrast, IR-OilNet achieves a much more compact architecture, with only 0.20 M parameters and 0.19 GFLOPs, while maintaining an inference speed of 433.54 FPS. Compared to larger CNN and Transformer models, the proposed network significantly reduces model size and computational cost while still delivering excellent classification performance. The results show that IR-OilNet achieves a favorable trade-off between accuracy and efficiency.
The high efficiency of IR-OilNet is mainly attributed to its lightweight dense convolutional backbone, shallow Transformer branch, and efficient Dynamic Weight Fusion module. Rather than increasing network depth or simply stacking large-scale modules, IR-OilNet uses task-specific thermal noise suppression and adaptive feature fusion to enhance feature representation with minimal computational overhead. Therefore, the proposed model provides a practical solution for real-time infrared oil leakage recognition in transformer monitoring applications.
To evaluate the deployment potential of the proposed IR-OilNet, model complexity and inference efficiency were analyzed using the number of parameters, GFLOPs, and FPS. These indicators reflect the storage requirements, computational cost, and real-time inference capabilities of the model, respectively. The results are summarized in Table 3 and visualized in Figure 7.
As shown in Figure 7, large CNN models, such as VGG and deep ResNet variants, generally require a large number of parameters, increasing storage and deployment costs. Transformer-based models also introduce additional computational burdens due to self-attention operations and high-dimensional feature embeddings. While some of these models achieve high classification accuracy, their complexity may limit their practical use in edge-based infrared monitoring systems.
In contrast, IR-OilNet achieves a compact model structure with only 0.20 M parameters and 0.19 GFLOPs, while reaching an inference speed of 433.54 FPS. This indicates that the proposed model has low computational complexity and high real-time processing capability. The lightweight design is attributed to the compact CNN backbone, shallow Transformer branch, and efficient dynamic feature fusion strategy.
Different from existing heavyweight CNN and pure Transformer models that pursue feature extraction capability at the cost of massive computation, this work proposes a series of targeted novel designs for edge monitoring scenarios. First, the parameter-free TNS module realizes infrared noise suppression without introducing extra parameters and computational overhead, which avoids the performance degradation caused by noise while keeping the network lightweight. Second, we adopt a compact dense convolutional backbone and a shallow Transformer branch, instead of stacking deep network layers or large-scale attention modules. This structure extracts effective local and global features with extremely low parameter volume and GFLOPs. Third, the proposed DWF module achieves adaptive feature fusion via a tiny fully connected network, which eliminates redundant feature calculation and branch conflicts. The above integrated innovations enable IR-OilNet to greatly reduce computational burden. It runs efficiently on resource-limited edge devices such as substation inspection robots, and satisfies the requirements of real-time on-site monitoring.
Therefore, IR-OilNet provides a favorable trade-off between recognition performance and computational efficiency. These results suggest that the proposed model is not only effective for infrared oil leakage recognition but also highly suitable for real-time deployment in transformer monitoring applications.
3.7. Ablation Study
An ablation study was conducted to evaluate the effectiveness of the main components of IR-OilNet, including the Thermal Noise Suppression module, the Transformer branch, and the Dynamic Fusion module. As shown in Table 5, all three core modules (TNS, Transformer branch, and DF) consistently improve model performance. For single-module settings, TNS (M1) increases accuracy from 0.9497 to 0.9606 by suppressing thermal noise, demonstrating its effectiveness in enhancing infrared feature quality. The Transformer branch (M2) further boosts accuracy to 0.9737, significantly strengthening global feature representation while introducing higher computational cost. The DF module (M3) also improves performance to 0.9628 under a CNN-only setting, verifying its general capability in enhancing multi-level feature interaction. For dual-module combinations, TNS + Transformer (M4) and TNS + DF (M5) achieve 0.9869 and 0.9781 accuracy, respectively, indicating that noise suppression effectively amplifies both global feature learning and feature fusion. Notably, Transformer + DF (M6) further improves performance to 0.9978, showing that DF effectively mitigates feature conflicts and enhances collaboration between global and local representations. Finally, the full model (MFULL) reaches the best performance with 0.9992 accuracy, confirming that TNS improves input quality, the Transformer enhances semantic modeling, and DF ensures efficient feature integration, leading to a highly complementary and optimal framework.
Table 5.
Ablation results.
The selected ablation combinations are intended to reflect the most important and representative interactions among the proposed modules, rather than covering all possible combinations. In particular, combinations such as TNS + DF and TNS + TR were not explicitly included, mainly because the current experimental settings have already provided a sufficiently comprehensive demonstration of the incremental contributions of each component and their mutual complementary effects throughout the progressive integration process. Therefore, the ablation design focuses on the most representative key cases, aiming to maintain analytical completeness while minimizing unnecessary redundant experiments.
From the previous quantitative analysis, we observed that the integration of the TNS, Transformer branch, and Dynamic Fusion modules significantly improves model performance in terms of both accuracy and inference speed. While the numerical results clearly show improvements in metrics like accuracy, F1 score, and FPS, these figures only reflect part of the story. To gain a deeper understanding of the mechanisms driving these improvements, we now turn to the qualitative analysis, as is shown in Figure 8.
Figure 8.
Visualization of ablation study.
The figure illustrates the trade-off between computational complexity, model size, and inference efficiency across different network configurations. The baseline CNN achieves the highest inference speed (1226.8 FPS) with the lowest computational complexity (0.14 GFLOPs) and the smallest parameter size (0.03 M), demonstrating strong efficiency but limited representational capacity. After introducing the TNS module (M1), the inference speed slightly decreases to 1029.15 FPS, while GFLOPs and parameters remain nearly unchanged (0.14 GFLOPs, 0.03 M), indicating that TNS improves feature quality with negligible computational overhead.
With the integration of the Transformer branch (M2), inference speed drops significantly to 559.11 FPS, accompanied by an increase in model complexity (0.16 GFLOPs, 0.16 M parameters), confirming that global self-attention is the primary contributor to computational cost. When the Dynamic Fusion (DF) module is introduced without Transformer interaction (M3), the model achieves 847.83 FPS with 0.15 GFLOPs, showing moderate efficiency reduction while maintaining low complexity, which suggests that DF introduces limited computational burden while enhancing feature interaction.
For hybrid configurations (M4–M6), inference speed varies between 497.45 and 712.49 FPS, while GFLOPs gradually increase to 0.19, and parameters rise to 0.20 M. Notably, M4 achieves higher accuracy with moderate speed reduction, whereas M5 and M6 show stable computational growth with marginal performance variation, indicating that DF contributes minimal additional cost while operating within Transformer-enhanced representations. Overall, the results demonstrate a clear trade-off: Transformer dominates computational overhead, while TNS and DF introduce only minor increases while improving representation capability and fusion effectiveness.
Figure 9 illustrates the weight distribution of the DWF module for water and oil samples. It can be observed that the Transformer branch generally receives higher fusion weights in both categories, indicating that global contextual features serve as the primary information source in infrared representation learning.
Figure 9.
Branch-weight distribution of the DWF module for normal and oil leakage samples.
In comparison, the CNN branch contributes a relatively smaller proportion, while showing a clear increase in oil samples compared with water samples, reflecting an enhanced role of local texture information in oil leakage scenarios. The increased CNN weight for oil samples demonstrates that the proposed DWF module can adaptively adjust the contribution of local features according to sample characteristics, while maintaining a Transformer-dominant global representation tendency.
After verifying the adaptive feature-fusion capability of the DWF module, we further analyzed the contribution of the TNS module from the perspective of input-level infrared image enhancement. Unlike DWF, which operates at the feature-fusion stage, TNS directly processes the raw infrared input and aims to suppress thermal noise before feature extraction. Therefore, a visual comparison of the original image, the TNS-processed image, and the residual map was conducted to demonstrate its effect.
In this ablation study, the effect of the Thermal Noise Suppression (TNS) module was visually analyzed using representative infrared samples. As shown in Figure 10, the processed image preserves the main thermal structure of the transformer bushing while slightly smoothing high-frequency fluctuations in the background. Compared with the original infrared image, the TNS-processed image exhibits reduced local noise variations without obvious distortion of the equipment contour, indicating that the module can enhance input stability for subsequent feature extraction.
Figure 10.
Visualization of the Thermal Noise Suppression (TNS) module on infrared image preprocessing.
The residual map further illustrates the spatial distribution of the changes introduced by TNS. Warmer colors indicate regions with larger differences before and after processing, while cooler colors indicate regions that are less affected. The residual response is mainly concentrated in the background and local high-gradient areas, whereas the main bushing region shows relatively small changes. This suggests that the TNS module suppresses redundant thermal fluctuations while preserving the principal equipment structure, which may improve the robustness of IR-OilNet under complex infrared imaging conditions.
4. Model Validation
4.1. Robustness Testing
To comprehensively validate the robustness and generalization ability of IR-OilNet, we conducted experiments across five distinct oil leakage locations, including insulators, tank covers, tank sides, cooling fins, and oil drain valves. As shown in Table 6, IR-OilNet maintains consistently high recognition accuracy across different leakage locations and environmental interference scenarios. This set of tests shows that the model is not solely effective on the insulator but is capable of generalizing to different components, effectively addressing concerns about overfitting to fixed textures.
Table 6.
Performance metrics of IR-OilNet across different leakage locations and environmental conditions.
Additionally, we incorporated real-world industrial variables such as day/night conditions, fog, rain interference, and oil–water mixtures to simulate the challenges that the model might face in actual deployment scenarios. Notably, the rain interference and oil–water mixture tests further validated that the model maintains reliable performance even when target features are diluted by environmental disturbances. This demonstrates that the model is not just effective on clean experimental data but also robust in more complex, real-world conditions, thereby countering concerns about the model’s failure to generalize outside controlled environments.
Among the 12 test scenarios, 10 achieved 100% accuracy, with the worst-performing scenario yielding an accuracy of 99.21%. The largest deviation from the baseline five-fold cross-validation was only ±0.72%. These results indicate that the model’s exceptional performance is not a result of overfitting but rather a stable and reproducible capability under diverse operational conditions. This further solidifies the credibility of the model, showcasing its robustness and generalization across a variety of conditions.
Robustness and high efficiency are essential for the practical deployment of edge monitoring systems. Our network adopts a multi-layer protection mechanism to enhance anti-interference ability: the TNS module suppresses thermal noise at the input, the hybrid CNN–Transformer structure enriches feature representation, and the DWF module realizes adaptive feature fusion for variable scenes. All these designs jointly ensure the system works steadily under complex on-site interferences. This further solidifies the credibility of the model, showcasing its robustness and generalization across a variety of conditions.
The above tests cover typical leakage positions and common environmental interferences. Nevertheless, practical substation operation faces more unexpected challenges. For example, strong sunlight reflection, surface dust, condensation, thermal crosstalk from adjacent equipment, long-distance blurry images and extreme ambient temperatures will also affect infrared detection. Although the current model achieves outstanding performance under tested conditions, these complex and unforeseen factors may interfere with feature extraction. In follow-up research, we will collect data under the above extreme and complex conditions to further optimize the model and enhance its adaptability to fully practical scenarios.
4.2. Performance Evaluation: Confusion Matrix, ROC Curve, and PR Curve
To validate the classification performance of IR-OilNet, we first present the confusion matrix in Figure 11, which provides an in-depth view of the model’s predictions against the ground truth. This matrix reveals the distribution of true positives, false positives, true negatives, and false negatives, allowing for an intuitive understanding of the model’s error patterns.
Figure 11.
Confusion matrix of IR-OilNet for normal and oil leakage classification.
Following the confusion matrix, Figure 12 shows the Precision–Recall curve for IR-OilNet. This curve is especially informative in the context of oil leakage detection, as it highlights how well the model performs when distinguishing the rare class (oil leakage) from the majority class (normal conditions). The curve indicates that the model achieves a favorable balance between precision and recall, which is crucial for fault detection tasks in imbalanced datasets.
Figure 12.
P–R curve of IR-OilNet under 5-fold cross-validation.
Finally, Figure 13 presents the ROC curve, which offers an overall summary of the model’s discriminatory power across various thresholds. The area under the ROC curve (AUC) is particularly high, demonstrating the model’s robust ability to differentiate between oil leakage and normal conditions in a variety of operational environments.
Figure 13.
ROC curve of IR-OilNet under 5-fold cross-validation.
5. Discussion
As reflected by the experimental results, most mainstream CNN models and the proposed IR-OilNet achieve extremely high classification performance on the constructed dataset. This phenomenon is mainly attributed to the obvious temperature gradient difference between normal transformer surfaces and oil leakage areas in laboratory environments. The oil evaporation effect forms stable cold spot features on infrared images, making two categories visually separable to a certain extent.
In this study, all infrared samples are acquired in a partitioned collection mode under controlled laboratory settings. Although we have set multiple variables including component types, oil temperatures and environmental interference to enrich sample diversity, the data distribution is still limited by fixed shooting ranges and relatively stable ambient conditions. This is the main limitation of the current dataset and experiment.
To further validate the practical performance of IR-OilNet, our future work will abandon block-based fixed acquisition and adopt random on-site data collection in actual substation scenarios. We will collect infrared images with irregular angles, uncertain illumination, severe background clutter and time-varying thermal noise, so as to comprehensively test the recognition accuracy, robustness and anti-interference capability of the algorithm in real industrial environments.
6. Conclusions
In this work, we introduced IR-OilNet, a real-time, lightweight CNN–Transformer fusion network for infrared transformer oil leakage detection. The network integrates: a parameter-free Thermal Noise Suppression (TNS) module for input-level noise reduction, a compact dense CNN backbone for local feature extraction, a shallow Transformer branch for global context modeling, and a Dynamic Weight Fusion (DWF) module for adaptive feature integration. This design enables IR-OilNet to robustly capture discriminative features while maintaining minimal computational overhead.
Extensive experiments on an expanded dataset of 2700 infrared thermal images show that IR-OilNet achieves an accuracy of 0.9992, F1-score of 0.9992, and AUC of 0.9993, outperforming many existing CNN and Transformer models in accuracy, efficiency, and model compactness. Ablation studies confirm that the TNS, Transformer, and DWF modules synergistically enhance performance, resolving feature conflicts and improving robustness.
The proposed IR-OilNet achieves high accuracy and low computational cost, making it a practical solution for real-time oil leakage monitoring on resource-limited inspection robots. This directly advances SDG 6 by minimizing the risk of water pollution from undetected transformer oil leaks in remote settings. Future work will focus on validating the model on field-collected data, extending its adaptability to diverse operational conditions, and expanding the framework to include leakage localization, severity assessment, and multi-sensor fusion.
It is worth noting that all experimental data are collected from real transformers under regular operating conditions with good visibility. The proposed model achieves reliable detection performance in such scenarios. Nevertheless, its recognition capability may be affected under extremely harsh field environments with severe interference. In follow-up work, we will systematically explore the impact of diverse complex and extreme environmental factors on the model, and further optimize the algorithm to adapt to full-scale on-site substation deployment.
Nevertheless, this work still has obvious limitations. All data are acquired in controlled laboratory environments, and the model has not been verified under extreme conditions and sudden interferences like strong light, surface dust and extreme temperatures. In follow-up work, we will supplement field data from real substations, continuously optimize the network for harsh environments, and explore leakage localization, severity evaluation and multi-sensor fusion functions, so as to improve the practicability and generalization of the proposed method.
Author Contributions
Conceptualization, W.T., T.H.G.T. and F.L.S.; Methodology, W.T.; Software, W.T. and X.L.; Validation, W.T. and X.L.; Formal analysis, W.T., T.H.G.T., F.S. and F.L.S.; Investigation, W.T., J.Y.; Data curation, W.T., Y.J., T.Z. and X.L.; Writing—original draft preparation, W.T. and T.H.G.T.; Writing—review and editing, W.T., T.H.G.T., F.L.S. and Y.J.; Visualization, W.T.; Supervision, T.H.G.T. and F.L.S.; Project administration, T.H.G.T. Funding acquisition, Y.J. All authors have read and agreed to the published version of the manuscript.
Funding
This research was supported by Yunnan Key Laboratory of Intelligent Logistics Equipment and Systems (Grant No. 202449CE340008) and Yunnan Shen Weiming Academician Workstation (Grant No. 202505AF350084).
Data Availability Statement
The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author(s).
Conflicts of Interest
The authors declare no conflicts of interest.
References
- Thiviyanathan, V.A.; Ker, P.J.; Leong, Y.S.; Abdullah, F.; Ismail, A.; Jamaludin, M.Z. Power transformer insulation system: A review on the reactions, fault detection, challenges and future prospects. Alex. Eng. J. 2022, 61, 7697–7713. [Google Scholar] [CrossRef] [Scilit]
- Sorte, S.; Monteiro, A.F.; Ventura, D.; Salgado, A.; Oliveira, M.S.; Martins, N. Power Transformers Cooling Design: A Comprehensive Review. Energies 2025, 18, 1051. [Google Scholar] [CrossRef] [Scilit]
- Tlhabologo, B.A.; Samikannu, R.; Mosalaosi, M. Alternative liquid dielectrics in power transformer insulation: A review. Indones. J. Electr. Eng. Comput. Sci. 2021, 23, 1761–1777. [Google Scholar] [CrossRef] [Scilit]
- Khan, S.A.; Tariq, M.; Khan, A.A.; Alamri, B.; Mihet-Popa, L. Assessment of thermophysical performance of ester-based nanofluids for enhanced insulation cooling in transformers. Electronics 2022, 11, 376. [Google Scholar] [CrossRef] [Scilit]
- Rafiq, M.; Shafique, M.; Ateeq, M.; Zink, M.; Targitay, D. Natural esters as sustainable alternating dielectric liquids for transformer insulation system: Analyzing the state of the art. Clean Technol. Environ. Policy 2024, 26, 623–659. [Google Scholar]
- Brahami, Y.; Oparanti, S.O.; Fofana, I.; Fethi, M. Thermal and Electrical Fault Diagnosis in Oil–Paper Insulation System: A Comparative Study of Natural Esters and Mineral Oil. Appl. Sci. 2025, 15, 7676. [Google Scholar] [CrossRef] [Scilit]
- Yang, Q.; Ma, S.; Guo, D.; Wang, P.; Lin, M.; Hu, Y. A small object detection method for oil leakage defects in substations based on improved faster-RCNN. Sensors 2023, 23, 7390. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Li, B.; Wang, T.; Hu, Z.; Yuan, C.; Zhai, Y. Two-level model for detecting substation defects from infrared images. Sensors 2022, 22, 6861. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Obebe, E.O.; Hadjadj, Y.; Oparanti, S.O.; Fofana, I. Enhancing the Performance of Natural Ester Insulating Liquids in Power Transformers: A Comprehensive Review on Antioxidant Additives for Improved Oxidation Stability. Energies 2025, 18, 1690. [Google Scholar] [CrossRef] [Scilit]
- Yu, Q.; Zhang, Q.; Sun, G.; Qin, R. Distribution station inspection robot with Modulear manipulator. HardwareX 2025, 22, e00652. [Google Scholar] [PubMed]
- Lu, S.; Zhang, Y.; Su, J. Mobile robot for power substation inspection: A survey. IEEE/CAA J. Autom. Sin. 2017, 4, 830–847. [Google Scholar] [CrossRef] [Scilit]
- Silva, B.P.; Ferreira, R.A.; Gomes, S.C., Jr.; Calado, F.A.; Andrade, R.M.; Porto, M.P. On-rail solution for autonomous inspections in electrical substations. Infrared Phys. Technol. 2018, 90, 53–58. [Google Scholar] [CrossRef] [Scilit]
- Li, Y.; Xu, Y.; Xu, M.; Wang, S.; Xie, Z.; Li, Z.; Jiang, X. Automatic infrared image recognition method for substation equipment based on a deep self-attention network and multi-factor similarity calculation. Glob. Energy Interconnect. 2022, 5, 397–408. [Google Scholar]
- Wang, P.; Li, C.; Cai, F.; Zheng, L. An improved SLAM algorithm for substation inspection robot based on the fusion of IMU and visual information. Energy Inform. 2024, 7, 6. [Google Scholar] [CrossRef] [Scilit]
- Liu, Z.Y.; Wang, J.; Hui, Z.Y.; Zhao, B.; Zhang, F.L. Research on positioning and mapping algorithm of sliding window optimization for substation monitoring robot. Energy Rep. 2023, 9, 898–908. [Google Scholar] [CrossRef] [Scilit]
- Wang, C.; Yin, L.; Zhao, Q.; Wang, W.; Li, C.; Luo, B. An intelligent robot for indoor substation inspection. Ind. Robot 2020, 47, 705–712. [Google Scholar] [CrossRef] [Scilit]
- Yang, Q.; Qin, Q.; Yang, J.; Huang, Y.; Zhang, X.; Zhang, Z. Differences in human perception of urban environments across multiple scales: A literature review. Front. Archit. Res. 2026, in press. [Google Scholar] [CrossRef] [Scilit]
- Qian, H.; Wang, M.; Zhu, M.; Wang, H. A review of multi-sensor fusion in autonomous driving. Sensors 2025, 25, 6033. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Gong, Y.; Bao, C.; He, Z.; Jian, Y.; Wang, X.; Huang, H.; Song, X. A review on gas pipeline leak detection: Acoustic-based, OGI-based, and multimodal fusion methods. Information 2025, 16, 731. [Google Scholar]
- Meradi, S.; Laribi, S.; Bouslimani, S.; Dermouche, R. Analysis of failure in low-voltage terminal connections and fault classification in power transformer using infrared thermography. J. Fail. Anal. Prev. 2024, 24, 547–558. [Google Scholar] [CrossRef] [Scilit]
- Li, X.; Liu, X.; Xiao, Y.; Zhang, Y.; Yang, X.; Zhang, W. An improved U-net segmentation model that integrates a dual attention mechanism and a residual network for transformer oil leakage detection. Energies 2022, 15, 4238. [Google Scholar] [CrossRef] [Scilit]
- Wang, C.; Luo, Z.; Qi, Z. Transformer oil leakage detection with sampling-WIoU Module. J. Supercomput. 2024, 80, 7349–7368. [Google Scholar]
- Abbasi, A.R. Fault detection and diagnosis in power transformers: A comprehensive review and classification of publications and methods. Electr. Power Syst. Res. 2022, 209, 107990. [Google Scholar] [CrossRef] [Scilit]
- Fingas, M.; Brown, C.E. A Review of Oil Spill Remote Sensing. Sensors 2017, 18, 91. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Liu, S.; Chi, M.; Zou, Y.; Samat, A.; Benediktsson, J.A.; Plaza, A. Oil spill detection via multitemporal optical remote sensing images: A change detection perspective. IEEE Geosci. Remote Sens. Lett. 2017, 14, 324–328. [Google Scholar] [CrossRef] [Scilit]
- Bao, W.; Gu, L.; He, J.; Kuai, Y.; Liu, W.; Huang, W. Transformer oil leakage detection based on loop training method. J. Comput.-Aided Des. Comput. Graph. 2021, 33, 431–438. [Google Scholar] [CrossRef] [Scilit]
- Balabantaraya, R.; Sahoo, A.K.; Sahoo, P.K.; Abir, C.M.; Panda, M.K. A novel infrared thermography image analysis for transformer condition monitoring. e-Prime Adv. Electr. Eng. Electron. Energy 2024, 10, 100758. [Google Scholar] [CrossRef] [Scilit]
- Al-Ruzouq, R.; Gibril, M.B.; Shanableh, A.; Kais, A.; Hamed, O.; Al-Mansoori, S.; Khalil, M.A. Sensors, features, and machine learning for oil spill detection and monitoring: A review. Remote Sens. 2020, 12, 3338. [Google Scholar] [CrossRef] [Scilit]
- Renuka, S.; Luckose, V. Efficient Neuron Segmentation and Morphological Analysis Using Svm-Knn Classifier. J. Eng. Technol. Adv. 2021, 6, 1–12. [Google Scholar] [CrossRef] [Scilit]
- Luo, Z.; Wang, C.; Qi, Z.; Luo, C. LA_YOLOv8s: A lightweight-attention YOLOv8s for oil leakage detection in power transformers. Alex. Eng. J. 2024, 92, 82–91. [Google Scholar]
- Zhao, W.; Hu, J.; Liu, L. SE-FormerSeg: Transformer Oil Leakage Detection Model Based on Spatially Enhanced Transformer Segmentation. In International Conference on Intelligent Computing; Springer Nature: Singapore, 2025; pp. 182–194. [Google Scholar]
- Tan, W.; Thio, T.H.G.; Siaw, F.L.; Jia, Y.; Li, X.; Yang, J.; Li, H. A Hybrid CNN-SVM for Oil Leakage Detection in Transformer Monitoring. Processes 2026, 14, 970. [Google Scholar] [CrossRef] [Scilit]
- Sokolova, M.; Lapalme, G. A systematic analysis of performance measures for classification tasks. Inf. Process. Manag. 2009, 45, 427–437. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.












