A three-dimensional molecule generation method fusing conditional flow matching and van der waals radius constraint

By integrating conditional flow matching and van der Waals radius constraints into a three-dimensional molecule generation method, the problems of molecular trajectory drift and computational resource waste in existing technologies are solved, achieving efficient generation of three-dimensional molecules that conform to physical laws and improving the stability and similarity of the generated molecules.

CN121709081BActive Publication Date: 2026-04-14JIANGXI AGRICULTURAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JIANGXI AGRICULTURAL UNIVERSITY
Filing Date
2026-02-13
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing deep generation methods struggle to achieve both high fidelity and physical accuracy when generating 3D molecules. They suffer from issues such as trajectory drift, decreased geometric robustness, computational resource consumption due to global guidance, and local geometric distortions. They also lack effective physical constraints and adaptive mechanisms.

Method used

A three-dimensional molecule generation method integrating conditional flow matching and van der Waals radius constraints is adopted. By constructing a molecular training dataset, a continuous flow matching prediction model combined with van der Waals radius constraints is used to perform geometric collision penalties and dynamic weight scheduling to achieve adaptive local geometric refinement and ensure that the generated molecules conform to physical laws.

Benefits of technology

It improves the physical rationality and chemical validity of generated molecules, reduces computational resource consumption, and improves the stability and local geometric quality of generated trajectories. The generated molecules perform well on the QM9 and GEOM-DRUG datasets, exhibiting high stability and high similarity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121709081B_ABST
    Figure CN121709081B_ABST
Patent Text Reader

Abstract

The application discloses a three-dimensional molecule generation method combining conditional flow matching with van der Waals radius constraint, processes a molecular training data set, extracts the total number of atoms and a training element component histogram; based on optimal transmission path interpolation, combines a sampling time step and a standard Gaussian noise to construct a noise coordinate and a target condition velocity field; the noise coordinate is input into a continuous flow matching prediction model, node features are extracted through affine transformation modulation, a predicted velocity field is obtained, a soft atomic type distribution is generated, and the expected van der Waals radius of each atomic type is calculated; a flow matching loss is calculated from the predicted velocity field and the target condition velocity field, a geometric collision penalty term is calculated from the expected van der Waals radius and the noise coordinate, a total loss function is constructed to train model parameters; the trained parameters are used to define an ordinary differential equation for solving, and a three-dimensional molecular structure file is output. The method suppresses atomic space overlap and improves the physical rationality and chemical effectiveness of generated molecules.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer-aided molecular design, specifically relating to a method for generating three-dimensional molecules that integrates conditional flow matching and van der Waals radius constraints. Background Technology

[0002] In the fields of new drug development and materials science, designing molecules with specific functions and three-dimensional spatial structures from scratch has always been a core challenge. In recent years, deep generation methods based on diffusion models and flow matching have attracted widespread attention because they can directly generate three-dimensional molecular conformations that conform to physical laws. However, although these pre-trained general models can generate chemically reasonable molecules, they still face multiple technical bottlenecks in pursuing high fidelity and physical accuracy: on the one hand, traditional models usually only predict noise or instantaneous vector fields, lacking the part that directly predicts noise-free clean data at each generation moment, resulting in the sampling trajectory lacking the "gravity" pointing to the real chemical manifold, which easily leads to a decrease in geometric robustness due to trajectory drift at low sampling steps; on the other hand, existing physical constraint methods are either limited to abstract latent space or use blind all-atom constraints, failing to establish a physical hard screen for the atomic nucleus in the decoded physical coordinate space. The existing molecular generation methods face several challenges. First, they struggle to accurately distinguish between unbonded atom pairs and normal covalent structures, often compromising chemoeffectiveness due to over-smoothing and error penalties. Second, conventional generation strategies typically employ statically weighted path matching throughout the entire time step, failing to achieve a dynamic trade-off between exploring diverse optimal transport paths and ensuring structural accuracy in manifold projection based on the sampling process. Finally, most existing geometry correction strategies rely on global guidance throughout the entire process, resulting in severe numerical rigidity and computational resource consumption. They lack an adaptive mechanism capable of sensitively identifying local geometric distortions such as ring tension anomalies or torsion angle deviations and performing on-demand, triggered refinement. Therefore, a novel molecular generation method is needed that can simultaneously accomplish physically constrained manifold projection tasks while maintaining geometric quality, physical consistency, and computational efficiency. Summary of the Invention

[0003] To address the shortcomings of current technologies, this invention proposes a method for generating three-dimensional molecules that integrates conditional flow matching and van der Waals radius constraints, in order to solve the problems mentioned in the background.

[0004] To achieve the above objectives, the present invention provides the following technical solution: a method for generating three-dimensional molecules by integrating conditional flow matching and van der Waals radius constraints, comprising:

[0005] Step 1: Construct a molecular training dataset, process the molecular training dataset, and extract the total number of atoms and the histogram of training element composition;

[0006] Step 2: Based on the optimal transmission path interpolation, construct the noisy coordinates and target conditional velocity field at the current moment according to the sampling time step and the sampling standard Gaussian noise;

[0007] Step 3: Based on the total number of atoms and the histogram of training elements, perform affine transformation modulation on the noisy coordinates at the current moment through the continuous flow matching prediction model to extract node features. Process the node features to obtain the predicted velocity field of the noisy coordinates at the current moment.

[0008] Step 4: Process the node features to convert them into soft atom type distributions, and calculate the expected van der Waals radius of each atom type based on the soft atom type distributions;

[0009] Step 5: Calculate the flow matching loss based on the predicted velocity field and the target conditional velocity field, and calculate the geometric collision penalty term based on the expected van der Waals radius and the noisy coordinates at the current moment;

