Multi-modal attention deep learning method for enhancing virus recognition in metagenome data

Through the multimodal attention deep learning method, combined with the graph attention network, autoencoder, convolutional long short-term memory network and Transformer model, the problem of insufficient accuracy of virus recognition methods in short sequence recognition in metagenomic data is solved, and the problem of insufficient recognition of short sequences is achieved. More efficient and accurate virus sequence recognition.

CN118918954AActive Publication Date: 2024-11-08HARBIN INST OF TECH

Patent Information

Application Number
CN202411025662.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-11-08
Estimated Expiration
2044-07-30

AI Technical Summary

Technical Problem

The existing metagenomic data of virus identification methods are insufficient in processing short sequences, especially based on alignment and k-mer methods, there are problems such as long execution time, large memory consumption or low performance, deep learning methods such as LSTM and CNN still needs to improve its short virus sequence recognition.

Method used

Using multimodal attention deep learning method, combined with graph attention network, autoencoder, convolutional long short-term memory network and Transformer model, the contribution weight of each path is adaptively adjusted through dynamic feature fusion and self-attention mechanism to improve the The accuracy of feature fusion and optimize model performance through hyperparameter tuning and training strategies.

Benefits of technology

It significantly improves the recognition ability and robustness of viral sequences, provides more comprehensive and detailed feature representations, enhances the model's comprehensive understanding of sequences, and improves the performance and accuracy of identifying short viral sequences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118918954A_ABST
    Figure CN118918954A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, and discloses a multi-modal attention deep learning method for enhancing virus recognition in metagenome data, which comprises five main steps of data preprocessing, sequence embedding, multi-modal feature extraction, dynamic feature fusion and prediction, and hyper-parameter tuning and training. The method comprises the following steps: respectively extracting graph structure features, potential features, spatial-temporal features and global features of a sequence through four model paths, namely GAT, an auto-encoder, a convolutional long-short-term memory network and Transform, introducing the graph structure features, the potential features, the spatial-temporal features and the global features into a self-attention mechanism, adaptively adjusting the contribution weight of each path according to the features of an input sequence, carrying out sequence embedding by utilizing the GAT and the auto-encoder, and carrying out sequence embedding by utilizing the GAT and the auto-encoder. Capturing a long-distance dependency relationship and potential features, adopting ConvLSTM and Transform model paths, extracting space-time and global features, and performing hyper-parameter tuning and training strategy optimization; according to the method, the virus sequence recognition capability is improved, meanwhile, the accuracy of feature fusion is improved, and the performance and robustness of the model are further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and specifically to a multimodal attention deep learning method for enhancing virus identification in metagenomic data. Background Art

[0002] Viruses are one of the most common and abundant biological entities on Earth, playing an important role in the function of microbial communities, such as regulating bacterial populations and affecting host metabolism. Many viruses can cause serious diseases, and their frequency and infectivity pose a huge threat to human health. In recent years, with the development of next-generation sequencing (NGS) technology and advanced computing technology, scientists have been able to identify viruses in large metagenomic datasets. Unlike the traditional method of isolating viruses through laboratory culture, NGS technology can effectively sequence all types of genetic material in microbial communities, regardless of their culturability, thereby showing the true viral diversity of the sample. NGS technology can effectively sequence all types of genetic material from microbial communities, thereby revealing the true viral diversity of the sample. In addition, NGS studies on human enteroviruses have revealed important associations between viruses and human diseases, such as inflammatory bowel disease (IBD), severe acute malnutrition (SAM), and type II diabetes. Identifying viral sequences Virus identification from metagenomic samples is the first critical step in all downstream viral analysis. Some methods have been developed to address the problem of virus identification in metagenomic samples. However, identifying viral sequences from metagenomic samples remains a challenging task due to the small proportion of viruses in metagenomes and the high mutation rate of viruses.

[0003] In order to accurately identify viral sequences in metagenomes, researchers have proposed a variety of methods, mainly including alignment-based, gene-based, k-mer-based and deep learning-based methods. Alignment-based methods match the similarity between query sequences and known viral reference genomes, such as ProViDE, Metavir, DIAMOND, etc., but these methods have problems such as long execution time and high memory consumption during database construction and sequence mapping. Gene-based methods identify viral sequences by comparing genes in query sequences with viral gene databases, but their performance is poor when predicting short sequences. K-mer-based methods use k-mer frequencies as sequence features and can identify short viral sequences, but their overall performance is low when identifying short viral sequences. With the great success of deep learning methods in the past few years, some deep learning-based methods have been proposed. For identifying viruses from metagenomes, long short-term memory (LSTM) networks and convolutional neural networks (CNN) are the most commonly used models, such as DeepVirFinder, ViraMiner, PPR-Meta, etc., which use different deep learning neural networks to learn more advanced features from sequences and improve the detection performance of short viral sequences. However, these methods still have the problem of accuracy improvement when processing short sequences. In order to further improve the performance of identifying short virus sequences from metagenomic data, this application proposes a multimodal attention deep learning method (VirIDNet) for enhancing virus identification in metagenomic data.

[0004] Application Contents

[0005] The purpose of this application is to provide a multimodal attention deep learning method for enhancing virus recognition in metagenomic data by combining multiple deep learning model paths, improving the ability to recognize virus sequences, adaptively adjusting the contribution weights of each path through dynamic feature fusion and self-attention mechanism, improving the accuracy of feature fusion, and further improving the performance and robustness of the model by using hyperparameter tuning and training strategy optimization.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] A multimodal attention deep learning method for enhancing virus identification in metagenomic data of the present invention comprises the following steps:

[0008] S1. Extract a training data set containing viral sequences and host sequences from a genome database;

[0009] S2, one-hot encoding and segmentation of all viral and host sequences;

[0010] S3, construct the graph structure of the 3-mer fragment of each sequence, calculate the weight of each node, and obtain the graph structure characteristics of the sequence;

