Intelligent prediction method and system for hydroelectric energy consumption in target area
Through the improved Transformer model and multi-head attention mechanism processing multimodal data, the problem of difficulty in accurately predicting water and electricity energy consumption in the prior art is solved, and higher prediction accuracy and stability are achieved.
Patent Information
- Application Number
- CN202411655784.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-03-07
AI Technical Summary
Existing water and electricity consumption prediction methods are difficult to accurately capture complex seasonal changes and multimodal data, resulting in low prediction accuracy.
The improved Transformer model is used to combine multi-head attention mechanisms and improved sine and cosine position coding to process multimodal data (historical water and electricity consumption data, weather data and passenger flow data) for feature extraction and prediction.
It significantly improves the accuracy and stability of water and electricity consumption prediction, and can more accurately capture dependencies and complex seasonal changes in long time series.
Smart Images

Figure CN119578631A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of energy consumption data analysis, and specifically, to a method and system for intelligently predicting water and electricity energy consumption in a target area, and more specifically, to a method and system for intelligently predicting water and electricity energy consumption in a highway service area based on an improved Transformer model. Background Art
[0002] With the development of highway service areas, the management of water and electricity consumption has become increasingly important. As an important supporting facility of highways, the water and electricity consumption of service areas directly affects the operating costs and service quality. However, the existing energy consumption management methods mainly rely on traditional statistical and forecasting methods, which have many shortcomings and cannot meet the increasingly complex energy consumption management needs of service areas.
[0003] Existing energy consumption forecasting methods mainly include simple statistical methods, linear regression analysis, and time series analysis. Simple statistical methods use simple averages or weighted averages based on historical data to predict future energy consumption. This method is insensitive to data changes, cannot accurately capture seasonal and sudden changes, and has low prediction accuracy. Linear regression analysis fits energy consumption data based on a linear regression model to predict future energy consumption. Although this method is simple and easy to use, it is difficult to effectively deal with nonlinear and complex energy consumption changes, and the prediction results are often not accurate enough. Time series analysis uses time series models such as ARIMA to model and predict energy consumption data. Although time series models can capture the periodicity and trend changes of data, they perform poorly when dealing with long-term dependencies and high-frequency fluctuations, and require a large amount of historical data support.
[0004] With the development of artificial intelligence and big data technology, more and more researchers have begun to explore the use of deep learning models for energy consumption prediction. Common intelligent prediction methods include LSTM (Long Short-Term Memory Network), GRU (Gated Recurrent Unit) and traditional Transformer model. LSTM can effectively handle long-term dependency problems and is suitable for time series prediction, but it still has certain limitations when dealing with complex seasonal changes and multimodal data, with long training time and high computing resource consumption. As an improvement of LSTM, GRU has a simpler structure and faster training speed, but it is not as effective as LSTM when dealing with high-dimensional and long-time series. The traditional Transformer model performs well in natural language processing and sequence modeling, and has the advantages of parallel computing and long-distance dependency capture. However, when dealing with time series prediction, it is limited by the ability of position encoding and multimodal data fusion, making it difficult to achieve high-precision energy consumption prediction. Summary of the invention
[0005] In view of the defects in the prior art, the object of the present invention is to provide a method and system for intelligently predicting hydropower energy consumption in a target area.
[0006] According to the present invention, a method for intelligently predicting hydropower energy consumption in a target area includes:
[0007] Step S1: acquiring multimodal data in the target area, the multimodal data including historical water and electricity energy consumption data, weather data and passenger flow data; and preprocessing the acquired multimodal data to obtain preprocessed multimodal data;
[0008] Step S2: Use a multi-layer perceptron MLP to extract features from the preprocessed multimodal data, and concatenate the extracted features to form a unified large feature vector;
[0009] Step S3: Build an improved Transformer model;
[0010] Step S4: training and optimizing the constructed improved Transformer model to obtain the trained and optimized improved Transformer model;
[0011] Step S5: Using the trained and optimized improved Transformer model to intelligently predict the hydropower energy consumption in the target area;
[0012] The improved Transformer model realizes time series prediction based on multi-head attention mechanism and position encoding optimization.
[0013] Preferably, the step S1 comprises:
[0014] Step S1.1: cleaning and normalizing the acquired multimodal data in the target area;
[0015] Step S1.2: After cleaning and normalization, the multimodal data is subjected to data enhancement technology to add random noise and time series slice perturbations to generate diversified data samples.
[0016] Preferably, step S2 includes: a multilayer perceptron performs nonlinear transformation on the preprocessed multimodal data through a multilayer fully connected network to obtain a water and electricity energy consumption feature vector, a weather feature vector and a passenger flow feature vector; and concatenates the obtained water and electricity energy consumption feature vector, weather feature vector and passenger flow feature vector to obtain a unified large feature vector.
[0017] Preferably, the improved Transformer model includes: introducing a multi-head attention mechanism and a position encoding optimization mechanism based on the Transformer model;
[0018] By introducing the multi-head attention mechanism, the improved Transformer model can process the features in the time series in parallel in different subspaces, thereby identifying the dependencies between different time periods;
[0019] The position coding optimization mechanism is to enable the improved Transformer model to capture the order information of elements in the time series through improved sine and cosine position coding.
[0020] Preferably, the improved sine and cosine position encoding comprises:
[0021] For the (pos)th position and (2i)th dimension in the sequence, the position encoding is:
[0022]
[0023] For the (pos)th position and the (2i+1)th dimension,
[0024] Its position code is:
[0025]
[0026] Among them, d model Represents the dimensions of the model.
[0027] Preferably, step S4 comprises: using an Adam adaptive optimizer to train and optimize the constructed improved Transformer model to obtain a trained improved Transformer model; using a cross-validation method to evaluate the trained improved Transformer model; and at the same time, introducing a regularization method and an early stopping strategy during the training process;
[0028] The regularization method is to add a penalty term to the loss function;
[0029] The early stopping strategy is to stop training when the performance of the improved Transformer model on the validation set no longer improves by monitoring the loss on the validation set.
[0030] Preferably, the method further comprises: adjusting resource scheduling and management strategies in the target area in real time according to the prediction results to optimize energy consumption.
[0031] Preferably, the method also includes: displaying the comparison between the prediction results and the actual energy consumption through a visual interface; when the error between the prediction results and the actual energy consumption is less than a first preset value, it is judged that the prediction accuracy of the current improved Transformer model meets the preset requirements and can capture the law of energy consumption changes; when the error between the prediction results and the actual energy consumption is greater than the first preset value and less than the second preset value, the prediction accuracy of the current improved Transformer model does not meet the preset requirements, and the current improved Transformer model needs to be further trained and optimized; when the error between the prediction results and the actual energy consumption is greater than the second preset value, it is judged that certain equipment in the current target area is operating abnormally, and an early warning is triggered through the intelligent alarm system.
[0032] According to the present invention, a hydropower energy consumption intelligent prediction system in a target area includes:
[0033] Module M1: Acquire multimodal data in the target area, the multimodal data including historical water and electricity energy consumption data, weather data and passenger flow data; and preprocess the acquired multimodal data to obtain preprocessed multimodal data;
[0034] Module M2: Use multi-layer perceptron MLP to extract features from pre-processed multimodal data, and concatenate the extracted features to form a unified large feature vector;
[0035] Module M3: Building an improved Transformer model;
[0036] Module M4: training and optimizing the constructed improved Transformer model to obtain the improved Transformer model after training and optimization;
[0037] Module M5: Use the trained and optimized improved Transformer model to intelligently predict the hydropower energy consumption in the target area;
[0038] The improved Transformer model realizes time series prediction based on multi-head attention mechanism and position encoding optimization.
[0039] Preferably, the module M1 comprises:
[0040] Module M1.1: Clean and normalize the acquired multimodal data in the target area;
[0041] Module M1.2: After cleaning and normalization, random noise and time series slice disturbance are added to the multimodal data through data enhancement technology to generate diversified data samples;
[0042] The module M2 includes: a multi-layer perceptron performs nonlinear transformation on the pre-processed multimodal data through a multi-layer fully connected network to obtain a water and electricity energy consumption feature vector, a weather feature vector and a passenger flow feature vector; the obtained water and electricity energy consumption feature vector, weather feature vector and passenger flow feature vector are spliced to obtain a unified large feature vector;
[0043] The improved Transformer model includes: introducing a multi-head attention mechanism and a position encoding optimization mechanism based on the Transformer model;
[0044] By introducing the multi-head attention mechanism, the improved Transformer model can process the features in the time series in parallel in different subspaces, thereby identifying the dependencies between different time periods;
[0045] The position coding optimization mechanism is to enable the improved Transformer model to capture the order information of elements in the time series through improved sine and cosine position coding;
[0046] The improved sine and cosine position encoding comprises:
[0047] For the (pos)th position and (2i)th dimension in the sequence, the position encoding is:
[0048]
[0049] For the (pos)th position and the (2i+1)th dimension, the position encoding is:
[0050]
[0051] Among them, d model Represents the dimensions of the model;
[0052] The module M4 includes: using the Adam adaptive optimizer to train and optimize the constructed improved Transformer model to obtain the trained improved Transformer model; using the cross-validation method to evaluate the trained improved Transformer model; at the same time, during the training process, introducing a regularization method and an early stopping strategy;
[0053] The regularization method is to add a penalty term to the loss function;
[0054] The early stopping strategy is to stop training when the performance of the improved Transformer model on the validation set no longer improves by monitoring the loss on the validation set.
[0055] Compared with the prior art, the present invention has the following beneficial effects:
[0056] 1. The present invention integrates multimodal data, including historical energy consumption data, weather data, passenger flow data, etc., and introduces a multi-head attention mechanism and an adaptive optimization algorithm into the model, which can more accurately capture the dependencies and complex seasonal changes in long time series, and improve the prediction accuracy and stability;
[0057] 2. The present invention introduces a multi-head attention mechanism, which can perform parallel calculations in different subspaces and capture different levels of dependencies in long time series; compared with traditional RNN and LSTM models, the improved Transformer model can better handle long-term dependency problems;
[0058] 3. In order to solve the problem that the Transformer model cannot process sequence position information, improved sine and cosine position encoding is introduced to enable the model to better understand the order information in the time series and improve the prediction accuracy;
[0059] 4. In order to improve the model training efficiency and prediction accuracy, the present invention adopts an adaptive optimization algorithm (such as AdamW, Ranger, etc.) to automatically adjust the hyperparameters of the model. Compared with the traditional fixed hyperparameter optimization algorithm, the adaptive optimization algorithm can converge faster and prevent overfitting;
[0060] 5. By introducing data enhancement technology, the original data is disturbed and more diverse data samples are generated to improve the generalization ability of the model;
[0061] 6. The present invention also develops an intelligent resource management platform that can adjust the resource scheduling and management strategies in the target area in real time according to the prediction results to optimize energy consumption;
[0062] 7. The present invention can significantly improve the accuracy and stability of hydropower energy consumption forecasting in the target area, and provide an efficient and intelligent solution for energy consumption management in the target area. Compared with traditional statistical and forecasting methods, as well as existing deep learning models, the present invention has significant advantages in processing long-term dependencies, complex seasonal changes, and multimodal data. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0064] Figure 1 This is the architecture diagram of the intelligent prediction system for hydropower energy consumption in the target area.
[0065] Figure 2 Schematic diagram of the multi-head attention mechanism. DETAILED DESCRIPTION
[0066] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0067] Example 1
[0068] According to the present invention, a method for intelligently predicting water and electricity consumption in a highway service area is provided. Figures 1 to 2 As shown, including:
[0069] Step S1: acquiring multimodal data, including historical water and electricity energy consumption data, weather data, and passenger flow data; wherein the weather data includes temperature, precipitation, wind speed, etc.; and preprocessing the acquired multimodal data;
[0070] In this embodiment, the preprocessing of the acquired multimodal data includes: cleaning and normalizing the data to meet the input requirements of the model. Data enhancement technology is introduced to generate more diverse data samples by adding random noise and time series slice perturbation to the original data, thereby improving the generalization ability of the model.
[0071] In this embodiment, there are complex relationships between these data, which affect the water and electricity energy consumption in the service area. Through multimodal data fusion, the changing pattern of energy consumption can be more comprehensively reflected.
[0072] Step S2: extract features from different types of data and concatenate the extracted features;
[0073] In this embodiment, the data fusion layer uses a multi-layer perceptron (MLP) to process each data modality independently. MLP performs nonlinear transformation on the input data through a multi-layer fully connected network and gradually extracts high-order features. After each data modality is processed by the multi-layer perceptron, a feature vector of a specific length is generated, which represents the characteristics of data such as water and electricity energy consumption, weather and passenger flow. The nonlinear transformation capability of MLP can help to mine the implicit patterns in the data and improve the modeling ability of complex data relationships. After extracting the data features of different modalities, these features are spliced. The splicing method is to connect the feature vectors of each modality in series by dimension to form a unified large feature vector. In this way, different types of data features are integrated together to become a multi-dimensional input feature. This feature vector integrates the information of all modalities and can more comprehensively describe the water and electricity energy consumption in the service area. Finally, this unified feature representation will be input into the Transformer model, and the self-attention mechanism of the Transformer will be used to further learn the interdependence between features, thereby improving the accuracy of energy consumption prediction.
[0074] Step S3: Build an improved Transformer model;
[0075] In this embodiment, a time series prediction model based on the improved Transformer model is constructed, including a multi-head attention mechanism and position encoding optimization, which achieves efficient capture of long-term dependencies in time series data and improves the ability to understand sequence position information.
[0076] Multi-head attention mechanism: allows the model to process features in the time series in parallel in different subspaces, thereby identifying dependencies between different time periods, especially when processing long time series data, it has better performance than traditional RNN and LSTM models. The position encoding optimization enables the model to capture the order information of elements in the time series by improving the sine and cosine position encoding, solving the problem that the Transformer model cannot effectively process position information in the original design. Through these improvements, the model can not only model the temporal dependencies of time series more accurately, but also significantly improve the accuracy and generalization of predictions.
[0077] Position encoding optimization: In order to solve the problem that the Transformer model cannot process sequence position information, improved sine and cosine position encoding is introduced. By introducing position encoding, the model can better understand the sequential information in the time series and improve the prediction accuracy. The position encoding is essentially a vector containing the time series position information. It is added to the embedding vector of each input feature, telling the model the time position of each feature in the input sequence, allowing the model to distinguish elements at different positions in the sequence. Unlike RNN, position encoding introduces position information through mathematical functions, making the model have better translation invariance when processing sequences.
[0078] For the (pos)th position and (2i)th dimension in the sequence, the position encoding is:
[0079]
[0080] For the (pos)th position and the (2i+1)th dimension, the position encoding is:
[0081]
[0082] Where (d model ) is the dimension of the model.
[0083] The positional encoding is combined with the feature values in the input sequence by direct addition. For example, assuming that the input feature is a vector of dimension d after the embedding layer or linear transformation, the positional encoding will generate a vector of the same dimension and add it element by element to the input feature:
[0084] X′=X+PE
[0085] Where: X is the embedding vector of the input feature. PE is the position encoding vector generated according to the sequence position. X′ is the new feature vector after adding the position information.
[0086] In this way, the input features of each time step are given their corresponding position information. When processing these features, the model can not only learn the feature value of each time step, but also perceive the position of each time step in the entire sequence through position encoding, thereby maintaining the order of the time series.
[0087] Step S4: training the constructed improved Transformer model;
[0088] In the model training phase, the Adam adaptive optimization algorithm is used to improve the training efficiency and prediction accuracy of the model. The Adam algorithm can dynamically adjust the learning rate and gradient update step of the model, avoiding the problem of traditional fixed hyperparameter optimization methods easily falling into local optimality or too slow convergence during the training process. Through Adam optimization, the model can converge faster, thereby improving training efficiency, and the adaptive optimization mechanism can help the model find a better parameter combination and improve the overall prediction accuracy.
[0089] Then the model is trained using historical data. The model is evaluated using cross-validation. Cross-validation can effectively evaluate the performance of the model on different data sets, help identify the generalization ability of the model, and thus avoid the evaluation bias caused by a single training set. In each round of validation, the model is trained and evaluated multiple times on the training set and validation set to ensure that the model can perform stably under different data segmentations.
[0090] At the same time, in order to further optimize the model performance, this embodiment introduces hyperparameter tuning technology. Through the automated parameter tuning mechanism, the model can automatically adjust key parameters (including learning rate, batch size, and number of attention heads) according to the feedback during the training process to further improve the training effect of the model. This tuning technology avoids the tedious steps of manual parameter tuning and significantly improves the tuning efficiency.
[0091] In addition, in order to prevent the model from overfitting during training, regularization methods and early stopping strategies were introduced. L2 regularization prevents the model from overfitting the training data by adding a penalty term to the loss function, thereby improving the generalization ability. The early stopping strategy monitors the loss on the validation set and stops training in advance when the performance of the model on the validation set no longer improves significantly. This strategy effectively avoids overfitting of the model due to too long training time. Through these optimization steps, the entire training process is more efficient and stable, ensuring that the model can converge quickly while maintaining good generalization ability, and ultimately achieve high-precision prediction of hydropower energy consumption time series.
[0092] Step S5: Use the trained improved Transformer model to intelligently predict the water and electricity energy consumption of highway service areas.
[0093] In this embodiment, the method further includes: an intelligent resource management platform, which can adjust the resource scheduling and management strategy of the service area in real time according to the prediction results to optimize energy consumption. The platform includes a visual interface to display the comparison between the prediction results and the actual energy consumption, and an intelligent alarm system, which automatically issues an early warning when the predicted energy consumption exceeds the set threshold to prevent resource waste and equipment damage.
[0094] By comparing the prediction results with the actual energy consumption, the prediction accuracy of the model can be quantified and the performance of the model under different time periods and environmental conditions can be identified. If the error between the predicted value and the actual energy consumption is small, it means that the model is highly accurate and can effectively capture the pattern of energy consumption changes. If the error is large, the model or data can be further tuned to improve the prediction performance. Help identify potential anomalies. If the actual energy consumption is far beyond the predicted range, it may mean that some equipment in the service area is operating abnormally or has malfunctioned. At this time, the intelligent alarm system can issue an early warning based on the set energy consumption threshold, reminding managers to take timely measures to avoid equipment damage or further waste of resources.
[0095] The present invention also provides a highway service area water and electricity energy consumption intelligent prediction system, which can be implemented by executing the process steps of the highway service area water and electricity energy consumption intelligent prediction method, that is, those skilled in the art can understand the highway service area water and electricity energy consumption intelligent prediction method as a preferred implementation of the highway service area water and electricity energy consumption intelligent prediction system.
[0096] In actual application in highway service areas, the present invention accurately predicts future water and electricity energy consumption by analyzing historical water and electricity energy consumption data, weather data, and passenger flow data. For example, during the high temperature period in summer, the water and electricity energy consumption of a certain service area increases significantly due to increased passenger flow and increased frequency of air conditioning use. Through the prediction method of the present invention, resource scheduling arrangements can be made in advance to avoid energy waste and equipment overload. By modeling and analyzing energy consumption changes in different seasons and weather conditions, the present invention can provide service area managers with accurate energy consumption forecasts and management suggestions, improve resource utilization efficiency, and reduce operating costs.
[0097] Those skilled in the art know that, in addition to realizing the system and its various devices, modules, and units provided by the present invention in a purely computer-readable program code, it is entirely possible to realize the same functions in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered as a hardware component, and the devices, modules, and units included therein for realizing various functions can also be regarded as structures within the hardware component; the devices, modules, and units for realizing various functions can also be regarded as both software modules for realizing the method and structures within the hardware component.
[0098] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.
Claims
1. A method for intelligent prediction of hydropower energy consumption in a target area, characterized in that: include: Step S1: acquiring multimodal data in the target area, the multimodal data including historical water and electricity energy consumption data, weather data and passenger flow data; and preprocessing the acquired multimodal data to obtain preprocessed multimodal data; Step S2: Use a multi-layer perceptron MLP to extract features from the preprocessed multimodal data, and concatenate the extracted features to form a unified large feature vector; Step S3: Build an improved Transformer model; Step S4: training and optimizing the constructed improved Transformer model to obtain the trained and optimized improved Transformer model; Step S5: Using the trained and optimized improved Transformer model to intelligently predict the hydropower energy consumption in the target area; The improved Transformer model realizes time series prediction based on multi-head attention mechanism and position encoding optimization.
2. The method for intelligent prediction of hydropower energy consumption in a target area according to claim 1, characterized in that: The step S1 comprises: Step S1.1: cleaning and normalizing the acquired multimodal data in the target area; Step S1.2: After cleaning and normalization, the multimodal data is subjected to data enhancement technology to add random noise and time series slice perturbations to generate diversified data samples.
3. The method for intelligent prediction of hydropower energy consumption in a target area according to claim 1, characterized in that: The step S2 includes: a multi-layer perceptron performs nonlinear transformation on the preprocessed multimodal data through a multi-layer fully connected network to obtain a water and electricity energy consumption feature vector, a weather feature vector and a passenger flow feature vector; and the obtained water and electricity energy consumption feature vector, weather feature vector and passenger flow feature vector are spliced to obtain a unified large feature vector.
4. The method for intelligent prediction of hydropower energy consumption in a target area according to claim 1, characterized in that: The improved Transformer model includes: introducing a multi-head attention mechanism and a position encoding optimization mechanism based on the Transformer model; By introducing the multi-head attention mechanism, the improved Transformer model can process the features in the time series in parallel in different subspaces, thereby identifying the dependencies between different time periods; The position coding optimization mechanism is to enable the improved Transformer model to capture the order information of elements in the time series through improved sine and cosine position coding.
5. The method for intelligent prediction of hydropower energy consumption in a target area according to claim 4, characterized in that: The improved sine and cosine position encoding comprises: For the (pos)th position and (2i)th dimension in the sequence, the position encoding is: For the (pos)th position and the (2i+1)th dimension, the position encoding is: Among them, d model Represents the dimensions of the model.
6. The method for intelligent prediction of hydropower energy consumption in a target area according to claim 1, characterized in that: The step S4 includes: using the Adam adaptive optimizer to train and optimize the constructed improved Transformer model to obtain the trained improved Transformer model; using the cross-validation method to evaluate the trained improved Transformer model; and at the same time, introducing a regularization method and an early stopping strategy during the training process; The regularization method is to add a penalty term to the loss function; The early stopping strategy is to stop training when the performance of the improved Transformer model on the validation set no longer improves by monitoring the loss on the validation set.
7. The method for intelligent prediction of hydropower energy consumption in a target area according to claim 1, characterized in that: The method further includes: adjusting resource scheduling and management strategies in the target area in real time according to the prediction results to optimize energy consumption.
8. The method for intelligent prediction of hydropower energy consumption in a target area according to claim 1, characterized in that: The method also includes: displaying the comparison between the prediction result and the actual energy consumption through a visual interface; when the error between the prediction result and the actual energy consumption is less than a first preset value, it is judged that the prediction accuracy of the current improved Transformer model meets the preset requirements and can capture the law of energy consumption changes; when the error between the prediction result and the actual energy consumption is greater than the first preset value and less than the second preset value, the prediction accuracy of the current improved Transformer model does not meet the preset requirements, and the current improved Transformer model needs to be further trained and optimized; when the error between the prediction result and the actual energy consumption is greater than the second preset value, it is judged that some equipment in the current target area is operating abnormally, and an early warning is triggered through the intelligent alarm system.
9. An intelligent prediction system for hydropower energy consumption in a target area, characterized in that: include: Module M1: Acquire multimodal data in the target area, the multimodal data including historical water and electricity energy consumption data, weather data and passenger flow data; and preprocess the acquired multimodal data to obtain preprocessed multimodal data; Module M2: Use multi-layer perceptron MLP to extract features from pre-processed multimodal data, and concatenate the extracted features to form a unified large feature vector; Module M3: Building an improved Transformer model; Module M4: training and optimizing the constructed improved Transformer model to obtain the improved Transformer model after training and optimization; Module M5: Use the trained and optimized improved Transformer model to intelligently predict the hydropower energy consumption in the target area; The improved Transformer model realizes time series prediction based on multi-head attention mechanism and position encoding optimization.
10. The intelligent prediction system for hydropower energy consumption in the target area according to claim 9, characterized in that: The module M1 comprises: Module M1.1: Clean and normalize the acquired multimodal data in the target area; Module M1.2: After cleaning and normalization, random noise and time series slice disturbance are added to the multimodal data through data enhancement technology to generate diversified data samples; The module M2 includes: a multi-layer perceptron performs nonlinear transformation on the pre-processed multimodal data through a multi-layer fully connected network to obtain a water and electricity energy consumption feature vector, a weather feature vector and a passenger flow feature vector; the obtained water and electricity energy consumption feature vector, weather feature vector and passenger flow feature vector are spliced to obtain a unified large feature vector; The improved Transformer model includes: introducing a multi-head attention mechanism and a position encoding optimization mechanism based on the Transformer model; By introducing the multi-head attention mechanism, the improved Transformer model can process the features in the time series in parallel in different subspaces, thereby identifying the dependencies between different time periods; The position coding optimization mechanism is to enable the improved Transformer model to capture the order information of elements in the time series through improved sine and cosine position coding; The improved sine and cosine position encoding comprises: For the (pos)th position and (2i)th dimension in the sequence, the position encoding is: For the (pos)th position and the (2i+1)th dimension, the position encoding is: Among them, d model Represents the dimensions of the model; The module M4 includes: using the Adam adaptive optimizer to train and optimize the constructed improved Transformer model to obtain the trained improved Transformer model; using the cross-validation method to evaluate the trained improved Transformer model; at the same time, during the training process, introducing a regularization method and an early stopping strategy; The regularization method is to add a penalty term to the loss function; The early stopping strategy is to stop training when the performance of the improved Transformer model on the validation set no longer improves by monitoring the loss on the validation set.
Citation Information
Cited By
Method and system for predicting urban park visitor flow based on optimized CNN-LSTM model
CN121168766A
Method and system for predicting urban park flow based on an optimized cnn-lstm model
CN121168766B