[0010] Step 6: Construct a total loss function based on the flow matching loss and geometric collision penalty term, train the parameters of the continuous flow matching prediction model based on the total loss function, and obtain the parameters of the final trained continuous flow matching prediction model;

[0011] Step 7: Set the target total number of atoms and the target elemental composition histogram, and use the parameters of the final trained continuous flow matching prediction model to define the ordinary differential equation;

[0012] Step 8: Based on the target total number of atoms and the target elemental composition histogram, use a numerical integrator to solve the ordinary differential equation and output the final three-dimensional molecular structure file.

[0013] Furthermore, the specific process of step one is as follows:

[0014] Molecular data is acquired, cleaned, and format-validated to remove data with abnormal geometric structures and incorrect chemical valence states. Atomic spatial coordinates and element type features, as well as global conditions for each molecule, are extracted from the cleaned and format-validated molecular data. Coordinate decentering is performed on the atomic spatial coordinates, and one-hot encoding is performed on the element type features. The results of coordinate decentering and one-hot encoding are then concatenated and fused to obtain the processed molecular data; the element type features are equivalent to the atom types.

[0015] By employing a maximum node number padding and masking mechanism, unstructured data in the processed molecular data is mapped to a tensor representation of a unified dimension. The tensor representation is then concatenated with global conditions to construct a molecular training dataset containing atomic spatial coordinates, atomic types, and global conditions.

[0016] This involves processing each molecule in the molecular training dataset, extracting the total number of atoms N and the histogram C of the training element composition for each molecule, and then decentering the atomic spatial coordinates and filling them to the maximum number of nodes N. max Generate an atomic mask M.

[0017] Furthermore, the specific process of step two is as follows:

[0018] Sample time step t from the set time interval [0,1], and sample standard Gaussian noise x0 from the set standard Gaussian distribution;

[0019] The optimal transmission path interpolation is defined as follows:

[0020] ;

[0021] ;

[0022] In the formula, Let be the noisy coordinates at time t; Let be the target conditional velocity field at time t; This is the preset minimum noise standard deviation parameter; The standard Gaussian noise representing the sampled data. These are the molecular coordinates in the actual data distribution.

[0023] Furthermore, the specific process of step three is as follows:

[0024] Construct a continuous flow matching prediction model that includes a feature linear modulation module and an equivariant neural network;

[0025] The noisy coordinates at time t obtained in step two As the node position, initialize the first... Layer node features ;

[0026] The total number of atoms N extracted in step one and the training element composition histogram C are encoded into a training global conditional vector.

[0027] The total number of atoms N and the training element composition histogram C are added to each layer of the equivariant neural network through the feature linear modulation module. The multilayer perceptron in the feature linear modulation module maps the training global conditional vector to a scaling factor of the feature modulation parameters. Translation factor Using scaling factor Translation factor right Perform affine transformation modulation processing to obtain the first equivariant neural network. Node features after training global conditional vector modulation in the layer ;

[0028] Using equivariant neural networks Feature extraction is performed to obtain the first... Layer node features ;

[0029] A deterministic probabilistic flow path from Gaussian noise distribution to the true molecular data distribution is established based on a continuous flow matching prediction model. A time-dependent conditional vector field is defined through the probabilistic flow path, and the noisy coordinates at time t are guided by the conditional vector field. Evolving along the straight trajectory of lowest energy, intermediate state samples are constructed on the evolutionary straight trajectory through linear interpolation, and the first... Layer node features The intermediate samples are substituted into an equivariant neural network for fitting to obtain the noisy coordinates at time t. Predicted velocity field .

[0030] Furthermore, the specific process of step four is as follows:

[0031] Will The input is fed into a fully connected layer for processing, transforming the high-dimensional data... The compressed mapping is processed in the atomic category dimension space to obtain the unnormalized probability value Logits of the atomic type.

[0032] Logits are transformed from a soft maximization function into a soft atom-type distribution P. soft ;

[0033] By using P soft The expected van der Waals radius of the i-th atom type is calculated by weighted summation of the standard van der Waals radius constraints corresponding to each preset atom type. .

[0034] Furthermore, the flow matching loss is calculated using the following formula:

[0035] ;

[0036] In the formula, For flow matching loss; It expresses expectation.

[0037] Furthermore, the specific process for calculating the geometric collision penalty term is as follows:

[0038] Noisy coordinates based on time t Using the predicted velocity field right The atomic coordinates in the image are denoised to obtain the denoised coordinate estimate for each atom. , ;

[0039] Computational geometry collision penalty term , means as follows:

[0040] ;

[0041] In the formula, Normalization factor; For the first Atom mask; For the first Atom mask; To modify the activation function of the linear unit; Let $\mathbf{j}$ be the expected van der Waals radius of the $j$-th atom type. This is the tolerance factor; For the first Denoising coordinate estimates for each atom; For the first Denoising coordinate estimates for each atom.

[0042] Furthermore, the specific process of step six is ​​as follows:

[0043] based on and and physical constraint weight coefficients Construct the total loss function;

[0044] The parameters of the continuous flow matching prediction model are trained iteratively by minimizing the total loss function. ;

[0045] Parameters are optimized around minimizing the total loss function. Iterative updates, where the weight coefficients of physical constraints It is a non-fixed value. The value adjustment follows the cosine annealing strategy:

[0046] Parameters of the continuous flow matching prediction model In the early stages of training, The value of is approximately 0; as the number of training rounds increases... As the number of training rounds increases, the value of λ gradually increases. Training stops when the preset value is reached or when the value of λ reaches the set threshold, thus completing the parameter calculation. Training is performed to obtain the parameters of the final trained continuous flow matching prediction model. .

