A power demand prediction method based on deep learning

By constructing the MSPF-Net model and utilizing multi-scale feature fusion, grouped convolution, and pooling modules, the problem of incomplete feature extraction in existing power demand forecasting methods is solved, achieving efficient and accurate forecasting of power demand data.

CN120764767BActive Publication Date: 2025-12-23北京云弘科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510906493.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-02
Publication Date
2025-12-23
Estimated Expiration
2045-07-02

AI Technical Summary

Technical Problem

Existing electricity demand forecasting methods rely on single feature extraction methods, lack multi-scale adaptability, struggle to capture short-term fluctuations and long-term trends in electricity demand data, and suffer from low computational efficiency and an inability to effectively integrate the influence of multiple factors, resulting in insufficient forecast accuracy.

Method used

The MSPF-Net model is constructed by employing a multi-scale feature fusion module, a grouped convolution and weight fusion module, and a pooling and deformable concatenation convolution module, combined with spatial attention and the lightweight and efficient MobileNetv1. It captures electricity demand features through multi-scale convolution, dynamically adjusts the convolution kernel, and fuses multi-dimensional information to enhance feature representation capabilities.

Benefits of technology

It significantly improves the accuracy and efficiency of electricity demand forecasting, enabling more comprehensive extraction and fusion of spatiotemporal features from images, enhancing the model's adaptability to complex electricity data scenarios, and improving the scientific rigor and accuracy of forecasts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120764767B_ABST
    Figure CN120764767B_ABST
Patent Text Reader

Abstract

The application discloses to the technical field of power demand prediction, specifically a power demand prediction method based on deep learning, including the following specific steps: S1: obtaining a power demand prediction original data set; S2: preprocessing the power demand prediction original data set to obtain a power demand prediction image data set; S3: constructing a power demand prediction model for predicting power demand data; S4: dividing the power demand prediction image data set, training and verifying the power demand prediction model; S5: applying the power demand prediction model to obtain the predicted value of the hourly power demand of a target region in a future time period. When the power demand is predicted, the application can more comprehensively and accurately extract and fuse the spatial and temporal characteristics of images, significantly improving the prediction accuracy and efficiency in complex power data scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of power demand prediction, in particular to a power demand prediction method based on deep learning. BACKGROUND

[0002] In the modern intelligent management system of power grid, power demand prediction is a key link to ensure the stable operation and efficient dispatch of power grid, and its importance runs through the whole chain of energy production, transmission and consumption. Accurate demand prediction can provide real-time decision basis for power grid dispatching, ensure dynamic balance between power supply and demand, avoid power shortage or energy waste caused by load fluctuation, and is directly related to the safety and stability of power grid operation.

[0003] With the large-scale access of new energy, the diversification of load types and the increasing complexity of user electricity behavior, power demand presents strong nonlinearity, multi-time scale coupling and spatio-temporal correlation characteristics. Traditional prediction methods are difficult to meet the high precision requirements due to the dependence on single load sequence, the limitation of linear assumption and the insufficient external variable fusion capability. Specifically, the time series analysis method represented by ARIMA / SARIMA can only capture the trend and seasonality of a single sequence, and cannot effectively fuse multiple source influencing factors such as weather and electricity price. The adaptability to nonlinear fluctuations caused by extreme weather or new types of load (such as electric vehicle charging) is poor. Although statistical models such as multiple linear regression can include external variables, they are limited by linear assumptions and cannot depict the joint interaction effect of multiple factors such as temperature and electricity price on load.

[0004] Based on the above, the existing power demand prediction methods have the following problems:

[0005] 1. Single feature extraction, lack of multi-scale adaptability: most existing convolutional neural network methods use fixed-scale convolution kernels, which are difficult to capture both short-term fluctuation details and long-term trend in power demand data, resulting in incomplete feature extraction, insufficient mining ability of complex time patterns or multi-dimensional correlations, and affecting prediction accuracy.

[0006] 2. Existing CNN methods rarely use grouped convolution strategy, which is difficult to reduce computational complexity while enhancing feature extraction diversity, and the attention mechanism is single, which cannot deeply mine key features (such as the comprehensive influence of weather, holidays and other factors on electricity) in complex power demand data, and the use of power demand features under multi-factor interweaving is not sufficient, and the adaptability and robustness of the model to complex scenarios are insufficient.

[0007] 3. Existing methods often use single pooling operation (such as only maximum pooling or average pooling), which cannot balance the overall trend and significant change points of data, and performs poorly in handling large-scale data or resource-limited scenarios. SUMMARY

[0008] To solve the above technical problems, according to one aspect of the present application, the present application provides the following technical solutions:

[0009] A power demand prediction method based on deep learning, comprising the following specific steps:

[0010] S1: Obtain a power demand prediction original data set;

[0011] S2: Preprocess the power demand prediction original data set to obtain a power demand prediction image data set;

[0012] S3: Construct a power demand prediction model for predicting power demand data;

[0013] S4: Divide the power demand prediction image data set and train and verify the power demand prediction model;

[0014] S5: Apply the power demand prediction model to obtain the predicted value of the hourly power demand of a target region in a future time period.

[0015] As a preferred scheme of the power demand prediction method based on deep learning, the power demand prediction original data set comprises power consumption data, meteorological data, and social and economic data;

[0016] The power consumption data is collected by an intelligent power meter or a power information management system in real time, and the timestamp and power consumption data are stored by hour, day, month, and year granularity, wherein the power consumption data of the target region includes average load value, maximum load value, minimum load value, and total power consumption;

[0017] The meteorological data is obtained from the target region, and the timestamp and meteorological data are stored by hour, day, month, and year granularity, wherein the meteorological data of the target region includes temperature, humidity, wind speed, precipitation, atmospheric pressure, solar radiation intensity, and air pollution index;

[0018] The social and economic data is obtained by marking holidays through a calendar tool, and if the current day is a holiday, it is marked as 1, otherwise as 0; real-time electricity price of the target region is obtained; annual population data of the target region is obtained; GDP data of the target region is obtained, including annual gross production value and growth rate; industrial structure data of the target region is collected, including annual output value proportion of the first, second, and third industries; annual resident consumption level data of the target region is obtained.

[0019] As a preferred scheme of the power demand prediction method based on deep learning, the specific steps of S2 are as follows:

[0020] S21: splice the hourly electricity consumption data features of the target area with the meteorological data features to obtain an hour-level feature vector with a length of 11; then splice the 24 hour-level feature vectors in the order of 0:00 to 23:00 to obtain a single-day feature vector with a dimension of 264; finally, add a 1-dimensional holiday label and a 1-dimensional real-time electricity price data to obtain a 266-dimensional single-day complete feature vector;

[0021] S22: splice the 266-dimensional feature vectors of each day in a year in the order of date to obtain a 366x266 annual basic matrix with the same number of rows as the number of days in a year, which is unified to 366 rows by zero padding to be compatible with different number of days in a year; then splice the annual social and economic data, annual population data, annual gross regional product and growth rate, annual value-added proportion of the primary, secondary and tertiary industries, and annual resident consumption level data of the target area, and then expand them into 266-dimensional vectors with the same length by zero padding, fill 0 in the irrelevant dimensions, and add them as the last row of the matrix to finally form an annual matrix with a size of 367x266;

[0022] S23: sequentially perform S21-S22 on the data of three consecutive years to obtain three annual matrices with the same structure; then splice the three-year matrices in the order of time along the channel dimension to form a three-dimensional data matrix with a size of 367x266x3; finally, normalize all numerical features in the matrix by linear scaling to map the data range to the interval [0, 255];

[0023] S24: repeat S21-S23, and take the three-dimensional matrix obtained each time as an image to finally obtain a power demand prediction image dataset;

[0024] S25: manually label the generated images using an image labeling tool, and the label is defined as the hourly power demand value of the target area in a future time period after three consecutive years, and the labeling result is saved in the standard image label format JSON for subsequent model training and calling.

[0025] As a preferred scheme of the power demand prediction method based on deep learning, the specific steps of S3 are as follows:

[0026] S31: input the images in the power demand prediction picture dataset into a multi-scale feature fusion module to obtain a multi-scale time fusion feature map F11;

[0027] S32: input the multi-scale time fusion feature map F11 into a grouping convolution and weight fusion module to obtain a multi-dimensional data fusion feature map T11;

[0028] S33: input the multi-dimensional data fusion feature map T11 into a pooling and deformable splicing convolution module to obtain a power demand prediction feature vector G;

[0029] S34: input the power demand prediction feature vector G into an FFN to obtain a predicted value of the hourly power demand of the target region in a future time period.

[0030] As a preferred scheme of the power demand prediction method based on deep learning, the multi-scale feature fusion module is constructed and operated as follows:

[0031] S311: perform Conv3x3 convolution operation on the input power demand prediction image to obtain a multi-scale time fusion feature map F1;

[0032] S312: input the multi-scale time fusion feature map F1 into a multi-scale convolution submodule to capture features of different scales in the image, comprehensively enrich the feature expression, generate a multi-scale time fusion feature map F2, and then perform CBS operation on the multi-scale time fusion feature map F2 to optimize the feature expression and obtain a multi-scale time fusion feature map F3;

[0033] S313: process the multi-scale time fusion feature map F3 by using spatial attention to obtain a multi-scale time fusion feature map F4; then perform feature processing on F4 in two paths:

