# GCBAM-UNet: Sun Glare Segmentation Using Convolutional Block Attention Module
## 1 Introduction
Once glare spots are detected, inpainting techniques can be used to reconstruct the occluded information by interpolating the surrounding pixel values [10]. In fact, techniques like glare removal and inpainting can sometimes lead to the loss of important image details or introduce artifacts, which can degrade the overall image quality. Some image processing methods can alter the color balance of an image, leading to unnatural or inaccurate color representation. In some cases, adverse weather conditions like rain, fog, and snow can introduce additional challenges for image-processing techniques aimed at reducing glare. The last category of approaches is based on deep learning models that aim to recognize and adapt to glare conditions. By leveraging large datasets that include a wide range of lighting conditions and glare instances, deep learning can significantly ensure the best model's generalization to real-world scenarios. In this way, deep learning-based approaches can enhance the ability of ADAS to function reliably even in challenging lighting conditions. Recently, deep learning methods have been extensively applied to various computer vision tasks, including object detection, classification [11; 12; 13; 14], and segmentation [15; 16]. Architectures like convolution networks [17], U-Net [18], or DeepLab [19] can be used to segment images and identify areas affected by glare. Once identified, these areas can be processed differently to reduce glare. YOLO (You Only Look Once) [20] and Faster R-CNN [21] can be trained to detect objects even in the presence of glare, ensuring that critical objects like pedestrians and other vehicles are not missed. Moreover, models designed for image super-resolution can enhance the clarity and detail of images affected by glare, making it easier to detect and identify objects. Another type of generative deep learning model called autoencoders [22] can be used for image denoising and enhancement. An autoencoder can learn to produce glare-free versions of images by learning from large datasets. By leveraging these deep learning techniques, ADAS can achieve improved robustness against sun glare, enhancing the safety and reliability for drivers. In this work, we introduce a novel deep learning-based method called \"GCBAM-UNet\" for sun glare segmentation that consists of three major deep learning models. For that,we used VGG19 as the encoder in a U-Net architecture to leverage the powerful feature extraction capabilities of VGG19 for the sun glare segmentation task. Then, we integrated the Convolutional Block Attention Module (CBAM) with VGG19-UNet to improve the model's ability to highlight important features, thereby improving performance on sun glare segmentation. The most notable contributions of this study are as follows:  
1. The integration of VGG19 as the encoder in the U-Net architecture significantly enhances the model's ability to handle complex segmentation tasks. VGG19, with its 19-layer deep architecture and pre-trained weights from ImageNet, brings robust feature extraction capabilities, enabling the model to identify intricate patterns and subtle distinctions in the input data. This not only accelerates convergence during training but also reduces the reliance on extensive labeled datasets through transfer learning. The hierarchical feature representations extracted by VGG19 provide a rich multi-level foundation for the U-Net decoder, improving the reconstruction of fine details and facilitating more accurate segmentation;
2. To further enhance the model's robustness, the Convolutional Block Attention Module (CBAM) is integrated into the VGG19-UNet architecture. CBAM applies attention mechanisms in both channel and spatial dimensions, allowing the model to dynamically focus on the most critical features while suppressing irrelevant noise. This mechanism improves the model's performance in handling challenges such as varying lighting conditions, a key issue in sun glare segmentation.