[0047] Furthermore, the specific process of step eight is as follows:

[0048] Based on the set target total number of atoms N target Histogram C of target element compositiontarget As the target global condition vector during reasoning;

[0049] and from the set standard Gaussian distribution The initial noise state x is obtained by mid-sampling. prior ;

[0050] Solving ordinary differential equations using a numerical integrator, executing from time... =0 to The deterministic evolution of =1 is as follows:

[0051] Calculate the first The atomic coordinate states at each discrete time step are represented as follows:

[0052] ;

[0053] In the formula, For the first At each discrete time step Atomic coordinate states; For the first At each discrete time step Atomic coordinate states; Continuous time within the integration interval The corresponding atomic coordinate state; It is a differential operator;

[0054] Euler prediction correction method is used for An approximate solution is performed; during this solution process... Continuously modulated by the target global conditional vector during inference, the atomic coordinates are interpolated along the optimal transmission path from the initial noisy state. The high-dimensional noisy space is smoothly migrated to a histogram that matches the target element composition. The physical constraints of the low-dimensional chemical data manifold ultimately output the denoised molecular point cloud coordinates. and the corresponding soft atom type distribution ;

[0055] Distribution of soft atom types in the output Perform maximum a posteriori probability estimation distribution, transforming the continuous probability estimation distribution into the 1st... Discrete atomic number of atoms ;

[0056] Next, the geometric collision penalty term L obtained in step five is used. vdw Chemical bonds are inferred using a geometry sensing algorithm based on interatomic distances, specifically:

[0057] Based on the denoised molecular point cloud coordinates and Calculate any two atoms and Euclidean distance between ;

[0058] When satisfied Then determine the two atoms and There are chemical bonds present, among which For the first The covalent radius constant of an atom; For the first The covalent radius constant of an atom; To determine the threshold coefficient;

[0059] When determining two atoms and When chemical bonds exist, construct an adjacency matrix. ;

[0060] Based on adjacency matrix Generate discrete molecular graph structures, perform connectivity checks and valence bond rule checks on the molecular graph structures, remove isolated nodes in the molecular graph structures, and output the final three-dimensional molecular structure file.

[0061] The present invention also provides an electronic device, including a processor, a memory, and a bus, wherein the processor and the memory are connected via the bus, wherein the memory is used to store a set of program code, and the processor is used to call the program code stored in the memory to execute a method for generating three-dimensional molecules by fusing conditional flow matching and van der Waals radius constraints.

[0062] Compared with existing technologies, the present invention has the following advantages:

[0063] (1) This invention trains a continuous flow matching prediction model to learn the ability to guide towards the real chemical manifold by predicting clean data as the generation target. It also combines a dynamic weighted course learning scheduling strategy to focus on path exploration in the early stage of sampling and strengthen manifold projection in the later stage. This reduces the number of sampling steps while maintaining the stability of the generated trajectory and improves the problem of easy distortion of molecular geometric conformation under low step conditions.

[0064] (2) By introducing van der Waals interaction constraints, this invention can distinguish between covalent bond structures and non-physical collisions, thereby effectively suppressing atomic spatial overlap without interfering with normal chemical bonding, and improving the physical rationality and chemical effectiveness of the generated molecules.

[0065] (3) By adopting an adaptive triggering local geometry refinement mechanism, the present invention initiates correction based on local similarity kernels only when atomic ring tension anomalies and geometric distortions are detected. Compared with global guidance throughout the process, this method optimizes the allocation of computational resources and improves the local geometric quality of complex molecules while maintaining generation efficiency. Attached Figure Description

[0066] Figure 1 This is a flowchart of the method of the present invention.

[0067] Figure 2 This is a framework diagram of the molecular generation of the present invention.

[0068] Figure 3 This is a graph showing the attribute distribution evaluation results of the generated molecules of this invention relative to the QM9 dataset. Detailed Implementation

[0069] like Figures 1-2 As shown, this embodiment provides a method for generating three-dimensional molecules by fusing conditional flow matching and van der Waals radius constraints. The steps are as follows:

[0070] Step 1: Construct a molecular training dataset containing atomic spatial coordinates, atomic types, and global conditions; process the molecular training dataset to extract the total number of atoms and the histogram of training element composition.

[0071] Step 2: Sample time steps from the set time interval and sample standard Gaussian noise from the set standard Gaussian distribution. Based on the optimal transmission path interpolation, construct the noisy coordinates and target conditional velocity field at the current moment according to the sampled time steps and sampled standard Gaussian noise.

[0072] Step 3: Construct a continuous flow matching prediction model including a feature linear modulation module and an equivariant neural network; using the noisy coordinates at the current time as input, the feature linear modulation module adds the total number of atoms and the histogram of training element composition to each layer of the equivariant neural network, and performs affine transformation modulation processing on the intermediate layer features of the noisy coordinates at the current time; the equivariant neural network is used to extract features from the adjusted noisy coordinates at the current time to extract node features; the node features and the noisy coordinates at the current time are processed to obtain the predicted velocity field of the noisy coordinates at the current time.

[0073] Step 4: Input the node features into the fully connected layer for processing, compress and map the high-dimensional node features to the atomic category dimension space for processing, and obtain the unnormalized probability value of the atomic type; use the soft maximization function to transform the unnormalized probability value of the atomic type into a soft atomic type distribution, and calculate the expected van der Waals radius of each atomic type based on the soft atomic type distribution;

[0074] Step 5: Calculate the flow matching loss based on the predicted velocity field and the target conditional velocity field, and calculate the geometric collision penalty term based on the expected van der Waals radius and the noisy coordinates at the current moment;

