# Research on Vehicle Trajectory Prediction and Warning Based on Mixed Neural Networks
## 3 Methods and Design
### Object Detection of the Car
#### 3.1.3 Training of Car Object Detection Model  
As we obtained our training datasets and our model, we could commence with training. We used labelImg [19], which is also the github open source, to get the training label. The form of the training label was an xml file. Then, we trained our car object detection model three times. The model could learn to adjust its parameters in each step. At the first training, we had to pretrain our car object detection model. We used tiny-YOLO-VOC.weights [11], which is a pre-trained model developed by the authors of YOLO to pretrain our car detection model. The chief benefits are that it can make our model easy to  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Layers** & **Details** & **Output Size** \\ \hline \multirow{2}{*}{1} & Conv2d(filters = 16, kernel_size = 3, stride = 1, Batch_normalize = 1, \\  & Activation_function = Leaky Relu) & 16 x 416 x 416 \\ \hline \multirow{2}{*}{2} & Maxpooling2d(pool_size = 2, stride = 2) & 16 x 208 x 208 \\ \hline \multirow{2}{*}{3} & Conv2d(filters = 32, kernel_size = 3, stride = 1, Batch_normalize = 1, \\  & Activation_function = Leaky Relu) & 32 x 208 x 208 \\ \hline \multirow{2}{*}{4} & Maxpooling2d(pool_size = 2, stride = 2) & 32 x 104 x104 \\ \hline \multirow{2}{*}{5} & Conv2d(filters = 64, kernel_size = 3, stride = 1, Batch_normalize = 1, \\  & Activation_function = Leaky Relu) & 64 x 104 x104 \\ \hline \multirow{2}{*}{6} & Maxpooling2d(pool_size = 2, stride = 2) & 64 x 52 x 52 \\ \hline \multirow{2}{*}{7} & Conv2d(filters = 128, kernel_size = 3, stride=1, Batch_normalize = 1, \\  & Activation_function = Leaky Relu) & 128 x 52 x 52 \\ \hline \multirow{2}{*}{8} & Maxpooling2d(pool_size = 2, stride = 2) & 128 x 26 x 26 \\ \hline \multirow{2}{*}{9} & Conv2d(filters = 256, kernel_size = 3, stride = 1, Batch_normalize = 1, \\  & Activation_function = Leaky Relu) & 256 x 26 x 26 \\ \hline \multirow{2}{*}{10} & Maxpooling2d(pool_size = 2, stride = 2) & 256 x 13 x 13 \\ \hline \multirow{2}{*}{11} & Conv2d(filters = 512, kernel_size = 3, stride = 1, Batch_normalize = 1, \\  & Activation_function = Leaky Relu) & 512 x 13 x 13 \\ \hline \multirow{2}{*}{12} & Maxpooling2d(pool_size = 2, stride = 1) & 512 x 13 x 13 \\ \hline \multirow{2}{*}{13} & Conv2d(filters = 1024, kernel_size = 3, stride = 1, Batch_normalize = 1, \\  & Activation_function = Leaky Relu) & 1024 x 13 x 13 \\ \hline \multirow{2}{*}{14} & Conv2d(filters = 1024, kernel_size = 3, stride = 1, Batch_normalize = 1, \\  & Activation_function = Leaky Relu) & 1024 x 13 x 13 \\ \hline \multirow{2}{*}{15} & Conv2d(filters = 30, kernel_size = 1, stride = 1, Activation_function = Leaky Relu) & 30 x 13 x 13 \\ \hline \hline \end{tabular}
\end{table}
Table 1: The parameters of tiny-YOLO-VOC structure.  
Our input images were ground truth images from the car recorder. After image input, we needed to find eight points on it (Figure 13). The red points could generate an area, which covered the two road lines. These eight points were later used in the process of the projection transformation.  
In order to obtain clear road lines, edge detection was carried out on our input road images. We used the projection transform to obtain the edged road images. This was the most significant step in the lane line detection. The main purpose of it was to convert the perspective from the 3-D view to the 2-D view, as seen in Figure 14. We conducted projection transformation twice in the lane line detection. Furthermore, the images of the projection transformation were used to find the curve equation that fit the two road lines. After obtaining the curve equations, we plotted our lane area. Since we processed the projection transformation, we had to convert the lane area from the 2-D view back to the 3-D view. Figure 15 shows the projection transformation of the lane area. In the end, we could combine the lane area with the original road image. The above is the entire process of lane line detection.  
Figure 13: Eight points on the road images.