--- license: cc-by-nc-4.0 language: en tags: - vision - image-feature-extraction - sar - remote-sensing - synthetic-aperture-radar - masked-autoencoder - transformers library_name: transformers pipeline_tag: image-feature-extraction datasets: - Wenquandan777/SAR-1M arxiv: 2512.16635 base_model: Wenquandan777/SARMAE model-index: - name: sarmae-vit-base-patch16-pretrain results: [] --- # sarmae-vit-base-patch16-pretrain SARMAE (ViT-B, patch 16) encoder checkpoint converted to native Hugging Face Transformers format. SARMAE is a Noise-Aware Masked Autoencoder for self-supervised SAR representation learning, pretrained on [SAR-1M](https://huggingface.co/datasets/Wenquandan777/SAR-1M) with Speckle-Aware Representation Enhancement (SARE) and Semantic Anchor Representation Constraint (SARC). - **Paper:** [2512.16635](https://arxiv.org/abs/2512.16635) - **Legacy weights:** [Wenquandan777/SARMAE](https://huggingface.co/Wenquandan777/SARMAE) - **Stage:** `pretrain` - **Input:** 3 x 224 x 224 (single-channel SAR is repeated to 3 channels) - **Architecture:** 12 layers, hidden size 768, 12 heads ## Model specifications | Property | Value | |----------|-------| | Model type | `sarmae` | | Backbone | ViT-B | | Patch size | 16 | | Image size | 224 | | Hidden size | 768 | | Layers | 12 | | Attention heads | 12 | | Global pooling | `True` | | Normalization mean | `[0.485, 0.456, 0.406]` | | Normalization std | `[0.229, 0.224, 0.225]` | ## Intended use - SAR image feature extraction for downstream classification, detection, and segmentation - Initializing OpenMMLab backbones (`mmrotate`, `mmseg`) after weight porting - Research and non-commercial use under [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/) ## Quick start Install dependencies: ```bash pip install transformers timm torch torchvision safetensors ``` ### Feature extraction with `transformers.pipeline` ```python from transformers import pipeline pipe = pipeline( task="image-feature-extraction", model="BiliSakura/SARMAE-transformers", subfolder="vit-base-patch16-pretrain", trust_remote_code=True, ) features = pipe(sar_image, pool=True, return_tensors=True) print(features.shape) ``` ### Direct model loading ```python from transformers import AutoModel, AutoImageProcessor model = AutoModel.from_pretrained("BiliSakura/SARMAE-transformers", subfolder="vit-base-patch16-pretrain", trust_remote_code=True) processor = AutoImageProcessor.from_pretrained("BiliSakura/SARMAE-transformers", subfolder="vit-base-patch16-pretrain", trust_remote_code=True) inputs = processor(images=sar_image, return_tensors="pt") outputs = model(**inputs) pooled_features = outputs.pooler_output ``` ### Local checkout ```python pipe = pipeline( task="image-feature-extraction", model="./sarmae-vit-base-patch16-pretrain", trust_remote_code=True, ) ``` ## Preprocessing - Resize to 224x224 - Scale pixel values to `[0, 1]` (`rescale_factor=1/255`) - Repeat grayscale SAR to 3 channels when `repeat_grayscale_channels=true` - Normalize with ImageNet mean/std (same as SARMAE fine-tuning code) ## Training data Pretrained on **SAR-1M**, a million-scale SAR dataset with paired optical anchors for a subset of samples. ## Citation ```bibtex @misc{liu2025sarmaemaskedautoencodersar, title={SARMAE: Masked Autoencoder for SAR Representation Learning}, author={Danxu Liu and Di Wang and Hebaixu Wang and Haoyang Chen and Wentao Jiang and Yilin Cheng and Haonan Guo and Wei Cui and Jing Zhang}, year={2025}, eprint={2512.16635}, archivePrefix={arXiv}, primaryClass={cs.CV}, url={https://arxiv.org/abs/2512.16635}, } ``` ## License This model is released under [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/).