[0075] Step 6: Construct a total loss function based on the flow matching loss and geometric collision penalty term, train the parameters of the continuous flow matching prediction model based on the total loss function, and obtain the parameters of the final trained continuous flow matching prediction model;

[0076] Step 7: Set the target total number of atoms and the target elemental composition histogram, and use the parameters of the final trained continuous flow matching prediction model to define the ordinary differential equation;

[0077] Step 8: Based on the target total number of atoms and the target elemental composition histogram, use a numerical integrator to solve the ordinary differential equation and output the final three-dimensional molecular structure file.

[0078] The specific process of step one is as follows:

[0079] Molecular data is acquired, cleaned, and format-validated to remove data with abnormal geometric structures and incorrect chemical valence states. Atomic spatial coordinates and element type features, as well as global conditions for each molecule, are extracted from the cleaned and format-validated molecular data. Coordinate decentering is performed on the atomic spatial coordinates, and one-hot encoding is performed on the element type features. The results of coordinate decentering and one-hot encoding are then concatenated and fused to obtain the processed molecular data; the element type features are equivalent to the atom types.

[0080] By employing a maximum node number padding and masking mechanism, unstructured data in the processed molecular data is mapped to a tensor representation of a unified dimension. The tensor representation is then concatenated with global conditions to construct a molecular training dataset containing atomic spatial coordinates, atomic types, and global conditions.

[0081] This involves processing each molecule in the molecular training dataset, extracting the total number of atoms N and the histogram C of the training element composition for each molecule, and then decentering the atomic spatial coordinates and filling them to the maximum number of nodes N. max To generate the atomic mask M.

[0082] The specific process of step two is as follows:

[0083] Time step t is sampled from the set time interval [0,1], and standard Gaussian noise x0 is sampled from the set standard Gaussian distribution; where... ; ; It follows a normal distribution; It is the identity matrix;

[0084] The optimal transmission path interpolation is defined as follows:

[0085] ;

[0086] ;

[0087] In the formula, Let be the noisy coordinates at time t; Let be the target conditional velocity field at time t; This is the preset minimum noise standard deviation parameter; The standard Gaussian noise representing the sampled data. These are the molecular coordinates in the actual data distribution.

[0088] The specific process of step three is as follows:

[0089] Unlike the random noise addition and denoising process used in traditional diffusion models, this embodiment constructs a continuous flow matching prediction model based on optimal transmission theory, including a characteristic linear modulation module and an equivariant neural network.

[0090] Based on the manifold assumption, the deterministic sampling method for optimal transmission path interpolation described in step two, by directly predicting the noisy coordinates and target conditional velocity field at the current moment, enables the equivariant neural network in the continuous flow matching prediction model to still achieve effective computation in high-dimensional space under limited capacity conditions. The equivariant neural network can output not only the current predicted velocity field at any time step, but also, even with a very small number of sampling steps, guide intermediate samples deviating from the trajectory back to the effective chemical space through the equivariant neural network, thereby solving the problem of structural collapse generated by traditional methods under sparse sampling.

[0091] The noisy coordinates at time t obtained in step two As the node position, initialize the first... Layer node features ;

[0092] The total number of atoms N and the training element composition histogram C extracted in step one are encoded into a global conditional vector for training. Unlike traditional methods that only use the conditions as initial input, this step adds the total number of atoms N and the training element composition histogram C to each layer of the equivariant neural network through a feature linear modulation module. The multilayer perceptron in the feature linear modulation module then maps the global conditional vector for training to a scaling factor for the feature modulation parameters. Translation factor Using scaling factor Translation factor right (i.e., the intermediate layer features of the noisy coordinates at the current moment) undergo affine transformation modulation processing to obtain the equivariant neural network's... Node features after training global conditional vector modulation in the layer , means as follows:

[0093] ;

[0094] In the formula, ⊙ represents element-wise multiplication; the equivariant neural network adopts the equivariant graph neural network E(n) architecture to ensure that the node feature extraction process is equivariant to molecular rotation and translation.

[0095] In step three, an equivariant neural network is used for feature extraction. This network captures the relative distance and orientation information between atoms through a multi-layer message passing mechanism, ensuring that node features are equivariant to rotation and translation operations. The equivariant neural network is then used to... Feature extraction is performed, which means:

[0096] ;

[0097] In the formula, For the first Layer node characteristics; This refers to the Block module in an isotropic neural network. That is ;

[0098] A deterministic probabilistic flow path from Gaussian noise distribution to the true molecular data distribution is established based on a continuous flow matching prediction model. A time-dependent conditional vector field is defined through the probabilistic flow path, and the noisy coordinates at time t are guided by the conditional vector field. Evolving along the straight trajectory of lowest energy, intermediate state samples are constructed on the evolutionary straight trajectory through linear interpolation, and the first... Layer node features The intermediate samples are substituted into an equivariant neural network for fitting to obtain the noisy coordinates at time t. Predicted velocity field .

[0099] The specific process of step four is as follows:

[0100] Will The input is fed into a fully connected layer for processing, transforming the high-dimensional data... The compressed mapping is processed in the atomic category dimension space to obtain the unnormalized probability value Logits of the atomic type.

[0101] In step four, the output head of the equivariant neural network is configured to simultaneously output two sets of signals: one set of outputs is used for flow matching to predict the velocity field v. θOne set of outputs represents the instantaneous direction of changes in atomic coordinates; the other set of outputs is the unnormalized probability value Logits for atomic types, which is transformed into a soft atomic type distribution P by the soft maximization function Softmax. soft .

[0102] Furthermore, by using P soft The expected van der Waals radius of the i-th atom type is calculated by weighted summation of the standard van der Waals radius constraints corresponding to each preset atom type. In this way, differentiable chemical semantic constraints are embedded simultaneously during the geometric evolution process;

