Molecular structure prediction method and device, electronic equipment and storage medium

By jointly training the target spectral encoder and the target structure prediction model, the problem of lack of physicochemical constraints in molecular structure prediction in existing technologies has been solved. This has enabled the generation of high-fidelity and highly controllable molecular structures, improved the accuracy and diversity of generated molecules, and facilitated the design of drugs and functional materials.

CN121885010APending Publication Date: 2026-04-17INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
INST OF AUTOMATION CHINESE ACAD OF SCI
Filing Date
2025-12-11
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing methods for predicting molecular structures lack physicochemical and experimental constraints, resulting in poor accuracy and diversity of the generated molecular structures and low functionality.

Method used

A joint training method of target spectrum encoder and target structure prediction model is adopted. By acquiring molecular spectrum data, the Transformer backbone network and hybrid expert model are deeply fused to calculate multi-level alignment loss and physical self-supervision loss, so as to ensure that the generated molecular structure conforms to physicochemical constraints.

Benefits of technology

It significantly improves the accuracy and diversity of molecular structures, enhances the functionality of generated molecules, and greatly accelerates the design of drug lead compounds and functional materials.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121885010A_ABST
    Figure CN121885010A_ABST
Patent Text Reader

Abstract

The invention provides a molecular structure prediction method and device, electronic equipment and a storage medium, and relates to the technical field of molecular structure prediction.According to the method, a target spectrogram encoder and a target structure prediction model are introduced, and combined training is carried out through the target spectrogram encoder and a target structure encoder; the molecular structure information and the spectrogram data can be deeply fused in the training process, so that the global spectrogram representation obtained by the target spectrogram encoder can represent the molecular structure information, the problem that the molecular generation field is lack of accurate physical constraints is solved, the quality of the global spectrogram representation is remarkably improved, and the training efficiency is improved. And the accuracy and diversity of the finally obtained target molecular structure are improved. According to the method, through a target structure prediction model, high-fidelity and high-controllability reverse generation of a molecular structure based on molecular spectrogram data can be ensured, and discovery of drug lead compounds and design of novel catalysts or functional materials are greatly accelerated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of molecular structure prediction technology, and in particular to a molecular structure prediction method, apparatus, electronic device and storage medium. Background Technology

[0002] Existing molecular structure prediction methods mainly rely on recurrent neural networks (RNNs) based on simplified molecular input line entry system (SMILES) strings or graph-based variational autoencoders (VAEs). However, these methods usually lack physicochemical constraints or experimental observation constraints, making it difficult to guarantee the accuracy and diversity of the generated molecular structures, which in turn leads to poor functionality of the molecular structures. Summary of the Invention

[0003] This invention provides a molecular structure prediction method, apparatus, electronic device, and storage medium to address the deficiencies in related technologies.

[0004] This invention provides a method for predicting molecular structure, comprising: Acquire molecular spectral data; The molecular spectrum data is input into the target spectrum encoder to obtain the global spectrum representation output by the target spectrum encoder; Based on the target structure prediction model, and using the global spectral representation as a condition, the target molecular structure corresponding to the molecular spectral data is predicted; The target spectral encoder is obtained by joint training with the target structure encoder based on the first molecular structure sample and the first spectral data sample corresponding to the first molecular structure sample. The target structure prediction model is obtained by training the target spectral encoder and the target structure encoder based on the second molecular structure sample and the second spectral data sample corresponding to the second molecular structure sample.

[0005] According to a molecular structure prediction method provided by the present invention, the training steps of the target spectral encoder include: The first molecular structure sample is input into the initial structure encoder to obtain the atomic representation, molecular representation and molecular field representation of the first molecular structure sample output by the initial structure encoder; The first spectral data sample is input into the initial spectral encoder to obtain the local and global representations output by the initial spectral encoder. Based on the atomic representation and the local representation, calculate the local alignment loss; based on the molecular representation and the global representation, calculate the global alignment loss; and based on the molecular field representation and the molecular representation, calculate the physical self-supervised loss. Based on the local alignment loss, the global alignment loss, and the physical self-supervised loss, a first training loss is calculated, and based on the first training loss, the initial structure encoder and the initial spectrogram encoder are jointly trained to obtain the target spectrogram encoder.

[0006] According to a molecular structure prediction method provided by the present invention, the first spectral data sample includes data samples of multiple spectral types, and each data sample of a spectral type includes a masking code for the actual spectral value at a preset spectral segment; the calculation step of the first training loss includes: Based on the initial dual-path reconstruction head, the local representation and the global representation are applied to perform inter-spectral prediction and intra-spectral prediction on the occlusion mask to obtain inter-spectral predicted spectral values ​​and intra-spectral predicted spectral values. Based on the inter-spectral predicted spectral values, the intra-spectral predicted spectral values ​​and each of the actual spectral values, the spectral reconstruction loss is calculated. The first training loss is calculated based on the spectral reconstruction loss, the local alignment loss, the global alignment loss, and the physical self-supervised loss. Accordingly, the step of jointly training the initial structural encoder and the initial spectrogram encoder based on the first training loss to obtain the target spectrogram encoder includes: Based on the first training loss, the initial structure encoder, the initial spectrogram encoder, and the initial dual-path reconstruction head are jointly trained to obtain the target spectrogram encoder.