[0011] S4, the input sequence is mapped to a low-dimensional latent space through the encoder, and then the original sequence is reconstructed through the decoder to obtain the latent features of the sequence;

[0012] S5, aligning the graph structure features with the latent features;

[0013] S6, fusing the spliced ​​aligned structural features with the latent features to obtain fused features;

[0014] S7, processing the fused features through the convolutional long short-term memory network to obtain the spatiotemporal features of the sequence;

[0015] S8, process the fused features through the Transformer model to obtain the global features of the sequence;

[0016] S9, splicing the spatiotemporal features and the global features;

[0017] S10, by dynamically adjusting the contribution weights of the spatiotemporal features and the global features, the spliced ​​spatiotemporal features and the global features are fused;

[0018] S11, process the fused features through several fully connected layers;

[0019] S12, input the fused features processed by several fully connected layers into the Softmax layer to generate prediction results;

[0020] S13, comprehensively optimize the key hyperparameters of steps S3 to S12 through Bayesian optimization of Keras Tuner;

[0021] S14, reducing the sensitivity of steps S3 to S12 to training data noise by using a hybrid loss function and a label smoothing algorithm;

[0022] S15. Use the optimal hyperparameter configuration to train steps S3 to S12.

[0023] Further, step S3 includes, the 3-mer fragments of each sequence are nodes, and the co-occurrence relationship between the fragments is an edge;

[0024] By introducing the attention mechanism, for each node i, the attention weight α between it and its neighbor node j is calculated by formula 1. ij :

[0025]

[0026] Where W is the weight matrix, is the attention vector, is the neighbor set of node i, representing the connection operation;

[0027] The calculated attention weight α ij The feature representation of the weighted neighbor node j is used to update the feature representation h′ of node i through formula 2 i :

[0028]

[0029] Among them, σ is the activation function.

[0030] Further, step S4 includes, the encoder converts the input sequence X into a low-dimensional representation z by formula 3:

[0031] z=σ(W e X+b e ), formula 3;

[0032] Among them, W e is the weight matrix of the encoder, b e is the bias term, σ is the activation function;

[0033] The decoder reconstructs the input sequence from the feature vector z through Formula 4

[0034]

[0035] Among them, W d is the weight matrix of the decoder, b d is the bias term;

[0036] The autoencoder is trained by minimizing the reconstruction error via Formula 5:

[0037]

[0038] Where N is the number of samples.

[0039] Further, step S5 includes aligning the graph structure features and the latent features using linear transformation through Formula 6 and Formula 7:

[0040] Z′ GAT =W GAT Z GAT +b GAT , Formula 6;

[0041] Z′ Autencoder =W Autoencoder Z Autoender +b Autoencoder , Formula 7;

[0042] Among them, W GA T and WAutoencoder is the weight matrix of the linear transformation, b GA T and b Autoencoder is the bias term.

[0043] Furthermore, step 6 includes fusing the aligned graph structure features and latent features through formula 8 to obtain a high-dimensional feature vector Z fusion :

[0044] Z fusion =Concat(Z′ GAT , Z′ Autoencode ), formula 8;

[0045] Using the self-attention mechanism, high-dimensional feature vectors are processed using Formula 9 and Formula 10:

[0046] O attention =Attention(Z fusion ), Formula 9;

[0047]

[0048] Among them, Q, K, and V represent the query matrix, key matrix, and value matrix respectively. k The dimension of the key.

[0049] Further, step S7 includes inputting the fused features into formula 11, performing a series of convolution operations, and extracting the local spatial features of the sequence:

[0050] O conv =ReLU(W conv *X+b conv ), Formula 11;

[0051] Among them, * represents the convolution operation, W conv and b conv are the weights and bias terms of the convolutional layer, and ReLU is the activation function;

[0052] The extracted spatial features are input into the LSTM unit to process the temporal information, including controlling the amount of input information through the input gate of formula 12:

[0053]

[0054] Among them, σ is the sigmoid activation function, W xi , W hi and W ci is the weight matrix of the input gate, X t is the input at the current moment, H t-1 is the hidden state at the previous moment, C t-1 is the cell state at the previous moment, bi is the bias term, represents the Hadamard product;

[0055] Through formula 13 and formula 14, the forget gate determines how much of the state at the previous moment is forgotten:

[0056]

[0057] Through formula 15, the forget gate determines how much of the state at the previous moment is forgotten:

[0058]

[0059] The final hidden state is formula 16:

[0060]

[0061] Further, step S8 includes calculating the attention scores between the query matrix, the key matrix and the value matrix through formula 17 to generate a feature representation containing global dependencies:

[0062]

[0063] Among them, Q, K, and V represent the query matrix, key matrix, and value matrix respectively. k is the dimension of the key;

[0064] The feedforward neural network processes the attention output through a layer of linear transformation and activation function in formula 18:

[0065] FFN(x)=max(0,xW1+b1)W2+b2, Formula 18;

[0066] Among them, W1 and W2 are the weight matrices of the feedforward neural network, b1 and b2 are bias terms, and max(0, x) represents the ReLU activation function;

[0067] Layer normalization and residual connection are performed through Formula 19 and Formula 20 to stabilize the training process and improve the performance of the model:

[0068] LayerNorm(x+Attention(Q, K, V)), Formula 19;

[0069] LayerNorm(x+FFN(x)), Formula 20;

[0070] Among them, LayerNorm represents the layer normalization operation.

[0071] Further, step S9 includes: splicing the spatiotemporal features with the global features through formula 21 to obtain a high-dimensional feature vector Z:

[0072] Z = Concat(H ConvLSTM , H Transformer ), Formula 21;

[0073] Step S10 includes performing self-attention calculation on the high-dimensional feature vector, dynamically adjusting the contribution weight of each path through formula 22, and fusing the spatiotemporal features with the global features:

[0074] O attention =Attention(Z), Formula 22;

[0075] Step S11 includes further processing the feature vector output by the self-attention mechanism through several fully connected layers of formula 23:

