NRGS-Net: A Lightweight Uformer with Gated Positional and Local Context Attention for Nighttime Road Glare Suppression
Abstract
1. Introduction
- We propose a lightweight enhancement network (NRGS-Net) for nighttime road glare suppression, which effectively mitigates glare interference in nighttime road images.
- We design a lightweight and efficient Uformer backbone by reengineering the upsampling and downsampling structures, reducing model parameters from 20.47 M to 17.88 M while preserving essential spatial information. In addition, we enhance the feed-forward network with adaptive channel weighting to improve detail restoration and structural fidelity under nighttime conditions.
- We introduce a gated positional attention (GPA) module, which integrates positional encoding and local contextual information to effectively guide the network in accurately locating and suppressing glare regions of various shapes, thereby enhancing local contrast and visibility in affected areas.
- We construct and release the Night Road Glare Dataset (NRGD), a real-world dataset featuring diverse nighttime glare scenes. This dataset supports future research and enables fair performance comparison.
- We conduct extensive experiments on NRGD and Flare7k++ dataset using five commonly used evaluation metrics to compare our method with six state-of-the-art approaches. The results demonstrate the effectiveness and generalization ability of the proposed method in glare suppression, visibility enhancement, and detail restoration under nighttime road scenarios.
2. Related Work
2.1. Traditional Methods
2.2. Deep Learning Methods
3. The Methods
3.1. Overview
3.2. Paired Dataset Synthesis
3.3. Lightweight and Effective Uformer
3.4. Gated Positional Attention
3.5. Loss Function
4. Experiments
4.1. Experimental Setup Details
4.1.1. Model Training Details
4.1.2. Datasets
4.1.3. Evaluation Metrics
4.2. Quantitative Comparison with State-of-the-Art Methods
4.2.1. Result on NRGD
4.2.2. Result on Flare7K++ Dataset
4.3. Qualitative Comparison with State-of-the-Art Methods
4.3.1. Visual Analysis on NRGD
4.3.2. Visual Analysis on Flare7K++ Dataset
4.4. Ablation Study
4.4.1. Quantitative Ablation of Modules
4.4.2. Qualitative Ablation of Modules
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Lu, L.; Zhou, Y.; Panetta, K.; Agaian, S. Comparative study of histogram equalization algorithms for image enhancement. Mobile Multimedia. In Proceedings of the SPIE Defense, Security, and Sensing, Orlando, FL, USA, 5–9 April 2010; Volume 7708, pp. 337–347. [Google Scholar]
- Wu, T.; Wu, W.; Yang, Y.; Fan, F.; Zeng, T. Retinex image enhancement based on sequential decomposition with a plug-and-play framework. IEEE Trans. Neural Netw. Learn. Syst. 2023, 35, 14559–14572. [Google Scholar] [CrossRef]
- Proakis, J.G. Digital Signal Processing: Principles, Algorithms, and Applications, 4th ed.; Pearson Education: Noida, India, 2007. [Google Scholar]
- Lyons, R.G. Understanding Digital Signal Processing, 3rd ed.; Pearson Education: Noida, India, 1997. [Google Scholar]
- Jähne, B. Digital Image Processing; Springer: Berlin/Heidelberg, Germany, 2005. [Google Scholar]
- Prince, S.J.D. Computer Vision: Models, Learning, and Inference; Cambridge University Press: Cambridge, UK, 2012. [Google Scholar]
- Vitoria, P.; Ballester, C. Automatic flare spot artifact detection and removal in photographs. J. Math. Imaging Vis. 2019, 61, 515–533. [Google Scholar] [CrossRef]
- Zhang, Z.; Feng, H.; Xu, Z.; Li, Q.; Chen, Y. Single image veiling glare removal. J. Mod. Opt. 2018, 65, 2220–2230. [Google Scholar] [CrossRef]
- Si, L.; Wang, Z.; Xu, R.; Tan, C.; Liu, X.; Xu, J. Image enhancement for surveillance video of coal mining face based on single-scale retinex algorithm combined with bilateral filtering. Symmetry 2017, 9, 93. [Google Scholar] [CrossRef]
- Mandal, G.; Bhattacharya, D.; De, P. Real-time automotive night-vision system for drivers to inhibit headlight glare of the oncoming vehicles and enhance road visibility. J. Real-Time Image Process. 2021, 18, 2193–2209. [Google Scholar] [CrossRef]
- Rahman, S.; Rahman, M.M.; Abdullah-Al-Wadud, M.; Al-Quaderi, G.D.; Shoyaib, M. An adaptive gamma correction for image enhancement. EURASIP J. Image Video Process. 2016, 2016, 35. [Google Scholar] [CrossRef]
- Chen, S.D.; Ramli, A.R. Minimum mean brightness error bi-histogram equalization in contrast enhancement. IEEE Trans. Consum. Electron. 2003, 49, 1310–1319. [Google Scholar] [CrossRef]
- Tang, C.; Wang, Y.; Feng, H.; Xu, Z.; Li, Q.; Chen, Y. Low-light image enhancement with strong light weakening and bright halo suppressing. IET Image Process. 2019, 13, 537–542. [Google Scholar] [CrossRef]
- Zhou, Y.; Liang, D.; Chen, S.; Huang, S.J.; Yang, S.; Li, C. Improving lens flare removal with general-purpose pipeline and multiple light sources recovery. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Paris, France, 1–6 October 2023; pp. 12969–12979. [Google Scholar]
- Dai, Y.; Li, C.; Zhou, S.; Feng, R.; Zhu, Q.; Sun, Q.; Loy, C.C.; Gu, J.; Liu, S.; Wang, H.; et al. Mipi 2023 challenge on nighttime flare removal: Methods and results. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 2853–2863. [Google Scholar]
- Reinhard, E. High dynamic range imaging. In Computer Vision: A Reference Guide; Springer International Publishing: Cham, Switzerland, 2021; pp. 558–563. [Google Scholar]
- Wu, W.; Weng, J.; Zhang, P.; Wang, X.; Yang, W.; Jiang, J. Uretinex-net: Retinex-based deep unfolding network for low-light image enhancement. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA, 18–24 June 2022; pp. 5901–5910. [Google Scholar]
- Liu, R.; Ma, L.; Zhang, J.; Fan, X.; Luo, Z. Retinex-inspired unrolling with cooperative prior architecture search for low-light image enhancement. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 11–15 June 2021; pp. 10561–10570. [Google Scholar]
- Zhang, Y.; Zhang, J.; Guo, X. Kindling the darkness: A practical low-light image enhancer. In Proceedings of the 27th ACM International Conference on Multimedia, Nice, France, 21–25 October 2019; pp. 1632–1640. [Google Scholar]
- Jiang, Y.; Gong, X.; Liu, D.; Cheng, Y.; Fang, C.; Shen, X.; Yang, J.; Zhou, P.; Wang, Z.; Xu, J.; et al. Enlightengan: Deep light enhancement without paired supervision. IEEE Trans. Image Process. 2021, 30, 2340–2349. [Google Scholar] [CrossRef]
- Cui, Z.; Li, K.; Gu, L.; Su, S.; Gao, P.; Jiang, Z.; Qiao, Y.; Harada, T. You only need 90k parameters to adapt light: A light weight transformer for image enhancement and exposure correction. arXiv 2022, arXiv:2205.14871. [Google Scholar] [CrossRef]
- Guo, Q.; Wang, H.; Yang, J. Night Vision Anti-Halation Method Based on Infrared and Visible Video Fusion. Sensors 2022, 22, 7494. [Google Scholar] [CrossRef] [PubMed]
- Zhou, Y.; Xie, L.; He, K.; Xu, D.; Tao, D.; Lin, X. Low-light image enhancement for infrared and visible image fusion. IET Image Process. 2023, 17, 3216–3234. [Google Scholar] [CrossRef]
- Huang, W.; Li, K.; Xu, M.; Huang, R. Self-Supervised Non-Uniform Low-Light Image Enhancement Combining Image Inversion and Exposure Fusion. Electronics 2023, 12, 4445. [Google Scholar] [CrossRef]
- Liu, Y.; Yan, Z.; Wu, A.; Ye, T.; Li, Y. Nighttime image dehazing based on variational decomposition model. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA, 18–24 June 2022; pp. 640–649. [Google Scholar]
- Sharma, A.; Tan, R.T. Nighttime visibility enhancement by increasing the dynamic range and suppression of light effects. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 11–15 June 2021; pp. 11977–11986. [Google Scholar]
- Jin, Y.; Yang, W.; Tan, R.T. Unsupervised night image enhancement: When layer decomposition meets light-effects suppression. In Proceedings of the European Conference on Computer Vision, Tel Aviv, Israel, 23–27 October 2022; Springer Nature: Cham, Switzerland, 2022; pp. 404–421. [Google Scholar]
- Dong, S.W.; Lu, C.H. Dynamically Activated De-glaring and Detail-Recovery for Low-light Image Enhancement Directly on Smart Cameras. IEEE Trans. Emerg. Top. Comput. 2024, 13, 222–233. [Google Scholar] [CrossRef]
- Jin, Y.; Lin, B.; Yan, W.; Yuan, Y.; Ye, W.; Tan, R.T. Enhancing visibility in nighttime haze images using guided apsf and gradient adaptive convolution. In Proceedings of the 31st ACM International Conference on Multimedia, Ottawa, ON, Canada, 29 October–3 November 2023; pp. 2446–2457. [Google Scholar]
- He, Q.; Zhang, J.; Chen, W.; Zhang, H.; Wang, Z.; Xu, T. OENet: An overexposure correction network fused with residual block and transformer. Expert Syst. Appl. 2024, 250, 123709. [Google Scholar] [CrossRef]
- Niu, C.; Li, K.; Wang, D.; Zhu, W.; Xu, H.; Dong, J. Gr-gan: A unified adversarial framework for single image glare removal and denoising. Pattern Recognit. 2024, 156, 110815. [Google Scholar] [CrossRef]
- Dai, Y.; Luo, Y.; Zhou, S.; Li, C.; Loy, C.C. Nighttime smartphone reflective flare removal using optical center symmetry prior. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 20783–20791. [Google Scholar]
- Chen, B.H.; Ye, S.; Yin, J.L.; Cheng, H.Y.; Chen, D. Deep trident decomposition network for single license plate image glare removal. IEEE Trans. Intell. Transp. Syst. 2021, 23, 6596–6607. [Google Scholar] [CrossRef]
- Wu, Y.; He, Q.; Xue, T.; Garg, R.; Chen, J.; Veeraraghavan, A.; Barron, J.T. How to train neural networks for flare removal. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Nashville, TN, USA, 11–15 June 2021; pp. 2239–2247. [Google Scholar]
- Yan, W.; Tan, R.T.; Dai, D. Nighttime defogging using high-low frequency decomposition and grayscale-color networks. In Proceedings of the European Conference on Computer Vision, Glasgow, UK, 23–28 August 2020; Springer International Publishing: Cham, Switzerland, 2020; pp. 473–488. [Google Scholar]
- Zhang, H.; Xu, X.; He, H.; He, S.; Han, G.; Qin, J.; Wu, D. Fast user-guided single image reflection removal via edge-aware cascaded networks. IEEE Trans. Multimed. 2019, 22, 2012–2023. [Google Scholar] [CrossRef]
- Dai, Y.; Li, C.; Zhou, S.; Feng, R.; Luo, Y.; Loy, C.C. Flare7k++: Mixing synthetic and real datasets for nighttime flare removal and beyond. arXiv 2023, arXiv:2306.04236. [Google Scholar] [CrossRef]
- Dosovitskiy, A.; Beyer, L.; Kolesnikov, A.; Weissenborn, D.; Zhai, X.; Unterthiner, T.; Dehghani, M.; Minderer, M.; Heigold, G.; Gelly, S.; et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv 2020, arXiv:2010.11929. [Google Scholar]
- Cai, Y.; Bian, H.; Lin, J.; Wang, H.; Timofte, R.; Zhang, Y. Retinexformer: One-stage retinex-based transformer for low-light image enhancement. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Paris, France, 2–3 October 2023; pp. 12504–12513. [Google Scholar]
- Wang, Z.; Cun, X.; Bao, J.; Zhou, W.; Liu, J.; Li, H. Uformer: A general u-shaped transformer for image restoration. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA, 18–24 June 2022; pp. 17683–17693. [Google Scholar]
- Howard, A.G.; Zhu, M.; Chen, B.; Kalenichenko, D.; Wang, W.; Weyand, T.; Andreetto, M.; Adam, H. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv 2017, arXiv:1704.04861. [Google Scholar] [CrossRef]
- Hu, J.; Shen, L.; Sun, G. Squeeze-and-excitation networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 7132–7141. [Google Scholar]
- Woo, S.; Park, J.; Lee, J.Y.; Kweon, I.S. Cbam: Convolutional block attention module. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 3–19. [Google Scholar]
- Zhao, H.; Zhang, Y.; Liu, S.; Shi, J.; Loy, C.C.; Lin, D.; Jia, J. Psanet: Point-wise spatial attention network for scene parsing. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 267–283. [Google Scholar]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Identity mappings in deep residual networks. In Computer Vision–ECCV 2016, Proceedings of the 14th European Conference, Amsterdam, The Netherlands, 11–14 October 2016; Proceedings, Part IV; Springer International Publishing: Cham, Switzerland, 2016; pp. 630–645. [Google Scholar]
- Wang, Z.; Bovik, A.C.; Sheikh, H.R.; Simoncelli, E.P. Image quality assessment: From error visibility to structural similarity. IEEE Trans. Image Process. 2004, 13, 600–612. [Google Scholar] [CrossRef]
- Zhang, R.; Isola, P.; Efros, A.A.; Shechtman, E.; Wang, O. The unreasonable effectiveness of deep features as a perceptual metric. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 586–595. [Google Scholar]
- Mittal, A.; Soundararajan, R.; Bovik, A.C. Making a “completely blind” image quality analyzer. IEEE Signal Process. Lett. 2012, 20, 209–212. [Google Scholar] [CrossRef]
- Zheng, S.; Gupta, G. Semantic-guided zero-shot learning for low-light image/video enhancement. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, Waikoloa, HI, USA, 3–8 January 2022; pp. 581–590. [Google Scholar]
- Li, C.; Guo, C.; Loy, C.C. Learning to enhance low-light image via zero-reference deep curve estimation. IEEE Trans. Pattern Anal. Mach. Intell. 2021, 44, 4225–4238. [Google Scholar] [CrossRef] [PubMed]
- Nguyen, H.; Tran, D.; Nguyen, K.; Nguyen, H.; Tran, D.; Nguyen, K.; Nguyen, R. Psenet: Progressive self-enhancement network for unsupervised extreme-light image enhancement. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, Waikoloa, HI, USA, 2–7 January 2023; pp. 1756–1765. [Google Scholar]