[0034] In the first path, perform transpose convolution operation on F4 to expand the spatial dimension of the image to obtain a multi-scale time fusion feature map F5; then input F5 into a multi-scale convolution submodule to generate a multi-scale time fusion feature map F6; subsequently, perform Conv1x1 convolution operation on F6 to obtain a multi-scale time fusion feature map F7;

[0035] In the second path, perform hole convolution operation on F4 to expand the receptive field without increasing the parameters, capture the long-distance dependence relationship of the image, and obtain a multi-scale time fusion feature map F8; then input F8 into a multi-scale convolution submodule to generate a multi-scale time fusion feature map F9; subsequently, perform Conv1x1 convolution operation on F9 to obtain a multi-scale time fusion feature map F10;

[0036] S314: finally, perform Concat operation on F7 and the multi-scale time fusion feature map F10 to obtain a multi-scale time fusion feature map F11;

[0037] The multi-scale convolution submodule is constructed and operated as follows:

[0038] First, the multi-scale temporal fusion feature map F1 is subjected to a Conv1×1 convolution operation to achieve cross-channel information integration and dimensionality adjustment, resulting in the multi-scale temporal fusion feature map Z1; subsequently, Z1 is processed through three paths:

[0039] In path one, a Conv3×3 convolution operation is performed on Z1 to extract local features, resulting in a multi-scale temporal fusion feature map Z2. Then, a Subsample operation is performed on Z2 to reduce the resolution and highlight the overall features, resulting in a multi-scale temporal fusion feature map Z3. Finally, a CBS operation is performed on Z3 to optimize the feature representation, resulting in a multi-scale temporal fusion feature map Z4.

[0040] In path two, a Conv5×5 convolution operation is performed on Z1 to capture medium-scale features, resulting in a multi-scale temporal fusion feature map Z5. Then, a CBS operation is performed on Z5 to enhance feature consistency and effectiveness, resulting in a multi-scale temporal fusion feature map Z6.

[0041] In path three, a Conv7×7 convolution operation is performed on Z1 to obtain large-scale features, resulting in a multi-scale temporal fusion feature map Z7. Then, an Upsample operation is performed on Z7 to restore the spatial dimension, resulting in a multi-scale temporal fusion feature map Z8. Finally, a CBS operation is performed on Z8 to obtain a multi-scale temporal fusion feature map Z9.

[0042] Next, Z4, Z6, and Z9 are added element-wise to integrate feature information at different scales and generate a multi-scale temporal fusion feature map Z10. Then, CBS operation is performed on Z10 to obtain a multi-scale temporal fusion feature map Z11. Finally, Z11 is processed using the Sigmoid activation function, and its output is multiplied element-wise with Z11 to output a multi-scale temporal fusion feature map F2.

[0043] As a preferred embodiment of the deep learning-based power demand forecasting method described in this invention, the construction and execution process of the grouped convolution and weight fusion module is as follows:

[0044] S321: Perform Conv1×1+BN+ReLU combined operation on the multi-scale time fusion feature map F11 to obtain the multi-dimensional data fusion feature map T1; where Conv1×1 convolution operation can effectively extract local features, batch normalization can stabilize the training process, and ReLU activation function can introduce non-linearity to capture complex feature relationships.

[0045] S322: Perform an asymmetric convolution operation on T1. Asymmetric convolution can capture more directional information with lower computational cost, resulting in a multi-dimensional data fusion feature map T2. Then, process T2 through three paths:

[0046] In path one, DWconv operation is performed on T2 to significantly reduce the amount of computation, resulting in a multidimensional data fusion feature map T3; then, dynamic convolution operation is performed on T3. Dynamic convolution can adaptively adjust the convolution kernel according to the input to enhance the targeting of feature extraction, resulting in a multidimensional data fusion feature map T4.

[0047] In path two, the DWconv operation is performed on T2 to obtain the multidimensional data fusion feature map T5, and then the CBS operation is performed on T5 to optimize the feature representation and obtain the multidimensional data fusion feature map T6.

[0048] In path three, a Conv3×3 convolution operation is performed on T2 to obtain a multidimensional data fusion feature map T7. Then, a dynamic convolution operation is performed on T7 to obtain a multidimensional data fusion feature map T8.

[0049] S323: Concatenate T4, T6, and T8 using the Concat operation to fuse feature information from different dimensions of multiple paths and generate a multi-dimensional data fusion feature map T9; then perform a CBS operation on T9 to optimize feature representation, enhance feature consistency and effectiveness, and obtain a multi-dimensional data fusion feature map T10.

[0050] S324: Input T10 into the weight fusion submodule to obtain the multi-dimensional data fusion feature map T11;

[0051] The construction and execution process of the weight fusion submodule is as follows:

[0052] First, T10 is subjected to a Conv1×1 convolution operation to achieve cross-channel information integration and dimensionality adjustment, outputting a multi-dimensional data fusion feature map S1; then, S1 is processed in three paths:

[0053] In path one, the MaxPool operation is performed on S1 to highlight the significant features, resulting in a multidimensional data fusion feature map S2. Then, after processing with the Sigmoid activation function, its output is multiplied element-wise with S2 to obtain the multidimensional data fusion feature map S3.

[0054] In path two, S1 is processed using the attention mechanism SeNet to output a multidimensional data fusion feature map S4, which is then optimized by CBS operation to obtain a multidimensional data fusion feature map S5.

[0055] In path three, the AvgPool operation is performed on S1 to extract global average information and obtain the multidimensional data fusion feature map S6. Then, after processing by the Sigmoid activation function, its output is multiplied element-wise with S6 to obtain the multidimensional data fusion feature map S7.

[0056] Then, S3 and S5 are concatenated using the Concat operation to obtain the multidimensional data fusion feature map S8; similarly, S7 and S5 are concatenated using the Concat operation to obtain the multidimensional data fusion feature map S10; CBS operation is performed on S8 to optimize the feature representation, resulting in the multidimensional data fusion feature map S9; CBS operation is performed on S10 to optimize the feature representation, resulting in the multidimensional data fusion feature map S11.

[0057] Next, S9 and S11 are added element by element to combine the feature advantages of different paths and generate a multi-dimensional data fusion feature map S12. Finally, a Conv1×1 convolution operation is performed on S12 to output a multi-dimensional data fusion feature map T11.

[0058] As a preferred embodiment of the deep learning-based power demand forecasting method described in this invention, the construction and operation process of the pooling and deformable convolutional module is as follows:

[0059] S331: The multidimensional data fusion feature map T11 is input into the pooling and deformable concatenation convolution module. The feature representation is optimized through CBS operation to obtain the power demand prediction feature map X1. Subsequently, X1 is processed in three ways:

[0060] In path one, the AvgPool operation is performed on X1 to extract global average information and obtain the power demand forecast feature map X2.

[0061] In path two, a Conv1×1 convolution operation is performed on X1 to integrate cross-channel information and adjust the dimensions to obtain the power demand prediction feature map X3.

[0062] In path three, a MaxPool operation is performed on X1 to highlight significant information, resulting in the electricity demand forecast feature map X4.

[0063] S332: Element-wise add X2 and X3, and fuse the average pooling and convolution features to obtain the power demand prediction feature map X5; perform deformable convolution operation on X5. Deformable convolution can adaptively adjust the sampling position of the convolution kernel to better capture features of irregular shapes, resulting in the power demand prediction feature map X6; finally, perform Conv1×1 convolution operation on X6 to optimize the feature dimension and cross-channel information, resulting in the power demand prediction feature map X7.

[0064] S333: Perform element-wise addition of X3 and X4, and combine the advantages of max pooling and convolution to obtain the power demand prediction feature map X8; then, perform deformable convolution on X8 to obtain the power demand prediction feature map X9; finally, perform Conv1×1 convolution to optimize the feature dimension and cross-channel information to obtain the power demand prediction feature map X10.

[0065] S334: Use the Concat operation to concatenate X7 and X10, and fuse different path features to obtain the power demand prediction feature map X11; then perform the CBS operation on X11 to obtain the power demand prediction feature map X12.

[0066] S335: Utilize the lightweight and efficient MobileNetv1 to extract deep features from X12, and obtain the power demand prediction feature vector G.

[0067] As a preferred embodiment of the deep learning-based electricity demand forecasting method described in this invention, the specific steps of step S4 are as follows:

[0068] S41: In the training process of the electricity demand forecasting model, the model parameters and hyperparameters are first initialized. The model weights and biases are given reasonable initial values ​​through normal or uniform distribution strategies. At the same time, key hyperparameters are set, and a cosine annealing decay strategy is combined to make the learning rate decrease with a cosine curve as training progresses, avoiding convergence oscillations. With the help of the warm-up mechanism, the learning rate is gradually increased in the early stage of training to prevent parameter update overshoot.

[0069] S42: Divide the power demand forecast image dataset into non-overlapping training, validation, and test sets; the training set is used for gradient descent optimization of model parameters; the validation set monitors the model's generalization ability and avoids overfitting risk after each training round; and the test set performs final performance evaluation of the model after training is completed. The training and validation sets are divided into fixed-size batches using a data loader, and the training set batches are randomly shuffled to enhance the model's feature learning ability. At the same time, multi-threaded preloading is used to improve data processing efficiency.

[0070] S43: During the training iteration phase, training set data is input into the model in batches, and predicted values ​​are generated through forward propagation. The training loss is calculated using the mean squared error (MSE) loss function, and the model parameters are updated through backpropagation. After each round, validation set data is input in batches to calculate the validation loss. The model is based on an automatic differentiation mechanism and dynamically adjusts the parameters according to the training and validation losses. When the validation loss no longer decreases for several consecutive rounds and the fluctuation is less than a set threshold, it is determined that convergence has been achieved, training is terminated, and the optimal parameter state is saved for subsequent inference. The training of the power demand forecasting model is then complete.

[0071] As a preferred embodiment of the deep learning-based electricity demand forecasting method described in this invention, the specific steps of S5 are as follows:

[0072] S51: Input the electricity demand forecast image of the target area into the model, wherein the electricity demand forecast image has the same structure as any one of the electricity demand forecast images in the electricity demand forecast image dataset constructed by S2.

[0073] S52: Finally, obtain the hourly electricity demand forecast for the target area over a future time period.

[0074] Compared with existing technologies:

[0075] This invention, when forecasting electricity demand, can extract and fuse spatiotemporal features from images more comprehensively and accurately, significantly improving the prediction accuracy and efficiency in complex electricity data scenarios. Through a multi-scale feature fusion module, leveraging multi-scale convolution and spatial attention mechanisms, it effectively enhances the ability to capture short-term load fluctuations and long-term electricity consumption trends, solving the problem of incomplete single-scale feature extraction. The grouped convolution and weighted fusion module reduces computational load by utilizing grouped convolution, while the dynamic convolution and weighted fusion sub-modules focus on key factors, resolving the challenges of low computational efficiency and insufficient capture of key information. The pooling and deformable concatenation convolution module combines the advantages of average and max pooling with deformable convolution, preserving overall features while highlighting extreme values, improving the representation of complex patterns and avoiding information loss caused by focusing on a single feature. These modules work together to significantly improve the model's adaptability to the strong nonlinearity, multi-scale coupling, and spatiotemporal correlation of electricity demand, enhancing the scientific rigor and accuracy of the prediction. Attached Figure Description

[0076] Figure 1 This is a schematic diagram of the overall process of the present invention;

[0077] Figure 2 This is a schematic diagram of the main structure of the MSPF-Net of the present invention;

[0078] Figure 3 This is a structural diagram of the multi-scale feature fusion module of the present invention;

[0079] Figure 4 This is a structural diagram of the multi-scale convolutional submodule of the present invention;

[0080] Figure 5 This is a structural diagram of the grouped convolution and weight fusion module of the present invention;

[0081] Figure 6 This is a structural diagram of the weight fusion submodule of the present invention;

[0082] Figure 7 This is a structural diagram of the pooling and deformable splicing convolution module of the present invention;

[0083] Figure 8 This is an experimental graph showing the predicted hourly electricity demand for a target region over the next three months, based on the present invention. Detailed Implementation

[0084] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.

[0085] This invention provides a deep learning-based method for electricity demand forecasting. Please refer to [link / reference]. Figures 1-8 This invention proposes a power demand prediction model called MSPF-Net (Multi-Scale PowerForecaster Network) to predict power demand data for a target region. This model improves the richness and accuracy of feature representation while effectively controlling computational complexity through multi-scale feature extraction, attention-guided key information capture, and diversified pooling fusion. It can more accurately mine hidden patterns in power demand image data, providing more efficient and reliable feature representations for power demand prediction, thereby improving prediction accuracy and model generalization ability. The flowchart of the technical solution of this invention is shown below. Figure 1 As shown; the main structure of MSPF-Net is as follows Figure 2 As shown;

[0086] The specific steps of a deep learning-based electricity demand forecasting method are as follows:

[0087] S1: Obtain the raw dataset for electricity demand forecasting;

[0088] To construct a raw dataset for electricity demand forecasting, key data needs to be collected through multiple channels. This raw dataset includes electricity consumption data, meteorological data, and socioeconomic data.

[0089] The electricity consumption data is collected in real time from the target area by smart meters or power information management systems (such as SCADA), and the timestamps and electricity consumption data are stored in the granularity of hours, days, months and years. The electricity consumption data of the target area includes the average load value, the maximum load value, the minimum load value and the total electricity consumption.

[0090] Among them, SCADA (Supervisory Control And Data Acquisition) is a data acquisition and monitoring control system. SCADA systems are computer-based DCS and power automation monitoring systems; in power systems, SCADA systems are the most widely used and technologically mature. It plays a crucial role in remote control systems, enabling the monitoring and control of field equipment to achieve functions such as data acquisition, equipment control, measurement, parameter adjustment, and various signal alarms.

[0091] The meteorological data refers to the meteorological data of the target area (e.g., obtained by calling the meteorological API from OpenWeather Map or China Weather Network), and the timestamps and meteorological data are stored in the granularity of hours, days, months and years. The meteorological data of the target area includes temperature, humidity, wind speed, precipitation, atmospheric pressure, solar radiation intensity and air pollution index.

[0092] Open Weather Map is an open-source platform that provides weather data services, allowing users to access real-time, historical, and forecast weather data from around the world.

[0093] The socioeconomic data is obtained by marking holidays using a calendar tool; if a day is a holiday, it is marked as 1, otherwise as 0; real-time electricity prices in the target region are obtained; annual population data of the target region is obtained; GDP data of the target region is obtained, including the region's annual gross domestic product and growth rate; industrial structure data of the target region is collected, including the annual output value ratio of the primary, secondary, and tertiary industries; and annual resident consumption level data of the target region is obtained.

[0094] S2: Preprocess the raw dataset of electricity demand forecasting to obtain an image dataset of electricity demand forecasting;

[0095] The specific steps of S2 are as follows:

[0096] S21: Concatenate the hourly electricity consumption data features of the target area with the meteorological data features to obtain an hourly feature vector of length 11; then concatenate the 24-hour feature vectors in the order of 0:00 to 23:00 to obtain a 264-dimensional daily feature vector; finally, add a 1-dimensional holiday label and a 1-dimensional real-time electricity price data to obtain a 266-dimensional complete daily feature vector.

[0097] S22: Concatenate the 266-dimensional feature vectors of each day of the year in chronological order to obtain a 366×266 annual basic matrix with the same number of rows as the number of days in the year. Pad zeros to unify it into 366 rows to accommodate differences in the number of days in different years. Then, concatenate the annual socio-economic data, annual population data, annual GDP and growth rate of the region, the annual output value ratio of the primary, secondary and tertiary industries, and annual residents' consumption level data of the target region. Then, expand it into a 266-dimensional vector of equal length by padding zeros. Fill irrelevant dimensions with 0s to add as the last row of the matrix, and finally form an annual matrix of size 367×266.

[0098] S23: Perform S21-S22 sequentially on the data for three consecutive years to obtain three 367×266 annual matrices with the same structure; then, stitch the three-year matrices together along the channel dimension in chronological order to form a three-dimensional data matrix of size 367×266×3; finally, normalize all numerical features in the matrix and map the data range to the interval [0,255] by linear scaling.

[0099] S24: Repeat S21-S23, treating the three-dimensional matrix obtained each time as an image, and finally obtain the power demand prediction image dataset;

[0100] S25: Use an image annotation tool to manually annotate the generated images. The labels are defined as the hourly electricity demand values ​​for the target area over a future time period three consecutive years. The annotation results are saved as standard image label format JSON for easy loading and calling during subsequent model training.

[0101] LabelImg is an open-source image annotation tool primarily used for labeling image datasets for tasks such as object detection and image segmentation.

[0102] S3: Build an electricity demand forecasting model to predict electricity demand data;

[0103] This invention designs a deep learning-based power demand forecasting model, MSPF-Net (Multi-Scale Power Forecaster Network). The process of using MSPF-Net to predict power demand data consists of three steps: multi-scale feature extraction and fusion, grouped convolution and weight fusion analysis, and pooling and deformable convolution processing. These three main steps correspond to the three modules of the MSPF-Net model: the multi-scale feature fusion module, the grouped convolution and weight fusion module, and the pooling and deformable convolution module.

[0104] in:

[0105] Spatial attention: Spatial attention is a technique in deep learning that focuses on key regions in the feature map space. By generating a spatial weight map, the model focuses on the location of the target (such as the outline of an object or a textured area), suppresses irrelevant background information, and thus improves the accuracy of target localization and feature representation.

[0106] Transposed convolution: A key operation in deep learning to enlarge the size of feature maps. Essentially, it maps low-resolution feature maps to high-resolution spaces by rearranging the positions of input features and performing convolution operations.

[0107] Dilated convolution: A convolution operation that expands the receptive field by introducing "holes" (the spacing is controlled by the dilation rate) into the standard convolution kernel. It achieves an exponential increase in the coverage of the convolution kernel without increasing too many parameters and computational cost, which is significantly superior to the linear growth of traditional convolution.

[0108] Concat is a feature fusion operation commonly used in deep learning models, widely applied due to its efficient structural design and low computational complexity. By concatenating multiple feature maps along the channel dimension, it integrates information from different layers or paths, enhancing the model's expressive power. Concat, which concatenates multiple convolutional feature maps along the channel dimension, is widely used in multi-path feature fusion and cross-layer feature connections, enhancing the model's expressive capabilities.

