Molecular structure inference method, electronic device, and computer-readable storage medium

By combining deep neural network models with feature extraction and fusion techniques from multispectral data, the accuracy and efficiency issues of molecular structure prediction in existing technologies have been resolved, enabling rapid and accurate prediction of molecular structures, which can be applied to fields such as drug development and materials design.

CN120473022BActive Publication Date: 2026-04-07PEKING UNIV SHENZHEN GRADUATE SCHOOL
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-28
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing technologies suffer from poor noise resistance, low computational efficiency, and insufficient model generalization when dealing with complex molecular systems, making it impossible to predict molecular structures quickly and accurately, thus limiting their application in high-throughput analysis.

Method used

A deep neural network model is used in conjunction with multispectral data for feature extraction and feature fusion. Through joint decoding by the encoder and decoder, the model is optimized using the cross-entropy loss function to achieve rapid and accurate prediction of molecular structure.

Benefits of technology

It has achieved a breakthrough in improving the accuracy and efficiency of molecular structure inference, enabling rapid and accurate prediction of molecular structures, and is applicable to fields such as drug development, materials design, and chemical synthesis planning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120473022B_ABST
    Figure CN120473022B_ABST
Patent Text Reader

Abstract

The application discloses a molecular structure inference method, an electronic device and a computer readable storage medium, and relates to the technical field of molecular spectroscopy. The method comprises the following steps: determining a multispectral data set comprising multispectral data of at least one training molecule, wherein the multispectral data comprises data of infrared spectroscopy, ultraviolet spectroscopy, nuclear magnetic resonance spectroscopy and mass spectrometry; inputting the multispectral data into a molecular structure inference model for model training, wherein the molecular structure inference model is a deep neural network model, comprising an encoder for feature extraction and feature fusion of the multispectral data, and a decoder for joint decoding according to preset mass spectrometry information and the output of the encoder; performing cross-entropy loss function calculation according to a real molecular structure and a predicted molecular structure, so as to update the molecular structure inference model; and performing molecular structure inference on a to-be-tested molecule according to the trained molecular structure inference model. The application realizes fast and accurate prediction of the molecular structure of a molecule.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of molecular spectroscopy, in particular to a molecular structure inference method, an electronic device and a computer readable storage medium. BACKGROUND

[0002] Molecular spectroscopy plays an important role in chemical analysis, environmental monitoring and biomedicine. By analyzing molecular spectroscopy data, key information about molecular composition, structure and dynamic process can be obtained, which is of great significance for drug development, pollution detection and disease diagnosis. However, the molecular structure inference method based on traditional statistical model or single physical model has the problems of poor anti-noise ability, low computational efficiency and insufficient model generalization when dealing with complex molecular systems, that is, it cannot quickly and accurately predict the molecular structure, thereby limiting its application in high-throughput analysis.

[0003] The above content is only used to assist in understanding the technical solutions of the present application and does not represent the acknowledgement of the above content as prior art. SUMMARY

[0004] The main purpose of the present application is to provide a molecular structure inference method, an electronic device and a computer readable storage medium, which aims to solve the technical problem of how to quickly and accurately predict the molecular structure of a molecule.

[0005] To achieve the above purpose, the present application provides a molecular structure inference method, which comprises:

[0006] determining a multi-spectral data set containing multi-spectral data of at least one training molecule, wherein the multi-spectral data includes data of infrared spectrum, ultraviolet spectrum, nuclear magnetic resonance spectrum and mass spectrum;

[0007] inputting the multi-spectral data in the multi-spectral data set into a preset molecular structure inference model for model training to obtain a predicted molecular structure, wherein the molecular structure inference model is a deep neural network model, which includes an encoder for feature extraction and feature fusion of the multi-spectral data, and a decoder for joint decoding according to preset mass spectrum information and the output of the encoder;

[0008] calculating a cross-entropy loss function according to the true molecular structure of the training molecule and the predicted molecular structure to obtain a loss function value, and updating the molecular structure inference model according to the loss function value until a preset training end condition is met to obtain a trained molecular structure inference model;

[0009] inferring the molecular structure of a to-be-tested molecule according to the trained molecular structure inference model.

[0010] Optionally, the step of inputting the multi-spectral data in the multi-spectral data set into a preset molecular structure inference model for model training to obtain a predicted molecular structure comprises:

[0011] The multi-spectral data is input into an encoder in the preset molecular structure inference model, and the multi-spectral data is subjected to feature extraction and feature fusion by the encoder to obtain first spectral features;

[0012] The first spectral features and preset mass spectrum information are jointly decoded by the decoder, and a decoded result of the joint decoding is used to determine the predicted molecular structure.

[0013] Optionally, the step of inputting the multi-spectral data into an encoder in the preset molecular structure inference model and subjecting the multi-spectral data to feature extraction and feature fusion by the encoder to obtain first spectral features comprises:

[0014] For each spectral data in the multi-spectral data, the original spectral features of the spectral data are mapped to a high-dimensional embedding space, and then position encoding and spectral encoding are performed to obtain spectral feature embedding representations;

[0015] The spectral feature embedding representations corresponding to each spectral data are input into the encoder, the self-attention mechanism in the encoder is used to extract features from the spectral feature embedding representations, and the cross-attention mechanism in the encoder is used to weight and fuse the features extracted by the feature extraction to obtain multi-modal features, and the multi-modal features are used as the first spectral features.

[0016] Optionally, the step of jointly decoding the first spectral features and the preset mass spectrum information by the decoder comprises:

[0017] A real molecular structure of a training molecule is determined, wherein the real molecular structure is represented in the form of a SMILES sequence;

[0018] A discrete label of the SMILES sequence of the real molecular structure is mapped to a high-dimensional feature embedding vector, and position encoding is performed to obtain a first SMILES sequence;

[0019] High-definition mass spectrum features of the training molecule are determined according to the mass spectrum information, the high-definition mass spectrum features are spliced with the first SMILES sequence to obtain a second SMILES sequence;

[0020] The first spectral features and the second SMILES sequence are jointly decoded by the decoder.

[0021] Optionally, the step of jointly decoding the first spectral features and the second SMILES sequence by the decoder comprises:

[0022] determine, according to the self-attention mechanism of the decoder and the second SMILES sequence, a first representation feature for representing the dependency relationship of internal positions in the second SMILES sequence;

[0023] determine, according to the cross-attention mechanism of the decoder, the first representation feature and the first spectral feature, a second representation feature for representing the long-term dependency relationship of the first spectral feature and the second SMILES sequence, and determine the decoding result according to the second representation feature.

[0024] Optionally, the step of determining, according to the self-attention mechanism of the decoder and the second SMILES sequence, a first representation feature for representing the dependency relationship of internal positions in the second SMILES sequence, comprises:

[0025] convert the second SMILES sequence into a Q matrix, a K matrix and a V matrix through the self-attention mechanism of the decoder;

[0026] calculate a self-attention score matrix between each position and other positions in the second SMILES sequence according to the dot product of the Q matrix and the K matrix;

[0027] determine a mask matrix according to the length of the second SMILES sequence, wherein the mask matrix is a lower triangular matrix, the main diagonal and the positions below the main diagonal of the mask matrix are set as first elements representing visible position features, and the positions above the main diagonal are set as second elements representing invisible position features;

[0028] determine the attention weight of each position according to the Softmax function combined with the mask matrix and the self-attention score matrix, and perform weighted processing on the V matrix according to the attention weight to obtain the first representation feature for representing the dependency relationship of internal elements in the second SMILES sequence.

[0029] Optionally, the step of determining a multi-spectral data set containing multi-spectral data of at least one training molecule comprises:

