Data super-resolution reconstruction method, device and system based on reference transformer
By employing a reference transformer-based super-resolution reconstruction method, which utilizes feature extraction, attention processing, and reconstruction modules, the limitations of feature representation and noise issues in existing power data super-resolution methods are addressed, achieving efficient and accurate mapping from low-frequency data to high-frequency data.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIDIAN UNIV
- Filing Date
- 2023-10-09
- Publication Date
- 2026-04-28
AI Technical Summary
Existing super-resolution methods for power data, based on convolutional neural networks, can only collect short-term information and have limited feature representation capabilities. On the other hand, methods based on generative adversarial networks are sensitive to hyperparameters, and the generated super-resolution data may contain noise. Furthermore, replacing high-frequency electricity meters is costly.
A super-resolution reconstruction method based on a reference transformer is adopted. Through a feature extraction module, an information supplementation module, and a super-resolution reconstruction module, the attention mechanism of the transformer is used for feature extraction, attention processing, and feature fusion. Combined with continuous reconstruction and periodic reconstruction, the mapping accuracy from low-frequency data to high-frequency data is improved.
It enhances the correspondence between low-frequency and high-frequency data, fully expresses the long-term characteristics of the data, reduces the loss of data details, and improves the accuracy and robustness of data reconstruction.
Smart Images

