A fine-grained defect-sensitive local–global multiscale vision transformer framework for urban visual pollution prediction
Peng Xu, Jingyi Shen, Taotao Zou, Fa Shen, Yalun Lei, Digong Liu
Urban visual pollution is an increasing concern in rapidly growing cities, affecting environmental quality, public perception, and urban sustainability. Existing visual pollution assessment approaches often rely on manual inspection, conventional image processing, or generic deep learning models that exhibit limited sensitivity to small-scale degradation patterns, insufficient contextual understanding, and poor capability for continuous environmental severity assessment. Manual inspection methods are slow and subjective. To address these challenges, this study proposes a transformer-based deep learning framework for multi-class visual pollution detection using street-level imagery. The model integrates fine-grained urban patch encoding, defect-sensitive feature enhancement, Local–Global Dual Branch learning, hierarchical feature fusion, and a learnable Visual Pollution Index (VPI) layer to quantify degradation severity. The proposed approach classifies seven urban pollution categories, including garbage, graffiti, potholes, construction road damage, and cluttered sidewalks. Experimental results demonstrate that the model achieves the highest overall accuracy of 95.12%, outperforming baseline transformer models. The framework also attains a precision of 95.22%, recall of 95.03%, and F1-score of 95.08%. The proposed Visual Pollution Index reaches an overall VPI score of 95.07%, indicating strong consistency between classification confidence and environmental degradation assessment. Explainable AI techniques, including Grad-CAM, LIME, attention rollout, and counterfactual analysis, confirm that the model focuses on meaningful pollution regions rather than background features. The findings demonstrate that integrating defect-sensitive transformer learning with environmental severity quantification provides an effective and interpretable solution for large-scale urban visual pollution monitoring and smart-city environmental management.