Git Product home page Git Product logo

infrared-small-target-detection's Introduction

Dense Nested Attention Network for Infrared Small Target Detection

Good News! Our paper has been accepted by IEEE Transaction on Image Processing. Our team will release more interesting works and applications on SIRST soon. Please keep following our repository.

outline

Algorithm Introduction

Dense Nested Attention Network for Infrared Small Target Detection, Boyang Li, Chao Xiao, Longguang Wang, and Yingqian Wang, arxiv 2021 [Paper]

We propose a dense nested attention network (DNANet) to achieve accurate single-frame infrared small target detection and develop an open-sourced infrared small target dataset (namely, NUDT-SIRST) in this paper. Experiments on both public (e.g., NUAA-SIRST, NUST-SIRST) and our self-developed datasets demonstrate the effectiveness of our method. The contribution of this paper are as follows:

  1. We propose a dense nested attention network (namely, DNANet) to maintain small targets in deep layers.

  2. An open-sourced dataset (i.e., NUDT-SIRST) with rich targets.

  3. Performing well on all existing SIRST datasets.

Dataset Introduction

NUDT-SIRST is a synthesized dataset, which contains 1327 images with resolution of 256x256. The advantage of synthesized dataset compared to real dataset lies in three aspets:

  1. Accurate annotations.

  2. Massive generation with low cost (i.e., time and money).

  3. Numerous categories of target, rich target sizes, diverse clutter backgrounds.

Citation

If you find the code useful, please consider citing our paper using the following BibTeX entry.

@article{DNANet,
  title={Dense nested attention network for infrared small target detection},
  author={Li, Boyang and Xiao, Chao and Wang, Longguang and Wang, Yingqian and Lin, Zaiping and Li, Miao and An, Wei and Guo, Yulan},
  journal={IEEE Transactions on Image Processing},
  year={2023},
  volume={32},
  pages={1745-1758},
  publisher={IEEE}
}

Prerequisite

Usage

On windows:

Click on train.py and run it. 

On Ubuntu:

1. Train.

python train.py --base_size 256 --crop_size 256 --epochs 1500 --dataset [dataset-name] --split_method 50_50 --model [model name] --backbone resnet_18  --deep_supervision True --train_batch_size 16 --test_batch_size 16 --mode TXT

2. Test.

python test.py --base_size 256 --crop_size 256 --st_model [trained model path] --model_dir [model_dir] --dataset [dataset-name] --split_method 50_50 --model [model name] --backbone resnet_18  --deep_supervision True --test_batch_size 1 --mode TXT 

(Optional 1) Visulize your predicts.

python visulization.py --base_size 256 --crop_size 256 --st_model [trained model path] --model_dir [model_dir] --dataset [dataset-name] --split_method 50_50 --model [model name] --backbone resnet_18  --deep_supervision True --test_batch_size 1 --mode TXT 

(Optional 2) Test and visulization.

python test_and_visulization.py --base_size 256 --crop_size 256 --st_model [trained model path] --model_dir [model_dir] --dataset [dataset-name] --split_method 50_50 --model [model name] --backbone resnet_18  --deep_supervision True --test_batch_size 1 --mode TXT 

(Optional 3) Demo (with your own IR image).

python demo.py --base_size 256 --crop_size 256 --img_demo_dir [img_demo_dir] --img_demo_index [image_name]  --model [model name] --backbone resnet_18  --deep_supervision True --test_batch_size 1 --mode TXT  --suffix [img_suffix]

Results and Trained Models

Qualitative Results

outline

Quantative Results

on NUDT-SIRST

Model mIoU (x10(-2)) Pd (x10(-2)) Fa (x10(-6))
DNANet-VGG-10 85.23 96.95 6.782
DNANet-ResNet-10 86.36 97.39 6.897
DNANet-ResNet-18 87.09 98.73 4.223
DNANet-ResNet-18 88.61 98.42 4.30 [Weights]
DNANet-ResNet-34 86.87 97.98 3.710

on NUAA-SIRST

