## 4 Methodology  
### Machine Learning Models  
#### 4.1.1 SVM  
SVM is an algorithm under a supervised learning model, commonly used in classification problems. The earliest SVM model is a linear classifier dedicated to binary classification, with a statistical theory foundation. The SVM method maps the sample space into a high-dimensional or even infinite-dimensional eigenspace (Hilbert space) through a nonlinear mapping p, so that a problem that is nonlinearly differentiable in the original sample space is transformed into a problem that is linearly differentiable in the eigenspace. Simply put, it is lift and dimension linearization. Due to classification, regression, and other problems, it is likely that the sample set in the low-dimensional sample space cannot be linearly processed, but in the high-dimensional feature space this can be achieved through a linear hyperplane linear division (or regression). Generally, while upgrading will bring the complexity of computation, the SVM method applies the expansion theorem of the kernel function and establishes a linear learning machine in high-dimensional feature space; therefore, compared with the linear model, not only does it almost not increase the complexity of the computation, but to a certain extent it also avoids the \"dimensionality catastrophe\". Different SVMs can be generated by choosing different kernel functions, and the following four kernel functions are commonly used: (1) linear kernel function \(K(x,y)=x\cdot y\); (2) polynomial kernel function \(K(x,y)=[(x\cdot y)+1]^{d}\); (3) radial basis functions \(K(x,y)=\sqrt{\frac{-|x-y|^{2}}{d^{2}}}\); (4) two-layer neural network kernel function \(K(x,y)=tanh(a(x,y)+b)\). Figure 17 is the construction flowchart of the SVM model for binary classification of traffic black spot recognition. The SVM model is trained using data with selected features, and during the training process, appropriate parameters and kernel functions need to be selected to optimize the performance of the model. In this process, the model parameters need to be selected, and the more important parameters are selected as follows:  
1. The choice of kernel function. Depending on the different SVM model kernel functions, the accuracy of the SVM model will be different; generally, it will be a linear kernel function, Gaussian kernel function, Sigmoid kernel function, and so on;
2. Optimization of kernel parameters. The main parameters are the kernel parameter g and the penalty factor c. The penalty factor indicates the importance of misclassification, and the parameter g indicates the size of the impact of a single sample, and the smaller the value, the greater the impact. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**fid** & **Road** & **Building** & **Tree** & **Sky** & **Bus** & **Sidewalk** \\ \hline
0 & 36.90986633 & 25.16593933 & 16.90559387 & 10.83641052 & 4.64630127 & 2.752304077 \\ \hline
1 & 36.37313843 & 20.44830322 & 12.4294281 & 18.67103577 & 0 & 3.3790  
The specific description of the model parameters is shown in Table 12.  
The SVM function package in the machine learning Skleam toolkit was used to model the SVM algorithm, and the model accuracy was higher when the kernel function was chosen to be linear, in addition to the other parameters of the algorithmic model (Table 13), which were appropriately tuned using the grid search method. According to Table 14, the accuracy of the model is high when the kernel function is chosen to be linear. The appropriate kernel function is chosen to find the optimal classification hyperplane, and the support vector set of each sample feature is obtained to form the discriminant function of classification. \begin{table}
\begin{tabular}{c c} \hline
**Kernel Value** & **Accuracy** \\ \hline Linear & 81.75\% \\ \hline Rbf & 76.83\% \\ \hline Sigmoid & 71.58\% \\ \hline \end{tabular}
\end{table} 
Table 13: Selection of model kernel function for SVM algorithm.