面包屑图标 当前位置: 首页
AI资讯
热点详情

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

AI热点日报
AI热点日报时间:2025-07-24
热点解读

本文介绍DDRNet语义分割模型,其属双路径结构,含高低分辨率两个分支,分别保存细节与提取上下文信息,通过Bilateral fusion模块融合特征,引入DAPPM模块和辅助损失

本文介绍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'
登录后复制    
热点追踪提示词
你是一名 AI 行业编辑,请围绕下面这条热点输出一份资讯解读:
热点:【第六期论文复现赛-语义分割】DDRNet要求:
1. 先用一句话解释这条热点在讲什么
2. 再总结它为什么重要
3. 说明会影响哪些 AI 产品或内容方向
4. 最后给出 3 个适合资讯站使用的标题
来源:https://www.php.cn/faq/1425671.html
python git ai red igs for

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

相关热点
AI热点2026-07-06 20:47
百度官方出品度加剪辑口播自媒体必备工具

度加剪辑是百度官方出品的剪辑工具,面向口播自媒体创作者。支持视频剪辑、智能识别字幕,并与百度网盘打通,可快速导入素材。适用于泛知识类创作者制作高质量视频,覆盖从素材导入到成品输出的完整流程。

AI热点2026-07-06 20:46
基于AI的智能在线个性化锻炼计划生成工具 Workout Master

WorkoutMaster是一款基于AI的个性化锻炼计划生成工具,能根据用户目标、偏好及历史训练记录,动态输出专属方案,并实时自适应调整负重、组次等参数。支持定制目标与器械偏好,借助机器学习持续优化,随时随地即可接入使用,确保训练高效安全。

AI热点2026-07-06 20:46
Calorielens AI智能实时拍照分析餐点照片卡路里追踪应用

Calorielens是一款利用AI分析餐食照片的卡路里追踪应用。用户只需拍照,AI即可自动识别食物种类和分量并估算卡路里,省去手动输入步骤。应用还提供历史记录追踪功能,帮助把握热量趋势。AI估算精度可满足日常健康管理需求。

AI热点2026-07-06 20:46
百度旗下首个AI互动式搜索APP简单搜索

百度旗下“简单搜索”AI搜索引擎集成语音、图像、多媒体搜索及实时翻译,支持多模态交互与智能推荐。基于大模型技术,用户可通过对话式交互直接获取精准答案,适用于学习、旅行、生活、职业发展等场景,高效满足信息需求。

延伸阅读