作品名称:基于SAM多阶段精炼的无监督语义分割算法
队伍名称:Secret Weapon
参赛成员:陈震元,武戈,李翔
参赛单位:南开大学
第六届CCF开源创新大赛
5
4
3
2
1
无监督分割图片展示
Unsupervised Semantic Segmentation Photos
算法创新
Novel Solution
工作调研
Related Work
背景回顾
Competition Review
团队介绍
Team Introduction
6
作品开源
Open source code
CONTENTS
团队介绍
Team Introduction
团队介绍及分工
李翔,南开大学副教授,百青人才引进计划
2020年度博士后创新人才计划
2022 粤港澳大湾区(黄埔)国际算法算例大赛(遥感目标检测赛道)亚军(116支团队中排名第二)
2022年度计图人工智能挑战赛(语义风景图像生成赛道)冠军(154支团队中排名第一)
阿里巴巴天池首届大数据竞赛冠军(7186支团队中排名第一)
滴滴首届大数据算法竞赛冠军(7664支团队中排名第一)
发表人工智能领域顶会顶刊CVPR、NeurIPS、AAAI、IJCAI、T-PAMI等40+篇论文,Google Citation 7700+
负责:整体筹划,交流指导
武戈,南开大学博士
2022 粤港澳大湾区(黄埔)国际算法算例大赛(古籍文档图像赛道)三等奖(44支队伍中排名第八)
负责:收集资料,上线探索
陈震元,南开大学科研助理
南京理工大学学术型硕士学位
CVPR 2021不完备数据竞赛(弱监督目标定位赛道)冠军
CVPR 2021不完备数据竞赛(弱监督语义分割赛道)季军
CVPR 2020不完备数据竞赛(弱监督目标定位项目)季军
一作发表CCF-B、CCF-C论文各一篇
负责:上限探索,算法创新。
作品背景回顾
Competition Review
背景简介
[1] Kirillov, Alexander, Eric Mintun, Nikhila Ravi, Hanzi Mao, Chloe Rolland, Laura Gustafson, Tete Xiao et al. "Segment anything." arXiv preprint arXiv:2304.02643 (2023).
根据无标签图像训练网络,推理出测试集中图片对应的分割结果。可用Segment Anything[1] (SAM)进行辅助。
工作调研
Related Work
工作调研(Baseline选择)
无监督语义分割步骤:
1. 无监督特征学习:通过自监督学习建立图像特征之间的联系,SwAV[1]、Dino[2]等。
[1] Caron, Mathilde, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. "Unsupervised learning of visual features by contrasting cluster assignments."
Advances in neural information processing systems 33 (2020): 9912-9924.
[2] Caron, Mathilde, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. "Emerging properties in self-supervised vision transformers." In Proceedings of the IEEE/CVF international conference on computer vision, pp. 9650-9660. 2021.
Self -supervised
Clustering
Fine-Tuning
工作调研(Baseline选择)
无监督语义分割步骤:
2. 特征聚类生成图像层面类别表征:通过聚类的方式先后对图像层面和像素层面分配类别标签,IIC[1]、SegSort[2]等。
1. 无监督特征学习:通过自监督学习建立图像特征之间的联系,SwAV、Dino等。
[1] Ji, Xu, Joao F. Henriques, and Andrea Vedaldi. "Invariant information clustering for unsupervised image classification and segmentation." In Proceedings of the IEEE International Conference on Computer Vision, pp. 9865-9874. 2019.
[2] Hwang, Jyh-Jing, Stella X. Yu, Jianbo Shi, Maxwell D. Collins, Tien-Ju Yang, Xiao Zhang, and Liang-Chieh Chen. "Segsort: Segmentation by discriminative sorting of segments." In Proceedings of the IEEE International Conference on Computer Vision, pp. 7334-7344. 2019.
Self -supervised
Clustering
Fine-Tuning
工作调研(Baseline选择)
无监督语义分割步骤:
3. 像素类别判断:通过对比学习一致性方法构建像素层面特征表征,并根据聚类中心分配像素标签,PiCIE[1]、STEGO[2]等。
1. 无监督特征学习:通过自监督学习建立图像特征之间的联系,SwAV、Dino等。
2. 特征聚类生成图像层面类别表征:通过聚类的方式先后对图像层面和像素层面分配类别标签,IIC、SegSort等。
[1] Cho, Jang Hyun, Utkarsh Mall, Kavita Bala, and Bharath Hariharan. "Picie: Unsupervised semantic segmentation using invariance and equivariance in clustering." In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 16794-16804. 2021.
[2] Hamilton, Mark, Zhoutong Zhang, Bharath Hariharan, Noah Snavely, and William T. Freeman. "Unsupervised semantic segmentation by distilling feature correspondences." arXiv preprint arXiv:2203.08414 (2022).
Self -supervised
Clustering
Fine-Tuning
工作调研(Baseline选择)
[1] Gao, Shanghua, Zhong-Yu Li, Ming-Hsuan Yang, Ming-Ming Cheng, Junwei Han, and Philip Torr. "Large-scale unsupervised semantic segmentation." IEEE Transactions on Pattern Analysis and Machine Intelligence (2022).
无监督语义分割baseline——PASS[1]:
Self-supervision:
Self -supervised
Clustering
Fine-Tuning
Encoder预训练阶段一
Encoder预训练阶段二
训练
冻结
工作调研(Baseline选择)
[1] Gao, Shanghua, Zhong-Yu Li, Ming-Hsuan Yang, Ming-Ming Cheng, Junwei Han, and Philip Torr. "Large-scale unsupervised semantic segmentation." IEEE Tansactions on Pattern Analysis and Machine Intelligence (2022).
无监督语义分割baseline——PASS[1]:
Clustering:
逐像素相似度
Self -supervised
Clustering
Fine-Tuning
工作调研(Baseline选择)
无监督语义分割baseline——PASS[1]:
Fine-Tuning:
Self -supervised
Clustering
Fine-Tuning
[1] Gao, Shanghua, Zhong-Yu Li, Ming-Hsuan Yang, Ming-Ming Cheng, Junwei Han, and Philip Torr. "Large-scale unsupervised semantic segmentation." IEEE Tansactions on Pattern Analysis and Machine Intelligence (2022).
工作调研(Baseline选择)
无监督语义分割baseline——PASS[1]:
DenseCRFs精炼[2]
[1] Gao, Shanghua, Zhong-Yu Li, Ming-Hsuan Yang, Ming-Ming Cheng, Junwei Han, and Philip Torr. "Large-scale unsupervised semantic segmentation." IEEE Transactions on Pattern Analysis and Machine Intelligence (2022).
[2] Krähenbühl, Philipp, and Vladlen Koltun. "Efficient inference in fully connected crfs with gaussian edge potentials." Advances in neural information processing systems 24 (2011).
Self -supervised
Clustering
Fine-Tuning
Refinement
工作调研(Baseline选择)
[1] Kirillov, Alexander, Eric Mintun, Nikhila Ravi, Hanzi Mao, Chloe Rolland, Laura Gustafson, Tete Xiao et al. "Segment anything." arXiv preprint arXiv:2304.02643 (2023).
完备的超像素分割器:SAM[1]
使用方法:
超像素分割效果:
算法创新
Novel Solution
算法创新
基于特征层面的自适应背景阈值过滤
(Adaptive background threshold Filter)
分割网络
结构创新
分割结果
精炼创新
Baseline
上限探索
基于超像素特征聚类的伪标签生成
(Pseudo-label generation based on superpixel clustering)
基于多尺度特征融合的分割解码器
(Seg decoder based on multi-scale feature fusion)
基于超像素区域投票的分割精炼
(Refinement of Seg based on superpixel region voting)
伪标签
生成创新
Self -supervised
Clustering
Fine-Tuning
Refinement
算法创新
基于特征层面的自适应背景阈值过滤
(Adaptive background threshold Filter)
Baseline
上限探索
分割网络
结构创新
分割结果
精炼创新
伪标签
生成创新
基于超像素特征聚类的伪标签生成
(Pseudo-label generation based on superpixel clustering)
基于多尺度特征融合的分割解码器
(Seg decoder based on multi-scale feature fusion)
基于超像素区域投票的分割精炼
(Refinement of Seg based on superpixel region voting)
Self -supervised
Clustering
Fine-Tuning
Refinement
基于特征层面的自适应背景阈值过滤
原有方法:
Sigmoid
×
Mul & Sum
生成全局前景特征计算损失
Self -supervised
Clustering
Fine-Tuning
Refinement
固定背景阈值==0
基于特征层面的自适应背景阈值过滤
测试不同背景阈值
Validation GT
最优的背景阈值
原有方法:
Sigmoid
×
Mul & Sum
验证集数据
固定背景阈值==0
真实分割结果
输入图像
与真实前景差距较大
Sigmoid
×
Mul & Sum
生成全局前景特征计算损失
我们的方法:
Self -supervised
Clustering
Fine-Tuning
Refinement
固定背景阈值==0
☹
😊
生成验证集
伪标签
基于特征层面的自适应背景阈值过滤
A 榜 | 背景阈值 | mIoU(%)↑ |
Baseline | 0.0 | 23.06 |
+ ResNet50 (ours) | 0.0 | 27.12(+4.06%) |
+ Adaptive Threshold (ours) | 0.24 | 33.02(+9.96%) |
背景阈值对比试验
经过我们的背景阈值过滤和训练更好的backbone,两种策略加持下,取得了+9.96%的提升。
Self -supervised
Clustering
Fine-Tuning
Refinement
算法创新
基于特征层面的自适应背景阈值过滤
(Adaptive background threshold Filter)
Baseline
上限探索
分割网络
结构创新
分割结果
精炼创新
伪标签
生成创新
基于超像素特征聚类的伪标签生成
(Pseudo-label generation based on superpixel clustering)
基于多尺度特征融合的分割解码器
(Seg decoder based on multi-scale feature fusion)
基于超像素区域投票的分割精炼
(Refinement of Seg based on superpixel region voting)
Self -supervised
Clustering
Fine-Tuning
Refinement
基于超像素特征聚类的伪标签生成
SAM
原有方法:
我们的方法:
超像素特征
…
单像素
聚类中心
逐像素计算相似度
聚类中心
超像素平均特征计算相似度
☹
😊
Self -supervised
Clustering
Fine-Tuning
Refinement
基于超像素特征聚类的伪标签生成
A 榜 | SAM超像素iou阈值 | SAM稳定得分阈值 | SAM最小区域阈值 | mIoU(%)↑ |
改进一最终结果 | - | - | - | 33.02 |
+ 超像素聚类(ours) | 0.86 | 0.92 | 100 | 39.15(+6.13%) |
超像素伪标签生成对比试验
Self -supervised
Clustering
Fine-Tuning
Refinement
基于超像素特征聚类的伪标签生成
输入图像
w/o 超像素伪标签结果
w/ 超像素伪标签结果
Self -supervised
Clustering
Fine-Tuning
Refinement
算法创新
基于特征层面的自适应背景阈值过滤
(Adaptive background threshold Filter)
Baseline
上限探索
分割网络
结构创新
分割结果
精炼创新
伪标签
生成创新
基于超像素特征聚类的伪标签生成
(Pseudo-label generation based on superpixel clustering)
基于多尺度特征融合的分割解码器
(Seg decoder based on multi-scale feature fusion)
基于超像素区域投票的分割精炼
(Refinement of Seg based on superpixel region voting)
Self -supervised
Clustering
Fine-Tuning
Refinement
基于多尺度特征融合的分割解码器
原有方法:
输出特征
我们的方法:
多尺度特征图
Conv1x1 &
Softmax
拼接后特征图
Upsample &
Conv2d
特征融合权重
Mul &
sum
输出特征
×
缺乏尺度建模、
小目标不敏感。
☹
😊
Self -supervised
Clustering
Fine-Tuning
Refinement
基于多尺度特征融合的分割解码器
A 榜 | mIoU(%)↑ |
改进二最终结果 | 39.15 |
+ 多尺度特征融合(ours) | 43.21(+4.06%) |
超像素伪标签生成对比试验
输入图像
w/o 多尺度特征融合
w/ 多尺度特征融合
Self -supervised
Clustering
Fine-Tuning
Refinement
算法创新
基于特征层面的自适应背景阈值过滤
(Adaptive background threshold Filter)
Baseline
上限探索
分割网络
结构创新
分割结果
精炼创新
伪标签
生成创新
基于超像素特征聚类的伪标签生成
(Pseudo-label generation based on superpixel clustering)
基于多尺度特征融合的分割解码器
(Seg decoder based on multi-scale feature fusion)
基于超像素区域投票的分割精炼
(Refinement of Seg based on superpixel region voting)
Self -supervised
Clustering
Fine-Tuning
Refinement
基于超像素区域投票的分割精炼
网格点查询
候选框查询
掩码查询
传统CRF精炼:
耗时非常大,会使推理时间增加十倍,并且没有任何性能提升。
我们的方法:
Self -supervised
Clustering
Fine-Tuning
Refinement
基于超像素区域投票的分割精炼
A 榜 | mIoU(%)↑ |
改进三最终结果 | 43.21 |
+ 候选框精炼(ours) | 41.15(-2.06%) |
+ 掩码精炼(ours) | 44.01(+0.80%) |
+ 网格点精炼(ours) | 45.35(+2.14%) |
分割精炼对比试验
经过最终对分割结果的精炼,我们可以在原有的基础上提升2.14%。
网格点查询
候选框查询
掩码查询
Self -supervised
Clustering
Fine-Tuning
Refinement
基于超像素区域投票的分割精炼
输入图像
w/o 精炼
w/ 精炼
Self -supervised
Clustering
Fine-Tuning
Refinement
算法创新
基于特征层面的自适应背景阈值过滤
(Adaptive background threshold Filter)
分割网络
结构创新
分割结果
精炼创新
Baseline
上限探索
基于超像素特征聚类的伪标签生成
(Pseudo-label generation based on superpixel clustering)
基于多尺度特征融合的分割解码器
(Seg decoder based on multi-scale feature fusion)
基于超像素区域投票的分割精炼
(Refinement of Seg based on superpixel region voting)
伪标签
生成创新
Self -supervised
Clustering
Fine-Tuning
Refinement
作品开源
Open source code
作品开源
文档说明:https://github.com/Rose-41/USS-jittor
Github: https://github.com/Rose-41/USS-jittor
Gitlink: https://www.gitlink.org.cn/DonSolomon/jittor-SecretWeapon-USS
开源时间:2023年8月22日
A 榜 | mIoU(%)↑ |
baseline | 23.06 |
+ 自适应阈值(ours) | 33.02(+9.96%) |
+ 超像素聚类(ours) | 39.15(+6.13%) |
+ 多尺度特征融合(ours) | 43.21(+4.06%) |
+ 网格点精炼(ours) | 45.35(+2.14%) |
分割网络
结构创新
分割结果
精炼创新
Baseline
上限探索
伪标签
生成创新
Self -supervised
Clustering
Fine-Tuning
Refinement
比赛开源
性能分析:
作品开源
代码注释:
第三方库使用规范:
感谢大家观看,欢迎各位专家批评指正!
陈震元,武戈,李翔
Secret Weapon