Update README.md
Browse files
README.md
CHANGED
|
@@ -1,204 +1,218 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
-
|
| 38 |
-
-
|
| 39 |
-
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
-
|
| 43 |
-
- VAE
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
#
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
)
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
#
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
#
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
#
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
#
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
pipeline_tag: tabular-regression
|
| 6 |
+
tags:
|
| 7 |
+
- VAE
|
| 8 |
+
- bioinformatics
|
| 9 |
+
- TCGA
|
| 10 |
+
- ccRCC
|
| 11 |
+
- KIRC
|
| 12 |
+
- cancer
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
# Pretrained Models
|
| 17 |
+
|
| 18 |
+
This directory contains pretrained VAE and reconstruction network models obtained during the WP3 of the EVENFLOW EU project.
|
| 19 |
+
|
| 20 |
+
These models have been trained on a pre-processed version of the bulk RNA-Seq TCGA datasets of either KIRC or BRCA, independently (see data availability in the respective section).
|
| 21 |
+
|
| 22 |
+
## Available Models
|
| 23 |
+
|
| 24 |
+
### KIRC (Kidney Renal Clear Cell Carcinoma)
|
| 25 |
+
|
| 26 |
+
**Location**: `KIRC/`
|
| 27 |
+
|
| 28 |
+
*Data availability:* [Zenodo](https://doi.org/10.5281/zenodo.17987300)
|
| 29 |
+
|
| 30 |
+
**Model Files**:
|
| 31 |
+
- `20250321_VAE_idim8516_md512_feat256mse_relu.pth` - VAE weights
|
| 32 |
+
- `network_reconstruction.pth` - Reconstruction network weights
|
| 33 |
+
- `network_dims.csv` - Network architecture specifications
|
| 34 |
+
|
| 35 |
+
**Model Specifications**:
|
| 36 |
+
- Input dimension: 8,516 genes
|
| 37 |
+
- VAE architecture:
|
| 38 |
+
- Middle dimension: 512
|
| 39 |
+
- Latent dimension: 256
|
| 40 |
+
- Loss function: MSE
|
| 41 |
+
- Activation: ReLU
|
| 42 |
+
- Reconstruction network: [8954, 3512, 824, 3731, 8954]
|
| 43 |
+
- Training: Beta-VAE with 3 cycles, 600 epochs total
|
| 44 |
+
|
| 45 |
+
### BRCA (Breast Invasive Carcinoma)
|
| 46 |
+
|
| 47 |
+
**Location**: `BRCA/`
|
| 48 |
+
|
| 49 |
+
*Data availability:* [Zenodo](https://doi.org/10.5281/zenodo.17986123)
|
| 50 |
+
|
| 51 |
+
**Model Files**:
|
| 52 |
+
- `20251209_VAE_idim8954_md1024_feat512mse_relu.pth` - VAE weights
|
| 53 |
+
- `network_reconstruction.pth` - Reconstruction network weights
|
| 54 |
+
- `network_dims.csv` - Network architecture specifications
|
| 55 |
+
|
| 56 |
+
**Model Specifications**:
|
| 57 |
+
- Input dimension: 8,954 genes
|
| 58 |
+
- VAE architecture:
|
| 59 |
+
- Middle dimension: 1,024
|
| 60 |
+
- Latent dimension: 512
|
| 61 |
+
- Loss function: MSE
|
| 62 |
+
- Activation: ReLU
|
| 63 |
+
- Reconstruction network: [8954, 3104, 790, 4027, 8954]
|
| 64 |
+
- Training: Beta-VAE with 3 cycles, 600 epochs total
|
| 65 |
+
|
| 66 |
+
## Usage
|
| 67 |
+
|
| 68 |
+
### Loading Models in Python
|
| 69 |
+
|
| 70 |
+
See [renalprog](https://www.github.com/gprolcastelo/renalprog) for the needed VAE and NetworkReconstruction objects.
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
```python
|
| 74 |
+
import torch
|
| 75 |
+
import pandas as pd
|
| 76 |
+
import json
|
| 77 |
+
from pathlib import Path
|
| 78 |
+
import huggingface_hub as hf
|
| 79 |
+
from renalprog.modeling.train import VAE, NetworkReconstruction
|
| 80 |
+
|
| 81 |
+
# Configuration
|
| 82 |
+
cancer_type = "KIRC" # or "BRCA"
|
| 83 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 84 |
+
|
| 85 |
+
# ============================================================================
|
| 86 |
+
# Load VAE Model
|
| 87 |
+
# ============================================================================
|
| 88 |
+
|
| 89 |
+
# Download VAE config
|
| 90 |
+
vae_config_path = hf.hf_hub_download(
|
| 91 |
+
repo_id="gprolcastelo/evenflow_models",
|
| 92 |
+
filename=f"{cancer_type}/config.json"
|
| 93 |
+
)
|
| 94 |
+
|
| 95 |
+
# Load configuration
|
| 96 |
+
with open(vae_config_path, "r") as f:
|
| 97 |
+
vae_config = json.load(f)
|
| 98 |
+
|
| 99 |
+
print(f"VAE Configuration: {vae_config}")
|
| 100 |
+
|
| 101 |
+
# Download VAE model weights
|
| 102 |
+
if cancer_type == "KIRC":
|
| 103 |
+
vae_filename = "KIRC/20250321_VAE_idim8516_md512_feat256mse_relu.pth"
|
| 104 |
+
elif cancer_type == "BRCA":
|
| 105 |
+
vae_filename = "BRCA/20251209_VAE_idim8954_md1024_feat512mse_relu.pth"
|
| 106 |
+
else:
|
| 107 |
+
raise ValueError(f"Unknown cancer type: {cancer_type}")
|
| 108 |
+
|
| 109 |
+
vae_model_path = hf.hf_hub_download(
|
| 110 |
+
repo_id="gprolcastelo/evenflow_models",
|
| 111 |
+
filename=vae_filename
|
| 112 |
+
)
|
| 113 |
+
|
| 114 |
+
# Initialize and load VAE
|
| 115 |
+
model_vae = VAE(
|
| 116 |
+
input_dim=vae_config["INPUT_DIM"],
|
| 117 |
+
mid_dim=vae_config["MID_DIM"],
|
| 118 |
+
features=vae_config["LATENT_DIM"]
|
| 119 |
+
).to(device)
|
| 120 |
+
|
| 121 |
+
checkpoint_vae = torch.load(vae_model_path, map_location=device, weights_only=False)
|
| 122 |
+
model_vae.load_state_dict(checkpoint_vae)
|
| 123 |
+
model_vae.eval()
|
| 124 |
+
|
| 125 |
+
print(f"VAE model loaded successfully from {cancer_type}")
|
| 126 |
+
|
| 127 |
+
# ============================================================================
|
| 128 |
+
# Load Reconstruction Network
|
| 129 |
+
# ============================================================================
|
| 130 |
+
|
| 131 |
+
# Download network dimensions
|
| 132 |
+
network_dims_path = hf.hf_hub_download(
|
| 133 |
+
repo_id="gprolcastelo/evenflow_models",
|
| 134 |
+
filename=f"{cancer_type}/network_dims.csv"
|
| 135 |
+
)
|
| 136 |
+
|
| 137 |
+
# Load network dimensions
|
| 138 |
+
network_dims = pd.read_csv(network_dims_path)
|
| 139 |
+
layer_dims = network_dims.values.tolist()[0]
|
| 140 |
+
|
| 141 |
+
print(f"Reconstruction Network dimensions: {layer_dims}")
|
| 142 |
+
|
| 143 |
+
# Download reconstruction network weights
|
| 144 |
+
recnet_model_path = hf.hf_hub_download(
|
| 145 |
+
repo_id="gprolcastelo/evenflow_models",
|
| 146 |
+
filename=f"{cancer_type}/network_reconstruction.pth"
|
| 147 |
+
)
|
| 148 |
+
|
| 149 |
+
# Initialize and load Reconstruction Network
|
| 150 |
+
model_recnet = NetworkReconstruction(layer_dims=layer_dims).to(device)
|
| 151 |
+
checkpoint_recnet = torch.load(recnet_model_path, map_location=device, weights_only=False)
|
| 152 |
+
model_recnet.load_state_dict(checkpoint_recnet)
|
| 153 |
+
model_recnet.eval()
|
| 154 |
+
|
| 155 |
+
print(f"Reconstruction Network loaded successfully from {cancer_type}")
|
| 156 |
+
|
| 157 |
+
# ============================================================================
|
| 158 |
+
# Use the models
|
| 159 |
+
# ============================================================================
|
| 160 |
+
|
| 161 |
+
# Example: Apply VAE to your data
|
| 162 |
+
# your_data = torch.tensor(your_data_array).float().to(device)
|
| 163 |
+
# with torch.no_grad():
|
| 164 |
+
# vae_output = model_vae(your_data)
|
| 165 |
+
# recnet_output = model_recnet(vae_output)
|
| 166 |
+
|
| 167 |
+
```
|
| 168 |
+
|
| 169 |
+
## Citation
|
| 170 |
+
|
| 171 |
+
!!! warning "Warning"
|
| 172 |
+
This citation is temporary. It will be updated when a pre-print is released.
|
| 173 |
+
|
| 174 |
+
If you use these pretrained models, please cite:
|
| 175 |
+
|
| 176 |
+
```bibtex
|
| 177 |
+
@software{renalprog2024,
|
| 178 |
+
title = {RenalProg: A Deep Learning Framework for Kidney Cancer Progression Modeling},
|
| 179 |
+
author = {[Guillermo Prol-Castelo, Elina Syrri, Nikolaos Manginas, Vasileos Manginas, Nikos Katzouris, Davide Cirillo, George Paliouras, Alfonso Valencia]},
|
| 180 |
+
year = {2025},
|
| 181 |
+
url = {https://github.com/gprolcas/renalprog},
|
| 182 |
+
note = {Preprint in preparation}
|
| 183 |
+
}
|
| 184 |
+
```
|
| 185 |
+
|
| 186 |
+
## Training Details
|
| 187 |
+
|
| 188 |
+
These models were trained using:
|
| 189 |
+
- Random seed: 2023
|
| 190 |
+
- Train/test split: 80/20
|
| 191 |
+
- Optimizer: Adam
|
| 192 |
+
- Learning rate: 1e-4
|
| 193 |
+
- Batch size: 8
|
| 194 |
+
- Beta annealing (for VAE): 3 cycles with 0.5 ratio
|
| 195 |
+
|
| 196 |
+
## Model Performance
|
| 197 |
+
|
| 198 |
+
**KIRC Model**:
|
| 199 |
+
- Reconstruction loss (test): ~1.1
|
| 200 |
+
|
| 201 |
+
**BRCA Model**:
|
| 202 |
+
- Reconstruction loss (test): ~0.9
|
| 203 |
+
|
| 204 |
+
## License
|
| 205 |
+
|
| 206 |
+
These pretrained models are provided under the same Apache 2.0 license.
|
| 207 |
+
|
| 208 |
+
## Contact
|
| 209 |
+
|
| 210 |
+
For questions about the pretrained models, please:
|
| 211 |
+
1. Check the [documentation](https://gprolcastelo.github.io/renalprog/)
|
| 212 |
+
2. Open an issue on [GitHub](https://github.com/gprolcastelo/renalprog/issues)
|
| 213 |
+
3. Contact the authors
|
| 214 |
+
|
| 215 |
+
---
|
| 216 |
+
|
| 217 |
+
**Last Updated**: December 2025
|
| 218 |
+
**Version**: 1.0.0-alpha
|