## 4 Experimental Analysis
### Collision Detection Efficacy
#### 4.4.2 Performance of SVM Collision Detection  
When calculating the amplitude change in the optical flow vector, each frame was first resized to 134 \(\times\) 100 pixels, and a threshold of \(\beta\) = 0.35 was applied according to Formula (15) to construct the feature vector. The image was then divided into 4 \(\times\) 4 non-overlapping cells, and the amplitude change frequency was independently collected for each cell. The amplitude change distribution within each cell was represented by a fixed-size histogram. These histograms were subsequently concatenated into a 16-dimensional feature vector. To create a training set for the SVM, we compiled a dataset of 178 videos sourced from publicly accessible Internet content, ensuring that they were devoid of personally identifiable information or sensitive data. Of these, 121 videos were classified as non-accident data, while the remaining videos were labeled as accident data. During training, 10% of the videos were designated as a test set. The feature vectors extracted from these videos were utilized as input features for training the SVM. The grid search technique was employed to optimize the SVM hyperparameters. The available values for the regularization parameter \(C\) were {0.1, 1, 10, 100}, while the available values for the kernel function parameter gamma were {'_scale_', '_auto_', 0.01, 0.1, 1}. The types of kernel functions considered were {'_linear_', '_rbf_', '_poly_'}. A 5-fold cross-validation strategy was adopted, where the model was trained and evaluated on five different training and validation sets for each parameter combination. The regularization parameter \(C\) is crucial in controlling the trade-off between minimizing errors on the training data and reducing the norm of the model's weights. A smaller value of \(C\) leads to a closer fit to the training data, potentially causing overfitting, while a larger value promotes better generalization at the possible expense of training set accuracy. The gamma parameter, also known as the kernel coefficient, determines the influence of individual training examples. A low gamma value yields a broader, smoother decision boundary by considering points far from it, while a high gamma value enables the model to capture more complex patterns, which can also lead to overfitting. Figure 9 is a comprehensive view of the model performance on different data subsets. The grid search results in Figure 9 highlight the interaction of these hyperparameters to achieve the best model performance. The performance reached its peak when \(C\) was set to 0.1 and gamma was set to '_scale_', suggesting that this configuration enables the model to balance flexibility and regularization effectively. This equilibrium is crucial because the dataset for collision detection likely contains noise and variability typical of real-world scenarios. The chosen parameters ensure that the model is adequately robust to handle such noise without being overly sensitive to it. The polynomial kernel's success in this context also indicates that the relationships between features in the dataset are not strictly linear. Its ability to effectively capture higher-order feature interactions enhances the SVM's ability to classify collision and non-collision frames more effectively. This ability is particularly important in the context of accident detection, where the interactions between variables, such as the speeds and trajectories of different vehicles, are often complex and nonlinear. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Algorithm** & **AEE** & **Angle Error** & **FPS** \\ \hline Improved HS algorithm & 12.02 & 66.09\({}^{\circ}\) & 5.26 \\ Classic HS algorithm & 13.32 & 66.88\({}^{\circ}\) & 6.25 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Performance comparison of the optical flow estimation algorithms. The model exhibited strong performance on the test set with this parameter combination, achieving an AP score of 0.756, a precision of 75%, an accuracy of 75%, and a recall of 1.0.