Home

Awesome

Background Semantics Matter: Cross-Task Feature Exchange Network for Clustered Infrared Small Target Detection With Sky-Annotated Dataset

This repository is the official implementation of BAFE-Net

Paper link: Background Semantics Matter: Cross-Task Feature Exchange Network for Clustered Infrared Small Target Detection With Sky-Annotated Dataset

DenseSIRST

DenseSIRST Datasets: https://github.com/GrokCV/DenseSIRST

DenseSIRST

You can download our DenseSIRST dataset from Google Drive.<br>

For both training and inference, the following dataset structure is required:

|- data
    |- SIRSTdevkit
        |-PNGImages
            |-Misc_1.png
            ......
        |-SIRST
            |-BBox
                |-Misc_1.xml
                ......
            |-BinaryMask
                |-Misc_1_pixels0.png
                |-Misc_1.xml
                ......
            |-PaletteMask
                |-Misc_1.png
                ......
            |-Point_label
                |-Misc_1_pixels0.txt
                ......
        |-SkySeg
            |-BinaryMask
                |-Misc_1_pixels0.png
                |-Misc_1.xml
                ......
            |-PaletteMask
                |-Misc_1.png
                ......
        |-Splits
            |-train_v2.txt
            |-test_v2.txt
            ......

Please make sure that the path of your data set is consistent with the data_root in configs/detection/_base_/datasets/sirst_det_seg_voc_skycp.py

Model Zoo and Benchmark

Checkpoint and Train log: Google Drive.<br>

Leaderboard

MethodBackbonemAP<sub>07</sub>recall<sub>07</sub>mAP<sub>12</sub>recall<sub>12</sub>Flops↓Params↓
One-stage
SSDVGG1687.552G23.746M0.2110.4210.1780.424
RetinaNetResNet5052.203G36.330M0.1140.5100.0860.523
YOLOv3Darknet50.002G61.949M0.2330.4240.2070.413
CenterNetResNet5050.278G32.111M0.1380.3160.1240.317
FCOSResNet5050.291G32.113M0.2320.3150.2040.324
ATSSResNet5051.504G32.113M0.2480.3270.2020.326
CentripetalNetHourglassNet0.491T0.206G0.2440.2590.2010.244
AutoAssignResNet5050.555G36.244M0.2550.3540.1800.314
GFLResNet5052.296G32.258M0.2640.3670.2300.317
PAAResNet5051.504G32.113M0.2550.5450.2280.551
VFNetResNet5048.317G32.709M0.2530.3360.2140.336
PVT-TPVT41.623G21.325M0.1090.4810.0930.501
YOLOFResNet5025.076G42.339M0.0910.0090.0020.009
YOLOXCSPDarknet8.578G8.968M0.2100.3410.1800.331
TOODResNet5050.456G32.018M0.2560.3550.2260.342
DyHeadResNet5027.866G38.890M0.2490.3350.1890.328
DDODResNet5046.514G32.378M0.2530.3350.2300.351
RTMDetCSPNeXt51.278G52.316M0.2290.3490.2120.350
EfficientDetEfficientNet34.686G18.320M0.1460.4640.0940.517
Two-stage
Faster R-CNNResNet500.759T33.035M0.0910.0220.0150.029
Cascade R-CNNResNet5090.978G69.152M0.1360.1880.1390.194
Grid R-CNNResNet500.177T64.467M0.1560.1220.1040.190
Libra R-CNNResNet5063.990G41.611M0.1410.1420.0850.120
TridentNetResNet500.759T33.035M0.0910.0090.0140.021
SABLResNet500.125T42.213M0.1240.1040.1040.171
Dynamic R-CNNResNet5063.179G41.348M0.1840.2350.1110.190
End2End
DETRResNet5024.940G41.555M0.0000.0000.0000.000
Sparse R-CNNResNet5045.274G0.106G0.1830.5720.1540.614
Deformable DETRResNet5051.772G40.099M0.0240.0160.0180.197
Conditional DETRResNet5027.143G40.297M0.0000.0000.0000.001
DAB-DETRResNet5028.939G43.702M0.0050.0540.0000.001
BAFE-Net (Ours)ResNet1857.654G22.31M0.2830.3350.2330.325
BAFE-Net (Ours)ResNet5071.639G35.626M0.2740.3420.2480.338

BAFE-Net

BAFE-Net

Installation

Step 1: Create a conda environment

$ conda create --name deepir python=3.9
$ conda activate deepir

Step 2: Install PyTorch

$ conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia

Step 3: Install OpenMMLab Codebases

pip install -U openmim
mim install mmengine
mim install "mmcv>=2.0.0"
mim install "mmdet>=3.0.0"
pip install "mmsegmentation>=1.0.0"
pip install dadaptation

Step 4: Install deepir

$ python setup.py develop

Note: make sure you have cd to the root directory of deepinfrared

$ git clone git@github.com:GrokCV/BAFE-Net.git
$ cd BAFE-Net

Train

$ CUDA_VISIBLE_DEVICES=0 python train.py <CONFIG_FILE>

For example:

$ CUDA_VISIBLE_DEVICES=0 python tools/train_det.py configs/detection/fcos_changer_seg/fcos_changer_seg_r50-caffe_fpn_gn-head_1x_densesirst.py

Test

$ CUDA_VISIBLE_DEVICES=0 python test.py <CONFIG_FILE> <SEG_CHECKPOINT_FILE>

For example:

$ CUDA_VISIBLE_DEVICES=0 python tools/test_det.py configs/detection/fcos_changer_seg/fcos_changer_seg_r50-caffe_fpn_gn-head_1x_densesirst.py work_dirs/fcos_changer_seg_r50-caffe_fpn_gn-head_1x_densesirst/20240719_162542/best_pascal_voc_mAP_epoch_8.pth

If you want to visualize the result, you only add --show at the end of the above command.

The default image save path is under <SEG_CHECKPOINT_FILE>. You can use --work-dir to specify the test log path, and the image save path is under this path by default. Of course, you can also use --show-dir to specify the image save path.

Citation

If you use our dataset or code in your research, please cite this project.

@article{xiao2024bafenet,
	title={Background Semantics Matter: Cross-Task Feature Exchange Network for Clustered Infrared Small Target Detection With Sky-Annotated Dataset}, 
	author={Mengxuan Xiao and Qun Dai and Yiming Zhu and Kehua Guo and Huan Wang and Xiangbo Shu and Jian Yang and Yimian Dai},
	year={2024},
	journal={arXiv preprint arXiv:2407.20078},
}

@article{dai2023one,
  title={One-stage cascade refinement networks for infrared small target detection},
  author={Dai, Yimian and Li, Xiang and Zhou, Fei and Qian, Yulei and Chen, Yaohong and Yang, Jian},
  journal={IEEE Transactions on Geoscience and Remote Sensing},
  volume={61},
  pages={1--17},
  year={2023},
}