# Traffic Measurement and Congestion Detection Based on Real-Time Highway Video Data
## 3 Approach
### Core Components
#### 3.3.3 Prediction Modelling  
The proposed system operates with sequences from publicly and remotely accessible video cameras. Most of the time these public cameras are mounted above the roads, e.g. under bridges or special fixtures and record vehicles on roads with high traffic such as highways. Based on this fact, the following relevant assumptions can be made: (i) The analyzed sequences are mainly recorded on highways high above the street. The perspective of the camera is situated above the street with vehicles driving towards the camera, away from the camera or both. Additionally, there are seldomly significant bends on highways, hence the driving direction is very straight. (ii) On highways, the driving speed of all the vehicles passing by is quite similar. Thus, the covered distance between all the vehicles is nearly the same. However, this assumption is not valid for special cases such as congestions. First of all, the prediction model saves all the positions from vehicle detections with additional data such as the frame count. If the model has enough data points from all the past frames it tries to form associations between these points. The goal of this task is to find possible driving paths in successive frames considering certain limitations: Data points are only valid if they come from successive frames to keep temporal ordering, lines between data points must stay inside a set range of angles to encourage rather straight driving paths and the distance between associated data points must be similar due to the assumed similar velocity of the vehicles. Figure 7 shows a schematic illustration of the initialization process of the prediction model. It tries to find driving paths based on the gathered data points from the detection and classification component. This initialization phase is completed when a certain number of driving paths are available. However, it gets continuously updated in order to react to changing traffic parameters. The discovered driving paths are used later for estimating positions of vehicles in future frames. \begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline \hline
**Key** & **Description** & **Value** \\ \hline batch & Also known as batch size. Indicates how many image samples are used before the network updates its weights during the training process. Is often used to save time when training with huge datasets. & Integer (multiples of 2) \\ \hline subdivision & Lets you specify a subdivision of the batch size during training. This is helpful if you do not have enough memory to process all images at once. The system uses then batch/subdivision number of images. & Integer (multiples of 2) \\ \hline width/height & Input image size. The image will be resized to _width_\(\times\)_height_ pixels before processing. In general, the higher the resolution the better the results. During training, higher values increase training time. & Integer (multiple of 32) \\ \hline channels & Number of color channels while processing. For RGB images & Integer \\ \hline momentum & Penalizes large weight changes between iterations during training. & Double \\ \hline decay & Penalizes large values of weights to prevent overfitting during training. & Double \\ \hline learning\_rate & Controls how fast the network learns. & Double \\ \hline momentum & Penalizes large weight changes between iterations. & Double \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Most important YOLOv3 configuration file entry descriptions. After completion of the initialization phase, the prediction model is able to estimate future positions of detected vehicles. As exemplified by Figure 8, the prediction model is asked to estimate positions of currently detected objects. Depending on the current positions of the detected vehicles, the prediction model picks the path which has a minimal distance for each of the detections. Each path is associated with an angle and a distance. This data is used to calculate a future position by simply adding the path such as a vector on top of the current position.