$$\\text{Seg-BO-Transformer}$$
I am concerned that the rapid growth of electric vehicles (EVs) has introduced unprecedented challenges and opportunities for power system operations, grid planning, and energy market design. As part of the global transition towards carbon neutrality, the penetration of electric vehicles is being accelerated by policy incentives, lower battery costs, and the expanding availability of charging stations.

In my study, I focus on the accurate prediction of electric vehicle charging load at a single charging station or a small cluster of stations. The charging load sequence is affected by user behavior, meteorological conditions, real-time electricity price, service fees, and many other exogenous factors. Because of these intertwined drivers, charging load data are highly volatile, nonlinear, non-stationary, and occasionally chaotic. If the system operator cannot anticipate a sudden load spike, the distribution network may suffer from voltage deviations, transformer congestion, reliability degradation, and elevated operating costs.
1 Introduction and Background
My proposal is to design a data-driven hybrid forecasting framework that bridges the gap between conventional time-series modeling and modern sequence-to-sequence learning. The work is contextualized by the rapid evolution of the electric vehicle market. According to recent statistics in China, the national fleet of electric vehicles exceeded 31 million by the end of 2024, with more than 12 million charging connectors deployed in public and private spaces. Such a scale makes the impact of charging processes on electricity demand non-negligible. The core problem is that electric vehicle owners pick their charging windows based on daily routine, price incentives, distance to the charger, and residual battery range. Their aggregated behavior contains strong periodic patterns, but these patterns are disturbed by irregular migrations, weather events, holidays, and occasional grid constraints.
Traditional forecasting methods such as physical models and statistical models rely on explicit mathematical equations and prior hypotheses. For example, physical charging load models may embed battery chemistry, state-of-charge distributions, and driving-cycle simulations. While those deterministic models can provide interpretable logic, they are frequently too rigid to capture the heterogeneity of real-world charging events. Past studies have shown that statistical time-series models such as ARIMA, SARIMA, grey-Markov, and Monte Carlo simulation provide simple baseline tools, but they often suffer from limited nonlinear feature representation. In addition, the performance of these classical techniques generally degrades when the forecasting horizon increases and when data exhibit severe regime changes.
During the last decade, machine learning has reshaped time-series forecasting. The first generation of deep-learning approaches applied to my problem domain included artificial neural networks, support vector machines, random forests, and gradient boosting. Later, recurrent neural networks and their gated variants, especially long short-term memory (LSTM) and gated recurrent units (GRU), became the dominant methods for short-term electric vehicle load prediction. More recently, convolutional neural networks have been combined with recurrent layers to extract spatial and temporal features simultaneously. Yet these models have limitations: convolutional windows are fixed and less suitable for long-range dependencies, while recurrent structures process data sequentially and suffer from high training complexity. Gradient instability remains a concern when long historical sequences are used.
Transformer neural networks have gained attention because of the self-attention mechanism, which allows each element in an input sequence to attend to every previous element directly. This parallelizable architecture has demonstrated excellent results in natural language processing, speech recognition, vision, and many time-series forecasting tasks. Nevertheless, the raw Transformer must be adapted carefully when applied to continuous real-valued charging load data. My experience suggests that three important ingredients can greatly improve forecasting performance: input segmentation, Bayesian global optimization, and a probabilistically interpreted attention mechanism. This led to my formulation of the Seg-BO-Transformer model. In this model, I split a long charging-load time series into several segments that act as local descriptors; I embed periodic positional encodings to inform the model about the daily cycle; and I use Bayesian optimization to determine hyperparameters, including segmentation lengths, learning rates, and regularization factors.
My contribution is threefold. First, I introduce a time-series segmentation procedure whose detail is considered as a tunable hyperparameter, rather than being decided arbitrarily. I demonstrate that segmentation improves both computational efficiency and generalization. Second, I build a Transformer in which the attention weights are modulated by a prior probability derived from historical fluctuation patterns. This probabilistic mechanism allows the model to pay closer attention to time instants that are statistically important, thereby improving robustness. Third, I validate the model in both single-step and multi-step forecasting settings, using one hour, one day, and one week ahead as representative horizons. I also investigate whether adding a dynamic service fee variable, which is often neglected in the electric vehicle literature, can contribute to a lower forecast error. I report that it does.
2 Literature Survey and Research Gaps
My literature survey categorizes electric vehicle charging load forecasting into physical, statistical, machine-learning, and hybrid methods. Various scholars have simulated electric vehicle movement and charging demand using vehicle travel chains and queuing models. However, because these methods require vast amounts of behavioral data that are difficult to acquire, their practical deployment on online forecasting platforms is often constrained.
On the statistical side, ARIMA models have been recognized for their favorable performance on simple univariate load data. SARIMA expands ARIMA by adding seasonal components. Markov chains are useful for representing the stochastic transition of charging states. Monte Carlo simulation is widely adopted for random user arrival times and initial battery states. The major drawback of these statistical approaches is their inability to represent complicated nonlinear maps from several explanatory variables to the load target. Therefore, modern electric vehicle charging load forecasting has gradually shifted to deep learning and ensemble architectures.
Among deep recurrent architectures, LSTM has been extremely popular because of its exceptional ability to learn temporal dependencies. GRU decreases the number of parameters while preserving similar performance. For electric vehicle charging load in a particular region, LSTM-based models can outperform neural networks in many applications. CNN-GRU hybrid systems have also been proposed where CNN extracts local features and GRU captures long short-term dynamics. Transformer-based models, however, are still relatively new in the charging-load domain. Researchers have developed general Transformer forecasting architectures such as Autoformer, Informer, FEDformer, and Pyraformer. These works reveal that attention-based models can better capture long-term dependencies and seasonality than RNN-based models under certain evaluation criteria.
Despite this progress, several research gaps remain. First, most forecasting papers concentrate on a single time horizon, for example, next-hour or next-day. A robust electric vehicle charging load prediction model should perform consistently across multiple horizons. Second, only a limited number of studies include the effect of dynamic service fees. In reality, commercial charging stations in China charge customers a tariff composed of the electricity price plus a service fee. The service fee represents the major revenue source for the station operator and is often temporarily adjusted to balance supply and demand. Ignoring this variable could lead to biased estimation. Third, segmentation and hyperparameter tuning are usually done independently; the segmentation length is often fixed in advance, and the resulting loss performance is not used to fine-tune the segmentation rule. My proposed framework addresses these gaps by jointly modeling segmentation hyperparameters, Bayesian hyperparameter selection, and a probabilistic attention mechanism.
3 Theoretical Foundations
3.1 Time-Series Segmentation
Let the input sequence be denoted by
$$X = [x_1, x_2, \\ldots, x_L]^T, \\quad x_t \\in \\mathbb{R}^d,$$
where d is the number of feature channels and L is the lookback length. A segmentation procedure partitions X into K sub-sequences as follows:
$$N_1 + N_2 + \\cdots + N_K = L, \\quad S_k = [x_{\\sum_{i=1}^{k-1}N_i+1}, \\ldots, x_{\\sum_{i=1}^{k}N_i}],$$
$S_k$ denotes the $k$-th segment. When $K=1$, the original sequence is not segmented. I treat the segment lengths $N_1,\\ldots,N_K$ as hyperparameters in a search space. This is different from fixed-window segmentation because not all segments are forced to have the same length.
3.2 Bayesian Optimization
Bayesian optimization is an efficient global optimization method for expensive black-box functions. In my work, the objective is the validation loss of the Transformer, a function of hyperparameters $\theta$:
$$f(\\theta) = \\mathcal{L}_{\\text{val}}(\\theta).$$
A Gaussian process is used as a surrogate model. For two hyperparameter configurations $\theta_i$ and $\theta_j$, the radial basis function kernel is
$$K(\\theta_i, \\theta_j) = \\exp\\left(-\\frac{\\|\\theta_i – \\theta_j\\|^2}{2\\ell^2}\\right).$$
I use a lower confidence bound acquisition function to balance exploration and exploitation. The expected improvement can be expressed as:
$$EI(\\theta) = \\mathbb{E}\\left[\\max(f(\\theta_{\\text{best}})-f(\\theta),0)\\right],$$
where $f(\\theta_{\\text{best}})$ is the best-observed validation error.
4 Seg-BO-Transformer Architecture
4.1 Overall Forecasting Framework
My hybrid model follows a “Segmentation-Optimization-Neural-Network” principle. First, the original charging-load time series is separated into several sub-sequences. Once segmentation is completed, the model applies periodic positional encoding and Bayesian prior attention inside a Transformer encoder-decoder framework. Bayesian optimization then updates hyperparameters including the segmentation pattern. The complete structure is expressed as follows:
$$\\hat{Y}_{t+1:t+H} = \\mathcal{F}_{\\text{BO}}\\left[ \\text{Transformer}\\left(\\text{Seg}(X_{t-L+1:t}); \\theta^*\\right)\\right].$$
The function $\\text{Seg}(\\cdot)$ denotes the segmentation module, $H$ stands for the prediction horizon, and $\\theta^*$ contains all optimized hyperparameters.
4.2 Periodic Positional Encoding
The load series shows strong intraday seasonality. To convey this information to the neural network, I add an encoding based on sine and cosine functions with a periodicity of 24h. In formal notation:
$$PE_{(t,2i)} = \\sin\\left( \\frac{t}{10000^{2i/d}} \\right), \\quad PE_{(t,2i+1)} = \\cos\\left( \\frac{t}{10000^{2i/d}} \\right).$$
The encoding vector is concatenated with the input features before the segmentation step.
4.3 Bayesian-Prior Attention
My attention mechanism modifies the standard scaled dot-product attention by weighting each key location with a prior probability $p(j)$ obtained from historical load fluctuations. Let $Q=XW_Q$, $K=XW_K$ and $V=XW_V$. Then the attention from position i to position j is written as
$$a_{ij} = \\frac{\\left[(x_iW_Q)(x_jW_K)^T\\right]}{\\sqrt{h}} \\cdot \\frac{p(j)}{p(i)}.$$
Let $p(j)$ be a prior that is high when the historical load at time j often changes sharply or has large statistical dispersion. The final output of the multi-head attention layer is
$$\\text{Attention}(X) = \\text{softmax}\\left( \\frac{QK^T}{\\sqrt{h}} \\right) V.$$
The prior $p(j)$ is calculated in three steps: multi-feature amplitude analysis, clustering refinement, and exponential moving average update.
First, for each feature channel $k$ and time step $j$ I calculate
$$\\Delta_j^k = |N_j^k – \\overline{N^k}| + \\alpha_k \\left|\\frac{N_j^k – N_{j-1}^k}{N_{j-1}^k}\\right|,$$
where $\\overline{N^k}$ denotes the average value of the $k$-th feature. Next, I combine all feature amplitudes by using weighting coefficients $\\beta_k$:
$$\\Delta_j = \\sum_k \\beta_k \\Delta_j^k.$$
Then the raw prior is
$$p_0(j) = \\frac{\\Delta_j}{\\sum_{m=1}^L \\Delta_m}.$$
Second, I apply K-means clustering to the feature vectors so that time instants with similar charging behavior are grouped into the same cluster. For a cluster $C_i$, the standard deviation of feature $k$ is
$$\\sigma_i^k = \\sqrt{\\frac{1}{|C_i|} \\sum_{j \\in C_i} (N_j^k – \\mu_i^k)^2},$$
and a refined prior is
$$p_1(j) = p_0(j) + \\gamma \\, \\frac{\\sigma_{c(j)}}{\\max_c \\sigma_c},$$
where $c(j)$ is the cluster index of the $j$-th point. Finally, I smooth the prior using an exponential weighted moving average with forgetting factor $\\tau$:
$$p_t(j) = \\tau \\, p_{t-1}(j) + (1-\\tau) p(j).$$
In my experiments, $\tau$ is treated as a hyperparameter and tuned by Bayesian optimization.
5 Data Description and Preprocessing
To evaluate my proposed model, I collected operational records from a dynamic-pricing electric vehicle charging station in a major city in China. The dataset spans one entire year, from September 1, 2022, to August 31, 2023. The measurements were recorded at an hourly resolution and produced 8,760 observations. All identifying information about the customers and the exact station address was anonymized before the analysis. The main target variable is the total charging load in kilowatts, observed at each station.
The available feature variables include charging duration, number of charging piles, electricity price, service fee, occupancy rate, module temperature, air pressure, humidity, wind speed, visibility, and precipitation level. Since the number of charging piles is fixed and the station serial number is not analytically informative, I removed those from the feature set. Then I implemented suitable data-cleaning processes for each feature. The statistics of the target load series are shown below in Table 1.
| Statistic | Value |
|---|---|
| Sample size | 8760 |
| Minimum load | 0.000 kW |
| Maximum load | 767.019 kW |
| Median load | 182.218 kW |
| Mean load | 234.742 kW |
| Variance | 22,557.99 kW² |
| Skewness | 0.562 |
These numbers indicate a right-skewed distribution with a wide range and high dispersion. The hourly plot I inspected shows daily peaks in the early morning and lower loads in the afternoon. I therefore use a log-transformation followed by min-max normalization to rescale all features to the interval $[0,1]$:
$$x’ = \\log(x+1), \\quad x” = \\frac{x’ – \\min(x’)}{\\max(x’) – \\min(x’)}.$$
Missing values were filled by a combined Lagrange and cubic spline interpolation approach. Outliers were detected using statistical rules such as Z-scores and then removed or corrected.
6 Feature Engineering and Variable Importance
I applied Pearson correlation analysis to identify linear associations between the transformed features and the target load. The correlation coefficient is defined as
$$r = \\frac{\\sum (x_i-\\bar{x})(y_i-\\bar{y})}{\\sqrt{\\sum (x_i-\\bar{x})^2}\\sqrt{\\sum (y_i-\\bar{y})^2}}.$$
The resulting correlation heat-map showed that the service fee and the electricity price are the two strongest predictors of charging load, with correlation coefficients of 0.76 and -0.77, respectively. The charging duration and occupancy rate also exhibit positive correlations. In contrast, weather variables have small absolute correlation coefficients; only wind speed and relative humidity moderately exceed 0.1.
Because including too many weakly relevant weather variables may introduce noise, I employed principal component analysis. PCA maps the original set of possibly correlated variables into a lower-dimensional orthogonal feature space. Let the covariance matrix be $C$; its eigenvectors $\mu_i$ and eigenvalues $\lambda_i$ are computed via $C\\mu = \\lambda \\mu$. Then I select the top $k$ principal components based on the explained variance ratio. After the extraction step, I concatenate the principal-component scores with the target historical load and the price-related variables to form the final input tensor.
7 Benchmark and Evaluation Metrics
I define six benchmark models to compare against my proposed Seg-BO-Transformer hybrid model:
| Model | Abbreviation | Key Characteristics |
|---|---|---|
| Convolution Neural Network | CNN | Captures local patterns using convolutional kernels |
| Recurrent Neural Network | RNN | Sequential hidden-state propagation |
| Long Short-Term Memory | LSTM | Gated recurrent cells for long-term dependence |
| Gated Recurrent Unit | GRU | Simplified gated recurrent architecture |
| CNN-GRU Hybrid | CNN-GRU | Conv feature extraction with gated recurrence |
| Transformer | Transformer | Standard multi-head self-attention encoder-decoder |
For a rigorous comparison, I measure forecast accuracy using four metrics. Let $y_i$ be the actual load, $\\tilde{y}_i$ be the prediction, and $n$ be the number of test points. The metrics are defined in Equations listed below:
$$MAE = \\frac{1}{n}\\sum_{i=1}^{n} |y_i – \\tilde{y}_i|.$$
$$MAPE = \\frac{100\\%}{n}\\sum_{i=1}^{n}\\left|\\frac{y_i – \\tilde{y}_i}{y_i}\\right|.$$
$$RMSE = \\sqrt{\\frac{1}{n}\\sum_{i=1}^{n} (y_i – \\tilde{y}_i)^2}.$$
$$R^2 = 1 – \\frac{\\sum_{i=1}^{n}(y_i – \\tilde{y}_i)^2}{\\sum_{i=1}^{n}(y_i – \\bar{y})^2}.$$
A model with lower MAE, MAPE, RMSE and higher R² is considered better.
8 Experimental Setup and Results
8.1 Forecasting Horizons and Input Sequence Lengths
I set up three forecasting experiments. The first experiment predicts one hour ahead. In this case, I use an input window of length 24 and an output horizon of length 1. The second experiment predicts a full day, using input length 240 and output horizon 24. The third experiment predicts one week ahead, using input length 360 and output horizon 168. The complete dataset is split into training, validation, and testing subsets with proportions 70%, 10%, and 20%. The validation set is used by Bayesian optimization to tune the model hyperparameters. The test set is held out until the end of the training process.
In all subsequent tables, I highlight that my Seg-BO-Transformer model consistently achieves the best performance across all four metrics and all three horizons.
8.2 Single-Step Forecasting Results
Table 2 reports the test-set performance for the one-hour-ahead prediction task.
| Model | MAE | RMSE | MAPE (%) | R² |
|---|---|---|---|---|
| CNN | 41.2417 | 46.0223 | 19.48 | 0.9601 |
| RNN | 34.1502 | 42.6074 | 14.37 | 0.9638 |
| Transformer | 24.7746 | 32.1393 | 12.25 | 0.9820 |
| LSTM | 24.5108 | 31.2006 | 12.16 | 0.9832 |
| GRU | 21.4507 | 28.5532 | 9.95 | 0.9889 |
| CNN-GRU | 16.9431 | 23.1223 | 8.49 | 0.9945 |
| Seg-BO-Transformer | 12.0645 | 16.9033 | 5.67 | 0.9976 |
From the single-step experiment, I observe that convolutional and recurrent architectures have high errors. CNN and RNN do not track the extreme charging events accurately. Transformer and LSTM provide relatively moderate improvement. CNN-GRU, a hybrid model, performs better than all single models. However, my Seg-BO-Transformer reduces MAE by approximately 28.8% and RMSE by 26.9% when compared with CNN-GRU. The MAPE is only 5.67%, implying an exceptional prediction quality. I am also satisfied that the R² value reaches 0.9976, which indicates that my model explains almost all variability of the charging-load process.
8.3 One-Day-Ahead Multi-Step Forecasting
Table 3 reports the evaluation for the one-day-ahead horizon.
| Model | MAE | RMSE | MAPE (%) | R² |
|---|---|---|---|---|
| CNN | 62.5517 | 75.1689 | 29.98 | 0.9478 |
| RNN | 54.0300 | 65.3878 | 25.78 | 0.9592 |
| GRU | 40.7500 | 50.3363 | 19.29 | 0.9637 |
| LSTM | 39.2196 | 48.9892 | 19.09 | 0.9641 |
| Transformer | 36.0410 | 43.8706 | 17.41 | 0.9739 |
| CNN-GRU | 33.1164 | 41.8791 | 15.94 | 0.9736 |
| Seg-BO-Transformer | 16.7519 | 22.6898 | 7.87 | 0.9901 |
The errors of all models increase in comparison to the single-step results. This is expected because multi-step forecasting is intrinsically harder. Interestingly, the performance ranking changes slightly. LSTM and Transformer perform better than GRU for longer sequences. CNN-GRU remains competitive. My proposed model, however, retains the best performance across all metrics. The R² of 0.9901 demonstrates that the Seg-BO-Transformer can map long input sequences to a full day of charging-load variations with high fidelity.
8.4 Seven-Day-Ahead Multi-Step Forecasting
I further complicate the prediction task by setting the output horizon to 168 hours. The findings are listed in Table 4.
| Model | MAE | RMSE | MAPE (%) | R² |
|---|---|---|---|---|
| CNN | 101.8872 | 115.7878 | 41.05 | 0.8641 |
| RNN | 84.7673 | 98.7741 | 37.22 | 0.9172 |
| GRU | 69.3218 | 83.9810 | 32.63 | 0.9283 |
| CNN-GRU | 63.5268 | 79.7613 | 31.14 | 0.9247 |
| LSTM | 59.3698 | 67.3154 | 29.86 | 0.9307 |
| Transformer | 53.1803 | 64.9281 | 27.49 | 0.9649 |
| Seg-BO-Transformer | 29.0728 | 35.2941 | 14.95 | 0.9829 |
My proposed model still obtains the smallest MAE, RMSE, MAPE, and the largest R². Compared with the standard Transformer, the Seg-BO-Transformer reduces MAE from 53.18 to 29.07, a relative improvement of 45.3%. A direct comparison of curves suggests that my model is particularly effective in reproducing the daily cycles and avoiding large overshoots near peak values. All models have more difficulty in matching the extreme load values, but the Seg-BO-Transformer shows smaller deviations in those important regions.
8.5 Statistical Significance Test
In order to verify that the observed improvements are not coincidental, I employ the Diebold-Mariano (DM) test for each forecast horizon. I compare the prediction errors of my Seg-BO-Transformer with those of each benchmark. Let $e_{1,t}$ be the error of the proposed model, $e_{2,t}$ be the error of a benchmark, and $d_t = g(e_{1,t}) – g(e_{2,t})$ under a given loss function $g$. The null hypothesis is that the two models have equal expected loss. The DM statistic is computed with a HAC estimator of the variance. The results for MAE and RMSE are shown below.
| Loss | Horizon | CNN | RNN | Transformer | LSTM | GRU | CNN-GRU |
|---|---|---|---|---|---|---|---|
| MAE | K=1 | 30.75 | 24.41 | 26.91 | 26.02 | 21.18 | 2.80 |
| K=24 | 21.34 | 17.48 | 10.53 | 12.51 | 16.91 | 16.04 | |
| K=168 | 35.95 | 21.46 | 8.37 | 11.99 | 18.47 | 20.35 | |
| RMSE | K=1 | 34.04 | 27.60 | 25.39 | 15.31 | 22.87 | 18.91 |
| K=24 | 35.14 | 19.97 | 11.71 | 15.65 | 17.51 | 10.89 | |
| K=168 | 40.18 | 28.08 | 7.55 | 11.28 | 15.10 | 14.99 |
All DM statistics are far beyond the critical value at the 1% significance level. This means I can reject the null hypothesis and conclude that my Seg-BO-Transformer provides a statistically significant improvement over the benchmark models.
9 The Role of Dynamic Service Fees in Improving Accuracy
Many studies treat electricity price as the main monetary variable that affects electric vehicle charging behavior. In the Chinese market, the charging tariff at public stations usually contains a service fee. That fee is a crucial decision factor for electric vehicle users because it directly affects the total cost per kilowatt-hour. However, the service fee has rarely been included in predictive models in previous work. I therefore analyze the added predictive value of the service fee by comparing the Seg-BO-Transformer with and without the variable.
Let the evaluation metric with the service fee be $MAE$ and $RMSE$, and let the metric without the service fee be $MAE^*$ and $RMSE^*$. I define the improvement as follows:
$$P_{MAE}=\\left|\\frac{MAE-MAE^*}{MAE^*}\\right|, \\quad P_{RMSE}=\\left|\\frac{RMSE-RMSE^*}{RMSE^*}\\right|.$$
The results are shown in Table 5.
| Forecast Horizon | $MAE^*$ (without) | $RMSE^*$ (without) | $P_{MAE}$ | $P_{RMSE}$ |
|---|---|---|---|---|
| One hour ahead (K=1) | 13.3857 | 18.6674 | 9.87% | 9.45% |
| One day ahead (K=24) | 18.3441 | 24.6896 | 8.68% | 8.10% |
| One week ahead (K=168) | 31.3284 | 37.8814 | 7.20% | 6.83% |
I find that adding the service fee significantly reduces the prediction error in all horizons. The improvement is largest when the output horizon is one hour, where MAE decreases by 9.87% and RMSE by 9.45%. The percentage improvement decreases as the horizon grows, but it remains above 6.8% even for weekly forecasts. These results confirm that the service fee is an important explanatory variable in electric vehicle charging load forecasting.
Such a conclusion has relevant managerial implications. On the one hand, charging station operators can leverage forecasts that explicitly account for service fee adjustments to design real-time pricing strategies. On the other hand, regulators can simulate the impact of fee caps on the stability of the distribution network. If operators decide to increase the service fee during peak hours, an accurate forecast would allow the distribution system operator to predict the resulting demand reduction. Conversely, reducing the service fee during off-peak periods can increase the utilization of idle charging piles.
10 Discussion
My experiments consistently show that the Seg-BO-Transformer hybrid model achieves superior performance in all tested settings. I attribute this success to several architectural and procedural choices. First, segmentation permits the transformer to learn from multiple representations of the load series. Instead of processing the whole sequence as a monolithic vector, the model receives segments of varying lengths, which behaves like a multi-resolution view of the input. Second, Bayesian optimization efficiently finds a reliable set of hyperparameters. Manual tuning for this complex model is difficult because there are numerous interactions between the number of segments, the length of each segment, the learning rate, the number of attention heads, the dropout rate, and the prior probability weighting parameters.
Third, the prior attention mechanism enables the model to focus sharply on the most informative time stamps. In electric vehicle charging load series, these informative points often occur during morning peaks and before/after rush hours. The prior probabilities obtained from the historical fluctuation magnitude and clustering provide valuable inductive biases. From a computational aspect, the segmentation strategy also reduces the complexity of the self-attention calculation. Rather than performing an $L \\times L$ attention matrix for the whole input, I am able to process sub-sequences, shortening the rank of each attention map. This property is especially useful when the input length is large, as in the seven-day prediction setup.
I also observe that the standard Transformer is fairly robust on long sequences, but it lags significantly behind my model at the one-week horizon. This indicates that segmentation and prior-probability modulation are essential for translating vanilla Transformer architectures into reliable electric vehicle load forecasting instruments. To make my inference more interpretable, I visualize the fitted and real curves in several charts. Those graphs indicate that all models can follow the general shape, but my model is more accurate at peak and valley times. Since load peaks are the main sources of grid stress, my model is especially valuable for scheduling spinning reserves and peak-shaving services.
11 Management and Policy Implications
The accurate prediction of electric vehicle charging load provides several benefits for grid dispatch, charging station management, and infrastructure planning. First, when the system operator knows the expected load profile for the next day, it can schedule generators and storage units more economically. Battery energy storage can be charged during low-load periods and discharged during predicted high-price periods. I argue that my forecasting model can serve as a foundational component of such energy-management systems.
Second, the inclusion of the service fee as an explanatory variable allows operators to perform scenario analysis. Suppose that the price elasticity of electric vehicle charging is known and the proposed model predicts the charging load as a function of service fee. The station operator can choose an optimal fee schedule that maximizes revenue while avoiding transformer overload. This is particularly important because the majority of public charging stations are still operating at low margins. A small increase in forecast accuracy can directly influence return on investment.
Third, the results suggest that the regulatory framework should facilitate data sharing between charging network operators and grid operators. Anonymized charging records, including the time, duration, location, and price components, are necessary for building high-quality data-driven forecasting models. Policies that encourage open data while preserving user privacy can accelerate research and development in this area.
12 Future Work and Limitations
My current study has several limitations. First, the dataset comes from one charging station in one city. This station might not reflect the behavioral diversity of electric vehicle users in other regions. Even though I have validated the model with a large number of hourly records, the findings should be re-tested on data from multiple stations with different sizes, locations, and charging policies. Second, I did not consider holiday effects explicitly. During Chinese holidays, travel patterns change dramatically, and my model might accidentally learn normal day variations. Third, the charging load can also be affected by local traffic conditions, public events, and the penetration level of electric vehicles in nearby districts. None of those were directly available in the dataset.
Another weakness is related to the transparency of the Bayesian prior construction. The prior probability is based on amplitudes, clusters, and smoothed updates. Although this prior improves the empirical performance, it may be difficult for a human operator to interpret why certain attention heads assign high weights to specific times. Future research can incorporate explainable attention maps that highlight the driving features. Furthermore, I have used a fixed architecture of transformer layers in all experiments. A future direction is to search over network topologies as well, but this would drastically increase the computational time.
From a methodological perspective, I believe that the Seg-BO-Transformer framework is not restricted to electric vehicle charging load forecasting. The same framework can handle residential building load data, wind power production, solar irradiance, and other non-stationary energy time series. In each case, the segmentation step and the Bayesian prior can be adapted to the domain-specific seasonality. I also see an opportunity to embed my model into online learning pipelines, where model parameters are updated sequentially as new charging data arrive. Online Bayesian optimization could further reduce the cost of retraining when the charging-station environment changes over time.
13 Conclusion
In this paper, I proposed Seg-BO-Transformer, a hybrid neural network for electric vehicle charging load forecasting. My model combines time-series segmentation, Bayesian global optimization, and a Transformer encoder-decoder with prior-probability weightings. The segmentation strategy is treated as a set of hyperparameters, allowing the forecasting model to identify the most relevant local patterns automatically. The prior attention mechanism incorporates historical fluctuation statistics into the model, improving the stability of predictions in peak and valley periods. Bayesian optimization efficiently explores the high-dimensional parameter space and avoids local optima.
I trained the model on an hourly dataset from a real dynamic-pricing charging station and tested it for one-hour, one-day, and one-week horizons. In every experiment, my Seg-BO-Transformer achieved the best MAE, RMSE, MAPE, and R² among seven models. For example, in the one-day-ahead forecast, the MAE was 16.75 kW, while the best benchmark model had an MAE of 33.12 kW. The Diebold-Mariano test confirmed that the performance differences are statistically significant. I additionally tested the effect of adding the service fee as an explanatory variable, and the results showed an improvement of up to 9.87% in MAE.
The contributions of my work are as follows. I provide a coherent pipeline that integrates data processing, segmentation, prior-based probability, transformer sequence learning, and hyperparameter optimization. My comparisons prove the superiority of the hybrid architecture over conventional CNN, RNN, LSTM, GRU, CNN-GRU, and vanilla Transformer models. My empirical evidence supports the inclusion of service fees in future electric vehicle charging load forecasting models. The managerial implications can help charging-station operators, grid dispatchers, and policymakers to make more efficient and resilient decisions. Although limitations remain, I am confident that the Seg-BO-Transformer hybrid model is a useful tool for sustainable transport electrification.
I hope that this research inspires more elaborate investigations into attention-based hybrid models for electric vehicle infrastructure planning. By continuing to improve the forecasting accuracy, we can promote cleaner transportation, improve grid reliability, and contribute to the global climate agenda.