[0030] According to a preset quantum chemical calculation strategy, obtain the multi-spectral data of the at least one training molecule, and aggregate all the multi-spectral data to obtain a multi-spectral data set containing multi-spectral data of the at least one training molecule, wherein the quantum chemical calculation strategy comprises: for nuclear magnetic resonance spectrum data, using MPW1PW91 functional and 6-311+G(2d, p) basis set for calculation, and for infrared spectrum and ultraviolet spectrum data, using B3LYP functional and def-TZVP basis set for calculation.

[0031] Optionally, after the step of determining a multi-spectral data set containing multi-spectral data of at least one training molecule, comprising:

[0032] The multispectral data in the multispectral data set is preprocessed, wherein the preprocessing includes data normalization, noise filtering and data enhancement processing.

[0033] According to the preprocessed multispectral data, the multispectral data in the multispectral data set is input into a preset molecular structure inference model for model training.

[0034] In addition, to achieve the above-mentioned purpose, the present application also provides an electronic device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the above-mentioned molecular structure inference method.

[0035] In addition, to achieve the above-mentioned purpose, the present application also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the above-mentioned molecular structure inference method.

[0036] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the steps of the above-mentioned molecular structure inference method.

[0037] In the embodiments of the present application, the multispectral data determined by the data of infrared spectrum, ultraviolet spectrum, nuclear magnetic resonance spectrum and mass spectrum provides high-precision and complete data support for model training of the molecular structure inference model. And since the molecular structure inference model is a deep neural network model, by combining the encoder in the deep neural network model to extract and fuse the features of the multispectral data, the accuracy and efficiency of the molecular structure inference can be greatly improved. And when training the decoder, the input of the decoder needs to consider not only the output of the encoder, but also the corresponding mass spectrum information, so as to improve the accuracy of the decoder output. And the cross-entropy loss function calculation is combined with the real molecular structure and the predicted molecular structure of the training molecule to update the molecular structure inference model until the preset training end condition is met, and the trained molecular structure inference model is obtained. Then, the molecular structure inference model is used to infer the molecular structure of the to-be-tested molecule. Thus, the trained molecular structure inference model can be used to quickly and accurately predict the molecular structure. BRIEF DESCRIPTION OF DRAWINGS