[0007] According to a molecular structure prediction method provided by the present invention, the training steps of the target structure prediction model include: The second spectral data sample is input into the target spectral encoder to obtain the global spectral representation sample output by the target spectral encoder; Based on the initial structure prediction model, the predicted molecular structure corresponding to the spectral data sample is obtained using the global spectral characterization sample as a condition. The predicted molecular structure is input into the target structure encoder to obtain the molecular representation sample output by the target structure encoder; Based on the predicted molecular structure and the second molecular structure sample, the graph diffusion denoising loss is calculated, and based on the molecular representation sample and the global spectral characterization sample, the conditional fidelity loss is calculated. Based on the graph diffusion denoising loss and the conditional fidelity loss, a second training loss is calculated, and based on the second training loss, the initial structure prediction model is trained to obtain the target structure prediction model.

[0008] According to the molecular structure prediction method provided by the present invention, the second spectral data sample includes ultraviolet spectral data samples; The calculation step of the second training loss also includes: Based on the predicted molecular structure, the position of the predicted absorption peak corresponding to the predicted molecular structure is determined, and the absorption constraint is calculated based on the actual absorption peak position in the ultraviolet spectral data sample and the predicted absorption peak position. The second training loss is calculated based on the absorption constraint, the graph diffusion denoising loss, and the conditional fidelity loss.

[0009] According to the molecular structure prediction method provided by the present invention, the second spectral data sample further includes Raman spectral data samples; The calculation step of the second training loss also includes: Based on the predicted molecular structure, the predicted peak position corresponding to the predicted molecular structure is determined, and the peak position constraint is calculated based on the actual peak position in the Raman spectral data sample and the predicted peak position. The second training loss is calculated based on the spectral peak position constraint, the graph diffusion denoising loss, and the conditional fidelity loss.

[0010] According to the molecular structure prediction method provided by the present invention, the target spectral encoder includes a Transformer backbone network and a hybrid expert model; The hybrid expert model is set in the multi-head self-attention layer of the Transformer backbone network or in the feedforward neural network; The hybrid expert model includes a gated network and multiple expert networks. The gated network is used to assign routing weights to each of the expert networks based on the global spectrogram representation, and to select at least two of the expert networks from each of the expert networks to process the input based on the routing weights.

[0011] The present invention also provides a molecular structure prediction device, comprising: The data acquisition module is used to acquire molecular spectrum data; The spectral encoding module is used to input the molecular spectral data into the target spectral encoder to obtain the global spectral representation output by the target spectral encoder; The molecular structure prediction module is used to predict the target molecular structure corresponding to the molecular spectrum data based on the target structure prediction model and with the global spectrum characterization as a condition. The target spectral encoder is obtained by joint training with the target structure encoder based on the first molecular structure sample and the first spectral data sample corresponding to the first molecular structure sample. The target structure prediction model is obtained by training the target spectral encoder and the target structure encoder based on the second molecular structure sample and the second spectral data sample corresponding to the second molecular structure sample.

[0012] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the molecular structure prediction method as described above.

[0013] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the molecular structure prediction method as described above.

[0014] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the molecular structure prediction method as described above.

[0015] This invention provides a molecular structure prediction method, apparatus, electronic device, and storage medium. The method introduces a target spectral encoder and a target structure prediction model. Through joint training of the target spectral encoder and the target structure encoder, molecular structure information and spectral data can be deeply fused during training. This allows the global spectral representation obtained by the target spectral encoder to characterize molecular structure information, solving the problem of lacking precise physical constraints in the field of molecular generation. This significantly improves the quality of global spectral representation, thereby enhancing the accuracy and diversity of the final target molecular structures. The method, through the target structure prediction model, ensures high-fidelity and highly controllable reverse generation of molecular structures based on molecular spectral data, greatly accelerating the discovery of drug lead compounds and the design of novel catalysts or functional materials. It provides a new, high-fidelity, and highly controllable design paradigm for chemical and biological research. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in this invention or related technologies, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a schematic flowchart of the molecular structure prediction method provided by the present invention.

[0018] Figure 2 This is a schematic diagram of the molecular structure prediction device provided by the present invention.

[0019] Figure 3 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0021] Because existing molecular structure prediction methods often lack physicochemical or experimental constraints, it is difficult to guarantee the accuracy and diversity of the generated molecular structures, resulting in poor functionality of the molecular structures. Therefore, this invention provides a molecular structure prediction method.

[0022] like Figure 1 As shown, the molecular structure prediction method provided in this embodiment of the invention includes: S1, acquire molecular spectrum data; S2, input the molecular spectrum data into the target spectrum encoder to obtain the global spectrum representation output by the target spectrum encoder; S3, Based on the target structure prediction model, and using the global spectral representation as a condition, predict the target molecular structure corresponding to the molecular spectral data; The target spectral encoder is obtained by joint training with the target structure encoder based on the first molecular structure sample and the first spectral data sample corresponding to the first molecular structure sample. The target structure prediction model is obtained by training the target spectral encoder and the target structure encoder based on the second molecular structure sample and the second spectral data sample corresponding to the second molecular structure sample.

