cpdong commited on
Commit
0b16d1e
·
verified ·
1 Parent(s): 5a94811

Upload StructEstimator model card

Browse files
Files changed (1) hide show
  1. README.md +131 -0
README.md ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ library_name: pytorch
4
+ pipeline_tag: token-classification
5
+ tags:
6
+ - biology
7
+ - protein
8
+ - secondary-structure
9
+ - conformer
10
+ - esm2
11
+ - netsurfp
12
+ - plddt
13
+ - alphafold2
14
+ - disorder
15
+ - solvent-accessibility
16
+ ---
17
+
18
+ # `StructEstimator`: Standalone Multi-Layer Frozen ESM2-650M + RoPE-Conformer Predictor
19
+
20
+ **`StructEstimator_esm2_650m.pth`** (`1.36 GiB`) is a **100% self-contained standalone checkpoint** bundling frozen **`ESM2-650M`** (`facebook/esm2_t33_650M_UR50D`, FP16 weights + config + 33-token vocabulary) together with a multi-layer **Multi-Scale `RoPE-Conformer` + Coupled Dual-Stream Decoder** (`39.03M` parameters) tapping frozen layers **`[18, 24, 30, 33]`**.
21
+
22
+ Given any FASTA file, it predicts **all 7 classical NetSurfP-3.0 structural features plus AlphaFold2 per-residue `pLDDT`** (50-bin HL-Gauss head) in a single alignment-free pass on GPU (~1.6–2.2 GB VRAM), Apple Silicon (`MPS`), or CPU (~3.0 GB RAM) — with **zero external ESM-2 downloads or MSA searches required**.
23
+
24
+ ---
25
+
26
+ ## Benchmark Performance
27
+
28
+ Trained on `10,337` PISCES `<25%` non-redundant crystal chains (`Train_HHblits.npz`) + `~67,800` `MMseqs2` **`35%` sequence-identity** clustered **AlphaFoldDB Swiss-Prot v6** structures (`78,109` unique training chains total, with selective `CB513 / TS115 / CASP12` secondary-structure decontamination).
29
+
30
+ ### 1. Crystal Structure Benchmarks vs. NetSurfP-2.0, NetSurfP-3.0 & `netsurfp3-esm2`
31
+
32
+ | Benchmark | Model | `Q3` (↑) | `Q8` (↑) | `RSA` $r$ (↑) | `Disorder` MCC (↑) | `Phi` MAE (↓) | `Psi` MAE (↓) |
33
+ | :--- | :--- | :---: | :---: | :---: | :---: | :---: | :---: |
34
+ | **`CB513`** | NetSurfP-2.0 *(HHblits MSA)* | 84.5% | 71.3% | 0.791 | – | 20.35° | 29.04° |
35
+ | | Official NetSurfP-3.0 *(ESM-1b)* | 84.6% | 71.1% | 0.793 | – | 20.22° | 29.25° |
36
+ | | `netsurfp3-esm2` *(CNNbLSTM)* | 88.25% | 77.14% | 0.8228 | – | 18.2° | 24.4° |
37
+ | | **`StructEstimator` *(RoPE-Conformer)*** | **88.51%** | **77.85%** | **0.8292** | – | **17.9°** | **23.8°** |
38
+ | **`TS115`** | NetSurfP-2.0 *(HHblits MSA)* | 84.9% | 74.0% | 0.771 | 0.624 | 17.40° | 26.80° |
39
+ | | Official NetSurfP-3.0 *(ESM-1b)* | 85.6% | 74.9% | 0.776 | 0.662 | 17.16° | 25.80° |
40
+ | | `netsurfp3-esm2` *(CNNbLSTM)* | 87.65% | 78.14% | 0.8001 | **0.6743** | 15.6° | 22.2° |
41
+ | | **`StructEstimator` *(RoPE-Conformer)*** | **88.20%** | **78.69%** | **0.8090** | 0.6740 | **15.3°** | **21.8°** |
42
+ | **`CASP12`** | NetSurfP-2.0 *(HHblits MSA)* | 81.0% | 69.9% | 0.728 | **0.653** | 20.90° | 32.80° |
43
+ | | Official NetSurfP-3.0 *(ESM-1b)* | 79.1% | 66.9% | 0.707 | 0.621 | 21.25° | 33.92° |
44
+ | | `netsurfp3-esm2` *(CNNbLSTM)* | 83.15% | 72.07% | 0.7421 | 0.6247 | 19.1° | **29.0°** |
45
+ | | **`StructEstimator` *(RoPE-Conformer)*** | **83.37%** | **72.17%** | **0.7538** | 0.6491 | **19.0°** | **29.0°** |
46
+
47
+ ### 2. AlphaFold2 v6 `pLDDT` Benchmarks
48
+
49
+ | Split | Regime | Model | Residue `pLDDT` $r$ (↑) | Protein `mean pLDDT` $r$ (↑) | `pLDDT` MAE (↓) | `>=70` Acc (↑) |
50
+ | :--- | :--- | :--- | :---: | :---: | :---: | :---: |
51
+ | **`afdb_plddt_test_unseen`** | `<35%` seq-id unseen families | `netsurfp3-esm2` | 0.9294 | 0.9301 | 5.72 | 93.0% |
52
+ | | | **`StructEstimator`** | **0.9358** | **0.9392** | **5.12** | **93.4%** |
53
+ | **`afdb_plddt_test_homologs`** | Non-rep Swiss-Prot homologs | `netsurfp3-esm2` | 0.9410 | 0.9553 | 5.01 | 94.3% |
54
+ | | | **`StructEstimator`** | **0.9475** | **0.9654** | **4.39** | **94.6%** |
55
+
56
+ ---
57
+
58
+ ## Model Architecture
59
+
60
+ `StructEstimator` freezes **`ESM2-650M`** (`FP16`, no fine-tuning) and trains a compact **`39.03M`-parameter** downstream architecture (`149 MB` FP32 vs. `241 MB` for NetSurfP-3's `CNNbLSTM`):
61
+
62
+ 1. **Multi-Layer Frozen Fusion (`MultiLayerScalarMix` × 3):** Extracts 4 strategic layers **`[18, 24, 30, 33]`** and learns independent per-layer `RMSNorm` + softmax weights for the shared trunk (`54.3%` intermediate layers), local `Q3`/torsion skip (`30.9%`), and global `pLDDT` skip (`50.5%`), concatenated with a `32`-dim AA identity embedding.
63
+ 2. **Multi-Scale Gated Conv Stem (`k = 3, 7, 15, 31`):** Padding-masked depthwise-separable 1D convolutions capturing turns, α-helices, and β-hairpins.
64
+ 3. **6-Layer Pre-Norm Macaron `RoPE-Conformer` (`d = 512`, `8` heads, `ffn = 1024`):** Combines `SwiGLU` FFNs, dynamic Rotary Position Embedding (RoPE) FlashAttention/SDPA, and GLU-gated `k = 9` depthwise convolutions.
65
+ 4. **Dual-Stream Decoder + Global Fold FiLM + Stage-2 Cross-Task Refinement:**
66
+ * **Local Geometry Stream** fuses mid-backbone (Block 3) + final (Block 6) + local layer skip for `Q3`, `Q8`, `Phi`, and `Psi`.
67
+ * **Global Fold Stream** modulates `h_final` with **Attentive Statistics Pooling (mean + std) FiLM** for **50-bin HL-Gauss `pLDDT`**, `RSA`, and `Disorder`.
68
+ * **Stage-2 Refinement** (`d = 256`, masked `k = 5` depthwise conv + `SwiGLU`) couples all 7 tasks via residual logit deltas.
69
+
70
+ ---
71
+
72
+ ## Predicted Per-Residue Outputs
73
+
74
+ | Column(s) | Output | Description |
75
+ | :--- | :--- | :--- |
76
+ | `q3`, `p_q3_*` | **3-state Secondary Structure (`SS3`)** | `H` (Helix), `E` (Strand), `C` (Coil) + per-state probabilities |
77
+ | `q8`, `p_q8_*` | **8-state Secondary Structure (`SS8`)** | DSSP classes `G, H, I, B, E, S, T, C` + per-state probabilities |
78
+ | `plddt` | **AlphaFold2 `pLDDT`** | Predicted per-residue AlphaFold2 confidence score (`[0, 100]`, 50-bin HL-Gauss) |
79
+ | `rsa`, `asa` | **Solvent Accessibility** | Relative (`[0, 1]`) & Absolute ($\text{\AA}^2$, Tien et al. maxima) surface accessibility |
80
+ | `disorder` | **Intrinsic Disorder** | Probability (`[0, 1]`) of crystallographic missing electron density |
81
+ | `phi`, `psi` | **Backbone Dihedrals** | Torsion angles $\phi, \psi \in [-180^\circ, +180^\circ]$ |
82
+
83
+ ---
84
+
85
+ ## Quick Start
86
+
87
+ ### 1. Install `StructEstimator` from GitHub
88
+ ```bash
89
+ pip install git+https://github.com/cpdong/StructEstimator.git
90
+ ```
91
+
92
+ ### 2. Run CLI Prediction (Auto-Downloads `StructEstimator_esm2_650m.pth` on First Run)
93
+ ```bash
94
+ struct-estimator \
95
+ --fasta sample.fasta \
96
+ --hf-repo cpdong/StructEstimator \
97
+ --out-dir predictions
98
+ ```
99
+
100
+ Or run completely offline with a pre-downloaded `StructEstimator_esm2_650m.pth`:
101
+ ```bash
102
+ struct-estimator --fasta sample.fasta --checkpoint /path/to/StructEstimator_esm2_650m.pth --out-dir predictions
103
+ ```
104
+
105
+ Or run the **zero-install all-in-one single script** (`predict_standalone.py`, only needs `torch` + `transformers` + `StructEstimator_esm2_650m.pth` — no package install required):
106
+ ```bash
107
+ python3 predict_standalone.py \
108
+ --model StructEstimator_esm2_650m.pth \
109
+ --input sample.fasta \
110
+ --output predictions.csv
111
+ ```
112
+
113
+ ### 3. Python API
114
+ ```python
115
+ from predict import predict_fasta
116
+
117
+ results = predict_fasta(
118
+ fasta="sample.fasta",
119
+ hf_repo="cpdong/StructEstimator",
120
+ out_dir="predictions",
121
+ )
122
+ ```
123
+
124
+ ---
125
+
126
+ ## License & Attribution
127
+
128
+ Released under **CC-BY-NC-4.0** (Academic / Non-Commercial use only).
129
+ * Powered by frozen **ESM-2** (`facebook/esm2_t33_650M_UR50D`, Lin et al., *Science* 2023; MIT License).
130
+ * `pLDDT` and confident secondary structure supervision derived from **AlphaFold Protein Structure Database v6** (Varadi et al., *Nucleic Acids Research* 2024; CC-BY-4.0).
131
+ * Evaluated on standard **NetSurfP-3.0** PDB/DSSP benchmarks (`CB513`, `TS115`, `CASP12`; Høie et al., *NAR* 2022).