[0109] Asymmetric convolution: A convolution technique that optimizes computational efficiency through structural decomposition. It splits the traditional square convolution kernel (such as 3×3) into a combination of two one-dimensional convolution kernels (such as 1×3 and 3×1), which significantly reduces the number of parameters and computational cost while maintaining the receptive field, thus significantly improving computational efficiency.

[0110] Dynamic convolution: A deep learning technique that breaks through the limitations of traditional static convolution. It departs from the fixed kernel parameters and dynamically generates kernel parameters based on the input data through attention mechanisms or weight fusion strategies. In actual operation, the model assigns different weights to each input sample and adaptively combines the basic convolution kernels to more accurately capture data features.

[0111] DWconv is a depthwise separable convolution operation where the convolution kernel operates independently on each input channel, extracting spatial features from a single channel of the input feature map without cross-channel weight sharing. It preserves the unique information of each channel of the input feature map while significantly reducing computation and parameter count. It efficiently captures local patterns in data while reducing computational complexity.

[0112] Deformable convolution: A convolution technique that adaptively adjusts the sampling position, breaking the limitations of fixed grid sampling in traditional convolution. By learning an additional set of offsets on the fixed sampling points of the standard convolution kernel, it enables the convolution kernel to dynamically adjust the sampling position according to the input features, thus more flexibly capturing irregularly shaped targets or complex textures.

[0113] MaxPool: A commonly used pooling method that reduces data dimensionality and extracts important features by selecting the maximum value within a local region.

[0114] AvgPool: A pooling method used to reduce the spatial dimension of feature maps while preserving the average feature information of local regions.

[0115] MobileNetv1: A widely used lightweight deep learning model, known for its efficient architecture and low computational complexity. It significantly reduces model parameters and computational cost. Thanks to this design, MobileNetv1 can deliver powerful performance with low computational overhead on resource-constrained devices (such as mobile devices), making it a model of lightweight model design.

[0116] FFN: A feedforward neural network, one of the fundamental structures of neural networks. It uses fully connected layers for feature extraction and mapping, and is widely used in tasks such as classification, regression, and feature embedding; it is an existing technique.

[0117] The specific steps of S3 are as follows:

[0118] S31: Input the images in the power demand forecast image dataset into the multi-scale feature fusion module to obtain the multi-scale time fusion feature map F11;

[0119] In the multi-scale feature fusion module, multi-scale convolution is used to capture short-term load fluctuations and long-term electricity consumption patterns, covering the multi-temporal granularity coupling characteristics of power data. A spatial attention mechanism is introduced to focus on key feature areas such as temperature and humidity combinations during high-temperature periods and load troughs during holidays, suppressing redundant information and increasing the influence weight of factors such as meteorology and electricity prices. Transposed convolution restores spatial details, and dilated convolution mines intertemporal dependencies, taking into account both micro-fluctuations and macro-trend analysis. High-frequency details and low-frequency trend features are fused after parallel processing, integrating multi-dimensional information such as load values ​​and meteorological parameters to construct a spatiotemporally correlated composite feature representation. This effectively improves the model's ability to represent multi-scale coupled and strongly nonlinear load scenarios, providing support for accurate prediction. The structure of the multi-scale feature fusion module is as follows: Figure 3 As shown.

[0120] The construction and operation process of the multi-scale feature fusion module is as follows:

[0121] S311: Perform a Conv3×3 convolution operation on the input electricity demand prediction image to obtain the multi-scale temporal fusion feature map F1;

[0122] S312: Input the multi-scale temporal fusion feature map F1 into the multi-scale convolution submodule to capture features at different scales in the image, enrich the feature expression, generate the multi-scale temporal fusion feature map F2, and then perform CBS operation on the multi-scale temporal fusion feature map F2 to optimize the feature expression and obtain the multi-scale temporal fusion feature map F3.

[0123] S313: Spatial attention is used to process the multi-scale temporal fusion feature map F3 to obtain the multi-scale temporal fusion feature map F4; then, feature processing is performed on F4 through two paths:

[0124] In path one, F4 is transposed and convolved to expand the spatial dimension of the image, resulting in a multi-scale temporal fusion feature map F5. F5 is then input into the multi-scale convolution submodule to generate a multi-scale temporal fusion feature map F6. Subsequently, F6 is convolved using Conv1×1 to obtain a multi-scale temporal fusion feature map F7.

[0125] In path two, dilated convolution is performed on F4 to expand the receptive field without increasing the parameters, capture long-distance dependencies in the image, and obtain multi-scale temporal fusion feature map F8; then F8 is input into the multi-scale convolution submodule to generate multi-scale temporal fusion feature map F9; then Conv1×1 convolution is performed on F9 to obtain multi-scale temporal fusion feature map F10.

[0126] S314: Finally, the F7 and multi-scale temporal fusion feature map F10 are concatenated by the Concat operation to obtain the multi-scale temporal fusion feature map F11;

[0127] CBS operation is a basic convolutional module that extracts local features of an image using a 3×3 convolutional kernel, then performs batch normalization (BatchNorm) to stabilize the feature distribution, and introduces nonlinearity through an activation function to enhance the model's feature representation capability.

[0128] The structure of the multi-scale convolution module in the multi-scale feature fusion module is as follows: Figure 4 As shown;

[0129] The construction and operation process of the multi-scale convolutional submodule is as follows:

[0130] First, the multi-scale temporal fusion feature map F1 is subjected to a Conv1×1 convolution operation to achieve cross-channel information integration and dimensionality adjustment, resulting in the multi-scale temporal fusion feature map Z1; subsequently, Z1 is processed through three paths:

[0131] In path one, a Conv3×3 convolution operation is performed on Z1 to extract local features, resulting in a multi-scale temporal fusion feature map Z2. Then, a Subsample operation is performed on Z2 to reduce the resolution and highlight the overall features, resulting in a multi-scale temporal fusion feature map Z3. Finally, a CBS operation is performed on Z3 to optimize the feature representation, resulting in a multi-scale temporal fusion feature map Z4.

[0132] In path two, a Conv5×5 convolution operation is performed on Z1 to capture medium-scale features, resulting in a multi-scale temporal fusion feature map Z5. Then, a CBS operation is performed on Z5 to enhance feature consistency and effectiveness, resulting in a multi-scale temporal fusion feature map Z6.

[0133] In path three, a Conv7×7 convolution operation is performed on Z1 to obtain large-scale features, resulting in a multi-scale temporal fusion feature map Z7. Then, an Upsample operation is performed on Z7 to restore the spatial dimension, resulting in a multi-scale temporal fusion feature map Z8. Finally, a CBS operation is performed on Z8 to obtain a multi-scale temporal fusion feature map Z9.

[0134] Next, Z4, Z6, and Z9 are added element-wise to integrate feature information at different scales and generate a multi-scale temporal fusion feature map Z10. Then, CBS operation is performed on Z10 to obtain a multi-scale temporal fusion feature map Z11. Finally, Z11 is processed using the Sigmoid activation function, and its output is multiplied element-wise with Z11 to output a multi-scale temporal fusion feature map F2.

[0135] The beneficial effects of the multi-scale convolution submodule: This module captures features at different scales through multi-scale convolution, and combines different convolution kernels, upsampling, downsampling and CBS operations to achieve feature optimization and fusion, thereby enhancing feature representation ability and diversity.

[0136] S32: Input the multi-scale temporal fusion feature map F11 into the grouped convolution and weight fusion module to obtain the multi-dimensional data fusion feature map T11;

[0137] The DWconv (Depthwise Separable Convolution) operation in the grouped convolution and weighted fusion module significantly reduces computational cost. Multiple convolutions are combined to enrich feature representation from different perspectives. Dynamic convolution operations adaptively adjust the convolution kernel based on the input, enhancing the specificity of feature extraction. The Concat operation concatenates and fuses features from different paths, enriching feature dimensions, while the CBS operation repeatedly regularizes and optimizes feature quality. In the weighted fusion submodule, features are weighted and fused, highlighting key features and suppressing redundancy, achieving efficient processing of multi-dimensional data fusion features and integration of multi-dimensional information. The grouped convolution and weighted fusion module not only improves the efficiency and quality of feature extraction and fusion but also enhances the model's generalization ability, enabling it to stably and accurately predict electricity demand in target areas.

[0138] The structure of the grouped convolution and weight fusion module is as follows: Figure 5 As shown;

[0139] The construction and execution process of the grouped convolution and weight fusion module is as follows:

[0140] S321: Perform Conv1×1+BN+ReLU combined operation on the multi-scale time fusion feature map F11 to obtain the multi-dimensional data fusion feature map T1; where Conv1×1 convolution operation can effectively extract local features, batch normalization (BN) can stabilize the training process, and ReLU activation function can introduce nonlinearity to capture complex feature relationships.

[0141] S322: Perform an asymmetric convolution operation on T1. Asymmetric convolution can capture more directional information with lower computational cost, resulting in a multi-dimensional data fusion feature map T2. Then, process T2 through three paths:

[0142] In path one, DWconv (Depthwise Separable Convolution) is performed on T2 to significantly reduce the amount of computation, resulting in a multidimensional data fusion feature map T3; then, dynamic convolution is performed on T3. Dynamic convolution can adaptively adjust the convolution kernel according to the input to enhance the targeting of feature extraction, resulting in a multidimensional data fusion feature map T4.

