# Brake Light Detection Algorithm for Predictive Braking
## 2 State-of-the-Art
Previous brake light detection research with machine vision can be divided into nighttime studies [14; 15; 16; 17] and daytime studies [18; 19; 20]. During the nighttime, the task of brake light detection becomes simpler, due to the vehicle lights already being clearly discernible against a dark background. This is demonstrated in the work of [PERSON] et al. [15] who used an HSV filter for detecting vehicle tail-lights, reaching a notable accuracy of 97% in detecting brake lights. Following a similar methodology, [PERSON] and [PERSON] [14] developed a system that detected brake lights in the darkness with a simplistic RGB model. They used a test sample of 45 images and managed to classify brake light status with 87% accuracy. [PERSON] [16] used a light distribution based Nakagami-distribution model and achieved an average detection accuracy of 76%, with extensive testing in urban and highway routes, as well as under different weather conditions. During the daytime, simple colorspace filtering is inadequate for detecting the vehicle lights due to the limited contrast of brake lights in regards to image background. Thus, daytime brake light detection is typically performed in such a way that a vehicle is first detected and marked with a bounding box and then the bounding boxes are extracted from the full image to limit the processed image area. The bounding box area has commonly been determined by utilizing the well-established histogram of oriented gradients (HOG) detection algorithm [21]. More modern deep learning-based approaches applicable for vehicle detection include YOLOv3 [5], SSD [22], or RCNN [23]. The latest methods include the detection of small vehicles with ASPP-CenterNet [24]. After extracting the vehicle bounding boxes, the brake light status in each vehicle bounding box is classified. The classification has typically been accomplished with machine learning classifiers, such as convolutional neural networks (CNNs), or colorspace filtering. Common colorspaces for filtering include CIELAB (L*a*b), YCbCR, and hue saturation value (HSV) [25]. The brake light detection framework of [PERSON] et al. [18] utilized HOG to capture the vehicle bounding boxes. They identified lower two tail light candidate regions from these bounding boxes as radially symmetric areas that were found on a common horizontal plane. In other words, the two brake lights should exist as a pair symmetric with respect to the vehicle center line. These regions were filtered with an L*a*b filter. The brake light status was then detected based on high red chromaticity difference to the tail light region, as the lights only occupy some of the tail light region. Their approach yielded an accuracy of 87.6% on their own non-public dataset. [PERSON] et al. [19] have proposed another brake light detection algorithm based on extracting vehicle rears utilizing a HOG detector. They modified the original HOG detector to better suit the purpose of using road- and vehicle-specific information. The brake light status of a vehicle was evaluated using a CNN classifier, which was trained with images of vehicles with brake lights either on or off. Their classifier achieved an average accuracy of 89% with ten-fold cross-validation on their self-gathered non-public data. [PERSON] et al. [20] studied tail light detection and signal recognition including turn signals. Their approach included bounding box extraction, a preprocessing stage in HSV colorspace, and signal classification. Bounding box extraction was based on HOG, a pairing algorithm, as well as a support vector machine. The preprocessing stage included HSV colorspace, clustering, and the orientation and location of taillight pairs inside the bounding box. A dictionary learning algorithm was used for the classification stage. The study primarily focused on closely located vehicles, i.e., 5-40 m.  
Despite earlier research in the field of brake light detection, not a single available open source implementation exists.