Power grid operation safety accident classification method based on LLAMA-RF fusion model
By combining the LLAMA model and the random forest algorithm, introducing the attention mechanism and unsupervised learning, an enhanced version of the forest algorithm model and a large model fusion model are established, which solves the limitations of the traditional power grid operation safety accident classification method and improves the types of power grid operation risk The prediction accuracy and classification accuracy adapt to the complexity and variability of the power grid system.
Patent Information
- Application Number
- CN202410602399.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-15
- Publication Date
- 2024-08-23
AI Technical Summary
Traditional power grid operation safety accident classification methods are difficult to adapt to the complexity and variability of power grid systems, and traditional machine learning methods cannot fully mine potential patterns in the data, resulting in poor model interpretability.
A fusion model based on the LLAMA model and the random forest algorithm is adopted, combining the local learning ability of the LLAMA model and the global integration ability of the random forest algorithm. By introducing the attention mechanism and unsupervised learning, an enhanced version of the forest algorithm model and a large model based on the large model and The fusion model of the forest algorithm optimizes feature extraction and loss functions to improve the model's decision-making ability and classification accuracy.
It improves the prediction accuracy and classification accuracy of power grid operation safety accidents, enhances the generalization ability and decision-making ability of the model, and can better handle the prediction of risk types in complex power grid systems.
Smart Images

