File size: 3,441 Bytes
e2a3312
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
## πŸ› οΈ Requirements

### Environment
- **Python** 3.8+
- **PyTorch** 1.13.0+
- **CUDA** 11.6+
- **Ubuntu** 18.04 or higher / Windows 10

### Installation

```bash
# Create conda environment
conda create -n dccs python=3.8 -y
conda activate dccs

# Install PyTorch
pip install torch==1.13.0 torchvision==0.14.0 torchaudio==0.13.0

# Install dependencies
pip install packaging
pip install timm==0.4.12
pip install pytest chardet yacs termcolor
pip install submitit tensorboardX
pip install triton==2.0.0
pip install causal_conv1d==1.0.0
pip install mamba_ssm==1.0.1

# Or simply run
pip install -r requirements.txt
```

## πŸ“ Dataset Preparation

We evaluate our method on three public datasets: **IRSTD-1K**, **NUAA-SIRST**, and **SIRST-Aug**.

| Dataset | Link |
|---------|------|
| IRSTD-1K | [Download](https://github.com/RuiZhang97/ISNet) |
| NUAA-SIRST | [Download](https://github.com/YimianDai/sirst) |
| SIRST-Aug | [Download](https://github.com/Tianfang-Zhang/AGPCNet) |

Please organize the datasets as follows:

```
β”œβ”€β”€ dataset/
β”‚    β”œβ”€β”€ IRSTD-1K/
β”‚    β”‚    β”œβ”€β”€ images/
β”‚    β”‚    β”‚    β”œβ”€β”€ XDU514png
β”‚    β”‚    β”‚    β”œβ”€β”€ XDU646.png
β”‚    β”‚    β”‚    └── ...
β”‚    β”‚    β”œβ”€β”€ masks/
β”‚    β”‚    β”‚    β”œβ”€β”€ XDU514.png
β”‚    β”‚    β”‚    β”œβ”€β”€ XDU646.png
β”‚    β”‚    β”‚    └── ...
β”‚    β”‚    └── trainval.txt
β”‚    β”‚    └── test.txt
β”‚    β”œβ”€β”€ NUAA-SIRST/
β”‚    β”‚    └── ...
β”‚    └── SIRST-Aug/
β”‚         └── ...
```

## πŸš€ Training

```bash
python main.py --dataset-dir '/path/to/dataset' \
               --batch-size 4 \
               --epochs 400 \
               --lr 0.05 \
               --mode 'train'
```

**Example:**
```bash
python main.py --dataset-dir './dataset/IRSTD-1K' --batch-size 4 --epochs 400 --lr 0.05 --mode 'train'
```

## πŸ“Š Testing

```bash
python main.py --dataset-dir '/path/to/dataset' \
               --batch-size 4 \
               --mode 'test' \
               --weight-path '/path/to/weight.tar'
```

**Example:**
```bash
python main.py --dataset-dir './dataset/IRSTD-1K' --batch-size 4 --mode 'test' --weight-path './weight/irstd1k_weight.pkl'
```

## πŸ“ˆ Results

### Quantitative Results

| Dataset | IoU (Γ—10⁻²) | Pd (Γ—10⁻²) | Fa (Γ—10⁻⁢) | Weights |
|:-------:|:------------:|:----------:|:----------:|:-------:|
| IRSTD-1K | 69.64 | 95.58 | 10.48 | [Download](https://drive.google.com/file/d/1KqlOVWIktfrBrntzr53z1eGnrzjWCWSe/view?usp=sharing) |
| NUAA-SIRST | 78.65 | 78.65 | 2.48 | [Download](https://drive.google.com/file/d/13JQ3V5xhXUcvy6h3opKs15gseuaoKrSQ/view?usp=sharing) |
| SIRST-Aug | 75.57 | 98.90 | 33.46 | [Download](https://drive.google.com/file/d/1lcmTgft0LStM7ABWDIMRHTkcOv95p9LO/view?usp=sharing) |


## πŸ“‚ Project Structure

```
DCCS/
β”œβ”€β”€ dataset/          # Dataset loading and preprocessing
β”œβ”€β”€ model/            # Network architecture
β”œβ”€β”€ utils/            # Utility functions
β”œβ”€β”€ weight/           # Pretrained weights
β”œβ”€β”€ main.py           # Main entry point
β”œβ”€β”€ requirements.txt  # Dependencies
└── README.md
```

## πŸ™ Acknowledgement

We sincerely thank the following works for their contributions:

- [BasicIRSTD](https://github.com/XinyiYing/BasicIRSTD) - A comprehensive toolbox 
- [MSHNet](https://github.com/ying-fu/MSHNet) - Scale and Location Sensitive Loss