[0103] Calculate the expected van der Waals radius of the i-th atom type. , means as follows:

[0104] ;

[0105] In the formula, For the i-th atom type to belong to the i-th Predicted probability of element type; The standard van der Waals radius constraint for the k-th element; This represents the total number of atom types.

[0106] based on It can construct van der Waals constraints in the process of molecular geometric evolution. Van der Waals constraints can transform the originally discrete atomic type information into continuously differentiable geometric radii, thereby achieving optimization of geometric and chemical semantics.

[0107] The specific process of step five is as follows:

[0108] The predefined total loss function is trained using a course-based learning strategy; the first step is to calculate the flow matching loss. :

[0109] ;

[0110] In the formula, It expresses expectation.

[0111] Noisy coordinates based on time t Using the predicted velocity field right The atomic coordinates in the image are denoised to obtain the denoised coordinate estimate for each atom. , ;

[0112] Flow matching loss minimizes the predicted velocity field With the target condition velocity field The mean square error constitutes the continuous flow matching prediction model, which learns the optimal straight-line transmission path from the noise distribution directly to the clean data distribution.

[0113] Next, calculate the geometric collision penalty term L. vdw To apply physical regularization, it can be expressed as follows:

[0114] ;

[0115] In the formula, Normalization factor; For the first Atom mask; For the first Atom mask; To modify the activation function of the linear unit; Let $\mathbf{j}$ be the expected van der Waals radius of the $j$-th atom type. This is the tolerance factor; For the first Denoising coordinate estimates for each atom; For the first Denoising coordinate estimates for each atom;

[0116] L vdw The formula only applies to interatomic distances. Less than the sum of the expected van der Waals radii of the two The triggering condition can also serve as the activation signal for the local geometry refinement mechanism: when When the value is less than the sum of the expected van der Waals radii of the two, the geometric refinement mechanism of the local similarity nucleus is automatically triggered to correct local geometric distortions such as abnormal atomic ring tension and torsion angle deviation, thereby preventing atomic overlap and reducing interference with interatomic chemical bonding.

[0117] The specific process of step six is ​​as follows:

[0118] In step six: Finally, a dynamic weight adjustment strategy is used to jointly optimize the above losses, resulting in the total loss function. The parameters of the continuous flow matching prediction model are iteratively trained by minimizing the total loss function. λ represents the weighting coefficient of the physical constraints;

[0119] Parameters are optimized around minimizing the total loss function. Iterative updates, where the weight coefficients of physical constraints It is a non-fixed value. The value adjustment follows the cosine annealing strategy:

[0120] Parameters of the continuous flow matching prediction model In the early stages of training, The value of is approximately 0, so that the continuous flow matching prediction model prioritizes learning the macroscopic contour distribution features of molecules; as the number of training rounds increases... As the number of training rounds increases, the value of λ gradually increases to force the continuous flow matching prediction model to finely correct the atomic spacing at the microscopic level. Training stops when the preset value is reached or when the value of λ reaches the set threshold, thus completing the parameter calculation. Training is performed to obtain the parameters of the final trained continuous flow matching prediction model. The aforementioned optimization strategy, from coarse-grained to fine-grained, can prevent the continuous flow matching prediction model from getting stuck in local optima due to excessively strong physical constraints imposed in the early stages of training, ensuring that the generated molecular structure has both global rationality and local accuracy.

[0121] The specific process of step eight is as follows:

[0122] Based on the set target total number of atoms N target Histogram C of target element composition target As the target global condition vector during reasoning;

[0123] and from the set standard Gaussian distribution The initial noise state x is obtained by mid-sampling. prior ;

[0124] Inference phase: Solve the ordinary differential equations using the numerical integrator ODE, and execute the process from time... =0 to The deterministic evolution of =1 is as follows:

[0125] Calculate the first The atomic coordinate states at each discrete time step are represented as follows:

[0126] ;

[0127] In the formula, For the first At each discrete time step Atomic coordinate states; For the first At each discrete time step Atomic coordinate states; Continuous time within the integration interval The corresponding atomic coordinate state; It is a differential operator;

[0128] To improve inference efficiency while maintaining generation accuracy, this embodiment employs the Euler prediction correction method. An approximate solution is then performed. During this solution process... Continuously modulated by the target global conditional vector during inference, the atomic coordinates are interpolated along the optimal transmission path from the initial noisy state. The high-dimensional noisy space is smoothly migrated to a histogram that matches the target element composition. The physical constraints of the low-dimensional chemical data manifold ultimately output the denoised molecular point cloud coordinates. and the corresponding soft atom type distribution .

[0129] First, the distribution of soft atom types in the output is analyzed. Perform maximum a posteriori probability estimation (Argmax) distribution, transforming the continuous probability estimation distribution into the 1st... Discrete atomic number of atoms To determine the specific element class of each atom, as shown below:

[0130] ;

[0131] In the formula, This is an operation to retrieve the maximum value;

[0132] Next, the geometric collision penalty term L obtained in step five is used. vdw Chemical bonds are inferred using a geometry sensing algorithm based on interatomic distances, specifically:

[0133] and As clean data; based on clean data and Calculate any two atoms and Euclidean distance between ;

[0134] When satisfied Then determine the two atoms and There are chemical bonds present, among which For the first The covalent radius constant of an atom; For the first The covalent radius constant of an atom; To determine the threshold coefficient;

[0135] When determining two atoms and When chemical bonds exist, calculate the adjacency matrix elements. Based on adjacency matrix elements Construct an adjacency matrix A∈{0,1} N×N The adjacency matrix elements , means as follows:

[0136] ;