[0076] O fusion =Dense(O attetion ), Formula 23;

[0077] Step S12 includes generating a prediction result through the Softmax layer of Formula 24:

[0078]

[0079] Further, step 13 includes: defining a hyperparameter search space, including a hidden layer size of ConvLSTM ranging from 50 to 150, with a step size of 10; a number of convolution filters of the first layer ranging from 16 to 64, with a step size of 16, a second layer ranging from 32 to 128, with a step size of 32, and a third layer ranging from 64 to 256, with a step size of 64; a dropout rate ranging from 0.3 to 0.5, with a step size of 0.1; a learning rate ranging from 0.001 to 0.01, with a logarithmic scale for searching;

[0080] Through multiple iterative searches, the accuracy of the validation set is optimized to obtain the optimal hyperparameter configuration;

[0081] Step 14 includes enhancing the model's ability to distinguish sequence features through the mixed loss function of formula 25:

[0082] L custom =αL cross_enttopy +(1-α)L contrastive , Formula 25;

[0083] Among them, L cross_entropy represents the cross entropy loss, L contrastive represents contrast loss, α is the weight coefficient;

[0084] Classification is performed using the cross entropy formula 26:

[0085]

[0086] The similarity between samples is measured by comparing the loss using formula 27:

[0087]

[0088] Among them, d i represents the Euclidean distance between samples, m is the boundary threshold, y i For labels;

[0089] The combination of the two can improve the model's discriminative ability;

[0090] The target label is adjusted by the label smoothing algorithm in Formula 28 to reduce the model's sensitivity to training data noise:

[0091]

[0092] Among them, g true is the original label, ∈ is the smoothing factor, and K is the number of categories;

[0093] The target labels are adjusted from 0 and 1 to values ​​between 0 and 1.

[0094] Furthermore, step S15 includes: optimizing with mini-batch stochastic gradient descent, combined with a custom hybrid loss function and label smoothing technology, to further improve the robustness and accuracy of the model; monitoring the loss and accuracy of the validation set, and preventing overfitting through an early stopping strategy; and terminating the training early when the validation set performance no longer improves.

[0095] Compared with the prior art, the beneficial effects of this application are:

[0096] The present application combines four model paths, namely, graph attention network (GAT), autoencoder, convolutional long short-term memory network (ConvLSTM) and Transformer, to extract graph structure features, latent features, spatiotemporal features and global features of the sequence respectively, and provide a more comprehensive and detailed feature representation; by introducing the self-attention mechanism, the model can adaptively adjust the contribution weights of each path according to the features of the input sequence, thereby improving the accuracy of feature fusion; in the sequence embedding stage, GAT and autoencoder are used for sequence embedding to capture long-distance dependencies and latent features, making the embedding representation richer and more accurate; in the multimodal feature extraction stage, ConvLSTM and Transformer model paths are used to extract spatiotemporal and global features, and enhance the model's comprehensive understanding of the sequence; through hyperparameter tuning and training strategy optimization, the performance and robustness of the model are further improved; the present application combines multiple deep learning model paths to improve the ability to recognize virus sequences, and through dynamic feature fusion and self-attention mechanism, the contribution weights of each path are adaptively adjusted to improve the accuracy of feature fusion, and the performance and robustness of the model are further improved by hyperparameter tuning and training strategy optimization. BRIEF DESCRIPTION OF THE DRAWINGS

[0097] In order to more clearly illustrate the technical solutions of the implementation methods of the present application, the drawings required for use in the implementation methods will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0098] Figure 1 is a method flow chart of the present application;

[0099] Figure 2 is a workflow diagram of steps S3 to S12 of the present application;

[0100] Figure 3 is a summary table of the dataset used in this application;

[0101] Figure 4 It is a comparison chart of the experimental results of the method of the present application and the prior art method on the CAMI data set;

[0102] Figure 5 It is a comparison chart of experimental results performed on the NCBI_RefSeq test set using the method of the present application and the prior art method;

[0103] Figure 6 It is a comparison chart of experimental results using the method of the present application and the prior art method on a human intestinal metagenomic dataset;

[0104] Figure 7 yes Figure 4 The corresponding data table;

[0105] Figure 8 yes Figure 5 The corresponding data table;

[0106] Fig. 9 yes Figure 6 The corresponding data table. DETAILED DESCRIPTION

[0107] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0108] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show the layers related to the present invention rather than being drawn according to the number, shape and size of the layers in actual implementation. In actual implementation, the type, quantity and proportion of each layer may be changed arbitrarily, and the layer layout may also be more complicated.

[0109] In the following description, numerous details are discussed to provide a more thorough explanation of embodiments of the present invention; however, it is apparent to one skilled in the art that embodiments of the present invention may be practiced without these specific details.

[0110] See also Figure 1 and Figure 2 , a multimodal attention deep learning method for enhancing virus identification in metagenomic data, uses a multimodal hybrid deep learning model to accurately identify virus sequences from metagenomic data. Its workflow includes five main steps: data preprocessing, sequence embedding, multimodal feature extraction, dynamic feature fusion and prediction, and hyperparameter tuning and training. It includes the following steps:

[0111] S1. Extract a training data set containing viral sequences and host sequences from a genome database;

[0112] S2, one-hot encoding and segmentation of all viral and host sequences;

[0113] The datasets used in this application are summarized in Figure 3The training and test datasets contain 9000 and 1000 sequences of 500 bp in length, respectively. The CAMI dataset consists of 46 viral sequences and 1051 host sequences with lengths between 100 bp and 500 bp. The real human intestinal metagenomic dataset consists of sequences with lengths between 500 bp and 5000 bp.

