Skip to content

GrokCV/GrokSAR

Repository files navigation

GrokSAR


official repository for DenoDet

"DenoDet: Attention as Deformable Multi-Subspace Feature Denoising for Target Detection in SAR Images" at: https://arxiv.org/pdf/2406.02833

PWC


GrokSAR is an open-source toolbox for SAR target detection and recognition.

Installation

Step 1: Create a conda environment

conda create --name groksar python=3.8
source activate groksar

Step 2: Install PyTorch

conda install pytorch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 pytorch-cuda=11.8 -c pytorch -c nvidia

Step 3: Install OpenMMLab 2.x Codebases

# openmmlab codebases
pip install -U openmim dadaptation cmake lit --no-input
mim install mmengine "mmcv>=2.0.0rc4, <2.1.0" "mmdet>=3.0.0rc5, < 3.1.0" "mmsegmentation>=1.0.0" "mmrotate>=1.0.0rc1" mmyolo mmpretrain
# heatmap generation dependencies
pip install grad-cam==1.4.0
# other dependencies
pip install ninja --no-input
pip install scikit-learn
pip install psutil

Step 4: Install groksar

python setup.py develop

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

$ git clone [email protected]:GrokCV/groksar.git
$ cd groksar

Getting Started

Training

Single GPU Training

For SARDet-100K dataset:

python tools/train_det.py configs/DenoDet/DenoDet_1x_SARDet_100k.py

For SAR-AIRcraft-1.0 dataset:

python tools/train_det.py configs/DenoDet/DenoDet_1x_SAR-AIRcraft-1.0.py

For MSAR dataset:

python tools/train_det.py configs/DenoDet/DenoDet_3x_MSAR.py

For AIR-SARShip-1.0 dataset:

python tools/train_det.py configs/DenoDet/DenoDet_6x_AIR-SARShip-1.0.py

Multi GPU Training

Take a 4-GPU machine as example.

For SARDet-100K dataset:

CUDA_VISIBLE_DEVICES=0,1,2,3 PORT=29500 tools/dist_train.sh configs/DenoDet/DenoDet_1x_SARDet_100k.py 4

For SAR-AIRcraft-1.0 dataset:

CUDA_VISIBLE_DEVICES=0,1,2,3 PORT=29500 tools/dist_train.sh configs/DenoDet/DenoDet_1x_SAR-AIRcraft-1.0.py 4

For MSAR dataset:

CUDA_VISIBLE_DEVICES=0,1,2,3 PORT=29500 tools/dist_train.sh configs/DenoDet/DenoDet_3x_MSAR.py 4

For AIR-SARShip-1.0 dataset:

CUDA_VISIBLE_DEVICES=0,1,2,3 PORT=29500 tools/dist_train.sh configs/DenoDet/DenoDet_6x_AIR-SARShip-1.0.py 4

Here, 4 is the number of GPUs in your machine.

Inference

Single GPU Inference

For SARDet-100K dataset:

python tools/test_det.py configs/DenoDet/DenoDet_1x_SARDet_100k.py {checkpoint_path}

For SAR-AIRcraft-1.0 dataset:

python tools/test_det.py configs/DenoDet/DenoDet_1x_SAR-AIRcraft-1.0.py {checkpoint_path}

For MSAR dataset:

python tools/test_det.py configs/DenoDet/DenoDet_3x_MSAR.py {checkpoint_path}

For AIR-SARShip-1.0 dataset:

python tools/test_det.py configs/DenoDet/DenoDet_6x_AIR-SARShip-1.0.py {checkpoint_path}

Here, {checkpoint_path} represents the path to the weights you downloaded or trained. The {curly braces} are for reference only and should not be included when using the scripts.

Multi GPU Inference

Take a 4-GPU machine as example.

For SARDet-100K dataset:

CUDA_VISIBLE_DEVICES=0,1,2,3 PORT=29500 tools/dist_test.sh configs/DenoDet/DenoDet_1x_SARDet_100k.py {checkpoint_path} 4

For SAR-AIRcraft-1.0 dataset:

CUDA_VISIBLE_DEVICES=0,1,2,3 PORT=29500 tools/dist_test.sh configs/DenoDet/DenoDet_1x_SAR-AIRcraft-1.0.py {checkpoint_path} 4

For MSAR dataset:

CUDA_VISIBLE_DEVICES=0,1,2,3 PORT=29500 tools/dist_test.sh configs/DenoDet/DenoDet_3x_MSAR.py {checkpoint_path} 4

For AIR-SARShip-1.0 dataset:

CUDA_VISIBLE_DEVICES=0,1,2,3 PORT=29500 tools/dist_test.sh configs/DenoDet/DenoDet_6x_AIR-SARShip-1.0.py {checkpoint_path} 4

Here, {checkpoint_path} represents the path to the weights you downloaded or trained. The {curly braces} are for reference only and should not be included when using the scripts, and {4} is the number of GPUs in your machine.

Model Zoo and Benchmark

Note: Both passwords for BaiduYun and OneDrive is grok.

Leaderboard

Model Zoo

DenoDet

SARDet-100K

Model mAP(COCO) FLOPs Config Training Log Checkpoint
DenoDet 55.88 52.69G DenoDet_1x_SARDet_100k.py 百度网盘

MSAR

Model mAP(07) mAP(12) FLOPs Config Training Log Checkpoint
DenoDet 69.90 71.21 12.89G DenoDet_3x_MSAR.py 百度网盘 | OneDirve

SAR-AIRcraft-1.0

Model mAP(07) mAP(12) FLOPs Config Training Log Checkpoint
DenoDet 68.60 69.56 48.53G DenoDet_1x_SAR-AIRcraft-1.0.py 百度网盘 | OneDirve

AIR-SARShip-1.0

Model mAP(07) mAP(12) FLOPs Config Training Log Checkpoint
DenoDet 72.42 73.36 48.52G DenoDet_6x_AIR-SARShip-1.0.py 百度网盘 | OneDirve

Citation

If you use this toolbox or benchmark in your research, please cite this project.

@article{dai2024denodet,
	title={DenoDet: Attention as Deformable Multi-Subspace Feature Denoising for Target Detection in SAR Images},
	author={Dai, Yimian and Zou, Minrui and Li, Yuxuan and Li, Xiang and Ni, Kang and Yang, Jian},
	journal={IEEE Transactions on Aerospace and Electronic Systems (TAES)},
	year={2024}
}

@inproceedings{li2024sardet100k,
	title={SARDet-100K: Towards Open-Source Benchmark and ToolKit for Large-Scale SAR Object Detection}, 
	author={Yuxuan Li and Xiang Li and Weijie Li and Qibin Hou and Li Liu and Ming-Ming Cheng and Jian Yang},
	year={2024},
	booktitle={The Thirty-eighth Annual Conference on Neural Information Processing Systems (NeurIPS)},
}

License

This project is released under the Attribution-NonCommercial 4.0 International.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published