[0143] In path two, the DWconv operation is performed on T2 to obtain the multidimensional data fusion feature map T5, and then the CBS operation is performed on T5 to optimize the feature representation and obtain the multidimensional data fusion feature map T6.

[0144] In path three, a Conv3×3 convolution operation is performed on T2 to obtain a multidimensional data fusion feature map T7. Then, a dynamic convolution operation is performed on T7 to obtain a multidimensional data fusion feature map T8.

[0145] S323: Concatenate T4, T6, and T8 using the Concat operation to fuse feature information from different dimensions of multiple paths and generate a multi-dimensional data fusion feature map T9; then perform a CBS operation on T9 to optimize feature representation, enhance feature consistency and effectiveness, and obtain a multi-dimensional data fusion feature map T10.

[0146] S324: Input T10 into the weight fusion submodule to obtain the multi-dimensional data fusion feature map T11;

[0147] The structure of the weight fusion submodule is as follows: Figure 6 As shown;

[0148] The construction and execution process of the weight fusion submodule is as follows:

[0149] First, T10 is subjected to a Conv1×1 convolution operation to achieve cross-channel information integration and dimensionality adjustment, outputting a multi-dimensional data fusion feature map S1; then, S1 is processed in three paths:

[0150] In path one, MaxPool is performed on S1 to highlight salient features and obtain multidimensional data fusion feature map S2. Then, after processing with the Sigmoid activation function, its output is multiplied element-wise with S2 to obtain multidimensional data fusion feature map S3.

[0151] In path two, S1 is processed using the attention mechanism SeNet to output a multidimensional data fusion feature map S4, which is then optimized by CBS operation to obtain a multidimensional data fusion feature map S5.

[0152] In path three, S1 is subjected to AvgPool (average pooling) operation to extract global average information and obtain multidimensional data fusion feature map S6. Then, after processing by the Sigmoid activation function, its output is multiplied element-wise with S6 to obtain multidimensional data fusion feature map S7.

[0153] Then, S3 and S5 are concatenated using the Concat operation to obtain the multidimensional data fusion feature map S8; similarly, S7 and S5 are concatenated using the Concat operation to obtain the multidimensional data fusion feature map S10; CBS operation is performed on S8 to optimize the feature representation, resulting in the multidimensional data fusion feature map S9; CBS operation is performed on S10 to optimize the feature representation, resulting in the multidimensional data fusion feature map S11.

[0154] Next, S9 and S11 are added element by element to combine the feature advantages of different paths and generate a multi-dimensional data fusion feature map S12. Finally, a Conv1×1 convolution operation is performed on S12 to output a multi-dimensional data fusion feature map T11.

[0155] The beneficial effects of the weighted fusion submodule: This submodule focuses on key features through SeNet, and performs fusion operations with features by combining max pooling with Sigmoid and average pooling with Sigmoid, thereby suppressing redundancy and filtering and strengthening features for multi-dimensional data fusion, thus improving the efficiency and quality of feature extraction and fusion.

[0156] S33: Input the multidimensional data fusion feature map T11 into the pooling and deformable concatenation module to obtain the power demand prediction feature vector G;

[0157] In the pooling and deformable concatenation convolution module, average pooling and max pooling are combined to obtain global average information and saliency information respectively. Simultaneously, Conv1×1 convolution integrates cross-channel information to achieve multi-dimensional feature extraction and comprehensively characterize electricity demand data. Deformable convolution adaptively adjusts the sampling position to accurately capture irregular patterns and complex trends in electricity demand data. By element-wise addition and concatenation of features from different paths, Conv1×1 convolution and CBS operations optimize feature dimensions and representation, improving feature quality. Finally, lightweight and efficient MobileNetv1 is used to extract deep features, achieving fast and accurate electricity demand prediction while reducing computational and parameter requirements, meeting the efficiency and accuracy demands of practical applications. The structure of the pooling and deformable concatenation convolution module is as follows: Figure 7 As shown.

[0158] The construction and operation process of the pooling and deformable convolution module is as follows:

[0159] S331: The multidimensional data fusion feature map T11 is input into the pooling and deformable concatenation convolution module. The feature representation is optimized through CBS operation to obtain the power demand prediction feature map X1. Subsequently, X1 is processed in three ways:

[0160] In path one, the AvgPool operation is performed on X1 to extract global average information and obtain the power demand forecast feature map X2.

[0161] In path two, a Conv1×1 convolution operation is performed on X1 to integrate cross-channel information and adjust the dimensions to obtain the power demand prediction feature map X3.

[0162] In path three, MaxPool operation is performed on X1 to highlight significant information, resulting in the electricity demand forecast feature map X4.

[0163] S332: Element-wise add X2 and X3, and fuse the average pooling and convolution features to obtain the power demand prediction feature map X5; perform deformable convolution operation on X5. Deformable convolution can adaptively adjust the sampling position of the convolution kernel to better capture features of irregular shapes, resulting in the power demand prediction feature map X6; finally, perform Conv1×1 convolution operation on X6 to optimize the feature dimension and cross-channel information, resulting in the power demand prediction feature map X7.

[0164] S333: Perform element-wise addition of X3 and X4, and combine the advantages of max pooling and convolution to obtain the power demand prediction feature map X8; then, perform deformable convolution on X8 to obtain the power demand prediction feature map X9; finally, perform Conv1×1 convolution to optimize the feature dimension and cross-channel information to obtain the power demand prediction feature map X10.

[0165] S334: Use the Concat operation to concatenate X7 and X10, and fuse different path features to obtain the power demand prediction feature map X11; then perform the CBS operation on X11 to obtain the power demand prediction feature map X12.

[0166] S335: Utilize the lightweight and efficient MobileNetv1 to extract deep features from X12, and obtain the power demand prediction feature vector G.

[0167] S34: Input the electricity demand forecast feature vector G into FFN to obtain the hourly electricity demand forecast for the target area over a future time period.

[0168] S3 Implementation Example:

[0169] S31: Input the images from the electricity demand forecast image dataset into the multi-scale feature fusion module. The image size is 367×266 pixels and the number of channels is the electricity demand forecast image.

[0170] First, the input power demand prediction image, with a size of 367×266 pixels and 3 channels, undergoes a Conv3×3 convolution operation to obtain a multi-scale temporal fusion feature map F1 with a size of 512×512 pixels and 64 channels. Then, the multi-scale temporal fusion feature map F1 is input into a multi-scale convolution submodule for processing, resulting in a multi-scale temporal fusion feature map F2 with a size of 512×512 pixels and 128 channels. Finally, a CBS operation is performed on the multi-scale temporal fusion feature map F2 to obtain a multi-scale temporal fusion feature map F3 with a size of 512×512 pixels and 128 channels.

[0171] Next, spatial attention is used to process the multi-scale temporal fusion feature map F3, resulting in a multi-scale temporal fusion feature map F4 with a size of 512×512 pixels and 128 channels. Then, F4 is processed using two paths:

[0172] (1) In path one, F4 is transposed and convolved to obtain a multi-scale temporal fusion feature map F5 with a size of 1024×1024 pixels and 64 channels. Then, F5 is input into the multi-scale convolution sub-module to generate a multi-scale temporal fusion feature map F6 with a size of 1024×1024 pixels and 128 channels. Then, F6 is convolved with Conv1×1 to obtain a multi-scale temporal fusion feature map F7 with a size of 512×512 pixels and 64 channels.

[0173] (2) In path two, dilated convolution is performed on F4 to obtain a multi-scale temporal fusion feature map F8 with a size of 512×512 pixels and 64 channels. Then, F8 is input into the multi-scale convolution sub-module to generate a multi-scale temporal fusion feature map F9 with a size of 512×512 pixels and 128 channels. Subsequently, Conv1×1 convolution is performed on F9 to obtain a multi-scale temporal fusion feature map F10 with a size of 512×512 pixels and 64 channels.

[0174] Finally, F7 and the multi-scale temporal fusion feature map F10 are concatenated to obtain the multi-scale temporal fusion feature map F11, which has a size of 512×512 pixels and 128 channels.

[0175] In the multi-scale convolution submodule, firstly, the input multi-scale temporal fusion feature map F1, with a size of 512×512 pixels and 64 channels, is subjected to a Conv1×1 convolution operation to obtain a multi-scale temporal fusion feature map Z1, also with a size of 512×512 pixels and 64 channels. Next, feature processing is performed on Z1 through three paths:

[0176] (1) In path one, perform Conv3×3 convolution operation on Z1 to obtain a multi-scale time fusion feature map Z2 with a size of 1024×1024 pixels and 64 channels; perform downsampling operation on Z2 to obtain a multi-scale time fusion feature map Z3 with a size of 512×512 pixels and 64 channels; then perform CBS operation on Z3 to obtain a multi-scale time fusion feature map Z4 with a size of 512×512 pixels and 128 channels.

[0177] (2) In path two, perform Conv5×5 convolution operation on Z1 to obtain a multi-scale temporal fusion feature map Z5 with a size of 512×512 pixels and 64 channels; then perform CBS operation on Z5 to obtain a multi-scale temporal fusion feature map Z6 with a size of 512×512 pixels and 128 channels.