[0114] The genomic data provided in VirFinder (a comparative experiment) were collected from the RefSeq database of NCBI, which contains 1562 RefSeq genomes of viruses that infect prokaryotes and 4410 RefSeq genomes of prokaryotic hosts. All RefSeq genomes were split into several non-overlapping fragments of 500bp in length to simulate fragmented short metagenomic sequences. Due to the limitation of personal computer memory, 5000 viral fragments and 5000 host fragments were randomly selected from the above fragments. The baseline dataset was then divided into two subsets, containing 9000 fragments and 1000 fragments, respectively, with the same number of viral and host fragments. The subset of 9000 fragments is called the training set, and the subset of 1000 fragments is called the test set.

[0115] To ensure objectivity, VirIDNet was evaluated on a public benchmark dataset of the CAMI dataset 3CAMI_high. BLAST (Basic Local Alignment Search Tool) was used. The sequences were mapped to the viral reference sequence genome using default parameters. 8431 sequences shorter than 500bp, 7087 sequences 500-1000bp in length, 7915 sequences 1000-3000bp in length, and 12518 sequences longer than 3000bp were identified as viral sequences. The same number of non-viral short sequences were also randomly selected from the remaining sequences of each length. These 71,902 mixed sequences were built into the metagenomic dataset together for testing.

[0116] To further validate the capabilities of VirIDNet, a simple real-world metagenomic dataset was constructed from a real human gut metagenomic sample whose reads were obtained from the NCBI short read archive. BLAST processing using default parameters with the public benchmark dataset from CAMI generated 385 viral sequences shorter than 500bp, 409 sequences with a length of 500-1000bp, 728 sequences with a length of 1000-3000bp, and 915 sequences with a length of more than 3000bp. Similarly, the same number of non-viral short sequences of each length were randomly sampled from the remaining non-viral sequences. A total of 4,874 mixed sequences were used for testing.

[0117] S3, construct the graph structure of the 3-mer fragment of each sequence, calculate the weight of each node, and obtain the graph structure characteristics of the sequence;

[0118] S4, the input sequence is mapped to a low-dimensional latent space through the encoder, and then the original sequence is reconstructed through the decoder to obtain the latent features of the sequence;

[0119] S5, aligning the graph structure features with the latent features;

[0120] S6, fusing the spliced ​​aligned structural features with the latent features to obtain fused features;

[0121] In the sequence embedding stage, this application uses the graph attention network (GAT) and the autoencoder model for sequence embedding. GAT constructs a graph structure of 3-mer fragments of each sequence and uses the attention mechanism to calculate the weight of each node to capture the local and global structural information in the sequence. The autoencoder path maps the input sequence to a low-dimensional latent space through the encoder, and then reconstructs the original sequence through the decoder to learn the potential feature representation of the sequence.

[0122] S7, processing the fused features through the convolutional long short-term memory network to obtain the spatiotemporal features of the sequence;

[0123] S8, process the fused features through the Transformer model to obtain the global features of the sequence;

[0124] In the multimodal feature extraction stage, the convolutional long short-term memory network (ConvLSTM) and the Transformer model path are combined. ConvLSTM combines the advantages of convolutional neural network (CNN) and long short-term memory network (LSTM) to capture both spatial and temporal dependencies in the sequence. The Transformer path uses a multi-head attention mechanism and a feedforward neural network to capture long-range dependencies and generate a global feature representation by calculating the correlation between each position in the input sequence.

[0125] S9, splicing the spatiotemporal features and the global features;

[0126] S10, by dynamically adjusting the contribution weights of the spatiotemporal features and the global features, the spliced ​​spatiotemporal features and the global features are fused;

[0127] S11, process the fused features through several fully connected layers;

[0128] S12, input the fused features processed by several fully connected layers into the Softmax layer to generate prediction results;

[0129] In the dynamic feature fusion and prediction stage, the self-attention mechanism is used to adaptively adjust the contribution weight of each path according to the characteristics of the input sequence. The feature vectors generated by multimodal feature extraction are concatenated and further processed by the self-attention mechanism to enhance the expressiveness and accuracy of feature fusion. The fused features are then processed through several fully connected layers, and finally the prediction results are generated through the Softmax layer.

[0130] S13, comprehensively optimize the key hyperparameters of steps S3 to S12 through Bayesian optimization of Keras Tuner;

[0131] S14, reducing the sensitivity of steps S3 to S12 to training data noise by using a hybrid loss function and a label smoothing algorithm;

[0132] In order to optimize the performance of the model, this application uses Keras Tuner for Bayesian Optimization, and comprehensively tunes key hyperparameters such as the hidden layer size, number of convolutional filters, dropout rate, and learning rate of the ConvLSTM unit. Bayesian optimization effectively explores and utilizes the search space to find the optimal configuration by building a proxy model and maximizing the expected improvement. In order to enhance the model's ability to distinguish sequence features, this application designs a custom hybrid loss function that combines cross entropy loss and contrast loss. Label smoothing technology is applied to reduce the model's sensitivity to training data noise.

[0133] S15. Use the optimal hyperparameter configuration to train steps S3 to S12.

[0134] After hyperparameter tuning and loss function design, the VirIDNet model is trained using the optimal hyperparameter configuration. During training, mini-batch stochastic gradient descent (SGD) is used for optimization, combined with a custom hybrid loss function and label smoothing technology to further improve the robustness and accuracy of the model. During training, the loss and accuracy of the validation set are monitored, and overfitting is prevented by an early stopping strategy. This comprehensive tuning and training strategy ensures efficient training and optimal performance of the model.

[0135] The present application combines four model paths, namely, graph attention network (GAT), autoencoder, convolutional long short-term memory network (ConvLSTM) and Transformer, to extract graph structure features, latent features, spatiotemporal features and global features of the sequence respectively, and provide a more comprehensive and detailed feature representation; by introducing the self-attention mechanism, the model can adaptively adjust the contribution weights of each path according to the features of the input sequence, thereby improving the accuracy of feature fusion; in the sequence embedding stage, GAT and autoencoder are used for sequence embedding to capture long-distance dependencies and latent features, making the embedding representation richer and more accurate; in the multimodal feature extraction stage, ConvLSTM and Transformer model paths are used to extract spatiotemporal and global features, and enhance the model's comprehensive understanding of the sequence; through hyperparameter tuning and training strategy optimization, the performance and robustness of the model are further improved; the present application combines multiple deep learning model paths to improve the ability to recognize virus sequences, and through dynamic feature fusion and self-attention mechanism, the contribution weights of each path are adaptively adjusted to improve the accuracy of feature fusion, and the performance and robustness of the model are further improved by hyperparameter tuning and training strategy optimization.

