ukaikotaro commited on
Commit
a03f5ea
·
verified ·
1 Parent(s): e7124ad

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. README.md +222 -0
  2. original/model.pth +3 -0
  3. seen_unseen/model.pth +3 -0
README.md ADDED
@@ -0,0 +1,222 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: pytorch
3
+ license: mit
4
+ tags:
5
+ - protein
6
+ - enzyme
7
+ - protein-language-model
8
+ - bioinformatics
9
+ - protein-function-prediction
10
+ ---
11
+
12
+ # UNKAI
13
+
14
+ UNKAI is a protein-pair classification model for predicting whether two proteins are associated with the same enzymatic reaction.
15
+
16
+ The model takes per-residue protein embeddings as input, independently pools the two proteins using attention pooling, computes the absolute difference between the resulting protein-level representations, and performs binary classification with a multilayer perceptron.
17
+
18
+ Code and inference utilities are available at:
19
+
20
+ https://github.com/ukai3313/UNKAI
21
+
22
+ ## Model variants
23
+
24
+ This repository contains two pretrained UNKAI variants.
25
+
26
+ ### Original
27
+
28
+ Architecture:
29
+
30
+ ```text
31
+ Per-residue embeddings
32
+ |
33
+ Attention Pooling
34
+ |
35
+ Protein vectors v1, v2
36
+ |
37
+ |v1 - v2|
38
+ |
39
+ 2560 -> 1599 -> 781 -> 117 -> 1
40
+ |
41
+ Sigmoid
42
+ ```
43
+
44
+ The original model uses:
45
+
46
+ * Input embedding dimension: 2560
47
+ * Attention pooling
48
+ * Pair representation: absolute difference `|v1 - v2|`
49
+ * MLP dimensions: `2560 -> 1599 -> 781 -> 117 -> 1`
50
+ * Dropout: `0.302766`
51
+
52
+ Checkpoint:
53
+
54
+ ```text
55
+ original/model.pth
56
+ ```
57
+
58
+ ### Seen-unseen
59
+
60
+ The seen-unseen model is designed for evaluation where one side of a validation or test pair belongs to a protein cluster observed during training, while the other side belongs to a cluster not observed during training.
61
+
62
+ Architecture:
63
+
64
+ ```text
65
+ Per-residue embeddings
66
+ |
67
+ Attention Pooling
68
+ with attention dropout
69
+ |
70
+ Protein vectors v1, v2
71
+ |
72
+ |v1 - v2|
73
+ |
74
+ 2560 -> 1408 -> 640 -> 512 -> 1
75
+ ```
76
+
77
+ The model uses:
78
+
79
+ * Input embedding dimension: 2560
80
+ * Attention pooling
81
+ * Attention dropout: `0.1627294925`
82
+ * Pair representation: absolute difference `|v1 - v2|`
83
+ * MLP dimensions: `2560 -> 1408 -> 640 -> 512 -> 1`
84
+ * Classifier dropout: `0.5282298379`
85
+
86
+ Checkpoint:
87
+
88
+ ```text
89
+ seen_unseen/model.pth
90
+ ```
91
+
92
+ The checkpoint produces logits. A sigmoid transformation is applied during inference to obtain a probability.
93
+
94
+ ## Input format
95
+
96
+ UNKAI expects one per-residue embedding file for each protein.
97
+
98
+ Expected filename:
99
+
100
+ ```text
101
+ <UNIPROT_ACCESSION>_embedding.npy
102
+ ```
103
+
104
+ Supported array shapes are:
105
+
106
+ ```text
107
+ (L, 2560)
108
+ ```
109
+
110
+ or:
111
+
112
+ ```text
113
+ (1, L, 2560)
114
+ ```
115
+
116
+ where `L` is the protein sequence length.
117
+
118
+ The released checkpoints were trained using 2560-dimensional per-residue protein embeddings.
119
+
120
+ ## Installation
121
+
122
+ Clone the UNKAI GitHub repository:
123
+
124
+ ```bash
125
+ git clone https://github.com/ukai3313/UNKAI.git
126
+ cd UNKAI
127
+ pip install -r requirements.txt
128
+ ```
129
+
130
+ Add the source directory to `PYTHONPATH`:
131
+
132
+ ```bash
133
+ export PYTHONPATH="$PWD/src"
134
+ ```
135
+
136
+ ## Inference
137
+
138
+ ### Original model
139
+
140
+ ```bash
141
+ python -m unkai.predict \
142
+ --model original \
143
+ --protein1 Q6GZV6 \
144
+ --protein2 Q6GZN7 \
145
+ --embeddings-dir /path/to/embeddings \
146
+ --checkpoint /path/to/original/model.pth
147
+ ```
148
+
149
+ ### Seen-unseen model
150
+
151
+ ```bash
152
+ python -m unkai.predict \
153
+ --model seen_unseen \
154
+ --protein1 Q6GZV6 \
155
+ --protein2 Q6GZN7 \
156
+ --embeddings-dir /path/to/embeddings \
157
+ --checkpoint /path/to/seen_unseen/model.pth
158
+ ```
159
+
160
+ Example output:
161
+
162
+ ```text
163
+ Protein 1 : Q6GZV6
164
+ Protein 2 : Q6GZN7
165
+ Model : original
166
+ Probability : 0.002518
167
+ Prediction : 0
168
+ ```
169
+
170
+ The current inference utility uses a probability threshold of `0.5`.
171
+
172
+ * `Prediction = 1`: predicted to be associated with the same enzymatic reaction.
173
+ * `Prediction = 0`: predicted not to be associated with the same enzymatic reaction.
174
+
175
+ ## Files
176
+
177
+ ```text
178
+ original/
179
+ └── model.pth
180
+
181
+ seen_unseen/
182
+ └── model.pth
183
+ ```
184
+
185
+ ## Datasets
186
+
187
+ Datasets used with UNKAI are released separately:
188
+
189
+ ```text
190
+ ukaikotaro/UNKAI-dataset
191
+ ```
192
+
193
+ Three dataset variants are provided:
194
+
195
+ * original
196
+ * seen_unseen
197
+ * strict
198
+
199
+ See the dataset repository for details about the splitting strategies.
200
+
201
+ ## Embeddings
202
+
203
+ The pretrained UNKAI checkpoints require precomputed per-residue protein embeddings.
204
+
205
+ The embedding collection used in this project is planned to be distributed separately.
206
+
207
+ ## Limitations
208
+
209
+ UNKAI predicts association between a pair of proteins with respect to enzymatic reactions and should not be interpreted as direct experimental evidence of identical biochemical function.
210
+
211
+ Performance may depend on the distribution of proteins, sequence similarity, clustering strategy, and embedding model used to construct the input representations.
212
+
213
+ The original and seen-unseen checkpoints were trained using different dataset splitting strategies and should therefore not be directly compared without considering the evaluation setting.
214
+
215
+ ## Citation
216
+
217
+ Citation information for the associated publication will be added here.
218
+
219
+ ## License
220
+
221
+ MIT License.
222
+
original/model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:13b34eb3fe53995a2065150a881904ab5d112145f95f89c495f8a9d4304bd6a4
3
+ size 21800658
seen_unseen/model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ced59dacf9ae72768090bc4cedd5b38ef30e6b5c89cb5de0c2b3fcb898837869
3
+ size 19395893