Multi-mode-based multi-strain peptide activity prediction method and system
By using multimodal data fusion and microbial species embedding tables, the problems of insufficient feature information and inadequate species differentiation in existing peptide activity prediction models are solved, achieving efficient and accurate activity prediction for multiple microbial species.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING NORMAL UNIVERSITY
- Filing Date
- 2026-01-14
- Publication Date
- 2026-05-15
AI Technical Summary
Existing peptide activity prediction models rely on single-modality data, resulting in insufficient feature information, difficulty in distinguishing activity differences among different bacterial species, and weak model generalization ability, making them prone to overfitting.
Feature extraction and fusion are performed using multimodal data (sequences, structures, trajectories, and biological metadata). Conditional feature representations are generated by combining learnable microbial embedding tables, and a two-dimensional contrastive loss function is used for model training.
It enables the prediction of specific activities of different bacterial species, improves prediction efficiency and accuracy, and enhances the generalization ability of the model.
Smart Images

Figure CN122050488A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of peptide activity prediction, and in particular to a multi-species peptide activity prediction method and system based on multi-modal. BACKGROUND
[0002] Antimicrobial peptides (AMPs) are a class of polypeptides with broad-spectrum antimicrobial activity, and are important candidate drugs for replacing traditional antibiotics to cope with the threat of drug-resistant bacteria. With the popularization of high-throughput sequencing technology, using computational biology methods to predict the biological activity of peptides has become a key means of drug screening. At present, the mainstream technology in this field mainly relies on deep learning models (such as CNN, RNN, and Transformer), which usually take the amino acid sequence of the peptide (such as FASTA format) as input and predict whether it has antimicrobial activity by extracting sequence features. In recent years, some advanced methods have further introduced static three-dimensional structure information (such as PDB files) of proteins and used graph neural networks and other models to capture spatial structure features, further improving the prediction accuracy.
[0003] However, the existing technology has obvious limitations despite improving the prediction efficiency to some extent. First, the modal utilization is relatively single, and the information is seriously missing. Most models only rely on one-dimensional sequences or static structures, ignoring the dynamic conformational changes of peptides in solution (such as molecular dynamics trajectories) and important biological metadata (such as Gram attributes and taxonomic information), resulting in insufficient feature extraction. Second, the existing models are mostly "general-purpose" predictions, only judging whether there is antimicrobial activity, and it is difficult to distinguish the differences in effects on different bacterial species, and it is impossible to handle the specificity prediction task of hundreds of bacterial species in a single network, lacking bacterial specificity. Finally, traditional supervised learning mainly relies on cross-entropy loss, and the feature learning ability is insufficient. When facing high-dimensional multi-modal data, it is difficult to effectively close similar samples and push away dissimilar samples in the feature space, resulting in weak model generalization ability and easy overfitting. SUMMARY
[0004] The purpose of the embodiments of the present application is to provide a multi-species peptide activity prediction method and system based on multi-modal, to solve at least one problem in the above background technology.
[0005] In order to achieve the above object, the embodiment of the present application provides a multi-modal based multi-species peptide activity prediction method, which is based on a multi-species peptide activity prediction model and performs the following steps: obtaining multi-modal data of a peptide, including sequence data, structure data, trajectory data and biological metadata of the peptide; respectively performing feature extraction on each modal data in the multi-modal data, mapping the extracted modal features to a unified dimensional feature space through a multi-channel feature encoder, and then fusing to obtain a fused feature representation of the peptide; generating a plurality of conditional feature representations corresponding to each target species through a learnable species embedding table, by combining the fused feature representation of the peptide with the identification information of the plurality of target species; and outputting the activity prediction results of the peptide on each target species according to the plurality of conditional feature representations.
[0006] Optionally, the feature extraction on each modal data in the multi-modal data comprises: after standardization and data enhancement processing on the sequence data, performing feature extraction on the processed sequence data based on a pre-trained language model to obtain a sequence feature tensor; performing standardization and length unification processing on the structure data, and performing feature extraction on the processed structure data based on a geometric deep learning model to obtain a three-dimensional structure feature tensor; obtaining conformations at different time steps in the trajectory data, extracting contact map feature vectors of each time step conformation, and calculating the average of the contact map feature vectors of all time steps to obtain a trajectory feature vector; and performing numerical encoding and length standardization on the biological metadata to obtain an integer encoding vector.
[0007] Optionally, the multi-channel feature encoder comprises a sequence encoder, a structure encoder, a trajectory encoder and a Text encoder, and the mapping of the extracted modal features to a unified dimensional feature space through the multi-channel feature encoder and then the fusion comprises: performing nonlinear transformation and dimension alignment on the three-dimensional structure feature tensor through an input projection layer in the structure encoder; processing the data after the nonlinear transformation and dimension alignment through a plurality of encoding blocks, wherein each encoding block contains a multi-head self-attention mechanism and a feedforward neural network; performing global average pooling on the feature vectors output by the encoding blocks in the sequence length dimension, and mapping to a unified dimensional feature space.
[0008] Optionally, the mapping of the extracted modal features to a unified dimensional feature space through the multi-channel feature encoder and then the fusion comprises: sequentially performing linear dimension increasing, nonlinear activation, layer normalization, random inactivation and linear projection processing on the trajectory feature vector through the trajectory encoder, so as to map it to a unified dimensional feature space.
[0009] Optionally, the mapping of the extracted modal features to a unified dimensional feature space by the multi-channel feature encoder and the fusion are performed, including: splicing the feature vectors output by the sequence encoder, the structure encoder, the trajectory encoder, and the Text encoder to obtain a combined feature vector; performing linear transformation on the combined feature vector by a projection head to map the dimension thereof to a unified dimensional feature space to obtain the fusion feature representation of the peptide.
[0010] Optionally, the fusion feature representation of the peptide, in combination with the identification information of the plurality of target bacterial species, generates a plurality of conditional feature representations corresponding to each target bacterial species through a learnable bacterial embedding table, including: replicating the fusion feature representation of the peptide a corresponding number of times according to the number of target bacterial species to generate a plurality of replicated feature representations in parallel, the number of which is the same as the number of target bacterial species; converting the identification information of each target bacterial species into a corresponding identification vector to obtain a full permutation identification vector containing the identification information of each target bacterial species; using the full permutation identification vector to extract the bacterial species features of each target bacterial species through the learnable bacterial embedding table, and fusing each bacterial species feature with a replicated feature representation to generate a plurality of conditional feature representations.
[0011] Optionally, the total loss function used in the multi-bacterial species peptide activity prediction model training process includes a two-dimensional contrast loss function and a cross-entropy loss function, and the construction process of the two-dimensional contrast loss function includes: calculating a similarity matrix between the fusion feature representations of all training samples in a training batch; based on the real bacterial species identification labels of the training samples, a first mask matrix is constructed, wherein if the bacterial species identification labels of two samples are the same, the corresponding matrix element is a first value, otherwise a second value; based on the real activity labels of the training samples, a second mask matrix is constructed, wherein if the activity labels of two samples are the same, the corresponding matrix element is a first value, otherwise a second value; based on the similarity matrix and the first mask matrix, and the similarity matrix and the second mask matrix, a first contrast loss and a second contrast loss are calculated; and the first contrast loss and the second contrast loss are weighted and summed to obtain the two-dimensional contrast loss function.
[0012] Optionally, the calculation expression of the first contrast loss and the second contrast loss is:
[0013] wherein Mask represents the first mask matrix or the second mask matrix, S represents the similarity matrix, represents the temperature coefficient; The calculation expression of the two-dimensional contrast loss function is:
[0014] in, This represents the first mask matrix. This represents the second mask matrix. Indicates the first loss. This indicates the second loss. This represents the bacterial species weighting coefficient.
[0015] Secondly, the present invention provides a multimodal multi-species peptide activity prediction system, the prediction system comprising: The system includes a multimodal data acquisition module for acquiring multimodal data of the peptide, including sequence data, structural data, trajectory data, and biological metadata; a multimodal feature extraction and fusion module for extracting features from each modality of the multimodal data, mapping the extracted modal features to a unified feature space using a multi-channel feature encoder, and then fusing them to obtain a fused feature representation of the peptide; a conditional feature generation module for combining the fused feature representation of the peptide with the identification information of multiple target bacterial species, and generating multiple conditional feature representations corresponding to each target bacterial species using a learnable bacterial species embedding table; and a prediction output module for outputting the activity prediction results of the peptide for each target bacterial species based on the multiple conditional feature representations.
[0016] Thirdly, the present invention provides a machine-readable storage medium storing instructions for causing a machine to execute the multimodal multi-species peptide activity prediction method described in any of the preceding claims of this application.
[0017] Through the above technical solution, this invention employs multimodal data, including peptide sequences, structures, trajectories, and biological metadata, as input. This overcomes the shortcomings of existing technologies that rely on a single modality, resulting in insufficient feature information and providing a more comprehensive data foundation for prediction. A multi-channel feature encoder extracts features from each modality, maps them to a unified dimension, and then fuses them, integrating heterogeneous data from different modalities into a unified feature representation. This facilitates subsequent processing and enhances feature expressive power. Furthermore, based on the bacterial species identification information, a learnable bacterial species embedding lookup table is used to obtain the corresponding bacterial species embedding vector. This vector is then combined with the fused feature representation of the peptide to generate conditional feature representations corresponding to each target bacterial species. This conditional injection operation allows the feature representation of the same peptide to be specifically adjusted according to different target bacterial species, enabling the model to dynamically adjust the prediction criteria based on different target bacterial species. This achieves specific activity prediction of the same peptide against different bacterial species within a single model, solving the problem of existing general models lacking species discrimination capabilities. Finally, by generating multiple conditional feature representations in parallel and outputting the prediction results corresponding to each bacterial species, this method can efficiently complete the activity assessment of multiple bacterial species in one go, improving prediction efficiency.
[0018] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description section. Attached Figure Description
[0019] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings: Figure 1 This is a schematic flowchart of a multimodal multi-species peptide activity prediction method provided in an embodiment of the present invention; Figure 2 The left figure is a structural schematic diagram of the structural encoder provided in an embodiment of the present invention, and the right figure is a structural schematic diagram of the trajectory encoder; Figure 3 This is a schematic diagram of the process of constructing a two-dimensional contrastive loss function for training a model, as provided in an embodiment of the present invention. Figure 4 This is a schematic diagram of the structure of a multimodal multi-species peptide activity prediction system provided in an embodiment of the present invention; Figure 5 This is a flowchart illustrating the training process of the multi-strain peptide activity prediction model provided in this embodiment of the invention. Detailed Implementation
[0020] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the scope of the present invention.
[0021] It should be noted that the acquisition, transmission, storage, use, and processing of data in the technical solution of this application all comply with relevant laws and regulations. In the embodiments of this application, certain existing industry solutions such as software, components, and models may be mentioned. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solution of this application, and do not imply that the applicant has already used or necessarily used such solutions.
[0022] Figure 1 This is a schematic flowchart of a multimodal, multi-species peptide activity prediction method provided in an embodiment of the present invention. The prediction method is based on a multi-species peptide activity prediction model and executes as follows: Figure 1 Steps S1-S4 are shown.
[0023] Step S1: Obtain multimodal data of the peptide, including peptide sequence data, structural data, trajectory data, and biological metadata; Step S2: Extract features from each modality of the multimodal data, map the extracted modal features to a feature space of a unified dimension using a multi-channel feature encoder, and then fuse them to obtain the fused feature representation of the peptide. Step S3: Combine the fusion feature representation of the peptide with the identification information of multiple target bacterial species, and generate multiple conditional feature representations corresponding to each target bacterial species through a learnable bacterial species embedding table; Step S4: Based on the multiple conditional feature representations, output the activity prediction results of the peptides for each target bacterial species.
[0024] Specifically, the multimodal data acquired in step S1 includes the following four types: amino acid sequence data of peptides, usually provided in FASTA format; static three-dimensional structural data of peptides, usually provided in protein database (PDB) format files, containing atomic coordinate information of peptides in space; dynamic conformational trajectory data of peptides, derived from molecular dynamics simulations, recording the conformational changes of peptides over time in a solution environment; and bio-metadata related to peptides, existing in the form of structured text, such as background information like the Gram attribute and taxonomic classification of the target bacterial species. By simultaneously acquiring the above four types of data, a comprehensive and complementary information foundation is provided for subsequent multimodal feature fusion, overcoming the problem of insufficient information caused by relying on only a single or a few data modalities in existing technologies.
[0025] Step S2 aims to transform the acquired multimodal raw data into a unified peptide feature representation that integrates multimodal information. This step first extracts features from each modality of data separately, then maps all features to a unified dimension using a multi-channel feature encoder framework, and finally fuses the output vectors of the encoders after unifying the dimension.
[0026] Specifically, in some optional embodiments, feature extraction is performed on each modality of the multimodal data, including: For peptide amino acid sequence data, standardization and data augmentation operations such as adding random noise are first performed to improve data robustness. Subsequently, based on a pre-trained language model (such as the ESM series models), feature extraction is performed on the standardized and data-augmented sequence data to obtain a high-dimensional sequence feature tensor containing semantic information.
[0027] In this embodiment, depending on the pre-trained language model used, the dimension of the input data is set to 1280 or 2048, and Gaussian noise with an intensity of 0.01 is introduced. The normalization formula used is:
[0028] in, Indicates the original input. This represents the mean. Indicates standard deviation, It represents a very small constant to prevent the denominator from being zero and to ensure numerical stability.
[0029] For the three-dimensional structural data of peptides, the coordinates are first standardized and their length is unified to a fixed value. Based on the geometric deep learning model, the processed structural data is used to extract features to obtain a three-dimensional structural feature tensor that can characterize the spatial geometric relationship.
[0030] In this embodiment, the original input data is The input data is in the format of coordinates, where N is the number of amino acid residues. After standardization, if the length exceeds 512 amino acid residues, it is truncated to 512; otherwise, zero-padding is performed. A geometric vector perceptron (GVP) is then used to extract features from the standardized and length-uniformed data, ultimately yielding a shape... The three-dimensional structural feature tensor.
[0031] For feature extraction of peptide trajectory data, a statistical dynamic feature extraction strategy was adopted. First, PDB conformational files at multiple different time steps during molecular dynamics simulation were acquired. Then, the clean-contact algorithm / tool was used to process the PDB file of each time step to extract feature vectors related to the contact map at each time step. Finally, the mean pooling of the contact map feature vectors of all time steps was calculated to generate a global feature vector that can characterize the average dynamic contact mode of the peptide in solution, i.e., the trajectory feature vector.
[0032] Biological metadata (such as Gram positivity / negativity, activity category, target, taxonomic lineage, etc.) is treated as a text sequence, and numerical encoding and length standardization are performed on it to obtain an integer encoded vector.
[0033] In this embodiment, the ASCII encoding is truncated to a length of 128, and then converted into a 5×128 feature matrix.
[0034] The extracted features from each modality are input into a multi-channel feature encoder for unified mapping. This multi-channel feature encoder includes four parallel neural network branches (sub-encoders): a sequence encoder, a structure encoder, a trajectory encoder, and a text encoder, mapping heterogeneous data to a unified projection dimension. In this embodiment, the unified mapping is to 768 dimensions. It should be noted that the 768 dimensions here refer to the length of each feature vector representing the peptide after encoder processing; that is, the vector contains 768 values, each value representing an abstract feature automatically learned by the model.
[0035] The unified dimension is set to 768 dimensions primarily because this is a widely adopted feature dimension setting in current deep learning models, facilitating model implementation and integration. Simultaneously, considering that peptides have a simpler structure than complete proteins, this dimension is sufficient to encode their key information, achieving a good balance between feature representation capability and model computational complexity. It is understood that this specific value is merely a preferred embodiment, and those skilled in the art can adapt it to other dimensions (e.g., 512 dimensions, 1024 dimensions, etc.) according to actual task requirements and computational resources, as long as it achieves the purpose of mapping multimodal features to the same dimensional space and effectively fusing them.
[0036] For the sequence encoder, this embodiment employs a multilayer perceptron architecture. Specifically, the encoder receives peptide sequence features extracted by a pre-trained language model and processes them through a module containing two linear transformation layers. The first linear layer maps the input dimension to 1024 dimensions, then introduces non-linearity through a ReLU activation function, followed by layer normalization for the 1024 dimensions and a random deactivation operation with a ratio of 0.3. The second linear layer finally maps the features to a unified 768-dimensional output. This encoder effectively projects high-dimensional sequence semantic features into a unified feature space aligned with other modalities.
[0037] The structural encoder, built on the Transformer architecture, is used to capture the spatial dependencies between amino acid residues from the three-dimensional coordinate data of peptides. Its structural diagram is shown below. Figure 2 As shown in the left figure.
[0038] In some optional embodiments, the three-dimensional structural feature tensor is nonlinearly transformed and its dimensions are increased by the input projection layer in the structural encoder to achieve alignment between the data and model dimensions; in this embodiment, the specific parameters of the input projection layer are (3, 128).
[0039] The data, after nonlinear transformation and dimension alignment, is used for feature extraction through multi-layer coding blocks. Each coding block contains a multi-head self-attention mechanism and a feedforward neural network. The multi-head self-attention mechanism enables the model to simultaneously focus on multiple spatial relationships between different residue pairs, while the feedforward neural network performs nonlinear transformations on the features. In this embodiment, the coding block is set to two layers, with four attention heads configured in each layer, and the hidden layer dimension of its feedforward network is 256.
[0040] Global average pooling is performed on the feature vector output by the encoded block along the sequence length dimension. The pooled features are then mapped to a preset uniform feature dimension (such as 768 dimensions) through a linear projection layer, thereby outputting a structural feature vector consistent with the feature dimensions of other modalities.
[0041] The data input to the structural encoder is a 3D structural feature tensor extracted by GVP. It undergoes nonlinear transformation and dimension alignment through the input projection layer in the structural encoder. Instead of relying on the complex coordinate encoding of Transformer to encode the input data, Transformer-based encoding blocks are used only during feature encoding, thus focusing on the utilization of high-level geometric semantics.
[0042] In some optional embodiments, the trajectory encoder is a multilayer perceptron, the structural diagram of which is shown below. Figure 2 As shown in the right figure, it includes a linear transformation layer, an activation function layer, a layer normalization layer, a random deactivation layer, and an output projection layer, which are responsible for performing nonlinear transformations and dimension mapping on the trajectory feature vectors to map them to a unified feature dimension.
[0043] Specifically, the trajectory encoder receives a trajectory feature vector containing global features after being extracted by clean-contact and subjected to temporal averaging. Since the temporal dimension has already been aggregated through average pooling in the previous steps, the encoder does not need to process the time series again. Its core is a multilayer perceptron, specifically including two linear transformation layers. The first linear layer maps the input feature dimension to 512 dimensions, and then sequentially passes it through the ReLU activation function, layer normalization, and a random deactivation operation with a dropout ratio of 0.3 to extract robust dynamic contact features. This process does not include recurrent or convolutional operations on the temporal dimension. The second linear layer maps the 512-dimensional features to a preset unified feature dimension (such as 768 dimensions). Through this structure, the trajectory encoder efficiently embeds the feature data characterizing the dynamic properties of peptides into a unified dimensional feature space aligned with other modal features.
[0044] The Text encoder is used to process the numerical and standardized biological metadata features. The encoder adopts a multilayer perceptron (MLP) structure with a random deactivation mechanism (Dropout), which receives integer encoded vectors representing biological metadata and maps them to a preset uniform feature dimension (such as 768 dimensions) through nonlinear transformation.
[0045] Furthermore, the feature vectors of the same dimension output from the four sub-encoders in the multi-channel encoder are fused. In this embodiment, they are concatenated and fused into a single combined feature vector, the vector form of which is... The peptide is then linearly transformed using a projection head (typically a fully connected layer) to map it to the target feature dimension (e.g., 768-dimensional), thus obtaining a fused feature representation of the peptide. This fused feature representation integrates the peptide's sequence, structure, trajectory, and biological metadata, providing a robust and information-rich feature foundation for subsequent conditional predictions.
[0046] Step S3 aims to achieve strain-conditional peptide activity prediction, i.e., generating differentiated feature representations based on different target strains. The core of this step is to utilize a learnable strain embedding table to transform discrete strain identification information into continuous semantic vectors, thereby enabling the model to generate differentiated feature representations based on different target strains.
[0047] In some embodiments, the step of generating multiple conditional feature representations corresponding to each target bacterial species by combining the fusion feature representation of the peptide with the identification information of multiple target bacterial species through a learnable bacterial species embedding table includes: The fusion feature representation of the peptide is replicated a corresponding number of times according to the number of target bacterial species, so as to generate multiple replication feature representations in parallel with the same number of target bacterial species; The identification information of each target bacterial species is converted into a corresponding identification vector, resulting in a full permutation identification vector containing the identification information of each target bacterial species. Using the full permutation identifier vector, the species features of each target species are extracted through the learnable species embedding table, and each species feature is fused with a replication feature representation to generate multiple conditional feature representations.
[0048] Specifically, the learnable species embedding table is implemented in the model as a trainable parameter matrix, called the species embedding matrix, with dimensions of . ,in Let D be the total number of bacterial species supported by the model (e.g., 413), and D be the uniform feature dimension (e.g., 768). This matrix is randomly initialized at the start of training and optimized along with other model parameters during training through backpropagation. This allows each row (i.e., the D-dimensional vector corresponding to each bacterial species ID) to gradually learn a distributed representation characterizing the unique biological background of that bacterial species. During inference, this matrix serves as a lookup table, retrieving the corresponding feature vector by indexing the bacterial species ID.
[0049] In the processing, the single fusion feature of the peptide obtained in step S2 is first represented. The system replicates the data according to the number of target bacterial species to be predicted, generating a replicated feature representation with the same number of target bacterial species. This operation provides the foundation for subsequent parallel fusion with features from different bacterial species.
[0050] Simultaneously, the identifiers (e.g., ID numbers) of each target bacterial species are converted into standard identifier vectors, and these vectors are combined to form a permutation vector containing all the identifiers of the target bacterial species. This vector is then used as an index to query the embedding table, thereby obtaining the embedding vector corresponding to each target bacterial species in parallel. .
[0051] Finally, the embedding vector corresponding to each target bacterial species is... This is achieved by fusing the replication feature representation of the corresponding peptide, for example, through element-wise addition. This generates a unique conditional feature representation for each target bacterial species.
[0052] This mechanism is equivalent to telling the model, "Now please examine this peptide from the perspective of 'Staphylococcus aureus'." In other words, the model can enable the general characterization of the same peptide to be dynamically adjusted specifically in different bacterial contexts (i.e., under the influence of different bacterial feature vectors). Thus, a single model can be used to generate predictions for the peptide against multiple different bacterial species in parallel, fundamentally achieving multi-species-specific activity prediction.
[0053] In some optional embodiments, the total loss function used during the training of the multi-species peptide activity prediction model includes a two-dimensional contrastive loss function and a cross-entropy loss function. Specifically, the two-dimensional contrastive loss function provided in this embodiment of the invention optimizes both the contrastive learning objective and the classification prediction objective simultaneously during the backpropagation phase of model training through a dual-task joint optimization mechanism.
[0054] Specifically, the comparative learning objective, through the aforementioned dual-dimensional contrastive loss function (built based on InfoNCE), enables the model to bring together the representations of samples belonging to the same bacterial species in the feature space, while also bringing together the representations of samples with the same activity level. This dual constraint ensures that the learned fused feature space possesses both species discrimination and activity discrimination, providing a more discriminative and generalizable feature foundation for classification tasks.
[0055] The classification prediction objective is to directly supervise the model output's final classification prediction of peptide activity through the cross-entropy loss function (e.g., outputting probability distributions corresponding to three categories: inactive, low-activity, and high-activity, in the form of...). ,in N (For the number of samples), to ensure that the model can make accurate judgments on the activity category.
[0056] Figure 3 This is a schematic diagram illustrating the process of constructing a two-dimensional contrastive loss function for training a model, as provided in an embodiment of the present invention. Figure 3 As shown, the construction process of the two-dimensional contrastive loss function includes: Calculate a training batch N The cosine similarity between the fused feature representations of all peptides in the training samples is used to obtain a... Similarity matrix S ; in, Figure 3Part A of the diagram shows examples of peptide samples in a training batch, including a species identifier (Species 1 or Species 2) and an activity label (Inactive or High Active) for each sample, with a batch size of 4.
[0057] Figure 3 Part B of the diagram illustrates the construction process of the dual-mask mechanism. The upper part constructs the first mask matrix based on the real bacterial species identification labels of the training samples. (Species mask matrix), where if two samples i and j If the actual bacterial strain identification label is the same, then the corresponding matrix element is the first value, that is... Otherwise, it is the second value, i.e. Typically, the diagonal elements of the matrix (representing the sample itself) are excluded.
[0058] The lower half consists of the real liveness labels from the training samples, which form the second mask matrix. (Activity mask matrix), where if two samples i and j If the activity tags are the same (e.g., 0, 1, and 2 correspond to no activity, low activity, and high activity, respectively), then the corresponding matrix element is the first value, i.e. Otherwise, it is the second value, i.e. Similarly, diagonal elements are excluded.
[0059] Based on similarity matrix respectively S With the first mask matrix Similarity matrix S With the second mask matrix Calculate the first contrast loss and the second contrast loss; and Figure 3 Part C of the diagram illustrates the weighted summation of the first and second contrastive losses to obtain a two-dimensional contrastive loss function. This joint optimization strategy enables the model to comprehensively utilize both strain and activity supervision signals.
[0060] Furthermore, both the first and second contrast losses are calculated using the InfoNCE-based loss formula:
[0061] Where Mask represents either the first mask matrix (species mask matrix) or the second mask matrix (activity mask matrix), and S represents the similarity matrix. This represents the temperature coefficient. In this embodiment, It can be set to 0.1.
[0062] The expression for calculating the two-dimensional contrastive loss function is as follows:
[0063] in, This represents the first mask matrix (species mask matrix). This represents the second mask matrix (active mask matrix). This represents the first loss calculated based on the bacterial species mask. This represents the second loss calculated based on the liveness mask. This represents the strain weighting coefficient, used to balance the relative importance of strain uniformity constraints and activity uniformity constraints in the overall contrast loss. In this embodiment, The value is 0.5, which assigns equal weight to both dimensions.
[0064] The total loss function used for model training is the sum of the two-dimensional contrastive loss and the cross-entropy loss, thereby achieving joint optimization of the two tasks. Its calculation expression is as follows:
[0065] in, The cross-entropy loss function is used. Through this total loss function, the model can simultaneously improve the discriminative power of the feature space (by comparing and learning the target) and the accuracy of the final activity classification (by predicting the target through classification), thereby significantly improving the peptide activity prediction performance in complex scenarios with multiple bacterial species.
[0066] Step S4 is the final output stage of the prediction method of this invention. Its function is to convert the multiple conditional feature representations generated in step S3, which are specific to each target bacterial species, into predictions of the peptide's activity category against each target bacterial species, and ultimately form the complete antimicrobial spectrum of the peptide.
[0067] Specifically, for each target bacterial species, the model inputs its corresponding conditional feature representation into a shared or independent classifier head (typically a fully connected neural network layer). This classifier maps the high-dimensional features to a predefined activity class space (e.g., three output neurons corresponding to "inactive," "low-activity," and "high-activity"). Subsequently, through normalization, the probability distribution of the peptide sequence belonging to each activity class for that specific bacterial species is obtained.
[0068] Based on the above processing procedure for a single bacterial species, the model processes the conditional features corresponding to all target bacterial species in parallel, thereby outputting the input peptide sequence for all preset target bacterial species (assuming a quantity of...) in one go. The activity prediction results are calculated for each individual (unit). The final output constitutes a list containing... The output is a set of predicted terms, each corresponding to a target bacterial species and containing three probability values (corresponding to inactive, low-activity, and high-activity, respectively). This output format directly generates the antimicrobial spectrum of the peptide, clearly and completely revealing its activity against different bacterial species.
[0069] By employing the aforementioned prediction methods, this invention, through the introduction of molecular dynamics trajectories and metadata (text), captures dynamic conformational changes and biochemical background information that are unavailable in traditional static structural models, significantly improving the predicted F1 score and AUROC value. Furthermore, by introducing species embedding technology, it differentiates itself from traditional binary classification models, enabling a single model to simultaneously handle the activity prediction of hundreds of bacteria. This allows it to clearly indicate that a certain peptide is effective against *Staphylococcus aureus* but ineffective against *Escherichia coli*, greatly assisting in the design of narrow-spectrum / broad-spectrum antibacterial drugs. Simultaneously, the proposed dual-dimensional InfoNCE loss function forces the model to simultaneously cluster "same species" and "same activity" samples in the feature space. This supervised contrastive learning strategy addresses the label sparsity problem, resulting in stronger generalization ability on the test set, particularly excelling in fine-grained classification distinguishing between "high activity" and "low activity." Furthermore, the multi-species peptide activity prediction model adopts a modular design, and the encoders such as sequence, structure, and trajectory can be independently replaced or upgraded, making it easy to expand to more new biological modal data.
[0070] Figure 4 This is a schematic diagram of the structure of a multimodal, multi-species peptide activity prediction system provided in an embodiment of the present invention. Figure 4 As shown, the prediction system includes: The multimodal data acquisition module is used to acquire multimodal data of peptides, including peptide sequence data, structural data, trajectory data, and biological metadata. The multimodal feature extraction and fusion module is used to extract features from each modality of the multimodal data, and then map the extracted modal features to a feature space of a unified dimension through a multi-channel feature encoder to obtain the fused feature representation of the peptide. A conditional feature generation module is used to combine the fusion feature representation of the peptide with the identification information of multiple target bacterial species, and generate multiple conditional feature representations corresponding to each target bacterial species through a learnable bacterial species embedding table; and The prediction output module is used to output the activity prediction results of the peptide for each target bacterial species based on the multiple conditional feature representations.
[0071] Specifically, the multimodal data acquisition module acquires the following four types of multimodal data: amino acid sequence data of peptides, usually provided in FASTA format; static three-dimensional structure data of peptides, usually provided in protein database (PDB) format files, containing atomic coordinate information of peptides in space; dynamic conformational trajectory data of peptides, derived from molecular dynamics simulations, recording the conformational changes of peptides in solution over time; and bio-metadata related to peptides, existing in the form of structured text, such as background information such as the Gram attribute and taxonomic classification of the target bacterial species of the peptide.
[0072] The data input into the system are the sequence feature tensor, three-dimensional structural feature tensor, trajectory feature vector, and integer encoding vector obtained after feature extraction of each modality in the multimodal data.
[0073] The multi-channel feature encoders in the multimodal feature extraction and fusion module include: sequence encoders, structural encoders, trajectory encoders, and text encoders. The process of mapping the extracted modal features to a unified-dimensional feature space using a multi-channel feature encoder and then fusing them includes: The three-dimensional structural feature tensor is nonlinearly transformed and dimensionally aligned through the input projection layer in the structural encoder. The nonlinearly transformed and dimension-aligned data is processed through multi-layer coding blocks, where each coding block contains a multi-head self-attention mechanism and a feedforward neural network. The feature vector output by the coded block is subjected to global average pooling along the sequence length dimension and mapped to a uniform feature dimension.
[0074] Furthermore, the feature vectors output by the sequence encoder, structure encoder, trajectory encoder, and text encoder are concatenated to obtain a combined feature vector; A projection head is used to perform a linear transformation on the combined feature vector, mapping its dimensions to the unified feature dimension, in order to obtain the fusion feature representation of the peptide.
[0075] The conditional feature generation module generates multiple conditional feature representations corresponding to each target bacterial species, including: The fusion feature representation of the peptide is replicated a corresponding number of times according to the number of target bacterial species, so as to generate multiple replication feature representations in parallel with the same number of target bacterial species; The identification information of each target bacterial species is converted into a corresponding identification vector, resulting in a full permutation identification vector containing the identification information of each target bacterial species. Using the full permutation identifier vector, the species features of each target species are extracted through the learnable species embedding table, and each species feature is fused with a replication feature representation to generate multiple conditional feature representations.
[0076] The prediction output module corresponds to Figure 4 The classification and output section on the right. Specifically, each conditional feature is input into a shared classifier head (usually a linear layer). This classifier maps it to a predefined activity category (e.g., three output neurons corresponding to inactive, low-activity, and high-activity). The conditional features corresponding to all target bacterial species are processed in parallel, thus outputting the peptide's activity prediction result for all target bacterial species at once. Figure 4 As shown at the bottom, the output is a probability distribution with dimensions [Batch, Num_Species, 3]. That is, for each peptide in a batch, it gives the probability that it belongs to one of the three activity categories for each species (e.g., the 413 species in the example in the figure), directly generating the complete antimicrobial spectrum of the peptide.
[0077] Figure 4 The contrastive learning branch shown illustrates the key optimization mechanism of the system during the training phase. This mechanism utilizes a two-dimensional contrastive loss function, the construction of which includes: Calculate the similarity matrix between the fused feature representations of all training samples within a training batch; Based on the real bacterial species identification labels of the training samples, a first mask matrix is constructed, wherein if two samples have the same bacterial species identification label, the corresponding matrix element is the first value, otherwise it is the second value; Based on the real active labels of the training samples, a second mask matrix is constructed, wherein if the active labels of two samples are the same, the corresponding matrix element is the first value, otherwise it is the second value; Calculate the first contrast loss and the second contrast loss based on the similarity matrix and the first mask matrix, and the similarity matrix and the second mask matrix, respectively; and The first contrast loss and the second contrast loss are weighted and summed to obtain the two-dimensional contrast loss function.
[0078] Furthermore, the calculation expressions for the first contrast loss and the second contrast loss are as follows:
[0079] Wherein, Mask represents the first mask matrix or the second mask matrix, and S represents the similarity matrix. Indicates the temperature coefficient; The calculation expression for the two-dimensional contrastive loss function is as follows:
[0080] in, This represents the first mask matrix. This represents the second mask matrix. Indicates the first loss. This indicates the second loss. This represents the bacterial species weighting coefficient.
[0081] Figure 5 This is a schematic flowchart illustrating the training process of the multi-species peptide activity prediction model provided in this embodiment of the invention. Figure 5 As shown, this process details how a model utilizes multimodal data for forward propagation, loss calculation, and backpropagation optimization within a training epoch. Its core lies in employing Automatic Mixed Precision (AMP) and GradScaler techniques to achieve efficient and stable joint optimization training.
[0082] First, the process begins by retrieving a batch of training samples from the training data loader (train_loader). Each sample contains the multimodal data described in the claims: peptide sequence data, three-dimensional structural data, molecular dynamics trajectory data, biological metadata, and corresponding ground truth labels (species identifiers and activity tags). This data is then transferred to a GPU device to accelerate computation.
[0083] After zeroing the optimizer gradient, training enters the Automatic Mixed Precision (AMP) context. Performing forward propagation of the model within this context significantly reduces memory usage and improves computation speed, making it particularly suitable for processing computationally intensive multimodal data such as 3D structures and trajectories. Forward propagation invokes the multimodal multi-species peptide activity prediction model described in the claims. The model sequentially performs feature extraction, fusion, and conditional feature generation operations, ultimately outputting feature projections (for comparative learning) and classification logistic values.
[0084] Joint loss calculation is the core of the training strategy in this invention. The system calculates two losses in parallel: a two-dimensional contrastive loss based on the aforementioned method, utilizing species and activity masks to calculate a contrastive loss on feature projection aimed at improving feature discriminativeness; and a cross-entropy classification loss calculated on the classification logistic value, directly supervising the model's accuracy in classifying the activity of multiple species. Subsequently, the two losses are weighted and summed to obtain the total loss, thereby achieving joint optimization of the contrastive learning objective and the classification prediction objective.
[0085] To overcome the gradient underflow problem that may occur in mixed-precision training, a gradient scaler is introduced into the process. Specifically, the scaler is called to scale the total loss; then, backpropagation is performed based on the scaled loss to calculate the gradients of the model parameters.
[0086] After gradient calculation is complete, the optimizer step (Scaler step(optimizer)) is executed using the scaler. This step internally descales the gradients before applying the optimizer to update the parameters. Subsequently, the internal state of the gradient scaler is updated (Scaler update) to prepare for the next batch.
[0087] The above steps are repeated within a training cycle until all batches are completed. After a complete cycle, the process typically moves to the validation phase to evaluate model performance and saves the current optimal model weights when certain conditions are met.
[0088] Thirdly, the present invention provides a machine-readable storage medium storing instructions for causing a machine to execute the multimodal multi-species peptide activity prediction method described in any of the preceding claims of this application.
[0089] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0090] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0091] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0092] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0093] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0094] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0095] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0096] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0097] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for predicting the activity of multiple bacterial peptides based on multimodality, characterized in that, The prediction method is based on a multi-strain peptide activity prediction model and involves the following steps: Acquire multimodal data of peptides, including peptide sequence data, structural data, trajectory data, and biological metadata; Feature extraction is performed on each modality of the multimodal data. The extracted modal features are then mapped to a feature space of a unified dimension and fused using a multi-channel feature encoder to obtain the fused feature representation of the peptide. The fusion feature representation of the peptide is combined with the identification information of multiple target bacterial species, and multiple conditional feature representations corresponding to each target bacterial species are generated through a learnable bacterial species embedding table. as well as Based on the multiple conditional features, the activity prediction results of the peptides for each target bacterial species are output.
2. The prediction method according to claim 1, characterized in that, The step of extracting features from each modality of the multimodal data includes: After standardizing and data augmenting the sequence data, feature extraction is performed on the processed sequence data based on a pre-trained language model to obtain a sequence feature tensor. The structural data is standardized and length-uniformed. Based on a geometric deep learning model, features are extracted from the processed structural data to obtain a three-dimensional structural feature tensor. Obtain the configurations at different time steps in the trajectory data, extract the contact map feature vectors of each time step configuration, and calculate the average value of the contact map feature vectors for all time steps to obtain the trajectory feature vector; and The biological metadata is numerically encoded and its length is standardized to obtain an integer encoded vector.
3. The prediction method according to claim 2, characterized in that, The multi-channel feature encoder includes: a sequence encoder, a structure encoder, a trajectory encoder, and a text encoder. The process of mapping the extracted modal features to a unified-dimensional feature space using a multi-channel feature encoder and then fusing them includes: The three-dimensional structural feature tensor is nonlinearly transformed and dimensionally aligned through the input projection layer in the structural encoder. The nonlinearly transformed and dimension-aligned data is processed through multi-layer coding blocks, where each coding block contains a multi-head self-attention mechanism and a feedforward neural network. The feature vectors output by the coded block are subjected to global average pooling along the sequence length dimension and mapped to a feature space of uniform dimension.
4. The prediction method according to claim 3, characterized in that, The process of mapping the extracted modal features to a unified-dimensional feature space using a multi-channel feature encoder and then fusing them includes: The trajectory encoder sequentially performs linear dimensionality upscaling, nonlinear activation, layer normalization, random deactivation, and linear projection on the trajectory feature vector to map it to a feature space of uniform dimension.
5. The prediction method according to claim 3 or 4, characterized in that, The process of mapping the extracted modal features to a unified-dimensional feature space using a multi-channel feature encoder and then fusing them includes: The feature vectors output by the sequence encoder, structure encoder, trajectory encoder and text encoder are concatenated to obtain a combined feature vector; A projection head is used to perform a linear transformation on the combined feature vector, mapping its dimensions to a feature space of uniform dimension, in order to obtain the fusion feature representation of the peptide.
6. The prediction method according to claim 1, characterized in that, The process of representing the fusion features of the peptide, combining the identification information of multiple target bacterial species, and generating multiple conditional feature representations corresponding to each target bacterial species through a learnable bacterial species embedding table includes: The fusion feature representation of the peptide is replicated a corresponding number of times according to the number of target bacterial species, so as to generate multiple replication feature representations in parallel with the same number of target bacterial species; The identification information of each target bacterial species is converted into a corresponding identification vector, resulting in a full permutation identification vector containing the identification information of each target bacterial species. Using the full permutation identifier vector, the species features of each target species are extracted through the learnable species embedding table, and each species feature is fused with a replication feature representation to generate multiple conditional feature representations.
7. The prediction method according to claim 1, characterized in that, The total loss function used in the training of the multi-strain peptide activity prediction model includes a two-dimensional contrastive loss function and a cross-entropy loss function. The construction process of the two-dimensional contrastive loss function includes: Calculate the similarity matrix between the fused feature representations of all training samples within a training batch; Based on the real bacterial species identification labels of the training samples, a first mask matrix is constructed, wherein if two samples have the same bacterial species identification label, the corresponding matrix element is the first value, otherwise it is the second value; Based on the real active labels of the training samples, a second mask matrix is constructed, wherein if the active labels of two samples are the same, the corresponding matrix element is the first value, otherwise it is the second value; Calculate the first contrast loss and the second contrast loss based on the similarity matrix and the first mask matrix, and the similarity matrix and the second mask matrix, respectively; and The first contrast loss and the second contrast loss are weighted and summed to obtain the two-dimensional contrast loss function.
8. The prediction method according to claim 7, characterized in that, The calculation expressions for the first contrast loss and the second contrast loss are as follows: Wherein, Mask represents the first mask matrix or the second mask matrix, and S represents the similarity matrix. Indicates the temperature coefficient; The calculation expression for the two-dimensional contrastive loss function is as follows: in, This represents the first mask matrix. This represents the second mask matrix. Indicates the first loss. Indicates the second loss. This represents the bacterial species weighting coefficient.
9. A multimodal, multi-species peptide activity prediction system, characterized in that, The prediction system includes: The multimodal data acquisition module is used to acquire multimodal data of peptides, including peptide sequence data, structural data, trajectory data, and biological metadata. The multimodal feature extraction and fusion module is used to extract features from each modality of the multimodal data, and then map the extracted modal features to a feature space of a unified dimension through a multi-channel feature encoder to obtain the fused feature representation of the peptide. A conditional feature generation module is used to combine the fusion feature representation of the peptide with the identification information of multiple target bacterial species, and generate multiple conditional feature representations corresponding to each target bacterial species through a learnable bacterial species embedding table; and The prediction output module is used to output the activity prediction results of the peptide for each target bacterial species based on the multiple conditional feature representations.
10. A machine-readable storage medium storing instructions for causing a machine to perform the multimodal multi-species peptide activity prediction method as described in any one of claims 1-8.