I follow a variant of the architecure in MHCAttnNet.
The best model follows the following architecture:(mhcAttentionAdd)
- MHC and peptide sequences are each embedded into 256 dimensional vectors.
- Each embedded sequences are fed into 2 bidirectional LSTM layers with 128 units each.
- Now the following 3 sequences are passed into attention layers:
- The MHC LSTM output
- The peptide LSTM output
- The sum of MHC and peptide LSTM outputs
- The attention outputs are each passed through fully connected layers with 64 units.
- The outputs of the fully connected layers are concatenated and passed through a sequence of fully connected layers to get the final output.
Here is a diagram of the model:
Other models I tried are:
- (mhcAttentionConcat) Concatenating the LSTM outputs instead of adding them.
- (mhcAttentionCombined) Only the concatenated LSTM outputs are passed through the attention layer.
- (mhcAttentionSimple) Only the LSTM outputs are passed through the attention layer.
- (mhcNoAttention) No attention layer is used. The LSTM outputs are passed through global average pooling and then through fully connected layers.
The best model is mhcAttentionAdd. The results are as follows:(On test set with 15% ratio)
| Model | Loss | Accuracy | Precision | Recall | F1 Score | AUC |
|---|---|---|---|---|---|---|
| mhcAttentionAdd | 0.1392 | 94.91 | 88.87 | 85.48 | 87.15 | 97.85 |
| mhcNoAttention | 0.1531 | 94.25 | 86.74 | 84.39 | 85.54 | 97.47 |
| mhcAttentionSimple | 0.1442 | 94.65 | 87.75 | 85.36 | 86.54 | 97.73 |
| mhcAttentionConcat | 0.1422 | 94.78 | 90.25 | 83.09 | 86.52 | 97.81 |
python Preprocess.py -f [CSV path] -v [validation ratio] -t [test ratio] -tp [train path] -vp [validation path] -tep [test path]This splits the data into train, validation and test sets. The default validation and test ration is 15%.
python main.py --train [train path] --val [validation path] -e [epochs] -b [batch size] -lr [learning rate] -l [loss function] -ed [embedding dimension] -ru [RNN units] -s [sequence length] -v [vocab size] -fci [inner FC units] -fco [outer FC units] -cd [context dim] -m [model name]First run preprocesing to generate train, val, test splits.
python main.py --test [test path] -b [batch size] -m [model name] -e [epochs] -b [batch size] -lr [learning rate] -l [loss function] -ed [embedding dimension] -ru [RNN units] -s [sequence length] -v [vocab size] -fci [inner FC units] -fco [outer FC units] -cd [context dim] -m [model name]| Loss | Accuracy |
|---|---|
![]() |
![]() |
| Precision | Recall |
|---|---|
![]() |
![]() |
| AUC |
|---|
![]() |