Model mIoU (x10(-2)) Pd (x10(-2)) Fa (x10(-6))
DNANet-VGG-10 74.96 97.34 26.73
DNANet-ResNet-10 76.24 97.71 12.80
DNANet-ResNet-18 77.47 98.48 2.353
DNANet-ResNet-18 79.26 98.48 2.30 [Weights]
DNANet-ResNet-34 77.54 98.10 2.510

on NUST-SIRST

Model mIoU (x10(-2)) Pd (x10(-2)) Fa (x10(-6))
DNANet-ResNet-18 46.73 81.29 33.87 [Weights]

*This code is highly borrowed from ACM. Thanks to Yimian Dai.

*The overall repository style is highly borrowed from PSA. Thanks to jiwoon-ahn.

Referrences

  1. Dai Y, Wu Y, Zhou F, et al. Asymmetric contextual modulation for infrared small target detection[C]//Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision. 2021: 950-959. [code]

  2. Zhou Z, Siddiquee M M R, Tajbakhsh N, et al. Unet++: Redesigning skip connections to exploit multiscale features in image segmentation[J]. IEEE transactions on medical imaging, 2019, 39(6): 1856-1867. [code]

  3. He K, Zhang X, Ren S, et al. Deep residual learning for image recognition[C]//Proceedings of the IEEE conference on computer vision and pattern recognition. 2016: 770-778. [code]

infrared-small-target-detection's People

Contributors

jiwoon-ahn avatar yeren123455 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

infrared-small-target-detection's Issues

定量结果分析的问题

作者你好,我想请问一些问题,在你的Quantative Results中有两个DNANet-ResNet-18,而且得到的性能指标也不相同,所以我想请问这两个之间的区别在哪里?为什么一个DNANet-ResNet-18的mIOU效果会比另一个的mIOU效果好这么多?

关于测试指标的问题

您好,我在阅读metric.py文件遇到了一些问题。
1.我在阅读batch_pix_accuracy方法与batch_intersection_union方法时,发现predict=(output>0).astype('int64')。请问这里的0是什么物理含义?
2.最后得到的mIoU是目标与背景的IOU平均值吗?

NUAA训练设置问题

你好,请问NUAA训练的时候,学习率,batchsize,优化器等参数都与训练NUDT数据集合一样吗?

about pretrained model

你好,提供的预训练权重似乎格式有问题,不能够解压,能帮忙查看一下吗?显示 This does not look like a tar archive

论文问题请教

您好,关于您论文中的Table VII我有个问题。
实验结果Table VII中显示,在NUAA-SIRST数据集上,DNANet的IoU指标是77.47。请问这个指标结果是NUAA原来数据集的划分吗?
NUAA-SIRST的划分是256train,85val,86test。这个结果是按照它的划分出现的测试结果吗?还是按照您自己的划分方法所出来的结果?

关于NUAA数据集复现问题

你好,我在NUAA-SIRST数据集上复现时,epoch=1500 lr=0.05,但是结果并不理想,best_mIou只有72.24,而且训练时会出现有时mIou值不变或者loss不下降的问题,是要重复跑很多次吗还是有什么其他的trick

关于训练的问题

你好,我想问一下训练突然中断了,如何从中断的地方接着训练呀?

数据和weight下载

作者您好,请问您确定您提供的数据集和weight是可以下载的吗,为什么您的链接我无法打开呢,有其他下载方式吗

李同学您好 请问可以公开您在DNANet中 用于对比的模型的代码吗

李同学您好:

我目前同样正在研究红外小目标检测的相关问题, 看到您预印的DNANet后我感到十分振奋, 这真是一项极具创造性的工作, 祝您论文投稿顺利.

拜读您的工作后, 我深感作为一名研一学子, 基础尚不扎实, 因此打算先行学习比较久远的工作如: ACM ALCNet等模型. 可是这些模型的作者戴博士习惯使用MXNET, 这对于习惯Pytorch的我而言造成了十足的困扰.

幸而在阅读您论文时发现您竟然使用Pytorch对这些模型进行了复现! 这真的让我意外之余, 倍感惊喜. 然而在模型文件夹内, 我发现只能找到DNANet的模型, 这让我有些沮丧.

因此冒昧来信, 希望能够获得您论文中对比模型的Pytorch版本的实现, 如能回复, 不胜感激!

