1. Introduction
The power system, as a critical infrastructure supporting societal operations, plays a crucial role in ensuring the safety and stability of society. Power cables are essential for power transmission and distribution, offering compact size, high reliability, and resistance to external interference. They are widely used in urban power grids, industrial enterprises, and other areas. However, over time, power cables are subjected to various influences, including electrical, thermal, and mechanical stresses, and environmental factors, which degrade their insulation performance and lead to insulation deterioration. This not only affects the smooth operation of society but also poses a significant threat to personnel safety. According to reports [
1], in 2022, the failure rate of 10kV distribution network cable lines in China was 1.43 failures per 100 km per year, which is considerably higher than the failure rates for transformers (0.15 failures per 100 units per year) and circuit breakers (0.17 failures per 100 units per year). Additionally, as most cables enter the later stages of their service life, it is likely that the failure rate of cables will increase in the future. Therefore, effective health monitoring of power cables is of great significance in improving the reliability and stability of power systems.
Insulation anomalies in operational cables frequently initiate electric field distortion and partial discharge (PD) phenomena [
2], recognized as pivotal biomarkers for incipient fault risk assessment in power transmission systems. Contemporary PD detection systems bifurcate into offline inspection and online monitoring paradigms: offline modalities necessitate operational discontinuities, constraining their practical utility, whereas online alternatives facilitate uninterrupted insulation evaluation during live cable operation. The operational superiority of online systems—characterized by intelligent signal acquisition, continuous condition tracking, and diagnostic reliability—has driven their industrial proliferation [
3]. Established online PD detection architectures principally integrate three methodologies: pulse current analysis method, ultra-high frequency (UHF) sensing technology, and ultrasonic wave detection [
4]. Among these, UHF technology exhibits unparalleled sensitivity in weak PD signal acquisition and has been widely applied in practical engineering scenarios. For instance, researchers have proposed a real-time UHF-based online PD monitoring system capable of detecting partial discharge signals within gas-insulated switchgear (GIS) [
5]. By integrating multiple sensor data streams, this system enables online condition assessment and early fault warning of GIS equipment. Additionally, a high-efficiency, portable system utilizing UHF-based dual-end PD detection and localization techniques has been developed for wind farm power cables [
6]. This system can assess insulation conditions in real-time, rapidly identify potential failures, and ensure operational stability of the wind energy infrastructure. Furthermore, UHF sensing facilitates visualization through phase-correlated discharge representations, including PRPD (phase-resolved partial discharge) spectra [
7] and PRPS (phase-resolved pulse sequence) matrices [
8]. While recent advances exploit conventional PRPD signatures for discharge taxonomy, prevailing analytical frameworks—encompassing threshold-dependent detection, Gaussian statistical modeling, and wavelet-based signal decomposition—remain hampered by manual feature engineering requirements and suboptimal cross-domain adaptability, fundamentally limiting diagnostic throughput.
With the development of deep learning techniques, especially the widespread application of convolutional neural networks (CNNs) and recurrent neural networks (RNNs) in image classification, the performance of partial discharge pattern recognition has significantly improved. Ran Y. [
9] proposed a partial discharge pattern recognition method based on PRPD and CNNs, which significantly improved recognition accuracy by improving CNN architecture and integrating multiple feature sets. Deng Y. [
10] utilized multi-scale feature extraction and spatial interaction attention mechanisms to enhance the accuracy and efficiency of partial discharge pattern recognition. The model demonstrated excellent performance in handling complex partial discharge signals from power equipment, providing a new, efficient method for fault diagnosis and condition monitoring of electrical equipment. During the classification training process using neural networks, the settings of hyperparameters directly impact the final training results. Scholars have proposed various optimization algorithms for hyperparameter tuning. Guo Xingchao [
11] suggested the use of Particle Swarm Optimization to optimize deep belief networks for identifying partial discharge characteristics in mining cables. Lei Zhipeng [
12] proposed a target detection model based on the Transformer architecture, incorporating Bayesian optimization to improve convergence speed and accuracy for partial discharge type identification. Fei Z. [
13] introduced an improved mantis optimization algorithm to optimize the biases and weights of backpropagation neural networks, verifying its effectiveness in identifying different types of partial discharge faults through simulation experiments. In studies by Srivastava R. [
14] and Vigneshwaran B. [
15], the Combined Sealion-Swarm Optimization Algorithm (CS-SOA) and Bayesian optimization algorithms were employed to optimize hyperparameters in convolutional neural networks. Zhaotao Yu [
16] proposed an effective method for pipeline robot fault diagnosis based on Particle Swarm Optimization and ResNet (PSO-ResNet). Experimental results show that the PSO-ResNet model achieves superior diagnostic accuracy and adaptability compared to conventional approaches under varying working conditions and fault levels. Wang P. [
17] developed a fault diagnosis approach for spent fuel cutting machines, integrating Bayesian optimization and a CBAM-enhanced ResNet model. The CBAM (Convolutional Block Attention Module) introduces both channel and spatial attention mechanisms to improve the extraction of fault features, while Bayesian optimization fine-tunes the network’s hyperparameters to enhance overall model performance. Additionally, some scholars have focused on partial discharge classification with small sample sizes. Jin H. [
18] proposed a method combining Wasserstein GAN (WGAN) and Gradient Penalty (GP) to enhance partial discharge pattern recognition by generating synthetic samples to address the small-sample issue. Li S. [
19] introduced a method based on a Convolutional Autoencoder-Assisted Classifier Generative Adversarial Network (CAE-ACGAN) and Residual Networks (ResNet) for partial discharge data augmentation and pattern recognition. This approach generates high-quality PRPD maps using CAE-ACGAN and performs classification using ResNet, yielding promising experimental results. Furthermore, Andreas Rauscher [
20] suggested that optimizing network architectures and training strategies could significantly improve model performance under small-sample conditions. This is echoed by Tenbohlen S. [
21] and Jung H. [
22], who explored classification of overlapping partial discharge (PD) patterns and classification of phase-resolved partial discharge (PRPD) patterns using enhanced deep learning algorithms such as VGG and ResNet under limited data scenarios.
In summary, PRPD maps are commonly used in online partial discharge monitoring systems. However, obtaining large volumes of partial discharge data in actual power equipment operation is challenging. Additionally, feature extraction in traditional convolutional neural networks (CNNs) heavily depends on hyperparameter selection in fault type recognition. Manual hyperparameter tuning hinders effective feature extraction, particularly in small-sample classification, where generalization is poor and accuracy is limited. Furthermore, the Firefly Algorithm (FA), commonly used to optimize hyperparameters, suffers from several limitations, including slow convergence in high-dimensional spaces, premature stagnation in local optima, and insufficient adaptability to complex problem landscapes, all of which hinder its performance in small sample scenarios.
To address the limitations of the traditional Firefly Algorithm, this paper proposes an improved version that integrates Black Hole Mechanisms and enhanced population dynamics. The proposed FBH algorithm enhances convergence speed, global search ability, and parameter space exploration efficiency. By incorporating dynamic adjustments in the exploration and exploitation phases, the FBH algorithm effectively avoids local optima, ensuring a more robust optimization process. Compared to other metaheuristic-based optimization strategies such as Particle Swarm Optimization (PSO), Bayesian optimization (BO), and hybrid methods like CS-SOA, the FBH algorithm offers a unique advantage in balancing exploration and exploitation, especially under small-sample constraints. The introduction of the Black Hole Mechanism strengthens the global search behavior by guiding candidate solutions toward promising regions in the solution space, thereby mitigating the risk of premature convergence. This enhancement is particularly advantageous in small sample scenarios, where the traditional FA and other metaheuristics often struggle to maintain effective exploration of the solution space. In this model, the ResNet18 model serves as the fundamental neural network for pattern recognition and classification, and the FBH algorithm is used to optimize the hyperparameters, ensuring better feature extraction and improved performance in small sample datasets. Through this integration, our method aligns with current trends in optimization-driven neural architecture tuning while innovatively introducing black hole dynamics to overcome the inherent weaknesses of conventional approaches.
Based on the above background, this paper represents the relationship between the discharge phase and amplitude using two-dimensional PRPD maps and provides a detailed introduction. Using the established experimental platform and the collected data, a new partial discharge detection model is proposed for small sample PRPD maps. In the proposed model, the ResNet18 architecture is employed for pattern recognition and classification tasks, and the FBH algorithm is utilized to optimize the hyperparameters of the residual neural network. This integration improves feature extraction from small sample datasets, enhancing the generalization ability and classification accuracy. The effectiveness of the proposed model and algorithm is tested through experimental validation with the collected data. The structure of this paper is organized as follows:
Section 2 introduces the platform and method for generating PRPD maps in the laboratory.
Section 3 elaborates on the specific steps of using the improved residual network for partial discharge fault classification. Finally, the effectiveness of the FBH-ResNet18 model is verified through case studies and experimental analysis.
3. Introduction of the Black Hole Mechanism (BHM)
To further enhance the global search capability of the Firefly Algorithm and avoid premature convergence to local optima, the Black Hole Mechanism (BHM) is introduced. The BHM simulates the gravitational effect of a black hole, where a solution is “pulled” into the black hole once its fitness exceeds a certain threshold, and its position is reset. This mechanism helps to prevent the algorithm from getting trapped in local optima.
Dynamic Threshold Adjustment Strategy:
To better control the introduction of the Black Hole Mechanism, a dynamic threshold adjustment strategy is proposed. Specifically, as the number of iterations increases, the black hole threshold gradually decreases, ensuring that only solutions with significantly poor performance are “pulled” into the black hole during later iterations. This strategy maintains exploration while preventing premature convergence. The dynamic threshold formula is as follows:
To clarify the implementation of the BHM in the improved Firefly Algorithm, the detailed pseudocode of this mechanism is provided in Algorithm 1. The pseudocode outlines how each individual in the population is evaluated against the dynamically adjusted threshold. If its fitness is worse than the threshold, the individual is considered to have fallen into the black hole and is reinitialized within the search space to encourage exploration.
Algorithm 1. Black Hole Mechanism (BHM) with Dynamic Threshold Pseudocode |
Input: Population X = {x1, x2, …, xn}, max_iter, initial fitness list F0 |
Output: Updated population X with BHM applied |
1: for iter = 1 to max_iter do |
2: Calculate threshold: |
T_bh ← max(F0) × (0.8 − 0.5 × iter/max_iter) |
3: for each individual xi in X do |
4: Evaluate current fitness fi = Fitness(xi) |
5: if fi > T_bh then |
6: //Individual pulled into black hole |
7: xi ← Random Initialization ()//Reinitialize position |
8: end if |
9: end for |
10: end for |
3.1. Algorithm Testing
To accurately and efficiently evaluate the performance of the original Firefly Algorithm and the improved FBH algorithm, two common functions, Ackley and Rosenbrock, are selected for testing. The Ackley function is a widely used optimization test function, particularly in multidimensional optimization problems. Its characteristics make it an ideal choice for evaluating the performance of optimization algorithms in complex, multimodal problems. The Rosenbrock function, on the other hand, is a typical single-objective optimization problem, featuring multiple local optima and a flat global optimum, making it suitable for testing the global optimization capability of optimization algorithms.
Rosenbrock Function:
where
is the dimension of the decision variables;
is the value of the -th decision variable;
is the base of the natural logarithm.
In this test experiment, the population size is set to 30, with iteration counts of 500 and 100, and parameters α = 0.5, , and . Additionally, to ensure fairness, both algorithms use the same initial population. The best fitness value in each generation is taken as the performance evaluation criterion, and the fitness change curve is plotted to compare the convergence speeds of the two algorithms.
Figure 4 presents the fitness evolution curves for two benchmark functions. Specifically, subfigures (a) and (b) illustrate the fitness variations of the original Firefly Algorithm and the improved FBH algorithm on the Ackley and Rosenbrock functions, respectively. It can be observed that the fitness of the FBH algorithm converges rapidly in the early stages, which is due to the introduction of the Black Hole Mechanism in the FBH algorithm’s iteration process. This mechanism increases the disturbance of particles in the search space, enabling the algorithm to find better solutions early on. Furthermore, the Black Hole Mechanism effectively prevents the algorithm from getting trapped in local optima by simulating the phenomenon of particles entering a black hole, demonstrating superior performance, especially on the Ackley function.
The results from both test functions show that the FBH algorithm, compared to the traditional Firefly Algorithm, exhibits stronger global search capabilities and faster convergence, particularly when optimizing complex functions with multiple local optima. The introduction of the Black Hole Mechanism significantly improves the overall performance of the algorithm, especially in multidimensional and high-complexity problems. The FBH algorithm is more effective at avoiding premature convergence, maintaining a good search diversity, and ultimately finding solutions closer to the global optimum.
Thus, the FBH algorithm not only achieves significant performance improvements but also exhibits stronger advantages in convergence rate and global search capability, making it particularly suitable for optimizing the hyperparameters of ResNet neural networks, which have complex structures and multiple local optima.
3.2. Partial Discharge Pattern Recognition Based on FBH-ResNet18
In the FBH-ResNet18 model, the Firefly Algorithm (FA) is innovatively combined with the Black Hole Mechanism (BHM) to optimize the hyperparameters of ResNet18. This study focuses on optimizing four key hyperparameters during the training process: learning rate, batch size, momentum, and weight decay coefficient. These parameters have a decisive impact on the training efficiency and performance of the model. However, determining their optimal combination is often challenging when using traditional methods such as grid search or random search. The Firefly Algorithm, inspired by the flashing behavior of fireflies and utilizing swarm intelligence, effectively finds the optimal hyperparameter combination through global search and local optimization. The addition of the Black Hole Mechanism further improves the algorithm’s ability to escape local optima, enhancing the global search capability. Specifically, the fitness value is determined by the loss function on the test set. This design helps in evaluating the model’s performance during the stages of training and avoids the issue of local optima, which can be caused by overfitting or underfitting.
The FBH algorithm iteratively guides the hyperparameters of ResNet18 to update in the direction that maximizes the fitness value, providing a better initialization for the model at the start of training. The Black Hole Mechanism introduces a dynamic threshold strategy, where solutions that exceed a certain fitness threshold are “pulled” into the black hole and reinitialized. This mechanism ensures that the optimization process avoids getting trapped in local optima by exploring the search space more effectively. This optimization strategy enhances the model’s convergence speed and recognition accuracy, especially in terms of its generalization ability on small sample datasets. The introduction of the Firefly Algorithm combined with the Black Hole Mechanism offers an efficient and robust solution for hyperparameter optimization. Its global search capability effectively circumvents the local optimum pitfalls of traditional methods, while the swarm intelligence mechanism enables rapid exploration of the parameter space. This novel approach, which integrates swarm intelligence and deep learning, not only improves model performance but also provides new research insights for solving similar small sample learning problems. The complete process of optimizing a residual convolutional neural network using the FBH algorithm is illustrated in
Figure 5.
The specific process and parameters for optimizing ResNet18 using the improved Firefly Algorithm (FBH) are as follows:
① Set the range of hyperparameters to be optimized and algorithm parameters:
Learning rate: (1 × 10−5, 1 × 10−2)
Batch size: (4, 32)
Momentum coefficient: (0.5, 0.999)
Weight decay coefficient: (1 × 10−5,1 × 10−3)
The update of the black hole threshold is referenced by Equation (6).
The number of the firefly population is set to 30, with a maximum number of iterations of 70, the update step size α = 0.5, and both the maximum attraction and light absorption coefficient γ are set to 1.0.
② Population Initialization: Randomly generate the hyperparameter combinations to initialize the positions of the fireflies, and input these into the ResNet18 neural network for training. Return the validation loss for each hyperparameter combination as the fitness value.
③ Evaluate the Black Hole Mechanism:
After evaluating the fitness of each firefly, check if the firefly’s fitness is worse than the predefined black hole threshold.
If a firefly’s fitness is worse than the predefined black hole threshold, replace it with a new random hyperparameter combination that is likely to improve performance.
Recalculate the fitness value under the newly randomly generated hyperparameters.
④ Update the Optimal Solution: Record the current optimal hyperparameter combination. If the fitness of the current firefly is better than the historical optimal, update the optimal solution.
⑤ Update Firefly Positions: Update the positions (i.e., hyperparameter combinations) based on the attraction between fireflies.
Attraction Calculation: Calculate the attraction by computing the distance and using Equation (3).
Position Update: If the fitness of firefly is worse than firefly , firefly will move toward firefly . The position is updated using Equation (5), ensuring that the updated hyperparameter values remain within the predefined range.
⑥ Iterative Optimization: In each iteration, repeat the following steps:
Evaluate the new firefly positions (i.e., hyperparameter combinations).
Update the fitness values, repeat step ③, and record the optimal solution.
Output the optimal loss of the current iteration.
⑦ Check for Maximum Iteration: If the maximum iteration count is reached, stop the optimization process and output the final optimal hyperparameter combination and corresponding loss.
5. Conclusions
This study develops a Firefly Algorithm-optimized ResNet18 model for partial discharge pattern recognition, yielding four core findings:
(1) The optimized model demonstrates accelerated convergence with reduced initial loss values compared to baseline approaches, showing faster loss function reduction during early training phases.
(2) Achieving 92.55% classification accuracy, the model surpasses conventional models in both training efficiency and generalization ability, effectively addressing overfitting issues in small-sample scenarios.
(3) In specific discharge type analysis, accuracy improvements of 6% for needle discharge and 5.14% for surface discharge were observed, while maintaining consistent high performance across all defect categories.
(4) ResNet18_6 consistently demonstrated superior performance compared to Bayesian optimization (ResNet18_7) and Particle Swarm Optimization (PSO, ResNet18_8). It achieved significantly lower final training loss (0.420235) and test loss (0.250785), as well as a substantially higher final precision of 0.9255, outperforming ResNet18_7 (0.8485) and ResNet18_8 (0.8731).
These advancements establish a reliable solution for early insulation fault detection in power systems, particularly valuable for smart grid maintenance scenarios requiring robust pattern recognition with limited training data.
Nonetheless, the study has certain limitations. The FBH algorithm, although effective, imposes a higher computational cost, which could constrain its deployment in low-resource environments. Moreover, the current work focuses on a single-task optimization scenario using a specific dataset and model architecture. Broader evaluations across diverse data distributions or alternative deep learning models are required to further validate generalizability.
Future work will explore the applicability of the FBH algorithm in multi-objective optimization scenarios and other complex real-world tasks, such as fault localization, energy consumption forecasting, or condition-based maintenance. The hybrid nature of the FBH algorithm makes it a promising candidate for balancing competing objectives such as accuracy, time efficiency, and model complexity in broader industrial and engineering contexts.