Circuit breaker fault diagnosis method, model training method, medium and equipment
Through the characteristic extraction and fusion of the multi -source data of the circuit breaker, and using the improved target function to optimize the hyperparameter combination of the LightGBM model, the problem of insufficient accuracy in the diagnosis of the existing model in the diagnosis of the circuit breaker has been solved. The accuracy of diagnosis.
Patent Information
- Application Number
- CN202411410583.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-10-10
AI Technical Summary
When the existing LightGBM model processes multi-source heterogeneous data of the circuit breaker, the accuracy of the fault diagnosis results cannot be effectively guaranteed.
By obtaining multiple sets of multi -source heterogeneous data of the circuit breaker, extract and integrate the sample characteristics, randomly initialize the super -combination of the LightGBM model, use the improved target function to combine the cross -entropy loss function and gradient reconciliation mechanism function to optimize the combination of the super -added combination to use it. Improve model performance.
Enhance the learning ability of the model to distinguish between complex and difficult to distinguish samples, and improve the accuracy of the diagnosis of circuit breakers.
Smart Images

Figure CN119337309A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fault diagnosis, and in particular to a circuit breaker fault diagnosis method, a model training method, a medium and a device. Background Art
[0002] In the prior art, the LightGBM model can be applied to circuit breaker fault diagnosis because it can process high-dimensional data and has efficient computing performance. However, with the increasing complexity of circuit breaker systems, the system generates more and more multi-source heterogeneous data types, such as sensor data such as voltage, current, temperature, and communication data of different protocols and formats. These multi-source heterogeneous data are often affected by factors such as noise, data loss, and time asynchrony during the collection and processing process, resulting in uneven data quality. This results in the existing LightGBM model not being able to effectively guarantee the accuracy of its fault diagnosis results when processing multi-source heterogeneous data of circuit breakers. Summary of the invention
[0003] Based on this, it is necessary to provide circuit breaker fault diagnosis methods, model training methods, media and equipment to solve the problem that the accuracy of fault diagnosis results of the existing LightGBM model cannot be effectively guaranteed when processing multi-source heterogeneous data of circuit breakers.
[0004] A method for improving a LightGBM model based on optimization algorithm training, the method comprising:
[0005] Obtain I groups of sample multi-source heterogeneous data of the circuit breaker; wherein I>1, each group of sample multi-source heterogeneous data includes sample data sampled from multiple data sources, and each group of sample multi-source heterogeneous data carries a corresponding fault label;
[0006] In each group of sample multi-source heterogeneous data, sample features of each sample data are extracted respectively, and the extracted multiple sample features are fused to obtain corresponding I sample fusion features;
[0007] Random initialization improves the current N hyperparameter combinations of the LightGBM model;
[0008] On the premise of setting the improved LightGBM model to different hyperparameter combinations, input each sample fusion feature in turn and obtain the output predicted fault, input the predicted fault and the corresponding fault label into the preset improved objective function to calculate the fitness, so as to obtain the fitness corresponding to the current N hyperparameter combinations; wherein the loss function in the improved objective function includes a cross entropy loss function and a gradient reconciliation mechanism function, the cross entropy loss function is used to measure the difference between the predicted fault and the corresponding fault label, the fault differentiation difficulty of the sample multi-source heterogeneous data corresponding to the sample fusion feature in the gradient reconciliation mechanism function is positively correlated with the weight of the sample fusion feature, and the calculation ratio of the gradient reconciliation mechanism function compared to the cross entropy loss function increases with the increase of the current number of iterations;
[0009] Determine the optimal hyperparameter combination among the current N hyperparameter combinations according to the size of the fitness, and update the current N hyperparameter combinations using an optimization algorithm according to the optimal hyperparameter combination;
[0010] If the current number of iterations is less than the preset iteration number threshold, then the current number of iterations is set to +1, and the process returns to execute the steps and subsequent steps of inputting each sample fusion feature in turn and obtaining the output predicted fault under the premise of setting the improved LightGBM model to different hyperparameter combinations, until the current number of iterations is equal to the preset iteration number threshold, and then the improved LightGBM model is set based on the optimal hyperparameter combination among the current N hyperparameter combinations to obtain the target LightGBM model.
[0011] In one embodiment, the current nth hyperparameter combination of the LightGBM model is randomly initialized and improved, which is expressed as:
[0012] X n =BK lb +rand(BK ub -BK lb )
[0013] In the above formula, X n is the nth hyperparameter combination, n is an integer between 1 and N; BK ub is the lower bound of the nth hyperparameter group in the jth dimension; BK lb is the upper bound of the nth hyperparameter group in the jth dimension; rand is a randomly selected value between [0,1].
[0014] In one embodiment, the predicted fault and the corresponding fault label are input into a preset improved objective function to calculate the fitness, which is expressed as:
[0015]
[0016]
[0017] L GHM =L CE β i
[0018] In the above formula, is the fitness of the fusion feature of the i-th sample; f t (x i ) represents the t-th tree model; F is the loss value of the loss function; g i is the first-order derivative of the loss function; h i is the second-order derivative of the loss function; ∑ k Ω(f k ) represents the regularization term; is the proportional coefficient at the tth iteration. When t = 1, is the default value; L CE is the loss value of the cross entropy loss function; L GHM is the loss value of the gradient reconciliation mechanism function; is the fitness of the optimal hyperparameter combination at the t-1th iteration; y i is the fault label of the fusion feature of the i-th sample; is the predicted fault of the fusion feature of the i-th sample; β i The weight set for the fusion feature of the i-th sample. The greater the difficulty of fault differentiation of the multi-source heterogeneous data of the sample corresponding to the i-th sample fusion feature, the greater the difficulty of fault differentiation of the multi-source heterogeneous data of the sample, i The larger the setting.
[0019] In one embodiment, the method further comprises:
[0020] Calculate the minimum distance between the sample multi-source heterogeneous data corresponding to the i-th sample fusion feature and the remaining sample multi-source heterogeneous data, and set β based on the minimum distance i The size of; Among them, the minimum distance and β i The size is negatively correlated.
[0021] In one embodiment, the method further comprises:
[0022] Calculate the noise ratio in the sample multi-source heterogeneous data corresponding to the i-th sample fusion feature, and set β based on the noise ratio i The size of the noise ratio is i The size is positively correlated.
[0023] In one embodiment, the updating of the current N hyperparameter combinations using an optimization algorithm according to the optimal hyperparameter combination includes:
[0024] The calculation is based on the size between the random number r and the constant p, expressed as:
[0025]
[0026]
[0027] In the above formula, is the size of the nth hyperparameter combination in the jth dimension at the t+1th iteration; is the size of the nth hyperparameter combination in the jth dimension at the tth iteration; p is a preset constant; r is a random number between 0 and 1; t is the current iteration number; T is the preset iteration number threshold;
[0028] The fitness between different hyperparameter combinations is calculated and expressed as:
[0029]
[0030] is the size of the best hyperparameter combination in the jth dimension at the tth iteration so far; represents the fitness of the nth hyperparameter combination in the jth dimension in the tth iteration; represents the fitness of the hyperparameter combination in the tth iteration when the jth dimension is set to a random size; c(0,1) represents the Cauchy mutation;
[0031] Compare and The size of the room, if Use replace like Keep in, Indicates that the improved LightGBM model is set to The adaptability of Indicates that the improved LightGBM model is set to Time adaptability.
[0032] In one embodiment, the step of fusing the extracted multiple sample features includes:
[0033] Assign different weights to the extracted multiple sample features and perform weighted averaging to obtain the corresponding sample fusion features; or,
[0034] The extracted multiple sample features are concatenated in columns to obtain the corresponding sample fusion features; or,
[0035] The extracted multiple sample features are cross-combined to obtain the corresponding sample fusion features.
[0036] A circuit breaker fault diagnosis method, the method comprising:
[0037] Obtain real-time multi-source heterogeneous data of circuit breakers;
[0038] Extracting real-time features of each real-time data in the real-time multi-source heterogeneous data, and fusing the extracted multiple real-time features to obtain corresponding real-time fused features;
[0039] The real-time fusion feature is input into the target LightGBM model, and the output predicted fault is obtained; wherein, the target LightGBM model is trained by the above-mentioned method of improving the LightGBM model based on optimization algorithm training.
[0040] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the processor executes the steps of the method for improving the LightGBM model based on optimization algorithm training and the circuit breaker fault diagnosis method.
[0041] A terminal device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method for improving the LightGBM model based on optimization algorithm training and the circuit breaker fault diagnosis method as described above.
[0042] The present invention provides a circuit breaker fault diagnosis method, a model training method, a medium and a device, which obtain multiple groups of multi-source heterogeneous data of the circuit breaker, extract and fuse features for each group of data, and form sample fusion features. Under the multiple hyperparameter combinations initially set, the model sequentially inputs these sample fusion features, and uses an improved objective function to calculate the fitness to evaluate the effect of each combination. The loss function of the improved objective function combines the cross entropy loss function and the gradient reconciliation mechanism function, wherein the gradient reconciliation mechanism function adjusts the weight according to the difficulty of fault differentiation of the sample during the calculation process, so that the learning of difficult samples is more concentrated. In addition, as the number of iterations increases, the influence of the gradient reconciliation mechanism function gradually increases, further improving the model's learning ability for complex samples. Then, the current optimal hyperparameter combination is continuously iteratively determined by the optimization algorithm until the preset number of times is reached, thereby setting the optimized target LightGBM model. This method enhances the model's learning ability for complex and difficult-to-distinguish samples through an improved objective function, solving the shortcomings of the existing model in accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0044] in:
[0045] Figure 1 A flowchart of a method for improving a LightGBM model based on optimization algorithm training in one embodiment;
[0046] Figure 2 A schematic diagram of a flow chart of a circuit breaker fault diagnosis method in one embodiment;
[0047] Figure 3 This is a structural block diagram of the terminal equipment. DETAILED DESCRIPTION
[0048] 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.
[0049] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0050] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0051] like Figure 1 As shown, Figure 1The flowchart of a method for improving the LightGBM model based on optimization algorithm training in one embodiment is shown in FIG. The method for improving the LightGBM model based on optimization algorithm training in this embodiment includes the following steps:
[0052] S101, obtaining I groups of sample multi-source heterogeneous data of circuit breakers.
[0053] Where I>1, each set of sample multi-source heterogeneous data includes sample data sampled from multiple data sources, such as current sensors, voltage sensors, temperature sensors, and vibration sensors, etc. The sample data sampled may include current, voltage, temperature, fault information, and vibration parameters, etc. Each set of sample multi-source heterogeneous data carries a corresponding fault label, such as overload, fuse, high temperature circuit break, short circuit, contact wear, and poor contact.
[0054] For example, a current sensor, a voltage sensor, a temperature sensor, and a vibration sensor are installed on a circuit breaker at the same time. We perform data sampling every sampling period (for example, set to 10 minutes) to obtain a set of sample multi-source heterogeneous data, including recording the current value of the circuit breaker through the current sensor, recording the voltage value at both ends of the circuit breaker through the voltage sensor, recording the temperature around the circuit breaker through the temperature sensor, and recording the vibration amplitude of the circuit breaker through the vibration sensor. This is repeated for a total of I times, and I sets of sample multi-source heterogeneous data can be obtained.
[0055] Furthermore, each set of collected data can be preprocessed, including data cleaning, missing value processing and data smoothing, to ensure the quality and consistency of the data.
[0056] S102, in each group of sample multi-source heterogeneous data, extract the sample features of each sample data respectively, and perform feature fusion on the extracted multiple sample features to obtain corresponding I sample fusion features.
[0057] Among them, sample features refer to specific indicators or attributes extracted from multi-source heterogeneous data of each group of samples, which are used to describe the nature and changes of data. Feature fusion refers to the process of integrating sample features from different data sources.
[0058] For example, the average current value and peak current are extracted from the data of the current sensor; the maximum temperature and temperature change rate are extracted from the data of the temperature sensor; the vibration frequency and vibration amplitude are extracted from the data of the vibration sensor. Then, each feature can be combined into a feature vector by a simple splicing method, or a weighted fusion method can be used to assign different weights to different features and then merge them.
[0059] S103, randomly initialize and improve the current N hyperparameter combinations of the LightGBM model.
[0060] Among them, each hyperparameter combination refers to a set of parameters that need to be adjusted during training to improve LightGBM, including the maximum depth of the decision tree max_depth, learning rate learning_rate, number of leaf nodes num_leaves, etc. In each combination, the value of each hyperparameter is randomly selected within a pre-set range. For example, if N is set to 50, 50 different hyperparameter combinations are generated, each of which contains randomly selected parameters such as num_leaves, max_depth, and learning_rate.
[0061] In a specific embodiment, the current nth hyperparameter combination of the LightGBM model is randomly initialized and improved, which is expressed as:
[0062] X n =BK lb +rand(BK ub -BK lb )
[0063] In the above formula, X n is the nth hyperparameter combination, n is an integer between 1 and N; BK ub is the lower bound of the nth hyperparameter group in the jth dimension; BK lb is the upper bound of the nth hyperparameter group in the jth dimension; rand is a randomly selected value between [0,1].
[0064] For example, assume that an improved LightGBM model has three hyperparameters: learning rate, tree depth, and minimum number of samples for leaf nodes. Their upper and lower bounds can be set as follows:
[0065] Learning rate: lower bound 0.01, upper bound 0.1;
[0066] Depth of the tree: lower bound 3, upper bound 10;
[0067] The minimum number of samples for a leaf node is: lower bound 20, upper bound 100.
[0068] Through the random initialization of the above specific embodiment, the model can be allowed to explore the entire hyperparameter space, thereby avoiding falling into a local optimal solution.
[0069] S104, under the premise of setting the improved LightGBM model to different hyperparameter combinations, input each sample fusion feature in turn and obtain the output predicted fault, input the predicted fault and the corresponding fault label into the preset improved objective function to calculate the fitness, so as to obtain the fitness corresponding to the current N hyperparameter combinations.
[0070] Among them, the improved LightGBM model in this embodiment is expressed as:
[0071]
[0072] In the above formula, Indicates predicted failure; f k (x i ) represents the kth decision tree; x i represents the fusion feature of the i-th sample of the circuit breaker; F represents the tree model; K represents the total number of decision trees.
[0073] From this, the objective function can be constructed:
[0074]
[0075] In the above formula, φ(y i ,F t-1 (x i )+f t (x i )) represents the loss function; y i F represents the fault label of the fusion feature of the i-th sample; t-1 (x i ) represents the first t-1 tree models; f t (x i ) represents the t-th tree model; Ω(f k ) represents the regularization term; ω represents the leaf weight of each tree; γ and λ are hyperparameters; T represents the number of leaf nodes in the tree model.
[0076] In order to minimize the objective function, the LightGBM model uses Newton's method to find an improved objective function to approximate the objective function. The improved objective function is expressed as:
[0077]
[0078] In the above formula, is the fitness, which is used to measure the performance of a current hyperparameter combination in the improved LightGBM. In this embodiment, the smaller the fitness, the more suitable the combination is for the current task; i is the first-order derivative of the loss function F; h i is the second-order derivative of the loss function F;
[0079] Compared with the prior art, the loss function F in this embodiment includes a cross entropy loss function and a gradient harmonization mechanism function.
[0080] Among them, the cross entropy loss function is used to measure the difference between the predicted fault and the corresponding fault label. The smaller the difference, the more accurate the prediction.
[0081] The difficulty of fault differentiation of multi-source heterogeneous data of samples corresponding to the sample fusion features in the gradient reconciliation mechanism function is positively correlated with the weight of the sample fusion features, so that the improved LightGBM can better learn these complex samples and improve the recognition accuracy of complex samples to a certain extent. At the same time, the calculation ratio of the gradient reconciliation mechanism function compared to the cross entropy loss function increases with the increase of the current number of iterations, that is, as the number of training iterations increases, the role of the gradient reconciliation mechanism function gradually increases, so that the improved LightGBM further pays attention to those difficult-to-distinguish samples, thereby further improving the learning ability of complex data.
[0082] S105, determining the optimal hyperparameter combination among the current N hyperparameter combinations according to the size of the fitness, and updating the current N hyperparameter combinations using an optimization algorithm according to the optimal hyperparameter combination.
[0083] In this embodiment, we can use the hyperparameter combination with the smallest fitness as the optimal hyperparameter combination. Then we use optimization algorithms, such as particle swarm optimization (PSO) and genetic algorithm (GA), to adjust the current N hyperparameter combinations. The optimization algorithm explores better parameter configurations based on the optimal hyperparameter combination.
[0084] S106, determine whether the current number of iterations is less than the preset number of iterations threshold. If the current number of iterations is less than the preset number of iterations threshold, execute S107 to add 1 to the current number of iterations, and return to execute S104 and subsequent steps. If the current number of iterations is equal to the preset number of iterations threshold, execute S108, and set the improved LightGBM model based on the optimal hyperparameter combination among the current N hyperparameter combinations to obtain the target LightGBM model.
[0085] Exemplarily, assume that the iteration number threshold is set to 20 times. The current number of iterations is 19 times, and the steps in the optimization process are as follows: Because the current number of iterations (19 times) is less than the iteration number threshold (20 times). Therefore, execute S107, increase the current number of iterations to 20 times, and return to execute step S104, use the new hyperparameter combination to train the model, calculate the fitness, and update the hyperparameter combination. Then, because the current number of iterations (20 times) is equal to the iteration number threshold (20 times), the improved LightGBM model is set based on the optimal hyperparameter combination among the N hyperparameter combinations obtained in the 20th round of iterations to obtain the target LightGBM model.
[0086] The above method of training an improved LightGBM model based on an optimization algorithm obtains multiple groups of multi-source heterogeneous data from the circuit breaker, extracts and fuses features for each group of data, and forms sample fusion features. Under the multiple hyperparameter combinations initially set, the model sequentially inputs these sample fusion features, and uses the improved objective function to calculate the fitness to evaluate the effect of each combination. The loss function of the improved objective function combines the cross entropy loss function and the gradient reconciliation mechanism function, wherein the gradient reconciliation mechanism function adjusts the weight according to the difficulty of fault differentiation of the sample during the calculation process, so that the learning of difficult samples is more concentrated. In addition, as the number of iterations increases, the influence of the gradient reconciliation mechanism function gradually increases, further improving the model's learning ability for complex samples. Then, the optimization algorithm is used to iteratively determine the current optimal hyperparameter combination until the preset number of times is reached, thereby setting the optimized target LightGBM model. This method enhances the model's learning ability for complex and difficult-to-distinguish samples through an improved objective function, solving the shortcomings of the existing model in accuracy.
[0087] In a specific embodiment, the feature fusion of the extracted multiple sample features in S102 specifically includes any one of the following steps A1, A2 and A3.
[0088] A1. Assign different weights to the extracted multiple sample features and perform weighted averaging to obtain the corresponding sample fusion features.
[0089] Optionally, a weight is set for each sample feature according to the importance of the feature. For example, for the current, voltage and temperature features of a circuit breaker, the current may be considered more important for fault diagnosis, so a higher weight is given, while the temperature is relatively less important and a lower weight is given. Then all features are weighted averaged to obtain the corresponding sample fusion feature.
[0090] A2. Concatenate the extracted multiple sample features by column to obtain the corresponding sample fusion features.
[0091] This cross-combination can explore the nonlinear relationship between features, thereby improving the predictive ability of the model.
[0092] A3. Cross-combine the extracted multiple sample features to obtain corresponding sample fusion features.
[0093] Through the feature fusion of this specific embodiment, the influence of a single feature on the model can be alleviated, and the adaptability of the model to different fault modes can be improved.
[0094] In a specific embodiment, in S104, the predicted fault and the corresponding fault label are input into a preset improved objective function to calculate the fitness, which is expressed as:
[0095]
[0096] L GHM =L CE β i
[0097] In the above formula, is the fitness of the fusion feature of the i-th sample; f t (x i ) represents the t-th tree model; F is the loss value of the loss function; g i is the first-order derivative of the loss function; h i is the second-order derivative of the loss function; ∑ k Ω(f k ) represents the regularization term; is the proportional coefficient at the tth iteration. When t = 1, is the default value; L CE is the loss value of the cross entropy loss function; L GHM is the loss value of the gradient reconciliation mechanism function; is the fitness of the optimal hyperparameter combination at the t-1th iteration; y i is the fault label of the fusion feature of the i-th sample; is the predicted fault of the fusion feature of the i-th sample; β i The weight set for the fusion feature of the i-th sample. The greater the difficulty of fault differentiation of the multi-source heterogeneous data of the sample corresponding to the i-th sample fusion feature, the greater the difficulty of fault differentiation of the multi-source heterogeneous data of the sample, i The larger the setting.
[0098] It can be understood that in the above specific embodiment, because the difficulty of fault differentiation of sample multi-source heterogeneous data is greater, β i The larger the setting, the better LightGBM can learn these complex samples and improve the recognition accuracy of complex samples to a certain extent. It will continue to decrease during the iteration process, so It will increase accordingly, which makes the calculation ratio of the gradient reconciliation mechanism function compared to the cross entropy loss function increase with the increase of the current number of iterations. Therefore, the role of the gradient reconciliation mechanism function is gradually enhanced, which makes the improved LightGBM pay more attention to those difficult-to-distinguish samples, thereby further improving the learning ability of complex data.
[0099] In a specific embodiment, β can also be set by the following specific steps: i Size: Calculate the minimum distance between the sample multi-source heterogeneous data corresponding to the fusion feature of the i-th sample and the multi-source heterogeneous data of the remaining samples, and set β based on the minimum distance i size.
[0100] The method for calculating the distance between data can be selected according to the differences of different features. For example, Euclidean distance, Manhattan distance or other distance measurement methods suitable for data types can be selected. For the multi-source heterogeneous data of the sample corresponding to the i-th sample fusion feature, we can get a total of I-1 distances. By sorting these I-1 distances, we can get the minimum distance. Furthermore, in this specific embodiment, the minimum distance is set to β i The size of is negatively correlated, so β can be achieved by the following formula i Settings:
[0101]
[0102] In the above formula, mind i It represents the minimum distance of the sample multi-source heterogeneous data corresponding to the i-th sample fusion feature. η is a small preset positive number used to prevent the distance from being zero.
[0103] In another specific embodiment, β can also be set by the following specific steps: i Size: Calculate the noise ratio in the sample multi-source heterogeneous data corresponding to the i-th sample fusion feature, and set β based on the noise ratio i size.
[0104] The noise ratio can be determined by analyzing the outliers and fluctuations in the data or by using a noise detection algorithm. Specific methods include: Signal-to-Noise Ratio (SNR) analysis: For signal-type data, the noise ratio can be determined by calculating the ratio of the signal to the noise. Statistical analysis: Statistical characteristics (such as variance and skewness) are used to evaluate the degree of fluctuation of the data, thereby estimating the noise ratio. Furthermore, in this specific embodiment, the noise ratio is set to be proportional to β. i The size of is positively correlated, so β can be realized by the following formula i Settings:
[0105] β i =α×n i
[0106] In the above formula, n i It represents the noise proportion of the i-th sample, and α is a coefficient used to adjust the weight.
[0107] In a specific embodiment, in S105, updating the current N hyperparameter combinations using an optimization algorithm according to the optimal hyperparameter combination specifically includes the following steps:
[0108] B1. Calculate based on the size between the random number r and the constant p, expressed as:
[0109]
[0110] In the above formula, is the size of the nth hyperparameter combination in the jth dimension at the t+1th iteration; is the size of the nth hyperparameter combination in the jth dimension at the tth iteration; p is a preset constant; r is a random number between 0 and 1; t is the current iteration number; and T is the preset iteration number threshold.
[0111] B2. Calculate the fitness of different hyperparameter combinations, expressed as:
[0112]
[0113] is the size of the best hyperparameter combination in the jth dimension at the tth iteration so far; represents the fitness of the nth hyperparameter combination in the jth dimension in the tth iteration; represents the fitness of the hyperparameter combination in the tth iteration when the jth dimension is set to a random size; c(0,1) represents the Cauchy mutation.
[0114] B3. Comparison and The size of the room, if Use replace like Keep
[0115] in, Indicates that the improved LightGBM model is set to The adaptability of Indicates that the improved LightGBM model is set to That is, only at the t+1th iteration The parameters are updated only when the fitness of is less than the fitness of the optimal parameter combination of the tth iteration, otherwise it remains unchanged.
[0116] In one embodiment, Figure 2 As shown, the present invention also proposes a circuit breaker fault diagnosis method. The circuit breaker fault diagnosis method in this embodiment provides the following steps:
[0117] S201, obtaining real-time multi-source heterogeneous data of the circuit breaker.
[0118] S202, extracting real-time features of each real-time data in the real-time multi-source heterogeneous data, and fusing the extracted multiple real-time features to obtain corresponding real-time fused features.
[0119] In a specific embodiment, the above steps S201-S202 are basically the same as steps S101-S102 in the method for training an improved LightGBM model based on an optimization algorithm. The only difference is that real-time data is obtained from different data sources, and these real-time data do not need to be marked with fault labels.
[0120] S203, input the real-time fusion features into the target LightGBM model, and obtain the output predicted fault.
[0121] The target LightGBM model is trained by the above method of improving the LightGBM model based on optimization algorithm training. The model calculates according to the input features and outputs predicted faults. This result can be used for real-time monitoring and early warning to help operators find and deal with potential problems of circuit breakers in a timely manner.
[0122] Figure 3 FIG. 2 shows an internal structure diagram of a terminal device in an embodiment. Figure 3 As shown, the terminal device includes a processor, a memory and a network interface connected via a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the terminal device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement the above-mentioned method for improving the LightGBM model based on optimization algorithm training and the circuit breaker fault diagnosis method. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can execute the above-mentioned method for improving the LightGBM model based on optimization algorithm training and the circuit breaker fault diagnosis method. Those skilled in the art can understand that Figure 3 The structure shown in the figure is only a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the terminal device to which the scheme of the present application is applied. The specific terminal device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0123] A computer-readable storage medium stores a computer program, which implements the following steps when executed by a processor: obtaining I groups of sample multi-source heterogeneous data of a circuit breaker; wherein I>1, each group of sample multi-source heterogeneous data includes sample data sampled from multiple data sources, and each group of sample multi-source heterogeneous data carries a corresponding fault label; in each group of sample multi-source heterogeneous data, extracting sample features of each sample data respectively, and performing feature fusion on the extracted multiple sample features to obtain corresponding I sample fusion features; randomly initializing the current N hyperparameter combinations of an improved LightGBM model; on the premise of setting the improved LightGBM model to different hyperparameter combinations, inputting each sample fusion feature in turn and obtaining the output predicted fault, inputting the predicted fault and the corresponding fault label into a preset improved objective function to calculate the fitness, so as to obtain the fitness corresponding to the current N hyperparameter combinations; wherein the loss function in the improved objective function includes a cross entropy loss function and a gradient reconciliation mechanism function , the cross entropy loss function is used to measure the difference between the predicted fault and the corresponding fault label. The fault differentiation difficulty of the sample multi-source heterogeneous data corresponding to the sample fusion feature in the gradient reconciliation mechanism function is positively correlated with the weight of the sample fusion feature, and the calculation ratio of the gradient reconciliation mechanism function compared with the cross entropy loss function increases with the increase of the current number of iterations; the optimal hyperparameter combination among the current N hyperparameter combinations is determined according to the size of the fitness, and the current N hyperparameter combinations are updated using the optimization algorithm according to the optimal hyperparameter combination; if the current number of iterations is less than the preset iteration number threshold, the current number of iterations is set +1, and the execution is returned to the step of inputting each sample fusion feature in turn and obtaining the output predicted fault under the premise of setting the improved LightGBM model to different hyperparameter combinations and the subsequent steps, until the current number of iterations is equal to the preset iteration number threshold, the improved LightGBM model is set based on the optimal hyperparameter combination among the current N hyperparameter combinations to obtain the target LightGBM model.
[0124] And implement the following steps: obtain real-time multi-source heterogeneous data of the circuit breaker; extract the real-time features of each real-time data in the real-time multi-source heterogeneous data, and fuse the extracted multiple real-time features to obtain corresponding real-time fusion features; input the real-time fusion features into the target LightGBM model, and obtain the output predicted fault; wherein, the target LightGBM model is trained by the above-mentioned method of improving the LightGBM model based on optimization algorithm training.
[0125] A terminal device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: obtaining I groups of sample multi-source heterogeneous data of a circuit breaker; wherein I>1, each group of sample multi-source heterogeneous data includes sample data sampled from multiple data sources, and each group of sample multi-source heterogeneous data carries a corresponding fault label; in each group of sample multi-source heterogeneous data, extracting sample features of each sample data respectively, and performing feature fusion on the extracted multiple sample features to obtain corresponding I sample fusion features; randomly initializing the current N hyperparameter combinations of an improved LightGBM model; under the premise of setting the improved LightGBM model to different hyperparameter combinations, inputting each sample fusion feature in turn and obtaining the output predicted fault, inputting the predicted fault and the corresponding fault label into a preset improved objective function to calculate the fitness, so as to obtain the fitness corresponding to the current N hyperparameter combinations; wherein the loss function in the improved objective function includes a cross entropy loss function and a gradient loss function. The cross entropy loss function is used to measure the difference between the predicted fault and the corresponding fault label. The fault differentiation difficulty of the sample multi-source heterogeneous data corresponding to the sample fusion feature in the gradient reconciliation mechanism function is positively correlated with the weight of the sample fusion feature, and the calculation ratio of the gradient reconciliation mechanism function compared with the cross entropy loss function increases with the increase of the current number of iterations; the optimal hyperparameter combination among the current N hyperparameter combinations is determined according to the size of the fitness, and the current N hyperparameter combinations are updated using the optimization algorithm according to the optimal hyperparameter combination; if the current number of iterations is less than the preset iteration number threshold, the current number of iterations is set +1, and the execution is returned to the step of inputting each sample fusion feature in turn and obtaining the output predicted fault under the premise of setting the improved LightGBM model to different hyperparameter combinations and the subsequent steps until the current number of iterations is equal to the preset iteration number threshold, and the improved LightGBM model is set based on the optimal hyperparameter combination among the current N hyperparameter combinations to obtain the target LightGBM model.
[0126] And implement the following steps: obtain real-time multi-source heterogeneous data of the circuit breaker; extract the real-time features of each real-time data in the real-time multi-source heterogeneous data, and fuse the extracted multiple real-time features to obtain corresponding real-time fusion features; input the real-time fusion features into the target LightGBM model, and obtain the output predicted fault; wherein, the target LightGBM model is trained by the above-mentioned method of improving the LightGBM model based on optimization algorithm training.
[0127] It should be noted that the above-mentioned circuit breaker fault diagnosis method, model training method, medium and device belong to a general inventive concept, and the contents in the embodiments of the circuit breaker fault diagnosis method, model training method, medium and device are applicable to each other.
[0128] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0129] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0130] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for improving the LightGBM model based on optimization algorithm training, characterized in that: The method comprises: Obtain I groups of sample multi-source heterogeneous data of the circuit breaker; wherein I>1, each group of sample multi-source heterogeneous data includes sample data sampled from multiple data sources, and each group of sample multi-source heterogeneous data carries a corresponding fault label; In each group of sample multi-source heterogeneous data, sample features of each sample data are extracted respectively, and the extracted multiple sample features are fused to obtain corresponding I sample fusion features; Random initialization improves the current N hyperparameter combinations of the LightGBM model; On the premise of setting the improved LightGBM model to different hyperparameter combinations, input each sample fusion feature in turn and obtain the output predicted fault, input the predicted fault and the corresponding fault label into the preset improved objective function to calculate the fitness, so as to obtain the fitness corresponding to the current N hyperparameter combinations; wherein the loss function in the improved objective function includes a cross entropy loss function and a gradient reconciliation mechanism function, the cross entropy loss function is used to measure the difference between the predicted fault and the corresponding fault label, the fault differentiation difficulty of the sample multi-source heterogeneous data corresponding to the sample fusion feature in the gradient reconciliation mechanism function is positively correlated with the weight of the sample fusion feature, and the calculation ratio of the gradient reconciliation mechanism function compared to the cross entropy loss function increases with the increase of the current number of iterations; Determine the optimal hyperparameter combination among the current N hyperparameter combinations according to the size of the fitness, and update the current N hyperparameter combinations using an optimization algorithm according to the optimal hyperparameter combination; If the current number of iterations is less than the preset iteration number threshold, then the current number of iterations is set to +1, and the process returns to execute the steps and subsequent steps of inputting each sample fusion feature in turn and obtaining the output predicted fault under the premise of setting the improved LightGBM model to different hyperparameter combinations, until the current number of iterations is equal to the preset iteration number threshold, and then the improved LightGBM model is set based on the optimal hyperparameter combination among the current N hyperparameter combinations to obtain the target LightGBM model.
2. The method according to claim 1, characterized in that Random initialization improves the current nth hyperparameter combination of the LightGBM model, expressed as: X n =BK lb +rand(UK ub -BK lb ) In the above formula, X n is the nth hyperparameter combination, n is an integer between 1 and N; BK ub is the lower bound of the nth hyperparameter group in the jth dimension; BK lb is the upper bound of the nth hyperparameter group in the jth dimension; rand is a randomly selected value between [0,1].
3. The method according to claim 1, characterized in that The predicted fault and the corresponding fault label are input into the preset improved objective function to calculate the fitness, which is expressed as: L GHM =L CE b i In the above formula, is the fitness of the fusion feature of the i-th sample; f t (x i ) represents the t-th tree model; F is the loss value of the loss function; g i is the first-order derivative of the loss function; h i is the second-order derivative of the loss function; ∑ k Ω(f k ) represents the regularization term; is the proportional coefficient at the tth iteration. When t = 1, is the default value; L CE is the loss value of the cross entropy loss function; L GHM is the loss value of the gradient reconciliation mechanism function; is the fitness of the optimal hyperparameter combination at the t-1th iteration; y i is the fault label of the fusion feature of the i-th sample; is the predicted fault of the fusion feature of the i-th sample; β i The weight set for the fusion feature of the i-th sample. The greater the difficulty of fault differentiation of the multi-source heterogeneous data of the sample corresponding to the i-th sample fusion feature, the greater the i The larger the setting.
4. The method according to claim 3, characterized in that The method further comprises: Calculate the minimum distance between the sample multi-source heterogeneous data corresponding to the i-th sample fusion feature and the remaining sample multi-source heterogeneous data, and set β based on the minimum distance i The size of; Among them, the minimum distance and β i The size is negatively correlated.
5. The method according to claim 3, characterized in that: The method further comprises: Calculate the noise ratio in the sample multi-source heterogeneous data corresponding to the i-th sample fusion feature, and set β based on the noise ratio i The size of the noise ratio is i The size is positively correlated.
6. The method according to claim 1, characterized in that The updating of the current N hyperparameter combinations using an optimization algorithm according to the optimal hyperparameter combination includes: The calculation is based on the size between the random number r and the constant p, expressed as: In the above formula, is the size of the nth hyperparameter combination in the jth dimension at the t+1th iteration; is the size of the nth hyperparameter combination in the jth dimension at the tth iteration; p is a preset constant; r is a random number between 0 and 1; t is the current iteration number; T is the preset iteration number threshold; The fitness between different hyperparameter combinations is calculated and expressed as: is the size of the best hyperparameter combination in the jth dimension at the tth iteration so far; represents the fitness of the nth hyperparameter combination in the jth dimension in the tth iteration; represents the fitness of the hyperparameter combination in the tth iteration when the jth dimension is set to a random size; c(0,1) represents the Cauchy mutation; Compare and The size of the room, if Use replace like Keep in, Indicates that the improved LightGBM model is set to The adaptability of Indicates that the improved LightGBM model is set to Time adaptability.
7. The method according to claim 1, characterized in that The step of fusing the extracted multiple sample features includes: Assign different weights to the extracted multiple sample features and perform weighted averaging to obtain the corresponding sample fusion features; or, The extracted multiple sample features are spliced in columns to obtain corresponding sample fusion features; or the extracted multiple sample features are cross-combined to obtain corresponding sample fusion features.
8. A circuit breaker fault diagnosis method, characterized in that: The method comprises: Obtain real-time multi-source heterogeneous data of circuit breakers; Extracting real-time features of each real-time data in the real-time multi-source heterogeneous data, and fusing the extracted multiple real-time features to obtain corresponding real-time fused features; The real-time fusion feature is input into a target LightGBM model, and an output predicted fault is obtained; wherein the target LightGBM model is trained by the method described in any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 8.
10. A terminal device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Heating ventilation air conditioning system fault diagnosis method based on LightGBM algorithm and grid search algorithm
CN113378908A
Water chilling unit fault diagnosis method and system based on Bayesian optimization LightGBM, and medium
CN113792762A
Rolling bearing fault diagnosis method based on LightGBM feature extraction and BiLSTM
CN116701918A
Integrated path generating means for linking driving and walking paths and method thereof
KR1020240130247A
Cited By
Urban road network bridge multi-target maintenance decision optimization method considering preference of decision makers
CN122492184A