再次感谢您在红外小目标目标领域内的工作, 以及您热爱&&共享的开源精神,这为同样研究这个问题的我们提供了宝贵的思路与优质数据集.

陈壮

数据集问题

GitHub给出的数据集链接过期了,请问能不能更新一下数据集链接

deep_supervision默认为True,但论文里结构为False

您好,感谢您为这个领域做出的贡献并将代码开源,在研读您代码和论文过程中发现deep_supervision这个参数默认为True的话是将得到特征图分别遍历求loss,但在论文的整体架构图中对应的应该是False,只对融合后的特征图求loss,请问这个参数对性能影响大吗。

可视化部分

6402347c77e39e58c1e2432a5117d3a

作者您好,我通过下载您給的代码,对特征图进行可视化,结果差异很大,请问您在可视化做了哪些其他的操作吗?

关于训练测试的问题

您好:
因为我是刚开始学习神经网络的,我想请问在Windows上运行train.py后,result文件夹中的准确度就是测试的准确度吗?还是要再运行测试的函数。

关于ROC曲线绘制的问题

您好,我现在在与您的方法做对比,在绘制ROC曲线时,有些问题需要请教一下:

  1. 请问您是使用model/metric.py 中的ROCMetric()得到的tp_rates,fp_rates绘制的?还是使用的PD_FA()得到的Final_FA与Final_PD绘制的呢
  2. 您绘制的时候Bins 采取的是10 吗,即取10个离散点嘛?
  3. 对于其他对比方法,是读取测试结果的图片,再归一化,然后再调用计算ROC的函数吗?我现在使用ROCMetric()得到的值画对比方法的ROC曲线,得到的效果极差,Fa很高,Pd很低,如下图所示:
    roc
    但是对比方法的主观效果,包括计算IoU等指标都是正常的,代表其检测的应该没问题,我不清楚是不是我的程序出问题还是调用的函数不对,
    请问您可以释放一下画ROC曲线的程序 或者 对比方法的ROC曲线的值吗?

或者您可以看一下我的程序哪不对吗?我自己总结的两点需要注意的,第一是更换方法后,需要reset(),第二是GT也需要归一化,

  
    #读取 GT
    for label in imgs:
         labels.append(torch.unsqueeze(torch.unsqueeze(torch.tensor(cv2.imread(labels_path+label,0)/255), 0), 0).cuda())
         #GT 需要归一化!
    #不同方法进行循环计算ROC
    for method in methods_list:
        ROC.reset()  #ROC重置
        #读取预测的图片
        for index,item in enumerate(tqdm(imgs)):
            pred  =torch.unsqueeze(torch.unsqueeze(torch.tensor(cv2.imread(method+item,0)/255),0),0).cuda()#适应ROCMetric()的格式
            ROC.update(pred, labels[index])
        #所有图计算完成后,get()
        ture_positive_rate, false_positive_rate, recall, precision = ROC.get() 

数据集,训练模型问题,

您好,我这边运行默认训练的时候,提示:No such file or directory: 'dataset//NUDT-SIRST/images/000282.png' 这个数据集 是不是自动下载的吗?怎么处理啊,可否发我一份到邮箱啊 [email protected]

where is the model.model_ACM?

We can comment the code: from model.model_ACM import ACM, and avoid the ACM method tests.But we still want to ask where is the model_ACM.py or when is available?

1

请问您提出的NUDT-sirst 数据集1327张图片里包含多少个小目标呢?

NUST数据集的训练与测试

你好,第三个数据集我用readme的权重测试结果和论文中的不一样,是权重出现了问题吗,我的结果是
test_loss, 0.9042
mean_IOU: 0.0041452822739834186
FA: [7.67974854e-04 2.69775391e-04 2.63977051e-05 2.89916992e-06
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
0.00000000e+00 0.00000000e+00 0.00000000e+00]
PD: [1. 1. 1. 0. 0. 0. 0. 0. 0. 0. 0.]

