manumartinm commited on
Commit
34b3c3e
·
verified ·
1 Parent(s): c6b75cb

Upload BBB classifier (exp06_esm_tab_mlp_aug)

Browse files
README.md ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ tags:
4
+ - peptide
5
+ - blood-brain-barrier
6
+ - bbb
7
+ - classification
8
+ - esm
9
+ library_name: bbb-models
10
+ pipeline_tag: text-classification
11
+
12
+ base_model: manumartinm/bbb-classifier
13
+ ---
14
+
15
+ # BBB Classifier — `exp06_esm_tab_mlp_aug`
16
+
17
+ Sequence/tabular BBB permeability classifier for peptide candidates. Fuses ESM-2 embeddings with physicochemical descriptors and isotonic-calibrated probabilities.
18
+
19
+ ## Model summary
20
+
21
+ | Field | Value |
22
+ |-------|-------|
23
+ | Experiment | `exp06_esm_tab_mlp_aug` |
24
+ | Architecture | `esm_tab_mlp` |
25
+ | ESM dim | `128` |
26
+ | Hidden dim | `256` |
27
+ | PR-AUC (calibrated) | `0.906775452423001` |
28
+ | ROC-AUC (calibrated) | `0.9185328185328185` |
29
+ | MCC (calibrated) | `0.6435046074523986` |
30
+
31
+ ## Files
32
+
33
+ - `checkpoints/best.ckpt` — PyTorch weights
34
+ - `calibrators/calibrator.pkl` — isotonic calibration
35
+ - `train_metadata.json` — experiment + data config for inference
36
+ - `metrics.json` — validation metrics
37
+
38
+ ## Usage
39
+
40
+ Install the project and download this repo:
41
+
42
+ ```bash
43
+ git clone https://github.com/your-org/TFG.git
44
+ cd TFG/bbb_models && uv sync
45
+ hf download manumartinm/bbb-classifier --local-dir ./bbb-classifier
46
+ ```
47
+
48
+ Score candidates (input must include sequence + tabular descriptor columns used at training time):
49
+
50
+ ```bash
51
+ uv run python scripts/classifier/predict.py \
52
+ --run-dir ./bbb-classifier \
53
+ --input candidates.parquet \
54
+ --output scored.parquet
55
+ ```
56
+
57
+ ## Dataset
58
+
59
+ Trained on the TFG BBB peptide dataset. Companion dataset: [`manumartinm/bbb-peptides`](https://huggingface.co/datasets/manumartinm/bbb-peptides).
60
+
61
+ ## Citation
62
+
63
+ If you use this model, cite the TFG BBB peptide modeling pipeline.
calibrators/calibrator.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2a59f4633d4aa2d83a1dc5d5400b13323a1ee24e3981bd4aacc4b98964b4ba62
3
+ size 704
checkpoints/best.ckpt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4a1dce08cc4782397df42a192527a7b33a906c0164416c3880e335518ab9e185
3
+ size 1838017
export_stats.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "kind": "classifier",
3
+ "run_dir": "/Users/manumartinm/Documents/ProteinDesign/TFG/bbb_models/artifacts/models/exp06_esm_tab_mlp_aug",
4
+ "output_dir": "/Users/manumartinm/Documents/ProteinDesign/TFG/bbb_models/artifacts/hf_release/bbb-classifier",
5
+ "run_name": "exp06_esm_tab_mlp_aug",
6
+ "model_type": "esm_tab_mlp",
7
+ "files": [
8
+ "checkpoints/best.ckpt",
9
+ "calibrators/calibrator.pkl",
10
+ "train_metadata.json",
11
+ "metrics.json",
12
+ "README.md"
13
+ ],
14
+ "repo_id": "manumartinm/bbb-classifier"
15
+ }
metrics.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "calibrated": {
3
+ "brier": 0.1134513631011226,
4
+ "ece": 5.7948960259975495e-09,
5
+ "mcc": 0.6435046074523986,
6
+ "pr_auc": 0.906775452423001,
7
+ "precision": 0.8666666666666667,
8
+ "roc_auc": 0.9185328185328185,
9
+ "sensitivity": 0.7428571428571429
10
+ },
11
+ "model_type": "esm_tab_mlp",
12
+ "raw": {
13
+ "brier": 0.13664215418462355,
14
+ "ece": 0.06837135491271813,
15
+ "mcc": 0.6435046074523986,
16
+ "pr_auc": 0.9094165678023901,
17
+ "precision": 0.8666666666666667,
18
+ "roc_auc": 0.8965250965250965,
19
+ "sensitivity": 0.7428571428571429
20
+ },
21
+ "run_name": "exp06_esm_tab_mlp_aug"
22
+ }
train_metadata.json ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "data_cfg": {
3
+ "dataset_path": "../dataset/data/processed/peptides_bbb_with_augmentation.parquet",
4
+ "fold_col": "fold_id",
5
+ "id_col": "peptide_id",
6
+ "label_col": "bbb_label",
7
+ "random_state": 42,
8
+ "sequence_col": "sequence",
9
+ "struct_manifest_path": "../dataset/data/processed/peptides_struct_manifest.parquet",
10
+ "tabular_exclude": [
11
+ "peptide_id",
12
+ "sequence",
13
+ "bbb_label",
14
+ "split",
15
+ "source_split",
16
+ "source_db",
17
+ "label_tier",
18
+ "is_gold",
19
+ "cluster_id",
20
+ "external_test",
21
+ "source_id",
22
+ "assay_method",
23
+ "reference",
24
+ "organism",
25
+ "fold_id",
26
+ "is_augmented",
27
+ "parent_peptide_id",
28
+ "sample_weight"
29
+ ],
30
+ "test_size": 0.2,
31
+ "three_d_columns": []
32
+ },
33
+ "exp_cfg": {
34
+ "esm": {
35
+ "cache_dir": "artifacts/cache/esm2"
36
+ },
37
+ "features": {
38
+ "use_3d": false,
39
+ "use_esm": true,
40
+ "use_gnn": false,
41
+ "use_tabular": true
42
+ },
43
+ "mixup": {
44
+ "alpha": 0.2,
45
+ "enabled": true,
46
+ "prob": 0.5
47
+ },
48
+ "model": {
49
+ "dropout": 0.2,
50
+ "esm_dim": 128,
51
+ "hidden_dim": 256
52
+ },
53
+ "model_type": "esm_tab_mlp",
54
+ "name": "exp06_esm_tab_mlp_aug"
55
+ },
56
+ "tab_cols": [
57
+ "length",
58
+ "mw",
59
+ "ext_coef_reduced",
60
+ "ext_coef_oxidized",
61
+ "hydrophobic_ratio_pct",
62
+ "pi",
63
+ "net_charge_ph7",
64
+ "total_charge",
65
+ "mean_hydrophobicity",
66
+ "hydrophobicity_ph7",
67
+ "hydrophilic_ratio",
68
+ "aliphatic_index",
69
+ "boman_index",
70
+ "aromaticity",
71
+ "instability_index",
72
+ "gravy",
73
+ "charge_density",
74
+ "aa_basic_pct",
75
+ "aa_acidic_pct",
76
+ "aa_aromatic_pct",
77
+ "aa_hydrophobic_pct",
78
+ "aa_polar_pct",
79
+ "hydrophobic_moment",
80
+ "mw_pyteomics",
81
+ "mw_delta_abs"
82
+ ],
83
+ "train_cfg": {
84
+ "calibration": {
85
+ "enabled": true,
86
+ "method": "isotonic"
87
+ },
88
+ "maximize_metric": true,
89
+ "output": {
90
+ "keep_top_k": 1,
91
+ "root": "artifacts",
92
+ "save_periodic_every": 5
93
+ },
94
+ "primary_metric": "pr_auc",
95
+ "run_name": "default",
96
+ "secondary_metric": "mcc",
97
+ "seed": 42,
98
+ "tracking": {
99
+ "mlflow": true,
100
+ "mlflow_experiment": "bbb_classifier",
101
+ "tensorboard": true
102
+ },
103
+ "training": {
104
+ "batch_size": 128,
105
+ "epochs": 50,
106
+ "eval_every": 1,
107
+ "grad_clip": 1.0,
108
+ "log_every": 5,
109
+ "lr": 0.001,
110
+ "num_workers": 4,
111
+ "patience": 8,
112
+ "weight_decay": 0.0001
113
+ }
114
+ }
115
+ }