Figure CN117272027B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and specifically to a data super-resolution reconstruction method, apparatus, and system based on a reference transformer. Background Technology
[0002] A smart grid is an automated, advanced, distributed network integrating energy and communication. As a measurement infrastructure for modern society, big data analytics in smart grids significantly improves the operational efficiency, reliability, and sustainability of the power service industry. However, collecting high-frequency data is quite difficult in practice due to the higher data communication and storage costs. Furthermore, a large number of low-frequency meters already exist in the power grid, and replacing them with high-frequency meters is costly. Therefore, an economical and efficient approach is to perform super-resolution reconstruction of low-frequency power data.
[0003] With the development of neural networks, many deep learning algorithms have emerged in the field of temporal super-resolution. In the field of deep learning, existing power data super-resolution methods are mainly divided into two categories: one is power super-resolution methods based on convolutional neural networks, which learn the mapping from low frequency to high frequency through full convolution; the other is based on generative adversarial networks, which learn the mapping from low frequency distribution to high frequency distribution through adversarial learning.
[0004] However, due to limitations in kernel size and shared weights, convolutional methods can only collect short-term information, thus restricting their feature representation capabilities. Furthermore, generative adversarial network (GAN)-based methods are sensitive to hyperparameters, and the generated super-resolution data may contain noise. Summary of the Invention
[0005] To address the aforementioned problems in the prior art, this invention provides a data super-resolution reconstruction method, apparatus, and system based on a reference transformer.
[0006] The technical problem to be solved by this invention is achieved through the following technical solution:
[0007] In a first aspect, the present invention provides a data super-resolution reconstruction method based on a reference transformer, comprising:
[0008] Acquire the low-frequency load data to be converted, perform logarithmic and normalization processing on the low-frequency load data to be converted, and divide the data according to the conversion sequence length to obtain the preprocessed low-frequency load sequence to be converted.
[0009] The preprocessed low-frequency load sequence to be converted is input into a qualified data super-resolution reconstruction model to obtain reconstructed super-resolution high-frequency data. The qualified data super-resolution reconstruction model includes a feature extraction module, an information supplementation module, and a super-resolution reconstruction module. The feature extraction module extracts features from the low-frequency load sequence to obtain low-frequency load features. The information supplementation module sequentially performs attention processing and feature fusion on the low-frequency load features to obtain enhanced high-frequency load features. The super-resolution reconstruction module performs continuous and periodic reconstruction on the enhanced high-frequency load features to obtain reconstructed super-resolution high-frequency data.
[0010] Optionally, the step of inputting the preprocessed low-frequency load sequence to be converted into a qualified data super-resolution reconstruction model to obtain reconstructed super-resolution high-frequency data includes:
[0011] The feature extraction module in the qualified data super-resolution reconstruction model extracts features from the preprocessed low-frequency load sequence to be converted, thereby obtaining the low-frequency load features to be converted.
[0012] The information supplementation module in the data super-resolution reconstruction model that meets the conditions performs global attention and local attention processing on the low-frequency load features to be transferred to obtain the high-frequency load features to be transferred. Then, the reference high-frequency features are added to the high-frequency load features to be transferred to obtain the enhanced high-frequency features through matching attention.
[0013] The enhanced high-frequency features are sequentially and periodically reconstructed by the super-resolution reconstruction module in the qualified data super-resolution reconstruction model to obtain reconstructed super-resolution high-frequency data.
[0014] Optionally, the training process of the qualified data super-resolution reconstruction model includes:
[0015] Obtain training load data;
[0016] The training load data is subjected to sequence similarity calculation to obtain a low-frequency training load sequence.
[0017] The continuous reconstruction factor and the periodic reconstruction factor are calculated using the low-frequency training load sequence.
[0018] The training load data is subjected to logarithmic and standard normalization, and the data is divided according to the length of the transformation sequence to obtain the training load sequence;
[0019] The training load sequence is divided into a reference set sequence and a model dataset sequence according to a preset ratio;
[0020] The pre-constructed super-resolution data reconstruction model is trained using the reference set sequence and the model dataset sequence. During the training process, the parameters of the super-resolution data reconstruction model are continuously updated using the continuous reconstruction factor and the periodic reconstruction factor to obtain the super-resolution data reconstruction model that meets the conditions.
[0021] Optionally, the training load data includes: low-frequency training load data and high-frequency training load data;
[0022] The step of calculating sequence similarity from the training load data to obtain the low-frequency training load sequence includes:
[0023] The low-frequency training load data is calculated according to the sequence similarity calculation formula to obtain the low-frequency training load sequence.
[0024] Optionally, the step of calculating the low-frequency training load sequence by applying the sequence similarity calculation formula to the low-frequency training load data includes:
[0025] The sequence similarity of each element in the low-frequency training load sequence is calculated according to the sequence similarity calculation formula, which is expressed as follows:
[0026]
[0027] Where L is the sequence length, N is the number of sequences obtained by dividing the low-frequency training load data by L, and X LR (i, l) is the low-frequency training load sequence X LR The l-th element of the sequence in the i-th period;
[0028] A sequence similarity graph S is constructed based on the calculated sequence similarity, and the L corresponding to the minimum extreme point on the sequence similarity graph S is taken as the length L of the transformed sequence. win ;
[0029] According to the conversion sequence length L win The low-frequency training load data is divided to obtain the low-frequency training load sequence X. LR .
[0030] Optionally, calculating the continuous reconstruction factor and the periodic reconstruction factor using the low-frequency training load sequence includes:
[0031] Step A: Calculate the low-frequency training load sequence X LR The corresponding time length T0 is represented as: f L The frequency of low-frequency training load data;
[0032] Step B: Determine X LR The corresponding high-frequency sequence XHR (T0), calculate X HR The approximate period T1 of (T0); X HR The approximate period T1 of (T0) is:
[0033]
[0034] f1 = argmax f |FFT(X HR )| A (2)
[0035] Where FFT(.) is the Fourier transform, |.| A For amplitude measurement operation;
[0036] Step C: Calculate the number of sequences N1 corresponding to the approximate period T1, N1 = f H T1,f H The frequency of the high-frequency training load data;
[0037] Step D: If N1 is not an integer, assign the frequency f2, which is the amplitude second only to f1 in step B, to f1, and recalculate N1.
[0038] Step E: If N1 is an integer and a prime number, then the minimum period T min =T1, otherwise use T0 to record the current period T1;
[0039] Step F: Repeat steps BE until the minimum period T is found. min ;
[0040] Step H, passing through the minimum period T min Calculate the periodic reconstruction factor b = f H T min and continuous reconstruction factor Where a and k are positive integers, k is the minimum reconstruction window, and the super-resolution factor is...
[0041] Optionally, the step of performing logarithmic and standard normalization on the training load data, and dividing the data according to the transformation sequence length to obtain a training load sequence, and then dividing the training load sequence according to a preset ratio to obtain a reference set sequence and a model dataset sequence, includes:
[0042] The low-frequency training load data and high-frequency training load data in the training load data are subjected to logarithmic and standard normalization processes, respectively, and the data is divided according to the length of the transformation sequence to obtain the low-frequency training load sequence and the high-frequency training load sequence.
[0043] The low-frequency training load sequence and the high-frequency training load sequence are divided according to a preset ratio to obtain the corresponding low-frequency training load sequence X. LR High-frequency training load sequence X HR Reference low-frequency load sequence X RefLR Reference high-frequency load sequence X RefHR .
[0044] Optionally, the step of continuously updating the parameters of the data super-resolution reconstruction model through the reference set sequence, the model dataset sequence, the continuous reconstruction factor, and the periodic reconstruction factor to obtain the data super-resolution reconstruction model that meets the conditions includes:
[0045] The low-frequency training load sequence X is processed by the feature extraction module. LR Reference low-frequency load sequence X RefLR Reference high-frequency load sequence X RefHR Feature extraction is performed separately to obtain the corresponding low-frequency training features F. LR Reference low-frequency feature F RefLR Reference high-frequency feature F RefHR ;
[0046] The information supplementation module includes: a global attention block, a local attention block, and a matching attention block. Each of the global attention block, the local attention block, and the matching attention block is equipped with at least one efficient transformer. The dot product attention mechanism of the encoder in the transformer is replaced with convolutional attention, which serves as the efficient transformer.
[0047] Using the global attention block to train low-frequency features F LR and reference low-frequency feature F RefLR Perform global self-attention separately to obtain the low-frequency features F′ after self-attention. LR High-frequency features F′ after self-attention RefLR ;
[0048] Using local attention blocks, low-frequency training features F LR Learn the corresponding high-frequency feature F HR ;
[0049] Using matching attention blocks for F′ LR and F′ RefLR Matching attention is performed, attention weights are calculated, and high-frequency features F are referenced based on these attention weights. RefHR Integrating F HR Among them, the enhanced high-frequency feature F′ is obtained. HR ;
[0050] In the super-resolution reconstruction module, F HRBy sequentially performing continuous reconstruction and periodic reconstruction according to the continuous reconstruction factor a and the periodic reconstruction factor b, the super-resolution reconstructed high-frequency sequence is obtained.
[0051]
[0052] ConRE() represents continuous refactoring, PerRE() represents periodic refactoring, Conv k This represents a one-dimensional convolutional layer with kernel k.
[0053] High-frequency sequences reconstructed using the super-resolution method High-frequency training load sequence X HR The loss of the super-resolution reconstruction model of the data is calculated.
[0054]
[0055] Where i = 1, ..., N win l = 1, ..., L win N win Indicates the number of divisions;
[0056] The parameters of the super-resolution data reconstruction model are continuously updated in the direction of the loss descent until a preset number of iterations is reached to obtain a super-resolution data reconstruction model that meets the conditions.
[0057] In a second aspect, the present invention provides a data super-resolution reconstruction apparatus based on a reference transformer, comprising: an acquisition unit and a reconstruction unit;
[0058] The acquisition unit is used to acquire low-frequency load data to be converted, perform logarithmic and normalization processing on the low-frequency load data to be converted, and divide the data according to the conversion sequence length to obtain a preprocessed low-frequency load sequence to be converted.
[0059] The reconstruction unit is used to input the preprocessed low-frequency load sequence to be converted into a data super-resolution reconstruction model that meets the conditions, so as to obtain reconstructed super-resolution high-frequency data. The data super-resolution reconstruction model that meets the conditions includes: a feature extraction module, an information supplementation module, and a super-resolution reconstruction module. The feature extraction module is used to extract features from the low-frequency load sequence to obtain low-frequency load features. The information supplementation module is used to sequentially perform attention processing and feature fusion on the low-frequency load features to obtain enhanced high-frequency load features. The super-resolution reconstruction module is used to perform continuous reconstruction and periodic reconstruction on the enhanced high-frequency load features to obtain reconstructed super-resolution high-frequency data.
[0060] Thirdly, the present invention provides a data super-resolution reconstruction system based on a reference transformer, comprising: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the method described in the first aspect above.
[0061] This invention provides a data super-resolution reconstruction method, apparatus, and system based on a reference transformer. The data super-resolution reconstruction method based on a reference transformer includes: acquiring low-frequency load data to be converted; performing logarithmic and normalization processing on the low-frequency load data to be converted; and dividing the data according to the conversion sequence length to obtain a preprocessed low-frequency load sequence to be converted; inputting the preprocessed low-frequency load sequence to be converted into a data super-resolution reconstruction model that meets certain conditions to obtain reconstructed super-resolution high-frequency data; wherein, the data super-resolution reconstruction model that meets certain conditions includes: a feature extraction module, an information supplementation module, and a super-resolution reconstruction module; the feature extraction module is used to extract features from the low-frequency load sequence to obtain low-frequency load features; the information supplementation module is used to sequentially perform attention processing and feature fusion on the low-frequency load features to obtain enhanced high-frequency load features; the super-resolution reconstruction module is used to perform continuous reconstruction and periodic reconstruction on the enhanced high-frequency load features to obtain reconstructed super-resolution high-frequency data. By designing separate feature extraction and information supplementation modules and using feature fusion for low-frequency load features, the correspondence between low-frequency and high-frequency data is strengthened, making feature representation more comprehensive. In addition, continuous reconstruction and periodic reconstruction make full use of the changing characteristics of data, fully express the long-term features of data, reduce the loss of data details, and improve the accuracy of data reconstruction.
[0062] The present invention will now be described in further detail with reference to the accompanying drawings. Attached Figure Description
[0063] Figure 1 A schematic flowchart of the data super-resolution reconstruction method based on a reference transformer provided in an embodiment of the present invention;
[0064] Figure 2 A schematic diagram of a data super-resolution reconstruction device based on a reference transformer provided in an embodiment of the present invention;
[0065] Figure 3 This is a schematic diagram of a data super-resolution reconstruction system based on a reference transformer, provided in an embodiment of the present invention. Detailed Implementation
[0066] The present invention will be further described in detail below with reference to specific embodiments, but the implementation of the present invention is not limited thereto.
[0067] To improve the accuracy of super-resolution data reconstruction, this invention provides a super-resolution data reconstruction method based on a reference transformer. Figure 1 This is a flowchart illustrating the data super-resolution reconstruction method based on a reference transformer provided in an embodiment of the present invention, as shown below. Figure 1 As shown, the method includes:
[0068] S101. Obtain the low-frequency load data to be converted, perform logarithmic and normalization processing on the low-frequency load data to be converted, and divide the data according to the conversion sequence length to obtain the preprocessed low-frequency load sequence to be converted.
[0069] It should be noted that, in this embodiment of the invention, data processing mainly targets power data.
[0070] The transformed sequence length L is the length of the transformed sequence calculated in the training of a qualified super-resolution reconstruction model. win .
[0071] S102. Input the preprocessed low-frequency load sequence to be converted into the data super-resolution reconstruction model that meets the conditions to obtain the reconstructed super-resolution high-frequency data.
[0072] The qualified super-resolution reconstruction model includes: a feature extraction module, an information supplementation module, and a super-resolution reconstruction module. The feature extraction module is used to extract features from the low-frequency load sequence to obtain low-frequency load features. The information supplementation module is used to perform attention processing and feature fusion on the low-frequency load features in sequence to obtain enhanced high-frequency load features. The super-resolution reconstruction module is used to perform continuous reconstruction and periodic reconstruction on the enhanced high-frequency load features to obtain reconstructed super-resolution high-frequency data.
[0073] This invention provides a data super-resolution reconstruction method based on a reference transformer, comprising: acquiring low-frequency load data to be converted; performing logarithmic and normalization processing on the low-frequency load data to be converted; and dividing the data according to the conversion sequence length to obtain a preprocessed low-frequency load sequence to be converted; inputting the preprocessed low-frequency load sequence to be converted into a data super-resolution reconstruction model that meets the conditions to obtain reconstructed super-resolution high-frequency data; wherein, the data super-resolution reconstruction model that meets the conditions includes: a feature extraction module, an information supplementation module, and a super-resolution reconstruction module; the feature extraction module is used to extract features from the low-frequency load sequence to obtain low-frequency load features; the information supplementation module is used to sequentially perform attention processing and feature fusion on the low-frequency load features to obtain enhanced high-frequency load features; the super-resolution reconstruction module is used to perform continuous reconstruction and periodic reconstruction on the enhanced high-frequency load features to obtain reconstructed super-resolution high-frequency data. By designing separate feature extraction and information supplementation modules and using feature fusion for low-frequency load features, the correspondence between low-frequency and high-frequency data is strengthened, making feature representation more comprehensive. In addition, continuous reconstruction and periodic reconstruction make full use of the changing characteristics of data, fully express the long-term features of data, reduce the loss of data details, and improve the accuracy of data reconstruction.
[0074] Optionally, S102 specifically includes:
[0075] The feature extraction module in the data super-resolution reconstruction model that meets the conditions is used to extract features from the preprocessed low-frequency load sequence to be transferred, and the low-frequency load features to be transferred are obtained.
[0076] The information supplementation module in the data super-resolution reconstruction model that meets the conditions performs global attention and local attention processing on the low-frequency load features to be transferred, respectively, to obtain the high-frequency load features to be transferred. Then, the reference high-frequency features are added to the high-frequency load features to be transferred through matching attention to obtain the enhanced high-frequency features.
[0077] The enhanced high-frequency features are sequentially reconstructed and periodically reconstructed using the super-resolution reconstruction module in the qualified data super-resolution reconstruction model to obtain the reconstructed super-resolution high-frequency data.
[0078] Optionally, the training process for a qualified data super-resolution reconstruction model includes:
[0079] Obtain training load data;
[0080] The training load data is subjected to sequence similarity calculation to obtain low-frequency training load sequences;
[0081] The continuous reconstruction factor and the periodic reconstruction factor are calculated by using a low-frequency training load sequence.
[0082] The training load data is logarithmically and standardly normalized, and then divided according to the length of the transformation sequence to obtain the training load sequence.
[0083] The training load sequence is divided into a reference set sequence and a model dataset sequence according to a preset ratio;
[0084] A pre-built super-resolution data reconstruction model is trained using a reference set sequence and a model dataset sequence. During the training process, the parameters of the super-resolution data reconstruction model are continuously updated using continuous reconstruction factors and periodic reconstruction factors to obtain a super-resolution data reconstruction model that meets the conditions.
[0085] Optionally, the training load data includes: low-frequency training load data and high-frequency training load data;
[0086] The training load data is subjected to sequence similarity calculation to obtain low-frequency training load sequences, including:
[0087] The low-frequency training load data is calculated according to the sequence similarity calculation formula to obtain the low-frequency training load sequence.
[0088] It should be noted that in power load data, the time series changes in a trend-period manner. The sequence changes continuously during the period and changes regularly within the period. That is, the sequence can be decomposed into continuously changing signals and periodically changing signals. General upsampling strategies are difficult to capture such complex trend-period changes.
[0089] It is understood that in this embodiment of the invention, by analyzing the data according to a sequence and segmenting the data according to the sequence, the constructed training data is ensured to contain the reference value of periodic information. Furthermore, the training data obtained through sequence analysis can also make the model training more accurate.
[0090] Optionally, the low-frequency training load data is calculated according to the sequence similarity calculation formula to obtain the low-frequency training load sequence, which includes:
[0091] The sequence similarity of each element in the low-frequency training load sequence is calculated according to the sequence similarity calculation formula, which is expressed as follows:
[0092]
[0093] Where L is the sequence length, N is the number of sequences obtained by dividing the low-frequency training load data by L, and X LR (i, l) is the low-frequency training load sequence X LR The l-th element of the sequence in the i-th period;
[0094] A sequence similarity graph S is constructed based on the calculated sequence similarity, and the L corresponding to the minimum extreme point on the sequence similarity graph S is taken as the length L of the transformed sequence. win ;
[0095] According to the length L of the transformation sequence win The low-frequency training load data is divided into low-frequency training load sequences X. LR .
[0096] Optionally, the continuous reconstruction factor and the periodic reconstruction factor are calculated using a low-frequency training load sequence, including:
[0097] Step A: Calculate the low-frequency training load sequence X LR The corresponding time length T0 is represented as: f L For low-frequency training load data,
[0098] Step B: Determine X LR The corresponding high-frequency sequence X HR (T0), calculate X HR The approximate period T1 of (T0); X HR The approximate period T1 of (T0) is:
[0099]
[0100] f1 = argmax f |FFT(X HR )| A (2)
[0101] Where FFT(.) is the Fourier transform, |.| A For amplitude measurement operation,
[0102] Step C: Calculate the number of sequences N1 corresponding to the approximate period T1, N1 = f H T1,f H The frequency of the high-frequency training load data;
[0103] Step D: If N1 is not an integer, assign the frequency f2, which is the amplitude second only to f1 in step B, to f1, and recalculate N1.
[0104] Step E: If N1 is an integer and a prime number, then the minimum period T min =T1, otherwise use T0 to record the current period T1;
[0105] Step F: Repeat steps BE until the minimum period T is found. min ;
[0106] Step H, passing through the minimum period T minCalculate the periodic reconstruction factor b = f H T min and continuous reconstruction factor Where a and k are positive integers, k is the minimum reconstruction window, and the super-resolution factor is...
[0107] Specifically, in this embodiment of the invention, k is the minimum reconstruction window and the smallest integer that satisfies the condition.
[0108] Optionally, the training load data is logarithmically and normally normalized, and then divided according to the transformation sequence length to obtain the training load sequence. The training load sequence is then divided according to a preset ratio to obtain the reference set sequence and the model dataset sequence, including:
[0109] Logarithmic and standard normalization processes are performed on the low-frequency and high-frequency training load data in the training load data, respectively, and the data is divided according to the length of the transformed sequence to obtain the low-frequency training load sequence and the high-frequency training load sequence.
[0110] The low-frequency training load sequence and the high-frequency training load sequence are divided according to a preset ratio to obtain the corresponding low-frequency training load sequence X. LR High-frequency training load sequence X HR Reference low-frequency load sequence X RefLR Reference high-frequency load sequence X RefHR .
[0111] Preferably, in this embodiment of the invention, the reference set sequence generally accounts for 1%-5% of the training load sequence.
[0112] Optionally, the parameters of the data super-resolution reconstruction model are continuously updated using the reference set sequence, the model dataset sequence, the continuous reconstruction factor, and the periodic reconstruction factor to obtain a data super-resolution reconstruction model that meets the conditions, including:
[0113] The low-frequency training load sequence X is processed through the feature extraction module. LR Reference low-frequency load sequence X RefLR Reference high-frequency load sequence X RefHR Feature extraction is performed separately to obtain the corresponding low-frequency training features F. LR Reference low-frequency feature F RefLR Reference high-frequency feature F RefHR ;
[0114] In an embodiment of the present invention,
[0115] F LR =FE 1 (X LR );
[0116] FRefLR =FE 1 (X RefLR );
[0117] F RefHR =FE 2 (X RefHR );
[0118] The feature extraction module FE(x) is as follows:
[0119] FE(x) = Conv1(concat[Conv5(x), ARFB(ARFB(Conv5(x))]); ARFB represents adaptive residual feature blocks; FE 1 Indicates a low-frequency feature extractor, FE 2 Represents a high-frequency feature extractor; Conv k This represents a one-dimensional convolutional layer with kernel k.
[0120] The information supplementation module includes: a global attention block, a local attention block, and a matching attention block. Each of the global attention block, the local attention block, and the matching attention block is equipped with at least one efficient transformer. The dot product attention mechanism of the encoder in the transformer is replaced with convolutional attention, which serves as the efficient transformer.
[0121] An efficient transformer consists of two parts: an attention block and a feedforward network block. Layer normalization is applied between the attention block and the feedforward network block, and residual connections are used after each block. Assume Q... in K in V in E in To pay attention to the characteristics of block inputs. E out For output features, then E out for;
[0122] E out =Norm(MLP(E m )+E m (1)
[0123] E m =Norm(EMHA(Q) in K in V in )+E in (2)
[0124] Where EMHA(·), MLP(·), and Norm(·) represent efficient multi-head attention, multilayer perceptron, and layer normalization, respectively. The efficient transformer described by equations (1) and (2) above is simplified to ET(E in Qin K in V in ).
[0125] For F LR F RefLR and F RefHR Location and time features are embedded separately. Location embedding uses fixed values, and time feature level is per hour.
[0126] Using the global attention block to train low-frequency features F LR and reference low-frequency feature F RefLR Perform global self-attention separately to obtain the low-frequency features F′ after self-attention. LR High-frequency features F′ after self-attention RefLR ;
[0127] In an embodiment of the present invention,
[0128] F′ LR =ET(F LR ↓, F LR ↓, F LR ↓, F LR ↓)↑;
[0129] F′ RefLR =ET(F RefLR ↓, F RefLR ↓, F RefLR ↓, F RefLR ↓)↑;
[0130] ↓ indicates convolution downsampling, and ↑ indicates deconvolution upsampling;
[0131] Using local attention blocks, low-frequency training features F LR Learn the corresponding high-frequency feature F HR ;
[0132] Specifically,
[0133] F HR =ET(F′) LR F′ LR F′ LR F′ LR );
[0134] Using matching attention blocks for F′ LR and F′ RefLR Matching attention is performed, attention weights are calculated, and high-frequency features F are referenced based on these attention weights. RefHR Integrating F HR Among them, the enhanced high-frequency feature F′ is obtained. HR ;
[0135] F′HR =ET(F HR F′ LR F′ RefLR F RefHR ↓);
[0136] F RefHR ↓ indicates F RefHR The value to be downsampled;
[0137] In this embodiment of the invention, by referencing the high-frequency feature F RefHR Embedded into the corresponding high-frequency feature F HR Furthermore, the temporal texture details lost due to low-frequency sampling were filled in.
[0138] In the super-resolution reconstruction module, F′ HR By sequentially performing continuous reconstruction and periodic reconstruction according to the continuous reconstruction factor a and the periodic reconstruction factor b, the super-resolution reconstructed high-frequency sequence is obtained.
[0139]
[0140] ConRE() represents continuous refactoring, PerRE() represents periodic refactoring, Conv k This represents a one-dimensional convolutional layer with kernel k.
[0141] Wherein, the continuous reconstruction formula ConRE()=MLP2(MLP1()) T MLP1 is a single fully connected layer with the ReLU activation function, used for feature mapping; MLP2 is a two-layer MLP used to transform sequences of length L. win The sequence is reconstructed into a sequence of length . sequence;
[0142] Periodic reconstruction uses convolutional layers to reconstruct sequence L a The continuous reconstructed features are mapped into b data points of length L through convolution. a The continuous periodic high-frequency features are then concatenated along the length dimension to make bL a =kfL win Then, convolution is used to integrate continuous periodic high-frequency features, and the reconstruction result is output. The periodic reconstruction formula is expressed as: PerRE() = concat[Conv 1 (), ..., Conv b ()];
[0143] Combining the above continuous reconstruction formula and periodic reconstruction formula, we obtain the above formula (3).
[0144] High-frequency sequences reconstructed using the super-resolution method High-frequency training load sequence XHR The loss of the super-resolution reconstruction model of the data is calculated.
[0145]
[0146] Where i = 1, ..., N win l = 1, ..., L win N win Indicates the number of divisions;
[0147] The parameters of the super-resolution data reconstruction model are continuously updated in the direction of the loss descent until a preset number of iterations is reached to obtain a super-resolution data reconstruction model that meets the conditions.
[0148] It should be noted that, in the embodiments of the present invention, the N win Specifically, it can represent the super-resolution reconstruction high-frequency sequence and the high-frequency training load sequence, according to L... win The number of partitions obtained by performing the partitioning.
[0149] It is understood that, in the embodiments of the present invention, by using an efficient transformer to perform self-attention on long-term sequences, the sequence’s awareness of context is enhanced, making it easier to capture long-term changes in the sequence and to learn high-frequency low-frequency features to fuse more global information.
[0150] The step-by-step reconstruction mechanism of continuous and periodic reconstruction obtains continuous and periodic factors based on data characteristics, fully taking into account the small periodicity phenomenon in the data, and reducing the problem of the difficulty of data reconstruction when the super-resolution factor is large.
[0151] To verify the accuracy of the data super-resolution reconstruction method based on a reference transformer provided in this embodiment of the invention, experiments were conducted on a dataset provided by UNiLab. This dataset contains three buses, and as the number of households increases, the changes in electricity data become more complex, increasing the difficulty of super-resolution. The results of this method and the comparison algorithm are shown in Table 1. The super-resolution factor is 10, and the measurement index is MAAPE. The calculation formula is as follows:
[0152]
[0153] Where i = 1, ..., N, l = 1, ..., L. N represents the length of the transformation sequence, and L represents the number of corresponding partitions.
[0154] Table 1: Experimental results on power load data
[0155]
[0156] Table 2: Number of households using different bus types in the dataset
[0157]
[0158]
[0159] As shown in Table 1, the proposed Data Super-Resolution Reconstruction Method (RTSR) exhibits a smaller loss value compared to the convolution-based method (SRPNSE), regardless of whether it's a single bus or an average bus. Table 2 displays the number of households corresponding to different buses in Table 1. Combining Tables 1 and 2, it can be seen that the proposed Data Super-Resolution Reconstruction Method (RTSR) becomes more challenging as the number of households increases. Compared to SRPNSE, the proposed Data Super-Resolution Reconstruction Method (RTSR) shows a smaller increase in loss, indicating that it is more robust to more complex situations.
[0160] Corresponding to the above-mentioned data super-resolution reconstruction method based on a reference transformer, this embodiment of the invention provides a data super-resolution reconstruction apparatus based on a reference transformer. Figure 2 This is a schematic diagram of a data super-resolution reconstruction apparatus based on a reference transformer provided in an embodiment of the present invention. Figure 2 As shown, the device includes: an acquisition unit 201 and a reconstruction unit 202;
[0161] The acquisition unit 201 is used to acquire the low-frequency load data to be converted, perform logarithmic and normalization processing on the low-frequency load data to be converted, and divide the data according to the conversion sequence length to obtain the preprocessed low-frequency load sequence to be converted.
[0162] The reconstruction unit 202 is used to input the preprocessed low-frequency load sequence to be converted into the data super-resolution reconstruction model that meets the conditions, so as to obtain the reconstructed super-resolution high-frequency data.
[0163] The qualified super-resolution reconstruction model includes: a feature extraction module, an information supplementation module, and a super-resolution reconstruction module. The feature extraction module is used to extract features from the low-frequency load sequence to obtain low-frequency load features. The information supplementation module is used to perform attention processing and feature fusion on the low-frequency load features in sequence to obtain enhanced high-frequency load features. The super-resolution reconstruction module is used to perform continuous reconstruction and periodic reconstruction on the enhanced high-frequency load features to obtain reconstructed super-resolution high-frequency data.
[0164] Figure 3This is a schematic diagram of a data super-resolution reconstruction system based on a reference transformer provided in an embodiment of the present invention. It includes a processor 710, a storage medium 720, and a bus 730. The storage medium 720 stores machine-readable instructions executable by the processor 710. When the electronic device is running, the processor 710 communicates with the storage medium 720 via the bus 730. The processor 710 executes the machine-readable instructions to perform the steps of the above-described method embodiment. Specific implementations and technical effects are similar and will not be repeated here.
[0165] The method provided in this invention can be applied to electronic devices. Specifically, the electronic device can be a desktop computer, a portable computer, a smart mobile terminal, a server, etc. No limitation is made herein; any electronic device that can implement this invention falls within the protection scope of this invention.
[0166] The present invention also provides a computer-readable storage medium. A computer program is stored in the computer-readable storage medium, and when executed by a processor, the computer program implements the steps of any of the above-described data super-resolution reconstruction methods based on a reference transformer.
[0167] Optionally, the computer-readable storage medium may be non-volatile memory (NVM), such as at least one disk storage device.
[0168] It should be noted that, for the embodiments of the device / electronic device / storage medium / computer program product, since they are basically similar to the method embodiments, the description is relatively simple, and relevant parts can be referred to the description of the method embodiments.
[0169] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features or characteristics described may be combined in any suitable manner in one or more embodiments or examples. In addition, those skilled in the art can combine and integrate the different embodiments or examples described in this specification.
[0170] The method provided in this invention can be applied to electronic devices. Specifically, the electronic device can be a desktop computer, a portable computer, a smart mobile terminal, a server, etc. No limitation is made herein; any electronic device that can implement this invention falls within the protection scope of this invention.
[0171] For the embodiments of the device / electronic device / storage medium, since they are basically similar to the method embodiments, the description is relatively simple, and relevant parts can be referred to in the description of the method embodiments.
[0172] It should be noted that the device, electronic device and storage medium in the embodiments of the present invention are respectively devices, electronic devices and storage media that apply the above-mentioned data super-resolution reconstruction method based on reference transformer. Therefore, all embodiments of the above-mentioned data super-resolution reconstruction method based on reference transformer are applicable to the device, electronic device and storage medium, and can achieve the same or similar beneficial effects.
[0173] The terminal device provided by the embodiments of the present invention can display proper nouns and / or fixed phrases for users to select, thereby reducing user input time and improving user experience.
[0174] This terminal device exists in various forms, including but not limited to:
[0175] (1) Mobile communication devices: These devices are characterized by their mobile communication capabilities and primarily aim to provide voice and data communication. These terminals include: smartphones (e.g., iPhones), multimedia phones, feature phones, and low-end phones, etc.
[0176] (2) Ultra-mobile personal computer devices: These devices fall under the category of personal computers, possessing computing and processing capabilities, and generally also have mobile internet access features. These terminals include PDAs, MIDs, and UMPCs, such as the iPad.
[0177] (3) Portable entertainment devices: These devices can display and play multimedia content. This category includes: audio and video players (such as iPods), handheld game consoles, e-books, as well as smart toys and portable car navigation devices.
[0178] (4) Other electronic devices with data interaction functions.
[0179] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus (devices), or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects, all of which are collectively referred to herein as "modules" or "systems." Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The computer program may be stored / distributed in a suitable medium, provided with or as part of other hardware, or may take other distribution forms, such as via the Internet or other wired or wireless telecommunications systems.
[0180] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0181] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0182] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.
Claims
1. A data super-resolution reconstruction method based on a reference transformer, characterized in that, include: Acquire the low-frequency load data to be converted, perform logarithmic and normalization processing on the low-frequency load data to be converted, and divide the data according to the conversion sequence length to obtain the preprocessed low-frequency load sequence to be converted. The preprocessed low-frequency load sequence to be converted is input into a qualified data super-resolution reconstruction model to obtain reconstructed super-resolution high-frequency data. The qualified data super-resolution reconstruction model includes a feature extraction module, an information supplementation module, and a super-resolution reconstruction module. The feature extraction module extracts features from the low-frequency load sequence to obtain low-frequency load features. The information supplementation module sequentially performs attention processing and feature fusion on the low-frequency load features to obtain enhanced high-frequency load features. The super-resolution reconstruction module performs continuous and periodic reconstruction on the enhanced high-frequency load features to obtain reconstructed super-resolution high-frequency data. The qualified data super-resolution reconstruction model is obtained through a training process including the following steps: Acquire training load data, which includes low-frequency training load data and high-frequency training load data; The training load data is subjected to sequence similarity calculation to obtain a low-frequency training load sequence; wherein, the sequence similarity calculation formula is expressed as: ;(1) in, It is the sequence length. It is by The number of sequences obtained by dividing the low-frequency training load data. It is a low-frequency training load sequence The The sequence of the nth period One element; The sequence similarity of each element in the low-frequency training load sequence is calculated according to the sequence similarity calculation formula; A sequence similarity graph is constructed based on the calculated sequence similarity. and the sequence similarity The minimum extreme point on the graph corresponds to As the length of the transformation sequence ; According to the length of the conversion sequence The low-frequency training load data is divided to obtain the low-frequency training load sequence. ; The continuous reconstruction factor and the periodic reconstruction factor are calculated using the low-frequency training load sequence; specifically, the calculation of the continuous reconstruction factor and the periodic reconstruction factor includes: Step A: Calculate the low-frequency training load sequence Corresponding time length , represented as: , The frequency of low-frequency training load data; Step B, Determine Corresponding high-frequency sequence ,calculate Approximate period ; Approximate period for: ; ;(2) in, For Fourier transform, For amplitude measurement operation; Step C: Calculate the approximate period The number of corresponding sequences , , The frequency of the high-frequency training load data; Step D, when If it is not an integer, then the magnitude in step B is second only to... The corresponding amplitude frequency Give Recalculate ; Step E, if If the integer is a prime number, then the minimum period is... Otherwise use Record the current cycle ; Step F: Repeat steps B and E until the minimum period is found. ; Step H, Passing the minimum cycle Calculate the periodic reconstruction factor and continuous reconstruction factor ,in And k is a positive integer. For the minimum reconstruction window, the super-resolution factor .
2. The data super-resolution reconstruction method based on a reference transformer according to claim 1, characterized in that, The step of inputting the preprocessed low-frequency load sequence to be converted into a qualified data super-resolution reconstruction model to obtain reconstructed super-resolution high-frequency data includes: The feature extraction module in the qualified data super-resolution reconstruction model extracts features from the preprocessed low-frequency load sequence to be converted, thereby obtaining the low-frequency load features to be converted. The information supplementation module in the data super-resolution reconstruction model that meets the conditions performs global attention and local attention processing on the low-frequency load features to be transferred to obtain the high-frequency load features to be transferred. Then, the reference high-frequency features are added to the high-frequency load features to be transferred to obtain the enhanced high-frequency features through matching attention. The enhanced high-frequency features are sequentially and periodically reconstructed by the super-resolution reconstruction module in the qualified data super-resolution reconstruction model to obtain reconstructed super-resolution high-frequency data.
3. The data super-resolution reconstruction method based on a reference transformer according to claim 1, characterized in that, The training process of the qualified data super-resolution reconstruction model includes: Obtain training load data; The training load data is subjected to sequence similarity calculation to obtain a low-frequency training load sequence. The continuous reconstruction factor and the periodic reconstruction factor are calculated using the low-frequency training load sequence. The training load data is subjected to logarithmic and standard normalization, and the data is divided according to the length of the transformation sequence to obtain the training load sequence; The training load sequence is divided into a reference set sequence and a model dataset sequence according to a preset ratio; The pre-constructed super-resolution data reconstruction model is trained using the reference set sequence and the model dataset sequence. During the training process, the parameters of the super-resolution data reconstruction model are continuously updated using the continuous reconstruction factor and the periodic reconstruction factor to obtain the super-resolution data reconstruction model that meets the conditions.
4. The data super-resolution reconstruction method based on a reference transformer according to claim 1, characterized in that, The training load data undergoes logarithmic and standard normalization processing, and is divided according to the transformation sequence length to obtain a training load sequence. The training load sequence is then divided according to a preset ratio to obtain a reference set sequence and a model dataset sequence, including: The low-frequency training load data and high-frequency training load data in the training load data are subjected to logarithmic and standard normalization processes, respectively, and the data is divided according to the length of the transformation sequence to obtain the low-frequency training load sequence and the high-frequency training load sequence. The low-frequency training load sequence and the high-frequency training load sequence are divided according to a preset ratio to obtain the corresponding low-frequency training load sequence. High-frequency training load sequences Reference low-frequency load sequence Reference high-frequency load sequence .
5. The data super-resolution reconstruction method based on a reference transformer according to claim 4, characterized in that, The step of continuously updating the parameters of the data super-resolution reconstruction model by the reference set sequence, the model dataset sequence, the continuous reconstruction factor, and the periodic reconstruction factor to obtain the data super-resolution reconstruction model that meets the conditions includes: The low-frequency training load sequence is processed by the feature extraction module. Reference low-frequency load sequence Reference high-frequency load sequence Feature extraction was performed separately to obtain the corresponding low-frequency training features. Reference low-frequency characteristics Reference high-frequency characteristics ; The information supplementation module includes: a global attention block, a local attention block, and a matching attention block. Each of the global attention block, the local attention block, and the matching attention block is equipped with at least one efficient transformer. The dot product attention mechanism of the encoder in the transformer is replaced with convolutional attention, which serves as the efficient transformer. Utilizing the global attention block for low-frequency training features and reference low-frequency characteristics Perform global self-attention separately to obtain Reference low-frequency characteristics after self-attention ; Using local attention blocks, train features from low frequency. Learn the corresponding high-frequency features ; Using matching attention block pairs and Matching attention is performed, attention weights are calculated, and high-frequency features are referenced based on these attention weights. Integration Among them, the enhanced high-frequency features ; In the super-resolution reconstruction module According to the continuous reconstruction factor and periodic reconstruction factor By sequentially performing continuous reconstruction and periodic reconstruction, a super-resolution reconstructed high-frequency sequence is obtained. , Indicates continuous reconstruction, Indicates periodic reconstruction, This represents a one-dimensional convolutional layer with kernel k. High-frequency sequences reconstructed using the super-resolution method High-frequency training load sequences The loss of the super-resolution reconstruction model of the data was calculated. ; in , ; Indicates the number of divisions; To the The parameters of the super-resolution data reconstruction model are continuously updated in the direction of descent until the preset number of iterations is reached, thus obtaining a super-resolution data reconstruction model that meets the conditions.
6. A data super-resolution reconstruction device based on a reference transformer, characterized in that, include: Acquisition unit and reconstruction unit; The acquisition unit is used to acquire low-frequency load data to be converted, perform logarithmic and normalization processing on the low-frequency load data to be converted, and divide the data according to the conversion sequence length to obtain a preprocessed low-frequency load sequence to be converted. The reconstruction unit is used to input the preprocessed low-frequency load sequence to be converted into a data super-resolution reconstruction model that meets the conditions, so as to obtain reconstructed super-resolution high-frequency data. The data super-resolution reconstruction model that meets the conditions includes: a feature extraction module, an information supplementation module, and a super-resolution reconstruction module. The feature extraction module is used to extract features from the low-frequency load sequence to obtain low-frequency load features. The information supplementation module is used to sequentially perform attention processing and feature fusion on the low-frequency load features to obtain enhanced high-frequency load features. The super-resolution reconstruction module is used to perform continuous reconstruction and periodic reconstruction on the enhanced high-frequency load features to obtain reconstructed super-resolution high-frequency data. The qualified data super-resolution reconstruction model is obtained through a training process including the following steps: Acquire training load data, which includes low-frequency training load data and high-frequency training load data; The training load data is subjected to sequence similarity calculation to obtain a low-frequency training load sequence; wherein, the sequence similarity calculation formula is expressed as: ;(1) in, It is the sequence length. It is by The number of sequences obtained by dividing the low-frequency training load data. It is a low-frequency training load sequence The The sequence of the nth period One element; The sequence similarity of each element in the low-frequency training load sequence is calculated according to the sequence similarity calculation formula; A sequence similarity graph is constructed based on the calculated sequence similarity. and the sequence similarity The minimum extreme point on the graph corresponds to As the length of the transformation sequence ; According to the length of the conversion sequence The low-frequency training load data is divided to obtain the low-frequency training load sequence. ; The continuous reconstruction factor and the periodic reconstruction factor are calculated using the low-frequency training load sequence; specifically, the calculation of the continuous reconstruction factor and the periodic reconstruction factor includes: Step A: Calculate the low-frequency training load sequence Corresponding time length , represented as: , The frequency of low-frequency training load data; Step B, Determine Corresponding high-frequency sequence ,calculate Approximate period ; Approximate period for: ; ;(2) in, For Fourier transform, For amplitude measurement operation; Step C: Calculate the approximate period The number of corresponding sequences , , The frequency of the high-frequency training load data; Step D, when If it is not an integer, then the magnitude in step B is second only to... The corresponding amplitude frequency Give Recalculate ; Step E, if If the integer is a prime number, then the minimum period is... Otherwise use Record the current cycle ; Step F: Repeat steps B and E until the minimum period is found. ; Step H, Passing the minimum cycle Calculate the periodic reconstruction factor and continuous reconstruction factor ,in And k is a positive integer. For the minimum reconstruction window, the super-resolution factor .
7. A data super-resolution reconstruction system based on a reference transformer, characterized in that, include: The system includes a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the system is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Video super-resolution reconstruction method based on space-time layering mask attention fusion
CN116468605A