Current transformer error prediction method and system based on S transformation and two-dimensional convolution
Through the current transformer error prediction method based on S transform and two-dimensional convolutional neural network, the information dimension limitation and feature extraction difficulties of error monitoring and prediction in the prior art are solved, and error prediction with high accuracy and adaptability is achieved, reducing the risk of current transformer over-difference.
Patent Information
- Application Number
- CN202411607864.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-02-28
Smart Images

Figure CN119537914A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of state evaluation and online monitoring of power transmission and distribution equipment, and in particular to a current transformer error prediction method and system based on S transformation and two-dimensional convolution. Background Art
[0002] With the mature application of current transformer technology, its core position in the field of power system measurement and protection has been widely recognized. Electromagnetic current transformers maintain an irreplaceable position in many application scenarios due to their simple structure, low cost, and easy maintenance. However, with the increase in operating years, current transformers will be affected by the operating environment, causing their error characteristics to shift. Through online monitoring technology, current transformers with abnormal errors can be detected in time to avoid their impact on electric energy metering. Therefore, the online monitoring technology of current transformer errors has become a hot spot and difficulty in the development of current transformer operation management technology.
[0003] In terms of online verification systems, the prior art proposes a fully digital online verification system for high-voltage current transformers. The system consists of three parts: a standard channel, a measured channel, and a verification platform. It uses a clamp-shaped hollow coil to collect data and calculates errors through amplification, conversion, and FFT algorithms. In terms of error detection, the prior art proposes an online detection method for transformer measurement errors based on a BP neural network. This method realizes online verification of current transformers by inputting the equivalent impedance of the secondary side of the transformer and outputting the error of the transformer.
[0004] The existing technology has the following shortcomings: 1. One-dimensional signals have some shortcomings compared to two-dimensional signals: ① Information dimension limitation: One-dimensional signals can only provide single-dimensional information in time series and cannot show the distribution characteristics of signals in space or other dimensions. ② Feature extraction limitation: One-dimensional signals may find it difficult to capture all the characteristics of the signal, especially when the signal has complex patterns in space or time. ③ Data interpretability: One-dimensional signals may not be as intuitive as two-dimensional signals in visual interpretation, and the latter can more clearly show the distribution and changes of signals. ④ Deep learning application: Although one-dimensional convolutional neural networks (1D CNN) perform well in processing signals, they may not be as effective as two-dimensional convolutional neural networks (2D CNN) when processing multi-dimensional or multi-channel signals. ⑤ Noise sensitivity: One-dimensional signals may be more sensitive to noise and require specific filtering algorithms to remove noise while retaining the edge and detail features of the signal.
[0005] 2. In order to ensure the safe and stable operation of the power system, the periodic inspection of current transformers faces problems such as power outages and untimely detection. In addition, due to the large number and wide distribution of current transformers in operation in the power grid, the periodic inspection of current transformers has problems such as large workload, low efficiency, and untimely detection of errors, which greatly affects the fairness of power market transactions.
[0006] 3. Traditional current transformer error prediction methods may have disadvantages such as strong dependence on feature extraction, limited generalization ability, high computational cost, poor scalability, insufficient real-time performance and poor model interpretability.
[0007] The present invention is based on a data-driven pre-evaluation method and designs a current transformer error prediction model based on S transform and two-dimensional convolutional neural network. This method utilizes the time-frequency analysis characteristics of S transform and the deep learning ability of two-dimensional convolutional neural network, providing a novel and effective way for current transformer error prediction. By automatically extracting the features of the signal and utilizing the learning ability of the neural network, this method not only improves the accuracy of the prediction, but also enhances the adaptability of the model to new situations. At the same time, the high efficiency and easy scalability of this method make it more advantageous when processing large-scale data sets and complex tasks.
[0008] This model first performs an S-transform on the collected data to output a two-dimensional matrix; then the two-dimensional matrix is transmitted to a two-dimensional convolutional neural network to predict the error of the current transformer. Compared with the existing technology, the present invention trains the time-frequency characteristics of the data through a two-dimensional convolutional neural network to finally obtain the prediction result. Summary of the invention
[0009] In view of the above-mentioned existing problems, the purpose of the present invention is to further promote the type evaluation and error verification of power transformers, which can effectively improve the pertinence of on-site inspection of current transformers and reduce the risk of out-of-tolerance operation of current transformers through error prediction.
[0010] In order to solve the above technical problems, a current transformer error prediction method based on S transform and two-dimensional convolution is proposed, including:
[0011] Collect the original signal data, process the original data through S transform, and obtain the complex matrix; take the modulus of each element in each complex matrix; build a two-dimensional convolutional neural network training model, modify and optimize the neural network prediction model; obtain the prediction results of ratio difference and angle difference.
[0012] As a preferred solution of the current transformer error prediction method based on S transform and two-dimensional convolution described in the present invention, the original signal data includes packaging the original signal data into data samples, each sample data contains secondary side current data sampled in time sequence and corresponding ratio difference and angle difference data.
[0013] As a preferred solution of the current transformer error prediction method based on S transform and two-dimensional convolution described in the present invention, wherein: the S transform includes the wavelet transform derivation of the continuous signal, and the continuous wavelet transform of a continuous signal y(t) can be expressed as W(τ, d):
[0014]
[0015] Among them, d is the expansion coefficient, τ is the time shift parameter, and ω(τ-t,d) is the expansion time shift transformation formula of the mother wavelet;
[0016] Take the transformation kernel for W(τ,d):
[0017]
[0018] Where, f is the frequency;
[0019] Multiply the continuous wavelet transform by an appropriate phase correction factor to obtain the corrected result:
[0020] S(τ,f)=e j2πft W(τ,d)
[0021] Among them, e j2πft is the phase correction factor;
[0022] Combining the continuous wavelet transform and the correction results, we can get the S transform expression of y(t):
[0023]
[0024]
[0025] Among them, ω(τ-t,f) is the Gaussian window function, and τ is the time shift factor.
[0026] As a preferred solution of the current transformer error prediction method based on S transform and two-dimensional convolution described in the present invention, wherein: the S transform also includes the Fourier transform derivation of the discrete signal. If the discrete signal is represented by y(kT)(k∈[0,N-1]), the discrete Fourier transform of the function y(kT) can be represented by Y(n / NT):
[0027]
[0028]
[0029] Among them, a two-dimensional complex matrix is obtained through S transform, that is, the frequency components of the traveling wave signal and the changes of each frequency component over time; α represents the scaling parameter of the S transform, which is used to control the width of the window function; T represents the total time length of the signal, N represents the number of sampling points of the signal, n represents the index of the time point, which is used for the sampling of discrete signals; m represents the index of the frequency point, which is used for the frequency components of discrete signals; k represents the frequency, y represents the sampling value of the signal, and Y represents the result of the signal transformation.
[0030] As a preferred solution of the current transformer error prediction method based on S transform and two-dimensional convolution described in the present invention, wherein: the two-dimensional convolutional neural network training model includes an input layer, a convolution layer, an activation layer and a pooling layer; during training, the ratio of the training set to the test set is set to 8:2, and the input of the input layer is a two-dimensional complex matrix obtained by S transform;
[0031] Two layers of convolution are used. The convolution kernel size of the first convolution layer is 3, and the number of convolution kernels is 8; the convolution kernel size of the second convolution layer is 3, and the number of convolution kernels is 16;
[0032] Add activation layers after each convolutional layer by using linear rectification function;
[0033] The amount of data is reduced by outputting the maximum value. The sampling factor of the pooling layer is set to 2, and the step size is set to 2.
[0034] The number of neurons in the fully connected layer is set to 50, and the output layer performs regression output. After the neural network is built, the requirements for network training include the maximum number of training cycles, batch size, learning rate, and verification frequency.
[0035] As a preferred solution of the current transformer error prediction method based on S transform and two-dimensional convolution described in the present invention, wherein: the modification and optimization of the neural network prediction model includes training the two-dimensional convolutional neural network through experiments to verify the effect of the neural network on the error prediction of the transformer monitoring data, and according to the loss function, the mean absolute error, mean square error, and root mean square error are output simultaneously to evaluate the model;
[0036] The model is trained using a two-dimensional convolutional neural network to obtain the mean absolute error, mean square error, and root mean square error results. When the training results show that the designed model has a poor prediction effect on the data set, the network needs to be modified and optimized as follows:
[0037] Modification 1: By increasing the convolution kernel to capture features in a larger range, the convolution kernel is changed from 3 to 5;
[0038] Modification 2: Add another layer of convolution and dropout layer on the basis of the original two layers of convolution. Dropout layer is a regularization layer in the neural network, which is used to randomly discard some neurons during the training process to reduce overfitting and improve the generalization ability of the model.
[0039] Modification three, add a normalization layer to the two-dimensional convolutional neural network.
[0040] As a preferred scheme of the current transformer error prediction method based on S transform and two-dimensional convolution described in the present invention, the prediction result includes comparing the mean absolute error, mean square error and root mean square error of the ratio difference and angle difference results obtained by the two-dimensional convolutional neural network training model to obtain the final prediction result.
[0041] Another object of the present invention is to provide a current transformer error prediction system based on S transform and two-dimensional convolution, which solves the technical problems of current transformer error prediction, including improving prediction accuracy, improving signal processing and feature extraction efficiency, meeting real-time monitoring and early warning requirements, reducing manual intervention and improving automation level, and enhancing the generalization ability of the model. By using S transform for time-frequency analysis and combining two-dimensional convolutional neural network to efficiently learn signal features, the system can accurately predict the ratio difference and angle difference of the current transformer in real time, ensuring that the power system can maintain good prediction performance even in the case of unknown data, thereby ensuring the safe and stable operation of the power system.
[0042] As a preferred solution of the current transformer error prediction system based on S transform and two-dimensional convolution described in the present invention, it is characterized by comprising a data processing module, an S transform module, a feature extraction module, a two-dimensional convolutional neural network training model module, a model optimization module and a prediction result output module;
[0043] The data processing module includes an original signal acquisition unit and a data packaging unit. The original signal acquisition unit monitors the output of the current transformer in real time. The data packaging unit packages the data and the time tag, the ratio difference and the angle difference data into a data sample according to a set sampling rate.
[0044] The S transform module receives the data samples output by the data preprocessing module, performs time-frequency analysis on the signal through S transform, extracts the time-varying characteristics of the frequency components of the signal, and outputs a complex matrix;
[0045] The feature extraction module receives the complex matrix output by the S transform module, performs a modulus operation on each element of the complex matrix, obtains amplitude information, and outputs a feature matrix to provide input for subsequent neural network processing;
[0046] The two-dimensional convolutional neural network training module predicts the error of the current transformer by using the feature learning and pattern recognition capabilities of the convolutional neural network. The input layer receives the feature matrix, and after multi-layer convolution, activation, and pooling operations, the fully connected layer integrates the features, and finally the output layer outputs the prediction result.
[0047] The model optimization module, during the training process, uses a loss function to calculate the difference between the predicted value and the actual value, evaluates the model performance according to the evaluation indicators of mean absolute error, mean square error, and root mean square error output by the loss function, optimizes the network structure according to the evaluation results, and adjusts the network parameters and structure;
[0048] The prediction result output module receives the prediction result after model optimization, compares the prediction result with the actual value, calculates the error index, outputs the ratio difference and angle difference predicted by the model, and evaluates the accuracy of the prediction.
[0049] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and is characterized in that when the processor executes the computer program, the steps of the current transformer error prediction method based on S transform and two-dimensional convolution are implemented.
[0050] A computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps of the current transformer error prediction method based on S transform and two-dimensional convolution are implemented.
[0051] Beneficial effects of the present invention: With the development of the electric power industry, higher requirements are placed on the accuracy and stability of current transformers. However, due to the limitations of power outage costs and traditional technologies, it is difficult to carry out effective current transformer error verification. Therefore, the present invention proposes a current transformer error prediction model based on S transform and two-dimensional convolutional neural network. First, an S transform is performed on the collected data, and the one-dimensional data is converted to two dimensions through the S transform, and analyzed in the two dimensions of time and frequency. The time-frequency characteristics of the data are trained through a two-dimensional convolutional neural network, and finally the prediction results are obtained.
[0052] The network model described in the present invention can well adapt to the prediction of the error state of the operating current transformer, which is helpful to grasp the error characteristics of the current transformer under operating conditions. The proposed current transformer operation error evaluation model is convenient for error monitoring and prediction in actual engineering, which helps to reduce the risk of out-of-tolerance of the operating current transformer.
[0053] The S transform has the characteristics of lossless, reversible and one-to-one time-frequency localization. It can decompose the signal into a superposition of a series of signals at the required frequency points, better characterize the time-frequency characteristics of a certain frequency point of the fault transient signal, and comprehensively consider and highlight the characteristic differences between the attenuated DC component and each harmonic component of the zero-sequence current. It is a processing method that can effectively analyze non-stationary signals and extract transient mutations and weak features.
[0054] The current transformer error prediction method based on S transform and two-dimensional convolutional neural network achieves efficient prediction of the current transformer error state by combining the time-frequency analysis capability of S transform and the automatic feature extraction capability of two-dimensional convolutional neural network. This method can not only automatically learn the deep features of the signal, but also improve the efficiency of the model by sharing parameters and reducing computational costs. At the same time, its translation invariance enhances the model's generalization ability to signal changes, and converting the signal into a two-dimensional time-frequency image may reveal new patterns and structural features in the data, thereby improving the accuracy of the prediction. In addition, this method has good scalability and can adapt to tasks of different complexity by increasing the number of network layers and parameters. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work, among which:
[0056] Figure 1 An overall flow chart of a current transformer error prediction method based on S transform and two-dimensional convolution provided for one embodiment of the present invention.
[0057] Figure 2 A visual display of a piece of original data of a current transformer error prediction method based on S transform and two-dimensional convolution provided by an embodiment of the present invention.
[0058] Figure 3 A time-frequency matrix obtained by S transforming a certain piece of data in a current transformer error prediction method based on S transform and two-dimensional convolution provided by an embodiment of the present invention.
[0059] Figure 4 A ratio-difference model training diagram of a current transformer error prediction method based on S-transformation and two-dimensional convolution provided in one embodiment of the present invention.
[0060] Figure 5 An angular difference model training diagram of a current transformer error prediction method based on S transform and two-dimensional convolution provided by an embodiment of the present invention.
[0061] Figure 6 A module schematic diagram of a current transformer error prediction system based on S-transform and two-dimensional convolution provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0062] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0063] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0064] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor is it an embodiment that is mutually exclusive with other embodiments, either individually or selectively.
[0065] The present invention is described in detail with reference to schematic diagrams. When describing the embodiments of the present invention, for the sake of convenience, the cross-sectional diagrams showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.
[0066] At the same time, in the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "upper, lower, inner and outer" are based on the directions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention. In addition, the terms "first, second or third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0067] In the present invention, unless otherwise clearly specified and limited, the terms "install, connect, connect" should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection or an integral connection; it can also be a mechanical connection, an electrical connection or a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0068] Example 1, reference Figure 1-Figure 3 , which is the first embodiment of the present invention, provides a current transformer error prediction method based on S transform and two-dimensional convolution, comprising:
[0069] S1: Collect the original signal data, process the original data through S transformation, and obtain a complex matrix.
[0070] Specifically, the original signal data is packaged into data samples, each sample data including secondary side current data sampled in time sequence and corresponding ratio difference and angle difference data.
[0071] Furthermore, the continuous signal is subjected to wavelet transform derivation. The continuous wavelet transform of a continuous signal y(t) can be expressed as W(τ,d):
[0072]
[0073] Among them, d is the expansion coefficient, τ is the time shift parameter, and ω(τ-t,d) is the expansion time shift transformation formula of the mother wavelet;
[0074] Take the transformation kernel for W(τ,d):
[0075]
[0076] Where, f is the frequency;
[0077] Multiply the continuous wavelet transform by an appropriate phase correction factor to obtain the corrected result:
[0078] S(τ,f)=e j2πft W(τ,d)
[0079] Among them, e j2πft is the phase correction factor;
[0080] Combining the continuous wavelet transform and the correction results, we can get the S transform expression of y(t):
[0081]
[0082]
[0083] Among them, ω(τ-t,f) is the Gaussian window function, and τ is the time shift factor.
[0084] The Fourier transform of the discrete signal is derived. If the discrete signal is represented by y(kT) (k∈[0,N-1]), the discrete Fourier transform of the function y(kT) can be expressed as Y(n / NT):
[0085]
[0086]
[0087] Among them, the two-dimensional complex matrix is obtained by S transformation, that is, the frequency components of the traveling wave signal and the changes of each frequency component over time. α represents the scaling parameter of S transformation, which is used to control the width of the window function. T represents the total time length of the signal. N represents the number of sampling points of the signal. n represents the index of the time point, which is used for the sampling of discrete signals. m represents the index of the frequency point, which is used for the frequency components of discrete signals. k represents the frequency. y represents the sampling value of the signal. Y represents the result of the transformation of the signal.
[0088] Obviously, the result of S transform is a two-dimensional complex matrix. The row vector of the complex matrix reflects the change of the amplitude and phase of the signal at a certain frequency component over time, while the column vector reflects the change of the amplitude of each frequency component at a certain moment.
[0089] The frequency difference between adjacent rows is △ff s / N, where f s is the sampling frequency, and N is the number of sampling points of the signal. Therefore, by applying S transform to analyze the signal, we can obtain the frequency components of the traveling wave signal and the changes of each frequency component over time.
[0090] As the inheritance and development of wavelet transform and short-time Fourier transform, S transform combines the advantages of wavelet transform and short-time Fourier transform, has a more intuitive time-frequency transform result, and can independently analyze the amplitude changes of each frequency component of the fault traveling wave signal. S transform uses a Gaussian window function, the width of the window function is inversely proportional to the frequency, does not need to select the window function and improves the defect of fixed window width, and the phase of the frequency component in the time-frequency representation is directly related to the original signal.
[0091] In view of the existing technology, the present invention adopts S transform, which is an advanced time-frequency analysis method. It can decompose non-stationary signals into superpositions of different frequency components through a lossless and reversible transformation process, thereby achieving an accurate description of the local time-frequency characteristics of the signal. The advantage of S transform is its low sensitivity to noise, which makes it more reliable in extracting features.
[0092] The current current transformer evaluation methods are mainly divided into three types, namely power-off inspection, live inspection, and pre-calibration evaluation. The present invention is a data-driven pre-evaluation method, and proposes a current transformer error prediction model based on S transform and two-dimensional convolutional neural network. First, the S transform is performed on the collected data, and the one-dimensional data is converted to two dimensions through the S transform, and analyzed in the two dimensions of time and frequency. The time-frequency characteristics of the data are trained through a two-dimensional convolutional neural network, and finally the prediction results are obtained.
[0093] The S transform is a lossless and reversible transformation process. At the same time, neural networks have powerful nonlinear fitting capabilities in data prediction and can handle complex patterns and relationships. They can capture subtle patterns in the data by learning the hidden features and structures of the input data, and can make effective predictions even when the amount of data is limited. In addition, the adaptive learning ability of neural networks enables them to automatically adjust model parameters when faced with new data, improving the accuracy and generalization of predictions. The current transformer error prediction based on the S transform and two-dimensional convolutional neural network can be improved to obtain a relatively accurate model.
[0094] S2: Take the modulus of each element in each complex matrix.
[0095] Furthermore, Figure 2 and Figure 3 As shown, we start to process each piece of data in the data set, and obtain the time-frequency matrix of each piece of data through S transformation. This matrix is a complex matrix, and the final data set that can be used by the convolutional neural network also requires the modulus of each element in each complex matrix.
[0096] Taking the modulus of each element in each complex matrix, the calculation is as follows:
[0097]
[0098] Among them, z is the modulus, a is the real part of the element, and b is the imaginary part of the element.
[0099] Then replace each complex element with its calculated modulus to obtain a real matrix;
[0100] S3: Build a two-dimensional convolutional neural network training model and modify and optimize the neural network prediction model.
[0101] Furthermore, a two-dimensional convolutional neural network training model is constructed including an input layer, a convolution layer, an activation layer and a pooling layer; during training, as shown in Table 1, the data experiment of the present invention sets the ratio of the training set to the test set to 8:2, and the input of the input layer is a two-dimensional complex matrix obtained by S transformation;
[0102] Two layers of convolution are used. The convolution kernel size of the first convolution layer is 3, and the number of convolution kernels is 8; the convolution kernel size of the second convolution layer is 3, and the number of convolution kernels is 16;
[0103] An activation layer is added after each convolutional layer by using a linear rectification function.
[0104] The pooling layer uses maximum pooling to reduce the amount of data by maximizing the value. Its usual operation is to divide the input image into several rectangular regions and output the maximum value for each sub-domain. The pooling layer is located after the activation layer, and the sampling factor of the pooling layer is 2; the step size is also set to 2.
[0105] The number of neurons in the fully connected layer is set to 50.
[0106] Table 1 Convolutional neural network
[0107]
[0108]
[0109] After completing the construction of the neural network, the requirements for network training need to be set as shown in Table 2. The output layer performs regression output. After completing the construction of the neural network, the requirements for network training include the maximum number of training cycles, batch size, learning rate, and verification frequency.
[0110] Table 2 trainingOptions
[0111] name Setting parameters Set the maximum number of training epochs 15 Setting the batch size 16 Setting the learning rate 1e-4 Set verification frequency 30
[0112] It should be noted that the two-dimensional convolutional neural network is trained through experiments to verify the effect of the neural network on the error prediction of the transformer monitoring data. The calculation formula of the loss function is as follows:
[0113]
[0114]
[0115]
[0116] where y i is the target value corresponding to the i-th data sample, is the predicted value output by the model training for the i-th data sample.
[0117] Verify the effect of neural network on the error prediction of transformer monitoring data. According to the loss function, the mean absolute error (MAE), mean square error (MSE), and root mean square error (RMSE) will be output simultaneously to evaluate the model.
[0118] The model is trained using a two-dimensional convolutional neural network to obtain the mean absolute error, mean square error, and root mean square error results. When the training results show that the designed model has a poor prediction effect on the data set, the network needs to be modified and optimized as follows:
[0119] Modification 1: By increasing the convolution kernel, features can be captured in a larger range, the feature extraction capability can be improved, and the convolution kernel is changed from 3 to 5;
[0120] Modification 2: Add another layer of convolution on top of the original 2 layers of convolution to identify more complex content; at the same time, increase the number of convolution kernels to improve feature expression and enhance differentiation. Increasing the number of convolution layers and convolution kernels will increase the risk of overfitting, so a dropout layer is added to reduce the risk of overfitting;
[0121] Modification 3: By adding normalization to the network, we can speed up the training, improve the training stability, and reduce the internal covariate shift, thus obtaining the final neural network. The optimized network is shown in Table 3:
[0122] Table 3. Optimized network
[0123] name Network parameter settings Image Input Layer [sample x sample y1] 2D Convolutional Layer (5,8,'Padding','same') 2D Average Pooling Layer (2,'Stride',2) 2D Convolutional Layer (5,32,'Padding','same') 2D Average Pooling Layer (2,'Stride',2) Dropout Layer 0.2 2D Convolutional Layer (5,32,'Padding','same') Fully connected layer 50 Simple layer normalization layer / Dropout Layer 0.3 Fully connected layer 1
[0124] S4: Obtain prediction results of ratio difference and angle difference.
[0125] Furthermore, the ratio difference and angle difference results obtained by the two-dimensional convolutional neural network training model are compared in terms of mean absolute error, mean square error, and root mean square error to obtain the final prediction result.
[0126] Example 2, reference Figure 4-Figure 5 , which is the second embodiment of the present invention, provides a current transformer error prediction method based on S transform and two-dimensional convolution. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through experiments.
[0127] The data set has 816 data samples, each of which has 900 samples sampled in time sequence, as well as the corresponding ratio difference and angle difference data.
[0128] Perform S transformation, process each data in the data set according to the S transformation, and obtain the time-frequency matrix of each data through S transformation. This matrix is a complex matrix, and the final data set that can be used by the convolutional neural network also requires the modulus of each element in each complex matrix.
[0129] During training, the ratio of training set to test set is 8 to 2;
[0130] (1) As can be seen from the previous part, the original data of the input layer becomes a 900*900 matrix after S transformation.
[0131] (2) The convolution layer uses two-dimensional convolution, with two layers of convolution. The convolution kernel size of the first convolution layer is 3, and the number of convolution kernels is 8; the convolution kernel size of the second convolution layer is 3, and the number of convolution kernels is 16.
[0132] (3) The activation layer uses a linear rectification function (RectifiedLinearUnit, ReLU), and an activation layer is added after each convolutional layer.
[0133] (4) The pooling layer uses maximum pooling to reduce the amount of data by maximizing the value. Its usual operation is to divide the input image into several rectangular regions and output the maximum value for each sub-region. The pooling layer is located after the activation layer, and the sampling factor of the pooling layer is 2; the step size is also set to 2.
[0134] (5) The number of neurons in the fully connected layer is 50.
[0135] The model is trained using the network built above and the results are MSE: 774.9344, RMSE: 27.8376, and MAE: 24.1085. Generally speaking, the closer the MSE and RMSE are to 0, the better, and the smaller the MAE, the better. This training result shows that the designed model is not good for predicting the data set, and the network needs to be modified and optimized:
[0136] After modifying the convolution kernel, the training results are MSE: 73.8922, RMSE: 8.5961, and MAE: 7.6266. The training accuracy has been greatly improved compared to the initial training results.
[0137] After increasing the number of convolution layers, the training results are MSE: 2.1296, RMSE: 1.4593, and MAE: 1.0961, which further improves the accuracy of the model.
[0138] The training results after adding the normalization layer are: MSE: 0.0149, RMSE: 0.1221, MAE: 0.0965. The model modification has achieved a relatively good accuracy. The network settings after optimization are shown in Table 4:
[0139] Table 4: The optimized network
[0140]
[0141]
[0142] The prediction results of the angular difference are shown in Table 5:
[0143] Table 5 Comparison of prediction results of angle difference model
[0144]
[0145] The training results are: MSE: 16.9127, RMSE: 4.1125, MAE: 2.4483.
[0146] Embodiment 3, the third embodiment of the present invention, is different from the first two embodiments in that:
[0147] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.
[0148] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0149] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0150] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0151] Example 4, reference Figure 6 , which is the fourth embodiment of the present invention, and provides a current transformer error prediction system based on S transform and two-dimensional convolution, including a data processing module 10, an S transform module 20, a feature extraction module 30, a two-dimensional convolutional neural network training model module 40, a model optimization module 50 and a prediction result output module 60;
[0152] The data processing module 10 includes an original signal acquisition unit 11 and a data packaging unit 12. The original signal acquisition unit 11 monitors the output of the current transformer in real time. The data packaging unit 12 packages the data and the time tag, the ratio difference and the angle difference data into a data sample according to the set sampling rate.
[0153] The S transform module 20 receives the data samples output by the data preprocessing module 10, performs time-frequency analysis on the signal through S transform, extracts the time-varying characteristics of the frequency components of the signal, and outputs a complex matrix;
[0154] The feature extraction module 30 receives the complex matrix output by the S transformation module 20, performs a modulus operation on each element of the complex matrix, obtains amplitude information, and outputs a feature matrix to provide input for subsequent neural network processing;
[0155] The two-dimensional convolutional neural network training module 40 uses the feature learning and pattern recognition capabilities of the convolutional neural network to predict the error of the current transformer. The input layer receives the feature matrix, and after multiple layers of convolution, activation, and pooling operations, the fully connected layer integrates the features, and finally the output layer outputs the prediction result;
[0156] During the training process, the model optimization module 50 uses the loss function to calculate the difference between the predicted value and the actual value, and evaluates the model performance according to the evaluation indicators of mean absolute error, mean square error, and root mean square error output by the loss function. The network structure is optimized according to the evaluation results, and the network parameters and structure are adjusted;
[0157] The prediction result output module 60 receives the prediction result after model optimization, compares the prediction result with the actual value, calculates the error index, outputs the ratio difference and angle difference predicted by the model, and evaluates the accuracy of the prediction.
[0158] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A current transformer error prediction method based on S transform and two-dimensional convolution, characterized in that: include, Collect the original signal data, process the original data through S-transformation, and obtain a complex matrix; Modulo every element in every complex matrix; Build a two-dimensional convolutional neural network training model and modify and optimize the neural network prediction model; Obtain the predicted results of ratio difference and angle difference.
2. The current transformer error prediction method based on S transform and two-dimensional convolution as claimed in claim 1, characterized in that: The original signal data includes packaging the original signal data into data samples, each sample data includes secondary side current data sampled in time sequence and corresponding ratio difference and angle difference data.
3. The current transformer error prediction method based on S transform and two-dimensional convolution as claimed in claim 2, characterized in that: The S transform includes the derivation of the wavelet transform of the continuous signal. The continuous wavelet transform of a continuous signal y(t) can be expressed as W(τ, d): Among them, d is the expansion coefficient, τ is the time shift parameter, and ω(τ-t,d) is the expansion time shift transformation formula of the mother wavelet; Take the transformation kernel for W(τ,d): Where, f is the frequency; Multiply the continuous wavelet transform by an appropriate phase correction factor to obtain the corrected result: S(τ,f)=e j2πft W(τ,d) Among them, e j2πft is the phase correction factor; Combining the continuous wavelet transform and the correction results, we can get the S transform expression of y(t): Among them, ω(τ-t,f) is the Gaussian window function, and τ is the time shift factor.
4. The current transformer error prediction method based on S transform and two-dimensional convolution as claimed in claim 3, characterized in that: The S transform also includes the derivation of the Fourier transform of the discrete signal. If the discrete signal is represented by y(kT) (k∈[0,N-1]), the discrete Fourier transform of the function y(kT) can be represented by Y(n / NT): Among them, a two-dimensional complex matrix is obtained through S transform, that is, the frequency components of the traveling wave signal and the changes of each frequency component over time; α represents the scaling parameter of the S transform, which is used to control the width of the window function; T represents the total time length of the signal, N represents the number of sampling points of the signal, n represents the index of the time point, which is used for the sampling of discrete signals; m represents the index of the frequency point, which is used for the frequency components of discrete signals; k represents the frequency, y represents the sampling value of the signal, and Y represents the result of the signal transformation.
5. The current transformer error prediction method based on S transform and two-dimensional convolution as claimed in claim 4, characterized in that: The two-dimensional convolutional neural network training model includes an input layer, a convolution layer, an activation layer and a pooling layer; during training, the ratio of the training set to the test set is set to 8:2, and the input of the input layer is a two-dimensional complex matrix obtained by S transformation; Two layers of convolution are used. The convolution kernel size of the first convolution layer is 3, and the number of convolution kernels is 8; the convolution kernel size of the second convolution layer is 3, and the number of convolution kernels is 16; Add activation layers after each convolutional layer by using a linear rectification function; The amount of data is reduced by outputting the maximum value. The sampling factor of the pooling layer is set to 2, and the step size is set to 2. The number of neurons in the fully connected layer is set to 50, and the output layer performs regression output. After the neural network is built, the requirements for network training include the maximum number of training cycles, batch size, learning rate, and verification frequency.
6. The current transformer error prediction method based on S transform and two-dimensional convolution as claimed in claim 5, characterized in that: The modification and optimization of the neural network prediction model includes training the two-dimensional convolutional neural network through experiments to verify the effect of the neural network on the error prediction of the transformer monitoring data, and outputting the mean absolute error, mean square error, and root mean square error to evaluate the model according to the loss function; The model is trained using a two-dimensional convolutional neural network to obtain the mean absolute error, mean square error, and root mean square error results. When the training results show that the designed model has a poor prediction effect on the data set, the network needs to be modified and optimized as follows: Modification 1: By increasing the convolution kernel size to capture features in a larger range, the convolution kernel size is changed from 3 to 5. Modification 2: Add one more convolution layer and dropout layer on the basis of the original two convolution layers. Dropout layer is a regularization layer in the neural network, which is used to randomly discard some neurons during the training process to reduce overfitting and improve the generalization ability of the model. Modification three, add a normalization layer to the two-dimensional convolutional neural network.
7. The current transformer error prediction method based on S transform and two-dimensional convolution as claimed in claim 6, characterized in that: The prediction results include comparing the mean absolute error, mean square error, and root mean square error of the ratio difference and the angle difference results obtained by the two-dimensional convolutional neural network training model to obtain the final prediction results.
8. A system using the current transformer error prediction method based on S transform and two-dimensional convolution as claimed in any one of claims 1 to 7, characterized in that: It includes a data processing module, an S-transformation module, a feature extraction module, a two-dimensional convolutional neural network training model module, a model optimization module, and a prediction result output module; The data processing module includes an original signal acquisition unit and a data packaging unit. The original signal acquisition unit monitors the output of the current transformer in real time. The data packaging unit packages the data and the time tag, the ratio difference and the angle difference data into a data sample according to a set sampling rate. The S transform module receives the data samples output by the data preprocessing module, performs time-frequency analysis on the signal through S transform, extracts the time-varying characteristics of the frequency components of the signal, and outputs a complex matrix; The feature extraction module receives the complex matrix output by the S transform module, performs a modulus operation on each element of the complex matrix, obtains amplitude information, and outputs a feature matrix to provide input for subsequent neural network processing; The two-dimensional convolutional neural network training module predicts the error of the current transformer by using the feature learning and pattern recognition capabilities of the convolutional neural network. The input layer receives the feature matrix, and after multi-layer convolution, activation, and pooling operations, the fully connected layer integrates the features, and finally the output layer outputs the prediction result. The model optimization module, during the training process, uses a loss function to calculate the difference between the predicted value and the actual value, evaluates the model performance according to the evaluation indicators of mean absolute error, mean square error, and root mean square error output by the loss function, optimizes the network structure according to the evaluation results, and adjusts the network parameters and structure; The prediction result output module receives the prediction result after model optimization, compares the prediction result with the actual value, calculates the error index, outputs the ratio difference and angle difference predicted by the model, and evaluates the accuracy of the prediction.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the current transformer error prediction method based on S transform and two-dimensional convolution described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the current transformer error prediction method based on S transform and two-dimensional convolution described in any one of claims 1 to 7 are implemented.