[0023] Specifically, the molecular structure prediction method provided in this embodiment of the invention is executed by a molecular structure prediction device, which can be configured in a computer. The computer can be a local computer or a cloud computer. The local computer can be a computer, tablet, etc., and no specific limitation is made here.

[0024] First, execute step S1 to acquire molecular spectral data. This molecular spectral data refers to the spectral data provided by the user to predict the molecular structure, and can be experimental observation data. This molecular spectral data can characterize the quantum energy level structure information of the molecule and can include at least one of spectral data and energy dispersive spectroscopy (EDS) data. Spectral data can include at least one of infrared (IR) spectroscopy, Raman spectroscopy, and ultraviolet (UV) spectroscopy, while EDS data can include at least one of nuclear magnetic resonance (NMR) spectroscopy and mass spectrometry (MS) data.

[0025] Then, step S2 is executed, where the molecular spectrum data is input into the pre-trained target spectrum encoder, and the molecular spectrum data is encoded by the target spectrum encoder to obtain and output the global spectrum representation.

[0026] The target spectral encoder can be obtained by jointly training the initial spectral encoder and the initial structure encoder using paired first molecular structure samples and their corresponding first spectral data samples. The target spectral encoder and the initial spectral encoder have the same structure and can both include a Transformer backbone network.

[0027] When training the initial spectral encoder and the initial structure encoder, the first molecular structure sample is input into the initial structure encoder to obtain its first output. The first spectral data sample is then input into the initial spectral encoder to obtain its second output. Subsequently, the first and second outputs are used to calculate the first training loss. Finally, the initial structure encoder and the initial spectral encoder are iteratively trained using the first training loss. When a first preset number of iterations is reached or the first training loss converges, the target structure encoder and the target spectral encoder are obtained.

[0028] Here, the target structure encoder and the initial structure encoder have the same structure, and can both include one of the following: 3D E(3) equivariant network, graph neural network (GNN) and graph convolutional neural network (GCN).

[0029] Finally, step S3 is executed, where the global spectral representation is used as a condition, and the noise map and the global spectral representation are input into the pre-trained target structure prediction model. The target structure prediction model uses the global spectral representation to iteratively denoise the noise map, thereby obtaining the target molecular structure corresponding to the molecular spectral data. This target molecular structure is the molecular structure that possesses the attributes of the molecular spectral data. Here, the noise map can be a random Gaussian noise map or a noise map introduced during the training of the target structure prediction model.

[0030] The target structure prediction model can be obtained by training the initial structure prediction model using paired second molecular structure samples and corresponding second spectral data samples, applying a target spectral encoder and a target structure encoder. The target structure prediction model and the initial structure prediction model have the same structure, and both can include one of the following: a flow-based model, a graph variational autoencoder (Graph VAE), and a conditional graph diffusion model (CGDM). In this embodiment of the invention, CGDM is preferably used.

[0031] When training the initial structure prediction model, the second spectral data sample can be input into the target spectral encoder to obtain the global spectral representation sample output by the target spectral encoder. Then, using the initial structure prediction model and the global spectral representation sample as a condition, the predicted molecular structure corresponding to the spectral data sample can be obtained. Using the predicted molecular structure and the second molecular structure samples, the second training loss is calculated. Then, the initial structure prediction model is iteratively trained using the second training loss. When the second preset number of iterations is reached or the second training loss converges, the target structure prediction model is obtained.

[0032] It is understandable that after obtaining the first and second spectral data samples, preprocessing operations can be performed on them. These preprocessing operations may include: (1) uniform sampling and rerasterization; (2) baseline removal and background suppression; (3) peak significance calculation; (4) normalization and cross-spectral alignment; and (5) spectral patch division.

[0033] After preprocessing, a first intensity vector composed of the spectral values ​​of each spectral segment corresponding to the first spectral data sample and a second intensity vector composed of the spectral values ​​of each spectral segment corresponding to the second spectral data sample are obtained. Subsequently, the first intensity vector is used as the input to the initial spectral encoder, and the second intensity vector is used as the input to the target spectral encoder.

[0034] In this embodiment of the invention, the controllability prediction of the generated target molecular structure can also be achieved by changing the acquired molecular spectrum data. For example, by adjusting the spectral peaks of specific spectral segments in the molecular spectrum data, the presence or absence of corresponding functional groups in the target molecular structure can be controlled.

[0035] The molecular structure prediction method provided in this invention first acquires molecular spectral data; then, it inputs the molecular spectral data into a target spectral encoder to obtain a global spectral representation output by the encoder; finally, it uses a target structure prediction model, based on the global spectral representation, to predict the target molecular structure corresponding to the molecular spectral data. This method introduces a target spectral encoder and a target structure prediction model. Through joint training of the target spectral encoder and the target structure encoder, molecular structure information and spectral data can be deeply integrated during training. This allows the global spectral representation obtained by the target spectral encoder to represent molecular structure information, solving the problem of lacking precise physical constraints in the field of molecular generation, significantly improving the quality of the global spectral representation, and thus improving the accuracy and diversity of the final target molecular structure. This method, through the target structure prediction model, can ensure high-fidelity and highly controllable reverse generation of molecular structures based on molecular spectral data, greatly accelerating the discovery of drug lead compounds and the design of novel catalysts or functional materials, providing a new, high-fidelity, and highly controllable design paradigm for chemical and biological research.

[0036] Based on the above embodiments, the training steps of the target spectral encoder include: The first molecular structure sample is input into the initial structure encoder to obtain the atomic representation, molecular representation and molecular field representation of the first molecular structure sample output by the initial structure encoder; The first spectral data sample is input into the initial spectral encoder to obtain the local and global representations output by the initial spectral encoder. Based on the atomic representation and the local representation, calculate the local alignment loss; based on the molecular representation and the global representation, calculate the global alignment loss; and based on the molecular field representation and the molecular representation, calculate the physical self-supervised loss. Based on the local alignment loss, the global alignment loss, and the physical self-supervised loss, a first training loss is calculated, and based on the first training loss, the initial structure encoder and the initial spectrogram encoder are jointly trained to obtain the target spectrogram encoder.

[0037] Specifically, during the training process of the target spectral encoder, the first output of the initial structure encoder can include the atomic representation, molecular representation, and molecular field representation of the first molecular structure sample. The molecular field representation can be the energy representation or force representation in the first molecular structure sample. The second output of the initial spectral encoder can include the local representation and global representation of the first spectral data sample. Here, the local representation can be the feature representation corresponding to each spectral segment in the first spectral data sample, and the global representation can be the feature representation corresponding to the CLS field in the first spectral data sample.

[0038] Furthermore, the local alignment loss can be calculated using atomic and local representations, i.e.: ; in, Represents the local alignment loss, where i is the representation of the i-th atom in the first molecular structure sample. The k-th local representation of the first spectral data sample The similarity between them.

[0039] Using the molecular and global representations, the global alignment loss is calculated as follows: ; in, Represents the global alignment loss, which is the molecular representation of the first molecular structure sample. Global representation of the first spectral data sample The similarity between them.

[0040] The difference between molecular field representation and molecular representation can also be used to calculate physical self-supervised loss.

[0041] Finally, the first training loss can be obtained by weighted summation of the local alignment loss, global alignment loss, and physical self-supervised loss.

[0042] By using the first training loss, the initial structural encoder and the initial spectrogram encoder can be jointly trained to obtain the target spectrogram encoder.

[0043] In this embodiment of the invention, the first training loss is calculated by local alignment loss, global alignment loss and physical self-supervised loss, and multi-level alignment measurement is introduced. This allows the global spectral representation obtained by the target spectral encoder to implicitly contain rich molecular structure information, thereby improving the accuracy and reliability of the final target molecular structure.

[0044] Based on the above embodiments, the first spectral data sample includes data samples of multiple spectral types, and each data sample of a spectral type includes an occlusion mask of the actual spectral value at a preset spectral segment; the calculation steps of the first training loss include: Based on the initial dual-path reconstruction head, the local representation and the global representation are applied to perform inter-spectral prediction and intra-spectral prediction on the occlusion mask to obtain inter-spectral predicted spectral values ​​and intra-spectral predicted spectral values. Based on the inter-spectral predicted spectral values, the intra-spectral predicted spectral values ​​and each of the actual spectral values, the spectral reconstruction loss is calculated. The first training loss is calculated based on the spectral reconstruction loss, the local alignment loss, the global alignment loss, and the physical self-supervised loss. Accordingly, the step of jointly training the initial structural encoder and the initial spectrogram encoder based on the first training loss to obtain the target spectrogram encoder includes: Based on the first training loss, the initial structure encoder, the initial spectrogram encoder, and the initial dual-path reconstruction head are jointly trained to obtain the target spectrogram encoder.

[0045] Specifically, to further improve the coding performance of the target spectral encoder, the first training loss can be further enriched by introducing spectral reconstruction loss into the first training loss.

[0046] The first spectral data sample may include data samples from multiple spectral types, such as at least two of infrared spectroscopy, Raman spectroscopy, ultraviolet spectroscopy, nuclear magnetic resonance spectroscopy, and mass spectrometry.

[0047] Each spectral data sample includes a masking code for the actual spectral value at a preset spectral segment. The masking code can be implemented using a saliency-driven masking strategy to enhance the robustness of the target spectral encoder to noise, missing spectral segments, and cross-spectral differences.

[0048] For each spectral type of data sample, the significance score of sampling point i can be calculated using the following formula: Among them, Prominence indicates a significant peak height. This represents the spectral intensity value at sampling point i. Let represent the curvature of the second derivative at sampling point i.

[0049] The significance scores of each sampling point can be aggregated by spectral segment. For example, the significance scores of each sampling point within each spectral segment can be weighted and summed to obtain the significance score of each spectral segment.

[0050] Subsequently, the saliency scores of each spectral segment are sorted in descending order, and a specified number of spectral segments with high saliency scores are selected as preset spectral segments. Alternatively, adjacent spectral segments of the specified number of spectral segments with high saliency scores can be selected as preset spectral segments, or several spectral segments can be randomly selected from other spectral segments besides the specified number of spectral segments with high saliency scores.

[0051] When calculating the first training loss, the initial dual-path reconstruction head can be used to apply local and global representations to perform inter-spectral prediction and intra-spectral prediction on the occlusion mask, respectively, to obtain inter-spectral predicted spectral values ​​and intra-spectral predicted spectral values. Inter-spectral prediction refers to using the spectral values ​​of the visible frequency band of one spectral class to predict the spectral value of an occlusion mask of another spectral class; the predicted spectral value is the inter-spectral predicted spectral value. Intra-spectral prediction refers to using the spectral values ​​of the visible frequency band of one spectral class to predict the spectral value of an occlusion mask of the same spectral class; the predicted spectral value is the intra-spectral predicted spectral value. In other words, each occlusion mask can correspond to both inter-spectral predicted spectral values ​​and intra-spectral predicted spectral values.

[0052] Subsequently, the spectral reconstruction loss is calculated using the inter-spectral predicted spectral values, intra-spectral predicted spectral values, and the actual spectral values ​​of data samples for each spectral type at the occlusion mask. The inter-spectral predicted spectral values ​​and intra-spectral predicted spectral values ​​can be fused first to obtain the fused spectral values, i.e.: in, For fused spectral values, The activation function is denoted by r, which represents the fusion coefficients generated through global representation. This allows the initial dual-path reconstruction head to flexibly balance local information with cross-spectral complementary information, improving cross-modal consistency and reconstruction accuracy. To predict spectral values ​​between spectra, This refers to the predicted spectral value within the spectrum.

[0053] Subsequently, the first training loss can be calculated by weighted summation of the spectral reconstruction loss, local alignment loss, global alignment loss, and physical self-supervised loss.

[0054] Correspondingly, the initial structural encoder, initial spectrogram encoder, and initial dual-path reconstruction head can be jointly trained using the first training loss to obtain the target structural encoder, target spectrogram encoder, and target dual-path reconstruction head.

[0055] In this embodiment of the invention, by introducing joint training of the initial dual-path reconstruction head, even when there are missing spectral segments in the molecular spectrum data, effective global spectral representations can be robustly extracted, which can further improve the accuracy, effectiveness and robustness of the global spectral representations obtained by the target spectrum encoder.

[0056] Based on the above embodiments, the target spectral encoder includes a Transformer backbone network and a hybrid expert model; The hybrid expert model is set in the multi-head self-attention layer of the Transformer backbone network or in the feedforward neural network; The hybrid expert model includes a gated network and multiple expert networks. The gated network is used to assign routing weights to each of the expert networks based on the global spectrogram representation, and to select at least two of the expert networks from each of the expert networks to process the input based on the routing weights.

[0057] Specifically, both the target spectral encoder and the initial spectral encoder can include a Transformer backbone network and a Mixture of Experts (MOE) model.

[0058] The Transformer backbone network consists of a masked multi-head attention layer, a multi-head self-attention layer, and a feedforward neural network. A hybrid expert model can be placed within either the multi-head self-attention layer or the feedforward neural network of the Transformer backbone network. Placing the hybrid expert model within the multi-head self-attention layer of the Transformer backbone network allows for expert-level management of attention weights across different spectral bands.

[0059] Hybrid expert models can include gate networks and multiple expert networks, each corresponding to a different spectral class, general class, functional group region, and fingerprint region.

[0060] Gated networks are used to perform linear transformations on the global spectral representation, obtaining routing weights for each expert network. These routing weights are then used to select at least two expert networks to process the input. Here, the routing weights of each expert network can be sorted in descending order, and the input is routed to two or more expert networks with high routing weights, allowing the receiving expert networks to process the input. Specifically, if a spectral segment is missing, the expert network corresponding to that segment is automatically shut down and does not participate in subsequent inference.

[0061] As the number of spectral types and frequency band complexity increase, the number of expert networks selected by the gating network can be appropriately increased to enhance the coverage and utilization of the expert networks. Simultaneously, each expert network can be automatically constrained by a load balancing regularization term, which can be added to the first training loss. The load balancing regularization term can be expressed as: ; in, Here, 'e' represents the load balancing regularization term, and 'e' represents the expert network. Let e ​​be the probability of being selected in the current spectral band, which is the normalized weight of each expert network with a high route weight output by the gated network, and we have: ; in, The number of expert networks with high route weights selected for the gated network. Let e ​​be the routing weight. Let k be the set of expert networks with high routing weights. for The routing weight of the j-th expert network in the network. Let e ​​be the normalized weight.

[0062] In this embodiment of the invention, by introducing a hybrid expert model into the target spectrum encoder, effective global spectrum representations can be robustly extracted for complex or multi-source molecular spectrum data, which can further improve the accuracy, effectiveness and robustness of the global spectrum representations obtained by the target spectrum encoder.

[0063] Based on the above embodiments, the training steps of the target structure prediction model include: The second spectral data sample is input into the target spectral encoder to obtain the global spectral representation sample output by the target spectral encoder; Based on the initial structure prediction model, the predicted molecular structure corresponding to the spectral data sample is obtained using the global spectral characterization sample as a condition. The predicted molecular structure is input into the target structure encoder to obtain the molecular representation sample output by the target structure encoder; Based on the predicted molecular structure and the second molecular structure sample, the graph diffusion denoising loss is calculated, and based on the molecular representation sample and the global spectral characterization sample, the conditional fidelity loss is calculated. Based on the graph diffusion denoising loss and the conditional fidelity loss, a second training loss is calculated, and based on the second training loss, the initial structure prediction model is trained to obtain the target structure prediction model.

[0064] Specifically, during the training process of the target structure prediction model, the second spectral data sample can be input into the target spectral encoder to obtain the global spectral representation sample output by the target spectral encoder. Then, using the initial structure prediction model and the global spectral representation sample as a condition, the predicted molecular structure corresponding to the spectral data sample can be obtained.

[0065] The global spectral representation samples are linearly projected to obtain condition vectors. These condition vectors are then concatenated with time-step codes and used as conditional inputs for each layer of the initial structure prediction model, guiding the model to iteratively denoise the noise map. This process ensures that the initial structure prediction model is continuously guided by the semantics of the global spectral representation samples during denoising.

[0066] Subsequently, the predicted molecular structure is input into the trained target structure encoder to obtain the molecular representation sample output by the target structure encoder.

[0067] By utilizing the difference between the predicted molecular structure and the second molecular structure sample, the graph diffusion denoising loss can be calculated. By utilizing the distance between the molecular representation sample and the global spectrum characterization sample, the conditional fidelity loss can be calculated.

[0068] Furthermore, a second training loss can be obtained by weighted summation of the graph diffusion denoising loss and the conditional fidelity loss. The initial structure prediction model can then be iteratively trained using the second training loss until the second preset number of iterations is reached or the second training loss converges, thus obtaining the target structure prediction model.

[0069] In this embodiment of the invention, the second training loss is determined by graph diffusion denoising loss and conditional fidelity loss, which can enhance the matching degree between the target molecular structure predicted by the target structure prediction model and the molecular spectrum data.

[0070] Based on the above embodiments, the second spectral data sample includes ultraviolet spectral data samples; the calculation step of the second training loss further includes: Based on the predicted molecular structure, the position of the predicted absorption peak corresponding to the predicted molecular structure is determined, and the absorption constraint is calculated based on the actual absorption peak position in the ultraviolet spectral data sample and the predicted absorption peak position. The second training loss is calculated based on the absorption constraint, the graph diffusion denoising loss, and the conditional fidelity loss.

[0071] Specifically, to further enhance the matching degree between the target molecular structure and the molecular spectrum data, constraints corresponding to specific spectral types can be introduced into the second training loss. For example, for the ultraviolet spectral data samples in the second spectral data samples, absorption constraints can be introduced. That is, using the predicted molecular structure, the predicted absorption peak positions corresponding to the predicted molecular structure are determined, and the absorption constraints are calculated using the actual absorption peak positions and predicted absorption peak positions in the ultraviolet spectral data samples. ; in, To absorb constraints, This represents the actual absorption peak position. To predict the location of the absorption peak.

[0072] Based on the above embodiments, the second spectral data sample further includes Raman spectral data samples; the calculation step of the second training loss further includes: Based on the predicted molecular structure, the predicted peak position corresponding to the predicted molecular structure is determined, and the peak position constraint is calculated based on the actual peak position in the Raman spectral data sample and the predicted peak position. The second training loss is calculated based on the spectral peak position constraint, the graph diffusion denoising loss, and the conditional fidelity loss.

[0073] Specifically, to further enhance the matching degree between the target molecular structure and the molecular spectrum data, the peak position constraints corresponding to the Raman spectral data samples can be introduced into the second training loss: ; in, To constrain the position of the spectral peaks, These represent the actual spectral peak positions in the Raman spectral data sample. This is the set of actual spectral peak positions in a sample of Raman spectral data. To predict the positions of the spectral peaks corresponding to the molecular structure. This is the set of predicted spectral peak positions corresponding to the predicted molecular structure.

[0074] like Figure 2 As shown, based on the above embodiments, this embodiment of the invention provides a molecular structure prediction device, comprising: Data acquisition module 21 is used to acquire molecular spectrum data; The spectrum encoding module 22 is used to input the molecular spectrum data to the target spectrum encoder to obtain the global spectrum representation output by the target spectrum encoder; Molecular structure prediction module 23 is used to predict the target molecular structure corresponding to the molecular spectrum data based on the target structure prediction model and with the global spectrum characterization as a condition; The target spectral encoder is obtained by joint training with the target structure encoder based on the first molecular structure sample and the first spectral data sample corresponding to the first molecular structure sample. The target structure prediction model is obtained by training the target spectral encoder and the target structure encoder based on the second molecular structure sample and the second spectral data sample corresponding to the second molecular structure sample.

[0075] Based on the above embodiments, the molecular structure prediction device provided in this embodiment of the invention further includes a first training module, used for: The first molecular structure sample is input into the initial structure encoder to obtain the atomic representation, molecular representation and molecular field representation of the first molecular structure sample output by the initial structure encoder; The first spectral data sample is input into the initial spectral encoder to obtain the local and global representations output by the initial spectral encoder. Based on the atomic representation and the local representation, calculate the local alignment loss; based on the molecular representation and the global representation, calculate the global alignment loss; and based on the molecular field representation and the molecular representation, calculate the physical self-supervised loss. Based on the local alignment loss, the global alignment loss, and the physical self-supervised loss, a first training loss is calculated, and based on the first training loss, the initial structure encoder and the initial spectrogram encoder are jointly trained to obtain the target spectrogram encoder.

[0076] Based on the above embodiments, the molecular structure prediction device provided in this embodiment of the invention includes a first spectral data sample comprising data samples of multiple spectral types, each of which includes a masking code for the actual spectral value at a preset spectral segment; the first training module is specifically used for: Based on the initial dual-path reconstruction head, the local representation and the global representation are applied to perform inter-spectral prediction and intra-spectral prediction on the occlusion mask to obtain inter-spectral predicted spectral values ​​and intra-spectral predicted spectral values. Based on the inter-spectral predicted spectral values, the intra-spectral predicted spectral values ​​and each of the actual spectral values, the spectral reconstruction loss is calculated. The first training loss is calculated based on the spectral reconstruction loss, the local alignment loss, the global alignment loss, and the physical self-supervised loss. Accordingly, the step of jointly training the initial structural encoder and the initial spectrogram encoder based on the first training loss to obtain the target spectrogram encoder includes: Based on the first training loss, the initial structure encoder, the initial spectrogram encoder, and the initial dual-path reconstruction head are jointly trained to obtain the target spectrogram encoder.

[0077] Based on the above embodiments, the molecular structure prediction device provided in this embodiment of the invention further includes a second training module, used for: The second spectral data sample is input into the target spectral encoder to obtain the global spectral representation sample output by the target spectral encoder; Based on the initial structure prediction model, the predicted molecular structure corresponding to the spectral data sample is obtained using the global spectral characterization sample as a condition. The predicted molecular structure is input into the target structure encoder to obtain the molecular representation sample output by the target structure encoder; Based on the predicted molecular structure and the second molecular structure sample, the graph diffusion denoising loss is calculated, and based on the molecular representation sample and the global spectral characterization sample, the conditional fidelity loss is calculated. Based on the graph diffusion denoising loss and the conditional fidelity loss, a second training loss is calculated, and based on the second training loss, the initial structure prediction model is trained to obtain the target structure prediction model.

[0078] Based on the above embodiments, the molecular structure prediction device provided in this embodiment of the invention includes ultraviolet spectral data samples as the second spectral data sample; The second training module is specifically used for: Based on the predicted molecular structure, the position of the predicted absorption peak corresponding to the predicted molecular structure is determined, and the absorption constraint is calculated based on the actual absorption peak position in the ultraviolet spectral data sample and the predicted absorption peak position. The second training loss is calculated based on the absorption constraint, the graph diffusion denoising loss, and the conditional fidelity loss.

[0079] Based on the above embodiments, the molecular structure prediction device provided in the embodiments of the present invention further includes Raman spectral data samples in the second spectral data sample; The second training module is also specifically used for: Based on the predicted molecular structure, the predicted peak position corresponding to the predicted molecular structure is determined, and the peak position constraint is calculated based on the actual peak position in the Raman spectral data sample and the predicted peak position. The second training loss is calculated based on the spectral peak position constraint, the graph diffusion denoising loss, and the conditional fidelity loss.

[0080] Based on the above embodiments, the molecular structure prediction device provided in this embodiment of the invention includes a target spectral encoder comprising a Transformer backbone network and a hybrid expert model; The hybrid expert model is set in the multi-head self-attention layer of the Transformer backbone network or in the feedforward neural network; The hybrid expert model includes a gated network and multiple expert networks. The gated network is used to assign routing weights to each of the expert networks based on the global spectrogram representation, and to select at least two of the expert networks from each of the expert networks to process the input based on the routing weights.

[0081] Specifically, the functions of each module in the molecular structure prediction device provided in this embodiment correspond one-to-one with the operation flow of each step in the above method embodiment, and the achieved effects are also the same. Please refer to the above embodiments for details, and this will not be repeated in this embodiment.

[0082] Figure 3 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 3 As shown, the electronic device may include a processor 810, a communications interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communications interface 820, and the memory 830 communicate with each other via the communication bus 840. The processor 810 can call logical instructions in the memory 830 to execute the molecular structure prediction methods provided in the above embodiments.

[0083] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to related technologies, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0084] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the molecular structure prediction method provided in the above embodiments.

[0085] In another aspect, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the molecular structure prediction methods provided in the above embodiments. This computer-readable storage medium can be either a non-transitory computer-readable storage medium or a transient computer-readable storage medium, and no specific limitation is made herein.

[0086] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0087] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of software products. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for predicting molecular structure, characterized in that, include: Acquire molecular spectral data; The molecular spectrum data is input into the target spectrum encoder to obtain the global spectrum representation output by the target spectrum encoder; Based on the target structure prediction model, and using the global spectral representation as a condition, the target molecular structure corresponding to the molecular spectral data is predicted; The target spectral encoder is obtained by joint training with the target structure encoder based on the first molecular structure sample and the first spectral data sample corresponding to the first molecular structure sample. The target structure prediction model is obtained by training the target spectral encoder and the target structure encoder based on the second molecular structure sample and the second spectral data sample corresponding to the second molecular structure sample.

2. The molecular structure prediction method according to claim 1, characterized in that, The training steps for the target spectral encoder include: The first molecular structure sample is input into the initial structure encoder to obtain the atomic representation, molecular representation and molecular field representation of the first molecular structure sample output by the initial structure encoder; The first spectral data sample is input into the initial spectral encoder to obtain the local and global representations output by the initial spectral encoder. Based on the atomic representation and the local representation, calculate the local alignment loss; based on the molecular representation and the global representation, calculate the global alignment loss; and based on the molecular field representation and the molecular representation, calculate the physical self-supervised loss. Based on the local alignment loss, the global alignment loss, and the physical self-supervised loss, a first training loss is calculated, and based on the first training loss, the initial structure encoder and the initial spectrogram encoder are jointly trained to obtain the target spectrogram encoder.

3. The molecular structure prediction method according to claim 2, characterized in that, The first spectral data sample includes data samples of multiple spectral types, and each data sample of a spectral type includes a masking code for the actual spectral value at a preset spectral segment; The calculation steps for the first training loss include: Based on the initial dual-path reconstruction head, the local representation and the global representation are applied to perform inter-spectral prediction and intra-spectral prediction on the occlusion mask to obtain inter-spectral predicted spectral values ​​and intra-spectral predicted spectral values. Based on the inter-spectral predicted spectral values, the intra-spectral predicted spectral values ​​and each of the actual spectral values, the spectral reconstruction loss is calculated. The first training loss is calculated based on the spectral reconstruction loss, the local alignment loss, the global alignment loss, and the physical self-supervised loss. Accordingly, the step of jointly training the initial structural encoder and the initial spectrogram encoder based on the first training loss to obtain the target spectrogram encoder includes: Based on the first training loss, the initial structure encoder, the initial spectrogram encoder, and the initial dual-path reconstruction head are jointly trained to obtain the target spectrogram encoder.

4. The molecular structure prediction method according to claim 1, characterized in that, The training steps for the target structure prediction model include: The second spectral data sample is input into the target spectral encoder to obtain the global spectral representation sample output by the target spectral encoder; Based on the initial structure prediction model, the predicted molecular structure corresponding to the spectral data sample is obtained using the global spectral characterization sample as a condition. The predicted molecular structure is input into the target structure encoder to obtain the molecular representation sample output by the target structure encoder; Based on the predicted molecular structure and the second molecular structure sample, the graph diffusion denoising loss is calculated, and based on the molecular representation sample and the global spectral characterization sample, the conditional fidelity loss is calculated. Based on the graph diffusion denoising loss and the conditional fidelity loss, a second training loss is calculated, and based on the second training loss, the initial structure prediction model is trained to obtain the target structure prediction model.

5. The molecular structure prediction method according to claim 4, characterized in that, The second spectral data sample includes ultraviolet spectral data samples; The calculation step of the second training loss also includes: Based on the predicted molecular structure, the position of the predicted absorption peak corresponding to the predicted molecular structure is determined, and the absorption constraint is calculated based on the actual absorption peak position in the ultraviolet spectral data sample and the predicted absorption peak position. The second training loss is calculated based on the absorption constraint, the graph diffusion denoising loss, and the conditional fidelity loss.

6. The molecular structure prediction method according to claim 4, characterized in that, The second spectral data sample also includes Raman spectral data samples; The calculation step of the second training loss also includes: Based on the predicted molecular structure, the predicted peak position corresponding to the predicted molecular structure is determined, and the peak position constraint is calculated based on the actual peak position in the Raman spectral data sample and the predicted peak position. The second training loss is calculated based on the spectral peak position constraint, the graph diffusion denoising loss, and the conditional fidelity loss.

7. The molecular structure prediction method according to any one of claims 1-6, characterized in that, The target spectral encoder includes a Transformer backbone network and a hybrid expert model; The hybrid expert model is set in the multi-head self-attention layer of the Transformer backbone network or in the feedforward neural network; The hybrid expert model includes a gated network and multiple expert networks. The gated network is used to assign routing weights to each of the expert networks based on the global spectrogram representation, and to select at least two of the expert networks from each of the expert networks to process the input based on the routing weights.

8. A molecular structure prediction device, characterized in that, include: The data acquisition module is used to acquire molecular spectrum data; The spectral encoding module is used to input the molecular spectral data into the target spectral encoder to obtain the global spectral representation output by the target spectral encoder; The molecular structure prediction module is used to predict the target molecular structure corresponding to the molecular spectrum data based on the target structure prediction model and with the global spectrum characterization as a condition. The target spectral encoder is obtained by joint training with the target structure encoder based on the first molecular structure sample and the first spectral data sample corresponding to the first molecular structure sample. The target structure prediction model is obtained by training the target spectral encoder and the target structure encoder based on the second molecular structure sample and the second spectral data sample corresponding to the second molecular structure sample.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the molecular structure prediction method as described in any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the molecular structure prediction method as described in any one of claims 1-7.