# Explainable Artificial Intelligence for State of Charge Estimation of Lithium-Ion Batteries
## 3 Methodology
### Data
\begin{table}
\begin{tabular}{l l l l} \hline \multicolumn{1}{c}{**Signal Name**} & \multicolumn{1}{c}{**Unit**} & \multicolumn{1}{c}{**Frequency**} & \multicolumn{1}{c}{**Description**} \\ \hline VOLTAGE & [V] & 4 Hz & Voltage value of the battery pack \\ \hline CURRENT & [A] & 4 Hz & Current value of the battery pack \\ \hline SOC\_DISPLAY & [\%] & 0.1 Hz & SoC based on actually available capacity \\ \hline SOC\_REAL & [\%] & 0.1 Hz & SoC based on total battery capacity \\ \hline VOLTAGE\_CELL\_001-088 & [V] & 1 Hz & Voltage for cell blocks 1 to 88 \\ \hline VOLTAGE\_CELL\_MAX & [V] & 1 Hz & Highest voltage among cell blocks \\ \hline VOLTAGE\_CELL\_MIN & [V] & 1 Hz & Lowest voltage among cell blocks \\ \hline T\_MODULE\_01-27 & [\({}^{\circ}\)C] & 0.5 Hz & Temperature of battery modules 1 to 27 \\ \hline T\_CELL\_MAX & [\({}^{\circ}\)C] & 0.5 Hz & Highest temperature among cell blocks \\ \hline T\_CELL\_MIN & [\({}^{\circ}\)C] & 0.5 Hz & Lowest temperature among cell blocks \\ \hline T\_CELL\_AVG & [\({}^{\circ}\)C] & 0.5 Hz & Average cell block temperature \\ \hline CAPACTITY\_CELL\_001-088 & [Ah] & - & Capacity of cells 1 to 88 estimated by the BMS \\ \hline CUMULATIVE\_CC & [Ah] & 0.01 Hz & Cumulated charged capacity over lifetime \\ \hline CUMULATIVE\_DC & [Ah] & 0.01 Hz & Cumulated discharged capacity over lifetime \\ \hline CUMULATIVE\_CE & [Wh] & 0.01 Hz & Cumulated charged energy over lifetime \\ \hline CUMULATIVE\_DE & [kWh] & 0.01 Hz & Cumulated discharged energy over lifetime \\ \hline AVG\_CONSUMPTION & [kWh] & 0.01 Hz & Average consumption per 100 km \\ \hline MILEAGE & [km] & 0.1 Hz & Car’s mileage \\ \hline T\_OUTSIDE & [\({}^{\circ}\)C] & 0.1 Hz & Outside temperature \\ \hline \end{tabular}
\end{table} 
Table 3: Overview of signals. Delta resistance represents the change in voltage with respect to the change in current and was calculated as follows:  
\[R_{\Delta}=\frac{\Delta V}{\Delta I} \tag{2}\]  
**Normalization:** To prevent any single feature from overpowering the learning algorithm based on its magnitude and to expedite optimization convergence, all signals were scaled to the range of [0, 1]. This scaling technique ensures that each feature contributes proportionally to the learning process. The formula for normalization is as follows:  
\[x_{norm}=\frac{x-min(x)}{max(x)-min(x)} \tag{3}\]  
where \(x\) is an element of an array that represents a certain feature. **Interpolation of signals**: The signals collected exhibited varying sampling rates. For example, some signals (e.g., current) were sampled frequently, while others had a lower frequency. To address this, we established a consistent time vector by selecting the maximum start time and the minimum end time across all signals. Using the defined time step in seconds, we constructed a vector with equidistant intervals. For each session, we created interpolators for individual signals to synchronize the data with the uniform time vector. **Window segmentation**: It was imperative to address the inherent heterogeneity in the temporal characteristics of the captured driving sessions. These sessions were reflective of authentic, unscripted driving experiences; this means they exhibited varying durations and frequencies of pauses, which were not pre-determined by AVILOO [38]. To facilitate a rigorous comparative analysis, it became necessary to introduce controlled segmentation of the data. This was achieved through the establishment of discrete \"windows\", defined by a specific number of data points denoted as \(N\) (e.g., \(N=1200\) is equivalent to 20 min). Sub-sessions falling short of the \(N\) threshold were excluded from consideration. Conversely, for sub-sessions exceeding \(N\), an operational parameter \(s\) was introduced, representing the stride. This parameter dictated the step size or the interval at which the data window advanced along the temporal axis. In cases where \(s=N\), a \"full-stride\" scenario arose, wherein each window was independent of its preceding counterpart, containing no overlapping information.