[0136] Step S3 includes, the 3-mer fragments of each sequence are nodes, and the co-occurrence relationship between the fragments is an edge; GAT captures the graph structure information between the nucleotide fragments by constructing the graph structure of the 3-mer fragments of each sequence. For example, for the sequence 'AGCTGATCC', it will be divided into multiple 3-mer fragments: 'AGC GCT CTG TGA GAT ATC TCC'. Each 3-mer fragment is represented as a node in the graph, and the co-occurrence relationship between the fragments is represented as an edge in the graph. For example: the nodes in the previous example are 'AGC, GCT, CTG, TGA, GAT, ATC, TCC', then the edges of this graph are 'AGC-GCT, GCT-CTG, CTG-TGA, TGA-GAT, GATATC, ATC-TCC'.

[0137] By introducing the attention mechanism, GAT calculates the importance weight of each node with its neighboring nodes, thereby dynamically adjusting the combination of node features. Assuming that this application calculates the attention weight of node GCT and its neighbors AGC and CTG, for each node i, the attention weight α between it and its neighbor node j is calculated by formula 1: ij :

[0138]

[0139] Where W is the weight matrix, is the attention vector, is the neighbor set of node i, representing the connection operation;

[0140] The calculated attention weight α ij The feature representation of the weighted neighbor node j is used to update the feature representation h′ of node i through formula 2 i :

[0141]

[0142] Where σ is an activation function, such as ReLU. Assuming that the neighbors of node GCT are AGC and CTG, the updated feature of GCT is expressed as:

[0143] h′ GCT =σ(α GCT,AGC W AGC +α GCTCTG W CTG ),

[0144] In VirIDNet, the number of GAT layers is set to two, and each layer uses the LeakyReLU activation function to extract local structural features in the sequence.

[0145] The autoencoder extracts useful low-dimensional feature representations from the data through unsupervised learning. The autoencoder consists of an encoder and a decoder. The encoder compresses the input sequence to a low-dimensional representation, while the decoder attempts to reconstruct the input sequence. For example, the one-hot encoding representation of the sequence AGCTGATCC is: [[1,0,0,0], [0,1,0,0], [0,0,1,0], [0,0,0,1], [0,1,0,0], [1,0,0,0], [0,1,0,0], [0,0,1,0], [0,0,1,0]] In the autoencoder path, the input sequence is first converted to a low-dimensional representation z through the encoder. The above 9 nucleotide sequence is compressed to a 3-dimensional representation z = [z1, z2, z3]. The low-dimensional representation z is then reconstructed through the decoder as Step S4 includes, the encoder converts the input sequence X into a low-dimensional representation z by formula 3:

[0146] z=σ(W e X+b e ), formula 3;

[0147] Among them, W e is the weight matrix of the encoder, b e is the bias term, σ is the activation function, such as ReLU;

[0148] The decoder reconstructs the input sequence from the feature vector z through Formula 4

[0149]

[0150] Among them, W d is the weight matrix of the decoder, b d is the bias term;

[0151] The autoencoder is trained by minimizing the reconstruction error through formula 5. The commonly used loss function is the mean square error:

[0152]

[0153] Where N is the number of samples. In this way, the autoencoder can effectively extract useful low-dimensional feature representations from the data, reduce noise and retain important information.

[0154] From the above specific examples, it can be seen that GAT and Autoencoder have different working methods and advantages, and complement each other. GAT captures local and global dependencies in the sequence through graph structure, while Autoencoder extracts the potential features of the sequence through unsupervised learning. The combination of the two can provide a more comprehensive and accurate feature representation for the model, which helps to improve the performance and robustness of virus recognition.

[0155] Then, the feature vectors obtained through the GAT path and the Autoencoder path are concatenated. In order to ensure that the concatenated feature vectors have the same dimension, a linear transformation can be used to align the features. Step S5 includes using a linear transformation to align the graph structure features and the latent features through Formula 6 and Formula 7:

[0156] Z′ GAT =W GAT Z GAT +b GAT , Formula 6;

[0157] Z′ Autoencodeer =W Autoencoder Z Autoencoder +b Antoencoder , Formula 7;

[0158] Among them, W GAT and W Autoencoder is the weight matrix of the linear transformation, b GAT and b Autoencoder is the bias term. In this way, the feature vectors obtained by the two paths can be transformed to the same dimension for subsequent processing.

[0159] Step 6 includes fusing the aligned graph structure features and latent features through formula 8 to obtain a high-dimensional feature vector Z fusion :

[0160] Z fusion =Concat(Z′GAT , Z′ Autoencoder ), formula 8;

[0161] Using the self-attention mechanism, high-dimensional feature vectors are processed using Formula 9 and Formula 10:

[0162] O attention =Attention(Z fusion ), Formula 9;

[0163]

[0164] Among them, Q, K, and V represent the query matrix, key matrix, and value matrix respectively. k In this way, the correlation between feature vectors can be calculated and the weights can be adjusted dynamically to improve the effect of feature fusion.

[0165] Step S7 includes inputting the fused features into Formula 11, performing a series of convolution operations, and extracting the local spatial features of the sequence:

[0166] O conv =ReLU(W conv *X+b conv ), Formula 11;

[0167] Among them, * represents the convolution operation, W conv and b conv are the weights and bias terms of the convolutional layer, and ReLU is the activation function;

