Electric power system lightning disaster risk detection method and device oriented to unbalanced data
By using gridded processing and SMOTE technology optimized by K-means clustering of unbalanced data, combined with gradient boosting tree and Bayesian optimization methods, the problem of lightning disaster risk assessment of unbalanced data in power systems is solved, achieving higher regional adaptability and accuracy, and is suitable for power system risk identification in complex environments.
Patent Information
- Application Number
- CN202511923227.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-01-16
AI Technical Summary
Existing technologies struggle to effectively handle lightning disaster risk assessment using unbalanced data in power systems, resulting in poor model generalization capabilities, an inability to adapt to the stability requirements of different regions and power grid structures, and difficulty in comprehensively utilizing multi-source data for high-precision risk modeling.
A gridded processing method combined with imbalanced data K-means clustering optimization of the SMOTE method is adopted to generate new minority class samples. The model is trained by gradient boosting tree algorithm and Bayesian optimization method, taking into account the characteristics of the line and environment to improve the adaptability and accuracy of the model.
It improves the regional adaptability and accuracy of lightning disaster risk assessment, reduces the risk of overfitting, enhances the stability and generalization ability of the model under extreme unbalanced data conditions, and is suitable for power system risk identification in complex environments.
Smart Images

Figure CN121352525A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of lightning protection and risk assessment of power systems, and in particular to a power system lightning disaster risk detection method and device for unbalanced data. BACKGROUND
[0002] As the core infrastructure of energy transmission and power supply, the safety and stability of the power system are directly related to the operation of the national economy and social production and life. Due to the wide distribution of equipment in various links such as power transmission, transformation and distribution, and the complex operating environment, the power system is exposed to the changing natural environment for a long time and is easily affected by extreme weather conditions. Among them, lightning, as a sudden and destructive natural disaster, often causes serious induced overvoltage in power transmission lines, substations and distribution facilities, causing equipment insulation damage, tripping and shutdown, and even large-scale power outage accidents, posing a major threat to the safe operation of the power system.
[0003] At present, the lightning protection and risk assessment of the power system mainly rely on traditional electrical parameter calculation and empirical design. For example, Chinese patent CN112418629A discloses a lightning disaster risk assessment method suitable for main grid transmission lines, which includes: dividing the main grid transmission line into grids; extracting the cumulative frequency, lightning point coordinates and lightning current intensity in the multi-year lightning location system; counting the number of lightning strikes in each grid and calculating the multi-year average; counting the lightning current intensity in each grid and calculating the multi-year average; calculating the straight-line distance from the lightning point coordinates in the grid to the line and the average value of the lightning overvoltage peak coupled on the line at the position of each lightning point coordinates; using principal component analysis method to establish a lightning disaster risk assessment model for each grid. However, this method relies on the statistics in the grid (such as lightning density, lightning current average, overvoltage average), PCA is essentially a linear transformation, which cannot capture the nonlinear relationship between features, and this method can only analyze lightning parameters and does not have the ability to process high-dimensional, multi-source and heterogeneous data, resulting in poor model generalization ability. And lack of ability to deal with data imbalance. Model performance is greatly affected by subjective factors, and it does not have self-adaptability and is difficult to maintain stable performance in different regions or different grid structures. The method proposed by the present application not only considers lightning parameters, but also can process multi-dimensional, multi-source parameters by combining actual lightning events, lightning analysis objects and lightning environment factors, and has good adaptability and stability.
[0004] Due to the influence of various factors such as geography, meteorology and terrain on the spatial distribution, intensity variation and occurrence frequency of lightning activities, it is difficult for traditional methods to comprehensively depict the spatial and temporal differences of lightning risk. On the one hand, the types of equipment, operating conditions and surrounding environment of each link of the power system are significantly different, resulting in a large difference in lightning risk level in different regions; on the other hand, the number of lightning event samples is small and the data distribution is extremely unbalanced, so that the traditional risk assessment model has serious shortcomings in the identification ability of the minority class. In addition, the traditional method is often difficult to comprehensively utilize multi-source data (such as meteorological monitoring, geographic information, equipment operating parameters, etc.) for high-precision risk modeling, resulting in insufficient accuracy and generalization ability of the prediction results.
[0005] With the continuous expansion of the scale and the increasing complexity of the structure of the power system, the existing lightning risk assessment method has obvious limitations in dealing with variable weather environment, large-scale multi-dimensional feature data and real-time risk prediction demand. Therefore, a new lightning disaster risk assessment method is needed, which can operate under the condition of small sample and strong unbalanced data, and fuse multi-source feature analysis and integrated optimization algorithm, to realize accurate risk identification and scientific protection decision of different regions and different types of equipment of the power system. SUMMARY
[0006] The purpose of the present application is to provide a lightning disaster risk detection method and device for unbalanced data of a power system to solve the defects of the prior art.
[0007] The purpose of the present application can be realized by the following technical solutions: A lightning disaster risk detection method for unbalanced data of a power system, comprising: Step S1: griding the target detection plot to obtain a plurality of grid units: Step S2: based on the longitude and latitude coordinates of each grid unit, combining the line database and the geographic information database to obtain the line parameters and environmental characteristics of each grid unit, wherein the line parameters include tower height, span, grounding resistance, loop number, lightning arrester number and transformer capacity, and the environmental characteristics include soil conductivity, building height and land use type; Step S3: inputting the line parameters and environmental characteristics of each grid unit into the trained first detection model to obtain the lightning probability and maximum peak current of each grid unit.
[0008] The step S1 comprises: Step S1-1: extracting the tower coordinates of the target plot, and calculating the distance in the longitude and latitude direction of each tower; Step S1-2: calculating the greatest common divisor based on the distance in the longitude and latitude direction of the left and right towers. Step S1-3: determining whether the greatest common divisor is greater than the diameter of the tower, if yes, taking the greatest common divisor as the side length of the grid, otherwise, taking the default grid side length as the grid side length; Step S1-4: griding the target detection plot according to the determined grid side length to obtain a plurality of grid units.
[0009] The process of acquiring the line parameters in step S2 includes: Step S2-A-1: assigning all towers to each grid unit, wherein a single tower is only assigned to one grid unit; Step S2-A-2: determining whether there is a tower in the grid unit one by one, if yes, executing step S2-A-3, otherwise, executing step S2-A-4; Step S2-A-3: acquiring the tower height, span, grounding resistance, loop number, arrester number and transformer capacity; Step S2-A-4: assigning the tower height, span, grounding resistance, loop number, arrester number and transformer capacity to 0.
[0010] The step S2-A-3 includes: determining whether the number of towers in the grid unit is 1, if yes, selecting the tower as the representative tower, otherwise, selecting the highest tower in the grid unit as the representative tower; reading the height of the representative tower as the tower height; reading the distance between the representative tower and its subordinate tower as the span; reading the grounding resistance, loop number, arrester number and transformer capacity corresponding to the representative tower.
[0011] In step S2-A-1, if a single tower is located in two or more grid units, the tower is assigned to the grid unit with the largest overlapping area.
[0012] The process of acquiring the environmental characteristics in step S2 includes: Step S2-B-1: querying all first measuring points and first announcement points within the range of the grid unit based on the latitude and longitude coordinates of the grid unit in the geographic information database, wherein the first measuring point is a soil conductivity measuring point and the first announcement point is a land use type announcement point; Step S2-B-2: selecting the value with the largest frequency of occurrence as the soil conductivity of the grid unit based on the soil conductivities of all first measuring points; Step S2-B-3: selecting the value with the largest frequency of occurrence as the land use type of the grid unit based on the land use types of all first announcement points.
[0013] The first detection model is trained based on a first sample set, and samples in the first sample set include: Latitude and longitude coordinates of each grid unit; Line parameters and environmental characteristics of each grid unit; Time and peak current of lightning disaster of each grid unit, wherein if no lightning disaster occurs in the grid unit, the time and peak current of lightning disaster are marked as 0.
[0014] The first sample set is obtained by optimizing SMOTE through unbalanced data K-means clustering on an original sample set, and includes: All samples in the original sample set in which the time and peak current of lightning disaster are not 0 are taken as minority class samples, and the remaining samples are taken as majority class samples; K-means clustering is performed based on all minority class samples to obtain a plurality of sub-clusters, and all majority class samples are distributed into the sub-clusters; In each sub-cluster, for each minority class sample, one or more nearest majority class samples in the same sub-cluster are selected as opponent samples corresponding to the minority class sample, and new minority class samples are generated between the minority class sample and the opponent samples.
[0015] The first detection model is trained by using a gradient boosting tree algorithm combined with a Bayesian optimization method.
[0016] A power system lightning disaster risk detection device for unbalanced data includes a memory, a processor, and a program stored in the memory, and the processor implements the method as described above when executing the program.
[0017] Compared with the prior art, the present application has the following beneficial effects: 1. The line parameters such as tower height, span, and grounding resistance, and the environmental characteristics such as soil conductivity, building height, and land use type are comprehensively considered to obtain the lightning stroke probability and peak current in each grid unit, so that the risk assessment result has higher regional adaptability and accuracy.
[0018] 2. In the gridding process, the greatest common divisor of the longitudinal and transverse distances of all towers is taken as the size of the grid unit, so that it can be ensured that there is only one tower in a single grid as much as possible, thereby improving the representativeness and utilization rate of multi-source data of a single grid unit and improving the accuracy under limited samples.
[0019] 3. For grid cells with towers, the line parameters are obtained according to the actual data. For grid cells without towers, the value is directly assigned to 0. This achieves data alignment on the one hand and reduces interference from invalid data on the other hand, thereby more effectively obtaining the characteristics of the style with lightning disaster risk and improving the detection accuracy.
[0020] 4. If there are multiple towers in a grid cell, the data of the highest tower is used to construct the line parameters, thus selecting more representative data as the line parameters, which effectively improves the accuracy. Furthermore, using the distance between lower towers as the span ensures that the distance between every two towers is utilized, improving the utilization rate of limited data.
[0021] 5. Based on the latitude and longitude coordinates of the grid cells, all first measuring points and first announced points within the grid cell range are queried in the geographic information database. Parameters such as soil electrical conductivity and land use type are determined according to the mode principle. On the one hand, this allows for more refined grid cell division and increases the amount of information. On the other hand, the mode provides a more intuitive and reliable representative value for categorical variables such as land use type, avoiding information distortion caused by "averaging" different types together. It has significant advantages in maintaining spatial heterogeneity and local characteristics, which is helpful in subsequent spatial analysis. Using the mode rather than the mean better reflects the most representative environmental characteristics within the grid cell, avoiding interference from extreme values or abnormal measuring points on the mean. This is especially suitable for features such as soil electrical conductivity that may exhibit skewed distributions or have outliers, thereby improving the stability and interpretability of feature values.
[0022] 6. Because lightning disasters involve a small sample size in the overall data volume, the training sample set is obtained by optimizing the SMOTE method using K-means clustering for imbalanced data. This avoids generating noisy samples that fall into the majority class region and reduces the risk of inter-class overlap. The generation ratio is adjusted according to the cluster density to improve the discrimination ability of boundary and sparse regions. The clustering process can classify outliers into low-weight clusters, thereby reducing the noise amplification effect. The local distribution structure of the minority class is maintained, which improves the generalization performance of the model on imbalanced lightning data.
[0023] 7、The first detection model adopts gradient boosting tree algorithm combined with Bayesian optimization method to complete training. The combination can not only efficiently process multi-dimensional, multi-source and heterogeneous data, identify key variables in complex feature space and evaluate the importance of the key variables, but also provide higher interpretability on feature selection and model structure, effectively reduce the risk of overfitting, realize adaptive adjustment of model structure, and overcome the limitations of traditional mathematical models, such as dependence on single data source, strong assumption conditions and difficulty in describing multi-dimensional nonlinear relationship. The method can integrate multi-source information and mine potential feature interaction, overcome information loss and prediction deviation caused by excessive simplification of traditional models, and thus exhibit stronger applicability and stability in complex environment. The combination fully utilizes the advantages of gradient boosting tree in high-dimensional nonlinear feature modeling, automatically searches for the optimal hyperparameter combination through Bayesian optimization, significantly improves the convergence speed and generalization ability of the model, avoids the subjectivity and inefficiency of manual parameter adjustment, and enables the model to maintain high precision and high robustness under extreme unbalanced data conditions. BRIEF DESCRIPTION OF DRAWINGS
[0024] Figure 1 A schematic diagram of the main step flow of the method of the present application is shown in the figure. Figure 2 A schematic diagram of generating a minority class sample is shown in the figure. Figure 3 A schematic diagram of the technical route of the present application is shown in the figure. DETAILED DESCRIPTION
[0025] The present application will be described in detail below in conjunction with the drawings and specific embodiments. The present embodiment is implemented on the premise of the technical solution of the present application, and detailed implementation and specific operation processes are given, but the protection scope of the present application is not limited to the following embodiments.
[0026] Embodiment 1 A power system lightning disaster risk detection method for unbalanced data, as shown in Figure 1 and Figure 2 , includes: Step S1: griding the target detection plot to obtain a plurality of grid units, including: Step S1-1: extracting the tower coordinates of the target plot, and calculating the distance in the latitude and longitude direction of each tower; Step S1-2: calculating the greatest common divisor based on the distance in the latitude and longitude direction of the left and right towers; Step S1-3: determining whether the greatest common divisor is greater than the diameter of the tower, if yes, taking the greatest common divisor as the side length of the grid, otherwise, taking the default grid side length as the grid side length; Step S1-4: griding the target detection plot according to the determined grid side length to obtain a plurality of grid units.
[0027] Step S2: Based on the latitude and longitude coordinates of each grid cell, and combined with the line database and geographic information database, obtain the line parameters and environmental characteristics of each grid cell. The line parameters include tower height, span, grounding resistance, number of circuits, number of surge arresters and transformer capacity. The environmental characteristics include soil conductivity, building height and land use type. The process of obtaining line parameters includes: Step S2-A-1: Assign all towers to each grid cell, wherein each tower is assigned to only one grid cell; Step S2-A-2: Determine whether there are towers in each grid cell. If yes, proceed to step S2-A-3; otherwise, proceed to step S2-A-4. Step S2-A-3: Obtain tower height, span, grounding resistance, number of circuits, number of surge arresters, and transformer capacity; Step S2-A-4: Set the tower height, span, grounding resistance, number of circuits, number of surge arresters, and transformer capacity to 0.
[0028] Step S2-A-3 includes: Determine if the number of poles in a grid cell is 1. If it is, select this pole as the representative pole; otherwise, select the tallest pole in the grid cell as the representative pole. Read the height of the representative pole as the tower height; Read the distance between the representative tower and its subordinate towers as the span; Read the grounding resistance, number of circuits, number of surge arresters, and transformer capacity corresponding to the tower.
[0029] In step S2-A-1, if a single tower is located in two or more grid cells, the tower is assigned to the grid cell with the largest overlapping area.
[0030] In addition, the process of acquiring environmental characteristics includes: Step S2-B-1: Based on the latitude and longitude coordinates of the grid cell, query all first measuring points and first announcement points located within the grid cell in the geographic information database. The first measuring point is the soil electrical conductivity measuring point, and the first announcement point is the land use type announcement point. Step S2-B-2: Based on the soil conductivity of all first measuring points, select the value with the highest frequency of occurrence as the soil conductivity of the grid cell; Step S2-B-3: Based on the land use types of all first announcement points, select the value with the highest frequency of occurrence as the land use type of the grid cell.
[0031] The above data preprocessing can significantly improve the integrity, consistency and usability of the data, laying the foundation for subsequent imbalanced data processing and ensemble optimization model training.
[0032] Step S3: Input the line parameters and environmental characteristics of each grid cell into the trained first detection model to obtain the lightning probability and maximum peak current of each grid cell.
[0033] The first detection model is trained based on the first sample set, which includes the following samples: The latitude and longitude coordinates of each grid cell; Line parameters and environmental characteristics of each grid cell; The time and peak current of a lightning disaster occur in each grid cell. If no lightning disaster occurs in a grid cell, the time and peak current of the lightning disaster are marked as 0.
[0034] In the training set construction phase, the raw data for power system lightning disaster risk assessment typically originates from various heterogeneous data sources, including power grid tower parameters, lightning monitoring system outputs, geographic information data, and meteorological environmental characteristics. These data are prone to the following problems during collection: Data anomalies: Lightning monitoring systems may record invalid peak current data, such as weak interference signals of 0–2kA or abnormal values exceeding 200kA above the physical limit; Differences in dimensions and ranges: The numerical ranges and units of different data sources vary significantly (e.g., tower height is measured in meters, soil conductivity in S / m), directly inputting them into the model can lead to an imbalance in feature contributions; Inconsistent dimensions: Data formats from different platforms are inconsistent, with some records containing missing values or incomplete feature fields; Temporal and spatial alignment issues: Lightning data needs spatial matching with tower locations and geographic information to form valid training samples. Therefore, data matching and fusion are performed first. Based on latitude and longitude coordinates and time parameters, lightning event data is spatially matched with power system characteristic parameters and environmental characteristic parameters to ensure accurate correlation of lightning strike events and generate a multi-source fused feature table. Next, data cleaning was performed. Records with peak currents between 0 and 2 kA (considered invalid signals) and outliers exceeding 200 kA were removed from the lightning monitoring data. Each feature field was examined, and samples with missing rates exceeding a preset threshold were processed. Then, data normalization was performed, using a function to normalize all data to the range [0,1], eliminating the influence of different units on model training and facilitating input into the machine learning model. Finally, the dataset was randomly divided into a test set and a training set.
[0035] In lightning disaster risk assessment of power distribution networks, historical monitoring data exhibits a significant class imbalance: the number of lightning strike event samples is extremely small, accounting for less than 0.5%, while the number of non-lightning strike event samples is enormous, accounting for over 99%. This extreme data imbalance has several adverse effects. Machine learning algorithms typically optimize overall classification accuracy during training. In cases of severe class imbalance, models tend to favor the majority class (non-lightning strike events) to achieve higher overall accuracy, but this leads to a significant decrease in the recognition rate of the minority class (lightning strike events), failing to meet the practical requirement of high recall in lightning protection risk assessment. The limited number of minority class samples, and the potential sparse distribution of their features in a high-dimensional feature space, makes it difficult for the model to capture the discrimination boundaries reflecting the characteristics of lightning strike events. This not only affects the model's assessment capability in the current region but also reduces its adaptability for wider application in other power distribution networks. To balance the data distribution, existing methods often use random oversampling or the SMOTE (Synthetic Minority Over-sampling Technique) algorithm. The core of this method is to perform linear interpolation between minority class samples to synthesize new minority class samples, thereby alleviating the model bias and low recall caused by class imbalance.
[0036] However, such methods are prone to generating samples across clusters, leading to inter-class overlap and noise diffusion. Furthermore, they cannot adaptively allocate the synthesis ratio according to the sample distribution density, which may result in redundant samples being generated in dense regions and insufficient samples being generated in sparse regions. This weakens the discrimination ability of boundary regions and amplifies the adverse effects of outliers on model training.
[0037] Therefore, this application employs K-means clustering to optimize the SMOTE technique. First, minority class samples are clustered into subsets with similar feature distributions. Then, interpolation is performed within each cluster based on neighborhood relationships, and the number of generated samples is adaptively adjusted according to cluster density. This reduces noise and inter-class overlap introduced by cross-cluster interpolation, improves sample coverage and discriminative ability in boundary regions, and significantly mitigates the negative impact of data imbalance on model training. Specifically, this includes: All samples in the original sample set that contain lightning disasters and whose peak current is not 0 are classified as minority class samples, and the remaining samples are classified as majority class samples. like Figure 2 As shown, K-means clustering is performed on all minority class samples to obtain multiple sub-clusters, and all majority class samples are assigned to each sub-cluster. Specifically, K-means clustering is used to cluster the input space into K groups, and Euclidean distance is used to calculate the distance between each minority class sample and all other minority class samples to obtain K-neighbors.
[0038]
[0039] in, This represents the distance from the i-th sample to the j-th cluster center. Let j represent the cluster center. x i This represents the i-th minority class sample. For each cluster, its cluster center needs to be recalculated:
[0040] in, c i It is the center point of the i-th cluster. It represents the number of sample points in the cluster.
[0041] Within each subcluster, for each minority class sample, select one or more nearest majority class samples within the same subcluster as the opposing samples corresponding to that minority class sample, and generate new minority class samples between the minority class sample and each opposing sample:
[0042] in: It is the j-th opponent sample of the i-th minority class sample.
[0043] Kmeans-SMOTE is a minority class oversampling method that introduces the K-means clustering idea into the traditional SMOTE. Its core idea is to first cluster, and then interpolate within the clusters. Figure 2 The method shown first performs K-means clustering on the minority class samples, dividing them into several clusters with similar feature distributions; then, within each cluster, linear interpolation is performed based on k-nearest neighbors to generate new minority class samples; finally, the number of synthetic samples is adaptively allocated according to the sparsity of the clusters, generating more samples in sparse regions and fewer samples in dense regions.
[0044] Compared to the standard SMOTE, the main advantages of Kmeans-SMOTE are: avoiding the generation of noisy samples that fall into the majority class region, reducing the risk of inter-class overlap; adjusting the generation ratio according to the cluster density, improving the discrimination ability of boundary and sparse regions; the clustering process can classify outliers into low-weight clusters, thereby reducing the noise amplification effect; and maintaining the local distribution structure of the minority class, improving the model's generalization performance on imbalanced data.
[0045] The first detection model is trained using a gradient boosting tree algorithm combined with Bayesian optimization, specifically through ensemble optimization. In lightning disaster risk assessment of power systems, there are numerous feature dimensions and complex nonlinear relationships between different features, with multiple parameters jointly influencing lightning strike risk. Traditional linear or shallow models (such as logistic regression and simple decision trees) struggle to capture these high-dimensional nonlinear patterns, easily leading to underfitting. XGBoost (Extreme Gradient Boosting), as an efficient gradient boosting tree algorithm, has the ability to handle high-dimensional, nonlinear, and multi-type features, and controls model complexity through regularization to avoid overfitting.
[0046] XGBoost (Extreme Gradient Boosting) is a high-efficiency decision tree-based optimization model. Its core advantage lies in its iterative approach, constructing multiple decision tree models based on the Classification and Regression Tree (CART) algorithm. Unlike traditional gradient boosting methods, XGBoost introduces more advanced optimization techniques, such as second-order Taylor expansion and regularization, thereby improving both training speed and prediction accuracy.
[0047] However, XGBoost's performance is highly dependent on hyperparameter settings (such as learning rate, tree depth, subsampling ratio, regularization coefficient, etc.). When the parameter space has high dimensionality and the search range is large, manual parameter tuning or grid search is inefficient and difficult to find the global optimum.
[0048] Bayesian optimization (BO) is a global optimization algorithm based on a probabilistic model that can find the optimal solution to the objective function in a relatively small number of iterations, making it particularly suitable for costly black-box function optimization. Combining BO with XGBoost allows for efficient optimization within limited computational resources and time, achieving an optimal model that balances accuracy and generalization ability. Therefore, after data balancing, optimizing the hyperparameters of the XGBoost model using BO is a crucial step in improving the accuracy and stability of lightning risk assessment. The hyperparameters that need to be optimized in XGBoost include the learning rate, maximum tree depth, number of trees, minimum node weight, subsampling ratio, column sampling ratio, regularization coefficient, and minimum loss decrease during tree splitting. Using the Bayesian optimization algorithm, with the average AUC value of cross-validation as the objective function, the optimal solution is approximated by iteratively selecting new parameter combinations and updating the surrogate model (Gaussian process regression).
[0049] In the Bayesian optimization process of this invention, the following is adopted: K Cross-validation (in this embodiment) K=5) to ensure the stability and generalization ability of hyperparameter search evaluation. Specifically, the training dataset, after K-means-SMOTE balancing, is evenly divided into 5 parts. One part is selected as the validation set in each fold, and the remaining 4 parts are used as the training set. In each fold, the XGBoost model is trained using the given hyperparameter combination and predictions are made on the validation set. Evaluation metrics (such as ROC-AUC, Precision, Recall) are recorded. The average of the 5 results is then used as the performance score for that hyperparameter combination, which is fed back to the Bayesian optimization surrogate model to guide the selection of hyperparameter sampling points in the next round. This reduces the random bias caused by a single partition and effectively avoids model overfitting. By combining Bayesian optimization and cross-validation, this method can achieve globally optimal hyperparameter search within limited computational resources and time, significantly improving the model's performance in lightning disaster risk assessment. Finally, the optimal hyperparameter combination is used to train the training set.
[0050] To enhance the interpretability and engineering usability of the model, this invention introduces the SHAP (SHapley Additive exPlanations) interpretation method based on game theory after the integrated optimization model training is completed. SHAP calculates the marginal contribution of each feature in all possible feature combinations to obtain a unified metric for the feature's contribution to the prediction result. This metric reflects both the global importance ranking of the overall sample and reveals the positive and negative influence direction and contribution magnitude of each feature in the prediction of a single sample. By introducing SHAP analysis, this invention has significant advantages in engineering implementation. On the one hand, it uses visualization methods to transform the complex model decision-making process into intuitive and easy-to-understand charts (such as feature importance ranking charts, force graphs, dependency graphs, etc.), enabling maintenance personnel and designers to quickly understand the risk prediction results and take effective measures even without a deep learning background in algorithms. On the other hand, SHAP analysis can reveal the interactions and potential nonlinear relationships between different features, such as the coupling effect between altitude, line height, and peak return current, providing a scientific basis for developing more accurate and comprehensive protection schemes. Furthermore, under high-risk and strongly imbalanced sample conditions, combining SHAP analysis not only significantly improves the interpretability of model prediction results, but also enhances the trust of users and review agencies in the method, thereby promoting its promotion and application in different types of power systems.
[0051] After constructing and training the improved model, this invention compares the performance of the proposed Kmeans-SMOTE-BO-XGBoost model with several commonly used lightning disaster risk assessment models in a power distribution network risk assessment case to verify its advantages. The comparison models include: an XGBoost model using only BO optimization (BO-XGBoost), an XGBoost model without data balancing (XGBoost), a BO-XGBoost model incorporating SMOTE (SMOTE-BO-XGBoost), a random forest model incorporating Kmeans-SMOTE (Kmeans-SMOTE-BO-RF), a random forest model incorporating SMOTE (SMOTE-BO-RF), and a support vector machine model incorporating SMOTE (SMOTE-BO-SVM). All comparative experiments were conducted on the same training and test sets, and Precision, Recall, and ROC-AUC were used as performance evaluation criteria. The results show that the Kmeans-SMOTE-BO-XGBoost model of this invention achieves the best performance in both precision and recall, with a precision of 99.6%, a recall of 98.1%, and an ROC-AUC of 0.99 on the test set, significantly outperforming other comparative models. Compared with BO-XGBoost without data balancing and hyperparameter optimization, the model of this invention improves precision by 16.6% and recall by 32.3% on the test set. Compared with the data balancing method using only SMOTE, this invention further improves precision by 3.2% by optimizing the SMOTE generation process with Kmeans, while effectively reducing the generation of noisy samples. These results fully demonstrate that this invention can simultaneously achieve high precision and high recall in the task of lightning risk assessment in power systems with extremely imbalanced classes, possessing stronger generalization ability and practical application value.
[0052] Table 1
[0053] This invention proposes an integrated optimization assessment method for lightning disasters in power systems based on unbalanced data. This method aims to effectively improve the risk identification capability of power systems under lightning strike conditions, formulate appropriate lightning protection measures, reduce equipment damage and power outages caused by lightning disasters, and thus improve the overall operational reliability of the power grid.
[0054] The design objective of this invention is to achieve high-precision prediction and assessment of lightning strike risk under complex environmental conditions by combining data balancing, hyperparameter optimization and interpretability analysis, and to provide a scientific basis for the layout and operation and maintenance decisions of protection devices.
[0055] To address this issue, this invention proposes an integrated method that combines SMOTE technology optimized by K-means clustering with a Bayesian-optimized extreme gradient boosting (BO-XGBoost) model. This method not only solves the class imbalance problem caused by the extremely scarce lightning event samples but also improves the model's learning and generalization capabilities in high-dimensional nonlinear feature spaces. Performance evaluations show that this method significantly outperforms traditional models in accuracy and recall, achieving an optimal balance between risk management and computational efficiency. It is suitable for lightning risk assessment tasks in power systems under variable weather conditions and stringent safety standards, demonstrating broad engineering application prospects and providing an innovative solution for the development of smart grid lightning protection technology.
[0056] Example 2 The electronic device of this invention includes a central processing unit (CPU), which can perform various appropriate actions and processes according to computer program instructions stored in read-only memory (ROM) or loaded from a storage unit into random access memory (RAM). The RAM may also store various programs and data required for device operation. The CPU, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.
[0057] Multiple components in the device are connected to the I / O interface, including: input units such as keyboards and mice; output units such as various types of displays and speakers; storage units such as disks and optical discs; and communication units such as network interface cards (NICs), modems, and wireless transceivers. The communication unit allows the device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0058] The processing unit executes the various methods and processes described above, such as methods S1 to S3. For example, in some embodiments, methods S1 to S3 may be implemented as computer software programs tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and / or installed on the device via ROM and / or a communication unit. When the computer program is loaded into RAM and executed by the CPU, one or more steps of methods S1 to S3 described above may be performed. Alternatively, in other embodiments, the CPU may be configured to execute methods S1 to S3 by any other suitable means (e.g., by means of firmware).
[0059] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0060] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0061] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
Claims
1. A method for detecting lightning disaster risk in power systems based on unbalanced data, characterized in that, include: Step S1: Grid the target detection area to obtain multiple grid cells: Step S2: Based on the latitude and longitude coordinates of each grid cell, and combined with the line database and geographic information database, obtain the line parameters and environmental characteristics of each grid cell. The line parameters include tower height, span, grounding resistance, number of circuits, number of surge arresters and transformer capacity. The environmental characteristics include soil conductivity, building height and land use type. Step S3: Input the line parameters and environmental characteristics of each grid cell into the trained first detection model to obtain the lightning probability and maximum peak current of each grid cell.
2. The method for detecting lightning disaster risk in power systems based on unbalanced data according to claim 1, characterized in that, Step S1 includes: Step S1-1: Extract the coordinates of the poles in the target plot and calculate the distance between each pole in the latitude and longitude directions; Step S1-2: Calculate the greatest common divisor of the distances between the left and right towers in the latitude and longitude directions; Step S1-3: Determine whether the greatest common divisor is greater than the diameter of the tower. If it is, use the greatest common divisor as the side length of the grid; otherwise, use the default grid side length as the grid side length. Steps S1-4: Grid the target detection plots according to the determined grid side lengths to obtain multiple grid cells.
3. The method for detecting lightning disaster risk in power systems based on unbalanced data according to claim 2, characterized in that, The process of obtaining line parameters in step S2 includes: Step S2-A-1: Assign all towers to each grid cell, wherein each tower is assigned to only one grid cell; Step S2-A-2: Determine whether there are towers in each grid cell. If yes, proceed to step S2-A-3; otherwise, proceed to step S2-A-4. Step S2-A-3: Obtain tower height, span, grounding resistance, number of circuits, number of surge arresters, and transformer capacity; Step S2-A-4: Set the tower height, span, grounding resistance, number of circuits, number of surge arresters, and transformer capacity to 0.
4. The method for detecting lightning disaster risk in power systems based on unbalanced data according to claim 3, characterized in that, Step S2-A-3 includes: Determine if the number of poles in a grid cell is 1. If it is, select this pole as the representative pole; otherwise, select the tallest pole in the grid cell as the representative pole. Read the height of the representative pole as the tower height; Read the distance between the representative tower and its subordinate towers as the span; Read the grounding resistance, number of circuits, number of surge arresters, and transformer capacity corresponding to the tower.
5. The method for detecting lightning disaster risk in power systems based on unbalanced data according to claim 3, characterized in that, In step S2-A-1, if a single tower is located in two or more grid cells, the tower is assigned to the grid cell with the largest overlapping area.
6. The method for detecting lightning disaster risk in power systems based on unbalanced data according to claim 2, characterized in that, The process of acquiring environmental features in step S2 includes: Step S2-B-1: Based on the latitude and longitude coordinates of the grid cell, query all first measuring points and first announcement points located within the grid cell in the geographic information database. The first measuring point is the soil electrical conductivity measuring point, and the first announcement point is the land use type announcement point. Step S2-B-2: Based on the soil conductivity of all first measuring points, select the value with the highest frequency of occurrence as the soil conductivity of the grid cell; Step S2-B-3: Based on the land use types of all first announcement points, select the value with the highest frequency of occurrence as the land use type of the grid cell.
7. The method for detecting lightning disaster risk in power systems based on unbalanced data according to claim 1, characterized in that, The first detection model is trained based on a first sample set, which includes the following samples: The latitude and longitude coordinates of each grid cell; Line parameters and environmental characteristics of each grid cell; The time and peak current of a lightning disaster occur in each grid cell. If no lightning disaster occurs in a grid cell, the time and peak current of the lightning disaster are marked as 0.
8. A method for detecting lightning disaster risk in power systems based on unbalanced data, as described in claim 7, is characterized in that... The first sample set is obtained by optimizing the original sample set using the SMOTE method with imbalanced data K-means clustering, including: All samples in the original sample set that contain lightning disasters and whose peak current is not 0 are classified as minority class samples, and the remaining samples are classified as majority class samples. K-means clustering is performed on all minority class samples to obtain multiple sub-clusters, and all majority class samples are assigned to each sub-cluster; In each sub-cluster, for each minority class sample, one or more nearest majority class samples within the same sub-cluster are selected as the opponent samples corresponding to that minority class sample, and new minority class samples are generated between the minority class sample and each opponent sample.
9. A method for detecting lightning disaster risk in power systems based on unbalanced data according to claim 1, characterized in that, The first detection model is trained using a gradient boosting tree algorithm combined with a Bayesian optimization method.
10. A power system lightning disaster risk detection device for unbalanced data, comprising a memory, a processor, and a program stored in the memory, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1-9.
Citation Information
Patent Citations
Assessment method of electricity grid lightning strike risk and device thereof
CN103018604A
Method for drawing distribution map of lightning stroke tripping risk
CN108009351A
Lightning disaster risk assessment method suitable for main network transmission line
CN112418629A
Power transmission line lightning stroke risk assessment method and system based on distribution network lightning stroke data
CN114862278A
Lightning trip-out rate acquisition method and equipment oriented to complex terrain and meteorological environment
CN116415495A
Cited By
Method and system for detecting lightning activity modulation effect of long-span tower
CN122112777A
Method and system for detecting lightning activity modulation effect of large-span tower
CN122112777B
