File size: 6,731 Bytes
159c352
 
 
 
 
 
 
 
 
2ecb9eb
 
159c352
 
 
 
2ecb9eb
 
 
 
 
 
 
49039ac
2ecb9eb
 
 
 
 
 
 
 
 
 
159c352
 
 
5a919ba
 
 
 
159c352
2ecb9eb
159c352
2ecb9eb
5a919ba
 
159c352
 
 
 
 
 
 
 
 
 
 
 
 
 
2ecb9eb
 
159c352
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
413ec85
159c352
2ecb9eb
159c352
2ecb9eb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
language: en
tags:
- dinosar
- sar
- remote-sensing
- self-supervised-learning
- feature-extraction
library_name: pytorch
datasets:
- YTang/UniSAR-7M
---

# DINOSAR

**Self-supervised SAR image encoders with content-aware view construction.**

DINOSAR learns transferable representations from single-channel synthetic aperture radar imagery. Its Content-Aware Multi-Crop (CAMC) strategy constructs informative and diverse views for teacher鈥搒tudent self-distillation.

**Paper:** *DINOSAR: Large-Scale SAR Self-Supervised Pretraining with Content-Aware View Construction*  
**Status:** Submitted to the **International Journal of Digital Earth (IJDE)**.

[Project homepage](https://ehehe.cn/DINOSAR/) 路 [UniSAR-7M dataset](https://huggingface.co/datasets/YTang/UniSAR-7M) 路 [Pretrained checkpoints](#released-checkpoints) 路 [Citation](#citation)

[![DINOSAR pretraining framework: content-aware multi-crop, EMA teacher鈥搒tudent encoders, and DINO, iBOT, and KoLeo objectives.](assets/framework_overview.png)](assets/framework_overview.png)

*DINOSAR pretraining framework.* CAMC generates two global views and local views from a SAR structural content map and content anchors. The teacher processes global views, while the student processes all views. The teacher is updated by an exponential moving average of the student. Click the figure for full resolution.

## Method

CAMC derives structural content maps from multi-scale ratio-gradient responses and samples views by balancing informative scattering content, anchor proximity, and coverage diversity. Pretraining combines image-level DINO distillation, patch-level iBOT distillation, and KoLeo regularization. Teacher targets use Sinkhorn鈥揔nopp normalization; student predictions use softmax.

The ViT backbones use single-channel inputs, rotary position embeddings (RoPE), and four register tokens. They follow the DINOv3-compatible architecture with a single-stage self-distillation recipe. The exported teacher encoders provide global image representations and spatial patch features for downstream learning.

## Released checkpoints

| File | Architecture | Pretraining data | Epochs | Final step | CLS dimension | Training config | Training log |
|---|---|---|---|---|---|---|---|
| [dinosar_s16_unisar7m_60e.pth](dinosar_s16_unisar7m_60e.pth) | ViT-S/16 | UniSAR-7M | 60 | 330360 | 384 | [YAML](training/dinosar_s16_unisar7m_60e/config.yaml) | [JSONL](training/dinosar_s16_unisar7m_60e/metrics.jsonl) |
| [dinosar_b16_unisar7m_60e.pth](dinosar_b16_unisar7m_60e.pth) | ViT-B/16 | UniSAR-7M | 60 | 275340 | 768 | [YAML](training/dinosar_b16_unisar7m_60e/config.yaml) | [JSONL](training/dinosar_b16_unisar7m_60e/metrics.jsonl) |

Both models are pretrained for 60 epochs on [UniSAR-7M](https://huggingface.co/datasets/YTang/UniSAR-7M), a corpus of 7,047,666 SAR image samples, using CAMC. The [Dataset Card](https://huggingface.co/datasets/YTang/UniSAR-7M#data-sources-and-composition) documents the source composition, curation, download instructions, and usage considerations. Different effective batch sizes produce different step counts: 1280 for ViT-S and 1536 for ViT-B.

Files contain teacher backbone-only PyTorch tensor state dictionaries. They exclude projection heads and optimizer states and are intended for feature extraction and downstream initialization, not exact training resumption. See [manifest.json](manifest.json) and [SHA256SUMS](SHA256SUMS) for file metadata and integrity verification.

Training logs cover the full 60-epoch runs at 20-step intervals. Training configurations preserve the recorded settings, with the dataset path replaced by `/path/to/UniSAR-7M`.

## Loading

Install the DINOSAR Python package from the companion source repository (`DINOSAR_official/DINOSAR`, using its installation instructions), and install `huggingface_hub` and `pyyaml`. These are custom PyTorch encoders; Transformers `AutoModel` is not required.

```python
from pathlib import Path
import torch
import yaml
from huggingface_hub import hf_hub_download
from dinosar.model import load_backbone_from_config

name = "dinosar_b16_unisar7m_60e"  # or dinosar_s16_unisar7m_60e
repo = "YTang/DINOSAR"
# Fixed revision containing the released weights and model configurations.
revision = "159c352055e64dc5703f59254920bc8473870272"
weights = hf_hub_download(repo, name + ".pth", revision=revision)
config_path = hf_hub_download(repo, "configs/" + name + ".yaml", revision=revision)
config = yaml.safe_load(Path(config_path).read_text())["model"]
model = load_backbone_from_config(config, weights, strict=True).eval()

# Shape-only smoke example; replace with a properly preprocessed SAR image.
x = torch.zeros(1, 1, 224, 224)
with torch.inference_mode():
    features = model.forward_features(x)
    cls = features["x_norm_clstoken"]
    patches = features["x_norm_patchtokens"]
print(cls.shape, patches.shape)
```

## Input convention

The encoders use one input channel, patch size 16, and four register tokens. For the classification evaluation pipeline, use grayscale imagery, aspect-ratio-preserving resize and zero padding to 224 x 224, conversion to a [0, 1] tensor, and normalization with mean 0.219 and standard deviation 0.220. Use the companion code's `ResizeAndPad` implementation to match evaluation behavior. These statistics describe the prepared image representation, not arbitrary raw complex-valued SAR measurements. Dense prediction tasks use their own documented preprocessing protocols.

## Intended use

The encoders support frozen feature extraction and initialization for downstream SAR classification, detection, segmentation, and image鈥搕ext retrieval. Task-specific heads, annotations, and training protocols are required for those applications. The pretrained backbones alone do not constitute complete detectors, segmenters, or image鈥搕ext models.

## Licensing

The weight license statement is pending provenance review. Code, upstream dependencies, and training imagery have separate usage terms; the companion software license should not be interpreted as a blanket license for the weights or dataset. Training-data attribution and usage information is provided in the [Dataset Card](https://huggingface.co/datasets/YTang/UniSAR-7M#source-attribution-and-usage-terms).

## Citation

If DINOSAR contributes to your research, please cite the associated manuscript:

```bibtex
@unpublished{tang2026dinosar,
  title = {{DINOSAR}: Large-Scale {SAR} Self-Supervised Pretraining with Content-Aware View Construction},
  author = {Tang, Yan and Jin, Yifeng and Miao, Zekai and Ji, Min and Duan, Yu and Zhang, Shaoming and Wang, Jianmei},
  year = {2026},
  note = {Submitted to the International Journal of Digital Earth}
}
```