[0168] The extracted spatial features are input into the LSTM unit to process the temporal information. The LSTM unit controls the flow of information through the input gate, forget gate, and output gate mechanism, including controlling the amount of input information through the input gate of formula 12:

[0169]

[0170] Among them, σ is the sigmoid activation function, W xi , W hi and W ci is the weight matrix of the input gate, X t is the input at the current moment, H t-1 is the hidden state at the previous moment, C t-1 is the cell state at the previous moment, b i is the bias term, represents the Hadamard product;

[0171] Through formula 13 and formula 14, the forget gate determines how much of the state at the previous moment is forgotten:

[0172]

[0173] The current unit status is updated to:

[0174]

[0175] Through formula 15, the forget gate determines how much of the state at the previous moment is forgotten:

[0176]

[0177] The final hidden state is formula 16:

[0178]

[0179] Through these gating mechanisms, ConvLSTM can effectively capture the sequence dependencies while retaining important spatial features, making it suitable for processing complex sequence features in metagenomic data.

[0180] The ConvLSTM path combines the advantages of convolutional neural networks (CNNs) and long short-term memory networks (LSTMs) to simultaneously capture the spatial and temporal dependencies in the sequence, thereby effectively processing sequence data with spatial characteristics.

[0181] Step S8 includes calculating the attention scores between the query matrix, the key matrix, and the value matrix through Formula 17 to generate a feature representation containing global dependencies:

[0182]

[0183] Among them, Q, K, and V represent the query matrix, key matrix, and value matrix respectively. k is the dimension of the key;

[0184] The feedforward neural network processes the attention output through a layer of linear transformation and activation function in formula 18:

[0185] FFN(x)=max(0,xW1+b1)W2+b2, Formula 18;

[0186] Among them, W1 and W2 are the weight matrices of the feedforward neural network, b1 and b2 are bias terms, and max(0, x) represents the ReLU activation function;

[0187] Layer normalization and residual connection are performed through Formula 19 and Formula 20 to stabilize the training process and improve the performance of the model:

[0188] LayerNorm(x+Attention(Q, K, V)), Formula 19;

[0189] LayerNorm(xFFN(x)), Formula 20;

[0190] Among them, LayerNorm represents the layer normalization operation;

[0191] In this application, the number of layers of the Transformer path is set to four, eight attention heads are used in each layer, and the hidden layer size of the feedforward neural network is 512. By combining the ConvLSTM and Transformer paths, VirIDNet is able to simultaneously extract the spatiotemporal and global features of the sequence. In the multimodal feature extraction process, the ConvLSTM path and the Transformer path respectively capture different types of information in the sequence, enabling the model to understand and represent sequence features more comprehensively. This combination method not only takes advantage of the ConvLSTM's advantages in capturing spatiotemporal dependencies, but also takes advantage of the Transformer's powerful ability to capture long-distance dependencies, thereby improving the model's ability to handle complex sequence data and the accuracy of feature representation.

[0192] Step S9 includes: splicing the spatiotemporal features with the global features through formula 21 to obtain a high-dimensional feature vector Z:

[0193] Z = Concat(H ConvLSTM , H Transformer ), Formula 21;

[0194] Step S10 includes performing self-attention calculation on the high-dimensional feature vector, dynamically adjusting the contribution weight of each path through formula 22, and fusing the spatiotemporal features with the global features:

[0195] O attention =Attention(Z), Formula 22;

[0196] Step S11 includes further processing the feature vector output by the self-attention mechanism through several fully connected layers of formula 23:

[0197] O fusion =Dense(O atention ), Formula 23;

[0198] Step S12 includes generating a prediction result through the Softmax layer of Formula 24:

[0199]

[0200] The self-attention mechanism is used to adaptively adjust the contribution weight of each path according to the characteristics of the input sequence. The feature vectors generated by multimodal feature extraction are concatenated and further processed by the self-attention mechanism to enhance the expressiveness and accuracy of feature fusion.

[0201] Step 13 includes defining a hyperparameter search space, including a hidden layer size of ConvLSTM ranging from 50 to 150, with a step size of 10; the number of convolution filters of the first layer ranging from 16 to 64, with a step size of 16, the second layer ranging from 32 to 128, with a step size of 32, and the third layer ranging from 64 to 256, with a step size of 64; the dropout rate ranging from 0.3 to 0.5, with a step size of 0.1; the learning rate ranging from 0.001 to 0.01, with a logarithmic scale for searching;

[0202] Through multiple iterative searches, the accuracy of the validation set is optimized to obtain the optimal hyperparameter configuration;

[0203] Step 14 includes enhancing the model's ability to distinguish sequence features through a hybrid loss function of formula 25, which combines the cross entropy loss and the contrast loss:

[0204] L custom =αL cross _ entropy +(1-α)L contrasitve , Formula 25;

[0205] Among them, L cross_entropy represents the cross entropy loss, L contrastive represents contrast loss, α is the weight coefficient;

[0206] Classification is performed using the cross entropy formula 26:

[0207]

[0208] The similarity between samples is measured by comparing the loss using formula 27:

[0209]

[0210] Among them, d i represents the Euclidean distance between samples, m is the boundary threshold, y i For labels;

[0211] The combination of the two can improve the model's discriminative ability;

[0212] The target label is adjusted by the label smoothing algorithm in Formula 28 to reduce the model's sensitivity to training data noise:

[0213]

[0214] Among them, y true , is the original label, ∈ is the smoothing factor, K is the number of categories;

[0215] The target labels are adjusted from 0 and 1 to values ​​between 0 and 1, such as 0.9 and 0.1. Label smoothing can reduce overfitting and improve the generalization ability of the model.

[0216] Step S15 includes: using small batch stochastic gradient descent (SGD) for optimization, combining a custom hybrid loss function and label smoothing technology to further improve the robustness and accuracy of the model; monitoring the loss and accuracy of the validation set, and preventing overfitting through the early stopping strategy; when the performance of the validation set no longer improves, terminating the training in advance. Among them, the optimizer selects Adam or AdamW optimizer, and sets the corresponding learning rate, the batch size is set to 200, and the number of training rounds is 20.