并且我自己训练NUST数据集,目前第七百多次的训练结果也不理想,训练的结果是这样
04/11/2022 17:34:10 - 0702: - train_loss: 0.183630: - test_loss: 0.992174: mIoU 0.0036
04/11/2022 17:34:10-702
Recall-----: 0.29162057 0.01287787 0.01277457 0.01270373 0.01264883 0.01259481 0.01254192 0.01248629 0.01241864 0.01231749 0.0
Precision--: 3.68e-06 0.00368819 0.00373242 0.00376097 0.00378507 0.00380663 0.00382887 0.00385328 0.00388287 0.00392786 0.0

前面两个数据集可以成功复现,第三个数据集与论文给出的结果差距很大

关于数据集的问题

您好,请问您的数据集什么时候会公布呢?戴一冕的sirst的数据集太少,想看看您的数据集的效果,万分感谢

单帧处理时间

作者您好,我想问一下处理一帧需要的时间大概是多久呢

文章中的错误

文章中的公式(2),i+1和i-1是不是标反了,i+1到i才是上采样吧,i-1到i是卷积池化

关于复现效果的问题

您好,十分感谢您的代码,我使用NUDT数据集,也是单块3090,按照您给定的参数,原始代码没有修改,多次训练,最终训练出的结果大概在这个范围:IoU:0.82-0.85之间,Pd在0.97-0.985之间,Fa在7-11 ×10^-6, 无法训练到您的效果。请问您觉得可能是哪方面的问题吗?

about the learning rate

你好,请问代码里面,学习率是不是没变?epoch结束以后,好像没有加上schedule.step()

关于对比实验问题

您好!您在做对比实验时,是对所有方法进行了复现吗?论文中提到提供了对比方法的代码,但是我好像没有找到相关代码,可以提供对比用的代码吗?感谢,感谢!!!

关于多GPU训练的问题

作者您好,我在多GPU训练过程中发现模型效果会比单GPU训练效果差,后面发现应该是损失函数和batch的大小耦合的关系,您有遇到这个问题么

NUDT-SIRST数据集

作者你好!我通过给的链接下载的NUDT-SIRST数据集中只有images和masks,为什么会没有标签文件呢?

关于复现异常的问题

作者你好,最近在复现DNANet在NUDT-SIRST数据集上的结果时,出现了一下的问题:
image
image
可以看到,第一次loss出现了骤降,第二次出现了严重的震荡,结果似乎有很大的随机性,请问你知道这是什么原因吗?不固定随机种子,是不是本来就有很大的随机性?
然后我发现作者虽然定义了学习率函数,但是并没有在训练中使用step(),是作者发现恒定的学习率能有更好的训练结果吗?

关于模型问题

你好!我在复现过程中,没有找到ACM模型部分的代码,请问是不全吗还是我的问题。谢谢!

训练集和测试集的划分

原文中训练集和测试集的比例是1:1,但在NUDT-SIRST数据集中只提供了全部的images和masks,作者能否提供训练集和测试集的划分文件?谢谢!

缺少model_ACM.py文件

作者您好,我使用您这个文件运行demo.py会提示缺少ACM文件,您方便上传一下吗?

关于训练集和验证集一样的疑惑

作者您好,我在做实验的时候有一个疑惑,为什么训练集和验证集是一样的,这是不是会导致模型泛化能力差呢,还望作者指点迷津

A question about 3D visualisation

Can you tell me the code for the 3D visualization of the images? I'm having some problems with the implementation and would like some help. Which functions in MATLAB are used for this purpose? Or can you tell me the details of the XYZ axis, etc.? Looking forward to your response. Thank you very much!

关于FA-PD曲线的绘制代码

作者您好!
感谢您分享了您的代码,收获很多~!
可以问一下能分享一下FA-PD曲线的绘制代码么,我试了一下自己用sklearn.metrics import precision_recall_curve处理test后的FA和PD数据,一直报错,不知道怎么画FA-PD图,求帮助了,非常感谢!!

NUDT-SIRST 会公开吗?

你好,请问一下NUDT-SIRST数据集会公开吗? 如果会的话,大概什么时候呢,谢谢

关于train.py的问题

您好,很感谢您在红外小目标检测领域的杰出工作。我在浏览代码train.py时,发现写了一个testing函数,我想请问这样做是边训练边测试吗?还是需要将其注释掉。
期待您的回复~

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.