当前位置: 首页
AI
【第六期论文复现赛-语义分割】DDRNet

【第六期论文复现赛-语义分割】DDRNet

热心网友 时间:2025-07-24
转载
本文介绍DDRNet语义分割模型,其属双路径结构,含高低分辨率两个分支,分别保存细节与提取上下文信息,通过Bilateral fusion模块融合特征,引入DAPPM模块和辅助损失。复现的DDRNet - 23在Cityscapes验证集mIoU达79.85%,优于目标值,已被paddleseg收录。

【第六期论文复现赛-语义分割】ddrnet - 游乐网

【第六期论文复现赛-语义分割】Deep Dual-resolution Networks for Real-time and Accurate Semantic Segmentation of Road Scenes

paper:Deep Dual-resolution Networks for Real-time and Accurate Semantic Segmentation of Road Scenes
github:https://github.com/ydhongHIT/DDRNet
复现地址:https://github.com/justld/DDRNet_paddle

免费影视、动漫、音乐、游戏、小说资源长期稳定更新! 👉 点此立即查看 👈

轻量级语义分割模型大致分为2类:Encoder-Decoder结构(如ESPNet)和two-pathway(如BiSeNet)。类似two-pathway结构,DDRNet使用Dual-resolution,并引入DAPPM( Deep Aggregation Pyramid Pooling Module)模块。在Cityscapes测试集、GPU 2080Ti,DDRNet-23-slim达到102FPS,miou77.4%。本项目复现了DDRNet_23,在cityscapes val miou 为79.85%,该算法已被paddleseg收录。

模型预测效果(来自cityscapes val):【第六期论文复现赛-语义分割】DDRNet - 游乐网        

一、几种语义分割模型结构

下图为语义分割模型的几种结构:

(a)空洞卷积:通过空洞卷积增加模型的感受野,保留高分辨率的特征图降低信息损失;(Deeplab系列)

(b)Encoder-Decoder:通过Encoder(backbone)提取不同分辨率的特征图,然后将不同分辨率的特征图上采样融合,可以通过更换backbone来控制模型的大小;(UNet、ESPNet)

(c)Two-pathway:模型包含2个path,一个path负责提取上下文语义信息,一个path保留细节信息,然后将2个path输出融合。(BiSeNetV1、V2)

(d)DDRNet结构,具体见下文。【第六期论文复现赛-语义分割】DDRNet - 游乐网        

二、网络结构

DDRNet网络结构如下图所示,模型包含2个分支,上面的分支分辨率较高,保存细节信息,下面的分支分辨率较低,用来提取上下文信息(使用了DAPPM模块增加其感受野),分支间特征融合使用Bilateral fusion模块,另外引入辅助损失函数。【第六期论文复现赛-语义分割】DDRNet - 游乐网        

三、Bilateral fusion

DDRNet为了结合不同分辨率的特征图,使用了Bilateral fusion模块,不同分支不同分辨率的特征图分别通过上采样下采样后相加,保持自身分辨率不变的同时融合了另一分支的信息。【第六期论文复现赛-语义分割】DDRNet - 游乐网        

四、 Deep Aggregation Pyramid Pooling Module(DAPPM)

DAPPM为了获得多尺度信息,对输入特征图进行池化(核大小和步长不同),然后将不同大小的特征图上采样融合。

PS:池化部分类似PSPNet提出的Pyramid Pooling Module,整体结构类似ESPNetV2提出的EESP模块,具体可参考相关论文。 【第六期论文复现赛-语义分割】DDRNet - 游乐网        

pytorch源码:

class DAPPM(nn.Module):    def __init__(self, inplanes, branch_planes, outplanes):        super(DAPPM, self).__init__()        self.scale1 = nn.Sequential(nn.AvgPool2d(kernel_size=5, stride=2, padding=2),                                    BatchNorm2d(inplanes, momentum=bn_mom),                                    nn.ReLU(inplace=True),                                    nn.Conv2d(inplanes, branch_planes, kernel_size=1, bias=False),                                    )        self.scale2 = nn.Sequential(nn.AvgPool2d(kernel_size=9, stride=4, padding=4),                                    BatchNorm2d(inplanes, momentum=bn_mom),                                    nn.ReLU(inplace=True),                                    nn.Conv2d(inplanes, branch_planes, kernel_size=1, bias=False),                                    )        self.scale3 = nn.Sequential(nn.AvgPool2d(kernel_size=17, stride=8, padding=8),                                    BatchNorm2d(inplanes, momentum=bn_mom),                                    nn.ReLU(inplace=True),                                    nn.Conv2d(inplanes, branch_planes, kernel_size=1, bias=False),                                    )        self.scale4 = nn.Sequential(nn.AdaptiveAvgPool2d((1, 1)),                                    BatchNorm2d(inplanes, momentum=bn_mom),                                    nn.ReLU(inplace=True),                                    nn.Conv2d(inplanes, branch_planes, kernel_size=1, bias=False),                                    )        self.scale0 = nn.Sequential(                                    BatchNorm2d(inplanes, momentum=bn_mom),                                    nn.ReLU(inplace=True),                                    nn.Conv2d(inplanes, branch_planes, kernel_size=1, bias=False),                                    )        self.process1 = nn.Sequential(                                    BatchNorm2d(branch_planes, momentum=bn_mom),                                    nn.ReLU(inplace=True),                                    nn.Conv2d(branch_planes, branch_planes, kernel_size=3, padding=1, bias=False),                                    )        self.process2 = nn.Sequential(                                    BatchNorm2d(branch_planes, momentum=bn_mom),                                    nn.ReLU(inplace=True),                                    nn.Conv2d(branch_planes, branch_planes, kernel_size=3, padding=1, bias=False),                                    )        self.process3 = nn.Sequential(                                    BatchNorm2d(branch_planes, momentum=bn_mom),                                    nn.ReLU(inplace=True),                                    nn.Conv2d(branch_planes, branch_planes, kernel_size=3, padding=1, bias=False),                                    )        self.process4 = nn.Sequential(                                    BatchNorm2d(branch_planes, momentum=bn_mom),                                    nn.ReLU(inplace=True),                                    nn.Conv2d(branch_planes, branch_planes, kernel_size=3, padding=1, bias=False),                                    )                self.compression = nn.Sequential(                                    BatchNorm2d(branch_planes * 5, momentum=bn_mom),                                    nn.ReLU(inplace=True),                                    nn.Conv2d(branch_planes * 5, outplanes, kernel_size=1, bias=False),                                    )        self.shortcut = nn.Sequential(                                    BatchNorm2d(inplanes, momentum=bn_mom),                                    nn.ReLU(inplace=True),                                    nn.Conv2d(inplanes, outplanes, kernel_size=1, bias=False),                                    )    def forward(self, x):        #x = self.downsample(x)        width = x.shape[-1]        height = x.shape[-2]                x_list = []        x_list.append(self.scale0(x))        x_list.append(self.process1((F.interpolate(self.scale1(x),                        size=[height, width],                        mode='bilinear')+x_list[0])))        x_list.append((self.process2((F.interpolate(self.scale2(x),                        size=[height, width],                        mode='bilinear')+x_list[1]))))        x_list.append(self.process3((F.interpolate(self.scale3(x),                        size=[height, width],                        mode='bilinear')+x_list[2])))        x_list.append(self.process4((F.interpolate(self.scale4(x),                        size=[height, width],                        mode='bilinear')+x_list[3])))               out = self.compression(torch.cat(x_list, 1)) + self.shortcut(x)        return out
登录后复制

   

五、实验结果

cityscapes在cityscapes验证集和测试集上的表现如下: 【第六期论文复现赛-语义分割】DDRNet - 游乐网        

六、复现结果

本次复现的目标是DDRNet-23 在cityscapes验证集 mIOU= 79.5%,复现的miou为79.85%。详情见下表:

七、快速体验

运行以下cell,快速体验DDRNet-23。

In [ ]
# step 1: unzip data%cd ~/PaddleSeg/!mkdir data!tar -xf ~/data/data64550/cityscapes.tar -C data/%cd ~/
登录后复制    In [ ]
# step 2: 训练%cd ~/PaddleSeg!python train.py --config configs/ddrnet/ddrnet23_cityscapes_1024x1024_120k.yml \    --do_eval --use_vdl --log_iter 100 --save_interval 4000 --save_dir output
登录后复制    In [ ]
# step 3: val%cd ~/PaddleSeg/!python val.py \       --config configs/ddrnet/ddrnet23_cityscapes_1024x1024_120k.yml \       --model_path output/best_model/model.pdparams
登录后复制    In [ ]
# step 4: val flip%cd ~/PaddleSeg/!python val.py \       --config configs/ddrnet/ddrnet23_cityscapes_1024x1024_120k.yml \       --model_path output/best_model/model.pdparams \       --aug_eval \       --flip_horizontal
登录后复制    In [ ]
# step 5: val ms flip %cd ~/PaddleSeg/!python val.py \       --config configs/ddrnet/ddrnet23_cityscapes_1024x1024_120k.yml \       --model_path output/best_model/model.pdparams \       --aug_eval \       --scales 0.75 1.0 1.25 \       --flip_horizontal
登录后复制    In [ ]
# step 6: 预测, 预测结果在~/PaddleSeg/output/result文件夹内%cd ~/PaddleSeg/!python predict.py \       --config configs/ddrnet/ddrnet23_cityscapes_1024x1024_120k.yml \       --model_path output/best_model/model.pdparams \       --image_path data/cityscapes/leftImg8bit/val/frankfurt/frankfurt_000000_000294_leftImg8bit.webp \       --save_dir output/result
登录后复制    In [ ]
# step 7: export%cd ~/PaddleSeg!python export.py \       --config configs/ddrnet/ddrnet23_cityscapes_1024x1024_120k.yml \       --model_path output/best_model/model.pdparams \       --save_dir output
登录后复制    In [ ]
# test tipc 1: prepare data%cd ~/PaddleSeg/!bash test_tipc/prepare.sh ./test_tipc/configs/ddrnet/train_infer_python.txt 'lite_train_lite_infer'
登录后复制    In [ ]
# test tipc 2: pip install%cd ~/PaddleSeg/test_tipc/!pip install -r requirements.txt
登录后复制    In [ ]
# test tipc 3: 安装auto_log%cd ~/!git clone https://github.com/LDOUBLEV/AutoLog           %cd AutoLog/!pip3 install -r requirements.txt!python3 setup.py bdist_wheel!pip3 install ./dist/auto_log-1.2.0-py3-none-any.whl
登录后复制    In [ ]
# test tipc 4: test train inference%cd ~/PaddleSeg/!bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ddrnet/train_infer_python.txt 'lite_train_lite_infer'
登录后复制    
来源:https://www.php.cn/faq/1425671.html

