Semantic-Guided Image Restoration Method Based on SAM Segmentation Probability Maps
TAO Wenhao1, ZHANG Hongyun1,2, MIAO Duoqian1,2, LI Miao1
1. School of Computer Science and Technology, Tongji University, Shanghai 201804; 2. The Key Laboratory of Embedded System and Service Computing(Ministry of Education), Tongji University, Shanghai 201804
摘要 现有图像恢复方法多侧重低层像素特征的拟合,对区域语义信息的利用不足,容易出现细节丢失与结构失真等问题.为此,文中提出基于SAM分割概率图的语义引导图像恢复方法(Semantic-Guided Image Restoration Based on SAM Segmentation Probability Maps, SGIR-SAM).首先,设计分割概率-语义特征构建模块,利用SAM(Segment Anything Model)获取退化图像的分割概率图,再通过通道映射与局部特征提取,将分割概率图转换为用于引导图像恢复的语义级先验特征.然后,构建语义特征引导的多头注意力机制,由语义先验生成引导权重,对查询特征、键特征和值特征进行加权,从而引导图像特征的全局上下文建模.最后,设计语义特征引导的前馈网络,利用先验引导图像特征的非线性变换过程.实验表明,SGIR-SAM在去雨、去雾、去雪和去模糊任务上取得较优性能与视觉效果.
Abstract:Most existing image restoration methods focus on fitting low-level pixel features while making insufficient use of regional semantic information, often resulting in the problem of detail loss and structural distortion. To address this issue, a semantic-guided image restoration method based on SAM(segment anything model) segmentation probability maps(SGIR-SAM) is proposed. First, a segmentation probability-semantic feature construction module(SP-SFCM) is designed. SAM is employed to obtain segmentation probability maps of degraded images. These maps are then converted into semantic prior features for guiding image restoration through channel mapping and local feature extraction. Second, a semantic feature-guided multi-head attention mechanism(SFMA) is developed. Weights generated from the semantic priors are applied to the query, key and value features to guide global context modeling of image features. Semantic information is thus incorporated into global feature interactions. Finally, a semantic feature-guided feed-forward network(SF-FFN) is designed. The priors guide the nonlinear transformation of image features. Experiments demonstrate that SGIR-SAM achieves favorable performance and visual results on rain removal, dehazing, snow removal and deblurring tasks.
陶文浩, 张红云, 苗夺谦, 李淼. 基于SAM分割概率图的语义引导图像恢复方法[J]. 模式识别与人工智能, 2026, 39(10): 920-935.
TAO Wenhao, ZHANG Hongyun, MIAO Duoqian, LI Miao. Semantic-Guided Image Restoration Method Based on SAM Segmentation Probability Maps. Pattern Recognition and Artificial Intelligence, 2026, 39(10): 920-935.
[1] Kirillov A, Mintun E, Ravi N, et al. Segment anything[C]//Proceedings of the IEEE/CVF International Conference on Computer Vision. Washington, USA: IEEE, 2023: 3992-4003. [2] Zamir S W, Arora A, Khan S, et al. Restormer: efficient transfor-mer for high-resolution image restoration[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington, USA: IEEE, 2022: 5718-5729. [3] 徐祺津,叶海良,曹飞龙,等.基于全局-局部先验和纹理细节关注的图像修复[J].模式识别与人工智能, 2025, 38(2): 101-115. (XU Q J, YE H L, CAO F L, et al. Image inpainting based on global-local prior and texture details[J]. Pattern Recognition and Artificial Intelligence, 2025, 38(2): 101-115.) [4] 张荣国,文译浩,胡静,等.基于结构变换补全的边缘纹理双特征聚合图像修复方法[J].模式识别与人工智能,2025, 38(5): 397-411. (Zhang R G, Wen Y H, Hu J, et al. Edge-texture dual feature aggregation for image inpainting via structural transformation completion[J]. Pattern Recognition and Artificial Intelligence, 2025, 38(5): 397-411.) [5] Li S W, Liu M X, Zhang Y T, et al. SAM-DEBLUR: let segment anything boost image deblurring[C]//Proceedings of the IEEE International Conference on Acoustics, Speech and Signal Processing. Washington, USA: IEEE, 2024: 2445-2449. [6] Zhang Q, Liu X Y, Li W, et al. Distilling semantic priors from SAM to efficient image restoration models[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington, USA: IEEE, 2024: 25409-25419. [7] Fu X Y, Huang J B, Zeng D L, et al. Removing rain from single images via a deep detail network[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. Washington, USA: IEEE, 2017: 1715-1723. [8] Li X, Wu J L, Lin Z C, et al. Recurrent squeeze-and-excitation context aggregation net for single image deraining[C]//Proceedings of the 15th European Conference on Computer Vision. Berlin, Germany: Springer, 2018: 262-277. [9] Fu X Y, Qi Q, Zhu Z J, et al. Rain streak removal via dual graph convolutional network[J]. Proceedings of the AAAI Conference on Artificial Intelligence, 2021, 35(2): 1352-1360. [10] Cui Y N, Ren W Q, Knoll A.Omni-kernel network for image restoration[J]. Proceedings of the AAAI Conference on Artificial Intelligence, 2024, 38(2): 1426-1434. [11] Cui Y N, Ren W Q, Cao X C, et al. Revitalizing convolutional network for image restoration[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2024, 46(12): 9423-9438. [12] Cui Y N, Ren W Q, Yang S N, et al. IRNeXt: rethinking convolutional network design for image restoration[C]//Proceedings of the 40th International Conference on Machine Learning. San Diego, USA: JMLR, 2023: 6545-6564. [13] Guo Y, Xiao X Y, Chang Y, et al. From sky to the ground: a large-scale benchmark and simple baseline towards real rain remo-val[C]//Proceedings of the IEEE/CVF International Conference on Computer Vision. Washington, USA: IEEE, 2023: 12063-12073. [14] Wang Z D, Cun X D, Bao J M, et al. Uformer: a general U-shaped transformer for image restoration[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington, USA: IEEE, 2022: 17662-17672. [15] Chen X, Li H, Li M Q, et al. Learning a sparse transformer network for effective image deraining[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington, USA: IEEE, 2023: 5896-5905. [16] Valanarasu J M J, Yasarla R, Patel V M. TransWeather: Transformer-based restoration of images degraded by adverse weather conditions[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington, USA: IEEE, 2022: 2343-2353. [17] Chen X, Pan J S, Dong J X.Bidirectional multi-scale implicit neural representations for image deraining[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington, USA: IEEE, 2024: 25627-25636. [18] Xiao J, Fu X Y, Liu A P, et al. Image de-raining transformer[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2023, 45(11): 12978-12995. [19] Song Y D, He Z Q, Qian H, et al. Vision transformers for single image dehazing[J]. IEEE Transactions on Image Processing, 2023, 32: 1927-1941. [20] Jin Z, Qiu Y W, Zhang K H, et al. MB-TaylorFormer V2: improved multi-branch linear transformer expanded by Taylor formula for image restoration[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2025, 47(7): 5990-6005. [21] Chen S X, Ye T, Liu Y, et al. MSP-Former: multi-scale projection transformer for single image desnowing[C/OL]//Proceedings of the IEEE International Conference on Acoustics, Speech and Signal Processing. Washington, USA: IEEE, 2023. https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=10095605. [22] Zhou S H, Pan J S, Yang J F.Learning an adaptive sparse transformer for efficient image restoration[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2025, 47(11): 10344-10360. [23] Cui Y N, Ren W Q, Cao X C, et al. Focal network for image restoration[C]//Proceedings of the IEEE/CVF International Confe-rence on Computer Vision. Washington, USA: IEEE, 2023: 12955-12965. [24] Shen H, Ding H H, Zhang Y L, et al. Spatial frequency modulation network for efficient image dehazing[J]. IEEE Transactions on Image Processing, 2025, 34: 3982-3996. [25] Tu Z Z, Hossein T, Zhang H, et al. MAXIM: multi-axis MLP for image processing[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington, USA: IEEE, 2022: 5759-5770. [26] Gu Y B, Meng Y, Ji J Y, et al. ACL: activating capability of linear attention for image restoration[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington, USA: IEEE, 2025: 17913-17923. [27] Ye T, Chen S X, Bai J B, et al. Adverse weather removal with codebook priors[C]//Proceedings of the IEEE/CVF International Conference on Computer Vision. Washington, USA: IEEE, 2023: 12619-12630. [28] Zheng Y, Zhan J H, He S F, et al. Curricular contrastive regularization for physics-aware single image dehazing[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington, USA: IEEE, 2023: 5785-5794. [29] Zhang Y F, Zhou S, Li H F.Depth information assisted collaborative mutual promotion network for single image dehazing[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington, USA: IEEE, 2024: 2846-2855. [30] Su X F, Li S Y, Cui Y N, et al. Prior-guided hierarchical harmonization network for efficient image dehazing[J]. Proceedings of the AAAI Conference on Artificial Intelligence, 2025, 39(7): 7042-7050. [31] Cheng B D, Li J C, Chen Y, et al. Snow mask guided adaptive residual network for image snow removal[J/OL]. Computer Vision and Image Understanding, 2023, 236. https://doi.org/10.1016/j.cviu.2023.103819. [32] Wang C, Pan J S, Wang W, et al. PromptRestorer: a prompting image restoration method with degradation perception[C]//Proceedings of the 37th International Conference on Neural Information Processing Systems. Cambridge, USA: MIT Press, 2023: 8898-8912. [33] Huo Z Q, Zhan X Y, Qiao Y X, et al. D3-Dehaze: a divide-and-conquer framework for enhanced single image dehazing[J]. The Visual Computer, 2025, 41(8): 6133-6148. [34] Kupyn O, Martyniuk T, Wu J R, et al. DeblurGAN-v2: deblurring(orders-of-magnitude) faster and better[C]//Proceedings of the IEEE/CVF International Conference on Computer Vision. Washington, USA: IEEE, 2019: 8877-8886. [35] Wang T Y, Yang X, Xu K, et al. Spatial attentive single-image deraining with a high quality real rain dataset[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington, USA: IEEE, 2019: 12262-12271. [36] Qian R, Tan R T, Yang W H, et al. Attentive generative adversa-rial network for raindrop removal from a single image[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Washington, USA: IEEE, 2018: 2482-2491. [37] Li B Y, Ren W Q, Fu D P, et al. Benchmarking single-image dehazing and beyond[J]. IEEE Transactions on Image Processing, 2019, 28(1): 492-505. [38] Chen W T, Fang H Y, Hsieh C L, et al. All snow removed: single image desnowing algorithm using hierarchical dual-tree complex wavelet representation and contradict channel loss[C]//Procee-dings of the IEEE/CVF International Conference on Computer Vision. Washington, USA: IEEE, 2021: 4176-4185. [39] Nah S, Kim T H, Lee K M, et al. Deep multi-scale convolutional neural network for dynamic scene deblurring[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. Washington, USA: IEEE, 2017: 257-265.