Tree line contradiction probability prediction method based on improved random forest

By improving the random forest model, combining recursive feature elimination and simulated annealing algorithm, probability prediction of tree line contradictions is solved, and the problem of failure to fully consider vegetation types and ecological characteristics in the existing technology is achieved, and a more accurate and targeted tree line contradiction warning is achieved.

CN119760554APending Publication Date: 2025-04-04STATE GRID FUJIAN ELECTRIC POWER RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411792974.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-08
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The existing technology fails to fully consider the vegetation types and their ecological characteristics in different regions, resulting in a lack of targetedness and accuracy when warning tree lines are inconsistent, especially in special vegetation environments such as bamboo forests.

Method used

The tree line contradiction probability prediction method based on improved random forests is adopted. By collecting historical data on tree line contradictions in transmission lines, combining recursive feature elimination algorithm and simulated annealing algorithm, the model is characterized and parameter optimization, and a more accurate tree line contradiction probability prediction model is constructed.

Benefits of technology

The model's ability to handle complex and non-numerical features is improved, the accuracy and pertinence of predicting tree contradiction probability is enhanced, and the accuracy of early warning is effectively improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760554A_ABST
    Figure CN119760554A_ABST
Patent Text Reader

Abstract

The invention relates to a tree line contradiction probability prediction method based on an improved random forest. The method comprises the following steps that historical data of power transmission line tree line contradiction are collected and preprocessed; constructing a tree line contradiction probability prediction model based on a random forest model; screening the preprocessed tree line contradiction historical data of the power transmission line by combining a recursive feature elimination algorithm with a random forest classifier, and selecting a feature which contributes to the prediction of a tree line contradiction probability prediction model as model input feature data; after parameters of the tree line contradiction probability prediction model are optimized through a simulated annealing algorithm, the input feature data are input into the tree line contradiction probability prediction model for training, and a trained tree line contradiction probability prediction model is obtained; and predicting the tree line contradiction probability through the trained tree line contradiction probability prediction model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a tree-line contradiction probability prediction method based on improved random forest, belonging to the technical field of power transmission. Background Art

[0002] "Tree-line conflict" refers to the fact that vegetation such as trees and bamboos are too close to transmission lines, which may cause safety hazards such as tripping and power outages. Its main impacts include: First, when the branches and leaves of trees are close to the transmission lines, it may cause the wires to discharge to the trees, causing the lines to trip and causing large-scale power outages; second, the electric sparks generated by the discharge of high-voltage lines may ignite vegetation and cause fires in hot weather; third, in thunderstorms, fallen trees may crush transmission lines. At present, although there have been studies on the early warning of tree-line conflicts in distribution networks under severe convective weather, the vegetation types and their ecological characteristics in different regions have not been fully considered. For example, the growth cycle of bamboo forests is relatively short, and the height of mature bamboos is usually between 15 and 25 meters. This type of vegetation is very prone to related defects.

[0003] The rapid growth of forest trees poses a serious threat to the safety of power grid transmission lines and the stability of power supply. The tree-line conflict has become a major challenge that the power industry urgently needs to address. Summary of the invention

[0004] In order to solve the above problems existing in the prior art, the present invention proposes a tree-line contradiction probability prediction method based on improved random forest.

[0005] The technical solution of the present invention is as follows:

[0006] In one aspect, the present invention provides a treeline contradiction probability prediction method based on improved random forest, comprising the following steps:

[0007] Collect historical data of tree-line conflicts on transmission lines and perform preprocessing;

[0008] Construct a treeline contradiction probability prediction model based on the random forest model;

[0009] The pre-processed historical data of tree-line conflicts of power transmission lines are screened by recursive feature elimination algorithm combined with random forest classifier, and the features that contribute most to the prediction of tree-line conflict probability prediction model are selected as the model input feature data;

[0010] After optimizing the parameters of the tree-line conflict probability prediction model by using a simulated annealing algorithm, the input feature data is input into the tree-line conflict probability prediction model for training to obtain a trained tree-line conflict probability prediction model;