[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and serve to explain the principles of the present application together with the specification.

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, for those of ordinary skill in the art, the other drawings can be obtained based on these drawings without any creative effort.

[0040] Figure 1 A flowchart provided for the first embodiment of the molecular structure inference method of the present application;

[0041] Figure 2 A flowchart provided for the second embodiment of the molecular structure inference method of the present application;

[0042] Figure 3 A general flowchart of the molecular structure inference method of the present application;

[0043] Figure 4 An architecture diagram of the molecular structure inference model in the molecular structure inference method of the embodiment of the present application;

[0044] Figure 5 A pie chart of the generalization performance of the molecular structure inference method of the embodiment of the present application for the drug molecule data set;

[0045] Figure 6 A scatter plot of the generalization performance of the molecular structure inference method of the embodiment of the present application for the drug molecule data set;

[0046] Figure 7 A device structure diagram of the hardware running environment involved in the molecular structure inference method in the embodiment of the present application.

[0047] The object implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION

[0048] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application, and are not used to limit the present application.

[0049] In order to better understand the technical solutions of the present application, the following will be described in detail in combination with the drawings in the specification and specific embodiments.

[0050] Due to the high cost, data scarcity and difficulty in designing artificial features of obtaining molecular spectral data by experimental means at present; at the same time, the traditional inference method based on statistics or manual feature extraction is often difficult to meet the dual requirements of accuracy and speed under complex samples. Therefore, the embodiment obtains high-quality multispectral data through quantum chemical calculation, and trains a molecular structure inference model using a deep neural network to realize fast and accurate prediction of unknown molecular structures, thereby obtaining wide application in the fields of drug research and development, material design, chemical synthesis planning, etc.

[0051] Therefore, the multispectral data generated by quantum chemical calculation in the embodiment provides high-precision and complete basic data support for model training, and the automatic extraction and fusion technology of deep neural network for multi-modal spectral features is combined to realize a breakthrough in the accuracy and efficiency of molecular structure inference. This method has wide applicability and can be applied not only to the field of drug molecule design, but also to the development of new materials, optimization of chemical synthesis paths, etc. By innovatively combining teacher forced training and Beam Search strategy (a heuristic search algorithm), a highly intelligent analysis system is constructed, greatly reducing the need for human intervention, and the overall workflow efficiency is improved by about 40%. Experimental verification shows that this technology has broken through a number of key indicators in the test set: the bilingual evaluation substitute score reaches 0.970, the molecular effectiveness index is as high as 0.996, while maintaining a prediction accuracy of 0.930, fully demonstrating its advanced technology and practical reliability.

[0052] It should be noted that the execution subject of the embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device, a molecular structure inference device, etc. that can realize the above functions. The molecular structure inference device is taken as an example to illustrate the embodiment and the following embodiments.

[0053] Based on this, the application embodiment provides a molecular structure inference method, which refers to Figure 1 , Figure 1 The flowchart of the first embodiment of the molecular structure inference method of the application is shown.

[0054] In this embodiment, the molecular structure inference method is applied to the model owner, including steps S10-S40.

[0055] Step S10, determine a multispectral data set containing multispectral data of at least one training molecule.

[0056] It should be noted that the multispectral data includes data of infrared spectrum, ultraviolet spectrum, nuclear magnetic resonance spectrum and mass spectrum, etc.

[0057] Optionally, infrared spectrum can detect the vibration energy level transition caused by the absorption of infrared light of specific wavelength by molecules. Chemical bonds in molecules (such as O-H, C=O) have specific vibration frequencies, when the frequency of infrared light matches the vibration frequency of the bond, the light is absorbed, forming a characteristic absorption peak. Optionally, ultraviolet spectrum can detect the absorption of ultraviolet or visible light when the electron in the molecule jumps from the ground state to the excited state, which can be applied to the detection of molecules with conjugated double bonds, aromatic rings or chromophores (such as benzene, carotene). Optionally, nuclear magnetic resonance can be the phenomenon of absorption of radio frequency energy by atomic nuclei in a strong magnetic field. Nuclei in different chemical environments have different chemical shifts due to shielding effects, and nuclear magnetic resonance spectrum can reflect the surrounding electron distribution. Mass spectrometry can determine the molecular weight and structure by ionizing molecules and measuring their mass-to-charge ratio. Molecules are broken into ions in the ion source, separated by the mass analyzer, and the detector records the abundance of each ion.

[0058] Optionally, the data of infrared spectrum, ultraviolet spectrum, nuclear magnetic resonance spectrum and mass spectrum of the training molecules can be obtained in the pre-stored historical data, or can be obtained based on certain rules.

[0059] Optionally, the multi-spectral data can be an image data.

[0060] Optionally, the multi-spectral data set can be used for model training, such as model training of a preset molecular structure inference model, and the multi-spectral data in the multi-spectral data set can be used for model training.

[0061] Optionally, the training molecules can be chemical molecules, biological molecules, drug molecules, etc. (hereinafter referred to as molecules) with known molecular structure for model training, such as methane, ethanol, etc. Optionally, the true molecular structure of the training molecules is known.

[0062] Optionally, for any training molecule, the data of at least two of the infrared spectrum, ultraviolet spectrum, nuclear magnetic resonance spectrum and mass spectrum of the training molecule can be obtained to determine the multi-spectral data of the training molecule, and the multi-spectral data of a plurality of training molecules can be aggregated to obtain a multi-spectral data set.

[0063] Optionally, in an implementable embodiment, the step S10 of determining the multi-spectral data set containing the multi-spectral data of at least one training molecule comprises a step a10.

[0064] Step a10, according to the preset quantum chemical calculation strategy, obtaining the multi-spectral data of at least one training molecule, and aggregating all the multi-spectral data to obtain a multi-spectral data set containing the multi-spectral data of at least one training molecule.

[0065] It should be noted that the quantum chemistry calculation strategy includes calculating the nuclear magnetic resonance spectrum data by using the MPW1PW91 functional and the 6-311+G(2d,p) basis set, calculating the infrared spectrum and ultraviolet spectrum data by using the B3LYP functional and the def-TZVP basis set.

[0066] Optionally, the quantum chemistry calculation strategy can also include a geometry optimization task using the B3LYP functional and the 6-311+G(2d,p) basis set. It can also include that all calculations are completed by the Gaussian16 software package (version B.01). The training molecules of the multi-spectral data set can be selected from the QM9 data set.

[0067] Optionally, for any training molecule, a quantum chemistry calculation strategy can be used to determine or obtain the data of the infrared spectrum, the ultraviolet spectrum, the nuclear magnetic resonance spectrum and the mass spectrum of the training molecule.

[0068] Optionally, after obtaining the multi-spectral data of the plurality of training molecules, the multi-spectral data of the plurality of training molecules can be aggregated, or the multi-spectral data of the plurality of training molecules can be added to a preset training data set to obtain a multi-spectral data set containing multi-spectral data of at least one training molecule.

[0069] In this embodiment, the multi-spectral data is obtained by using the quantum chemistry calculation strategy, which can guarantee the high precision and integrity of the obtained multi-spectral data, and provides high-precision and complete data support for subsequent model training.

[0070] Optionally, in an implementable embodiment, after the step of determining the multi-spectral data set containing multi-spectral data of at least one training molecule in step S10, steps b10-b20 are included.

[0071] Step b10, pre-processing the multi-spectral data in the multi-spectral data set, wherein the pre-processing includes data normalization, noise filtering and data enhancement processing;

[0072] Step b20, according to the pre-processed multi-spectral data, performing the step of inputting the multi-spectral data in the multi-spectral data set into a preset molecular structure inference model for model training.

[0073] Optionally, the multispectral data of each training molecule in the multispectral dataset is preprocessed. Optionally, the multispectral data of each training molecule includes data of infrared spectrum, ultraviolet spectrum, nuclear magnetic resonance spectrum and mass spectrum. Different spectral data have different scales. Therefore, the multispectral data needs to be preprocessed. For example, the peak and intensity features of each spectral data are subjected to log transformation and Min-Max scaling, which is realized by a sklearn function, so as to map the features of different spectral data to a reasonable range.

[0074] Optionally, when performing data normalization processing, quantile normalization can be used to eliminate differences in the ranges of different instruments. The ultraviolet light absorption intensity (i.e. ultraviolet spectrum data), infrared light vibration frequency (i.e. infrared spectrum data) and the like are subjected to Min-Max standardization to the [0, 1] interval, and the nuclear magnetic resonance shielding constant (i.e. nuclear magnetic resonance spectrum data) is subjected to Z-Score standardization to retain the distribution characteristics.

[0075] Optionally, noise filtering can include decomposing high-frequency noise layers of nuclear magnetic resonance spectrum data by wavelet transform and removing them. Data enhancement processing can include sparse processing.

[0076] Optionally, the data in the multispectral dataset can be normalized to eliminate dimensional effects, and noise filtering and data enhancement processing (such as sparse processing) can also be performed to improve data robustness.

[0077] Optionally, the multispectral data generated by the quantum chemical calculation strategy can be stored in Gaussian output files (.log). Therefore, the Gaussian output files can be structured and parsed, the shielding constant and spin-spin coupling constant are extracted from the nuclear magnetic resonance calculation results by regular expression, and the vibration frequency and its corresponding absorption intensity are extracted from the infrared spectrum and ultraviolet spectrum calculation results; the mass spectrum data is subjected to feature reconstruction, the molecular formula is derived based on the accurate molecular weight by mass number matching algorithm, and the unsaturation of the molecule is calculated by combining the unsaturation formula; finally, the parsed spectral parameters and molecular feature data are uniformly converted into a standardized numerical matrix to construct a multi-modal training dataset. The multi-modal training dataset is used as the preprocessed multispectral dataset.

[0078] Optionally, the preprocessed multispectral dataset includes the preprocessed multispectral data of each training molecule. At this time, the preprocessed multispectral data can be input into a preset molecular structure inference model for model training.

[0079] In the embodiment, by preprocessing the multispectral data, such as data normalization, noise filtering and data enhancement processing, and then training the model, the multispectral data in different ranges can be brought into a reasonable range, avoiding the error phenomenon that the model mistakenly considers that the spectral data with large values is more important than the spectral data with small values during model training.

[0080] In step S20, the multispectral data in the multispectral data set is input into the preset molecular structure inference model for model training, and a predicted molecular structure is obtained.

[0081] It should be noted that the molecular structure inference model is a deep neural network model, which includes an encoder for feature extraction and feature fusion of the multispectral data, and a decoder for joint decoding based on the preset mass spectrum information and the output of the encoder.

[0082] Optionally, the molecular structure inference model can include one or more layers of encoders and one or more layers of decoders. Optionally, the encoder can be a Transformer (self-attention mechanism) architecture-based encoder. Optionally, the decoder can be a Transformer architecture-based decoder, which can be composed of multiple decoder layers stacked together, and each decoder layer can adopt a self-attention mechanism and a cross-attention mechanism.

[0083] Optionally, after the preset molecular structure inference model receives the input multispectral data (which can be preprocessed multispectral data), the molecular structure inference model can perform feature extraction and fusion on the multispectral data of the same training molecule.

[0084] For example, a customized Tokenization module can be set for each type of spectral data (including infrared spectrum, ultraviolet spectrum, nuclear magnetic resonance spectrum and mass spectrum data) of the same training molecule. The original spectral features of the multispectral data are mapped to a high-dimensional embedding space through linear transformation to obtain high-dimensional features, and position encoding and spectrum-specific encoding are superimposed in the high-dimensional features to form complete embedding representation. The embedding representation is input into the encoder, and the self-attention mechanism of the encoder extracts the dependency between Tokens to obtain discriminative spectral feature representation containing both local information and global features. The feature representations (i.e., discriminative spectral feature representations) extracted from different spectral data are fused, and the attention mechanism (such as cross-attention mechanism) can be used to weight and fuse the feature representations of each spectral data, and through information exchange, multi-scale and hierarchical comprehensive features (i.e., fused multi-modal features) are obtained to fully express the complementarity between modal information.

[0085] Optionally, the decoder in the embodiment can employ an autoregressive generation mechanism to obtain the comprehensive features from the encoder through a cross-attention module in the decoder for decoding.

[0086] Optionally, in the process of model training of the molecular structure inference model, a teacher forcing strategy can be employed, that is, a token of a simplified molecular linear input system (SMILES) of a real molecule is input to the decoder at each generation time step for supervised training, so as to optimize the model parameters and improve the accuracy of the generated SMILES sequence. In addition, in the inference stage of the molecular structure inference model, an autoregressive Beam Search strategy can be employed to generate the SMILES sequence, and chemical constraints (such as atom count, ring size, etc.) are imposed on the generated candidate sequence to ensure that the generated molecular structure is chemically legal.

[0087] Optionally, the molecular structure can be represented in various ways, such as SMILES (Simplified Molecular Input Line Entry System), InChI (International Chemical Identifier) molecular graph, or molecular formula, etc. In the present embodiment and subsequent embodiments, the molecular structure is only exemplified by a SMILES sequence. SMILES is a way to represent a molecular structure in the form of a string, which is more concise than a graphical structure. For example, the SMILES representation of benzene is clcccccl, which intuitively reflects the bond and ring structure of the compound.

[0088] Optionally, the multispectral data of at least one training molecule in the multispectral dataset or the preprocessed multispectral dataset can be input to the molecular structure inference model for model training, and the predicted molecular structure can be determined or obtained according to the output of the molecular structure inference model. Optionally, the predicted molecular structure can be represented by a SMILES sequence.

[0089] In step S30, the cross-entropy loss function is calculated according to the real molecular structure and the predicted molecular structure of the training molecule, the loss function value is obtained, and the molecular structure inference model is updated according to the loss function value until the preset training end condition is met, and the trained molecular structure inference model is obtained.

[0090] Optionally, the real molecular structure can be represented by a SMILES sequence.

[0091] Optionally, the preset training end condition can be a condition required to end the pre-training, which can be set as needed, and is not limited in the embodiment. For example, in the specific embodiment, the cross-entropy loss function of the molecular structure inference model can be set to converge, or the number of training rounds can be set to reach a set number of rounds, or the training time can be set to reach a set time, etc.

[0092] Optionally, when calculating the cross-entropy loss function, the index / mark corresponding to the SMILES sequence of the real molecular structure and the index / mark corresponding to the SMILES sequence of the predicted molecular structure can be input into the pre-set cross-entropy loss function for calculation to obtain a loss function value, and it is checked whether the loss function value converges. If not, it can be determined that the preset training end condition is not met, and the model parameters of the molecular structure inference model are updated in reverse according to the loss function value, and the molecular structure inference model is re-trained until the preset training end condition is met, and a trained molecular structure inference model is obtained.

[0093] Optionally, when re-training the molecular structure inference model, a teacher forcing strategy can be used, that is, the model does not use its own prediction at the previous time step as input at the next time step, but uses the real output at the previous time step as input at the next time step, so that the molecular structure inference model can quickly converge and can also prevent cumulative errors.

[0094] Optionally, in the embodiment, when performing end-to-end model training on the molecular structure inference model according to the multi-spectral data, the training process can use the real molecular structure as a supervision signal, and use the cross-entropy loss function to minimize the index or label error between the output of the molecular structure inference model and the real molecular structure, to optimize the model parameters in the encoder and the decoder of the molecular structure inference model.

[0095] Optionally, the process of constructing the molecular structure inference model can include: constructing a molecular structure inference model based on a Transformer decoder structure, the decoder uses an autoregressive generation mechanism, and uses cross-attention to obtain fused multi-modal spectral features from the encoder; in the model training process, a teacher forcing strategy is used, that is, the real SMILES Token is input into the decoder at each generation time step for supervised training, to optimize the model parameters and improve the sequence generation accuracy; in the inference stage, an autoregressive Beam Search strategy is used to generate a SMILES sequence, and chemical constraints such as atomic count and ring closure are applied to the generated candidate sequence to ensure the chemical legality of the generated molecular structure.

[0096] Step S40, according to the trained molecular structure inference model, the molecular structure of the to-be-tested molecule is inferred.

[0097] Optionally, after obtaining the trained molecular structure inference model, the molecular structure inference model can be directly used to infer the molecular structure of any to-be-tested molecule in actual application. That is, the multispectral data of the to-be-tested molecule is input into the trained molecular structure inference model, and the molecular structure of the to-be-tested molecule, such as the SMILES sequence of the to-be-tested molecule, is determined according to the output result.

[0098] In this embodiment, the multispectral data determined by determining the data including infrared spectrum, ultraviolet spectrum, nuclear magnetic resonance spectrum and mass spectrum provides high-precision and complete data support for model training of the molecular structure inference model. Moreover, since the molecular structure inference model is a deep neural network model, the feature extraction and feature fusion of the multispectral data can be realized by combining the encoder in the deep neural network model, so that the accuracy and efficiency of the molecular structure inference can be greatly improved. In addition, when training the model of the decoder, the input of the decoder needs to consider not only the output of the encoder but also the corresponding mass spectrum information, so as to improve the accuracy of the output of the decoder. Moreover, the cross-entropy loss function calculation is combined with the real molecular structure and the predicted molecular structure of the training molecule to update the molecular structure inference model until the preset training end condition is met, so as to obtain the trained molecular structure inference model, and then the molecular structure of the to-be-tested molecule is inferred according to the trained molecular structure inference model. In this way, the trained molecular structure inference model can be used to quickly and accurately predict the molecular structure.

[0099] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as the above first embodiment can be referred to the above introduction, and will not be described in detail. On this basis, please refer to Figure 2 In step S20, the multispectral data in the multispectral data set is input into the preset molecular structure inference model for model training to obtain the step of predicting the molecular structure, including steps S21-S22.

[0100] In step S21, the multispectral data is input into the encoder in the preset molecular structure inference model, and the multispectral data is feature-extracted and feature-fused by the encoder to obtain the first spectral feature.

[0101] Optionally, after the multispectral data is preprocessed, the multispectral data of any training molecule can be input into the molecular structure inference model set in advance, that is, the multispectral data can be first feature-extracted and feature-fused by the encoder to obtain the multi-modal fusion feature, which is used as the first spectral feature.

[0102] Optionally, for any training molecule, the multispectral data can be feature-extracted according to the self-attention mechanism in the encoder, and the multispectral data can be feature-fused according to the cross-attention mechanism in the encoder.

[0103] Optionally, in step S21, the multispectral data is input into an encoder in a preset molecular structure inference model, and the multispectral data is feature extracted and feature fused by the encoder to obtain a first spectral feature.

[0104] In step c10, for each spectral data in the multispectral data, the original spectral feature of the spectral data is mapped to a high-dimensional embedding space, and then position encoding and spectral encoding are performed to obtain a spectral feature embedding representation.

[0105] Optionally, the spectral data can be at least one of infrared spectral data, ultraviolet spectral data, nuclear magnetic resonance spectral data, and mass spectral data.

[0106] Optionally, the original spectral feature can include at least one of a feature of infrared spectral data, a feature of ultraviolet spectral data, a feature of nuclear magnetic resonance spectral data, and a feature of mass spectral data.

[0107] Optionally, the position encoding is an encoding of the position of different inputs. For example, if the input contains 500-dimensional input, a position encoding similar to 0-499 is needed. Through position encoding, the molecular structure inference model can know the position order of each spectral data of the input.

[0108] Optionally, the spectral encoding (i.e., spectrum-specific encoding) is to know which inputs belong to the same spectrum, such as 0-9 belonging to ultraviolet spectrum and 10-99 belonging to infrared spectrum. Through spectral encoding, the molecular structure inference model can know which spectrum each spectral data of the input is derived from.

[0109] Optionally, for each training molecule, a customized Tokenizer module can be set for each spectral data in the multispectral data, i.e., each spectral data can correspond to a Tokenizer module. The original spectral feature of the spectral data can be extracted through the Tokenizer module, and the original spectral feature can be mapped to a high-dimensional embedding space through linear transformation to obtain a high-dimensional mapping feature. The position encoding and the spectral encoding are superimposed in the high-dimensional mapping feature to obtain the spectral feature embedding representation.

[0110] Optionally, the nuclear magnetic resonance spectrum can be divided into blocks by the Tokenizer module according to the chemical shift, and then the spectral feature of the divided block is extracted to obtain the original spectral feature. The infrared spectrum can also be divided into blocks by the Tokenizer module according to the functional group feature frequency interval, and then the spectral feature of the divided block is extracted to obtain the original spectral feature. The mass spectrum can also be divided into blocks by the Tokenizer module according to the mass number interval, and then the spectral feature of the divided block is extracted to obtain the original spectral feature.

[0111] Optionally, the calculation manner of the spectral feature embedding representation can be determined or obtained by the following formula (I). Formula (I):

[0112] E f =Linear(X f )+P f +S f Formula (I);

[0113] wherein, E f is the spectral feature embedding representation, P f is the position encoding, S f is the spectrum-specific encoding, i.e., the spectral encoding, Linear(X f ) is the high-dimensional mapping feature of the original spectral feature.

[0114] Step c20, input the spectral feature embedding representation corresponding to each spectral data into the encoder, extract features of each spectral feature embedding representation through the self-attention mechanism in the encoder, and weight and fuse the features obtained through the feature extraction through the cross-attention mechanism of the encoder to obtain a multi-modal feature, and take the multi-modal feature as the first spectral feature.

[0115] Optionally, for each training molecule, the spectral feature embedding representation corresponding to each spectral data can be taken as an input parameter of the encoder and input into the encoder. Optionally, the encoder can execute the self-attention mechanism and the cross-attention mechanism synchronously or asynchronously.

[0116] Optionally, the encoder can extract the dependency relationship between each Token (i.e., Tokenizer module) according to the spectral feature embedding representation through the self-attention mechanism, and can perform self-attention mechanism calculation according to the following formula (II).

[0117] The calculation formula corresponding to the self-attention mechanism is:

[0118]

[0119] wherein, Q represents a query, K represents a key, and V is a value. The input parameter can be mapped to Q f , K f , V f through three matrices, respectively corresponding to query (query), key (key), and value (value), then perform self-attention calculation on the three matrices Q f , K f , V f , divide by d k for normalization processing, then calculate the attention weight through the softmax function, and then perform weighting processing according to the attention weight.

[0120] Q f may be a query matrix, K f may be a key matrix, V f may be a value matrix, d k may be the dimension of the spectral feature (such as the input spectral feature embedding representation) in the key matrix, and T may represent the transpose operation of the matrix. represents the transpose of the key matrix K f .

[0121] Optionally, the encoder can perform information interaction and weighted fusion on the spectral feature embedding representations corresponding to different spectral data through the cross-attention mechanism. Optionally, the cross-attention mechanism calculation can be performed according to the following formula (three).

[0122] The calculation formula corresponding to the cross-attention mechanism is:

[0123]

[0124] Q d may be a query matrix, and is different from Q f , Q d and Q f may be two different query matrices corresponding to the spectral feature embedding representations.

[0125] Optionally, the comprehensive encoder obtains the multi-modal feature based on the processing results of the self-attention mechanism and the cross-attention mechanism, and takes the multi-modal feature as the first spectral feature. Optionally, the encoder can first perform the self-attention mechanism to extract features from each spectral feature embedding representation, then perform the cross-attention mechanism to weight and fuse the extracted features, obtain the multi-modal feature, and take the multi-modal feature as the first spectral feature.

[0126] In this embodiment, by mapping the original spectral feature of the spectral data to a high-dimensional embedding space for each type of spectral data, then performing position encoding and spectral encoding to obtain the spectral feature embedding representation, and then inputting it into the encoder, using the self-attention mechanism of the encoder to extract features, and using the cross-attention mechanism of the encoder to fuse features, the multi-modal feature is obtained and taken as the first spectral feature, thereby ensuring the effectiveness of the obtained first spectral feature.

[0127] Step S22, jointly decoding the first spectral feature and the preset mass spectrum information according to the decoder, and determining the predicted molecular structure according to the decoding result of the joint decoding.

[0128] Optionally, the mass spectrum information can include atomic type information (such as atomic types C, N, O, F, etc.), unsaturation degree and molecular weight information, etc.

[0129] Optionally, the first spectral feature output by the encoder can be input into a decoder, the decoder jointly decodes the first spectral feature with the mass spectrum information, and then determines the predicted molecular structure according to the decoding result of the joint decoding. For example, if the decoding result of the joint decoding is a discrete identifier or index, a linear transformation can be performed on the discrete identifier or index to obtain the corresponding predicted molecular structure (such as a SMILES sequence).

[0130] In this embodiment, the first spectral feature is obtained by performing feature extraction and feature fusion on the multi-spectral data by the encoder, and the predicted molecular structure is determined by jointly decoding the first spectral feature and the mass spectrum information by the decoder, thereby ensuring the accuracy of the obtained predicted molecular structure.

[0131] Optionally, in step S22, the step of jointly decoding the first spectral feature and the preset mass spectrum information by the decoder includes steps d10-d40.

[0132] Step d10, determining the true molecular structure of the training molecule;

[0133] It should be noted that the true molecular structure is represented in the form of a SMILES sequence.

[0134] Optionally, the true molecular structure of the training molecule can be a known molecular structure in advance, which can be obtained from a network or historical storage data.

[0135] Step d20, mapping the discrete label of the SMILES sequence of the true molecular structure into a high-dimensional feature embedding vector and performing position encoding to obtain a first SMILES sequence;

[0136] Optionally, the discrete label can be a digital index / label, such as 0, 1, 2, etc.

[0137] Optionally, a SMILES vocabulary can be constructed to one-to-one correspond the chemical symbols in the SMILES vocabulary to the discrete labels (such as digital indexes). When constructing the SMILES vocabulary, all atomic symbols (such as C for C atom, O for O atom, N for N atom), bond types (such as = for double bond), parentheses and other symbols can be determined according to the grammar rules of SMILES. And the atomic symbols, bond types, ring labels, molecular parentheses, etc. can be used as basic Token. And the mapping relationship between each element in the SMILES sequence and the discrete label can be established. The mapping relationship between each Token in the SMILES sequence and the discrete label (such as digital index) can be determined.

[0138] Optionally, each Token in the SMILES sequence of the real molecular structure can be determined and queried in the SMILES vocabulary to determine the discrete label corresponding to each Token, and then the discrete label of the SMILES sequence of the real molecular structure is obtained, which can be 03414.

[0139] Optionally, the discrete label of the SMILES sequence of the real molecular structure can be mapped to a high-dimensional feature embedding vector, so that the model can capture the semantic relationship between symbols in the sequence (such as the semantic relationship between two discrete labels). Specifically, it can be realized by the following formula (four).

[0140]

[0141] Wherein, X smiles is the discrete label of the SMILES sequence (such as the discrete label of the SMILES sequence of the real molecular structure). d model is the embedding feature dimension.

[0142] Optionally, after obtaining the high-dimensional feature embedding vector, position encoding can be performed to obtain the first SMILES sequence, so that the model can perceive the position information of the SMILES sequence of the real molecular structure.

[0143] Step d30, determining the high-definition mass spectrum feature of the training molecule according to the mass spectrum information, and splicing the high-definition mass spectrum feature with the first SMILES sequence to obtain the second SMILES sequence;

[0144] Optionally, the mass spectrum information can be obtained in the mass spectrum data, and the high-definition mass spectrum feature contained in the mass spectrum information can be extracted.

[0145] Optionally, the high-definition mass spectrum feature can include atomic type information, such as the number of HCNOF atoms, with a length of 5. It can also include molecular weight information and unsaturation information, with a total length of 7.

[0146] Optionally, since the high-definition mass spectrum feature contains various information of the training molecule, such as the number of C and O in the molecule, this information is in the form of vector as a condition, and the first SMILES sequence is spliced to obtain the second SMILES sequence.

[0147] Optionally, for the mass spectrum information, atomic type information (such as C, N, O, F, etc. atomic type) and unsaturation information can be obtained in the mass spectrum information, and an additional high-definition mass spectrum feature representation layer is introduced to learn the relationship between the spectrum features, while the dimension of the high-definition mass spectrum feature is expanded to the same time dimension as the SMILES embedding sequence (i.e. the first SMILES sequence), so as to be superimposed (i.e. spliced) with the first SMILES sequence embedding, obtaining a second SMILES sequence, and inputting it as an input feature of the decoder.

[0148] Step d40, jointly decoding the first spectrum feature and the second SMILES sequence according to the decoder.

[0149] Optionally, the first spectrum feature and the second SMILES sequence can be input parameters of the decoder, and the first spectrum feature and the second SMILES sequence are jointly decoded by the decoder. That is, the input parameters of the decoder can include the output of the encoder (the first spectrum feature), the first SMILES sequence obtained by converting the real molecular structure of the test molecule, and the high-definition mass spectrum feature.

[0150] In this embodiment, the discrete label of the real molecular structure of the training molecule is mapped into a high-dimensional feature embedding vector and then position encoding is performed to obtain the first SMILES sequence, and then the high-definition mass spectrum feature is determined according to the mass spectrum information, and the first SMILES sequence is spliced to obtain the second SMILES sequence. Then, the first spectrum feature and the second SMILES sequence are jointly decoded by the decoder, thereby ensuring the effectiveness of the decoding.

[0151] Optionally, in step d40, the step of jointly decoding the first spectrum feature and the second SMILES sequence according to the decoder includes steps d41-d42.

[0152] Step d41, determining a first representation feature for representing the dependency relationship of the internal positions in the second SMILES sequence according to the self-attention mechanism of the decoder and the second SMILES sequence.

[0153] Optionally, the decoder includes multiple decoder layers, and each decoder layer can use the self-attention mechanism and the cross-attention mechanism to capture the long-term dependency relationship between the SMILES sequence (such as the second SMILES sequence) and the first spectrum feature.

[0154] Optionally, after inputting the first spectral feature and the second SMILES sequence into the decoder, the decoder can process the second SMILES sequence according to its self-attention mechanism to determine the dependency relationship of the internal positions in the second SMILES sequence, and output the first representation feature to represent the dependency relationship of the internal positions in the second SMILES sequence.

[0155] Optionally, the operation principle of the self-attention mechanism in the decoder is basically the same as that of the self-attention mechanism in the encoder.

[0156] Optionally, in step d41, according to the self-attention mechanism of the decoder and the second SMILES sequence, the step of determining the first representation feature for representing the dependency relationship of the internal elements in the second SMILES sequence includes steps d43-d46.

[0157] Step d43, converting the second SMILES sequence into Q matrix, K matrix and V matrix through the self-attention mechanism of the decoder;

[0158] Optionally, the core of the self-attention mechanism can be to calculate the correlation degree between each position and other positions in the second SMILES sequence through the interaction of Q and K, and then determine the attention score.

[0159] Optionally, the second SMILES sequence can be converted into Q matrix, K matrix and V matrix. Wherein, Q represents query, K represents key, and V is value.

[0160] Step d44, calculating the self-attention score matrix between each position and other positions in the second SMILES sequence according to the dot product of Q matrix and K matrix;

[0161] Optionally, when calculating the self-attention score, for each position in the second SMILES sequence, the dot product of Q matrix and K matrix can be calculated in the manner of formula (two) to determine the similarity matrix between each position and other positions. Optionally, the similarity matrix can be a self-attention score matrix.

[0162] Step d45, determining the mask matrix according to the length of the second SMILES sequence;

[0163] Step d46, determining the attention weight of each position according to the Softmax function combined with the mask matrix and the self-attention score matrix, and weighting the V matrix according to the attention weight to obtain the first representation feature for representing the dependency relationship of the internal elements in the second SMILES sequence.

[0164] It should be noted that the mask matrix is a lower triangular matrix, the main diagonal and the positions below the main diagonal of the mask matrix are set as the first elements indicating that the position characteristics are visible, and the positions above the main diagonal are set as the second elements indicating that the position characteristics are invisible.

[0165] Optionally, the size parameter of the mask matrix can be determined or obtained according to the length of the SMILES sequence. For example, for a SMILES sequence with a length of L, the size (length and width) of the corresponding mask matrix can be L x L. Therefore, the size parameter of the mask matrix can be determined according to the length of the second SMILES sequence, and then the mask matrix can be constructed according to the size parameter.

[0166] Optionally, the formula corresponding to the mask matrix can be formula (five).

[0167]

[0168] Wherein, Mask is the mask matrix, i and j are the width and height indexes of the mask matrix.

[0169] Optionally, the first element can be set to 0, and the second element can be set to negative infinity.

[0170] Optionally, the prediction of each sequence position generated by the model needs to mask the information of subsequent sequence positions to ensure compliance with the principle of autoregressive generation. Therefore, when the decoder adopts a self-attention mechanism to process the second SMILES sequence, the mask matrix can be used to mask the subsequent sequence position information of the second SMILES sequence.

[0171] Optionally, the mask matrix can be used to mask the future position information of the self-attention score matrix, and the mask matrix can act on each position of the self-attention score matrix. The following formula (six) can be referred to.

[0172]

[0173] Wherein, is the unmasked self-attention score matrix and the mask matrix, Q f is the Q matrix, K f is the K matrix, V f is the V matrix. Subsequently, when calculating the future position (i.e. the position with mask value -∞) by using the Softmax function, the corresponding attention weight tends to 0, thereby completely shielding the influence of future sequence information on the current prediction step.

[0174] In the embodiment, the second SMILES sequence is converted into a Q matrix, a K matrix and a V matrix by the self-attention mechanism of the decoder, the self-attention score matrix is determined according to the Q matrix and the K matrix, the mask matrix is determined according to the length of the second SMILES sequence, the attention weight is determined according to the Softmax function in combination with the mask matrix and the self-attention score matrix, the V matrix is weighted processed according to the attention weight, and the first representation feature is obtained, thereby ensuring the effectiveness of the determined first representation feature.

[0175] In step d42, the second representation feature for representing the long-term dependency relationship between the first spectral feature and the second SMILES sequence is determined according to the cross-attention mechanism of the decoder, the first representation feature and the first spectral feature, and the decoding result is determined according to the second representation feature.

[0176] Optionally, the operation principle of the cross-attention mechanism in the decoder is basically the same as that of the cross-attention mechanism in the encoder. And the execution order of the self-attention mechanism and the cross-attention mechanism in the decoder can also refer to the execution order of the self-attention mechanism and the cross-attention mechanism in the encoder.

[0177] Optionally, the cross-attention mechanism in the decoder mainly processes the mutual dependency relationship between the encoder (the first spectral feature) and the decoder (the first representation feature), which can be referred to as formula (seven).

[0178]

[0179] Wherein, the Q matrix of the cross-attention mechanism can be determined according to the first representation feature, that is, Q dec The K matrix and the V matrix of the cross-attention mechanism can be determined according to the first spectral feature, that is, K enc and V enc .

[0180] And the attention score can be calculated by the dot product of the Q matrix and the K matrix of the cross-attention mechanism, and the V matrix of the cross-attention mechanism is weighted processed according to the combination of the Soft max function and the attention score, thereby obtaining the second representation feature for representing the long-term dependency relationship between the first spectral feature and the second SMILES sequence, and then determining or obtaining the decoding result according to the second representation feature. Optionally, the decoding result can include discrete labels or indexes of the SMILES sequence.

[0181] Optionally, the decoding result can be linearly transformed to generate the SMILES sequence according to the SMILES word table constructed in advance.

[0182] Optionally, each decoding step generates a discrete label for the SMILES sequence, performs a linear transformation based on the generated discrete label, and outputs the SMILES sequence. The specific process of the linear transformation can be referred to in the following formula (VIII).

[0183] Y smiles =Linear(E out Formula (8);

[0184] Among them, E out For the decoding result, Y smiles For elements of the SMILES sequence.

[0185] Optionally, the molecular structure inference model can be trained iteratively, with each decoding step generating the next marker (such as a discrete marker or index) in the SMILES sequence, until the entire SMILES sequence is generated.

[0186] In this embodiment, the first characterization feature is determined based on the decoder's self-attention mechanism and the second SMILES sequence, and the second characterization feature is determined based on the cross-attention mechanism, the first characterization feature, and the first spectral feature, thereby determining the decoding result and ensuring the accuracy of the decoding result.

[0187] Furthermore, to aid in understanding the molecular structure deduction process described in this embodiment, examples are provided below, in conjunction with any of the above embodiments.

[0188] For example, such as Figure 3 As shown, for any chemical molecule (referred to as a molecule), quantum chemical calculations can be performed to generate multispectral data, which can be done using the Gaussian16 software package (version B.01). The multispectral data can then be aggregated to obtain a multispectral dataset, which can include four types of spectral data: infrared, ultraviolet, nuclear magnetic resonance (NMR), and mass spectrometry (MS). Optionally, the multispectral data in the dataset can be preprocessed and then input into the encoder (such as the Transformer encoder) in the molecular structure inference model for spectral feature encoding to obtain the first spectral feature. Then, combining the mass spectrometry information and the first spectral feature, the molecular structure is decoded using the decoder (such as the Transformer decoder) in the molecular structure inference model, and the predicted molecular structure is determined or obtained based on the decoding result.

[0189] In addition, refer to Figure 4 For any given chemical molecule, the multispectral data of the molecule is determined. The multispectral data can contain spectral information from each spectrum. For example, infrared and ultraviolet spectra contain spectral information such as peak value and intensity value. 1 H,13 C, 15 N, 17 O, 19 F Nuclear magnetic spectroscopy contains spectral information such as chemical shift, integral number, coupling constant and DEPT. Two-dimensional nuclear magnetic spectroscopy contains spectral information such as COSY (correlation spectrum), HSQC (heteronuclear single quantum coherence spectrum), INADEQUATE (natural abundance double quantum transfer experiment), J-resolved (J-resolved spectrum). Mass spectrometry contains spectral information such as molecular formula, unsaturation.

[0190] Multispectral data (such as mass spectrometry information, infrared, ultraviolet spectroscopy information, nuclear magnetic spectroscopy information) can be input into the encoder of the molecular structure inference model for spectral feature coding. The encoder can include a multi-layer Transformer encoder, such as L1-L N . And when the encoder encodes, it needs to consider the binary classification head, including whether there is C = O? Whether there is -OH? And also need to consider the counting head, such as the number of C, the number of O.

[0191] The mass spectrometry information can be processed by feature engineering, and the output of the encoder is used as the input of the decoder (such as a Transformer decoder) for molecular structure decoding to determine the molecular structure of the predicted molecule. When decoding, rule-based beam search is needed to determine the corresponding molecular structure. The rules can be the following, rule 1: molecular formula; rule 2: SMILES validity; rule 3 (optional): ring size. And based on rules 1-3, beam search is performed to obtain the corresponding decoding result.

[0192] In addition, corresponding auxiliary tasks can also be performed, such as determining the molecular formula (C x N y O z F t ; ring size), determining functional groups (-C = 0, -NH2, -OH), determining fine structure (-C-X, -C = X, -H-X), etc. And based on the auxiliary task, the condition for the decoder to decode (i.e. the rule in the figure) is determined.

[0193] In addition, the generalization performance verification of the molecular structure inference model in this embodiment is performed, and the drug molecule dataset L1300 is used for external testing to evaluate the prediction performance and application range of the model in real application scenarios. This dataset contains 632 FDA-approved drug molecules, covering a variety of different indications and having good representativeness. By counting the corresponding indications of these drug molecules in the clinic, it can be found that Figure 5The distribution of various diseases is clearly seen in the pie chart shown in the middle, including nervous system diseases (17.6%), infectious diseases (13.2%), metabolic diseases (12.8%), inflammatory diseases (12.8%), cancers (11.2%), malnutrition (10.4%), cardiovascular diseases (7.2%), immune diseases (5.6%), blood diseases (4.0%), skin diseases (2.8%), and endocrine diseases (2.4%), etc. This distribution intuitively shows the main treatment areas involved in the L1300 dataset, which is relatively extensive and scattered, and can help us more comprehensively verify the generalization ability of the model in different disease areas.

[0194] With reference to Figure 6 The scatter plot in the middle shows the relationship between molecular structure similarity (Yamamoto similarity) and predicted SMILES similarity (measured by BLEU score) on this dataset, where the Pearson correlation coefficient (r) is as high as 0.88. It can be seen that the Yamamoto similarity and the BLEU score show a significant positive correlation: when the molecular structures are more similar, the model BLEU score is usually also higher. This to some extent illustrates that the model can better capture the correspondence between molecular structures. Overall, the experimental results based on the L1300 dataset show that the model can still maintain good prediction accuracy when dealing with real drug molecules of different structures and diverse indications, demonstrating strong generalization ability. This not only shows that the model has migratory ability on external datasets, but also provides important feasibility evidence for subsequent applications in larger or more complex drug molecule libraries.

[0195] In addition, to achieve the above object, an electronic device is provided, comprising: at least one processor; and a memory in communication connection with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the molecular structure inference method in the above embodiment I.

[0196] Reference will now be made to the following description Figure 7FIG. 1 shows a structural diagram of an electronic device suitable for implementing embodiments of the present application. The electronic device in embodiments of the present application can include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (Personal Digital Assistant), a PAD (Portable Application Description), a PMP (Portable Media Player), a car terminal (e.g., a car navigation terminal), and the like, as well as a stationary terminal such as a digital TV, a desktop computer, and the like. The device shown in the figure is merely an example and should not impose any limitation on the function and use range of embodiments of the present application.

[0197] The electronic device can include a processing device 1001 (e.g., a central processor, a graphic processor, etc.) that can perform various appropriate actions and processes according to a program stored in a ROM (Read Only Memory) 1002 or a program loaded into a RAM (Random Access Memory) 1004 from a storage device 1003. In the RAM 1004, various programs and data required for device operation are also stored. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. An I / O (Input / Output) interface 1006 is also connected to the bus. In general, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, and the like; an output device 1008 including, for example, an LCD (Liquid Crystal Display), a speaker, a vibrator, and the like; the storage device 1003 including, for example, a magnetic tape, a hard disk, and the like; and a communication device 1009. The communication device 1009 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although an electronic device having various systems is shown in the figure, it should be understood that all of the systems shown are not required to be implemented or provided. More or less systems can be alternatively implemented or provided.

[0198] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program codes for executing the method shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiments disclosed in the present application are executed.

[0199] The electronic device provided by the present application adopts the molecular structure inference method in the above-mentioned embodiments, and can realize fast and accurate prediction of the molecular structure of molecules. Compared with the prior art, the electronic device provided by the present application has the same beneficial effects as the molecular structure inference method provided by the above-mentioned embodiments, and other technical features in the molecular structure inference device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.

[0200] It should be understood that parts of the present application can be realized by hardware, software, firmware or a combination thereof. In the description of the above-mentioned embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0201] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

[0202] The present application provides a computer readable storage medium having stored thereon computer readable program instructions (i.e. computer program) for executing the molecular structure inference method in the above-mentioned embodiments.

[0203] The computer readable storage medium provided in the present application may, for example, be a U disk, but is not limited to an electric, magnetic, optical, electromagnetic, infrared, or semiconductor system, system, or device, or any combination of the above. More specific examples of the computer readable storage medium can include, but are not limited to, an electric connection with one or more conductive wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present embodiment, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer readable storage medium can be transmitted in any suitable medium, including but not limited to an electric wire, an optical cable, an RF (Radio Frequency), and the like, or any suitable combination of the above.

[0204] The above computer readable storage medium can be contained in an electronic device, or can exist separately without being assembled into an electronic device.

[0205] The above computer readable storage medium carries one or more programs, which, when executed by the electronic device, enable the electronic device to perform the step flow of the above molecular structure inference method.

[0206] Computer program code for carrying out operations of the present application can be written in one or more programming languages or combinations of languages including object oriented programming languages such as Java, Smalltalk, C++ or conventional procedural programming languages such as "C" or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0207] The flow and block diagrams in the drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flow and block diagrams can represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may be executed in the reverse order, depending on the functionality involved. It will also be noted that each block of the block diagrams and / or flowchart illustrations, and combinations thereof, can be implemented by special purpose hardware-based systems that perform the specified functions or operations, or combinations of special purpose hardware and computer instructions.

