Pulse neural network and training method, program, medium and equipment thereof
By introducing the attention module and space-time backpropagation algorithm into the spiking neural network, the problem of poor performance and high training cost of large data volume and long time series prediction tasks in the existing technology is solved, and efficient and low-cost time series are achieved. Data processing and accurate forecasting.
Patent Information
- Application Number
- CN202410767307.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-08-30
AI Technical Summary
When existing technologies handle large amounts of data and long-time series prediction tasks, the performance of recurrent neural networks and LSTM models is poor and the complexity is high, resulting in high training costs. There is a lack of models that can efficiently process large-scale time series data and maintain low computing costs. network.
Using spiking neural network (SNN) and its training method, by initializing the model and constructing a training data set, using the attention module to weight the input, and using the space-time backpropagation algorithm to update the model parameters during the training process, combined with the STBP learning algorithm Train with low power consumption and low cost.
It achieves efficient processing of time series large sample size data under low-cost conditions, provides accurate prediction results, and improves network performance and efficiency through the attention mechanism, making the overall prediction results of the model equivalent to ANN, and the local results are better.
Smart Images

Figure CN118569322A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a pulse neural network and a training method, program, medium and device thereof. Background Art
[0002] As the cornerstone of deep learning, RNN (Recurrent Neural Network) and LSTM (Long Short-Term Memory) models are widely used in the field of time series prediction (such as oil temperature prediction of power transformers and gold trading price prediction). However, their performance may be poor when faced with large amounts of data and long time series prediction tasks. In contrast, Transformer, Informer, and DLinear models show significant advantages in processing large-scale data. Despite this, the complexity of these models is also relatively high, requiring a large amount of data for training, resulting in high training costs. Therefore, a network is needed that can not only efficiently process large sample sizes of time series data, but also provide accurate prediction results while maintaining low computational costs. Summary of the invention
[0003] In view of the deficiencies in the prior art, the present invention provides a pulse neural network and its training method, program, medium, and equipment, which solve the problem in the prior art of lacking a network that can efficiently process large sample sizes of time series data and perform low-cost training.
[0004] In a first aspect, according to an embodiment of the present invention, a training method for a pulse neural network is provided, wherein the pulse neural network is used to predict the oil temperature of the power transformer based on the load condition of the power transformer, and the construction method comprises: S1, obtaining an initial model of the pulse neural network, and initializing the parameters of the initial model, wherein the initial model comprises an attention module, and the attention module is used to weight the model input; S2, constructing a training data set, wherein the data set comprises the load condition of the power transformer at each specific time and the corresponding oil temperature value, wherein the load condition of the power transformer comprises a high useful load, a high useless load, a medium useful load, a medium useless load, a low useful load and a low useless load, and the oil temperature value is used as a label; S3, using the constructed training data set to train the initial model, and using a space-time back propagation algorithm to update the model parameters during the training process.
[0005] According to an embodiment of the present invention, a Softmax function is adopted in the attention module.
[0006] According to an embodiment of the present invention, the weighted model input is:
[0007] X weighted =A⊙X,
[0008] in,
[0009] A=[a1a2 … a N ],
[0010] X=[x1x2 … x N ],
[0011] Where A represents the weight matrix for all inputs, X represents the input matrix, and x i Represents any input, a i represents the weight for any input, and N represents the total number of inputs.
[0012] According to an embodiment of the present invention, the weight for any input is:
[0013]
[0014] in,
[0015] e i =ReLU(W e ·x i +b r )
[0016] Among them, e i and e j is the activation value of any input, W e is the weight matrix used for attention weight calculation, b e is the bias vector, and ReLU is the rectified linear unit function.
[0017] According to an embodiment of the present invention, the processing result of the weighted model input by the neurons in the initial model is:
[0018]
[0019] Among them, τ m is the membrane time constant of the neuron, V i is the membrane potential of the neuron, w ij represents the connection strength between neuron i and its input neuron j, K represents the total number of pulses generated by input neuron j, t represents the current time, represents the occurrence time of the kth pulse, X weighted,i represents any model input after weighting.
[0020] In a second aspect, according to an embodiment of the present invention, a pulse neural network is provided for predicting the oil temperature of a power transformer based on the load condition of the power transformer. The pulse neural network is obtained using the training method of a pulse neural network as described in the first aspect. The pulse neural network includes an attention module for weighting the model input.
[0021] In a third aspect, according to an embodiment of the present invention, there is provided an oil temperature prediction method for a power transformer, the oil temperature prediction method comprising: obtaining a current load condition of the power transformer, wherein the current load condition comprises a highly useful load, a highly useless load, a moderately useful load, a moderately useless load, a low useful load and a low useless load; and using a pulse neural network obtained by the model training method as described in the first aspect to predict the oil temperature value of the power transformer based on the current load condition of the power transformer.
[0022] In a fourth aspect, according to an embodiment of the present invention, a computer program product is provided, wherein the computer program product comprises a computer program code, and when the computer program code runs on an electronic device, the electronic device executes the method as described in the first aspect or the third aspect.
[0023] In a fifth aspect, according to an embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, and the computer program can be executed by a processor to implement the steps of the method described in the first aspect or the third aspect.
[0024] In the sixth aspect, according to an embodiment of the present invention, an electronic device is provided, comprising: one or more processors; and a memory, wherein the memory is used to store executable instructions; the one or more processors are configured to implement the steps of the method described in the first aspect or the third aspect by executing the executable instructions.
[0025] The technical principle of the present invention is: by adopting SNN (pulse neural network), the model training is made more cost-effective and low-power, and the model can better capture the temporal information of the data; and by further adopting the attention mechanism for the model input, the overall prediction results of the model are equivalent to ANN (artificial neural network), and the local results are better than ANN. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 Flow chart of a pulse neural network training method according to an embodiment of the present invention.
[0027] Figure 2 The graph is a graph showing the prediction performance of multiple network models according to an embodiment of the present invention for a power transformer data set.
[0028] Figure 3This is a curve chart of the prediction performance of the pulse neural network according to an embodiment of the present invention for a gold price fluctuation data set. DETAILED DESCRIPTION
[0029] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0030] As described in the background technology, for large data volumes and long time series prediction tasks, existing ANN networks either have poor performance or complex structures. Therefore, a network is needed that can efficiently process large sample volumes of time series data and provide accurate prediction results while maintaining a low computational cost.
[0031] In response to the above problems, researchers found that in time series prediction tasks, compared with traditional ANNs, deep spiking neural networks are more capable of learning the temporal information of data. In detail, in order to train deeper spiking neural networks, researchers proposed the STBP (Spatio-temporal backpropagation) learning algorithm, which converts the Leaky Integrate-and-Fire (LIF) model into an explicit iterative form, uses an approximate method instead of the gradient function to estimate the gradient required for synaptic weight updates, and solves the problem of SNN non-differentiability. In the spatial dimension, similar to DNN (deep neural network), it propagates layer by layer in SD (spatial domain). In the time dimension, each neuron generates a non-volatile integral through self-feedback. In this way, information in both the time and space fields is acquired and analyzed, which has greater advantages than BP (back propagation) that only considers spatial information and STDP (Spike-Timing-Dependent Plasticity) that only considers time information.
[0032] Based on the above research results, the inventors of the present application found that even if the above STBP learning algorithm is used for model training, the prediction performance of the spiking neural network model obtained for the field of time series prediction is poor compared with the traditional ANN. Figure 1As shown, for the oil temperature prediction problem of power transformers, an embodiment of the present invention proposes a training method for a pulse neural network, wherein the pulse neural network is used to predict the oil temperature of the power transformer based on the load condition of the power transformer, and the construction method includes: S1, obtaining the initial model of the pulse neural network, and initializing the parameters of the initial model, wherein the initial model includes an attention module, and the attention module is used to weight the model input; S2, constructing a training data set, wherein the data set includes the load condition of the power transformer at each specific time and the corresponding oil temperature value, wherein the load condition of the power transformer includes high useful load, high useless load, medium useful load, medium useless load, low useful load and low useless load, and the oil temperature value is used as a label; S3, using the constructed training data set to train the initial model, and using the space-time back propagation algorithm to update the model parameters during the training process. Due to the low power consumption and low cost of SNN training itself, the resulting SNN is more efficient and economical than ANN. In addition, the introduction of the attention mechanism in the input layer of SNN can help the network focus on a specific part when processing the input, thereby improving the performance and efficiency of the network.
[0033] The attention mechanism is used to calculate the attention weight of each input to determine the importance of the input. The attention mechanism includes a multi-head attention mechanism. According to an embodiment of the present invention, the attention module can use a Softmax function to obtain the attention weight based on the original model input and the weighted model input. The weighted model input is expressed as
[0034] X weighted =A⊙X,
[0035] Among them, ⊙ represents element-by-element multiplication,
[0036] A=[a1 a2 … a N ],
[0037] X=[x1 x2 … x N ],
[0038] Where A represents the weight matrix for all inputs, X represents the input matrix, and x i Represents any input, a i represents the weight for any input, and N represents the total number of inputs. The weight for any input is:
[0039]
[0040] in,
[0041] e i =ReLU(W e·x i +b e )
[0042] Among them, e i and e j is the activation value of any input, W e is the weight matrix used for attention weight calculation, b e is the bias vector, and ReLU is the rectified linear unit function.
[0043] In addition, according to an embodiment of the present invention, the weighted input is passed to the SNN neuron for processing. In the SNN, neurons represent the activation state by generating pulses. A model similar to LIF can be used to describe the response of neurons. The result of the weighted model input being processed by the neurons in the initial model is:
[0044]
[0045] Among them, τ m is the membrane time constant of the neuron, V i is the membrane potential of the neuron, w ij represents the connection strength between neuron i and its input neuron j, K represents the total number of pulses generated by input neuron j, t represents the current time, represents the occurrence time of the kth pulse, X weighted,i represents any model input after weighting.
[0046] According to the embodiment of the present invention, the present invention selects five models, namely RNN, LSTM, Transformer, Informer and DLinear, as comparison models, and the SNN_Attention model (the present invention model) is a hybrid model. The following are the configuration details of the desktop computer used in the experiment, as well as relevant information about the experimental environment: Intel Core i9-10900K CPU, 32GB RAM, Windows 10 64-bit, GeForce RTX TM 4090 GPU.
[0047] In addition, the training dataset selected the power transformer dataset (ETDataset) in the time series dataset of the industrial field. ETDataset is a dataset designed for studying time series problems, especially for in-depth analysis in the field of power systems. The purpose of constructing this dataset is to assist the prediction analysis of the oil temperature of power transformers and to study the performance of power transformers under extreme load conditions. The dataset is stored in a common csv format for easy access and processing by researchers. The entire dataset contains eight columns, namely "date" (The recorded date), "HUFL" (High UseFul Load), "HULL" (HighUseLess Load), "MUFL" (Middle UseFul Load), "MULL" (Middle UseLessLoad), "LUFL" (Low UseFul Load), "LULL" (Low UseLess Load) and "OT" (Oil Temperature). Among them, the "OT" column represents the oil temperature data to be predicted, while the other columns contain various factors that may affect the oil temperature. The characteristic of the ETDataset dataset is that it integrates multiple time series patterns. It covers short-term patterns, long-term patterns, long-term trends, and many irregular patterns. These rich patterns provide researchers with a comprehensive testing platform that can be used to evaluate and compare different time series analysis and prediction models. By using this dataset, researchers can better understand the changing laws of power transformer oil temperature and train more accurate prediction tools to optimize the operation and maintenance of power systems.
[0048] After training different models on the above datasets, hyperparameter optimization and comprehensive comparative experiments, the experiment achieved prediction results for the ETDatset dataset. Figure 2As shown, the main comparison shows the performance of SNN_Attention (model of the present invention) and several commonly used time series models such as LSTM, RNN, Transformer and DLinear in understanding time series data. From the overall distribution point of view, the models are almost the same, and all show a certain prediction ability. A careful observation shows that the SNN_Attention model shows a more accurate trend in the prediction values at certain time points. This may be because its unique attention mechanism can more effectively capture the key features in the time series data, thereby achieving better prediction results in specific cases. Therefore, although the prediction results of the ETDatset data set show that the performance of each model is almost the same, the SNN_Attention model shows certain advantages in the accurate prediction of certain key points.
[0049] According to another embodiment of the present invention, the training data set selects a gold price fluctuation data set in the financial field. The gold price fluctuation data set is specially selected to verify trend prediction research. This data set is stored in csv format, which is convenient for researchers to perform convenient data processing and analysis. The data set structure includes nine columns of data such as "date" (trading date), "open" (opening price), and "close" (closing price). In the gold price data set, the "pre_close (pre-closing price)" column is set as the target column, that is, the variable that needs to be predicted. Researchers can use this data set to explore and build models to more accurately predict the future trend of gold prices. Through in-depth analysis of these data, we can better understand the dynamic changes in the gold market, which can provide reference for investors and the market.
[0050] After hyperparameter optimization, the experiment obtained the prediction results of the model of the embodiment of the present invention for the gold price fluctuation data set. Figure 3 As shown, it can be seen that, in general, the predicted value and the actual value of the gold price are very close.
[0051] According to another embodiment of the present invention, a pulse neural network is provided for predicting the oil temperature of a power transformer based on the load condition of the power transformer. The pulse neural network is obtained using the training method of the pulse neural network as described above. The pulse neural network includes an attention module for weighting the model input.
[0052] According to another embodiment of the present invention, there is provided an oil temperature prediction method for a power transformer, the oil temperature prediction method comprising: obtaining a current load condition of the power transformer, wherein the current load condition comprises a highly useful load, a highly useless load, a moderately useful load, a moderately useless load, a low useful load and a low useless load; and using a pulse neural network obtained by the model training method as described in the first aspect to predict the oil temperature value of the power transformer based on the current load condition.
[0053] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, a person skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.
Claims
1. A method for training a pulse neural network, wherein the pulse neural network is used to predict the oil temperature of a power transformer based on the load condition of the power transformer, characterized in that: The construction method comprises: S1. Obtaining an initial model of the pulse neural network and initializing parameters of the initial model, wherein the initial model includes an attention module, and the attention module is used to weight the model input; S2. Construct a training data set, wherein the data set includes the load conditions of the power transformer at each specific time and the corresponding oil temperature value, wherein the load conditions of the power transformer include high useful load, high useless load, medium useful load, medium useless load, low useful load and low useless load, and the oil temperature value is used as a label; S3. Use the constructed training data set to train the initial model, and use the space-time back propagation algorithm to update the model parameters during the training process.
2. A pulse neural network training method as claimed in claim 1, characterized in that: The Softmax function is adopted in the attention module.
3. A pulse neural network training method as claimed in claim 2, characterized in that: The weighted model input is: X weighted =A⊙X, in, A=[a1a2…a N ], X=[x1x2…x N ], Where A represents the weight matrix for all inputs, X represents the input matrix, and x i Represents any input, a i represents the weight for any input, and N represents the total number of inputs.
4. A pulse neural network training method as claimed in claim 3, characterized in that: The weight for any input is: in, have been i =ReLU(W e x i +b r ) Among them, e i and e j is the activation value of any input, W e is the weight matrix used for attention weight calculation, b e is the bias vector, and ReLU is the rectified linear unit function.
5. A pulse neural network training method as claimed in claim 3, characterized in that: The result of processing the weighted model input by the neurons in the initial model is: Among them, τ m is the membrane time constant of the neuron, V i is the membrane potential of the neuron, w ij represents the connection strength between neuron i and its input neuron j, K represents the total number of pulses generated by input neuron j, t represents the current time, represents the occurrence time of the kth pulse, X weighted,i represents any model input after weighting.
6. A pulse neural network for predicting the oil temperature of a power transformer based on the load condition of the power transformer, characterized in that: The pulse neural network is obtained by using a pulse neural network training method as described in any one of claims 1-5, and the pulse neural network includes an attention module for weighting model input.
7. A method for predicting oil temperature of a power transformer, characterized in that: The oil temperature prediction method comprises: Obtaining a current load condition of the power transformer, wherein the current load condition includes a high useful load, a high useless load, a medium useful load, a medium useless load, a low useful load, and a low useless load; The pulse neural network obtained by the model training method as described in any one of claims 1-5 predicts the oil temperature value of the power transformer based on the current load condition.
8. A computer program product, characterized in that The computer program product comprises a computer program code, and when the computer program code is run on an electronic device, the electronic device executes the method as claimed in any one of claims 1-5 and 7.
9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program can be executed by a processor to implement the steps of the method in any one of claims 1-5 and 7.
10. An electronic device, characterized in that: include: one or more processors; as well as A memory, wherein the memory is used to store executable instructions; The one or more processors are configured to implement the steps of the method of any one of claims 1-5 and 7 by executing the executable instructions.
