|
|
--- |
|
|
license: apache-2.0 |
|
|
tags: |
|
|
- vision-transformer |
|
|
- image-classification |
|
|
- pytorch |
|
|
- timm |
|
|
- cvt |
|
|
- gravitational-lensing |
|
|
- strong-lensing |
|
|
- astronomy |
|
|
- astrophysics |
|
|
datasets: |
|
|
- parlange/gravit-c21 |
|
|
metrics: |
|
|
- accuracy |
|
|
- auc |
|
|
- f1 |
|
|
paper: |
|
|
- title: "GraViT: A Gravitational Lens Discovery Toolkit with Vision Transformers" |
|
|
url: "https://arxiv.org/abs/2509.00226" |
|
|
authors: "Parlange et al." |
|
|
model-index: |
|
|
- name: CvT-a1 |
|
|
results: |
|
|
- task: |
|
|
type: image-classification |
|
|
name: Strong Gravitational Lens Discovery |
|
|
dataset: |
|
|
type: common-test-sample |
|
|
name: Common Test Sample (More et al. 2024) |
|
|
metrics: |
|
|
- type: accuracy |
|
|
value: 0.7219 |
|
|
name: Average Accuracy |
|
|
- type: auc |
|
|
value: 0.7334 |
|
|
name: Average AUC-ROC |
|
|
- type: f1 |
|
|
value: 0.4108 |
|
|
name: Average F1-Score |
|
|
--- |
|
|
|
|
|
# ๐ cvt-gravit-a1 |
|
|
|
|
|
๐ญ This model is part of **GraViT**: Transfer Learning with Vision Transformers and MLP-Mixer for Strong Gravitational Lens Discovery |
|
|
|
|
|
๐ **GitHub Repository**: [https://github.com/parlange/gravit](https://github.com/parlange/gravit) |
|
|
|
|
|
## ๐ฐ๏ธ Model Details |
|
|
|
|
|
- **๐ค Model Type**: CvT |
|
|
- **๐งช Experiment**: A1 - C21-classification-head |
|
|
- **๐ Dataset**: C21 |
|
|
- **๐ช Fine-tuning Strategy**: classification-head |
|
|
|
|
|
|
|
|
|
|
|
## ๐ป Quick Start |
|
|
|
|
|
```python |
|
|
import torch |
|
|
import timm |
|
|
|
|
|
# Load the model directly from the Hub |
|
|
model = timm.create_model( |
|
|
'hf-hub:parlange/cvt-gravit-a1', |
|
|
pretrained=True |
|
|
) |
|
|
model.eval() |
|
|
|
|
|
# Example inference |
|
|
dummy_input = torch.randn(1, 3, 224, 224) |
|
|
with torch.no_grad(): |
|
|
output = model(dummy_input) |
|
|
predictions = torch.softmax(output, dim=1) |
|
|
print(f"Lens probability: {predictions[0][1]:.4f}") |
|
|
``` |
|
|
|
|
|
## โก๏ธ Training Configuration |
|
|
|
|
|
**Training Dataset:** C21 (Caรฑameras et al. 2021) |
|
|
**Fine-tuning Strategy:** classification-head |
|
|
|
|
|
|
|
|
| ๐ง Parameter | ๐ Value | |
|
|
|--------------|----------| |
|
|
| Batch Size | 192 | |
|
|
| Learning Rate | AdamW with ReduceLROnPlateau | |
|
|
| Epochs | 100 | |
|
|
| Patience | 10 | |
|
|
| Optimizer | AdamW | |
|
|
| Scheduler | ReduceLROnPlateau | |
|
|
| Image Size | 224x224 | |
|
|
| Fine Tune Mode | classification_head | |
|
|
| Stochastic Depth Probability | 0.1 | |
|
|
|
|
|
|
|
|
## ๐ Training Curves |
|
|
|
|
|
 |
|
|
|
|
|
|
|
|
## ๐ Final Epoch Training Metrics |
|
|
|
|
|
| Metric | Training | Validation | |
|
|
|:---------:|:-----------:|:-------------:| |
|
|
| ๐ Loss | 0.4446 | 0.4609 | |
|
|
| ๐ฏ Accuracy | 0.7622 | 0.7680 | |
|
|
| ๐ AUC-ROC | 0.8660 | 0.8842 | |
|
|
| โ๏ธ F1 Score | 0.7632 | 0.7929 | |
|
|
|
|
|
|
|
|
## โ๏ธ Evaluation Results |
|
|
|
|
|
### ROC Curves and Confusion Matrices |
|
|
|
|
|
Performance across all test datasets (a through l) in the Common Test Sample (More et al. 2024): |
|
|
|
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
|
|
|
### ๐ Performance Summary |
|
|
|
|
|
Average performance across 12 test datasets from the Common Test Sample (More et al. 2024): |
|
|
|
|
|
| Metric | Value | |
|
|
|-----------|----------| |
|
|
| ๐ฏ Average Accuracy | 0.7219 | |
|
|
| ๐ Average AUC-ROC | 0.7334 | |
|
|
| โ๏ธ Average F1-Score | 0.4108 | |
|
|
|
|
|
|
|
|
## ๐ Citation |
|
|
|
|
|
If you use this model in your research, please cite: |
|
|
|
|
|
```bibtex |
|
|
@misc{parlange2025gravit, |
|
|
title={GraViT: Transfer Learning with Vision Transformers and MLP-Mixer for Strong Gravitational Lens Discovery}, |
|
|
author={Renรฉ Parlange and Juan C. Cuevas-Tello and Octavio Valenzuela and Omar de J. Cabrera-Rosas and Tomรกs Verdugo and Anupreeta More and Anton T. Jaelani}, |
|
|
year={2025}, |
|
|
eprint={2509.00226}, |
|
|
archivePrefix={arXiv}, |
|
|
primaryClass={cs.CV}, |
|
|
url={https://arxiv.org/abs/2509.00226}, |
|
|
} |
|
|
``` |
|
|
|
|
|
--- |
|
|
|
|
|
|
|
|
## Model Card Contact |
|
|
|
|
|
For questions about this model, please contact the author through: https://github.com/parlange/ |
|
|
|