[0208] The modules involved in the embodiments of the present application can be implemented in software or in hardware. In some cases, the names of the modules do not limit the modules themselves.

[0209] The readable storage medium provided by the present application is a computer readable storage medium, which stores computer readable program instructions (i.e., a computer program) for executing the above-mentioned molecular structure inference method, and can realize fast and accurate prediction of the molecular structure of a molecule. Compared with the prior art, the computer readable storage medium provided by the present application has the same beneficial effects as the molecular structure inference method provided by the above-mentioned embodiments, which will not be repeated here.

[0210] The present application also provides a computer program product comprising a computer program, which, when executed by a processor, implements the steps of the above-mentioned molecular structure inference method.

[0211] The computer program product provided by the present application can realize fast and accurate prediction of the molecular structure of a molecule. Compared with the prior art, the computer program product provided by the present application has the same beneficial effects as the molecular structure inference method provided by the above-mentioned embodiments, which will not be repeated here.

[0212] The above only describes some embodiments of the present application, and does not limit the patent scope of the present application. Any equivalent structural transformation made by using the content of the present application specification and drawings, or direct / indirect application in other related technical fields is included in the patent protection scope of the present application.

Claims

1. A method for deducing molecular structure, characterized in that, The molecular structure deduction method includes: A multispectral dataset containing multispectral data of at least one training molecule is determined, wherein the multispectral data includes infrared spectroscopy, ultraviolet spectroscopy, nuclear magnetic resonance spectroscopy, and mass spectrometry data; The multispectral data is input into the encoder of a preset molecular structure inference model, and the encoder performs feature extraction and feature fusion on the multispectral data to obtain the first spectral feature. The true molecular structure of the training molecule is determined, wherein the true molecular structure is represented by SMILES sequences; The discrete labels of the SMILES sequence of the real molecular structure are mapped to high-dimensional feature embedding vectors and positionally encoded to obtain the first SMILES sequence. Based on preset mass spectrometry information, the high-resolution mass spectrometry features of the training molecule are determined, and the high-resolution mass spectrometry features are spliced ​​with the first SMILES sequence to obtain the second SMILES sequence. The decoder in the preset molecular structure inference model performs joint decoding of the first spectral feature and the second SMILES sequence to obtain the predicted molecular structure, wherein the molecular structure inference model is a deep neural network model; The cross-entropy loss function is calculated based on the actual molecular structure of the training molecule and the predicted molecular structure to obtain the loss function value. The molecular structure inference model is then updated based on the loss function value until the preset training termination condition is met, resulting in a trained molecular structure inference model. Molecular structure is inferred from the molecular structure inference model trained before testing.

2. The molecular structure deduction method as described in claim 1, characterized in that, The step of inputting the multispectral data into an encoder in a preset molecular structure inference model, and extracting and fusing features from the multispectral data through the encoder to obtain the first spectral feature includes: For each type of spectral data in the multispectral data, the original spectral features of the spectral data are mapped to a high-dimensional embedding space, and then position encoding and spectral encoding are performed to obtain the spectral feature embedding representation; The spectral feature embedding representation corresponding to each spectral data is input into the encoder. The self-attention mechanism in the encoder is used to extract features from each spectral feature embedding representation. The extracted features are then weighted and fused using the cross-attention mechanism of the encoder to obtain multimodal features, which are then used as the first spectral feature.

3. The molecular structure deduction method as described in claim 2, characterized in that, The step of jointly decoding the first spectral feature and the second SMILES sequence based on the decoder includes: Based on the self-attention mechanism of the decoder and the second SMILES sequence, a first representation feature is determined to characterize the dependency relationship of the internal position in the second SMILES sequence. Based on the cross-attention mechanism of the decoder, the first characterization feature, and the first spectral feature, a second characterization feature is determined to characterize the long-term dependency between the first spectral feature and the second SMILES sequence, and the decoding result is determined based on the second characterization feature.

4. The molecular structure deduction method as described in claim 3, characterized in that, The step of determining a first representation feature for characterizing the dependencies of internal positions in the second SMILES sequence based on the self-attention mechanism of the decoder and the second SMILES sequence includes: The second SMILES sequence is converted into Q matrix, K matrix and V matrix through the self-attention mechanism of the decoder; Calculate the self-attention score matrix between each position in the second SMILES sequence and other positions based on the dot product of the Q matrix and the K matrix; A mask matrix is ​​determined based on the length of the second SMILES sequence, wherein the mask matrix is ​​a lower triangular matrix, and the main diagonal and the position below the main diagonal of the mask matrix are set as first elements indicating that the position features are visible, and the position above the main diagonal is set as second elements indicating that the position features are not visible; The attention weight at each position is determined by combining the mask matrix and the self-attention score matrix with the Softmax function, and the V matrix is ​​weighted according to the attention weight to obtain the first representation feature used to characterize the dependency relationship of the internal elements in the second SMILES sequence.

5. The molecular structure deduction method as described in claim 1, characterized in that, The step of determining a multispectral dataset containing multispectral data of at least one training molecule includes: According to a preset quantum chemical calculation strategy, multispectral data of at least one training molecule is acquired, and all the multispectral data are aggregated to obtain a multispectral dataset containing multispectral data of at least one training molecule. The quantum chemical calculation strategy includes calculation using the MPW1PW91 functional and the 6-311+G(2d,p) basis set for nuclear magnetic resonance spectroscopy data, and calculation using the B3LYP functional and the def-TZVP basis set for infrared and ultraviolet spectral data.

6. The molecular structure deduction method as described in claim 1, characterized in that, After the step of determining the multispectral dataset containing multispectral data of at least one training molecule, the following steps are included: The multispectral data in the multispectral dataset is preprocessed, wherein the preprocessing includes data normalization, noise filtering and data augmentation. Based on the preprocessed multispectral data, the step of inputting the multispectral data in the multispectral dataset into a preset molecular structure inference model for model training is performed.

7. An electronic device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the molecular structure deduction method as described in any one of claims 1 to 6.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the molecular structure deduction method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Training method and device for molecular generation model

    CN115359856A

  • Molecular mass spectrum prediction method based on deep learning feature fusion

    CN118965252A