GreenGenomicsLab commited on
Commit
6c3dc73
·
verified ·
1 Parent(s): 3167609

Add model card: VICReg joint embedding with honest negative results

Browse files
Files changed (1) hide show
  1. README.md +73 -77
README.md CHANGED
@@ -1,121 +1,117 @@
1
  ---
2
- language: en
3
  license: apache-2.0
4
  tags:
5
- - marine-biology
6
- - metagenomics
7
- - environmental-modeling
8
- - protein-domains
9
- - tara-oceans
10
- - vicreg
11
- - joint-embedding
12
- - self-supervised-learning
13
- - pytorch
14
- library_name: pytorch
15
  pipeline_tag: tabular-regression
16
  ---
17
 
18
  # TARA-WorldModel-VICReg
19
 
20
- Joint environment--genome embedding model for marine ecosystem productivity prediction, trained with Variance-Invariance-Covariance Regularization (VICReg) on TARA Oceans data.
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
- Training:
30
- env (24 dims) → EncoderE(12832)z_env ─┐
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
- - **EncoderE**: Linear(24→128) + BN + ReLU + Dropout(0.3) → Linear(128→32) + BN + ReLU + Dropout(0.3)
40
- - **EncoderP**: Linear(20→256) + BN + ReLU + Dropout(0.3) → Linear(256→128) + BN + ReLU + Dropout(0.3) → Linear(128→32) + BN + ReLU + Dropout(0.3)
41
- - **Predictor**: Linear(32→64) + ReLU Linear(64→3)
42
- - **Total parameters**: 53,187
43
-
44
- ### VICReg Loss
45
 
46
- Non-contrastive self-supervised alignment (Bardes et al., ICLR 2022):
47
- - **Invariance**: MSE between co-located env/pfam embeddings (λ=25)
48
- - **Variance**: Hinge loss preventing embedding collapse (λ=25)
49
- - **Covariance**: Off-diagonal penalty decorrelating dimensions (λ=1)
50
- - **Prediction**: MSE on productivity targets (α=1)
51
 
52
  ## Performance
53
 
54
- Joint embedding improves POC prediction (R² 0.422 0.532, 26% relative improvement) over environment-only baseline. Chlorophyll-a and NFLH are better predicted by environment alone (directly satellite-measured).
 
 
55
 
56
- ## Files
 
 
 
 
57
 
58
- ### Fold Checkpoints (leave-one-basin-out spatial CV)
59
 
60
- Two training runs are provided:
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
- Six folds per run: Arctic, Atlantic, Indian, Mediterranean, Pacific, Southern.
 
 
 
 
65
 
66
- ### Configuration
67
 
68
- - `phase2_best_config.json` — Hyperparameter sweep results (54 configurations, 3 seeds each)
69
 
70
- ## Hyperparameters (Best Config)
71
 
72
- | Parameter | Value |
73
- |-----------|-------|
74
- | latent_dim | 32 |
75
- | dropout | 0.3 |
76
- | λ_invariance | 25.0 |
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 fold checkpoint
93
- ckpt = torch.load("world_model_fold_Atlantic_20260127_111754.pt", map_location="cpu")
94
-
95
- # ckpt contains model_state_dict for the full WorldModel
96
- # Requires WorldModel class from the training codebase
 
 
97
  ```
98
 
99
- ## Dataset
100
 
101
- - **1,810 ocean samples** with co-located environment and Pfam profiles
102
- - **24 environmental variables** (GEE oceanographic/atmospheric)
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
- ## Related Models
 
 
 
 
108
 
109
- - [GreenGenomicsLab/algaGPT](https://huggingface.co/GreenGenomicsLab/algaGPT) AlgaGPT protein classification
110
- - [GreenGenomicsLab/LA4SR-Pythia70m-b-ckpt-55000](https://huggingface.co/GreenGenomicsLab/LA4SR-Pythia70m-b-ckpt-55000) — LA4SR-Pythia classification
111
- - [GreenGenomicsLab/TARA-ELF-NET](https://huggingface.co/GreenGenomicsLab/TARA-ELF-NET) Deep bidirectional env↔pfam models
112
- - [GreenGenomicsLab/TARA-XGBoost-Bidirectional](https://huggingface.co/GreenGenomicsLab/TARA-XGBoost-Bidirectional) — XGBoost bidirectional models
113
 
114
  ## Citation
115
 
116
- LA4SR classification models:
117
- > Nelson DR, Jaiswal AK, Ismail NS, Mystikou A, Salehi-Ashtiani K. *Patterns*. 2024;6(11).
 
 
 
 
 
 
118
 
119
- ## License
120
 
121
- Apache 2.0
 
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)ReLUDropout(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 ) was not statistically significant.
54
 
55
+ ### 9-Fold Spatial Block CV (matching primary XGBoost design)
 
 
56
 
57
+ | PFAM dim | XGB Baseline | 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