Add model card: VICReg joint embedding with honest negative results
Browse files
README.md
CHANGED
|
@@ -1,121 +1,117 @@
|
|
| 1 |
---
|
| 2 |
-
language: en
|
| 3 |
license: apache-2.0
|
| 4 |
tags:
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
pipeline_tag: tabular-regression
|
| 16 |
---
|
| 17 |
|
| 18 |
# TARA-WorldModel-VICReg
|
| 19 |
|
| 20 |
-
Joint environment
|
| 21 |
|
| 22 |
## Model Description
|
| 23 |
|
| 24 |
-
The World Model learns a shared latent space that aligns environmental context (satellite-derived variables) with microalgal protein domain composition (Pfam module abundances), then predicts marine productivity (chlorophyll-a, POC, NFLH) from the joint embedding.
|
| 25 |
-
|
| 26 |
### Architecture
|
|
|
|
| 27 |
|
| 28 |
```
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
├→ VICReg loss
|
| 32 |
-
pfam (20 dims) → EncoderP(256 → 128 → 32) → z_pfam
|
| 33 |
-
└→ Predictor(64 → 3) → productivity
|
| 34 |
-
|
| 35 |
-
Inference (environment-only):
|
| 36 |
-
env → EncoderE → z_env → Predictor → [chl-a, POC, NFLH]
|
| 37 |
```
|
| 38 |
|
| 39 |
-
- **
|
| 40 |
-
- **
|
| 41 |
-
- **
|
| 42 |
-
- **
|
| 43 |
-
|
| 44 |
-
### VICReg Loss
|
| 45 |
|
| 46 |
-
|
| 47 |
-
- **
|
| 48 |
-
- **
|
| 49 |
-
- **
|
| 50 |
-
- **Prediction**: MSE on productivity targets (α=1)
|
| 51 |
|
| 52 |
## Performance
|
| 53 |
|
| 54 |
-
|
|
|
|
|
|
|
| 55 |
|
| 56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
-
|
| 59 |
|
| 60 |
-
|
| 61 |
-
- `world_model_fold_*_20260127_110243.pt` — Initial configuration (latent_dim=16)
|
| 62 |
-
- `world_model_fold_*_20260127_111754.pt` — Best configuration from hyperparameter sweep (latent_dim=32)
|
| 63 |
|
| 64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
-
|
| 67 |
|
| 68 |
-
|
| 69 |
|
| 70 |
-
|
| 71 |
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
| λ_variance | 25.0 |
|
| 78 |
-
| λ_covariance | 1.0 |
|
| 79 |
-
| pred_alpha | 1.0 |
|
| 80 |
-
| learning_rate | 0.001 |
|
| 81 |
-
| weight_decay | 1e-4 |
|
| 82 |
-
| batch_size | 128 |
|
| 83 |
-
| max_epochs | 300 |
|
| 84 |
-
| patience | 30 |
|
| 85 |
-
| grad_clip | 1.0 |
|
| 86 |
|
| 87 |
## Usage
|
| 88 |
|
| 89 |
```python
|
| 90 |
import torch
|
| 91 |
|
| 92 |
-
# Load
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
|
|
|
|
|
|
| 97 |
```
|
| 98 |
|
| 99 |
-
##
|
| 100 |
|
| 101 |
-
-
|
| 102 |
-
-
|
| 103 |
-
- **20 Pfam module features** (aggregated from 9,466 domains via co-occurrence clustering)
|
| 104 |
-
- **3 productivity targets** (chlorophyll-a, POC, NFLH)
|
| 105 |
-
- **Spatial cross-validation**: Leave-one-basin-out (6 ocean basins)
|
| 106 |
|
| 107 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
- [GreenGenomicsLab/TARA-XGBoost-Bidirectional](https://huggingface.co/GreenGenomicsLab/TARA-XGBoost-Bidirectional) — XGBoost bidirectional models
|
| 113 |
|
| 114 |
## Citation
|
| 115 |
|
| 116 |
-
|
| 117 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
|
| 119 |
-
##
|
| 120 |
|
| 121 |
-
|
|
|
|
| 1 |
---
|
|
|
|
| 2 |
license: apache-2.0
|
| 3 |
tags:
|
| 4 |
+
- self-supervised-learning
|
| 5 |
+
- vicreg
|
| 6 |
+
- joint-embedding
|
| 7 |
+
- marine-biology
|
| 8 |
+
- metagenomics
|
| 9 |
+
- environmental-modeling
|
| 10 |
+
- protein-domains
|
| 11 |
+
- tara-oceans
|
| 12 |
+
- pfam
|
| 13 |
+
- pytorch
|
| 14 |
pipeline_tag: tabular-regression
|
| 15 |
---
|
| 16 |
|
| 17 |
# TARA-WorldModel-VICReg
|
| 18 |
|
| 19 |
+
Joint environment–proteome embedding model using VICReg (Variance-Invariance-Covariance Regularization) self-supervised learning, applied to the TARA Oceans metagenomic dataset. This model aligns environmental and Pfam protein domain representations in a shared latent space.
|
| 20 |
|
| 21 |
## Model Description
|
| 22 |
|
|
|
|
|
|
|
| 23 |
### Architecture
|
| 24 |
+
Two-layer MLP encoder with VICReg alignment loss:
|
| 25 |
|
| 26 |
```
|
| 27 |
+
Environment branch: Input(env_dim) → Linear(hidden) → ReLU → Dropout(0.3) → Linear(32)
|
| 28 |
+
PFAM branch: Input(pfam_dim) → Linear(hidden) → ReLU → Dropout(0.3) → Linear(32)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
```
|
| 30 |
|
| 31 |
+
- **Latent dimension:** 32
|
| 32 |
+
- **Parameters:** ~53K–64K depending on PFAM input dimensionality
|
| 33 |
+
- **VICReg loss weights:** variance = 25.0, invariance = 25.0, covariance = 1.0
|
| 34 |
+
- **Prediction head alpha:** 1.0
|
|
|
|
|
|
|
| 35 |
|
| 36 |
+
### Training Data
|
| 37 |
+
- **Source:** 1,151 samples with complete productivity data (chlorophyll-a, POC, NFLH) from 1,810 total TARA Oceans samples
|
| 38 |
+
- **Environmental features:** Google Earth Engine oceanographic variables
|
| 39 |
+
- **PFAM features:** CLR-transformed domain abundances reduced via PCA to 20, 32, or 64 dimensions
|
|
|
|
| 40 |
|
| 41 |
## Performance
|
| 42 |
|
| 43 |
+
This model represents an exploratory methodological approach that did not outperform the primary XGBoost bidirectional framework used in the ELF-NET study. Results are reported for transparency and reproducibility.
|
| 44 |
+
|
| 45 |
+
### 6-Fold Leave-One-Basin-Out (LOBO) CV
|
| 46 |
|
| 47 |
+
| Target | Joint Model R² | Env-Only Baseline R² | Cohen's d | p-value |
|
| 48 |
+
|--------|----------------|----------------------|-----------|---------|
|
| 49 |
+
| POC | 0.532 | 0.422 | 0.026 | 0.38 |
|
| 50 |
+
| Chl-a | 0.516 | 0.561 | — | — |
|
| 51 |
+
| NFLH | 0.560 | 0.700 | — | — |
|
| 52 |
|
| 53 |
+
The POC improvement (+0.110 R²) was not statistically significant.
|
| 54 |
|
| 55 |
+
### 9-Fold Spatial Block CV (matching primary XGBoost design)
|
|
|
|
|
|
|
| 56 |
|
| 57 |
+
| PFAM dim | XGB Baseline R² | VICReg R² | ΔR² |
|
| 58 |
+
|----------|-----------------|-----------|-----|
|
| 59 |
+
| pfam20 | 0.417 | −2.045 | −2.462 |
|
| 60 |
+
| pfam32 | 0.417 | −4.217 | −4.634 |
|
| 61 |
+
| pfam64 | 0.417 | −1.262 | −1.679 |
|
| 62 |
|
| 63 |
+
The MLP architecture produced catastrophically negative R² on spatially distinctive held-out basins (Mediterranean, mid-Pacific), where distribution shift defeats shallow neural networks. XGBoost's tree-based partitioning handles this regime far more effectively at N ≈ 1,100.
|
| 64 |
|
| 65 |
+
### Interpretation
|
| 66 |
|
| 67 |
+
The poor performance under spatial CV is driven by the **architecture confound** (MLP vs. XGBoost for small tabular data), not necessarily by absence of the PFAM alignment signal. A fair comparison would require XGBoost-with-VICReg-embeddings, which was not evaluated. The XGBoost bidirectional framework was retained as the primary modeling approach.
|
| 68 |
|
| 69 |
+
## Repository Contents
|
| 70 |
+
|
| 71 |
+
- Model checkpoints (`.pt` files) for each fold and PFAM dimensionality
|
| 72 |
+
- Hyperparameter sweep results
|
| 73 |
+
- Per-fold training curves and metrics
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
## Usage
|
| 76 |
|
| 77 |
```python
|
| 78 |
import torch
|
| 79 |
|
| 80 |
+
# Load a VICReg checkpoint
|
| 81 |
+
checkpoint = torch.load(
|
| 82 |
+
"path/to/vicreg_checkpoint.pt",
|
| 83 |
+
map_location="cpu",
|
| 84 |
+
weights_only=False
|
| 85 |
+
)
|
| 86 |
+
state_dict = checkpoint["model_state_dict"]
|
| 87 |
```
|
| 88 |
|
| 89 |
+
## Related Models
|
| 90 |
|
| 91 |
+
- [TARA-XGBoost-Bidirectional](https://huggingface.co/GreenGenomicsLab/TARA-XGBoost-Bidirectional) — Primary bidirectional models used in the ELF-NET study
|
| 92 |
+
- [algaGPT](https://huggingface.co/GreenGenomicsLab/algaGPT) — Protein classification model used for proteome extraction
|
|
|
|
|
|
|
|
|
|
| 93 |
|
| 94 |
+
## References
|
| 95 |
+
|
| 96 |
+
- Bardes, A., Ponce, J., & LeCun, Y. (2022). VICReg: Variance-Invariance-Covariance Regularization for Self-Supervised Learning. *ICLR 2022*.
|
| 97 |
+
|
| 98 |
+
## Authors
|
| 99 |
|
| 100 |
+
David R. Nelson, Kourosh Salehi-Ashtiani
|
| 101 |
+
|
| 102 |
+
Green Genomics Lab, New York University Abu Dhabi
|
|
|
|
| 103 |
|
| 104 |
## Citation
|
| 105 |
|
| 106 |
+
```bibtex
|
| 107 |
+
@article{elfnet2026,
|
| 108 |
+
title={ELF-NET: Environment-Linked Functional Network for marine microalgal domain-environment coupling},
|
| 109 |
+
author={Nelson, David R. and Salehi-Ashtiani, Kourosh},
|
| 110 |
+
journal={Forthcoming},
|
| 111 |
+
year={2026}
|
| 112 |
+
}
|
| 113 |
+
```
|
| 114 |
|
| 115 |
+
## Contact
|
| 116 |
|
| 117 |
+
Kourosh Salehi-Ashtiani — ksa3@nyu.edu
|