[0217] In order to optimize the performance of the VirIDNet model, this application uses KerasTuner for Bayesian Optimization and comprehensively tunes the key hyperparameters of the model. Bayesian optimization is an efficient global optimization method, especially suitable for high-dimensional spaces and black box functions with high computational overhead. Compared with traditional grid search and random search, Bayesian optimization can use prior knowledge and observation data to build a proxy model (such as a Gaussian process) and select the next evaluation point by maximizing the expected improvement (Expected Improvement, EI) of the proxy model, thereby effectively exploring and utilizing the search space.

[0218] Typically, the performance of a classifier is evaluated by calculating a confusion matrix, which is calculated based on four statistical values: True Positives (TP), False Positives (FP), True Negatives (TN), and False Negatives (FN). TP is the instance correctly labeled as positive; FP is the negative instance incorrectly labeled as positive; TN is the instance correctly labeled as negative; and FN is the positive instance incorrectly labeled as negative. Based on these four values, some high-level metrics can also be calculated, such as True Positive Rate (TPR), False Positive Rate (FPR), Precision, Recall, and F1 score.

[0219]

[0220] Based on TPR and FPR, a receiver operating characteristic (ROC) curve can be plotted to evaluate the performance of the proposed model. The ROC curve is created by plotting TPR against FPR at various threshold settings. The area under the ROC curve (AUROC) is used to evaluate the prediction performance, and the higher the AUROC value, the better the performance.

[0221] When dealing with highly imbalanced datasets, the precision-recall (PR) curve provides a more informative performance picture than the ROC curve. The area under the PR curve (AUPRC) is also used to evaluate the predictive performance on imbalanced datasets.

[0222] In order to evaluate the performance of VirIDNet proposed in this application, experiments were conducted on the CAMI dataset, NCBI_RefSeq test set, and real human intestinal metagenomic dataset, and compared with other advanced methods (VirSorter, VirFinder, DeepVirFinder, CHEER, and DETIRE). The comparison indicators include recall, precision, and F1 score.

[0223] See also Figures 4 to 9 , the proposed method significantly outperforms other methods in terms of recall, precision, and F1 score on all three datasets. The high recall rate indicates that VirIDNet proposed in this application is very sensitive in identifying true virus sequences, while the high precision and F1 score indicate that it can accurately classify virus sequences without generating too many false positives.

[0224] In the above-mentioned embodiments, although the present invention has been described in conjunction with the specific embodiments of the present invention, many replacements, modifications and variations of these embodiments will be apparent to those of ordinary skill in the art based on the foregoing description. The embodiments of the present invention are intended to cover all such replacements, modifications and variations falling within the broad scope of the appended claims.

[0225] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. A multimodal attention deep learning method for enhancing virus identification in metagenomic data, characterized by: The following steps are involved: S1. Extract a training data set containing viral sequences and host sequences from a genome database; S2, one-hot encoding and segmentation of all viral and host sequences; S3, construct the graph structure of the 3-mer fragment of each sequence, calculate the weight of each node, and obtain the graph structure characteristics of the sequence; S4, the input sequence is mapped to a low-dimensional latent space through the encoder, and then the original sequence is reconstructed through the decoder to obtain the latent features of the sequence; S5, aligning the graph structure features with the latent features; S6, fusing the spliced ​​aligned structural features with the latent features to obtain fused features; S7, processing the fused features through the convolutional long short-term memory network to obtain the spatiotemporal features of the sequence; S8, process the fused features through the Transformer model to obtain the global features of the sequence; S9, splicing the spatiotemporal features and the global features; S10, by dynamically adjusting the contribution weights of the spatiotemporal features and the global features, the spliced ​​spatiotemporal features and the global features are fused; S11, process the fused features through several fully connected layers; S12, input the fused features processed by several fully connected layers into the Softmax layer to generate prediction results; S13, comprehensively optimize the key hyperparameters of steps S3 to S12 through Bayesian optimization of Keras Tuner; S14, reducing the sensitivity of steps S3 to S12 to training data noise by using a hybrid loss function and a label smoothing algorithm; S15. Use the optimal hyperparameter configuration to train steps S3 to S12.

2. A multimodal attention deep learning method for enhancing virus identification in metagenomic data according to claim 1, characterized in that Step S3 includes: the 3-mer fragments of each sequence are nodes, and the co-occurrence relationships between the fragments are edges; By introducing the attention mechanism, for each node i, the attention weight α between it and its neighbor node j is calculated by formula 1. ij : Where W is the weight matrix, is the attention vector, is the neighbor set of node i, || represents the connection operation; The calculated attention weight α ij The feature representation of the weighted neighbor node j is used to update the feature representation h′ of node i through formula 2 i : Among them, σ is the activation function.

3. A multimodal attention deep learning method for enhancing virus identification in metagenomic data according to claim 2, characterized in that: Step S4 includes, the encoder converts the input sequence X into a low-dimensional representation by formula 3 z=σ(W e X+b e ), Formula 3; Among them, W e is the weight matrix of the encoder, b e is the bias term, σ is the activation function; The decoder uses Formula 4 to extract the feature vector Reconstruct the input sequence Among them, W d is the weight matrix of the decoder, b d is the bias term; The autoencoder is trained by minimizing the reconstruction error via Formula 5: Where N is the number of samples.

4. A multimodal attention deep learning method for enhancing virus identification in metagenomic data according to claim 3, characterized in that: Step S5 includes aligning the graph structure features and the latent features using linear transformations through Formula 6 and Formula 7: Z′ GAT =W GAT Z GAT +b GAT , Formula 6; Z′ Autoencoder =W Autoencoer Z Autoencoder +b Autoencoer , Formula 7; Among them, W GAT and W Autoencodr is the weight matrix of the linear transformation, b GAT and b Auttoenoder is the bias term.