[0178] (3) In path three, perform Conv7×7 convolution operation on Z1 to obtain a multi-scale time fusion feature map Z7 with a size of 256×256 pixels and 64 channels; perform upsampling operation on Z7 to obtain a multi-scale time fusion feature map Z8 with a size of 512×512 pixels and 64 channels; then perform CBS operation on F8 to obtain a multi-scale time fusion feature map Z9 with a size of 512×512 pixels and 128 channels.

[0179] Element-wise addition of Z4, Z6, and Z9 yields a multi-scale temporal fusion feature map Z10 with a size of 512×512 pixels and 128 channels. CBS operation is then performed on Z10 to obtain a multi-scale temporal fusion feature map Z11 with a size of 512×512 pixels and 128 channels. Finally, Z11 is processed using the Sigmoid activation function and then multiplied element-wise with Z11 to obtain a multi-scale temporal fusion feature map F2 with a size of 512×512 pixels and 128 channels.

[0180] In the grouped convolution and weighted fusion module of S32, firstly, a multi-scale temporal fusion feature map F11 with a size of 512×512 pixels and 128 channels is input and subjected to a Conv1×1+BN+ReLU combination operation to obtain a multi-dimensional data fusion feature map T1 with a size of 512×512 pixels and 128 channels. Then, an asymmetric convolution operation is performed on T1 to obtain a multi-dimensional data fusion feature map T2 with a size of 512×512 pixels and 128 channels. Next, feature processing is performed on T2 through three paths:

[0181] (1) In path one, perform DWconv operation on T2 to obtain a multidimensional data fusion feature map T3 with a size of 512×512 pixels and 128 channels. Then perform dynamic convolution operation on T3 to obtain a multidimensional data fusion feature map T4 with a size of 512×512 pixels and 128 channels;

[0182] (2) In path two, DWconv operation is performed on T2 to obtain a multidimensional data fusion feature map T5 with a size of 512×512 pixels and 128 channels. Then CBS operation is performed on T5 to obtain a multidimensional data fusion feature map T6 with a size of 512×512 pixels and 128 channels.

[0183] (3) In path three, perform Conv3×3 operation on T2 to obtain a multidimensional data fusion feature map T7 with a size of 512×512 pixels and 128 channels. Then perform dynamic convolution operation on T5 to obtain a multidimensional data fusion feature map T8 with a size of 512×512 pixels and 128 channels.

[0184] By performing a Concat operation on T4, T6, and T8, a multidimensional data fusion feature map T9 with a size of 512×512 pixels and 384 channels is obtained. Then, a CBS operation is performed on T9 to obtain a multidimensional data fusion feature map T10 with a size of 512×512 pixels and 128 channels. Finally, T10 is input into the weight fusion submodule to obtain a multidimensional data fusion feature map T11 with a size of 512×512 pixels and 128 channels.

[0185] In the weighted fusion submodule, firstly, a multi-dimensional data fusion feature map T10 with a size of 512×512 pixels and 128 channels is input and subjected to a Conv1×1 convolution operation to obtain a multi-dimensional data fusion feature map S1 with a size of 512×512 pixels and 128 channels. Subsequently, feature processing is performed on the multi-dimensional data fusion feature map S1 through three paths:

[0186] (1) In path one, the multidimensional data fusion feature map S1 is subjected to MaxPool operation to obtain a multidimensional data fusion feature map S2 with a size of 512×512 pixels and 128 channels; the multidimensional data fusion feature map S2 is subjected to Sigmoid and then multiplied element-wise to obtain a multidimensional data fusion feature map S3 with a size of 512×512 pixels and 128 channels.

[0187] (2) In path two, the multidimensional data fusion feature map S1 is subjected to SeNet operation to obtain a multidimensional data fusion feature map S4 with a size of 512×512 pixels and 128 channels; the multidimensional data fusion feature map S4 is subjected to CBS operation to obtain a multidimensional data fusion feature map S5 with a size of 512×512 pixels and 128 channels.

[0188] (3) In path three, the multidimensional data fusion feature map S1 is subjected to the AvgPool operation to obtain the multidimensional data fusion feature map S6 with a size of 512×512 pixels and 128 channels; the multidimensional data fusion feature map S6 is subjected to the Sigmoid function and then multiplied element-wise to obtain the multidimensional data fusion feature map S7 with a size of 512×512 pixels and 128 channels.

[0189] Next, a concat operation is performed on the multidimensional data fusion feature map S3 and S5 to obtain a multidimensional data fusion feature map S8 with a size of 512×512 pixels and 256 channels; a concat operation is performed on the multidimensional data fusion feature map S7 and S5 to obtain a multidimensional data fusion feature map S10 with a size of 512×512 pixels and 256 channels. A CBS operation is performed on S8 to obtain a multidimensional data fusion feature map S9 with a size of 512×512 pixels and 128 channels; a CBS operation is performed on the multidimensional data fusion feature map S10 to obtain a multidimensional data fusion feature map S11 with a size of 512×512 pixels and 128 channels. Then, an element-wise addition operation is performed on the multidimensional data fusion feature maps S9 and S11 to obtain a multidimensional data fusion feature map S12 with a size of 512×512 pixels and 128 channels. Finally, a Conv1×1 convolution operation is performed on the multidimensional data fusion feature map S12 to obtain the multidimensional data fusion feature map T11.

[0190] In the pooling and deformable concatenation convolution module of S33, firstly, a multi-dimensional data fusion feature map T11 with a size of 512×512 pixels and 128 channels is input and subjected to CBS operation to obtain a power demand prediction feature map X1 with a size of 512×512 pixels and 128 channels. Then, feature processing is performed on the power demand prediction feature map X1 through three paths:

[0191] (1) In path one, perform AvgPool operation on the power demand prediction feature map X1 to obtain the power demand prediction feature map X2 with a size of 512×512 pixels and 128 channels.

[0192] (2) In path two: Perform Conv1×1 operation on the power demand prediction feature map X1 to obtain the power demand prediction feature map X3 with a size of 512×512 pixels and 128 channels;

[0193] (3) In path three, the power demand prediction feature map X1 is subjected to MaxPool operation to obtain the power demand prediction feature map X4 with a size of 512×512 pixels and 128 channels.

[0194] Next, the power demand forecast feature map X2 and the power demand forecast feature map X3 are added element-wise to obtain the power demand forecast feature map X5, which has a size of 512×512 pixels and 128 channels. Then, deformable convolution operation is performed on the power demand forecast feature map X5 to obtain the power demand forecast feature map X6, which has a size of 512×512 pixels and 128 channels. Finally, Conv1×1 operation is performed on the power demand forecast feature map X6 to obtain the power demand forecast feature map X7, which has a size of 512×512 pixels and 128 channels.

[0195] The power demand forecast feature map X4 and the power demand forecast feature map X3 are added element-wise to obtain a power demand forecast feature map X8 with a size of 512×512 pixels and 128 channels. Then, a deformable convolution operation is performed on the power demand forecast feature map X8 to obtain a power demand forecast feature map X9 with a size of 512×512 pixels and 128 channels. Finally, a Conv1×1 operation is performed on the power demand forecast feature map X9 to obtain a power demand forecast feature map X10 with a size of 512×512 pixels and 128 channels.

[0196] Next, the electricity demand forecast feature map X7 and the electricity demand forecast feature map X10 are concatenated using a Concat operation to obtain an electricity demand forecast feature map X11 with a size of 512×512 pixels and 256 channels. A CBS operation is then performed on the electricity demand forecast feature map X11 to obtain an electricity demand forecast feature map X12 with a size of 512×512 pixels and 256 channels. Finally, the electricity demand forecast feature map X12 is input into MobileNetv1, and after network processing, the electricity demand forecast feature map is transformed into one-dimensional data, resulting in the electricity demand forecast feature vector G.

[0197] S4: Divide the image dataset for electricity demand forecasting and train and validate the electricity demand forecasting model;

[0198] The specific steps of S4 are as follows:

[0199] S41: In the training process of the electricity demand forecasting model, the model parameters and hyperparameters are first initialized. The model weights and biases are given reasonable initial values ​​through normal or uniform distribution strategies. At the same time, key hyperparameters such as training epochs, batch size, optimizer (such as Adam, SGD) and initial learning rate are set. In addition, a cosine annealing decay strategy is used to make the learning rate decrease with a cosine curve as training progresses, avoiding convergence oscillations. With the help of a warm-up mechanism, the learning rate is gradually increased in the early stage of training to prevent parameter update overshoot.

[0200] S42: Divide the power demand forecast image dataset into non-overlapping training, validation, and test sets; the training set is used for gradient descent optimization of model parameters; the validation set monitors the model's generalization ability and avoids overfitting risk after each training round; and the test set performs final performance evaluation of the model after training is completed. The training and validation sets are divided into fixed-size batches using a data loader, and the training set batches are randomly shuffled to enhance the model's feature learning ability. At the same time, multi-threaded preloading is used to improve data processing efficiency.

[0201] S43: During the training iteration phase, training set data is input into the model in batches, and predicted values ​​are generated through forward propagation. The training loss is calculated using the mean squared error (MSE) loss function, and the model parameters are updated through backpropagation. After each round, validation set data is input in batches to calculate the validation loss. The model is based on an automatic differentiation mechanism and dynamically adjusts the parameters according to the training and validation losses. When the validation loss no longer decreases for several consecutive rounds and the fluctuation is less than a set threshold, it is determined that convergence has been achieved, training is terminated, and the optimal parameter state is saved for subsequent inference. The training of the power demand forecasting model is then complete.