[0137] In the formula, For the adjacency matrix, the first... Line number Column elements; for Step function, For the corresponding The covalent radius constant; For the corresponding number Discrete atomic number of atoms The covalent radius constant; For the first The final three-dimensional coordinates of each atom; For the first The final three-dimensional coordinates of each atom; For atomic indexing and Kronek Functions used to exclude self-loops;

[0138] in, The rule for the value of the step function is: when the input parameter is greater than 0, The step function value is 1; when the input parameter is less than or equal to 0, The step function value is 0. A step function can transform continuous numerical differences into binary results of 0 / 1 to match adjacent matrix elements. Value requirements; input parameters are ;

[0139] Based on adjacency matrix Generate discrete molecular graph structures, perform connectivity checks and valence bond rule checks on the molecular graph structures, remove isolated nodes in the molecular graph structures, and output the final three-dimensional molecular structure file.

[0140] Another embodiment of the present invention provides an electronic device including a processor, a memory, and a bus, wherein the processor and the memory are connected via the bus, wherein the memory is used to store a set of program code, and the processor is used to call the program code stored in the memory to execute a method for generating three-dimensional molecules by fusing conditional flow matching and van der Waals radius constraints.

[0141] The present invention encapsulates a three-dimensional molecular generation method that integrates conditional flow matching and van der Waals radius constraints into a molecular generation continuous flow matching prediction model. The performance of the continuous flow matching prediction model is tested below.

[0142] To comprehensively and objectively verify the effectiveness of the method proposed in this invention, this embodiment uses evaluation indicators, including five general evaluation indicators: atomic stability, effectiveness, uniqueness, novelty, and importance, to evaluate the quality of the generated molecule.

[0143] Among them, atomic stability is used to measure the physical rationality at the microscopic level, calculate the proportion of atoms in the generated molecule that maintain the correct valence, and atomic stability directly reflects the ability of the continuous flow matching prediction model to constrain the local atomic environment.

[0144] Among them, effectiveness is used to assess chemical compliance at the macro level and calculate the percentage of effective molecules among all generated molecules;

[0145] Among them, the uniqueness quantification of the generation diversity of the continuous flow matching prediction model represents the proportion of unique molecules among all generated valid molecules, and is used to determine whether the continuous flow matching prediction model has experienced mode collapse.

[0146] Novelty is used to evaluate the generalization and exploration capabilities of the continuous flow matching prediction model, and represents the percentage of novel samples among all valid and unique molecules.

[0147] Importance is a comprehensive indicator that represents the percentage of valid, unique, and novel molecules in the generated samples. It is a key criterion for measuring the practical application value of continuous flow matching prediction models.

[0148] In 3D molecular generation tasks, ensuring the physical validity and geometric stability of generated conformations remains a challenge. Traditional generative models, when processing large molecule drug datasets like GEOM-DRUG, struggle to avoid non-physical collisions between atoms due to the exponential growth of molecular degrees of freedom. This results in generated molecules that, while logically distributed in latent space, fail chemical verification upon decoding back to Euclidean space due to abnormal bond lengths and angles, significantly reducing validity and atomic stability. Without explicit physical constraints, traditional generative models often generate numerous invalid, distorted structures. To address this issue, this embodiment introduces van der Waals radius constraints and a continuous flow matching prediction model to establish hard physical constraints during the generation process. The experimental results after processing using this method are shown in Table 1.

[0149] Data analysis shows that the proposed method performs well on both QM9 and GEOM-DRUG datasets of different sizes. In terms of atomic stability and efficiency, even on the complex GEOM-DRUG dataset, the stability remains as high as 92.5%, and the efficiency reaches 94.0%. This demonstrates that the geometric collision penalty effectively suppresses spatial overlap and guides the continuous flow matching prediction model to generate conformations that conform to physical laws. Simultaneously, the results of uniqueness and novelty indicate that the high stability of the continuous flow matching prediction model is not obtained by simply memorizing the training set, but rather by truly learning the manifold distribution in chemical space. This further verifies the advantages of this embodiment in generating high-quality and highly stable three-dimensional molecules. QM9 is a benchmark dataset for small molecular weight chemistry; GEOM-DRUG is a dataset for drug molecule conformations.

[0150] Table 1. Quality assessment results of the generated molecules on the QM9 and GEOM-DRUG datasets.

[0151]

[0152] To evaluate the properties of the generated molecules, four benchmark properties were further selected for comparative analysis: molecular weight, synthetic accessibility, modified lipid-water partition coefficient (plogP), and quantitative evaluation value for drug-likeness (QED). Molecular weight measures molecular size; synthetic accessibility assesses the feasibility of synthesis under experimental conditions; plogP reflects the lipophilicity and water solubility of the molecule; and QED quantifies the degree of similarity between the molecular structure and known drug molecules. Figure 3 As can be seen, the generated dataset of molecules in the above four attributes is highly consistent with the attribute distribution of real molecules in the benchmark dataset, indicating that the molecules generated in this embodiment have good similarity to existing drugs or drug-like molecules in terms of key physicochemical properties, further verifying the effectiveness of the continuous flow matching prediction model in maintaining the rationality and practicality of molecules.

[0153] To investigate the impact of van der Waals radius constraints on the structural similarity between the generated molecule and the reference molecule, this embodiment employs three widely accepted molecular similarity metrics: Tanimoto similarity, MACCS similarity, and Fraggle similarity. These metrics are used to quantitatively assess the structural similarity between the generated molecule and the corresponding molecule in the benchmark dataset. Tanimoto refers to the Tanimoto similarity algorithm; MACCS is the fingerprint similarity algorithm; and Fraggle is the molecular similarity evaluation algorithm.

[0154] For comparison, this embodiment sets and compares the following two generation constraints. The first is a continuous flow matching prediction model without introducing any physicochemical constraints; the second is the continuous flow matching prediction model of this invention, setting the minimum distance threshold for all atom pairs to 1.5 Å; Å is a unit of length.

[0155] Table 2 shows the average scores of the generated molecules on the three similarity indices under the three generation conditions (all based on the continuous flow matching prediction model, with only different constraint mechanisms).

[0156] Experimental results show that the Tanimoto similarity of the continuous flow matching prediction model without any physical constraints is only 0.315±0.035, the MACCS similarity is 0.450±0.040, and the Fraggle similarity is 0.332±0.038, which is the lowest among the three methods.

[0157] The distance constraint based on a fixed threshold corresponds to a continuous flow matching prediction model with a fixed threshold distance constraint. The similarity indices of this method (Tanimoto 0.524±0.021, MACCS 0.710±0.025, Fraggle 0.588±0.020) are significantly improved compared to the unconstrained method.

[0158] The continuous flow matching prediction model generated using van der Waals radius constraints based on soft atoms achieves significant improvements across all similarity indices. Further statistical tests show that the p-values ​​corresponding to the differences between the continuous flow matching prediction model generated using van der Waals radius constraints based on soft atoms and those generated without physical constraints and based on distance constraints with a fixed threshold are all less than 0.01, confirming the statistical significance of the improvement. This demonstrates that the generated molecules exhibit higher structural similarity to the molecules in the benchmark dataset. Therefore, it can be confirmed that the van der Waals radius constraints introduced in this invention substantially contribute to improving the structural similarity between the generated molecules and the target molecules; p represents the probability value.

[0159] Table 2. Structural similarity assessment results between generated molecules and benchmark datasets under different constraints.

[0160]

[0161] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for generating three-dimensional molecules by integrating conditional flow matching and van der Waals radius constraints, characterized in that, include: Step 1: Construct a molecular training dataset, process the molecular training dataset, and extract the total number of atoms and the histogram of training element composition; Step 2: Based on the optimal transmission path interpolation, construct the noisy coordinates and target conditional velocity field at the current moment according to the sampling time step and the sampling standard Gaussian noise; Step 3: Based on the total number of atoms and the histogram of training elements, perform affine transformation modulation on the noisy coordinates at the current moment through the continuous flow matching prediction model, extract node features, process the node features, and obtain the predicted velocity field of the noisy coordinates at the current moment. Step 4: Process the node features to convert them into soft atom type distributions, and calculate the expected van der Waals radius of each atom type based on the soft atom type distributions; Step 5: Calculate the flow matching loss based on the predicted velocity field and the target conditional velocity field, and calculate the geometric collision penalty term based on the expected van der Waals radius and the noisy coordinates at the current moment; Step 6: Construct a total loss function based on the flow matching loss and geometric collision penalty term, train the parameters of the continuous flow matching prediction model based on the total loss function, and obtain the parameters of the final trained continuous flow matching prediction model; Step 7: Set the target total number of atoms and the target elemental composition histogram, and use the parameters of the final trained continuous flow matching prediction model to define the ordinary differential equation; Step 8: Based on the target total number of atoms and the target elemental composition histogram, use a numerical integrator to solve the ordinary differential equation and output the final three-dimensional molecular structure file.

2. The method for generating three-dimensional molecules by fusing conditional flow matching and van der Waals radius constraints according to claim 1, characterized in that: The specific process of step one is as follows: Molecular data is acquired, cleaned, and format-validated to remove data with abnormal geometric structures and incorrect chemical valence states. Atomic spatial coordinates and element type features, as well as global conditions for each molecule, are extracted from the cleaned and format-validated molecular data. Coordinate decentering is performed on the atomic spatial coordinates, and one-hot encoding is performed on the element type features. The results of coordinate decentering and one-hot encoding are then concatenated and fused to obtain the processed molecular data; the element type features are equivalent to the atom types. By employing a maximum node number padding and masking mechanism, unstructured data in the processed molecular data is mapped to a tensor representation of a unified dimension. The tensor representation is then concatenated with global conditions to construct a molecular training dataset containing atomic spatial coordinates, atomic types, and global conditions. This involves processing each molecule in the molecular training dataset, extracting the total number of atoms N and the histogram C of the training element composition for each molecule, and then decentering the atomic spatial coordinates and filling them to the maximum number of nodes N. max Generate an atomic mask M.

3. The method for generating three-dimensional molecules by fusing conditional flow matching and van der Waals radius constraints according to claim 2, characterized in that: The specific process of step two is as follows: Sample time step t from the set time interval [0,1], and sample standard Gaussian noise x0 from the set standard Gaussian distribution; The optimal transmission path interpolation is defined as follows: ; ; In the formula, Let be the noisy coordinates at time t; Let be the target conditional velocity field at time t; This is the preset minimum noise standard deviation parameter; The standard Gaussian noise representing the sampled data. These are the molecular coordinates in the actual data distribution.

