MHC identification method and system based on dual-stage training and multi-feature fusion
By employing a two-stage training and multi-feature fusion approach, and utilizing ESM1b and ESM2 to extract features, combined with PCA and BiLSTM+Attention for deep learning, the problem of insufficient feature extraction and modeling in MHC recognition is solved, achieving efficient and accurate MHC protein recognition.
Patent Information
- Application Number
- CN202511603319.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-04
- Publication Date
- 2026-03-03
AI Technical Summary
Existing technologies lack sufficient feature extraction and modeling capabilities in MHC recognition, resulting in limited predictive performance and making it difficult to meet the needs for fast and accurate recognition.
A two-stage training and multi-feature fusion approach is adopted. Features are extracted using protein language models ESM1b and ESM2, dimensionality reduction is performed by combining principal component analysis (PCA) and multilayer perceptron (MLP), and deep extraction is performed using bidirectional long short-term memory network (BiLSTM) and multi-head attention mechanism. Finally, recognition is performed by a classifier.
It significantly improved the prediction accuracy and generalization ability of MHC proteins, achieved a balanced modeling of global and local information, and enhanced the accuracy and robustness of identification.
Smart Images

Figure CN121601048A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data processing technology, specifically relating to a major histocompatibility complex (MHC) identification method and system based on two-stage training and multi-feature fusion. Background Technology
[0002] The Major Histocompatibility Complex (MHC) is a tightly linked and highly polymorphic gene cluster located on the short arm of chromosome 6 in the human genome. Its encoded products are membrane glycoprotein molecules distributed on the cell surface, capable of presenting antigenic peptides from various sources to T cells, thereby triggering an immune response. Based on structural and functional differences, MHC genes can be divided into three main classes: Class I molecules primarily present endogenous antigens to CD8⁺ cytotoxic T cells; Class II molecules present exogenous antigens to CD4⁺ helper T cells; and Class III genes are involved in the regulation of complement components and inflammatory mediators. The high polymorphism of MHC not only determines the differences in immune responses among individuals but is also an important molecular basis for organ transplant rejection, the occurrence of autoimmune diseases, and tumor immune surveillance. Therefore, rapid and accurate classification and identification of MHC proteins is of great significance for basic research and clinical practice.
[0003] In early studies, MHC identification mainly relied on experimental methods such as serological and cytotoxicity assays. While these methods can ensure a certain level of accuracy, they are complex to operate, time-consuming, and costly, making them unsuitable for large-scale applications.
[0004] With the development of computational biology, researchers in this field are attempting to use computational methods to replace traditional experiments in order to improve recognition efficiency. For example, some existing methods are based on manual feature engineering, converting the physicochemical properties, sequence composition, or patterns of amino acids into feature vectors, and then using machine learning classifiers to complete MHC prediction. However, while these methods reduce reliance on experiments to some extent, they still have the following shortcomings: 1) Manual feature construction requires strong domain knowledge and is a relatively complex process; 2) The expressive power of features is limited, often making it difficult to cover deeper information in the sequence; 3) Feature engineering is a cumbersome process and is difficult to scale efficiently to large-scale data.
[0005] In recent years, deep learning technology has been increasingly applied to protein sequence modeling, with the emergence of Protein Language Models (PLMs) bringing new opportunities for MHC recognition. These models, through large-scale unsupervised pre-training, can automatically learn the contextual dependencies and evolutionary constraints of sequences. Previous studies have proposed MHC classification methods based on ESM models, which reduce the dimensionality of protein embedding vectors using PCA before inputting them into a multilayer perceptron (MLP) for prediction, achieving some progress. However, these methods generally rely only on shallow, fully connected networks, failing to fully leverage the advantages of deep structures in sequence dependency modeling and global feature interaction.
[0006] In summary, existing MHC identification methods still have shortcomings in feature extraction and modeling capabilities, resulting in limited predictive performance. How to utilize deep models to more fully mine discriminative features in protein sequences to improve the accuracy and generalization ability of MHC protein identification has become an urgent technical problem to be solved. Summary of the Invention
[0007] To address the aforementioned problems in the existing technology, this invention discloses an MHC recognition method and system based on two-stage training and multi-feature fusion.
[0008] The present invention adopts the following technical solution: The MHC recognition method based on two-stage training and multi-feature fusion has the following specific steps: Step S1: Obtain MHC protein sequences and non-MHC protein sequences, and use the CD-HIT program to reduce sequence repetition, finally obtaining the protein sequences and their corresponding tags. Step S2: Use protein language models ESM1b and ESM2 to extract features from the protein sequence to obtain the corresponding high-dimensional embedding vectors, and then concatenate the two to obtain the initial feature representation. Step S3: Perform dimensionality reduction on the initial features by traversing within a preset range of 1-400 dimensions to obtain features in different dimensions, and select the optimal dimension to obtain the final features. Step S4: Based on the final features, construct a preliminary screening model containing the MLP algorithm, perform preliminary training and optimization on the input protein sequence, remove redundant information and retain discriminative features; Step S5: Based on the Bidirectional Long Short-Term Memory Network (BiLSTM) and the multi-head attention mechanism (Attention), the final training model is constructed, and the final features obtained in Step S4 are deeply extracted to capture the local and global dependencies of the protein sequence. Step S6, a classifier is set at the end of the BiLSTM and Attention networks. The classifier includes two fully connected layers and a SELU activation function, and the recognition result of the MHC protein is obtained after being processed by the sigmoid function.
[0009] Preferably, step S2 includes the following steps: S21, input the obtained protein sequence into the protein language model ESM1b. The ESM1b is a deep learning model based on the Transformer architecture with a parameter scale of 650M. By performing self-supervised learning on a large-scale protein database, it can capture the evolutionary information of protein sequences and the dependencies between amino acid residues. Using the pre-trained ESM1b large model, extract the protein sequence features. For the first time, extract the first half of the sequence with length L to generate a 1280-dimensional high-dimensional embedding vector, and for the second time, extract the second half of the sequence with length L to generate a 1280-dimensional high-dimensional embedding vector; S22, input the same protein sequence into the improved version of the protein language model ESM2. The ESM2 introduces a deeper network structure and an optimized training strategy on the basis of ESM1b to enhance the sequence representation ability. For example, in step S21, perform two feature extractions for different positions of the sequence, and the output of each feature extraction is also a 1280-dimensional high-dimensional embedding vector, which is used to supplement and enhance the feature information learned by ESM1b; S23, combine the embedding vectors output after ESM1b is processed twice and ESM2 is processed twice through a dimension concatenation operation to form an initial feature representation of 5120 dimensions, so as to fuse the complementary information of the two models and improve the comprehensiveness and discrimination of sequence representation; Preferably, in step S3, the PCA principal component analysis method is used to perform dimensionality reduction on the initial features of step S2, that is, map the n-dimensional features to the k-dimensional, where k < m, and the new features on the k-dimensional are called principal components, which specifically include the following steps: S31, first standardize the data, calculate the mean of each column of the matrix, and subtract the mean of each column from the features of each column; S32, calculate the covariance matrix C and its corresponding eigenvalues and eigenvectors; where n is the number of samples, X is the feature vector matrix composed of all samples, is the obtained eigenvalues and eigenvectors; S33, sort the eigenvalue matrix and the eigenmatrix , in descending order of eigenvalues. Among them, the eigenvalue represents the variance on the data feature vector ; S34, filter the feature matrix, select the N largest eigenvalues, and extract the corresponding eigenvectors to form a compression matrix P: S35, Multiply the standardized matrix X from step S31 by the compressed matrix again, transforming it to a new K-dimensional space, and obtain the principal component Y, as shown in the following formula: Preferably, step S5 includes the following steps: S51 processes the initially filtered features through a BiLSTM layer. One layer processes the input in chronological order, while the other processes it in reverse chronological order, capturing features from both the forward and reverse directions. Finally, the features obtained from the two directions are concatenated.
[0010] S52 maps the features processed by BiLSTM to a query vector Q, a key vector K, and a value vector V. Then, by calculating the similarity between the query and the key, the relevance distribution between different positions is obtained. This distribution is then normalized using softmax and used as weights, applied to the corresponding value vectors to obtain the weighted feature representation. In this way, the model can compute attention weights in parallel across different subspaces, automatically focusing on positions and patterns that play a crucial role in the sequence, thereby highlighting key information and improving feature representation capabilities. The specific calculation of the attention mechanism is shown in the following formula: Where W is the weight matrix, used to generate the query vector Q, key vector K, and value vector V, d k is the dimension of the hidden layer, used for normalization.
[0011] Preferably, step S6 includes the following steps: S61, the classifier consists of two fully connected layers and an intermediate SELU activation function. The features processed by LSTM and attention mechanism are passed through the first hidden layer to obtain the features after preliminary dimensionality reduction.
[0012] S62, the dimensionality-reduced features are processed by the SELU function, which has self-normalization properties and can maintain a stable distribution of activation values during forward propagation. Finally, the prediction result is obtained through a linear layer. The formula for the SELU function is as follows: Where e is the natural base and x is the input value. Control the expansion of the negative part; is the scaling factor, which controls the output of the overall function; f(x) is the final output result. S63 uses the cross-entropy loss function to calculate the error between the predicted output and the true label, and is trained using the Adam optimizer with 5000 iterations; specifically, the learning rate is set to 0.0001, and the momentum decay coefficient is... Set them to 0.9 and 0.999 respectively to initialize small constants. Set to 10 -8 ; The loss function chosen is the cross-entropy loss function, which is expressed mathematically as follows: Where N represents the total number of samples, y i p is the true label of the i-th sample. i This represents the predicted probability for the i-th sample; S64 prints the results of each training epoch. Evaluation metrics include accuracy (ACC), specificity (SP), sensitivity (SN), and Matthews correlation coefficient (MCC). Early stopping is used during training, and the F1 score is used to measure whether the model has improved compared to the previous epoch. The F1 score is the harmonic mean of precision and recall. If the model shows no performance improvement for more than 100 epochs, training is stopped, and the trained model weights are retained for testing. The specific calculation formulas for the various metrics mentioned above are as follows: In this model, TP, TN, FP, and FN represent the number of true positives, true negatives, false positives, and false negatives, respectively. Sensitivity (SN) and specificity (SP) represent the model's ability to distinguish between positive and negative samples, respectively. Accuracy (ACC) and Matthews correlation coefficient (MCC) are used to measure the overall performance of the model.
[0013] This invention also discloses an MHC recognition system based on two-stage training and multi-feature fusion, used to perform the above method, which includes the following modules: Protein sequence acquisition module: Acquires MHC protein sequences and non-MHC protein sequences, and uses the CD-HIT program to obtain the protein sequences and their corresponding tags; Feature extraction module: The protein language models ESM1b and ESM2 are used to extract features from the protein sequence to obtain the corresponding high-dimensional embedding vectors, and the two are concatenated to obtain the initial feature representation; Dimensionality reduction module: Performs dimensionality reduction on the initial features, traverses within a preset range of 1-400 dimensions to obtain features in different dimensions, selects the optimal dimension, and obtains the final features; Preliminary Training and Optimization Module: Based on the final features, a preliminary screening model incorporating the MLP algorithm is constructed to perform preliminary training and optimization on the input protein sequences; Deep extraction module: Based on the bidirectional long short-term memory network BiLSTM and the multi-head attention mechanism, the final training model is constructed to extract the final features obtained from the screening, so as to capture the local and global dependencies of the protein sequence; Recognition Module: A classifier is set at the end of the BiLSTM and Attention network. The classifier includes two fully connected layers and a SELU activation function. The final output is processed by the sigmoid function to obtain the recognition result of MHC protein.
[0014] This invention discloses a method and system for MHC identification based on two-stage training and multi-feature fusion. Traditional wet experimental methods for MHC identification suffer from limitations such as low efficiency, high cost, and difficulty in large-scale application, restricting their widespread use in clinical and research fields. Addressing these limitations, this invention proposes a novel technical solution, named DFL-MHC, which effectively improves prediction accuracy and robustness by introducing a combination of protein language models and deep learning structures. First, this invention utilizes multiple ESM protein language models to extract sequence features, and then combines principal component analysis (PCA) and multilayer perceptron (MLP) to reduce the dimensionality and filter the features, obtaining the optimal sequence representation. Subsequently, the filtered features are input into a deep framework combining a bidirectional long short-term memory network (BiLSTM) and an attention mechanism to simultaneously capture long-range dependencies in the protein sequence and focus on key site features. Through this two-stage training and feature fusion strategy, this invention achieves balanced modeling of global and local information, significantly improving the accuracy of MHC protein prediction. Attached Figure Description
[0015] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Some specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings in an exemplary and non-limiting manner. The same reference numerals in the drawings indicate the same or similar parts or components. Those skilled in the art should understand that these drawings are not necessarily drawn to scale. In the drawings: Figure 1 This is a flowchart of a preferred embodiment of the MHC recognition method based on two-stage training and multi-feature fusion according to the present invention; Figure 2 This is a schematic diagram of the initial feature screening after PCA dimensionality reduction using the MLP algorithm in an embodiment of the present invention; Figure 3 This is a schematic diagram of the final training model constructed in this embodiment of the invention, based on the Long Short-Term Memory (BiLSTM) network and multi-head attention. Figure 4This is a schematic diagram of the final model classifier in an embodiment of the present invention; Figure 5 This is a schematic diagram showing the accuracy of the model training in the first stage of this invention within the range of 1 to 400 dimensions. Figure 6 This is a schematic diagram comparing the generalization ability of the model using the method of the present invention with that of existing methods in an embodiment of the present invention; Figure 7 Diagrams showing different model variations of this invention; Figure 8(a) , 8(b) Figures 8(c) and 8(d) are comparison charts of the result indicators of different model variants implemented in this invention; Figure 9 This is a block diagram of an MHC recognition system based on two-stage training and multi-feature fusion, according to a preferred embodiment of the present invention. Detailed Implementation
[0016] To more clearly illustrate the embodiments of the present invention, specific implementation methods will be described below with reference to the accompanying drawings.
[0017] like Figure 1 As shown, this embodiment provides an MHC recognition method based on two-stage training and multi-feature fusion, including the following steps: S1. Obtain MHC and non-MHC protein sequences from the Uniprot database, and use the CD-HIT program to reduce sequence repetition, ultimately obtaining the protein sequence and its corresponding tag. S2, use protein language models ESM1b and ESM2 to extract features from protein sequences to obtain corresponding high-dimensional embedding vectors, and then concatenate the two to obtain the initial feature representation; S3. The initial features are reduced in dimensionality using PCA principal component analysis. The process is traversed within a preset range of 1-400 dimensions to obtain features in different dimensions. The optimal dimension is selected based on the accuracy of the validation set in the 10-fold cross-validation to obtain the final features. S4. Based on the final features, construct a preliminary screening model incorporating the MLP algorithm (see...). Figure 2 The input protein sequence is initially trained and optimized, redundant information is removed and discriminative features are retained; S5, based on the Bidirectional Long Short-Term Memory (BiLSTM) network and the multi-head attention mechanism, constructs the final training model (see [link]). Figure 3 The final features obtained from step S4 are deeply extracted to capture the local and global dependencies of the protein sequence. S6. A classifier is set at the end of the BiLSTM and Attention network. The classifier includes a fully connected layer and a SELU activation function (self-normalized linear unit). The output is processed by the sigmoid function to obtain the prediction result of whether it is an MHC protein.
[0018] The steps of this embodiment will now be described in more detail.
[0019] In step S1 of this embodiment, MHC and non-MHC protein sequences are first obtained from the Uniprot database, and highly homologous sequences are removed using the CD-HIT program to ensure the diversity and representativeness of the data. After preprocessing, 13,488 sequences are obtained, including 6,712 MHC sequences and 6,776 non-MHC sequences. Subsequently, they are randomly divided into a training set and a test set in an 8:2 ratio: the training set contains 10,790 sequences, and the test set contains 2,698 sequences.
[0020] In this embodiment, step S2 includes the following steps: S21, the acquired protein sequence is input into the protein language model ESM1b. ESM1b is a deep learning model based on the Transformer architecture with a parameter scale of 650M. Through self-supervised learning on a large-scale protein database, it can capture the evolutionary information of protein sequences and the dependencies between amino acid residues. In this embodiment, a pre-trained ESM1b large model is used to extract protein sequence features. The first extraction extracts the first half of a sequence of length L to generate a 1280-dimensional high-dimensional embedding vector, and the second extraction extracts the second half of the sequence of length L to generate a 1280-dimensional high-dimensional embedding vector. S22, the same protein sequence is input into the improved version of the protein language model ESM2. ESM2 introduces a deeper network structure and optimized training strategy on the basis of ESM1b to improve the sequence representation ability. It adopts the method of extracting features twice for different positions of the sequence as in step S21. Its output is also a 1280-dimensional high-dimensional embedding vector, which is used to supplement and enhance the feature information learned by ESM1b. S23. The embedding vectors output from ESM1b after processing twice and ESM2 after processing twice are combined by dimensional concatenation to form an initial feature representation of 5120 dimensions, so as to integrate the complementary information of the two models and improve the comprehensiveness and discriminativeness of sequence representation.
[0021] In this embodiment, step S3 includes the following steps: S31, First, standardize the data, calculate the mean of each column of the matrix, and subtract the mean of each column from the features of each column. S32, calculate the covariance matrix and its corresponding eigenvalues and eigenvectors; Where n is the number of samples, and X is the feature vector matrix composed of all samples. These are the obtained eigenvalues and eigenvectors; S33, combining the eigenvalue matrix and the eigenmatrix Sort the eigenvalues from largest to smallest, where the eigenvalues are... Representative data feature vector variance on; S34, filter the feature matrix, select the N largest eigenvalues, and extract the corresponding eigenvectors to form a compression matrix P: S35. Multiply the normalized matrix X from S31 with the compressed matrix again, transforming it to a new K-dimensional space, and obtain the principal component Y. The specific formula is as follows: In this embodiment, step S5 includes the following steps: S51, such as Figure 3 As shown, the initially filtered features are processed through BiLSTM layers. One layer processes the input in chronological order, while the other processes it in reverse chronological order, capturing features from both the forward and reverse directions. Finally, the features obtained from the two directions are concatenated.
[0022] S52 maps the features processed by BiLSTM to a query vector Q, a key vector K, and a value vector V. Then, by calculating the similarity between the query and the key, the relevance distribution between different positions is obtained. This distribution is then normalized using softmax and used as weights, applied to the corresponding value vectors to obtain the weighted feature representation. In this way, the model can compute attention weights in parallel across different subspaces, automatically focusing on positions and patterns that play a crucial role in the sequence, thereby highlighting key information and improving feature representation capabilities. The specific calculation of the attention mechanism is shown in the following formula: Where W is the weight matrix, used to generate the query vector Q, key vector K, and value vector V. is the dimension of the hidden layer, used for normalization.
[0023] In this embodiment, step S6 includes the following steps: S61, such as Figure 4 As shown, the classifier consists of two fully connected layers and an intermediate SELU activation function. The features processed by LSTM and attention mechanism are passed through the first hidden layer to obtain the features after preliminary dimensionality reduction.
[0024] S62, the dimensionality-reduced features are processed by the SELU function, which has self-normalization properties and can maintain a stable distribution of activation values during forward propagation. Finally, the prediction result is obtained through a linear layer. The formula for the SELU function is as follows: Where e is the natural base and x is the input value. Control the expansion of the negative part; is the scaling factor, which controls the output of the overall function; f(x) is the final output result. S63 uses the cross-entropy loss function to calculate the error between the predicted output and the true label, and is trained using the Adam optimizer with 5000 iterations; specifically, the learning rate is set to 0.0001, and the momentum decay coefficient is... Set them to 0.9 and 0.999 respectively to initialize small constants. Set to 10 -8 ; The loss function chosen is the cross-entropy loss function, which is expressed mathematically as follows: Where N represents the total number of samples, y i p is the true label of the i-th sample. i This represents the predicted probability for the i-th sample; S64 prints the results of each training epoch. Evaluation metrics include accuracy (ACC), specificity (SP), sensitivity (SN), and Matthews correlation coefficient (MCC). Early stopping is used during training, and the F1 score is used to measure whether the model has improved compared to the previous epoch. The F1 score is the harmonic mean of precision and recall. If the model shows no performance improvement for more than 100 epochs, training is stopped, and the trained model weights are retained for testing. The specific calculation formulas for the various metrics mentioned above are as follows: In this model, TP, TN, FP, and FN represent the number of true positives, true negatives, false positives, and false negatives, respectively. Sensitivity (SN) and specificity (SP) represent the model's ability to distinguish between positive and negative samples, respectively. Accuracy (ACC) and Matthews correlation coefficient (MCC) are used to measure the overall performance of the model.
[0025] The recognition effect of the present invention will be further described below through a set of specific experimental examples.
[0026] To further verify the impact of feature design on model performance, this invention conducted ablation experiments at the feature level. The experiments examined the performance of single features (e.g., ESM1b, ESM2), repeated feature expansions (e.g., ESM1b×2, ESM2×2), and multi-feature fusion (e.g., ESM2+ESM1b, ESM2×2+ESM1b×2). The experimental results are shown in Table 1.
[0027] Table 1. Comparison of results using different ESM features in the embodiments of the present invention. The table above shows that using ESM1b or ESM2 alone results in relatively low model performance. While repeated feature expansion, such as ESM1b×2 or ESM2×2, improves performance to some extent, it still doesn't reach the optimal level. Notably, combining ESM2 and ESM1b significantly enhances model performance, with the ESM2+ESM1b combination achieving an ACC of 0.9644 and an MCC of 0.9293, clearly outperforming single-feature performance. Furthermore, the combination of ESM2×2 and ESM1b×2 achieves the best performance, with an ACC of 0.9703, SP of 0.9707, SN of 0.9702, and an MCC as high as 0.9409. This demonstrates that a reasonable number of features and multi-view fusion are crucial for improving model performance. Meanwhile, the experiment also revealed that when the number of features further increased, such as ESM2×3+ESM1b×2 or ESM2×2+ESM1b×3, the model performance actually decreased slightly. This indicates that too many features introduce redundant information, affecting the model's generalization ability; while too few features make it difficult to fully represent sequence information. In summary, ESM2 and ESM1b have obvious complementarity in feature representation, and their reasonable fusion can effectively improve MHC prediction performance. Among them, the ESM2×2+ESM1b×2 combination of this invention is the optimal solution.
[0028] To further evaluate the role of each module in the proposed DFL-MHC framework, this invention also designed module ablation experiments. For example... Figure 7As shown, three variant models were constructed by selectively removing the two key modules, BiLSTM and Attention: DFL-MHC-V1, DFL-MHC-V2, and DFL-MHC-V3. DFL-MHC-V1 removed the BiLSTM module, DFL-MHC-V2 removed the Attention mechanism, and DFL-MHC-V3 removed both BiLSTM and Attention, retaining only the classifier for prediction. Ultimately, the complete DFL-MHC model achieved the best results on all four metrics: ACC, SN, SP, and MCC. Removing the BiLSTM module significantly reduced model performance, especially in sensitivity (SN), indicating that BiLSTM plays a crucial role in capturing bidirectional sequence dependencies. Removing the Attention module significantly reduced model specificity (SP) and overall robustness, demonstrating the importance of Attention in extracting discriminative features. When both BiLSTM and Attention were removed simultaneously, DFL-MHC-V3 experienced the most severe performance degradation, with all metrics showing significant decline. These results collectively demonstrate that BiLSTM and the Attention module complement each other in DFL-MHC. The combination of the two enables the model to simultaneously capture sequence dependencies and key residue features, thereby significantly improving prediction accuracy and model generalization ability.
[0029] To verify the superiority of the method of this invention, three representative MHC classification methods were selected for comparison: PredMHC, ELM-MHC, and ESM-MHC. Figures 8(a)-8(d) As shown in the figure, experiments demonstrate that the DFL-MHC model proposed in this invention significantly outperforms existing methods on multiple evaluation metrics. Specifically, the MCC on the test set reaches 0.9403, representing a 2.4% improvement over the best baseline method, ESM-MHC. This indicates that the proposed invention not only excels in classification accuracy but also exhibits significant advantages in overall prediction performance and generalization ability.
[0030] like Figure 9 As shown, this embodiment discloses an MHC recognition system based on two-stage training and multi-feature fusion, used to perform the above method, which includes the following modules: Protein sequence acquisition module: Acquires MHC protein sequences and non-MHC protein sequences, and uses the CD-HIT program to obtain the protein sequences and their corresponding tags; Feature extraction module: The protein language models ESM1b and ESM2 are used to extract features from the protein sequence to obtain the corresponding high-dimensional embedding vectors, and the two are concatenated to obtain the initial feature representation; Dimensionality reduction module: Performs dimensionality reduction on the initial features, traverses within a preset range of 1-400 dimensions to obtain features in different dimensions, selects the optimal dimension, and obtains the final features; Preliminary Training and Optimization Module: Based on the final features, a preliminary screening model incorporating the MLP algorithm is constructed to perform preliminary training and optimization on the input protein sequences; Deep extraction module: Based on the bidirectional long short-term memory network BiLSTM and the multi-head attention mechanism, the final training model is constructed to extract the final features obtained from the screening, so as to capture the local and global dependencies of the protein sequence; Recognition Module: A classifier is set at the end of the BiLSTM and Attention network. The classifier includes two fully connected layers and a SELU activation function. The final output is processed by the sigmoid function to obtain the recognition result of MHC protein.
[0031] Other aspects of this embodiment can be found in the above method embodiments.
[0032] In summary, this invention effectively overcomes the shortcomings of PredMHC and ELM-MHC, which rely on manually generated features, and also compensates for the limitations of ESM-MHC in feature interaction modeling. On multiple evaluation metrics, the DFL-MHC model of this invention outperforms existing methods, demonstrating stronger predictive performance and application potential.
[0033] Obviously, the above are merely preferred embodiments of the present invention. For those skilled in the art, other drawings and other implementation methods can be obtained based on these drawings without any creative effort.
Claims
1. An MHC recognition method based on two-stage training and multi-feature fusion, characterized in that, The specific steps are as follows: Step S1: Obtain MHC protein sequences and non-MHC protein sequences, and use the CD-HIT program to obtain the protein sequences and their corresponding tags. Step S2: Use protein language models ESM1b and ESM2 to extract features from the protein sequence in step S1 to obtain the corresponding high-dimensional embedding vectors, and then concatenate the two to obtain the initial feature representation. Step S3: Perform dimensionality reduction on the initial features from step S2. Traverse within a preset range of 1-400 dimensions to obtain features in different dimensions, and select the optimal dimension to obtain the final features. Step S4: Based on the final features from step S3, construct a preliminary screening model incorporating the MLP algorithm to perform preliminary training and optimization on the input protein sequence. Step S5: Based on the Bidirectional Long Short-Term Memory Network (BiLSTM) and the multi-head attention mechanism (Attention), the final training model is constructed, and the final features obtained from S4 are extracted to capture the local and global dependencies of the protein sequence. Step S6: Set a classifier at the end of the BiLSTM and Attention network. The classifier includes two fully connected layers and a SELU activation function. The final output is processed by the sigmoid function to obtain the recognition result of MHC protein.
2. The MHC recognition method based on two-stage training and multi-feature fusion according to claim 1, characterized in that, Step S2 is as follows: S21, the obtained protein sequence is input into the protein language model ESM1b. ESM1b extracts protein sequence features. The first extraction of the first half of the sequence of length L generates a 1280-dimensional high-dimensional embedding vector. The second extraction of the second half of the sequence of length L generates a 1280-dimensional high-dimensional embedding vector. S22, Input the same protein sequence into the protein language model ESM2 to extract protein sequence features. The first extraction of the first half of the sequence of length L generates a 1280-dimensional high-dimensional embedding vector. The second extraction of the second half of the sequence of length L generates a 1280-dimensional high-dimensional embedding vector. S23, combine the embedding vectors output from ESM1b after processing twice with those output from ESM2 after processing twice according to the dimension concatenation operation to form an initial feature representation of 5120 dimensions.
3. The MHC recognition method based on two-stage training and multi-feature fusion according to claim 1, characterized in that, Step S3 includes the following steps: S31, standardize the data, calculate the mean of each column of the matrix, and subtract the mean of each column from the features of each column. S32, calculate the covariance matrix and its corresponding eigenvalues and eigenvectors; Where n is the number of samples, and X is the feature vector matrix composed of all samples. These are the obtained eigenvalues and eigenvectors; S33, combining the eigenvalue matrix and the eigenmatrix Sort the eigenvalues from largest to smallest, where the eigenvalues are... Representative data feature vector The variance of the vector, i = 1, 2, ..., n; S34, filter the feature matrix, select the N largest eigenvalues, and extract the corresponding eigenvectors to form a compression matrix P: S35, Multiply the standardized matrix X from step S31 by the compressed matrix P, transform it to a new K-dimensional space, and obtain the principal component Y, as shown in the following formula: 。 4. The MHC recognition method based on two-stage training and multi-feature fusion according to claim 1, characterized in that, Step S5 includes the following steps: S51 processes the initially filtered features through a BiLSTM layer, with one layer processing the input in chronological order and the other in reverse chronological order, capturing features of the input sequence from both forward and reverse directions. The features obtained from the two directions are then concatenated. S52 maps the features processed by BiLSTM to a query vector Q, a key vector K, and a value vector V. Then, by calculating the similarity between the query and the key, the relevance distribution between different positions is obtained. This distribution is then normalized using softmax and used as weights, applied to the corresponding value vectors to obtain a weighted feature representation. The specific calculation of the attention mechanism is shown in the following formula: Where W is the weight matrix, used to generate the query vector Q, key vector K, and value vector V, d k is the dimension of the hidden layer, used for normalization.
5. The MHC recognition method based on two-stage training and multi-feature fusion according to any one of claims 1-4, characterized in that, Step S6 includes the following steps: S61, the classifier includes two fully connected layers and an intermediate SELU activation function. The features processed by LSTM and attention mechanism are passed through the first hidden layer to obtain the features after preliminary dimensionality reduction. S62, the dimensionality-reduced features are fed into the SELU function for processing, and the prediction result is obtained through a linear layer; The formula for the SELU function is as follows: Where e is the natural base and x is the input value. Used to control the expansion of the negative part; Let f(x) be the scaling factor, and f(x) be the final output result. S63 uses the cross-entropy loss function to calculate the error between the predicted output and the true label, and is trained by the Adam optimizer and multiple iterations; The loss function chosen is the cross-entropy loss function, which is expressed mathematically as follows: Where N represents the total number of samples, y i p is the true label of the i-th sample. i This represents the predicted probability for the i-th sample; S64 prints out the results in each training round. The evaluation metrics are accuracy (ACC), specificity (SP), sensitivity (SN), and Matthews correlation coefficient (MCC). Early stopping is used during training, and the F1 score is used to measure whether the model has improved compared to the previous round. The F1 score is the harmonic mean of precision and recall. If the model has not improved its performance for more than 100 rounds, training is stopped, and the trained model weights are retained for testing.
6. The MHC recognition method based on two-stage training and multi-feature fusion according to claim 5, characterized in that, In step S64, the evaluation index is specifically calculated using the following formula: In this model, TP, TN, FP, and FN represent the number of true positives, true negatives, false positives, and false negatives, respectively. Sensitivity (SN) and specificity (SP) represent the model's ability to distinguish between positive and negative samples, respectively. Accuracy (ACC) and Matthews correlation coefficient (MCC) are used to measure the overall performance of the model.
7. An MHC recognition system based on two-stage training and multi-feature fusion, used to perform the method as described in any one of claims 1-6, characterized in that, Includes the following modules: Protein sequence acquisition module: Acquires MHC protein sequences and non-MHC protein sequences, and uses the CD-HIT program to obtain the protein sequences and their corresponding tags; Feature extraction module: The protein language models ESM1b and ESM2 are used to extract features from the protein sequence to obtain the corresponding high-dimensional embedding vectors, and the two are concatenated to obtain the initial feature representation; Dimensionality reduction module: Performs dimensionality reduction on the initial features, traverses within a preset range of 1-400 dimensions to obtain features in different dimensions, selects the optimal dimension, and obtains the final features; Preliminary Training and Optimization Module: Based on the final features, a preliminary screening model incorporating the MLP algorithm is constructed to perform preliminary training and optimization on the input protein sequences; Deep extraction module: Based on the bidirectional long short-term memory network BiLSTM and the multi-head attention mechanism, the final training model is constructed to extract the final features obtained from the screening, so as to capture the local and global dependencies of the protein sequence; Recognition Module: A classifier is set at the end of the BiLSTM and Attention network. The classifier includes two fully connected layers and a SELU activation function. The final output is processed by the sigmoid function to obtain the recognition result of MHC protein.