Sun glare poses a significant challenge in Advanced Driver Assistance Systems (ADAS) due to its potential to obscure important visual information, reducing accuracy in detecting road signs, obstacles, and lane markings. Effective sun glare mitigation and segmentation are crucial for enhancing the reliability and safety of ADAS. In this paper, we propose a new approach called “GCBAM-UNet” for sun glare segmentation using deep learning. We employ a pre-trained U-Net model VGG19-UNet with weights initialized from an ImageNet. To further enhance the segmentation performance, we integrated a Convolutional Block Attention Module (CBAM), enabling the model to focus on important features in both spatial and channel dimensions. Experimental results show that GCBAM-UNet is considerably better than other state-of-the-art methods, which will undoubtedly guarantee the safety of ADAS.