Oil leakage in oil-immersed power transformers poses a significant threat to grid reliability, potentially causing severe electrical accidents and environmental pollution if not detected in time. Detecting oil leakage outdoors, however, remains challenging due to the impact of weather conditions such as fog, humidity, and rain, which obscure the leakage signs and complicate real-time detection. To address these challenges, we propose a solution that integrates infrared thermal imaging with a CNN-SVM hybrid architecture. The core of this approach lies in shifting from traditional Softmax-cross-entropy-based empirical risk minimization (ERM) to maximum-margin-based structural risk minimization (SRM). A fully fine-tuned MobileNetV3 transforms low-contrast, boundary-softened infrared thermal images—often affected by fog and moisture—into a more discriminative high-dimensional feature space, where positive and negative samples become linearly separable. This is followed by replacing Softmax with a linear SVM and using hinge loss to enforce a margin constraint, which maximizes the classification margin and improves robustness to input perturbations. Experimental results show that our proposed method outperforms all compared models, achieving an accuracy of 0.990, significantly higher than ResNet50_BCE (0.908), EfficientNetB0 (0.925), YOLOv11n-CLS (0.930), and ViT (0.929). In terms of F1-Score (0.989) and AUC (0.995), MobileNetV3-SVM also demonstrates excellent performance, ensuring outstanding classification capability. Additionally, the model achieves an inference latency of only 6.3 ms, demonstrating excellent real-time inference performance, highlighting its potential for transformer oil monitoring applications. This research contributes to SDG 6 by preventing industrial water pollution resulting from transformer oil runoff, thereby protecting vital water sources in remote environments.
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.