Skip to content
/ RSAR Public

This repository contains the official implementation for the paper "RSAR: Restricted State Angle Resolver and Rotated SAR Benchmark".

License

Notifications You must be signed in to change notification settings

zhasion/RSAR

Repository files navigation

RSAR: Restricted State Angle Resolver and Rotated SAR Benchmark

Xin ZhangXue YangYuxuan LiJian YangMing-Ming ChengXiang Li*

If you find our work helpful, please consider giving us a ⭐!

⭐️Highlights

highlight

📋Introduction

Abstract

Rotated object detection has made significant progress in the optical remote sensing. However, advancements in the Synthetic Aperture Radar (SAR) field are laggard behind, primarily due to the absence of a large-scale dataset. Annotating such a dataset is inefficient and costly. A promising solution is to employ a weakly supervised model (e.g., trained with available horizontal boxes only) to generate pseudo-rotated boxes for reference before manual calibration. Unfortunately, the existing weakly supervised models exhibit limited accuracy in predicting the object's angle. Previous works attempt to enhance angle prediction by using angle resolvers that decouple angles into cosine and sine encodings. In this work, we first reevaluate these resolvers from a unified perspective of dimension mapping and expose that they share the same shortcomings: these methods overlook the unit cycle constraint inherent in these encodings, easily leading to prediction biases. To address this issue, we propose the Unit Cycle Resolver, which incorporates a unit circle constraint loss to improve angle prediction accuracy. Our approach can effectively improve the performance of existing state-of-the-art weakly supervised methods and even surpasses fully supervised models on existing optical benchmarks (i.e., DOTA-v1.0 dataset). With the aid of UCR, we further annotate and introduce RSAR, the largest multi-class rotated SAR object detection dataset to date. Extensive experiments on both RSAR and optical datasets demonstrate that our UCR enhances angle prediction accuracy.

⚡RSAR Dataset

RSAR_vis

This dataset contains 95,842 images, including 78,837 in the training set, 8,467 in the validation set, and 8,538 in the test set. Instance statistics for each category are shown in the table below

Catagory Train ins. Val ins. Test ins.
Ship (SH) 92,950 10,492 10,700
Aircraft (AI) 6,880 449 494
Car (CA) 9,567 1,219 1,231
Tank (TA) 9,479 1,000 886
Bridge (BR) 27,512 3,300 3,272
Harbor (HA) 3,304 400 399
Total 149,692 16,860 16,982

The following figure provides a statistical analysis of the annotated instances for each category in the RSAR dataset

RSAR_sta

🛠️ Usage

1. Installation

Please refer to mmrotate dev-1.x for more detailed instructions.

conda create --name mmrotate python=3.8 -y
conda activate mmrotate
conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.6 -c pytorch -c nvidia
pip install -U openmim
mim install mmcv-full
mim install mmdet
git clone https://github.com/zhasion/RSAR
cd RSAR
pip install -v -e .

Note: Install PyTorch please following official instructions.

2. Dataset Prepare

Download the RSAR dataset from thedataset or dataset and extract the files to $DATAROOT. The directory structure should look like:

$DATAROOT
|-- train
|   |-- annfiles  # contains annotations :*.txt
|   `-- images    # contains sar images  :*.jpg *.bmp *.png
|-- val
|   |-- annfiles
|   `-- images
`-- test
    |-- annfiles
    `-- images

Please refer to data_preparation.md to prepare the other datasets (e.g. DOTAv-1.0, HRSC). Please note that the dataset needs to be sliced accordingly after downloading, and all experiments in this repository are based on a single-size setting.

3. Training

If you are using a single GPU, you can refer to the following commands:

python tools/train.py [your_config]

If you are using multiple GPUs, you can refer to the following commands:

sh tools/dist_train.sh [your_config] [available_GPU_num]

4. Evaluation

python tools/test.py [your_config]

Please note that if you need to output results for multiple iou thresholds and the precision of the results, you need to modify the configuration accordingly.

5. Convert model

If you find the trained model very large, please refer to publish_model.py

python tools/model_converters/publish_model.py [your_model.pth] [your_new_model.pth]

🚀Models and Results

1. Weakly supervised Model

The weakly supervised model is based on H2RBox-v2 with our UCR. All Models utilize ResNet50 as the backbone and trained on one GPU.

Dataset DM* mAP Angle lr schd BS Config Download
DOTA-v1.0 2 42.65 le90 1x 2 config ckpt | log
DOTA-v1.0 3 43.10 le90 1x 2 config ckpt | log
HRSC 2 60.00 le90 6x 2 config ckpt | log
HRSC 3 61.74 le90 6x 2 config ckpt | log
RSAR 2 32.25 le90 1x 2 config ckpt | log
RSAR 3 32.64 le90 1x 2 config ckpt | log

* denotes the dimension of mapping in UCR.

Note: It is normal for the reproduction accuracy of the model to deviate slightly from the reported accuracy, but it should all be substantially improved from the baseline model.

2. Fully supervised Model (base on RSAR)

Various detectors trained on RSAR. All models are trained on 4 GPUs.

Backbone Model mAP Angle lr schd BS Config Download
ResNet50 (800,800) Rotated-RetinaNet 27.65 le90 1x 2 config ckpt | log
ResNet50 (800,800) R3Det 30.50 le90 1x 2 config ckpt | log
ResNet50 (800,800) S2ANet 33.11 le90 1x 2 config ckpt | log
ResNet50 (800,800) Rotated-FCOS 34.22 le90 1x 2 config ckpt | log
ResNet50 (800,800) Rotated-Faster RCNN 30.46 le90 1x 2 config ckpt | log
ResNet50 (800,800) O-RCNN 33.62 le90 1x 2 config ckpt | log
ReResNet50 (800,800) ReDet 34.30 le90 1x 2 config ckpt | log
ResNet50 (800,800) RoI-Transformer 35.02 le90 1x 2 config ckpt | log
ResNet50 (800,800) Deformable DETR 19.63 le90 1x* 2 config ckpt | log
ResNet50 (800,800) ARS-DETR 31.56 le90 1x* 2 config ckpt | log

* denotes a special setting in the official repo (e.g. trained 36 epochs in practice), details see STAR-MMRotate.

📘Citation

If you find our paper or benchmark helpful for your research, please consider citing our paper and giving this repo a star ⭐. Thank you very much!

@article{zhang2025rsar,
  title={RSAR: Restricted State Angle Resolver and Rotated SAR Benchmark},
  author={Zhang, Xin and Yang, Xue and Li, Yuxuan and Yang, Jian and Cheng, Ming-Ming and Li, Xiang},
  journal={arXiv preprint arXiv:2501.04440},
  year={2025}
}

@inproceedings{li2024sardet,
  title={Sardet-100k: Towards open-source benchmark and toolkit for large-scale sar object detection},
  author={Li, Yuxuan and Li, Xiang and Li, Weijie and Hou, Qibin and Liu, Li and Cheng, Ming-Ming and Yang, Jian},
  booktitle={The Thirty-eighth Annual Conference on Neural Information Processing Systems (NeurIPS)},
  year={2024},
}

Contact

If you have any question, please feel free to contact us via [email protected] or Github issues.

License

Licensed under a Creative Commons Attribution-NonCommercial 4.0 International for Non-commercial use only. Any commercial use should get formal permission first.

About

This repository contains the official implementation for the paper "RSAR: Restricted State Angle Resolver and Rotated SAR Benchmark".

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages