Molecular structure estimation method, electronic device and computer readable storage medium

Through the deep neural network model combined with the feature extraction and fusion of multispectral data, the accuracy and efficiency of molecular structure prediction in the existing technology are solved, and fast and accurate molecular structure inference is achieved, and applied to drug research and development and material design are used in fields such as drug research and development and material design.

CN120473022AActive Publication Date: 2025-08-12PEKING UNIV SHENZHEN GRADUATE SCHOOL
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510546901.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-28
Publication Date
2025-08-12
Estimated Expiration
2045-04-28

AI Technical Summary

Technical Problem

When dealing with complex molecular systems, the prior art has poor noise resistance, low computational efficiency and insufficient generalization of the model, and cannot predict molecular structure quickly and accurately, limiting its application in high-throughput analysis.

Method used

A deep neural network model is used to combine multispectral data for feature extraction and feature fusion, through the joint decoding of the encoder and the decoder, the cross-entropy loss function is used for model training, and the molecular structure inference model is optimized.

Benefits of technology

It achieves rapid and accurate prediction of molecular structure, improves the accuracy and efficiency of molecular structure inference, and is suitable for drug research and development, material design and chemical synthesis planning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120473022A_ABST
    Figure CN120473022A_ABST
Patent Text Reader

Abstract

The invention discloses a molecular structure inference method, electronic equipment and a computer readable storage medium, and relates to the technical field of molecular spectrums.The method comprises the steps that a multispectral data set containing multispectral data of at least one training molecule is determined, and the multispectral data comprises data of an infrared spectrum, an ultraviolet spectrum, a nuclear magnetic resonance spectrum and a mass spectrum; the multispectral data is input to a molecular structure inference model for model training, and the molecular structure inference model is a deep neural network model and comprises an encoder used for performing feature extraction and feature fusion on the multispectral data and a decoder used for performing joint decoding according to preset mass spectrum information and output of the encoder; performing cross entropy loss function calculation according to the real molecular structure and the predicted molecular structure so as to update the molecular structure inference model; and according to the trained molecular structure inference model, carrying out molecular structure inference on to-be-detected molecules. According to the invention, rapid and accurate prediction of the molecular structure of the molecule is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Molecular spectroscopy plays an important role in fields such as chemical analysis, environmental monitoring, and biomedicine. By analyzing molecular spectral data, key information about molecular composition, structure, and dynamic processes can be obtained, which is of great significance for drug development, pollution detection, and disease diagnosis. However, molecular structure inference methods based on traditional statistical models or single physical models suffer from poor noise immunity, low computational efficiency, and insufficient model generalization when dealing with complex molecular systems. This means that molecular structures cannot be predicted quickly and accurately, which in turn limits their application in high-throughput analysis.

[0003] The above content is only used to assist in understanding the technical solution of this application and does not constitute an admission that the above content is prior art. Summary of the Invention

[0004] The main purpose of this application is to provide a molecular structure inference method, electronic device and computer-readable storage medium, aiming to solve the technical problem of how to achieve rapid and accurate prediction of the molecular structure of a molecule.

[0005] To achieve the above objectives, the present application proposes a molecular structure inference method, which includes:

[0006] determining a multispectral data set comprising multispectral data of at least one training molecule, wherein the multispectral data comprises infrared spectrum, ultraviolet spectrum, nuclear magnetic resonance spectrum and mass spectrum data;

[0007] Inputting multispectral data in the multispectral dataset 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, including an encoder for feature extraction and feature fusion of the multispectral data, and a decoder for joint decoding based on preset mass spectrum information and the output of the encoder;

[0008] The cross entropy loss function is calculated based on the actual molecular structure and the predicted molecular structure of the training molecule to obtain the loss function value, and the molecular structure inference model is updated according to the loss function value until the preset training end condition is met to obtain a trained molecular structure inference model;

[0009] The molecular structure of the molecules to be tested is inferred based on the trained molecular structure inference model.

[0010] Optionally, the step of inputting the multispectral data in the multispectral dataset into a preset molecular structure inference model for model training to obtain a predicted molecular structure includes:

[0011] The multispectral data is input into an encoder in a preset molecular structure inference model, and the encoder performs feature extraction and feature fusion on the multispectral data to obtain a first spectral feature;

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

[0013] Optionally, the step of inputting the multispectral data into an encoder in a preset molecular structure inference model, and performing feature extraction and feature fusion on the multispectral data by the encoder to obtain the first spectral feature includes:

[0014] For each 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;

[0015] The spectral feature embedding representation corresponding to each spectral data is input into the encoder, and the self-attention mechanism in the encoder is used to extract the features of each spectral feature embedding representation. The features obtained through feature extraction are weightedly fused through the cross-attention mechanism of the encoder to obtain multimodal features, and the multimodal features are used as the first spectral features.

[0016] Optionally, the step of jointly decoding the first spectral feature and the preset mass spectrum information according to the decoder includes:

[0017] Determine the true molecular structure of the training molecule, where the true molecular structure is represented by a SMILES sequence;

[0018] The discrete labels of the SMILES sequence of the real molecular structure are mapped into a high-dimensional feature embedding vector and positionally encoded to obtain the first SMILES sequence;

[0019] Determine the high-definition mass spectrum features of the training molecule based on the mass spectrum information, and concatenate the high-definition mass spectrum features with the first SMILES sequence to obtain a second SMILES sequence;

[0020] The first spectral feature and the second SMILES sequence are jointly decoded according to the decoder.

[0021] Optionally, the step of jointly decoding the first spectral feature and the second SMILES sequence according to the decoder includes:

[0022] Determine, based on the decoder's self-attention mechanism and the second SMILES sequence, a first representation feature for representing a dependency relationship between internal positions in the second SMILES sequence;

[0023] 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 between the first spectral feature and the second SMILES sequence is determined, and a decoding result is determined according to the second representation feature.

[0024] Optionally, the step of determining, based on the self-attention mechanism of the decoder and the second SMILES sequence, a first characterization feature for characterizing the dependency relationship of internal positions in the second SMILES sequence includes:

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

[0026] Calculate the self-attention score matrix between each position and other positions in the second SMILES sequence based on the dot product of the Q matrix and the K matrix;

[0027] Determine a mask matrix based on the length of the second SMILES sequence, wherein the mask matrix is a lower triangular matrix, wherein the main diagonal and positions below the main diagonal of the mask matrix are set to the first element indicating that the position feature is visible, and positions above the main diagonal are set to the second element indicating that the position feature is invisible;

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

[0029] Optionally, the step of determining a multispectral dataset comprising multispectral data of at least one training molecule comprises:

[0030] According to a preset quantum chemical calculation strategy, multispectral data of at least one training molecule are obtained, and all multispectral data are aggregated to obtain a multispectral dataset containing multispectral data of at least one training molecule. The quantum chemical calculation strategy includes using the MPW1PW91 functional and the 6-311+G(2d,p) basis set for calculations of nuclear magnetic resonance spectral data, and using the B3LYP functional and the def-TZVP basis set for calculations of infrared and ultraviolet spectral data.

[0031] Optionally, after the step of determining a multispectral dataset comprising multispectral data of at least one training molecule, the method further comprises:

[0032] Preprocessing the multispectral data in the multispectral dataset, wherein the preprocessing includes data normalization, noise filtering and data enhancement;

[0033] According to the pre-processed multispectral data, a step of inputting the multispectral data in the multispectral data set into a preset molecular structure inference model for model training is performed.

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

[0035] In addition, to achieve the above-mentioned purpose, the present application also proposes a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the molecular structure inference method as described above are implemented.

[0036] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the molecular structure inference method as described above are implemented.

[0037] In the embodiment of the present application, the multispectral data determined by the data including infrared spectrum, ultraviolet spectrum, nuclear magnetic resonance spectrum and mass spectrum provide high-precision and complete basic data support for the model training of the molecular structure inference model. And because the molecular structure inference model is a deep neural network model, the multispectral data is extracted and fused by combining the encoder in the deep neural network model to achieve a breakthrough improvement in the accuracy and efficiency of molecular structure inference, and when the decoder is trained, the input of the decoder not only considers the output of the encoder, but also needs to consider the corresponding mass spectrum information to improve the accuracy of the decoder output, and the cross entropy loss function is calculated in combination with the real molecular structure and 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, and then the molecular structure of the molecule to be tested is inferred according to the trained molecular structure inference model. It can be achieved that the molecular structure can be predicted quickly and accurately by the trained molecular structure inference model. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0040] Figure 1 A schematic diagram of the process for the first embodiment of the molecular structure inference method of the present application;

[0041] Figure 2 A schematic diagram of a second embodiment of the molecular structure inference method of the present application;

[0042] Figure 3 This is the overall process framework diagram of the molecular structure inference method of this application;

[0043] Figure 4 This is a diagram illustrating the structure of a molecular structure inference model in the molecular structure inference method according to an embodiment of the present application;

[0044] Figure 5 A pie chart showing the generalization performance of the molecular structure inference method according to an embodiment of the present application for a drug molecule dataset;

[0045] Figure 6 A scatter plot showing the generalization performance of the molecular structure inference method according to an embodiment of the present application for a drug molecule dataset;

[0046] Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the molecular structure inference method in the embodiment of this application.

[0047] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

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

[0049] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0050] Current experimental methods for obtaining molecular spectral data suffer from high costs, data scarcity, and difficulties in manual feature design. Furthermore, traditional inference methods based on statistics or manual feature extraction often struggle to meet the dual requirements of accuracy and speed for complex samples. Therefore, this embodiment uses quantum chemical calculations to obtain high-quality multispectral data and utilizes deep neural networks to train a molecular structure inference model, enabling rapid and accurate prediction of unknown molecular structures. This approach is therefore widely applicable in areas such as drug discovery, material design, and chemical synthesis planning.

[0051] Therefore, the multispectral data generated by quantum chemical calculations in this embodiment provides high-precision and complete basic data support for model training, and combines the automatic extraction and fusion technology of multimodal spectral features of deep neural networks to achieve a breakthrough improvement in the accuracy and efficiency of molecular structure inference. This method has a wide range of applicability and can be applied not only in the field of drug molecule design, but also in scenarios such as new material development and chemical synthesis path optimization. By innovatively integrating teacher-forced training with the Beam Search strategy (a heuristic search algorithm), a highly intelligent analysis system was constructed, which greatly reduced the need for manual intervention and improved the overall workflow efficiency by about 40%. Experimental verification shows that the technology has achieved breakthroughs in many key indicators in the test set: the bilingual assessment substitute score reached 0.970, the molecular effectiveness index was as high as 0.996, while maintaining a prediction accuracy of 0.930, which fully demonstrated its technological advancement and practical reliability.

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

[0053] Based on this, the present invention provides a molecular structure inference method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the molecular structure inference method of the present application.

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

[0055] Step S10: determining a multispectral data set comprising multispectral data of at least one training molecule.

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

[0057] Alternatively, infrared spectroscopy can detect vibrational energy level transitions caused by molecules absorbing infrared light of specific wavelengths. Chemical bonds in molecules (such as OH and C=O) have specific vibrational frequencies. When the frequency of infrared light matches the vibrational frequency of the bond, the light is absorbed, forming a characteristic absorption peak. Alternatively, ultraviolet spectroscopy can detect the absorption of ultraviolet or visible light by electrons in molecules when they transition from the ground state to the excited state. This is applicable to the detection of molecules with conjugated double bonds, aromatic rings, or chromophores (such as benzene and carotene). Alternatively, nuclear magnetic resonance can utilize the phenomenon of atomic nuclei absorbing optical energy in a strong magnetic field. Nuclei in different chemical environments produce different chemical shifts due to shielding effects, and the nuclear magnetic resonance spectrum can reflect the distribution of surrounding electrons. Mass spectrometry can determine molecular weight and structure by ionizing molecules and measuring their mass-to-charge ratio. Molecules are broken into ions in an ion source. After separation by a mass analyzer, the detector records the abundance of each ion.

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

[0059] Alternatively, the multispectral data may be a type of image data.

[0060] Optionally, the multispectral dataset can be used for model training. For example, when performing model training on a preset molecular structure inference model, the multispectral data in the multispectral dataset can be used for model training.

[0061] Alternatively, the training molecules may be chemical molecules, biological molecules, drug molecules, etc. (hereinafter referred to as molecules) with known molecular structures for model training, such as methane, ethanol, etc. Optionally, the actual molecular structures of the training molecules are known.

[0062] Optionally, for any training molecule, 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 multispectral data of the training molecule, and the multispectral data of multiple training molecules can be aggregated to obtain a multispectral data set.

[0063] Optionally, in an achievable embodiment, step S10, the step of determining a multispectral data set including multispectral data of at least one training molecule, includes step a10.

[0064] Step a10: acquiring multispectral data of at least one training molecule according to a preset quantum chemical calculation strategy, and aggregating all the multispectral data to obtain a multispectral data set including the multispectral data of at least one training molecule.

[0065] It should be noted that the quantum chemical calculation strategy includes the use of the MPW1PW91 functional and the 6-311+G(2d,p) basis set for calculations of the nuclear magnetic resonance spectral data, and the use of the B3LYP functional and the def-TZVP basis set for calculations of the infrared and ultraviolet spectral data.

[0066] Optionally, the quantum chemical calculation strategy may also include using the B3LYP functional with a 6-311+G(2d,p) basis set for geometry optimization. All calculations may also be performed using the Gaussian 16 software package (version B.01). The training molecules for the multispectral dataset may be selected from the QM9 dataset.

[0067] Optionally, any training molecule may be processed using a quantum chemical calculation strategy to determine or obtain infrared spectrum, ultraviolet spectrum, nuclear magnetic resonance spectrum and mass spectrum data of the training molecule.

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

[0069] In this embodiment, multispectral data is acquired by adopting a quantum chemical calculation strategy, thereby ensuring the high accuracy and integrity of the acquired multispectral data, and providing high-precision and complete basic data support for subsequent model training.

[0070] Optionally, in a feasible embodiment, after the step S10 of determining a multispectral data set including multispectral data of at least one training molecule, steps b10 to b20 are included.

[0071] Step b10, preprocessing the multispectral data in the multispectral dataset, wherein the preprocessing includes data normalization, noise filtering and data enhancement processing;

[0072] Step b20 is to input the multispectral data in the multispectral data set into a preset molecular structure inference model for model training based on the pre-processed multispectral data.

[0073] Optionally, the multispectral data of each training molecule in the multispectral dataset is preprocessed. Optionally, since the multispectral data of each training molecule includes infrared spectrum, ultraviolet spectrum, nuclear magnetic resonance spectrum and mass spectrum data, and the scale of different spectral data is different, it is necessary to preprocess the multispectral data. For example, the peak and intensity features of each spectral data are log transformed and Min-Max scaled, which are implemented through sklearn functions, thereby mapping the features of different spectral data to a reasonable range.

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

[0075] Optionally, noise filtering may include decomposing and removing a high-frequency noise layer using wavelet transform on the nuclear magnetic resonance spectrum data. Data enhancement processing may include sparse processing.

[0076] Optionally, the data in the multispectral dataset may be normalized to eliminate dimensionality effects, and noise filtering and data enhancement (such as sparsification) may be performed to improve data robustness.

[0077] Alternatively, multispectral data generated using quantum chemical calculation strategies can be stored as Gaussian output files (.log). This file can then be structured and parsed. Regular expressions are used to extract shielding constants and spin-spin coupling constants from the nuclear magnetic resonance (NMR) calculation results, and vibrational frequencies and their corresponding absorption intensities from the infrared and ultraviolet (UV) spectra. Feature reconstruction is then performed on the mass spectrometry data. Based on the precise molecular weight, a mass number matching algorithm is used to derive the molecular formula, and the degree of unsaturation is calculated using the unsaturation formula. Finally, the parsed spectral parameters and molecular feature data are uniformly converted into a standardized numerical matrix to construct a multimodal training dataset. This multimodal training dataset is then used as the preprocessed multispectral dataset.

[0078] Optionally, the pre-processed multispectral data set includes pre-processed multispectral data of each training molecule. In this case, the pre-processed multispectral data can be input into a preset molecular structure inference model for model training.

[0079] In this embodiment, by preprocessing the multispectral data, such as data normalization, noise filtering and data enhancement, and then performing model training, it is possible to keep the spectral data in different ranges within a reasonable range, thereby avoiding the error phenomenon during model training that the model mistakenly believes that spectral data with large values are more important than spectral data with small values.

[0080] Step S20, inputting the multispectral data in the multispectral data set into a preset molecular structure inference model for model training to obtain a predicted molecular structure;

[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 multispectral data, and a decoder for joint decoding based on preset mass spectrum information and the output of the encoder.

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

[0083] Optionally, after the preset molecular structure inference model receives the input multispectral data (which may be pre-processed multispectral data), the molecular structure inference model may be used to perform feature extraction and fusion on the multispectral data of the same training molecule.

[0084] For example, a customized tokenization module can be set up for each type of spectral data (including infrared, ultraviolet, nuclear magnetic resonance, and mass spectrometry data) of the same training molecule. The original spectral features of the multispectral data are mapped to a high-dimensional embedding space through a linear transformation to obtain high-dimensional features. Positional encoding and spectrum-specific encoding are superimposed on the high-dimensional features to form a complete embedded representation. This embedded representation is then input into the encoder, and the encoder's self-attention mechanism is used to extract the dependencies between each token, thereby obtaining a discriminative spectral feature representation that contains both local information and global features. The feature representations extracted from different spectral data (i.e., discriminative spectral feature representations) are then fused. An attention mechanism (such as a cross-attention mechanism) can be used to perform weighted fusion on the feature representations of each spectral data. Through information exchange, multi-scale, hierarchical comprehensive features (i.e., fused multimodal features) are obtained to fully express the complementarity between the various modal information.

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

[0086] Optionally, during the training of the molecular structure inference model, a teacher-forcing strategy can be employed. This involves feeding a simplified molecular linear encoding input system (SMILES) token of a real molecule into the decoder at each generation time step for supervised training, thereby optimizing model parameters and improving the accuracy of the generated SMILES sequence. Furthermore, during the inference phase of the molecular structure inference model, an autoregressive beam search strategy can be employed to generate SMILES sequences, imposing chemical constraints (such as atom count and ring size) on the generated candidate sequences to ensure the chemical legitimacy of the generated molecular structures.

[0087] Alternatively, the molecular structure can be represented by a variety of representations, such as SMILES (Simplified Molecular Input Line Entry System), InChI (International Chemical Identifier) molecular diagrams, or molecular formulas, etc. In this embodiment and subsequent embodiments, the molecular structure is illustrated only with SMILES sequences. SMILES is a method of representing 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 can intuitively reflect the bond and ring structure of the compound.

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

[0089] Step S30, calculating a cross entropy loss function based on the actual molecular structure and the predicted molecular structure of the training molecule to obtain a loss function value, and updating the molecular structure inference model based on the loss function value until a preset training end condition is met, thereby obtaining a trained molecular structure inference model;

[0090] Alternatively, the actual molecular structure can be represented using a SMILES sequence.

[0091] Optionally, the preset training end condition can be a condition that must be met to terminate the training in advance, and can be set as needed. This is not limited in this embodiment. For example, in a specific embodiment, it can be set to when the cross entropy loss function of the molecular structure inference model converges, or when the number of training rounds reaches a set number, or when the training duration reaches a set duration, etc.

[0092] Optionally, when calculating the cross-entropy loss function, the index / label corresponding to the SMILES sequence of the real molecular structure and the index / label 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 the loss function value, and check whether the loss function value converges. If it does not converge, it can be determined that the preset training end condition is not met, and the model parameters of the molecular structure inference model are reversely updated according to the loss function value, and the molecular structure inference model is re-trained until the preset training end condition is met to obtain a trained molecular structure inference model.

[0093] Optionally, when retraining the molecular structure inference model, a teacher forcing strategy can be adopted, that is, the model does not use its own prediction at the previous time step as the input of the next time step, but uses the actual output of the previous time step as the input of the next time step. This can enable the molecular structure inference model to converge quickly and prevent cumulative errors.

[0094] Optionally, in this embodiment, when end-to-end model training is performed on the molecular structure inference model based on multispectral data, the training process can use the true molecular structure as a supervisory signal and adopt a cross-entropy loss function to minimize the index or labeling error between the output of the molecular structure inference model and the true molecular structure, so as to optimize the model parameters in the encoder and decoder in the molecular structure inference model.

[0095] Optionally, the process of constructing a molecular structure inference model may include: constructing a molecular structure inference model based on a Transformer decoder structure, wherein the decoder adopts an autoregressive generation mechanism and uses cross-attention to obtain fused multimodal spectral features from the encoder; adopting a teacher forcing strategy during the model training process, that is, inputting a real SMILES Token into the decoder at each generation time step for supervised training to optimize model parameters and improve sequence generation accuracy; adopting an autoregressive Beam Search strategy in the inference stage to generate a SMILES sequence, and ensuring the chemical legitimacy of the generated molecular structure by imposing chemical constraints (such as atom count, ring closure, etc.) on the generated candidate sequence.

[0096] Step S40: performing molecular structure inference on the molecule to be tested based on the trained molecular structure inference model.

[0097] Alternatively, after obtaining a trained molecular structure inference model, the model can be directly used in practical applications to perform molecular structure inference on any target molecule. Specifically, the multispectral data of the target molecule is input into the trained molecular structure inference model, and the molecular structure of the target molecule, such as its SMILES sequence, is determined based on the output.

[0098] In this embodiment, multispectral data determined by determining data including infrared spectrum, ultraviolet spectrum, nuclear magnetic resonance spectrum and mass spectrum provides high-precision and complete basic data support for model training of molecular structure inference model. And because 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 features of multispectral data, a breakthrough improvement in the accuracy and efficiency of molecular structure inference can be achieved. When the decoder is trained, the decoder input not only considers the output of the encoder, but also needs to consider the corresponding mass spectrum information to improve the accuracy of the decoder output. The cross-entropy loss function is calculated based on the actual molecular structure and predicted molecular structure of the training molecule to update the molecular structure inference model until the preset training end condition is met, and a trained molecular structure inference model is obtained. Then, the molecular structure of the test molecule is inferred based on the trained molecular structure inference model. In this way, the molecular structure can be quickly and accurately predicted by the trained molecular structure inference model.

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

[0100] Step S21, inputting the multispectral data into an encoder in a preset molecular structure inference model, and performing feature extraction and feature fusion on the multispectral data through the encoder to obtain a first spectral feature;

[0101] Optionally, after preprocessing the multispectral data, the multispectral data of any training molecule can be input into a pre-set molecular structure inference model, that is, the multispectral data can be first subjected to feature extraction and feature fusion through an encoder to obtain a multimodal fusion feature, which is then used as the first spectral feature.

[0102] Optionally, for any training molecule, feature extraction can be performed on the multispectral data based on the self-attention mechanism in the encoder, and feature fusion can be performed on the multispectral data based on 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 encoder is used to perform feature extraction and feature fusion on the multispectral data to obtain a first spectral feature, including steps c10-c20.

[0104] Step c10: 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 a spectral feature embedding representation;

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

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

[0107] Optionally, positional encoding encodes the position of different inputs. For example, if the input contains 500 dimensions, a positional encoding like 0-499 is required. Positional encoding allows the molecular structure inference model to know the positional order of each spectral data input.

[0108] Optionally, spectral encoding (i.e., spectrum-specific encoding) requires knowing which inputs belong to the same spectrum, such as 0-9 for the ultraviolet spectrum, 10-99 for the infrared spectrum, etc. Spectral encoding allows the molecular structure inference model to know which spectrum each input spectral data comes from.

[0109] Optionally, for each training molecule, a customized Tokenizer module can be set up for each spectral data type in the multispectral data, that is, each spectral data type can correspond to a corresponding Tokenizer module. The Tokenizer module can then extract the raw spectral features of the spectral data and map them to a high-dimensional embedding space through a linear transformation, resulting in a high-dimensional mapping feature. Positional encoding and spectral encoding are then superimposed on the high-dimensional mapping feature to obtain an embedded representation of the spectral feature.

[0110] Alternatively, the Tokenizer module can be used to segment the nuclear magnetic resonance spectrum by chemical shift, and then extract the spectral features of the segmented spectrum to obtain the original spectral features. Alternatively, the Tokenizer module can be used to segment the infrared spectrum by functional group characteristic frequency intervals, and then extract the spectral features of the segmented spectrum to obtain the original spectral features. Alternatively, the Tokenizer module can be used to segment the mass spectrum by mass number intervals, and then extract the spectral features of the segmented spectrum to obtain the original spectral features.

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

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

[0113] Among them, E f is the spectral feature embedding representation, P f is the position code, S f It is spectrum-specific encoding, that is, spectral encoding, Linear(X f ) is the high-order mapping feature of the original spectral feature mapped to the high-dimensional embedding space.

[0114] In step c20, the spectral feature embedding representation corresponding to each spectral data is input into the encoder, and the feature embedding representation of each spectral feature is extracted through the self-attention mechanism in the encoder, and the features obtained through the feature extraction are weightedly fused through the cross-attention mechanism of the encoder to obtain multimodal features, and the multimodal features are used as the first spectral features.

[0115] Optionally, for each training molecule, a spectral feature corresponding to each spectral data can be embedded into the representation and input into the encoder as an input parameter. 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 between each token (i.e., the Tokenizer module) based on the spectral feature embedding representation through a self-attention mechanism, and can perform self-attention mechanism calculation according to the following formula (2).

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

[0118]

[0119] Among them, Q represents query, K represents key, and V is value. The input parameters can be mapped to Q through three matrices f , K f 、V f , corresponding to query, key, and value, respectively, and then the three matrices Q f , K f 、V f Perform self-attention calculation and divide by d k , to perform normalization processing, then calculate the attention weight through the softmax function, and then perform weighted processing according to the attention weight.

[0120] Optionally, Q f Can be the query matrix, K f Can be a bond matrix, V f Can be a matrix of values, d k It can be the dimension of the spectral features in the key matrix (such as the spectral feature embedding representation of the input), and T can represent the transpose operation of the matrix. Denotes the bond matrix K f The transpose of .

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

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

[0123]

[0124] Among them, Q d Can be a query matrix, and with Q f Different, Q d and Q f It can be the query matrix corresponding to two different spectral feature embedding representations.

[0125] Optionally, the integrated encoder obtains a multimodal feature based on the processing results of the self-attention mechanism and the cross-attention mechanism, and uses it as the first spectral feature. Optionally, the encoder can first perform a self-attention mechanism to extract features from the embedded representations of each spectral feature, and then perform a cross-attention mechanism to weightedly fuse the extracted features to obtain a multimodal feature, and use the multimodal feature as the first spectral feature.

[0126] In this embodiment, for each type of 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 a spectral feature embedding representation, which is then input into the encoder, and the self-attention mechanism of the encoder is used to extract features, and the cross-attention mechanism of the encoder is used to perform feature fusion to obtain multimodal features, which are used as the first spectral features, thereby ensuring the validity of the obtained first spectral features.

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

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

[0129] Alternatively, the first spectral signature output by the encoder can be input into a decoder, which then performs joint decoding using the mass spectrum information and the first spectral signature, and then determines the predicted molecular structure based on 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 (e.g., a SMILES sequence).

[0130] In this embodiment, the first spectral feature is obtained by performing feature extraction and feature fusion on the multispectral data according to the encoder, and the first spectral feature and mass spectrum information are jointly decoded according to the decoder to determine the predicted molecular structure, thereby ensuring the accuracy of the predicted molecular structure.

[0131] Optionally, in step S22, the step of jointly decoding the first spectral feature and the preset mass spectrum information according to 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 real molecular structure is represented by SMILES sequence.

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

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

[0136] Alternatively, the discrete tag may be a numeric index / tag such as 0, 1, 2, etc.

[0137] Optionally, a SMILES vocabulary can be constructed so that the chemical symbols in the SMILES vocabulary are mapped one-to-one to discrete tags (such as numerical indices). 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), brackets and other symbols can be determined according to the grammatical rules of SMILES. Atomic symbols, bond types, ring tags, molecular brackets, etc. can be used as basic tokens. A mapping relationship between each element in the SMILES sequence and a discrete tag can be established. The mapping relationship between each token in the SMILES sequence and a discrete tag (such as a numerical index) can be determined.

[0138] Optionally, each token in the SMILES sequence of the real molecular structure can be determined, and a query can be performed in the SMILES vocabulary to determine the discrete tag corresponding to each token, thereby obtaining the discrete tag of the SMILES sequence of the real molecular structure, such as 03414.

[0139] Alternatively, the discrete tokens of the SMILES sequence of a real molecular structure can be mapped into high-dimensional feature embedding vectors, which can enable the model to capture the semantic relationship between symbols in the sequence (such as the semantic relationship between two discrete tokens). This can be achieved specifically using the following formula (4).

[0140]

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

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

[0143] Step d30, determining the high-definition mass spectrum characteristics of the training molecule based on the mass spectrum information, and concatenating the high-definition mass spectrum characteristics with the first SMILES sequence to obtain a second SMILES sequence;

[0144] Optionally, mass spectrum information may be acquired from the mass spectrum data, and high-definition mass spectrum features contained in the mass spectrum information may be extracted.

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

[0146] Optionally, since the high-definition mass spectrometry features contain various information of the training molecules, such as how many Cs and Os the molecule has, this information is used as a condition in the form of a vector and spliced with the first SMILEX sequence to obtain a second SMILES sequence.

[0147] Optionally, for mass spectrum information, atomic type information (such as atomic types such as C, N, O, F, etc.) 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 spectral features. At the same time, 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 embedded and superimposed (i.e., spliced) with the first SMILES sequence to obtain a second SMILES sequence, and use it as the input feature to the decoder.

[0148] Step d40: jointly decode the first spectral feature and the second SMILES sequence according to the decoder.

[0149] Alternatively, the first spectral signature and the second SMILES sequence can be used as input parameters for a decoder, which then jointly decodes the first spectral signature and the second SMILES sequence. Specifically, the decoder's input parameters can include the encoder's output (the first spectral signature), the first SMILES sequence converted from the true molecular structure of the molecule being measured, and the high-definition mass spectrum signature.

[0150] In this example, the first SMILES sequence is generated by mapping the discrete markers of the actual molecular structure of the training molecule into a high-dimensional feature embedding vector and then performing positional encoding. High-definition mass spectral features determined based on mass spectral information are then concatenated with the first SMILES sequence to generate a second SMILES sequence. The decoder then jointly decodes the first spectral features and the second SMILES sequence, ensuring the effectiveness of the decoding.

[0151] Optionally, in step d40, the step of jointly decoding the first spectral 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 internal positions in the second SMILES sequence based on 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 a self-attention mechanism and a cross-attention mechanism to capture the long-term dependency within the SMILES sequence (such as the second SMILES sequence) and between the SMILES sequence and the first spectral feature.

[0154] Optionally, after the first spectral feature and the second SMILES sequence are input into the decoder, the decoder can process the second SMILES sequence according to its own self-attention mechanism to determine the dependency of internal positions in the second SMILES sequence, and characterize the dependency of internal positions in the second SMILES sequence by outputting the first representation feature.

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

[0156] Optionally, in step d41, the step of determining a first characterization feature for characterizing the dependency relationship of internal elements in the second SMILES sequence based on the self-attention mechanism of the decoder and 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 degree of association between each position and other positions in the second SMIELS sequence through the interaction of Q and K, and then determine the attention score.

[0159] Optionally, the second SMILES sequence may be converted into a Q matrix, a K matrix, and a V matrix, where Q represents a query, K represents a key, and V represents a value.

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

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

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

[0163] In step d46, the attention weight of each position is determined based on the Softmax function combined with the mask matrix and the self-attention score matrix, and the V matrix is weighted according to the attention weight to obtain the first representation feature for characterizing 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 of the mask matrix and the positions below the main diagonal are set as the first element indicating that the position feature is visible, and the positions above the main diagonal are set as the second element indicating that the position feature is invisible.

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

[0166] Optionally, the formula corresponding to the mask matrix may be as shown in formula (5).

[0167]

[0168] Among them, Mask is the mask matrix, i and j are the indexes of the width and height 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 predictions for each sequence position generated by the model need to mask information about subsequent sequence positions to ensure compliance with the principle of autoregressive generation. Therefore, when the decoder uses the self-attention mechanism to process the second SMILES sequence, a mask matrix can be used to mask information about subsequent sequence positions in the second SMILES sequence.

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

[0172]

[0173] in, is the unmasked self-attention score matrix and mask matrix, Q f is the Q matrix, K f is the K matrix, V f is the matrix V. When the Softmax function is subsequently used to calculate the future position (i.e., the position with a mask value of -∞), the corresponding attention weight will tend to 0, thus completely shielding the influence of future sequence information on the current prediction step.

[0174] In this embodiment, the second SMILES sequence is converted into a Q matrix, a K matrix and a V matrix according to the self-attention mechanism of the decoder, and then the self-attention score matrix is determined based on the Q matrix and the K matrix, and the mask matrix is determined based on the length of the second SMILES sequence. Then, the attention weight is determined according to the Softmax function combined with the mask matrix and the self-attention score matrix to perform weighted processing on the V matrix to obtain the first representation feature, thereby ensuring the validity of the determined first representation feature.

[0175] Step d42: Determine a second representation feature for representing the long-term dependency between the first spectral feature and the second SMILES sequence based on the cross-attention mechanism of the decoder, the first representation feature, and the first spectral feature, and determine a decoding result based on the second representation feature.

[0176] Optionally, the operating principle of the cross-attention mechanism in the decoder is basically the same as that in the encoder. 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 dependence between the encoder (first spectral feature) and the decoder (first representation feature), which can be referred to formula (7).

[0178]

[0179] Among them, 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 V matrix of the cross attention mechanism can be determined according to the first spectral feature, that is, K enc and V enc .

[0180] Furthermore, an attention score can be calculated by performing a dot product between the Q matrix and the K matrix of the cross-attention mechanism, and then the V matrix of the cross-attention mechanism is weighted according to a soft max function and the attention score to obtain a second characterization feature for characterizing the long-term dependency between the first spectral feature and the second SMILES sequence. A decoding result can then be determined or obtained based on the second characterization feature. Optionally, the decoding result can include a discrete label or index of the SMILES sequence.

[0181] Optionally, a linear transformation may be performed on the decoding result according to a pre-constructed SMILES vocabulary to generate a SMILES sequence.

[0182] Optionally, each decoding step generates discrete tags of a SMILES sequence, and a linear transformation is performed based on the generated discrete tags to output a SMILES sequence. The specific process of the linear transformation can refer to the following formula (8).

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

[0184] Among them, E out is the decoding result, Y smiles An element of a SMILES sequence.

[0185] Optionally, the molecular structure inference model can be iteratively trained, and each decoding step generates the next tag (such as a discrete tag or index) in the SMILES sequence until the generation of the entire SMILES sequence is completed.

[0186] In this embodiment, the first characterization feature is determined based on the self-attention mechanism of the decoder 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 to determine the decoding result, thereby ensuring the accuracy of the decoding result.

[0187] In addition, in combination with any of the above embodiments, to assist in understanding the molecular structure inference process in this embodiment, an example is given below.

[0188] For example, Figure 3 As shown, for any chemical molecule (referred to as molecule), quantum chemical calculations can be performed first to generate multispectral data, and this can be done using the Gaussian16 software package (version B.01). The multispectral data can then be aggregated to obtain a multispectral data set, where the spectral data in the multispectral data set can include four types of spectral data: infrared, ultraviolet, nuclear magnetic resonance, and mass spectrometry. Alternatively, the multispectral data in the multispectral data set can be preprocessed and then input into an encoder (such as a Transformer encoder) in a molecular structure inference model for spectral feature encoding to obtain a first spectral feature. Combined with the mass spectrum information and the first spectral feature, the molecular structure is decoded using a decoder (such as a 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 chemical molecule, the multispectral data of the chemical molecule is determined. The multispectral data may include spectral information of each spectrum. For example, the spectral information contained in infrared and ultraviolet spectra includes peak value and intensity value. 1 H,13 C, 15 N, 17 O, 19 F NMR spectra contain spectral information such as chemical shift, integral, coupling constant, and DEPT. Two-dimensional NMR spectra contain spectral information such as COSY (correlation spectrum), HSQC (heteronuclear single quantum coherence spectrum), INADEQUATE (natural abundance double quantum transfer experiment), and J-resolved spectrum. Mass spectra contain spectral information such as molecular formula and degree of unsaturation.

[0190] Multispectral data (such as mass spectrometry information, infrared, ultraviolet spectrum information, nuclear magnetic spectrum information) can be input into the encoder of the molecular structure inference model for spectral feature encoding. The encoder can include a multi-layer Transformer encoder, such as L1-L N When encoding, the encoder needs to consider the binary classification head, including whether there is C=O? Is there -OH?, etc., and also needs to consider the counting head, such as the number of Cs and the number of Os.

[0191] The mass spectrometry information can be feature engineered and used together with the encoder output as input to a decoder (such as a Transformer decoder) for molecular structure decoding to determine the molecular structure of the predicted molecule. During decoding, a rule-based beam search is required to determine the corresponding molecular structure. The rules can be the following: Rule 1: Molecular formula; Rule 2: SMILES validity; and Rule 3 (optional): Ring size. A beam search can be performed based on Rules 1-3 to obtain the corresponding decoding result.

[0192] In addition, corresponding auxiliary tasks can be performed, such as determining the molecular formula (C x N y O z F t ; ring size), determine the functional group (-C=O, -NH2, -OH), determine the fine structure (-CX, -C=X, -HX), etc. And determine the conditions for the decoder to perform decoding based on the auxiliary task (i.e., the rules in the figure).

[0193] In addition, to verify the generalization performance of the molecular structure inference model in this embodiment, an external test was conducted on the drug molecule dataset L1300 to evaluate the prediction performance and applicability of the model in real application scenarios. This dataset contains 632 FDA-approved drug molecules, covering a variety of different indications and is quite representative. By statistically analyzing the clinical indications corresponding to these drug molecules, it can be found that Figure 5The pie chart shown clearly shows the distribution of various diseases, including neurological diseases (17.6%), infectious diseases (13.2%), metabolic diseases (12.8%), inflammatory diseases (12.8%), cancer (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%). This distribution intuitively demonstrates the main therapeutic areas involved in the L1300 dataset, which is relatively broad and dispersed, and can help us more comprehensively verify the model's generalization ability across different disease areas.

[0194] Reference Figure 6 The scatter plot in shows the relationship between the molecular structure similarity (Tanimoto similarity) and the predicted SMILES similarity (measured by BLEU score) on this dataset, with the Pearson correlation coefficient (r) as high as 0.88. It can be seen that Tanimoto similarity and BLEU score show a significant positive correlation: when the molecular structures are more similar, the model BLEU score will generally be higher. This to a certain extent shows 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 with different structures and diverse indications, reflecting strong generalization ability. This not only shows that the model is transferable to external datasets, but also provides important feasibility evidence for its subsequent application in larger-scale or more complex drug molecule libraries.

[0195] In addition, to achieve the above-mentioned purpose, the present application provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the molecular structure inference method in the above-mentioned embodiment one.

[0196] Reference below Figure 7, which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic devices in the embodiments of the present application may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TVs and desktop computers. The devices shown in the figure are merely examples and should not limit the functions and scope of use of the embodiments of the present application.

[0197] The electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 1002 or programs loaded from a storage device 1003 into a random access memory (RAM) 1004. RAM 1004 also stores various programs and data required for device operation. The processing device 1001, ROM 1002, and RAM 1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; 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 the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have instead.

[0198] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. 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 comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via 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 embodiment disclosed in the present application are executed.

[0199] The electronic device provided in this application utilizes the molecular structure inference method described in the above-mentioned embodiment to enable rapid and accurate prediction of the molecular structure of a molecule. Compared to the prior art, the electronic device provided in this application achieves the same beneficial effects as the molecular structure inference method described in the above-mentioned embodiment. Other technical features of the molecular structure inference device are the same as those disclosed in the above-mentioned embodiment and are not further described here.

[0200] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above 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 are only specific embodiments of the present application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

[0202] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer program) stored thereon, and the computer-readable program instructions are used to execute the molecular structure inference method in the above-mentioned embodiment.

[0203] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more 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 thereof. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores 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 may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0204] The computer-readable storage medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0205] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device can execute the steps of the molecular structure inference method.

[0206] Computer program code for performing the operations of the present application may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may 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 may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0207] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.

[0208] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.

[0209] The computer-readable storage medium provided herein stores computer-readable program instructions (i.e., a computer program) for executing the molecular structure inference method described above, enabling rapid and accurate prediction of the molecular structure of a molecule. Compared to the prior art, the beneficial effects of the computer-readable storage medium provided herein are the same as those of the molecular structure inference method provided in the above-described embodiments, and are not further elaborated herein.

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

[0211] The computer program product provided in this application can achieve rapid and accurate prediction of the molecular structure of a molecule. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the molecular structure inference method provided in the above embodiment, and will not be repeated here.

[0212] The above description is only part of the embodiments of the present application and does not limit the patent scope of the present application. All equivalent structural transformations made by using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A molecular structure inference method, characterized in that: The molecular structure inference method includes: determining a multispectral data set comprising multispectral data of at least one training molecule, wherein the multispectral data comprises infrared spectrum, ultraviolet spectrum, nuclear magnetic resonance spectrum and mass spectrum data; Inputting the multispectral data in the multispectral dataset 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, including an encoder for feature extraction and feature fusion of the multispectral data, and a decoder for joint decoding based on preset mass spectrum information and the output of the encoder; Performing a cross entropy loss function calculation based on the actual molecular structure of the training molecule and the predicted molecular structure to obtain a loss function value, and updating the molecular structure inference model based on the loss function value until a preset training end condition is met, thereby obtaining a trained molecular structure inference model; The molecular structure of the molecules to be tested is inferred based on the trained molecular structure inference model.

2. The molecular structure inference method according to claim 1, wherein The step of inputting the multispectral data in the multispectral data set into a preset molecular structure inference model for model training to obtain a predicted molecular structure includes: Inputting the multispectral data into an encoder in a preset molecular structure inference model, and performing feature extraction and feature fusion on the multispectral data by the encoder to obtain a first spectral feature; The first spectral feature and preset mass spectrum information are jointly decoded according to the decoder, and the predicted molecular structure is determined according to a decoding result of the joint decoding.

3. The molecular structure inference method according to claim 2, wherein: The step of inputting the multispectral data into an encoder in a preset molecular structure inference model, and performing feature extraction and feature fusion on the multispectral data by the encoder to obtain a first spectral feature includes: For each type of spectral data in the multispectral data, mapping the original spectral features of the spectral data to a high-dimensional embedding space, and then performing position encoding and spectral encoding to obtain a spectral feature embedding representation; The spectral feature embedding representation corresponding to each type of spectral data is input into the encoder, and the features of each spectral feature embedding representation are extracted through the self-attention mechanism in the encoder. The features obtained through the feature extraction are weightedly fused through the cross-attention mechanism of the encoder to obtain multimodal features, and the multimodal features are used as the first spectral features.

4. The molecular structure inference method according to claim 2, wherein: The step of jointly decoding the first spectral feature and the preset mass spectrum information according to the decoder includes: Determining the true molecular structure of the training molecule, wherein the true molecular structure is represented by a SMILES sequence; Mapping the discrete labels of the SMILES sequence of the real molecular structure into a high-dimensional feature embedding vector and performing position encoding to obtain a first SMILES sequence; Determining a high-definition mass spectrum feature of the training molecule based on the mass spectrum information, and concatenating the high-definition mass spectrum feature with the first SMILES sequence to obtain a second SMILES sequence; The first spectral feature and the second SMILES sequence are jointly decoded according to the decoder.

5. The molecular structure inference method according to claim 4, wherein: The step of jointly decoding the first spectral feature and the second SMILES sequence according to the decoder includes: Determining, based on the self-attention mechanism of the decoder and the second SMILES sequence, a first representation feature for characterizing a dependency relationship between internal positions in the second SMILES sequence; Based on 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 between the first spectral feature and the second SMILES sequence is determined, and a decoding result is determined based on the second representation feature.

6. The molecular structure inference method according to claim 5, wherein: The step of determining, based on the self-attention mechanism of the decoder and the second SMILES sequence, a first characterization feature for characterizing the dependency relationship of internal positions in the second SMILES sequence comprises: Converting the second SMILES sequence into a Q matrix, a K matrix, and a V matrix through the self-attention mechanism of the decoder; Calculate the 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; Determining a mask matrix based on the length of the second SMILES sequence, wherein the mask matrix is a lower triangular matrix, a main diagonal of the mask matrix and positions below the main diagonal are set to first elements indicating that position features are visible, and positions above the main diagonal are set to second elements indicating that position features are invisible; The attention weight of each position is determined according to the Softmax function in combination with the mask matrix and the self-attention score matrix, and the V matrix is weighted according to the attention weight to obtain a first characterization feature for characterizing the dependency relationship of internal elements in the second SMILES sequence.

7. The molecular structure inference method according to claim 1, wherein: The step of determining a multispectral data set comprising multispectral data of at least one training molecule comprises: According to a preset quantum chemical calculation strategy, multispectral data of at least one training molecule are obtained, and all of the multispectral data are aggregated to obtain a multispectral dataset containing the multispectral data of at least one training molecule, wherein the quantum chemical calculation strategy includes using the MPW1PW91 functional and the 6-311+G(2d,p) basis set for calculations on nuclear magnetic resonance spectral data, and using the B3LYP functional and the def-TZVP basis set for calculations on infrared spectral and ultraviolet spectral data.

8. The molecular structure inference method according to claim 1, wherein: After the step of determining a multispectral data set comprising multispectral data of at least one training molecule, the method further comprises: Preprocessing the multispectral data in the multispectral dataset, wherein the preprocessing includes data normalization, noise filtering and data enhancement; According to the pre-processed multispectral data, the step of inputting the multispectral data in the multispectral data set into a preset molecular structure inference model for model training is performed.

9. An electronic device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the molecular structure inference method according to any one of claims 1 to 8.

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

Citation Information

Patent Citations

  • Training method and device for molecular generation model

    CN115359856A

  • Method, system, medium and equipment for identifying molecule type based on spectrum

    CN117558358A

  • Dissociation constant prediction method based on coarse-grained protein structure

    CN118116507A

  • AI polypeptide structure identification method based on Transform model and application thereof

    CN118298927A

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

    CN118965252A