| Methods | ||||
|---|---|---|---|---|
| EnlightenGAN [13] | 9.5874 | 0.5346 | 0.4660 | 7762.5161 |
| Zero-DCE [50] | 10.8350 | 0.5562 | 0.4461 | 5900.8370 |
| RUAS [18] | 6.1093 | 0.3674 | 0.6472 | 17,553.7916 |
| URetinex [17] | 10.4410 | 0.5630 | 0.4521 | 6338.3320 |
| PSENet [51] | 10.5074 | 0.5341 | 0.4459 | 6105.1058 |
| IAT [21] | 16.4169 | 0.6588 | 0.3671 | 1802.1397 |
| Ours | 26.4192 | 0.9602 | 0.0792 | 400.5131 |
| Methods | ||||
|---|---|---|---|---|
| EnlightenGAN [20] | 11.9049 | 0.7219 | 0.2665 | 4490.1825 |
| Zero-DCE [50] | 12.6071 | 0.7168 | 0.2656 | 3694.5139 |
| RUAS [18] | 6.3398 | 0.4290 | 0.5594 | 15,444.7054 |
| URetinex [17] | 13.1262 | 0.7256 | 0.2704 | 3374.2936 |
| PSENet [51] | 14.1257 | 0.7443 | 0.2257 | 2814.5622 |
| IAT [21] | 16.4169 | 0.6588 | 0.3671 | 1802.1397 |
| Ours | 31.4508 | 0.9822 | 0.0317 | 87.9677 |
| Methods | ||||
|---|---|---|---|---|
| w/o GPA | 24.2491 | 0.9114 | 0.1361 | 508.977 |
| w/o L-Sampling | 25.1757 | 0.9317 | 0.1015 | 454.0037 |
| Ours | 26.4192 | 0.9602 | 0.0792 | 400.5131 |
| Methods | ||||
|---|---|---|---|---|
| w/o GPA | 23.1328 | 0.8844 | 0.1764 | 607.8928 |
| w/o L-Sampling | 30.0409 | 0.9752 | 0.0444 | 105.7256 |
| Ours | 31.4508 | 0.9822 | 0.0317 | 87.9677 |
| Methods | |||
|---|---|---|---|
| w/o GPA | 4.9766 | 41.7599 | 35.5739 |
| w/o L-Sampling | 4.8686 | 41.9334 | 35.4058 |
| Ours | 4.8866 | 41.0672 | 35.2119 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Yang, R.; Chen, H.; Luo, S.; Wang, Z. NRGS-Net: A Lightweight Uformer with Gated Positional and Local Context Attention for Nighttime Road Glare Suppression. Appl. Sci. 2025, 15, 8686. https://doi.org/10.3390/app15158686
Yang R, Chen H, Luo S, Wang Z. NRGS-Net: A Lightweight Uformer with Gated Positional and Local Context Attention for Nighttime Road Glare Suppression. Applied Sciences. 2025; 15(15):8686. https://doi.org/10.3390/app15158686
Chicago/Turabian StyleYang, Ruoyu, Huaixin Chen, Sijie Luo, and Zhixi Wang. 2025. "NRGS-Net: A Lightweight Uformer with Gated Positional and Local Context Attention for Nighttime Road Glare Suppression" Applied Sciences 15, no. 15: 8686. https://doi.org/10.3390/app15158686
APA StyleYang, R., Chen, H., Luo, S., & Wang, Z. (2025). NRGS-Net: A Lightweight Uformer with Gated Positional and Local Context Attention for Nighttime Road Glare Suppression. Applied Sciences, 15(15), 8686. https://doi.org/10.3390/app15158686