[0011] The tree-line contradiction probability is predicted using the trained tree-line contradiction probability prediction model.

[0012] As a preferred implementation manner of the present invention, the historical data of the transmission line tree-line contradiction includes text data and numerical data.

[0013] As a preferred embodiment of the present invention, the preprocessing steps of the text data are:

[0014] Count the frequency of occurrence of each feature in the text data and standardize the frequency data;

[0015] The K-means clustering algorithm is used to cluster the standardized frequency data, traverse different cluster numbers, and calculate the error sum of squares and silhouette coefficient corresponding to each cluster number;

[0016] The score of each cluster number is obtained by weighted summing of the sum of squared errors and the silhouette coefficient corresponding to each cluster number, as shown in the following formula:

[0017] R=α·SSE+β·S

[0018] Among them: R represents the current cluster number score; SSE represents the error sum of squares; S represents the silhouette coefficient; α and β represent weight coefficients respectively; the cluster number with the highest score is selected as the final cluster number;

[0019] The K-means clustering algorithm is used to cluster the standardized frequency data again with the final cluster number to generate a cluster label corresponding to each feature in the text data.

[0020] As a preferred embodiment of the present invention, the calculation formula of the sum of square errors is:

[0021]

[0022] Where: S i represents the i-th cluster; X represents S i All samples in S; x represents S i Any sample in c i Indicates S i The cluster center of .

[0023] As a preferred embodiment of the present invention, the calculation formula of the silhouette coefficient is:

[0024]

[0025] Where: S(j) represents the silhouette coefficient of sample j; b(j) represents the average distance between sample j and all samples in its nearest cluster; a(j) represents the average distance between sample j and other samples in its cluster; the sum of the silhouette coefficients of all samples is taken as the final silhouette coefficient.

[0026] As a preferred embodiment of the present invention, the specific steps of optimizing the parameters of the tree-line contradiction probability prediction model by using the simulated annealing algorithm are as follows:

[0027] Set the initial temperature of the simulated annealing algorithm and generate an initial treeline contradiction probability prediction model;

[0028] Constructing a performance objective function of the tree-line contradiction probability prediction model and setting an initial performance objective function value, wherein the solution of the performance objective function is a parameter value of the tree-line contradiction probability prediction model;

[0029] Iteration begins. Each iteration generates a new solution to the performance objective function. The performance objective function value of this iteration is calculated. If the performance objective function value of this iteration is better than the performance objective function value of the previous iteration, the temperature is updated through the preset cooling strategy after the optimal solution is updated.

[0030] The iteration stops when the temperature is lower than the preset mid-range temperature, and the final solution is obtained.

[0031] As a preferred embodiment of the present invention, when a new solution is generated, an acceptance criterion is set to determine whether to accept the current new solution. The acceptance criterion P is specifically shown in the following formula:

[0032]

[0033] Wherein: ΔE represents the difference in the objective function value between the new solution and the current solution; T represents the current temperature; a preset threshold value is set, and when P(ΔE) is greater than the preset threshold value, the new solution is accepted, otherwise it is not accepted.

[0034] On the other hand, the present invention also provides a tree-line contradiction probability prediction system based on improved random forest, including a data acquisition module, a prediction model construction module, a feature selection module, a model training module and a prediction module;

[0035] The data acquisition module is used to collect historical data of tree-line conflicts of power transmission lines and perform preprocessing;

[0036] The prediction model building module is used to build a treeline contradiction probability prediction model based on a random forest model;

[0037] The feature selection module is used to screen the pre-processed transmission line tree-line conflict historical data by using a recursive feature elimination algorithm combined with a random forest classifier, and select the features that contribute most to the prediction of the tree-line conflict probability prediction model as model input feature data;

[0038] The model training module is used to optimize the parameters of the tree-line contradiction probability prediction model by using a simulated annealing algorithm, and then input the input feature data into the tree-line contradiction probability prediction model for training to obtain a trained tree-line contradiction probability prediction model;

[0039] The prediction module is used to predict the tree-line conflict probability through the trained tree-line conflict probability prediction model.