4. The method for generating three-dimensional molecules by fusing conditional flow matching and van der Waals radius constraints according to claim 3, characterized in that: The specific process of step three is as follows: Construct a continuous flow matching prediction model that includes a feature linear modulation module and an equivariant neural network; The noisy coordinates at time t obtained in step two As the node position, initialize the first... Layer node features ; The total number of atoms N extracted in step one and the training element composition histogram C are encoded into a training global conditional vector. The total number of atoms N and the training element composition histogram C are added to each layer of the equivariant neural network through the feature linear modulation module. The multilayer perceptron in the feature linear modulation module maps the training global conditional vector to a scaling factor of the feature modulation parameters. Translation factor Using scaling factor Translation factor right Perform affine transformation modulation processing to obtain the first equivariant neural network. Node features after training global conditional vector modulation in the layer ; Using equivariant neural networks Feature extraction is performed to obtain the first... Layer node features ; A deterministic probabilistic flow path from Gaussian noise distribution to the true molecular data distribution is established based on a continuous flow matching prediction model. A time-dependent conditional vector field is defined through the probabilistic flow path, and the noisy coordinates at time t are guided by the conditional vector field. Evolving along the straight trajectory of lowest energy, intermediate state samples are constructed on the evolutionary straight trajectory through linear interpolation, and the th... Layer node features The intermediate samples are substituted into an equivariant neural network for fitting to obtain the noisy coordinates at time t. Predicted velocity field .

5. The method for generating three-dimensional molecules by fusing conditional flow matching and van der Waals radius constraints according to claim 4, characterized in that: The specific process of step four is as follows: Will The input is fed into a fully connected layer for processing, transforming the high-dimensional data... The compressed mapping is processed in the atomic category dimension space to obtain the unnormalized probability value Logits of the atomic type. Logits are transformed from a soft maximization function into a soft atom-type distribution P. soft ; By using P soft The expected van der Waals radius of the i-th atom type is calculated by weighted summation of the standard van der Waals radius constraints corresponding to each preset atom type. .

6. The method for generating three-dimensional molecules by fusing conditional flow matching and van der Waals radius constraints according to claim 5, characterized in that: The flow matching loss is calculated and expressed as follows: ; In the formula, For flow matching loss; It expresses expectation.

7. The method for generating three-dimensional molecules by fusing conditional flow matching and van der Waals radius constraints according to claim 6, characterized in that: The specific process for calculating the geometric collision penalty term is as follows: Noisy coordinates based on time t Using the predicted velocity field right The atomic coordinates in the image are denoised to obtain the denoised coordinate estimate for each atom. , ; Computational geometry collision penalty term , means as follows: ; In the formula, Normalization factor; For the first Atom mask; For the first Atom mask; To modify the activation function of the linear unit; Let $\mathbf{j}$ be the expected van der Waals radius of the $j$-th atom type. This is the tolerance factor; For the first Denoising coordinate estimates for each atom; For the first Denoising coordinate estimates for each atom.

8. The method for generating three-dimensional molecules by fusing conditional flow matching and van der Waals radius constraints according to claim 7, characterized in that: The specific process of step six is ​​as follows: based on and and physical constraint weight coefficients Construct the total loss function; The parameters of the continuous flow matching prediction model are trained iteratively by minimizing the total loss function. ; Parameters are optimized around minimizing the total loss function. Iterative updates, where the weight coefficients of physical constraints It is a non-fixed value. The value adjustment follows the cosine annealing strategy: Parameters of the continuous flow matching prediction model In the early stages of training, The value of is approximately 0; as the number of training rounds increases... As the number of training rounds increases, the value of λ gradually increases. Training stops when the preset value is reached or when the value of λ reaches the set threshold, thus completing the parameter calculation. Training is performed to obtain the parameters of the final trained continuous flow matching prediction model. .

9. The method for generating three-dimensional molecules by fusing conditional flow matching and van der Waals radius constraints according to claim 8, characterized in that: The specific process of step eight is as follows: Based on the set target total number of atoms N target Histogram C of target element composition target As the target global condition vector during reasoning; and from the set standard Gaussian distribution The initial noise state x is obtained by mid-sampling. prior ; Solving ordinary differential equations using a numerical integrator, executing from time... =0 to The deterministic evolution of =1 is as follows: Calculate the first The atomic coordinate states at each discrete time step are represented as follows: ; In the formula, For the first At each discrete time step Atomic coordinate states; For the first At each discrete time step Atomic coordinate states; Continuous time within the integration interval The corresponding atomic coordinate state; It is a differential operator; Euler prediction correction method is used for An approximate solution is performed; during this solution process... Continuously modulated by the target global condition vector during inference, the atomic coordinates are interpolated along the optimal transmission path from the initial noisy state. The high-dimensional noisy space is smoothly migrated to a histogram that matches the target elemental composition. The physical constraints of the low-dimensional chemical data manifold ultimately output the denoised molecular point cloud coordinates. and the corresponding soft atom type distribution ; Distribution of soft atom types in the output Perform maximum a posteriori probability estimation distribution, transforming the continuous probability estimation distribution into the 1st... Discrete atomic number of atoms ; Next, the geometric collision penalty term L obtained in step five is used. vdw Chemical bonds are inferred using a geometry sensing algorithm based on interatomic distances, specifically: Based on the denoised molecular point cloud coordinates and Calculate any two atoms and Euclidean distance between ; When satisfied Then determine the two atoms and There are chemical bonds present, among which For the first The covalent radius constant of an atom; For the first The covalent radius constant of an atom; To determine the threshold coefficient; When determining two atoms and When chemical bonds exist, construct an adjacency matrix. ; Based on adjacency matrix Generate discrete molecular graph structures, perform connectivity checks and valence bond rule checks on the molecular graph structures, remove isolated nodes in the molecular graph structures, and output the final three-dimensional molecular structure file.

10. An electronic device, characterized in that, The device includes a processor, a memory, and a bus, wherein the processor and the memory are connected via the bus, the memory is used to store a set of program code, and the processor is used to call the program code stored in the memory to execute a three-dimensional molecular generation method that integrates conditional flow matching and van der Waals radius constraints as described in any one of claims 1-9.

Citation Information

Patent Citations

  • Molecular property prediction method and device and electronic equipment

    CN114446413A

  • Three-dimensional molecular structure generation method and model

    CN120998348A