5. A multimodal attention deep learning method for enhancing virus identification in metagenomic data according to claim 4, characterized in that: Step 6 includes fusing the aligned graph structure features and latent features through formula 8 to obtain a high-dimensional feature vector Z fusion : Z fusion = Concat(Z GAT , Z' Autoencoder ), Equation 8; Using the self-attention mechanism, high-dimensional feature vectors are processed using Formula 9 and Formula 10: O attention =Attention(Z fusion ), Formula 9; Among them, Q, K, and V represent the query matrix, key matrix, and value matrix respectively. k The dimension of the key.

6. A multimodal attention deep learning method for enhancing virus identification in metagenomic data according to claim 1, characterized in that Step S7 includes inputting the fused features into Formula 11, performing a series of convolution operations, and extracting the local spatial features of the sequence: O conv =ReLU(W conv *X+b conv ), Formula 11; Among them, * represents the convolution operation, W conv and b conv are the weights and bias terms of the convolutional layer, and ReLU is the activation function; The extracted spatial features are input into the LSTM unit to process the temporal information, including controlling the amount of input information through the input gate of formula 12: Among them, σ is the sigmoid activation function, W xi , W hi and W ci is the weight matrix of the input gate, X t is the input at the current moment, H t-1 is the hidden state at the previous moment, C t-1 is the cell state at the previous moment, b i is the bias term, represents the Hadamard product; Through formula 13 and formula 14, the forget gate determines how much of the state at the previous moment is forgotten: Through formula 15, the forget gate determines how much of the state at the previous moment is forgotten: The final hidden state is formula 16:

7. A multimodal attention deep learning method for enhancing virus identification in metagenomic data according to claim 6, characterized in that Step S8 includes calculating the attention scores between the query matrix, the key matrix, and the value matrix through Formula 17 to generate a feature representation containing global dependencies: Among them, Q, K, and V represent the query matrix, key matrix, and value matrix respectively. k is the dimension of the key; The feedforward neural network processes the attention output through a layer of linear transformation and activation function in formula 18: FFN(x)=max(0,xW1+b1)W2+b2, Formula 18; Among them, W1 and W2 are the weight matrices of the feedforward neural network, b1 and b2 are bias terms, and max(0, x) represents the ReLU activation function; Layer normalization and residual connection are performed through Formula 19 and Formula 20 to stabilize the training process and improve the performance of the model: LayerNorm(x+Attention(Q, K, V)), Formula 19; LayerNorm(x+FFN(x)), Formula 20; Among them, LayerNorm represents the layer normalization operation.

8. A multimodal attention deep learning method for enhancing virus identification in metagenomic data according to claim 1, characterized in that: Step S9 includes: splicing the spatiotemporal features with the global features through formula 21 to obtain a high-dimensional feature vector Z: Z = Concat(H ConvLSTM , H Transformer ), Formula 21; Step S10 includes performing self-attention calculation on the high-dimensional feature vector, dynamically adjusting the contribution weight of each path through formula 22, and fusing the spatiotemporal features with the global features: O attention =Attention(Z), Formula 22; Step S11 includes further processing the feature vector output by the self-attention mechanism through several fully connected layers of formula 23: O fusion = Dense(O atteniton ), Formula 23; Step S12 includes generating a prediction result through the Softmax layer of Formula 24:

9. A multimodal attention deep learning method for enhancing virus identification in metagenomic data according to claim 1, characterized in that: Step 13 includes: defining a hyperparameter search space, including the hidden layer size of ConvLSTM ranging from 50 to 150, with a step size of 10; the number of convolution filters of the first layer ranging from 16 to 64, with a step size of 16, the second layer ranging from 32 to 128, with a step size of 32, and the third layer ranging from 64 to 256, with a step size of 64; the dropout rate ranging from 0.3 to 0.5, with a step size of 0.1; the learning rate ranging from 0.001 to 0.01, using a logarithmic scale for searching; Through multiple iterative searches, the accuracy of the validation set is optimized to obtain the optimal hyperparameter configuration; Step 14 includes enhancing the model's ability to distinguish sequence features through the mixed loss function of formula 25: L custom =αL cross_entropy +(1-α)L contrastive , Formula 25; Among them, L cross_entropy represents the cross entropy loss, L contrastive represents contrast loss, α is the weight coefficient; Classification is performed using the cross entropy formula 26: The similarity between samples is measured by comparing the loss using formula 27: Among them, d i represents the Euclidean distance between samples, m is the boundary threshold, y i For labels; The combination of the two can improve the model's discriminative ability; The target label is adjusted by the label smoothing algorithm in Formula 28 to reduce the model's sensitivity to training data noise: Among them, y true is the original label, ∈ is the smoothing factor, and K is the number of categories; The target labels are adjusted from 0 and 1 to values ​​between 0 and 1.

10. A multimodal attention deep learning method for enhancing virus identification in metagenomic data according to claim 9, characterized in that: Step S15 includes: optimizing with mini-batch stochastic gradient descent, combined with a custom hybrid loss function and label smoothing technology, to further improve the robustness and accuracy of the model; monitoring the loss and accuracy of the validation set, and preventing overfitting through an early stopping strategy; and terminating the training early when the validation set performance no longer improves.

Citation Information

Patent Citations

  • Virus host prediction method and system based on neural network, and storage medium

    CN117995267A

  • Virulence factor identification method and system based on self-attention coding and pooling mechanism

    CN118098372A

  • Multi-view semi-supervised lymph node classification method and system, and device

    WO2022127227A1

Cited By

  • Transform-based gene data mining method

    CN119479835A

  • Gene data mining method based on Transformer

    CN119479835B

  • Gait sub-phase prediction method and device based on deep learning model fusion

    CN119700094A

  • ConvLSTM model-based sign language recognition method and system

    CN119964250A

  • Sign Language Recognition Method and System Based on ConvLSTM Model

    CN119964250B