[0040] On the other hand, the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in any embodiment of the present invention when executing the program.

[0041] In yet another aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any embodiment of the present invention.

[0042] The present invention has the following beneficial effects:

[0043] 1. The present invention uses the K-means clustering algorithm to preprocess text data, which effectively improves the model's ability to process complex, non-numerical features.

[0044] 2. The present invention optimizes the parameters of the random forest model through the global search capability of the simulated annealing algorithm to improve the performance of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] It should be understood that the step numbers used in this document are only for convenience of description and are not intended to limit the order in which the steps are executed.

[0048] It should be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0049] The terms “include” and “comprising” indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0050] The term "and / or" means and includes any and all possible combinations of one or more of the associated listed items.

[0051] Embodiment 1:

[0052] See also Figure 1 , a treeline contradiction probability prediction method based on improved random forest, comprising the following steps:

[0053] Collect historical data of tree-line conflicts on transmission lines and perform preprocessing;

[0054] Construct a treeline contradiction probability prediction model based on the random forest model;

[0055] The pre-processed historical data of tree-line conflicts of power transmission lines are screened by recursive feature elimination algorithm combined with random forest classifier, and the features that contribute most to the prediction of tree-line conflict probability prediction model are selected as the model input feature data;

[0056] After optimizing the parameters of the tree-line conflict probability prediction model by using a simulated annealing algorithm, the input feature data is input into the tree-line conflict probability prediction model for training to obtain a trained tree-line conflict probability prediction model;

[0057] The tree-line contradiction probability is predicted using the trained tree-line contradiction probability prediction model.

[0058] As a preferred implementation manner of this embodiment, the historical data of the transmission line tree-line contradiction includes text data and numerical data.

[0059] As a preferred implementation of this embodiment, the preprocessing steps of the text data are:

[0060] The frequency of occurrence of each feature in the text data (such as weather, route name, etc.) is counted, and the frequency data is standardized using StandardScaler (i.e., Z-score standardization) to make its mean 0 and standard deviation 1. This step ensures that all features are at the same scale when clustering, avoiding excessive influence on the clustering results due to the large value range of some features.

[0061] The K-means clustering algorithm is used to cluster the standardized frequency data, traverse different cluster numbers, and calculate the error sum of squares and silhouette coefficient corresponding to each cluster number;

[0062] The score of each cluster number is obtained by weighted summing of the sum of squared errors and the silhouette coefficient corresponding to each cluster number, as shown in the following formula:

[0063] R=α·SSE+β·S

[0064] Among them: R represents the current cluster number score; SSE represents the error sum of squares; S represents the silhouette coefficient; α and β represent weight coefficients respectively; the cluster number with the highest score is selected as the final cluster number;

[0065] The K-means clustering algorithm is used to cluster the standardized frequency data again with the final cluster number to generate a cluster label corresponding to each feature in the text data.

[0066] As a preferred implementation of this embodiment, the calculation formula of the sum of squared errors is:

[0067]

[0068] Where: S i represents the i-th cluster; X represents S i All samples in S; x represents S i Any sample in c i Indicates S i The cluster center; SSE is used to measure the compactness of the data within the cluster. The smaller the SSE value, the smaller the difference within the cluster.

[0069] As a preferred implementation of this embodiment, the calculation formula of the silhouette coefficient is:

[0070]

[0071] Where: S(j) represents the silhouette coefficient of sample j, the value range of S(i) is [-1,1]. The closer the value is to 1, the more similar the sample is to the samples in its cluster and the less similar it is to the samples in other clusters. The silhouette coefficient measures the effect of clustering. The larger the value, the better the clustering effect. b(j) represents the average distance between sample j and all samples in its nearest cluster. a(j) represents the average distance between sample j and other samples in its cluster. The sum of the silhouette coefficients of all samples is taken as the final silhouette coefficient.

[0072] As a preferred implementation of this embodiment, the specific steps of optimizing the parameters of the treeline contradiction probability prediction model are as follows:

[0073] Set the initial temperature of the simulated annealing algorithm and generate an initial treeline contradiction probability prediction model;

[0074] Constructing a performance objective function of the tree-line contradiction probability prediction model and setting an initial performance objective function value, wherein the solution of the performance objective function is a parameter value of the tree-line contradiction probability prediction model, including: the number of trees, the maximum depth, the minimum number of sample splits, the minimum number of sample leaves, and the number of feature selections;

[0075] Iteration begins. Each iteration generates a new solution to the performance objective function. The performance objective function value of this iteration is calculated. If the performance objective function value of this iteration is better than the performance objective function value of the previous iteration, the temperature is updated through the preset cooling strategy after the optimal solution is updated.

[0076] The iteration stops when the temperature is lower than the preset mid-range temperature, and the final solution is obtained.

[0077] As a preferred implementation of this embodiment, when a new solution is generated, an acceptance criterion is set to determine whether to accept the current new solution. The acceptance criterion P is specifically shown in the following formula:

[0078]

[0079] Where: ΔE represents the difference in the objective function value between the new solution and the current solution; T represents the current temperature; a preset threshold is set. When P(ΔE) is greater than the preset threshold, the new solution is accepted, otherwise it is not accepted; this formula determines the probability of accepting a worse solution. When the temperature is higher, the probability of accepting a worse solution is greater; when the temperature is lower, the probability of accepting a worse solution is reduced.

[0080] When the improved random forest model predicts the test set, it uses the maximum predicted probability value of each sample as its risk score. When the risk score exceeds the set threshold, the system will issue an early warning for the corresponding line. The core of the early warning model is to provide an accurate risk score for each sample, which reflects the probability that the sample belongs to the positive class (such as the high-risk category). By setting a reasonable threshold, it is possible to effectively determine when to trigger an early warning, thereby achieving accurate early warning based on probability.

[0081] Embodiment 2:

[0082] A tree-line contradiction probability prediction system based on improved random forest, comprising a data acquisition module, a prediction model building module, a feature selection module, a model training module and a prediction module;

[0083] The data acquisition module is used to collect historical data of tree-line conflicts of power transmission lines and perform preprocessing;

[0084] The prediction model building module is used to build a treeline contradiction probability prediction model based on a random forest model;

[0085] The feature selection module is used to screen the pre-processed transmission line tree-line conflict historical data by using a recursive feature elimination algorithm combined with a random forest classifier, and select the features that contribute most to the prediction of the tree-line conflict probability prediction model as model input feature data;

[0086] The model training module is used to optimize the parameters of the tree-line contradiction probability prediction model by using a simulated annealing algorithm, and then input the input feature data into the tree-line contradiction probability prediction model for training to obtain a trained tree-line contradiction probability prediction model;

[0087] The prediction module is used to predict the tree-line conflict probability through the trained tree-line conflict probability prediction model.

[0088] The system is used to implement the method in Example 1, which will not be described in detail here.

[0089] Embodiment three:

[0090] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in any embodiment of the present invention when executing the program.

[0091] Embodiment 4:

[0092] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method described in any embodiment of the present invention is implemented.

[0093] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.

[0094] Those of ordinary skill in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented in a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0095] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0096] In several embodiments provided in the present application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory; hereinafter referred to as: ROM), random access memory (Random Access Memory; hereinafter referred to as: RAM), disk or optical disk, and other media that can store program codes.

[0097] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A tree-line contradiction probability prediction method based on improved random forest, characterized in that: The following steps are involved: Collect historical data of tree-line conflicts on transmission lines and perform preprocessing; Construct a treeline contradiction probability prediction model based on the random forest model; The pre-processed historical data of tree-line conflicts of power transmission lines are screened by recursive feature elimination algorithm combined with random forest classifier, and the features that contribute most to the prediction of tree-line conflict probability prediction model are selected as the model input feature data; After optimizing the parameters of the tree-line conflict probability prediction model by using a simulated annealing algorithm, the input feature data is input into the tree-line conflict probability prediction model for training to obtain a trained tree-line conflict probability prediction model; The tree-line contradiction probability is predicted using the trained tree-line contradiction probability prediction model.

