## 3 Model Design
### Design of the Overall Process Framework
#### 3.2.1 Data Preparation Stage  
Image Collection  
Prior to model training, a large number of images had to be prepared and then divided into a training set and a test set. In all cases, the resolution of the image was 416 \(\times\) 416. The images were sourced from: (1) dashcam footage (including Car Crashes Time [64]); (2) the Tsinghua-Tencent 100K (TT100K) dataset [65]; (3) Google Street View; and (4) Google Images searches. Figure 3: Schematic showing the overall process framework. 1. Dashcam footage: These were videos recorded by actual drivers on the road. The collected dashcam footage was trimmed into pictures that were saved as JPG files for training and later testing. 2. TT100K dataset: This dataset contains data collected by street-mapping vehicles and includes various weather conditions. We screened the dataset and extracted the required information. 3. Google Street View: From this, we screen-captured street imagery that contained speed limit signs. 4. Google Images searches: We used this resource to search for suitable images. Image Processing  
Rotation angle was used to simulate obscured, slanted, or twisted objects. Gaussian noise was used to simulate poor weather. Canny edge detection was used to strengthen the edges of the targets so that their features could be accentuated. The original images were processed separately using the four combinations involving the three image-processing techniques as follows: (1) processing through rotation angle, Gaussian noise, and Canny edge detection, successively; (2) processing through rotation angle and Canny edge detection, successively; (3) processing through Gaussian noise and Canny edge detection, successively; and (4) processing through Canny edge detection only. The tree structure in Figure 4 displays the corresponding images generated through these four image-processing combinations. Combinations 1 and 2 generate four additional images, and Combinations 3 and 4 generate two and one additional images, respectively. Thus, seven images can be generated from a single original image. The joint use of these image-processing techniques effectively increased the number and variety of the images in the training set. Figure 4: Various images generated by the four image-processing combinations. We used the LabelImg tool for labeling in YOLOv7 and the LabelMe tool for labeling in Mask R-CNN. In the latter, only the tens and hundreds digits were labeled. This means that for the speed limit signs bearing the numbers 30, 40, 50, 60, 70, 80, 90, 100, and 110, only the numbers 3, 4, 5, 6, 7, 8, 9, 10, and 11 were labeled, as shown in Table 3. This design was used for two reasons: (1) It is extremely rare to see a speed limit number that does not end with 0 (this was seen only on temporary speed limit signs in road sections under construction). Therefore, training and detection in solely the tens and hundreds digits not only reduced the complexity of the training and detection process, but also prevented the problem of indistinguishable features that arose when the number ended with a 0; and (2) detecting the tens and hundreds digits prevented detection errors when the ones digits were obscured (see the 70 km/h speed limit in Table 3), and also for this reason, we used the Mask R-CNN instead of YOLOv7 to classify the speed limit signs. Tables 4-14 visually present all image classes after labeling. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Speed Limit** & **30** & **40** & **50** \\ \hline Speed limit sign \begin{table}
\begin{tabular}{c c c} \hline \hline  & \multicolumn{1}{c}{} & \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Labeling Class A scenarios. (Image sources: dashcam footage, Google Street Views of National Freeway No. 1, Expressway 64, and Huanhe Expressway in Taipei City). \begin{table}
\begin{tabular}{c c c} \hline \hline  & \multicolumn{1}{c}{} & \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Labeling Class B scenarios. (Image sources: Car Crashes Time and rockfall and pothole images on Google).