# Enhancing Safety in Automatic Electric Vehicle Charging: A Novel Collision Classification Approach
## 3 Materials and Methods
### LightGBM Model Concept  
LightGBM (light gradient boosting machine) is a gradient boosting framework designed to handle large-scale datasets efficiently. It is a type of gradient boosting decision tree (GBDT) algorithm that was introduced by [PERSON] et al. in 2017 [31]. The primary objective of LightGBM is to overcome the computational challenges associated with traditional GBDT algorithms, especially when dealing with massive amounts of data. The effectiveness of LightGBM stems from the incorporation of two key techniques based on GBDT: gradient-based one-side sampling (GOSS) and exclusive feature bundling (EFB). GOSS is a sampling technique that selectively targets the most informative samples for each tree, enhancing computational efficiency while maintaining high accuracy. FEB, on the other hand, focuses on bundling features with similar distributions into a single feature, reducing the overall number of features that require processing.  
More specifically, given the supervised training set \(X=\{(x_{i},y_{i})\}_{i=1}^{n}\), where \(x_{i}\) represents the input features, \(y_{i}\) is the corresponding label, and \(n\) is the number of instances, LightGBM seeks to determine the approximation \(\overset{\sim}{h}(x)\) of the target function \(h^{*}(x)\). The goal is to minimize the expected value of the predefined loss function \(L\left(\overset{\sim}{y},\overset{\sim}{h}(x)\right)\).  
Then, a number of \(K\) regression trees (\(\sum_{k=1}^{K}h_{k}(X)\)) are integrated into LightGBM to approximate the final model, which is expressed as follows:  
\[h_{K}(X)=\sum_{k=1}^{K}h_{k}(X), \tag{1}\]  
In LightGBM, the objective function is efficiently approximated using [PERSON]'s method. Therefore, the training process of LightGBM can be expressed in the following additive form:  
\[F_{k}\cong\sum_{i=1}^{n}\left(p_{i}h_{k}(x_{i})+\frac{1}{2}q_{i}h_{k}^{2}(x_{ i})\right), \tag{2}\]  
where \(p_{i}\) and \(q_{i}\) denote the first-order and second-order gradient statistics of the loss function. Additionally, the regression tree is represented as \(t_{r(x)}\), \(r\in\{1,\ 2,\ \ldots,\ \}\), where \(J\) denotes the number of leaves, \(r\) stands for the decision rules of the tree, and \(t\) represents a  
\begin{table}
\begin{tabular}{c c c c} \hline
**Dataset** & **Angular Deviation (\({}^{\circ}\))** & **Number of Samples** & **Height (mm)** \\ \hline C1 & 0 & 4335 & 1047 \\  & & & 1007 \\ \hline C2 & 0 & 4335 & 987 \\  & & & 947 \\ \hline C3 & 0 & 4335 & 927 \\  & & & 907 \\  & & & 887 \\ \hline C4 & 1 & 4335 & 1027 \\  & & & 1007 \\ \hline C5 & 2 & 4335 & 1027 \\  & & & 1007 \\ \hline C6 & 3 & 4335 & 1027 \\  & & & 1007 \\ \hline \end{tabular}
\end{table}
Table 1: Distribution of the datasets.  
vector that denotes the sample weight of the leaf nodes. Moreover, \(I_{j}\) denotes the sample set of leaf \(j\). Equation (2) can be transformed as follows:  
\[F_{k}=\sum_{j=1}^{J}\left(\bigg{(}\sum_{i\in I_{j}}p_{i}\bigg{)}t_{j}+\frac{1}{2 }\bigg{(}\bigg{(}\sum_{i\in I_{j}}q_{i}+\gamma\bigg{)}t_{j}^{2}\bigg{)}\,, \tag{3}\]  
where \(\gamma\) represents the hyperparameters. Further employing the optimization method outlined in [32], we obtain the following final optimized function:  
\[O=\frac{1}{2}\Bigg{(}\frac{\big{(}\sum_{i\in I_{L}}p_{i}\big{)}^{2}}{\sum_{i \in I_{L}}q_{i}+\gamma}+\frac{\big{(}\sum_{i\in I_{R}}p_{i}\big{)}^{2}}{\sum_{i \in I_{R}}q_{i}+\gamma}-\frac{\big{(}\sum_{i\in I}p_{i}\big{)}^{2}}{\sum_{i\in I }q_{i}+\gamma}\Bigg{)}, \tag{4}\]  
where \(I_{L}\) and \(I_{R}\) represent the sample sets for the left and right branches, respectively. As discussed in [32], unlike traditional GBDT-based techniques, LightGBM grows trees vertically. This unique approach makes LightGBM an effective method for processing large-scale data and features. For a more detailed introduction to LightGBM, please refer to [31] by [PERSON] et al.