SARCLIP: Multimodal Foundation Model for SAR Imagery
2
13 commits
2 linked in READMEs
updated Feb 6, 2026
SARCLIP is a multimodal foundation model specifically designed for Synthetic Aperture Radar (SAR) imagery based on the Contrastive Language-Image Pre-training (CLIP) framework. SARCLIP enables cross-modal understanding between SAR images and textual information, supporting zero-shot classification, cross-modal retrieval, and image-text inference.
Install required Python libraries:
pip install -r requirements.txt
SARCLIP-main/
βββ sar_clip/
β βββ model_configs/ # Model configs & pre-trained weights
β βββ *.py # Core model code
βββ data/ # Dataset directory
βββ retrieval.py # Cross-modal retrieval script
βββ zero-shot.py # Zero-shot classification script
βββ zero-shot-inference.py # Image-text inference script
βββ example.py # Demonstration script
βββ requirements.txt
βββ README.md
Update CLASSNAMES and TEMPLATES in zero-shot.py, then execute:
python zero-shot.py \
--imagenet-val "./data/zero-shot" \
--batch-size 8 \
--model "ViT-B-32" \
--cache-dir "./sar_clip/model_configs/ViT-B-32" \
--pretrained "./sar_clip/model_configs/ViT-B-32/vit_b_32_model.safetensors"
Execute the retrieval script (Extract the ./data/retrieval/retrieval.rar file first):
python retrieval.py \
--val-data "./data/retrieval_file_list.csv" \
--csv-img-key "filename" \
--csv-caption-key "caption" \
--batch-size 8 \
--model "ViT-B-32" \
--cache-dir "./sar_clip/model_configs/ViT-B-32" \
--pretrained "./sar_clip/model_configs/ViT-B-32/vit_b_32_model.safetensors"
Run inference directly on images:
python zero-shot-inference.py \
--image-dir "path/to/images" \
--batch-size 8 \
--model "ViT-B-32" \
--cache-dir "./sar_clip/model_configs/ViT-B-32" \
--pretrained "./sar_clip/model_configs/ViT-B-32/vit_b_32_model.safetensors"
Running example.py provides a visualization and outputs textual predictions:
Predictions:
- an SAR image of urban zones 1.0000
- an SAR image of water areas 0.0000
- an SAR image of croplands 0.0000
- one solitary marine craft is visible in the right region . 0.0000
- along the right side , several storage tanks are be detected . 0.0000
- 1 aircraft is found throughout the frame . 0.0000
--batch-size.The pretrained SARCLIP weights are publicly available for research and non-commercial use.
dizf)To use the pretrained weights, place them under:
./sar_clip/model_configs/{MODEL_NAME}/
All released data are intended for non-commercial research and educational purposes only.
2nxm)quh2)Dataset structure:
SARCAP/
βββ img/ # SAR image patches
βββ img_caption.csv # Image-text pairs
To use the zero-shot examples, place them under:
./data/zero-shot/
If you use SARCLIP, please cite:
@misc{SARCLIP2025,
author = {CAESAR-Radi},
title = {SARCLIP: A Multimodal Foundation Framework for SAR Imagery via Contrastive Language-Image Pre-Training},
year = {2025},
publisher = {GitHub},
url = {https://github.com/CAESAR-Radi/SARCLIP}
}
We thank the following organizations for providing datasets and inspiration:
Special thanks to the OpenCLIP team for their significant contributions.
13 commits
SARCLIP: Multimodal Foundation Model for SAR Imagery
2
13 commits
2 linked in READMEs
updated Feb 6, 2026
SARCLIP is a multimodal foundation model specifically designed for Synthetic Aperture Radar (SAR) imagery based on the Contrastive Language-Image Pre-training (CLIP) framework. SARCLIP enables cross-modal understanding between SAR images and textual information, supporting zero-shot classification, cross-modal retrieval, and image-text inference.
Install required Python libraries:
pip install -r requirements.txt
SARCLIP-main/
βββ sar_clip/
β βββ model_configs/ # Model configs & pre-trained weights
β βββ *.py # Core model code
βββ data/ # Dataset directory
βββ retrieval.py # Cross-modal retrieval script
βββ zero-shot.py # Zero-shot classification script
βββ zero-shot-inference.py # Image-text inference script
βββ example.py # Demonstration script
βββ requirements.txt
βββ README.md
Update CLASSNAMES and TEMPLATES in zero-shot.py, then execute:
python zero-shot.py \
--imagenet-val "./data/zero-shot" \
--batch-size 8 \
--model "ViT-B-32" \
--cache-dir "./sar_clip/model_configs/ViT-B-32" \
--pretrained "./sar_clip/model_configs/ViT-B-32/vit_b_32_model.safetensors"
Execute the retrieval script (Extract the ./data/retrieval/retrieval.rar file first):
python retrieval.py \
--val-data "./data/retrieval_file_list.csv" \
--csv-img-key "filename" \
--csv-caption-key "caption" \
--batch-size 8 \
--model "ViT-B-32" \
--cache-dir "./sar_clip/model_configs/ViT-B-32" \
--pretrained "./sar_clip/model_configs/ViT-B-32/vit_b_32_model.safetensors"
Run inference directly on images:
python zero-shot-inference.py \
--image-dir "path/to/images" \
--batch-size 8 \
--model "ViT-B-32" \
--cache-dir "./sar_clip/model_configs/ViT-B-32" \
--pretrained "./sar_clip/model_configs/ViT-B-32/vit_b_32_model.safetensors"
Running example.py provides a visualization and outputs textual predictions:
Predictions:
- an SAR image of urban zones 1.0000
- an SAR image of water areas 0.0000
- an SAR image of croplands 0.0000
- one solitary marine craft is visible in the right region . 0.0000
- along the right side , several storage tanks are be detected . 0.0000
- 1 aircraft is found throughout the frame . 0.0000
--batch-size.The pretrained SARCLIP weights are publicly available for research and non-commercial use.
dizf)To use the pretrained weights, place them under:
./sar_clip/model_configs/{MODEL_NAME}/
All released data are intended for non-commercial research and educational purposes only.
2nxm)quh2)Dataset structure:
SARCAP/
βββ img/ # SAR image patches
βββ img_caption.csv # Image-text pairs
To use the zero-shot examples, place them under:
./data/zero-shot/
If you use SARCLIP, please cite:
@misc{SARCLIP2025,
author = {CAESAR-Radi},
title = {SARCLIP: A Multimodal Foundation Framework for SAR Imagery via Contrastive Language-Image Pre-Training},
year = {2025},
publisher = {GitHub},
url = {https://github.com/CAESAR-Radi/SARCLIP}
}
We thank the following organizations for providing datasets and inspiration:
Special thanks to the OpenCLIP team for their significant contributions.
13 commits