[0202] S4 Implementation:

[0203] When training the electricity demand forecasting model, the original dataset is first divided into training, validation, and test sets at a ratio of 70%, 20%, and 10% to ensure no overlap among the three sets. The training epochs are set to 100, the batch size to 10, and the Adam optimizer is selected with an initial learning rate of 0.01 and a weight decay of 0.0005 to balance training efficiency and model regularization. During training, if the validation set loss does not improve for 10 consecutive epochs, the learning rate is halved to promote convergence. When the validation set loss no longer decreases, the model is considered to have basically converged and training ends.

[0204] S5: Apply the electricity demand forecasting model to obtain the hourly electricity demand forecast for the target area over a future time period.

[0205] The trained electricity demand forecasting model is used to forecast electricity demand in the target region. First, the electricity demand forecast image of the target region is input into the model, where the structure of the electricity demand forecast image is the same as any one of the electricity demand forecast images in the electricity demand forecast image dataset constructed by S2; finally, the hourly electricity demand forecast values ​​for the target region in the future time period are obtained.

[0206] S5 Example: In the actual experiment of this patent, the predicted hourly electricity demand of a target area for the next three months was finally obtained, such as... Figure 8 As shown.

[0207] Although the present invention has been described above with reference to embodiments, various modifications can be made and components can be replaced with equivalents without departing from the scope of the invention. In particular, as long as there is no structural conflict, the features in the disclosed embodiments can be combined with each other in any manner. The lack of an exhaustive description of these combinations in this specification is merely for the sake of brevity and resource conservation. Therefore, the present invention is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.

Claims

1. A deep learning-based power demand prediction method, characterized by, The specific steps include: S1: obtaining a power demand prediction original data set; S2: preprocessing the power demand prediction original data set to obtain a power demand prediction image data set, wherein the power demand prediction image is a three-dimensional matrix formed by preprocessing power consumption data, meteorological data and social and economic data; S3: constructing a power demand prediction model for predicting power demand data, and the specific steps are as follows: S31: inputting the image in the power demand prediction picture data set into a multi-scale feature fusion module to obtain a multi-scale time fusion feature map F11, and the specific construction and operation process is as follows: S311: performing Conv3x3 convolution operation on the input power demand prediction image to obtain a multi-scale time fusion feature map F1; S312: inputting the multi-scale time fusion feature map F1 into a multi-scale convolution submodule for operation to capture features of different scales in the image, comprehensively enrich the feature expression, generate a multi-scale time fusion feature map F2, and then perform CBS operation on the multi-scale time fusion feature map F2 to optimize the feature expression and obtain a multi-scale time fusion feature map F3; S313: processing the multi-scale time fusion feature map F3 using spatial attention to obtain a multi-scale time fusion feature map F4; then processing the multi-scale time fusion feature map F4 in two paths: In path one, performing transpose convolution operation on the multi-scale time fusion feature map F4 to expand the spatial dimension of the image to obtain a multi-scale time fusion feature map F5; then inputting the multi-scale time fusion feature map F5 into a multi-scale convolution submodule for operation to generate a multi-scale time fusion feature map F6; subsequently performing Conv1x1 convolution operation on the multi-scale time fusion feature map F6 to obtain a multi-scale time fusion feature map F7; In path two, performing dilated convolution operation on the multi-scale time fusion feature map F4 to expand the receptive field without increasing the parameters, capture the long-distance dependence relationship of the image, and obtain a multi-scale time fusion feature map F8; then inputting the multi-scale time fusion feature map F8 into a multi-scale convolution submodule for operation to generate a multi-scale time fusion feature map F9; subsequently performing Conv1x1 convolution operation on the multi-scale time fusion feature map F9 to obtain a multi-scale time fusion feature map F10; S314: finally, performing Concat operation to splice the multi-scale time fusion feature map F7 and the multi-scale time fusion feature map F10 to obtain a multi-scale time fusion feature map F11; The construction and operation process of the multi-scale convolution submodule is as follows: First, performing Conv1x1 convolution operation on the multi-scale time fusion feature map F1 to realize cross-channel information integration and dimension adjustment to obtain a multi-scale time fusion feature map Z1; subsequently, processing the multi-scale time fusion feature map Z1 in three paths: In path one, the multi-scale time fusion feature map Z1 is subjected to a Conv3×3 convolution operation to extract local features, obtaining a multi-scale time fusion feature map Z2, and then the multi-scale time fusion feature map Z2 is subjected to a Subsample operation to reduce the resolution to highlight overall features, obtaining a multi-scale time fusion feature map Z3, and then the multi-scale time fusion feature map Z3 is subjected to a CBS operation to optimize feature expression, obtaining a multi-scale time fusion feature map Z4; In path two, the multi-scale time fusion feature map Z1 is subjected to a Conv5×5 convolution operation to capture medium-scale features, obtaining a multi-scale time fusion feature map Z5, and then the multi-scale time fusion feature map Z5 is subjected to a CBS operation to enhance feature consistency and effectiveness, obtaining a multi-scale time fusion feature map Z6; In path three, the multi-scale time fusion feature map Z1 is subjected to a Conv7×7 convolution operation to obtain large-scale features, obtaining a multi-scale time fusion feature map Z7, and then the multi-scale time fusion feature map Z7 is subjected to an Upsample operation to restore the spatial dimension, obtaining a multi-scale time fusion feature map Z8, and then the multi-scale time fusion feature map Z8 is subjected to a CBS operation, obtaining a multi-scale time fusion feature map Z9; Then, the multi-scale time fusion feature map Z4, the multi-scale time fusion feature map Z6, and the multi-scale time fusion feature map Z9 are subjected to an element-wise addition operation to integrate different scale feature information, generating a multi-scale time fusion feature map Z10; then the multi-scale time fusion feature map Z10 is subjected to a CBS operation, obtaining a multi-scale time fusion feature map Z11; finally, the multi-scale time fusion feature map Z11 is processed using a Sigmoid activation function, and the output thereof is subjected to an element-wise multiplication operation with the multi-scale time fusion feature map Z11, outputting a multi-scale time fusion feature map F2; S32: inputting the multi-scale time fusion feature map F11 into a grouped convolution and weight fusion module to obtain a multi-dimensional data fusion feature map T11, S33: inputting the multi-dimensional data fusion feature map T11 into a pooling and deformable concatenation convolution module to obtain a power demand prediction feature vector G; S34: inputting the power demand prediction feature vector G into an FFN to obtain a predicted value of hourly power demand of a target region in a future time period; S4: dividing a power demand prediction image data set to train and verify a power demand prediction model; S5: applying the power demand prediction model to obtain a predicted value of hourly power demand of a target region in a future time period. 2.The power demand prediction method based on deep learning according to claim 1, characterized in that, The power demand prediction original data set includes: power consumption data, meteorological data, and social and economic data; The power consumption data is collected by a smart meter or a power information management system in real time, and the time stamp and power consumption data are stored by hour, day, month, and year granularity, wherein the power consumption data of the target region includes average load value, maximum load value, minimum load value, and total power consumption; The meteorological data is the meteorological data of the target area, which is stored in time stamp and meteorology with hour, day, month and year granularity, and the meteorological data of the target area includes temperature, humidity, wind speed, precipitation, atmospheric pressure, solar radiation intensity and air pollution index; The social and economic data is marked by a calendar tool to mark holidays, and if the day is a holiday, it is marked as 1, otherwise as 0; real-time electricity price of the target area is obtained; annual population data of the target area is obtained; annual GDP data of the target area is obtained, including annual total output value and growth rate of the target area; industrial structure data of the target area is collected, including annual output value proportion of the first, second and third industries; annual resident consumption level data of the target area is obtained. 3.The power demand prediction method based on deep learning according to claim 1, characterized in that, The specific steps of S2 are as follows: S21: splice the hourly electricity consumption data features of the target area with the meteorological data features to obtain an 11-length hour-level feature vector; then splice the 24 hour-level feature vectors in the order of 0:00 to 23:00 to obtain a 264-dimensional daily feature vector; finally, add a 1-dimensional holiday label and a 1-dimensional real-time electricity price data, and finally obtain a 266-dimensional complete daily feature vector; S22: splice the 266-dimensional feature vectors of each day in a year in date order to obtain a 366x266 annual basic matrix with the same number of rows and number of days in a year, which is unified to 366 rows by zero padding to accommodate different number of days in a year; then splice the annual social and economic data of the target area, the annual population data, the annual total output value and the growth rate of the target area, the annual output value proportion of the first, second and third industries, and the annual resident consumption level data, and then expand them to equal-length 266-dimensional vectors by zero padding, fill 0 in the irrelevant dimensions, and append them as the last row of the matrix, finally form an annual matrix with a size of 367x266; S23: sequentially execute S21-S22 on the continuous three-year data to obtain three 367x266 annual matrices with consistent structure; then splice the three-year matrices in time order along the channel dimension to form a three-dimensional data matrix with a size of 367x266x3; finally, normalize all numerical features in the matrix by linear scaling to map the data range to the interval [0, 255]; S24: repeat S21-S23, and regard the three-dimensional matrix obtained each time as an image to finally obtain the power demand prediction image dataset; S25: use an image labeling tool to manually label the generated images, and the label is defined as the hourly power demand value of the target area in a future time period for the next three years, and the labeling result is saved in the standard image label format JSON for subsequent model training and calling. 4.The power demand prediction method based on deep learning of claim 1, wherein, The construction and execution process of the grouping convolution and weight fusion module is as follows: S321: perform Conv1x1+BN+RELU combined operation on the multi-scale time fusion feature map F11 to obtain a multi-dimensional data fusion feature map T1; Wherein, the Conv1x1 convolution operation can effectively extract local features, batch normalization can stabilize the training process, and the ReLU activation function can introduce nonlinearity to capture complex feature relationships; S322: Asymmetric convolution operation is performed on the multi-dimensional data fusion feature map T1, the asymmetric convolution can capture more directional information at a lower computational cost, and a multi-dimensional data fusion feature map T2 is obtained, and then the multi-dimensional data fusion feature map T2 is processed in three paths: In path one, DWconv operation is performed on the multi-dimensional data fusion feature map T2 to greatly reduce the calculation amount, and a multi-dimensional data fusion feature map T3 is obtained; then dynamic convolution operation is performed on the multi-dimensional data fusion feature map T3, the dynamic convolution can adaptively adjust the convolution kernel according to the input, enhance the feature extraction pertinence, and obtain a multi-dimensional data fusion feature map T4; In path two, DWconv operation is performed on the multi-dimensional data fusion feature map T2 to obtain a multi-dimensional data fusion feature map T5, and then CBS operation is performed on the multi-dimensional data fusion feature map T5 to optimize the feature expression, and a multi-dimensional data fusion feature map T6 is obtained; In path three, Conv3x3 convolution operation is performed on the multi-dimensional data fusion feature map T2 to obtain a multi-dimensional data fusion feature map T7, and then dynamic convolution operation is performed on the multi-dimensional data fusion feature map T7 to obtain a multi-dimensional data fusion feature map T8; S323: The multi-dimensional data fusion feature maps T4, T6 and T8 are spliced by Concat operation to fuse the different dimensional feature information of the multi-path, and a multi-dimensional data fusion feature map T9 is generated; CBS operation is performed on the multi-dimensional data fusion feature map T9 to optimize the feature expression, enhance the consistency and effectiveness of the feature, and obtain a multi-dimensional data fusion feature map T10; S324: The multi-dimensional data fusion feature map T10 is input into the weight fusion sub-module to obtain a multi-dimensional data fusion feature map T11; The construction and execution process of the weight fusion sub-module is as follows: Firstly, Conv1x1 convolution operation is performed on the multi-dimensional data fusion feature map T10 to realize cross-channel information integration and dimension adjustment, and a multi-dimensional data fusion feature map S1 is output; then, feature processing is performed on S1 in three paths: In path one, MaxPool operation is performed on the multi-dimensional data fusion feature map S1 to highlight the significant features, and a multi-dimensional data fusion feature map S2 is obtained, and then the output is processed by Sigmoid activation function, and the element-wise multiplication operation is performed between the output and the multi-dimensional data fusion feature map S2 to obtain a multi-dimensional data fusion feature map S3; In path two, the multi-dimensional data fusion feature map S1 is processed by using the attention mechanism SeNet, and a multi-dimensional data fusion feature map S4 is output, and then CBS operation is performed to optimize the feature expression, and a multi-dimensional data fusion feature map S5 is obtained; In path three, AvgPool operation is performed on the multi-dimensional data fusion feature map S1 to extract global average information, and a multi-dimensional data fusion feature map S6 is obtained, and then the output is processed by Sigmoid activation function, and the element-wise multiplication operation is performed between the output and the multi-dimensional data fusion feature map S6 to obtain a multi-dimensional data fusion feature map S7; Then, the multi-dimensional data fusion feature map S3 is spliced with the multi-dimensional data fusion feature map S5 through a Concat operation to obtain a multi-dimensional data fusion feature map S8; and the multi-dimensional data fusion feature map S7 is spliced with the multi-dimensional data fusion feature map S5 through a Concat operation to obtain a multi-dimensional data fusion feature map S10; The multi-dimensional data fusion feature map S8 is subjected to a CBS operation to optimize feature expression, and a multi-dimensional data fusion feature map S9 is obtained; The multi-dimensional data fusion feature map S10 is subjected to a CBS operation to optimize feature expression, and a multi-dimensional data fusion feature map S11 is obtained; Next, the multi-dimensional data fusion feature map S9 and the multi-dimensional data fusion feature map S11 are added element by element to fuse the feature advantages of different paths, and a multi-dimensional data fusion feature map S12 is generated; finally, the multi-dimensional data fusion feature map S12 is subjected to a Conv1x1 convolution operation, and a multi-dimensional data fusion feature map T11 is output. 5.The power demand prediction method based on deep learning according to claim 1, characterized in that, The construction and operation process of the pooling and deformable splicing convolution module are as follows: S331: The multi-dimensional data fusion feature map T11 is input into the pooling and deformable splicing convolution module, the feature expression is optimized through a CBS operation, and a power demand prediction feature map X1 is obtained; then the power demand prediction feature map X1 is processed in three paths: In the first path, the power demand prediction feature map X1 is subjected to an AvgPool operation to extract global average information, and a power demand prediction feature map X2 is obtained; In the second path, the power demand prediction feature map X1 is subjected to a Conv1x1 convolution operation to integrate cross-channel information and adjust the dimension, and a power demand prediction feature map X3 is obtained; In the third path, the power demand prediction feature map X1 is subjected to a MaxPool operation to highlight significant information, and a power demand prediction feature map X4 is obtained; S332: The power demand prediction feature map X2 and the power demand prediction feature map X3 are added element by element to fuse the average pooling and convolution features, and a power demand prediction feature map X5 is obtained; the power demand prediction feature map X5 is subjected to a deformable convolution operation, the deformable convolution can adaptively adjust the sampling position of the convolution kernel, better capturing the features of irregular shapes, and a power demand prediction feature map X6 is obtained; finally, the power demand prediction feature map X6 is subjected to a Conv1x1 convolution operation to optimize the feature dimension and cross-channel information, and a power demand prediction feature map X7 is obtained; S333: The power demand prediction feature map X3 and the power demand prediction feature map X4 are added element by element to fuse the maximum pooling and convolution feature advantages, and a power demand prediction feature map X8 is obtained; then, the power demand prediction feature map X8 is subjected to a deformable convolution operation to obtain a power demand prediction feature map X9, and finally a Conv1x1 convolution is performed to optimize the feature dimension and cross-channel information, and a power demand prediction feature map X10 is obtained; S334: Concat operation is used to splice the power demand prediction feature map X7 and the power demand prediction feature map X10, fuse different path features, and obtain the power demand prediction feature map X11; then the CBS operation is performed on the power demand prediction feature map X11 to obtain the power demand prediction feature map X12; S335: A light and efficient MobileNetv1 is used to extract deep features from the power demand prediction feature map X12 to obtain a power demand prediction feature vector G.