游乐网为非赢利性网站,所展示的游戏/软件/文章内容均来自于互联网或第三方用户上传分享,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系youleyoucom@outlook.com。

同类文章
更多
逼AI当山顶洞人!Claude防话痨插件爆火,网友:受够了AI废话

逼AI当山顶洞人!Claude防话痨插件爆火,网友:受够了AI废话

新智元报道编辑:元宇【新智元导读】一个让AI像原始人一样说话的插件,在HN上一夜爆火,冲破2w星。它的核心只是一条简单粗暴的prompt:删掉冠词、客套和一切废话,号称能省下75%的输出token。

时间:2026-04-07 14:55
季度利润翻 8 倍,最赚钱的「卖铲人」财报背后,内存涨价狂潮如何收场?

季度利润翻 8 倍,最赚钱的「卖铲人」财报背后,内存涨价狂潮如何收场?

AI 时代最赚钱的公司,可能从来不是做 AI 的那个。作者|张勇毅编辑|靖宇淘金热里最稳赚的人,从来不是淘金的,是卖铲子的。这句老话在 2026 年的科技行业又应验了一次。只不过这次卖铲子的不是英伟

时间:2026-04-07 14:49
Claude Code Harness+龙虾科研团来了!金字塔分层架构+多智能体

Claude Code Harness+龙虾科研团来了!金字塔分层架构+多智能体

Claw AI Lab团队量子位 | 公众号 QbitAI你还在一个人做科研吗?科研最难的,从来不是问题本身,而是一个想法从文献到实验再到写作,只能靠自己一点点往前推。一个人方向偏了没人提醒,遇到歧

时间:2026-04-07 14:43
让离线强化学习从「局部描摹」变「全局布局」丨ICLR'26

让离线强化学习从「局部描摹」变「全局布局」丨ICLR'26

面对复杂连续任务的长程规划,现有的生成式离线强化学习方法往往会暴露短板。它们生成的轨迹经常陷入局部合理但全局偏航的窘境。它们太关注眼前的每一步,却忘了最终的目的地。针对这一痛点,厦门大学和香港科技大

时间:2026-04-07 14:37
美国犹他州启动新试点项目:AI为患者开具精神类药物处方

美国犹他州启动新试点项目:AI为患者开具精神类药物处方

IT之家 4 月 5 日消息,据外媒 PC Mag 当地时间 4 月 4 日报道,美国医疗机构 Legion Health 在犹他州获得监管批准,启动一项试点项目,允许 AI 系统为患者开具精神类药

时间:2026-04-07 14:30
热门专题
更多
刀塔传奇破解版无限钻石下载大全 刀塔传奇破解版无限钻石下载大全
洛克王国正式正版手游下载安装大全 洛克王国正式正版手游下载安装大全
思美人手游下载专区 思美人手游下载专区
好玩的阿拉德之怒游戏下载合集 好玩的阿拉德之怒游戏下载合集
不思议迷宫手游下载合集 不思议迷宫手游下载合集
百宝袋汉化组游戏最新合集 百宝袋汉化组游戏最新合集
jsk游戏合集30款游戏大全 jsk游戏合集30款游戏大全
宾果消消消原版下载大全 宾果消消消原版下载大全
热门教程
更多
  • 游戏攻略
  • 安卓教程
  • 苹果教程
  • 电脑教程