2. The tree-line contradiction probability prediction method based on improved random forest according to claim 1 is characterized in that: The historical data of the transmission line tree-line contradiction includes text data and numerical data.

3. The tree-line contradiction probability prediction method based on improved random forest according to claim 2 is characterized in that: The preprocessing steps of the text data are: Count the frequency of occurrence of each feature in the text data and standardize the frequency data; The K-means clustering algorithm is used to cluster the standardized frequency data, traverse different cluster numbers, and calculate the error sum of squares and silhouette coefficient corresponding to each cluster number; The score of each cluster number is obtained by weighted summing of the error sum and silhouette coefficient corresponding to each cluster number, as shown in the following formula: R=α·SSE+β·S Among them: R represents the current cluster number score; SSE represents the error sum of squares; S represents the silhouette coefficient; α and β represent weight coefficients respectively; the cluster number with the highest score is selected as the final cluster number; The K-means clustering algorithm is used to cluster the standardized frequency data again with the final cluster number to generate a cluster label corresponding to each feature in the text data.

4. The tree-line contradiction probability prediction method based on improved random forest according to claim 3 is characterized in that: The calculation formula of the error sum of squares is: Where: S i represents the i-th cluster; X represents S i All samples in S; x represents S i Any sample in c i Indicates S i The cluster center of .

5. The tree-line contradiction probability prediction method based on improved random forest according to claim 3 is characterized in that: The calculation formula of the silhouette coefficient is: Where: S(j) represents the silhouette coefficient of sample j; b(j) represents the average distance between sample j and all samples in its nearest cluster; a(j) represents the average distance between sample j and other samples in its cluster; the sum of the silhouette coefficients of all samples is taken as the final silhouette coefficient.

6. The tree-line contradiction probability prediction method based on improved random forest according to claim 1, characterized in that: The specific steps of optimizing the parameters of the tree-line contradiction probability prediction model by simulated annealing algorithm are as follows: Set the initial temperature of the simulated annealing algorithm and generate an initial treeline contradiction probability prediction model; Constructing a performance objective function of the tree-line contradiction probability prediction model and setting an initial performance objective function value, wherein the solution of the performance objective function is a parameter value of the tree-line contradiction probability prediction model; Iteration begins. Each iteration generates a new solution to the performance objective function. The performance objective function value of this iteration is calculated. If the performance objective function value of this iteration is better than the performance objective function value of the previous iteration, the temperature is updated through the preset cooling strategy after the optimal solution is updated. The iteration stops when the temperature is lower than the preset mid-range temperature, and the final solution is obtained.

7. The tree-line contradiction probability prediction method based on improved random forest according to claim 6, characterized in that: When a new solution is generated, an acceptance criterion is set to determine whether to accept the current new solution. The acceptance criterion P is specifically shown in the following formula: Wherein: ΔE represents the difference in the objective function value between the new solution and the current solution; T represents the current temperature; a preset threshold value is set, and when P(ΔE) is greater than the preset threshold value, the new solution is accepted, otherwise it is not accepted.

8. A treeline contradiction probability prediction system based on improved random forest, characterized in that: It includes data collection module, prediction model building module, feature selection module, model training module and prediction module; The data acquisition module is used to collect historical data of tree-line conflicts of power transmission lines and perform preprocessing; The prediction model building module is used to build a treeline contradiction probability prediction model based on a random forest model; The feature selection module is used to screen the pre-processed transmission line tree-line conflict historical data by using a recursive feature elimination algorithm combined with a random forest classifier, and select the features that contribute most to the prediction of the tree-line conflict probability prediction model as model input feature data; The model training module is used to optimize the parameters of the tree-line contradiction probability prediction model by using a simulated annealing algorithm, and then input the input feature data into the tree-line contradiction probability prediction model for training to obtain a trained tree-line contradiction probability prediction model; The prediction module is used to predict the tree-line conflict probability through the trained tree-line conflict probability prediction model.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.