# NL-LinkNet for Road Extraction
Pytorch implementation of **N**on-**L**ocal LinkNet (**NL-LinkNet**). It performs **65.00%** mIOU scores, better than the 1st ranked single-model solution (D-LinkNet, 64.12%) in DeepGlobe Road Extraction Challenge with less number of parameters. It also outperforms the ensemble of D-LinkNet, LinkNet, U-Net (64.66%). The referenced code can be found [here](https://github.com/zlkanata/DeepGlobe-Road-Extraction-Challenge).
This version is lastly revised by 20 Feb, 2019.
## Basic Overview
Since the VHR satellie images are taken at high distances, roads (red box) are likely to be covered by ostacles such as shadows, clouds, trees as a below figure. Therefore, capturing long-range dependencies (orange box) is essential. NL-LinkNet use nonlocal operations which compute feature map as a weighted sum of all pixels. It is a key to solve it.
<p align="center"> <img width=500 src="./imgs/NL_Intro_operation.jpg"> </p>
## Prerequisites
- Cuda 8.0
- Python 3.5
- Torchvision 0.2.1
- Torch 1.0.0
- cv2 3.4.0
- numpy, matplotlib, scikit-image, scipy, pickle, argparse
## Usage
Install prerequisites with:
pip3 install -r requirements.txt
### Data
Place '*train*', '*valid*' and '*test*' data folders in the '*../dataset*' folder.
Data is from [DeepGlobe Road Extraction Challenge](https://competitions.codalab.org/competitions/18467#participate-get_starting_kit). You should sign in first to get the data.
Or you can use your own dataset by replacing images like:
However, note that you cannot evaluate your own dataset file on the server.
├── Road
│ ├── train
│ │ ├── *_sat.jpg
│ │ ├── *_mask.png
│ │ └── ...
│ ├── test
│ │ ├── *_sat.jpg
│ │ └── ...
│ └── valid
│ ├── *_sat.jpg
├──────── ...
### Train
**To train** model in different settings (locations, pairwise functions), please refer [here](https://github.com/yswang0522/NLLinkNetRoadExtraction/blob/master/run_example.sh).
To train **NL-LinkNet**(general):
python3 train.py --model model_name --name 'name of weights and logs' --crop_size 1024 1024 --init_lr 0.0003 --dataset '../path/of/train/datasets' --load ""
To train **NL34-LinkNet**
python3 train.py --model NL34_LinkNet --name 'NL34_LinkNet' --crop_size 1024 1024 --init_lr 0.0003 --dataset '../dataset/Road/train/' --load ""
To train **NL34-LinkNet** with **pretrained_weights** at 'weights/NL34_LinkNet.th' (Download it from Dropbox)
python3 train.py --model NL34_LinkNet --name 'NL34_LinkNet' --crop_size 1024 1024 --init_lr 0.0003 --dataset '../dataset/Road/train/' --load "NL34_LinkNet"
### Predict
To generate mask images:
python3 test.py --model model_name --name 'name_of_weights' --source 'path of input images' --scales 1.0 --target 'name_of_output_dir'
To generate mask images with NL34_LinkNet **without** multi-scaled test (MS) :
python3 test.py --model NL34_LinkNet --name 'NL34_LinkNet' --source '../dataset/Road/valid' --scales 1.0 --target 'NL34_LinkNet'
To generate mask images with NL34_LinkNet **with** multi-scaled test (MS) :
python3 test.py --model NL34_LinkNet --name 'NL34_LinkNet' --source '../dataset/Road/valid' --scales 0.75 1.0 1.25 --target 'NL34_LinkNet_MS'
### Download trained NL4-LinkNet
Please download this file to 'weights/'
- NL4-LinkNet : [Dropbox](https://www.dropbox.com/s/ra6i25wswmsu6y0/NL34_LinkNet.th?dl=0) (64.40%, 64.90% w/ MS[0.75,1.0,1.25])
- NL34-LinkNet : [Dropbox](https://www.dropbox.com/s/ra6i25wswmsu6y0/NL34_LinkNet.th?dl=0) (64.59%, 65.00% w/ MS[0.75,1.0,1.25])
## Methods
### 1. NL-LinkNet Architecture
NL-LinkNet is composed of local block (LB) and non-local block (NLB). We employee ResNet34 as our LB according to sate-of-the-art (D-LinkNet).
<p align="center">
<img width=650 src="./imgs/NonlocalNetwork.jpg">
</p>
### 2. A Non-local block
Non-local block computes weighted sum of all pixels for an output pixel. We consider three candidates of pairwise function f. This is an example of Gaussian version f. More details are described in the paper.
<p align="center">
<img width=650 src="./imgs/NonlocalBlock.jpg">
</p>
## Results
### 1. Visual Comparison
<p align="center"> <img src="./imgs/Visual_Comparison.jpg"> </p>
### 2. Quantitative Comparison
This is leaderboard of [DeepGlobe Road Extraction Challenge](https://competitions.codalab.org/competitions/18467) @ CodaLab.
csv file is [here](https://github.com/yswang0522/NLLinkNetRoadExtraction/blob/master/imgs/DeepGlobe_Road_Extraction_Challenge_results.csv).
<p align="center"> <img width=600 src="./imgs/leaderboard.jpg"> </p>
This is quantitative comparison of our best models with the previous state-of-the-art models in challenge.
<p align="center"> <img width=500 src="./imgs/table_benchmarks.jpg"> </p>
### 3. Results on different locations of NLBs
<p align="center"> <img src="./imgs/table_loc.jpg"> </p>
### 4. Results on Different pairwise functions
<p align="center"> <img width=500 src="./imgs/table_pf.jpg"> </p>
## Author
Anonymous authors
<!--
Yooseung Wang / [@yswang0522](https://github.com/yswang0522)
Junghoon Seo / [@mikigom](http://mikigom.github.io/about)
Taegyun Jeon / [@tgjeon](https://github.com/tgjeon)
-->
没有合适的资源?快使用搜索试试~ 我知道了~
NL-LinkNet是一种改进的深度学习模型,主要用于从高分辨率卫星图像中提取道路信息
共37个文件
py:15个
jpg:9个
ipynb:3个
需积分: 2 2 下载量 131 浏览量
2024-06-12
10:16:12
上传
评论
收藏 3.82MB ZIP 举报
温馨提示
NL-LinkNet是一种改进的深度学习模型,主要用于从高分辨率卫星图像中提取道路信息。以下是对NL-LinkNet的详细解释: 模型背景 目的:解决高分辨率卫星图像中的道路分割问题,这是遥感领域的一个重要课题。 挑战:传统的卷积神经网络(CNN)方法在处理这类问题时,往往只能捕获局部特征,难以捕捉长距离依赖关系。 NL-LinkNet的特点 非局部操作:NL-LinkNet引入了非局部(Non-Local)操作,这使得模型能够捕获图像中的全局特征依赖关系。每个空间特征点都可以参考其他所有的上下文信息,从而提高了道路分割的准确性。 轻量级:相比其他先进的模型,NL-LinkNet在保持较高性能的同时,具有更少的参数和计算量。这使得模型在实际应用中更加高效和可行。 性能优越:在DeepGlobe 2018道路提取挑战数据集上,NL-LinkNet取得了65.00%的mIOU(平均交并比)分数。这一成绩超过了其他已发表的先进模型,包括D-LinkNet等。 模型结构 NL-LinkNet主要基于LinkNet架构,但引入了非局部操作模块。这些模块被插入到解码器部分,以捕获图像中的全局上下
资源推荐
资源详情
资源评论
收起资源包目录
NLLinkNet-master.zip (37个子文件)
NLLinkNet-master
loss.py 1KB
run_example.sh 3KB
networks
nllinknet_location.py 7KB
unet.py 4KB
non_local
dot_product.py 3KB
gaussian.py 3KB
embedded_gaussian.py 3KB
dinknet.py 4KB
.ipynb_checkpoints
Untitled-checkpoint.ipynb 3KB
layer_dimension_check -checkpoint.ipynb 2KB
nllinknet_pairwise_func.py 7KB
common_module.py 3KB
weights
weights 0B
test_framework.py 6KB
submits
submits 0B
.ipynb_checkpoints
Test_Image_Shape -checkpoint.ipynb 72B
dataset
valid
valid_image 0B
test
test_image 0B
.idea
vcs.xml 180B
train_framework.py 2KB
data.py 6KB
requirements.txt 109B
logger.py 271B
logs
NL34_LinkNet_example.log 61KB
train.py 4KB
imgs
NL_Intro_operation.jpg 1.25MB
NonlocalBlock.jpg 156KB
table_pf.jpg 303KB
NonlocalNetwork.jpg 100KB
leaderboard_raw.jpg 388KB
Visual_Comparison.jpg 794KB
DeepGlobe_Road_Extraction_Challenge_results.csv 4KB
table_benchmarks.jpg 314KB
table_loc.jpg 173KB
leaderboard.jpg 581KB
test.py 3KB
README.md 5KB
共 37 条
- 1
资源评论
赵药师
- 粉丝: 1163
- 资源: 23
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 渗透测试过程中使用的脚本,包括不限于针对特定程序设备的爆破脚本、利用代码,通用的脚本 .zip
- Web期末大作业,前端大作业,网页设计大作业-视频网站-Html+Css+js.zip,左边导航栏,右侧视频面板,有分页,有轮播图,搜索框,登录按钮等等
- 渗透测试辅助工具箱,反弹shell,命令生成器,输入对应IP端口即可,实现一劳永逸.zip
- java高校社团管理系统源码数据库 MySQL源码类型 WebForm
- 基于Python卷积神经网络人脸识别驾驶员疲劳检测与预警系统设计源码
- ANSYS Fluent 算例,气液两相流运动模拟
- ANSYS Fluent 算例,化学反应釜传热过程模拟
- 《python编程实战:运用设计模式、并发和程序库创建高质量程序》的范例代码
- qt5.12.8配套的Websocket
- 遗传算法模型框架(python源码)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功