# Short Communication: Detecting Heavy Goods Vehicles in Rest Areas in Winter Conditions Using YOLOv5
## 2 Materials and Methods
### The Rest Area Dataset  
At each rest area, a thermal imaging network camera is installed in a fixed position facing the main parking area of the rest area. One of the cameras was installed in front of a pole, which appears as a grey area in the centre of the image. The thermal network cameras have an uncooled microbolometre image sensor with a thermal sensitivity (noise equivalent temperature difference) of \(<\)50 mK and a thermal sensor resolution of 640 \(\times\) 480. The Ffmpeg library [56] was used to capture images from the video streams with settings that capture frames with a scene change of more than 2%. This is at the threshold where random sensor noise also triggers [57]. The captured frames have dimensions of 640 \(\times\) 480. Figure 2 shows images from the camera under different light and weather conditions.  
Figure 1: Typical examples of images from the thermal network cameras at the two rest areas.  
Between 15 January 2021 and 22 February 2021, 100,179 images were collected from the cameras. During this period, data collection from both cameras was partially interrupted. These interruptions could last from a few hours to several days. The longest interruption occurred at rest area B, where the camera was offline for the first days of the data collection period. Therefore, less data were available from rest area B. One consequence of the sensitive setting of the motion detector was that it reacted to temperature changes caused by wind. Therefore, many of the images only differed from each other in their grey scale due to temperature changes and not due to changes in vehicle position. The two rest areas in this study are mainly used for long breaks (about 8 h). Therefore, there are long periods of inactivity on a specific parking space. A total of 427 images were selected for annotation and split into the training, validation and test datasets. To prevent testing the model with images that are very similar to the images in the training dataset, the datasets were chronologically split. Table 1 shows how the data were split.  
The data were annotated using bounding boxes for three classes: _truck_front_, _truck_back_ and _car_, see Figure 3 for example. We chose to focus on the driver's cabin in front and the side view (_truck_front_) and the front view on the rear of the truck (_truck_back_), as the bounding boxes overlapped too much around the whole vehicle. In addition, this also makes it possible to recognise vehicles where the front or rear is cut off. In the 427 annotated images, there were 768 objects labelled as _truck_front_, 378 as _truck_back_ and 17 as _car_.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Dataset** & **Rest Area** & **Augmentation** & **\#Images** & **Period** \\ \hline Training & A & yes & 329 & 25 January 2021 to 15 January 2021 \\  & B & yes & 251 & 17 February 2021 to 2 February 2021 \\ Validation & A & no & 64 & 16 February 2021 to 25 January 2021 \\  & B & no & 39 & 17 February 2021 to 18 February 2021 \\ Test & A & no & 30 & 16 February 2021 to 22 February 2021 \\  & B & no & 30 & 18 February 2021 to 22 February 2021 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Split of the data into training, validation and test dataset.  
Figure 2: Example images from the thermal network camera taken at daylight (**A**,**B**), in the dark (**C**,**D**), when it was raining 1.1 mm (**A**), when it was snowing 1.5 mm (**C**) and without any precipitation (**B**,**D**).  
The 264 images from the training dataset were augmented to 580 images. For each image, a maximum of 3 augmented versions were generated by randomly applying horizontal mirroring, resizing (cropping from 19% minimum zoom to 67% maximum zoom) and changes in the grey scale (brightness variations between \(\pm\)35%). Examples of augmented images are shown in Figure 4.