Figure CN118535994A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power operation safety management, and in particular to a power grid operation safety accident classification method based on a LLAMA-RF fusion model. Background Art
[0002] Power operation safety risks refer to adverse events that may occur during the operation of the power system and lead to casualties, equipment damage, environmental pollution or economic losses. It is one of the major challenges facing the power industry.
[0003] The classification of power grid operation safety accidents is of great significance for ensuring personnel safety, protecting equipment and facilities, reducing economic losses and improving management efficiency. Only through scientific and effective classification and analysis methods can we better prevent and handle power grid operation safety accidents and ensure the safe and stable operation of the power grid system.
[0004] At present, traditional grid operation safety accident classification methods often rely on manually formulated rules and standards, and use expert experience to classify grid operation safety accidents. These rules may be based on industry standards or historical cases, but their limitations are that they are difficult to cover all situations and difficult to adapt to the complexity and variability of the grid system.
[0005] Machine learning methods attempt to learn patterns from historical data and use the learned patterns to classify power grid operation safety incidents. These methods include support vector machines (SVMs), decision trees, random forests, etc. However, traditional machine learning methods often require manual feature extraction and may not fully explore the potential patterns of the data.
[0006] In recent years, deep learning technology has made significant progress in image recognition, natural language processing and other fields. Some studies have tried to use deep learning models (such as convolutional neural networks, recurrent neural networks, etc.) to classify power grid operation safety accidents. These methods can automatically learn feature representations, but may require a large amount of data and computing resources, and have the problem of poor model interpretability.
[0007] Random Forest is an ensemble learning method, a type of supervised learning. It builds multiple decision trees to complete classification and regression tasks, and then makes predictions by voting (classification tasks) or taking the average (regression tasks). The core idea of Random Forest is to integrate multiple weak learners and improve the performance and generalization ability of the overall model through collective decision-making.
[0008] At present, many theoretical studies and practices related to the fusion of large language models and RF have been carried out at home and abroad. In 2023, [Neural Attention Forests: Transformer-Based Forest Improvement] combines RF and Transformer models together, introduces the attention mechanism into the random forest, and assigns the attention weights calculated by a specific form of neural network to the data in the leaf nodes of the decision tree and the random forest itself, and places it in the Nadaraya-Watson kernel regression framework. Compared with existing models (such as attention-based random forests), attention weights and Nadaraya-Watson regression are expressed in the form of neural networks with trainable parameters. The first part of the neural network with shared weights is used for training all trees and calculates the attention weights of the data in the leaf nodes. The second part aggregates the output of the tree network and aims to minimize the difference between the random forest prediction value and the true target value in the training set. The neural network is trained in an end-to-end manner. The combination of random forests and neural networks that implement the attention mechanism forms a transformer for enhancing forest predictions. References to decision trees (2023) [A risk prediction method for electric power customers' demands by text mining technology] also pay attention to the risk prediction method for electric power customers' demands based on decision trees. In this regard, it is necessary to intelligently analyze the needs of electric power customers, extract the main characteristic attributes in the demand, and establish a risk prediction model based on these characteristic data. However, text mining technology has powerful feature extraction capabilities and fast processing speed, which can meet the needs of power companies for efficient analysis of customer needs. Applying text mining technology to the risk prediction technology of electric power customer demand can effectively improve the prediction accuracy and has positive significance for the formulation of differentiated service management strategies. Decision trees can perform feature selection on text data based on indicators such as information gain or Gini coefficient. In text classification, features are usually words, phrases, or other text fragments. Decision trees can be divided according to the importance of these features, thereby constructing a classification model that can effectively distinguish different categories of text.
[0009] RF-Transformer-LSTM Model (2022) [A method of remaining useful life prediction of multi-source signals aero-engine based on RF-Transformer-LSTM*] A multi-source signal aero-engine remaining useful life (RUL) prediction method based on random forest (RF)-Transformer-long short-term memory (LSTM) is proposed to improve the prediction accuracy.
[0010] Therefore, if a fusion model can be proposed by combining the above methods and applied to the classification of power grid operation safety accidents, higher accuracy can be achieved. Summary of the invention
[0011] The purpose of the present invention is to study a new solution based on the LLAMA model and the random forest algorithm for the classification problem of power grid operation safety accidents. By combining the LLAMA model and the random forest algorithm, the local learning ability of the LLAMA model and the global integration ability of the random forest algorithm can be fully utilized, so as to better solve the classification problem of power grid operation safety accidents and improve the prediction accuracy of power grid operation risk types.
[0012] The LLAMA model is a local learning model that has the ability to adapt to the characteristics of each subtask and improve the generalization ability of the model. As an integrated learning method, the random forest algorithm improves the performance of the overall model by integrating the prediction results of multiple decision trees.
[0013] In order to achieve the above object, the present invention adopts the following technical scheme: a power grid operation safety accident classification method based on LLAMA-RF fusion model, comprising the following steps:
[0014] (1) Establish a database for predicting and classifying power operation safety risks;
[0015] (2) Establish an optimization model for extracting operational risk rating features;
[0016] (3) By introducing the attention mechanism, an enhanced forest algorithm model is established;
[0017] (4) Establish a fusion model based on large model and forest algorithm.
[0018] Furthermore, in step (1), the steps of constructing the database are as follows:
[0019] A1. Clarify the database requirements;
[0020] A2. Determine the data structure and select the appropriate database type;
[0021] A3. Design database schema;
[0022] A4. Create a database and table, and import existing data;
[0023] A5. Optimize database performance.
[0024] Furthermore, in step (2), the steps of establishing the model are as follows:
[0025] B1. Select a suitable data set, where the training set accounts for 60%, the validation set accounts for 20%, and the test set accounts for 20%;
[0026] B2. Use appropriate unsupervised learning models for feature extraction;
[0027] B3. Use the training set to train the model, and use the validation set to evaluate and adjust the model;
[0028] B4. Test the model using the test set.
[0029] Further, in step (3), the steps are as follows:
[0030] C1. Introduce attention mechanism and redefine aggregation function;
[0031] C2. Use the training set to train the model, and use the validation set to evaluate and adjust the model;
[0032] C3. Test the final model with the test set and deploy it to the production environment.
[0033] Further, in step (4), the steps are as follows:
[0034] D1. Select the large model and forest algorithm as the basis of the fusion model;
[0035] D2, perform feature extraction and model fusion;
[0036] D3. Use the training set to train and optimize the fusion model, and evaluate its performance through the test set;
[0037] D4. Deploy the trained fusion model to the production environment.
[0038] Furthermore, in step A2, the database is selected to select a relational database or a non-relational database.
[0039] Furthermore, the unsupervised learning model selects an autoencoder or a clustering model.
[0040] Compared with traditional technologies, the advantages of the present invention are: (1) It combines the LLAMA model and the random forest algorithm, making full use of the local learning ability of the LLAMA model and the global integration ability of the random forest algorithm, thereby better solving the problem of power grid operation safety accident classification and improving the prediction accuracy of power grid operation risk types.
[0041] (2) An optimization model for feature extraction of job risk rating was established. A text feature extraction model based on LLAMA was used for initial training using an unsupervised learning method, enabling the model to extract useful features and patterns from large-scale data.
[0042] (3) The attention mechanism was introduced and an enhanced forest algorithm model was established. The weighted nearest neighbor regression was re-expressed in a form suitable for this model and integrated with the random forest to optimize the loss function, thereby improving the decision-making ability and classification accuracy of the model.
[0043] (4) A fusion model based on the large model and the forest algorithm was established. On the basis of the feature vector obtained through pre-training, the enhanced forest algorithm completed the task of power operation safety risk prediction and classification with the support of the decision tree, further improving the classification accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 The present invention is a workflow diagram of a method for classifying power grid operation safety accidents based on the LLAMA-RF fusion model. DETAILED DESCRIPTION
[0045] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples consistent with some aspects of the present disclosure as detailed in the appended claims.
[0046] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. 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] A classification method for power grid operation safety accidents based on the LLAMA-RF fusion model, the steps are as follows:
[0048] (1) Establish a database for predicting and classifying power operation safety risks. First, determine the data structure and content that needs to be stored in the database, including the fields of the classification table and the historical library. The power grid field operation text can be divided into two categories according to the source: the classification table and the historical library. The content of the classification table mainly includes equipment voltage level, operation scope, operation content and risk level. Compared with the original typical production operation risk classification library, the classification table has the following two characteristics: First, the classification table is a summary of the classification library, unifying specific operations into general terms, such as "substation transformer on-site dismantling, replacement, and return to factory for overhaul" in the classification table is rewritten as "transformer Class A overhaul"; Second, the classification table expands and revises the content of the classification library. The classification table not only modifies and expands the on-site operation categories to six categories, increasing from 114 standards to 262, but also further subdivides the original risk level in voltage level. For example, in the classification library, the substation profession no longer distinguishes the risk level for on-site operations above 220kV, but in the classification table, 330, 500, 750, and 1000kV are refined. In the process of establishing a database, the database requirements must be clarified first, including determining the data structure, selecting the appropriate database type, such as relational database or non-relational database, and designing the database model. Next, create a database and table, import existing data, and finally optimize database performance to ensure efficient data management and query.
[0049] (2) Establish a feature extraction optimization model for job risk rating. A text feature extraction model based on LLAMA is established, including the initial training of the model using a large-scale dataset and an unsupervised learning method in the training phase. First, a suitable dataset is selected, with a training set accounting for 60%, a validation set accounting for 20%, and a test set accounting for 20%. The training data does not have manually labeled target outputs. This unsupervised learning process allows the model to extract useful features and patterns from large-scale data without manually labeled label information. Then, we select a suitable unsupervised learning model for feature extraction, such as an autoencoder or a clustering model. We train the model using the training set and use the validation set to evaluate and adjust the model. Finally, we test the model using the test set to ensure its performance and generalization ability.
[0050] (3) By introducing the attention mechanism, an enhanced forest algorithm model is established, including re-expressing the weighted nearest neighbor regression (N-Wregression) into a form adapted to this model and integrated with the random forest, scaling the review integral function, and optimizing the loss function. First, the attention mechanism is introduced and the aggregation function is redefined. Then, we train the model using the training set and evaluate and adjust the model using the validation set. Finally, we test the final model with the test set and deploy it to the production environment. In the introduction of the attention mechanism and the redefinition of the aggregation function, it is assumed that we have established a random forest consisting of T decision trees on the training set D. Each tree receives a feature vector x, and the path from x to the leaf node is represented by a red line. Some feature vectors xj and the corresponding output values yj fall into the same leaf node as j∈Jk(x). The first part of the neural network of the attention mechanism is represented by T networks with shared weights θ (network parameters). The attention weights defined by the review scaling integral function are calculated based on the tree and the example. Thus, we can obtain the keys Ak(x) and values Bk(x) of all trees, and get the global key value through the adjusted N-Wregression. Thus, we can get the aggregation of the model Mθ obtained from all trees through the redefined aggregation function.
[0051] (4) Establish a fusion model based on the big model and the forest algorithm to improve its decision-making ability and thus improve the accuracy of the classification of power grid operation safety risk factors, including regression tasks. In this step, we select the big model and the forest algorithm as the basis of the fusion model, and perform feature extraction and model fusion. Then, we use the training set to train and optimize the fusion model, and evaluate its performance through the test set. Finally, we deploy the trained fusion model into the production environment for power operation safety risk prediction and classification tasks. Through these detailed steps, we can establish a complete technical solution to improve the safety and management efficiency of power grid operations.
[0052] The embodiments of the present invention are not limited thereto, and any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention.
Claims
1. A power grid operation safety accident classification method based on LLAMA-RF fusion model, characterized in that: The following steps are involved: (1) Establish a database for predicting and classifying power operation safety risks; (2) Establish an optimization model for extracting operational risk rating features; (3) By introducing the attention mechanism, an enhanced forest algorithm model is established; (4) Establish a fusion model based on large model and forest algorithm.
2. According to claim 1, a power grid operation safety accident classification method based on LLAMA-RF fusion model is characterized in that: In step (1), the steps of constructing the database are as follows: A1. Clarify the database requirements; A2. Determine the data structure and select the appropriate database type; A3. Design database schema; A4. Create a database and table, and import existing data; A5. Optimize database performance.
3. According to claim 1, a method for classifying power grid operation safety accidents based on the LLAMA-RF fusion model is characterized in that: In step (2), the steps of establishing the model are as follows: B1. Select a suitable data set, where the training set accounts for 60%, the validation set accounts for 20%, and the test set accounts for 20%; B2. Use appropriate unsupervised learning models for feature extraction; B3. Use the training set to train the model, and use the validation set to evaluate and adjust the model; B4. Test the model using the test set.
4. According to claim 1, a method for classifying power grid operation safety accidents based on the LLAMA-RF fusion model is characterized in that: In step (3), the steps are as follows: C1. Introduce attention mechanism and redefine aggregation function; C2. Use the training set to train the model, and use the validation set to evaluate and adjust the model; C3. Test the final model with the test set and deploy it to the production environment.
5. According to claim 1, a method for classifying power grid operation safety accidents based on the LLAMA-RF fusion model is characterized in that: In step (4), the steps are as follows: D1. Select the large model and forest algorithm as the basis of the fusion model; D2, perform feature extraction and model fusion; D3. Use the training set to train and optimize the fusion model, and evaluate its performance through the test set; D4. Deploy the trained fusion model to the production environment.
6. A method for classifying power grid operation safety accidents based on the LLAMA-RF fusion model according to claim 2, characterized in that: In step A2, a database is selected by selecting a relational database or a non-relational database.
7. A method for classifying power grid operation safety accidents based on the LLAMA-RF fusion model according to claim 3, characterized in that: The unsupervised learning model selects an autoencoder or a clustering model.
Citation Information
Cited By
Chemical emergency hazard prediction method, device, equipment and medium
CN120951023A
