With the increasing severity of energy shortages and environmental issues, the promotion of accurate energy consumption prediction for battery EV cars is of vital importance. Battery electric vehicles, often referred to as battery EV cars, offer advantages such as zero emissions, braking energy recovery, independence from petroleum, and low noise. However, energy consumption remains a key constraint in their development. Driving range, as a core indicator, is closely related to energy consumption, but bottlenecks in battery technology limit the full lifecycle value of these vehicles and increase usage costs. Moreover, insufficient and unevenly distributed charging infrastructure leads to user inconvenience, undermining trust and satisfaction. Therefore, improving the accuracy of range estimation for battery EV cars under different driving conditions is crucial. This not only helps users plan trips reasonably but also supports automakers in optimizing design and strategies, promoting sustainable industry development.

In this study, we address the limitations of existing models in modeling complex spatiotemporal features by proposing a fusion model that integrates Long Short-Term Memory (LSTM) networks and Multi-Head Attention (MHA) mechanisms. Based on actual road operation data from a brand of battery EV car, we construct a hierarchical feature extraction framework through data preprocessing and feature engineering. This framework leverages LSTM to capture temporal dependencies and MHA to enhance global correlation analysis across dimensions, mitigating gradient decay issues in traditional models and improving long-range dependency modeling. Our experiments demonstrate high prediction accuracy and strong generalization ability, validated through multi-physics field simulations. The results provide reliable theoretical support for user trip planning, vehicle energy consumption optimization, and charging facility layout, contributing to the sustainable development of the battery EV car industry.
Related Work Overview
The advancement of artificial intelligence has highlighted the importance of deep learning models in energy consumption prediction. Neural networks, including Convolutional Neural Networks (CNN) and Long Short-Term Memory (LSTM) networks, are widely applied in this field due to their superior feature learning and expressive capabilities compared to traditional methods. For battery EV cars, accurate energy consumption prediction is essential for enhancing user experience and operational efficiency.
Recent studies have achieved significant progress. For instance, Malek et al. constructed univariate and multivariate LSTM models, showing that multivariate models outperform univariate ones in both short-term and long-term predictions for battery EV cars. Shen et al. proposed a hybrid algorithm based on Transformer and Markov Chain Monte Carlo (MCMC) for predicting electric vehicle speed and energy consumption, incorporating route information and driving behavior. Feng et al. developed an LSTM-Transformer framework for energy consumption prediction in battery EV cars, considering vehicle, environmental, and driver factors. These works underscore the potential of deep learning in tackling the complexities of battery EV car energy dynamics.
However, challenges persist in modeling complex spatiotemporal features, such as capturing long-range dependencies and handling multidimensional parameter interactions. Our research builds on these foundations by integrating LSTM and MHA into a cohesive model tailored for battery EV car energy consumption prediction.
Data Preprocessing and Feature Engineering
We base our study on actual road operation data from a brand of battery EV car, released by the National Big Data Alliance for New Energy Vehicles. The data covers operations in regions like Liaoning and Hebei from 2023 to 2024, with a sampling frequency of 0.1 Hz. It includes 13 key fields related to vehicle status, charging state, speed, and battery parameters, totaling over 3.96 million raw records. The technical parameters of the battery EV car are summarized in Table 1.
| Parameter | Value | Unit |
|---|---|---|
| Length × Width × Height | 4650 × 1820 × 1510 | mm |
| Wheelbase | 2670 | mm |
| Front/Rear Track | 1555 / 1560 | mm |
| Curb Weight | 1680 | kg |
| Driving Range | 501 | km |
| Maximum Power | 160 | kW |
| Maximum Torque | 300 | N·m |
| Maximum Speed | 155 | km/h |
| Battery Capacity | 39 | kWh |
| Tire Specification | 215/50 | mm |
The data fields comply with the GB/T 32960-2016 specification for electric vehicle remote service and management systems. Key fields and their physical meanings are described in Table 2.
| Name | Symbol | Unit | Meaning |
|---|---|---|---|
| Time | T | s | Data acquisition time |
| Status | St | – | Vehicle status |
| Charge Status | CSt | – | Charging state |
| Running Mode | RM | – | Operating mode |
| SOC | s | % | State of charge |
| Speed | V | km/h | Driving speed |
| Max Temperature | Tb,max | °C | Maximum battery cell temperature |
| Min Temperature | Tb,min | °C | Minimum battery cell temperature |
| Max Cell Voltage | Uc,max | V | Maximum battery cell voltage |
| Min Cell Voltage | Uc,min | V | Minimum battery cell voltage |
| Total Voltage | Vtotal | V | Total battery voltage |
| Total Current | Itotal | A | Total battery current |
| Mileage | M | km | Driving mileage |
Data preprocessing involves cleaning, filling missing values, and removing outliers to ensure data quality. We sort the dataset chronologically using a quicksort algorithm and apply linear interpolation to handle missing values, maintaining sequence continuity. For anomaly detection, the 3σ rule is employed to identify and remove outliers caused by sensor faults. The cleaned data is then processed using the PCHIP interpolation method, which preserves monotonicity and smoothness, suitable for unevenly sampled data from battery EV cars.
To further enhance data quality, a composite filtering strategy is adopted, combining Savitzky-Golay filtering, median filtering, and Hampel filtering. This multi-level filter chain dynamically adjusts window sizes to eliminate high-frequency noise while retaining trend features. The filtered energy consumption data shows significant smoothing, reducing noise interference for subsequent analysis and model training.
Feature Engineering for Battery EV Cars
Feature selection is critical for accurate energy consumption prediction in battery EV cars. Based on the dynamics equation of electric vehicles, we extract candidate features related to energy consumption. The driving resistance includes rolling resistance, air resistance, gradient resistance, and acceleration resistance, which depend on speed, vehicle mass, and road slope. Although vehicle mass and road slope are not directly available, driving mileage indirectly reflects these factors. Thus, speed (V) and mileage (M) are selected as candidate features.
Battery state significantly impacts energy consumption. The state of charge (SOC) determines the available electrical energy, while battery output power is related to total current (Itotal) and total voltage (Vtotal). Therefore, SOC, Vtotal, and Itotal are included. Environmental temperature affects battery performance and auxiliary energy use; maximum and minimum temperatures (Tb,max and Tb,min) reflect operating conditions. Battery cell voltage extremes (Uc,max and Uc,min) indicate battery health and consistency, also serving as candidate features.
To select input features, we use Pearson correlation coefficient analysis to evaluate the linear relationship between candidate features and the target variable (energy consumption). Features with high correlation and low multicollinearity are chosen to reduce model complexity and improve robustness. The correlation analysis results, based on data from the battery EV car, are summarized in Table 3.
| Feature | Correlation Coefficient | Selection Status |
|---|---|---|
| Speed (V) | 0.85 | Selected |
| Total Current (Itotal) | 0.78 | Selected |
| SOC | -0.72 | Selected |
| Max Temperature (Tb,max) | 0.65 | Selected |
| Mileage (M) | 0.58 | Not Selected |
| Total Voltage (Vtotal) | 0.52 | Not Selected |
| Min Temperature (Tb,min) | 0.48 | Not Selected |
| Max Cell Voltage (Uc,max) | 0.45 | Not Selected |
| Min Cell Voltage (Uc,min) | 0.42 | Not Selected |
Based on this analysis, we finalize four input features: speed, total current, SOC, and maximum battery temperature. These features exhibit strong correlations across various driving conditions, meeting the requirements for machine learning models in battery EV car energy consumption prediction.
Model Architecture: LSTM-MHA Fusion for Battery EV Cars
Traditional single models face limitations in modeling complex spatiotemporal features, which constrains the accuracy of energy consumption prediction for battery EV cars. LSTM excels at capturing short-term temporal dependencies but suffers from gradient decay in long sequences. MHA enables global correlation analysis across spatiotemporal dimensions but may lack sensitivity to local features. By fusing LSTM and MHA, we construct a hierarchical feature extraction framework that synergizes local perception, temporal modeling, and global association, significantly improving prediction accuracy and generalization in complex driving scenarios for battery EV cars.
Core Functional Modules
Long Short-Term Memory (LSTM) networks are a type of recurrent neural network (RNN) with gating mechanisms, including input, forget, and output gates, that manage information flow, storage, and memory cell updates. For time-series tasks like energy consumption prediction in battery EV cars, LSTM effectively handles historical data dependencies. The equations for an LSTM unit are as follows:
$$i_t = \sigma(W_i \cdot [h_{t-1}, x_t] + b_i)$$
$$f_t = \sigma(W_f \cdot [h_{t-1}, x_t] + b_f)$$
$$o_t = \sigma(W_o \cdot [h_{t-1}, x_t] + b_o)$$
$$\tilde{C}_t = \tanh(W_C \cdot [h_{t-1}, x_t] + b_C)$$
$$C_t = f_t \odot C_{t-1} + i_t \odot \tilde{C}_t$$
$$h_t = o_t \odot \tanh(C_t)$$
where \(i_t\), \(f_t\), and \(o_t\) are the input, forget, and output gates at time \(t\), respectively; \(\sigma\) is the sigmoid activation function; \(\odot\) denotes element-wise multiplication; \(x_t\) is the input; \(h_{t-1}\) is the previous hidden state; \(C_t\) is the cell state; and \(W\) and \(b\) are weight matrices and bias vectors.
Multi-Head Attention (MHA) captures global dependencies across dimensions by computing attention scores for multiple heads in parallel. For battery EV car data, MHA analyzes interactions between parameters like driving mileage and battery temperature. The attention mechanism is defined as:
$$\text{Attention}(Q, K, V) = \text{softmax}\left(\frac{QK^T}{\sqrt{d_k}}\right)V$$
where \(Q\), \(K\), and \(V\) are query, key, and value matrices, and \(d_k\) is the dimension of keys. In MHA, multiple attention heads are concatenated and linearly transformed:
$$\text{MHA}(Q, K, V) = \text{Concat}(\text{head}_1, \dots, \text{head}_h)W^O$$
$$\text{head}_i = \text{Attention}(QW_i^Q, KW_i^K, VW_i^V)$$
with \(h\) heads and projection matrices \(W_i^Q, W_i^K, W_i^V, W^O\).
Fusion Network Design
Our LSTM-MHA fusion model integrates LSTM’s temporal modeling with MHA’s global analysis for battery EV car energy consumption prediction. The framework processes input sequences through LSTM layers to capture temporal dependencies, such as dynamic battery degradation after rapid acceleration. The LSTM outputs are then fed into MHA layers to enhance cross-dimensional parameter correlations, like the interplay between speed and battery temperature. This hierarchical structure alleviates gradient decay and improves long-range dependency modeling.
The overall architecture involves the following steps: Input features are normalized and passed through LSTM layers to generate hidden states. These states are reshaped for MHA, where multiple attention heads compute weighted sums. A global average pooling operation is applied to the MHA output to extract global features:
$$F_{\text{pool}}(j) = \frac{1}{T} \sum_{t=1}^{T} F_{\text{MHA}}(t, j)$$
where \(T\) is the sequence length, and \(F_{\text{MHA}}(t, j)\) is the MHA output at time \(t\) and feature \(j\). Finally, a fully connected layer maps the pooled features to the prediction output \(\hat{y}\):
$$\hat{y} = W_{\text{out}} \cdot F_{\text{pool}} + b_{\text{out}}$$
This fusion model effectively addresses the limitations of traditional approaches, leveraging both local and global insights for accurate energy consumption prediction in battery EV cars.
Experimental Setup and Results for Battery EV Cars
We evaluate the LSTM-MHA model using actual road operation data from the battery EV car. The dataset is split into training (70%), validation (15%), and test (15%) sets. Input features are normalized to a [0,1] range to eliminate scale differences. The model is trained with the Adam optimizer, a learning rate of 0.001, and a batch size of 64, over 100 epochs. Early stopping is applied to prevent overfitting.
To assess prediction performance, we use three key evaluation metrics: Mean Absolute Error (MAE), Mean Bias Error (MBE), and Root Mean Square Error (RMSE). These metrics are chosen for their direct relevance to energy consumption prediction in battery EV cars, where systematic errors can impact user range anxiety and safety. The formulas are:
$$\text{MAE} = \frac{1}{n} \sum_{i=1}^{n} |y_i – \hat{y}_i|$$
$$\text{MBE} = \frac{1}{n} \sum_{i=1}^{n} (y_i – \hat{y}_i)$$
$$\text{RMSE} = \sqrt{\frac{1}{n} \sum_{i=1}^{n} (y_i – \hat{y}_i)^2}$$
where \(y_i\) is the actual energy consumption, \(\hat{y}_i\) is the predicted value, and \(n\) is the number of samples. Additionally, we compute the Relative Percentage Difference (RPD) to gauge model robustness.
The prediction results on the test data show that the LSTM-MHA model achieves an MAE of 0.020629, an MBE of 0.00244, an RMSE of 0.04643, and an RPD of 1.685. To demonstrate the advantages of our fusion approach, we compare it with a baseline LSTM model. The performance comparison is presented in Table 4.
| Model | MAE | MBE | RMSE | RPD |
|---|---|---|---|---|
| LSTM | 0.03358 | -0.00079 | 0.04768 | 1.276 |
| LSTM-MHA (Proposed) | 0.020629 | 0.00244 | 0.04643 | 1.685 |
The LSTM-MHA model reduces MAE by 38.56% (from 0.03358 to 0.020629) and increases RPD by 32.06% (from 1.276 to 1.685) compared to the baseline LSTM. It also improves MBE, indicating smaller systematic bias. These results highlight the superior accuracy and reliability of our fusion model for energy consumption prediction in battery EV cars, making it suitable for real-world applications like trip planning and energy management.
Simulation Validation with GT-Suite for Battery EV Cars
To further validate the generalization ability of our LSTM-MHA model, we conduct multi-physics field simulations using GT-Suite software. This platform enables coupled modeling of electric drivetrains and battery thermal management, providing a comprehensive virtual environment for battery EV car performance analysis. We build a physical model based on the parameters from Table 1, including a 39 kWh lithium-ion battery, a front-drive single motor with a maximum power of 160 kW, and a curb weight of 1680 kg.
The driving cycle is constructed using the China Light-duty Vehicle Test Cycle (CLTC), which reflects real-world urban traffic conditions in China. The CLTC cycle is segmented into congested (0–48.1 km/h, 20.7% proportion), slow (0–71.2 km/h, 12.4%), and free-flow (0–114 km/h, 66.9%) conditions. Real-time traffic data from a 13.29 km test route is incorporated to simulate dynamic driving scenarios for the battery EV car.
In GT-Suite, we set the initial SOC to 80% and simulate under CLTC conditions. The simulation outputs include vehicle speed, battery output power, SOC variation, and energy consumption. Key performance indicators from the simulation are summarized in Table 5.
| Metric | Value | Unit |
|---|---|---|
| Average Speed | 29.61 | km/h |
| Driving Distance | 13.29 | km |
| Total Energy Consumption | 5.92 | kWh |
| Maximum Acceleration | 1.78 | m/s² |
The battery output power and SOC variation during simulation are analyzed to understand energy consumption patterns. We then input the simulated data (e.g., speed, current, SOC, temperature) into our trained LSTM-MHA model to predict energy consumption. Comparing the predicted values with GT-Suite simulation results, the error metrics are computed: MAE = 0.0052131, MBE = 0.00015774, RMSE = 0.003089, and RPD = 3.3511. The low RMSE (0.003089) indicates minimal deviation between predicted and simulated energy consumption, with error fluctuations confined to a small range.
Potential error sources include: (1) GT-Suite considers weather factors that are not incorporated into the prediction model training, and (2) simulation cumulative errors may arise from real-time prediction feedback limitations. Despite these, the close alignment validates the high accuracy and strong generalization capability of our LSTM-MHA model for battery EV car energy consumption prediction across diverse scenarios.
Conclusion
In this study, we propose an LSTM-MHA fusion model for energy consumption prediction in battery EV cars, addressing the limitations of traditional models in complex spatiotemporal feature modeling. By integrating LSTM’s temporal dependency capture and MHA’s global correlation analysis, we construct a hierarchical feature extraction framework that mitigates gradient decay and enhances long-range dependency modeling. Based on actual road operation data from a battery EV car, our model achieves an MAE of 0.020629, an MBE of 0.00244, and an RMSE of 0.04643, with an RPD of 1.685. Validation through GT-Suite multi-physics field simulations under CLTC conditions yields an RMSE of 0.003089, confirming high precision and robustness.
The research results provide reliable theoretical support for user trip planning, vehicle energy consumption optimization, and charging facility layout in the context of battery EV cars. Future work could further enhance the model by incorporating multi-source heterogeneous data, such as real-time traffic and environmental information, to improve adaptability in practical scenarios. This contributes to the sustainable development of the battery EV car industry, promoting efficient energy use and reduced environmental impact.