6. The deep learning-based power demand prediction method of claim 1, wherein, The specific steps of S4 are as follows: S41: In the training process of the power demand prediction model, firstly, the model parameters and hyperparameters are initialized, the model weights and bias are given reasonable initial values through normal distribution or uniform distribution strategy, at the same time, the key hyperparameters are set, and combined with the cosine annealing decay strategy, the learning rate is decreased in a cosine curve with the training advancing, avoiding convergence shock; In combination with the warm-up mechanism, the learning rate is gradually increased in the early stage of training to prevent parameter update overshoot; S42: The power demand prediction image dataset is divided into non-overlapping training set, validation set and test set; The training set is used for gradient descent optimization of model parameters, the validation set is used to monitor model generalization ability and avoid overfitting risk after each training, and the test set is used to evaluate the final performance of the model after training is completed; the training set and the validation set are cut into batches of fixed size through the data loader, the training set batches are randomly shuffled to enhance the model feature learning ability, and the data processing efficiency is improved by using multi-thread preloading; S43: In the training iteration stage, the training set data is input into the model in batches, the prediction value is generated through forward propagation, the training loss is calculated through the mean square error (MSE) loss function, and the model parameters are updated through back propagation; after completing one round, the validation set data is input in batches to calculate the validation loss; the model is based on the automatic differentiation mechanism, and the parameters are dynamically adjusted according to the training and validation loss; when the validation loss does not decrease continuously for multiple rounds and the fluctuation is less than the set threshold, it is determined that the convergence has been reached, the training is terminated, and the optimal parameter state is saved for subsequent inference, and the training of the power demand prediction model is completed.

7. The deep learning-based power demand prediction method of claim 1, wherein, The specific steps of S5 are as follows: S51: The power demand prediction image of the target area is input into the model, wherein the structure of the power demand prediction image is the same as that of any power demand prediction image in the power demand prediction image dataset constructed by S2; S52: Finally, the prediction value of the hourly power demand of the target area in the future time period is obtained.

Citation Information

Patent Citations

  • Security check contraband detection method based on multi-scale attention and data enhancement

    CN116883933A

  • Denoising method and system for inspection image of power transmission line

    CN119540566A