Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,110 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- vision
|
| 5 |
+
- image-classification
|
| 6 |
+
- remote-sensing
|
| 7 |
+
- lora
|
| 8 |
+
- peft
|
| 9 |
+
- domain-adaptation
|
| 10 |
+
- vision-transformer
|
| 11 |
+
- continual-learning
|
| 12 |
+
datasets:
|
| 13 |
+
- fmow
|
| 14 |
+
- sentinel-2
|
| 15 |
+
pipeline_tag: image-classification
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# ExPLoRA: Parameter-Efficient Extended Pre-Training
|
| 19 |
+
|
| 20 |
+
**[Paper](https://arxiv.org/abs/2406.10973)** | **[Code](https://github.com/samar-khanna/ExPLoRA)** | **[Website](https://samar-khanna.github.io/ExPLoRA/)** | **[Video](https://slideslive.com/39039614)**
|
| 21 |
+
|
| 22 |
+
This repository contains pre-trained checkpoints from the ICML 2025 paper:
|
| 23 |
+
_"ExPLoRA: Parameter-Efficient Extended Pre-Training to Adapt Vision Transformers under Domain Shifts"_
|
| 24 |
+
|
| 25 |
+
## Overview
|
| 26 |
+
|
| 27 |
+
ExPLoRA is a parameter-efficient method for adapting pre-trained Vision Transformers (ViT) to new domains using LoRA-based extended pre-training. Instead of training the full architecture, ExPLoRA freezes most of the backbone and trains low-rank adapters and a small subset of ViT blocks during self-supervised pre-training on target domain data.
|
| 28 |
+
|
| 29 |
+
<p align="center">
|
| 30 |
+
<img src="https://samar-khanna.github.io/ExPLoRA/static/images/explora_arch.svg" width="600" style="background-color: white; padding: 10px; border-radius: 8px;"/>
|
| 31 |
+
</p>
|
| 32 |
+
|
| 33 |
+
---
|
| 34 |
+
|
| 35 |
+
## 📁 Checkpoints
|
| 36 |
+
|
| 37 |
+
> **Note:** All checkpoints have LoRA adapters **already merged** into the weights. The full checkpoints retain the separate `q_proj`, `k_proj`, `v_proj` layers (with merged LoRA) alongside the combined `qkv` weights for reference. The encoder-only checkpoints contain just the merged `qkv` weights, ready for downstream use.
|
| 38 |
+
|
| 39 |
+
### `explora_dinov2_fmow_rgb/`
|
| 40 |
+
|
| 41 |
+
ExPLoRA checkpoints using **DINOv2** self-supervised pre-training on fMoW high-resolution RGB satellite imagery.
|
| 42 |
+
|
| 43 |
+
| Description | ViT-B | ViT-L |
|
| 44 |
+
|-------------|:-----:|:-----:|
|
| 45 |
+
| DinoV2 teacher encoder & decoder weights + ExPLoRA adapters | [ViT-B/14](https://huggingface.co/samarkhanna/ExPLoRA/resolve/main/explora_dinov2_fmow_rgb/explora_dinov2_vit_base_fmow_rgb.pth) | [ViT-L/14](https://huggingface.co/samarkhanna/ExPLoRA/blob/main/explora_dinov2_fmow_rgb/explora_dinov2_vit_large_fmow_rgb.pth) |
|
| 46 |
+
| Encoder-only weights | [ViT-B/14](https://huggingface.co/samarkhanna/ExPLoRA/resolve/main/explora_dinov2_fmow_rgb/explora_dinov2_vit_base_fmow_rgb_encoder_only.pth) | [ViT-L/14](https://huggingface.co/samarkhanna/ExPLoRA/resolve/main/explora_dinov2_fmow_rgb/explora_dinov2_vit_large_fmow_rgb_encoder_only.pth) |
|
| 47 |
+
|
| 48 |
+
**Usage:**
|
| 49 |
+
```python
|
| 50 |
+
import torch
|
| 51 |
+
|
| 52 |
+
# Load encoder-only checkpoint (recommended for fine-tuning)
|
| 53 |
+
ckpt = torch.load("explora_dinov2_fmow_rgb/explora_dinov2_vit_large_fmow_rgb_encoder_only.pth", map_location="cpu")
|
| 54 |
+
state_dict = ckpt["model"]
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
### `explora_mae_multispectral/`
|
| 58 |
+
|
| 59 |
+
ExPLoRA checkpoints using **MAE** self-supervised pre-training on fMoW Sentinel-2 multispectral imagery.
|
| 60 |
+
|
| 61 |
+
| Description | ViT-L |
|
| 62 |
+
|-------------|:-----:|
|
| 63 |
+
| MAE encoder & decoder weights + ExPLoRA adapters | [ViT-L/16](https://huggingface.co/samarkhanna/ExPLoRA/resolve/main/explora_mae_multispectral/explora_mae_fmow_sentinel.pth) |
|
| 64 |
+
| Encoder-only weights | [ViT-L/16](https://huggingface.co/samarkhanna/ExPLoRA/resolve/main/explora_mae_multispectral/explora_mae_fmow_sentinel_encoder_only.pth) |
|
| 65 |
+
|
| 66 |
+
**Usage:**
|
| 67 |
+
```python
|
| 68 |
+
import torch
|
| 69 |
+
|
| 70 |
+
# Load encoder-only checkpoint (recommended for fine-tuning)
|
| 71 |
+
ckpt = torch.load("explora_mae_multispectral/explora_mae_fmow_sentinel_encoder_only.pth", map_location="cpu")
|
| 72 |
+
state_dict = ckpt["model"]
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
---
|
| 76 |
+
|
| 77 |
+
## Loading Checkpoints
|
| 78 |
+
|
| 79 |
+
These checkpoints are compatible with the [ExPLoRA codebase](https://github.com/samar-khanna/ExPLoRA).
|
| 80 |
+
|
| 81 |
+
For **fine-tuning**, use the `finetune/finetune.py` script:
|
| 82 |
+
```bash
|
| 83 |
+
python finetune/finetune.py \
|
| 84 |
+
--finetune path/to/explora_checkpoint.pth \
|
| 85 |
+
--model vit_large_patch16 \
|
| 86 |
+
--dataset_type rgb \
|
| 87 |
+
...
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
Reference scripts are also provided under `scripts/` in the codebase, and you can use these checkpoints there.
|
| 91 |
+
|
| 92 |
+
---
|
| 93 |
+
|
| 94 |
+
## Citation
|
| 95 |
+
|
| 96 |
+
If you find these checkpoints useful, please cite our paper:
|
| 97 |
+
|
| 98 |
+
```bibtex
|
| 99 |
+
@inproceedings{khanna2025explora,
|
| 100 |
+
title={Ex{PL}o{RA}: Parameter-Efficient Extended Pre-Training to Adapt Vision Transformers under Domain Shifts},
|
| 101 |
+
author={Samar Khanna and Medhanie Irgau and David B. Lobell and Stefano Ermon},
|
| 102 |
+
booktitle={Forty-second International Conference on Machine Learning},
|
| 103 |
+
year={2025},
|
| 104 |
+
url={https://openreview.net/forum?id=OtxLhobhwb}
|
| 105 |
+
}
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
## License
|
| 109 |
+
|
| 110 |
+
Apache 2.0
|