Traditional Chinese medicine molecule electron energy gap prediction method and system
By constructing a method for predicting the electronic energy gap of traditional Chinese medicine molecules based on a message passing neural network, the problems of low efficiency in the research and development of traditional Chinese medicine and insufficient model accuracy have been solved. Efficient and accurate prediction of the electronic energy gap of traditional Chinese medicine molecules has been achieved, and the efficiency and accuracy of screening active ingredients of traditional Chinese medicine have been improved.
Patent Information
- Application Number
- CN202510913445.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-03
- Publication Date
- 2025-10-17
AI Technical Summary
The efficiency of traditional Chinese medicine research and development is low, the professional barriers to data preprocessing are high, the traditional model accuracy is insufficient, and high-throughput screening is difficult. Existing technologies cannot efficiently predict the electronic energy gap of traditional Chinese medicine molecules, resulting in difficulties in screening the active ingredients of traditional Chinese medicine.
A message passing neural network-based method is used to filter invalid molecules from the quantum chemistry database. A three-layer message passing neural network model is constructed to learn the mapping relationship between SMILES strings and energy gap values. The neural network is trained by minimizing the mean square error to provide high-precision predictions of the electronic energy gap of traditional Chinese medicine molecules.
It has achieved efficient and accurate prediction of the electronic energy gap of traditional Chinese medicine molecules, significantly reduced the time consumption of single-molecule prediction, and the test set determination coefficient R2 reached 0.9, providing a powerful tool for screening active ingredients of traditional Chinese medicine.
Smart Images

Figure CN120808960A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of the intersection of computational chemistry and artificial intelligence, and particularly relates to a traditional Chinese medicine molecule electronic energy gap prediction method and system based on a message passing neural network. BACKGROUND
[0002] The traditional Chinese medicine research and development method mainly has the following problems:
[0003] (1) Low efficiency of traditional Chinese medicine research and development
[0004] The HOMO-LUMO energy gap of the active ingredient of traditional Chinese medicine is closely related to its biological activities such as antioxidant and anti-inflammatory. However, the lack of efficient prediction tools leads to the fact that the screening of active ingredients of traditional Chinese medicine still relies on time-consuming experimental determination or inefficient quantum chemical calculation.
[0005] (2) Professional barriers exist in data preprocessing
[0006] The filtering of unconventional molecules in existing databases requires the combination of chemical professional knowledge and calculation tools. For example, if free radical molecules are not excluded, the model will learn the wrong electronic structure characteristics. For example, the energy gap calculation of molecules containing free radicals needs to use a special spin polarization method, which is incompatible with the calculation logic of stable molecules of traditional Chinese medicine.
[0007] (3) Technical blank exists in high-throughput screening
[0008] Traditional methods are difficult to achieve rapid screening for traditional Chinese medicine compounds which usually contain hundreds of ingredients. For example, a traditional Chinese medicine compound containing 500 ingredients requires about 2000 hours of DFT calculation, and existing prediction models cannot meet the accuracy requirements, resulting in a lack of efficient calculation support tools for modernization research of traditional Chinese medicine.
[0009] Existing research involves a traditional Chinese medicine molecule electronic energy gap prediction method, which mainly involves the cross combination technology of quantum chemical calculation, neural network model and data. However, this method mainly has the following technical problems:
[0010] (1) There is a bottleneck in the efficiency of quantum chemical calculation
[0011] Although the quantum chemical calculation method based on density functional theory (DFT) can achieve high-precision calculation of molecular electronic energy gap, the calculation of a single molecule takes several hours. For example, the energy gap calculation of a single complex traditional Chinese medicine molecule (such as flavonoids) requires 3-5 hours of CPU resources, which makes large-scale screening of active ingredients of traditional Chinese medicine difficult to bear in terms of calculation cost.
[0012] (2) Limitations of traditional models
[0013] Traditional quantitative structure-activity relationship (QSAR) models rely on manually designed molecular descriptors, such as topological indices, physicochemical properties, etc. For molecules of traditional Chinese medicine containing heterocyclic and polycyclic systems (such as alkaloids, terpenoids), it is difficult for manual features to capture the mapping relationship between complex electronic structures and energy gaps, resulting in insufficient prediction accuracy. Related studies show that the determination coefficient R 2 is generally low.
[0014] (3) There are problems in data compatibility
[0015] Existing public quantum chemistry databases (such as QM9) contain about 130,000 molecules, but some unconventional molecules are included, including free radicals, metal organic compounds, etc. The electronic structures of such molecules are significantly different from those of active ingredients of traditional Chinese medicine, and direct use for model training will lead to prediction bias. SUMMARY
[0016] The purpose of the present application is to provide a traditional Chinese medicine molecule electronic energy gap prediction method and system based on message passing neural network, aiming to solve the problems of low efficiency of existing quantum chemistry calculation and insufficient accuracy of traditional models.
[0017] The present application is realized in this way, a traditional Chinese medicine molecule electronic energy gap prediction method based on message passing neural network, the method comprising the following steps:
[0018] S1, filtering invalid molecules from a quantum chemistry database, the invalid molecules including molecules containing free radicals, metal atoms and molecules that cannot be parsed by built-in software;
[0019] S2, using the filtered valid molecules to construct a training data set, learning the mapping relationship between SMILES string and energy gap value through a three-layer message passing neural network, and obtaining a trained neural network model;
[0020] S3, outputting the predicted energy gap value of the traditional Chinese medicine molecule based on the trained neural network model, and the determination coefficient R 2 of the test set is greater than or equal to 0.9.
[0021] Preferably, in step S1, the filtering of molecules containing free radicals and metal atoms is performed by detecting the number of free radical electrons and atomic numbers of atoms.
[0022] Preferably, in step S2, the training target of the neural network is to minimize the mean square error of the predicted energy gap and the DFT calculated value.
[0023] Preferably, in step S2, the atomic features of the neural network model include 9-dimensional atomic features and implicit bond features.
[0024] The application further discloses a traditional Chinese medicine molecule electronic energy gap prediction system based on a message passing neural network.
[0025] A data preprocessing module is used for performing molecule filtering and feature extraction; wherein the molecule filtering is used for filtering invalid molecules from a quantum chemistry database, and the invalid molecules include molecules containing free radicals, metal atoms and molecules that cannot be parsed by built-in software; and the feature extraction is used for extracting 9-dimensional atomic features and implicit bond features;
[0026] A model training module is used for constructing a training data set by using the filtered valid molecules, learning a mapping relationship between a SMILES string and an energy gap value through a three-layer message passing neural network, and obtaining a trained neural network model; wherein the atomic features of the neural network model include the 9-dimensional atomic features and the implicit bond features;
[0027] An application deployment module comprises a Python library used for packaging the trained neural network model and an interactive interface supporting SMILES input and energy gap visualization; wherein the trained neural network model is used for outputting a predicted energy gap value of a traditional Chinese medicine molecule, and a test set determination coefficient R 2 ≥ 0.9.
[0028] The application overcomes the defects of the prior art and provides a traditional Chinese medicine molecule electronic energy gap prediction method and system based on a message passing neural network. The application relates to a neural network model trained by using a quantum chemistry data set, which is used for predicting a highest occupied molecular orbital-lowest unoccupied molecular orbital energy gap (HOMO-LUMO gap) of a traditional Chinese medicine molecule. In the application, a QM9 data set is cleaned by using an RDKit toolkit, invalid SMILES, free radical-containing and metal organic compounds are excluded, and about 130,000 valid molecules are retained; a three-layer message passing neural network (MPNN) is constructed, 9-dimensional atomic features and implicit bond features are used as input, and training is performed by minimizing the mean square error of a predicted energy gap and a DFT calculated value. The system packages the trained model into a Python library and provides an API interface, and a visualization interface can also be selected.
[0029] Compared with the defects and deficiencies of the prior art, the application has the following beneficial effects: the determination coefficient R 2 of the model of the application on a test set is as high as 0.9, the time consumption of single molecule prediction is significantly improved compared with DFT calculation speed, the average absolute error is reasonable, efficient and accurate prediction of the electronic energy gap of a traditional Chinese medicine molecule is realized, and a powerful tool is provided for traditional Chinese medicine active ingredient screening and research and development. BRIEF DESCRIPTION OF DRAWINGS
[0030] Figure 1 is a work flow chart of the method of the application;
[0031] Figure 2 is a schematic diagram of the MPNN architecture in the model of the present application;
[0032] Figure 3 is a training loss curve and R 2 evolution curve;
[0033] Figure 4 is a test set prediction scatter plot. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and examples. It should be understood that the specific examples described herein are only used to explain the present application and do not limit the present application.
[0035] The present application discloses a traditional Chinese medicine molecular electronic energy gap prediction method based on a message passing neural network, which combines Figure 1 For understanding, the method comprises the following steps:
[0036] S1, filtering invalid molecules from a quantum chemistry database, the invalid molecules including molecules containing free radicals, metal atoms and molecules that cannot be parsed by built-in software;
[0037] In step S1, the quantum chemistry database is the QM9 original data set, and the following molecules are filtered from the database:
[0038] (1) SMILES that cannot be parsed, i.e. identified by the Chem.MolFromSmiles function of RDKit, mainly chemical structures with incorrect format or non-existent;
[0039] (2) Molecules containing free radicals, i.e. through the set code to judge the number of free radicals of all atoms in the molecule, the electronic structure is unstable, which does not match the characteristics of traditional Chinese medicine ingredients;
[0040] (3) Metal organic compounds, i.e. metal elements with atomic number > 36 (specifically, through the set code to judge, because the atomic number of the atom is known when SMILES is input) are incompatible with the model training system.
[0041] After filtering, about 130,000 valid molecules are retained, with an energy gap value range of 0.0246-0.6221 Hartree (calculated by B3LYP / 6-31G(2df, p)), among which oxygen-containing heterocyclic compounds account for about 35%, nitrogen-containing heterocyclic compounds account for about 18%, meeting the structural distribution characteristics of traditional Chinese medicine ingredients.
[0042] S2, construct a training data set using the filtered effective molecules, learn the mapping relationship between the SMILES string and the energy gap value through a three-layer message passing neural network, and obtain a trained neural network model;
[0043] In step S2, the process of model construction is specifically: the network architecture is a three-layer message passing neural network MPNN model, as shown in Figure 2 The input layer: atomic features (9 dimensions) include: atomic number, chirality marker, connectivity, formal charge, number of free radical electrons (actual cleaning should be 0), hybrid state (integer encoding), aromaticity marker, total number of hydrogen atoms, and ring-intra-atomic marker); bond features (implicit): bond type (single / double / triple bond), bond direction (two-way connection), spatial proximity relationship (non-covalent interaction). Joint embedding of atomic features and bond features (implicit); the message passing layer is responsible for the interaction mechanism; the output layer directly predicts the HOMO-LUMO gap value of the molecule, and the unit is Hartree.
[0044] The training strategy is specifically: the loss function is the mean square error (RMSE); the optimizer is Adam, and the initial learning rate is 0.0001; the hidden layer dimension is 64; the message aggregation method is add, that is, the node feature summation aggregation; the training round is 500. The training target is to minimize the mean square error of the predicted energy gap and the DFT calculated value.
[0045] In practical application, the training content of the neural network model of the application includes:
[0046] Data set division: more than 10,000 molecules in the training set (accounting for 80%); more than 2,000 molecules in the test set (accounting for 20%). And the division strategy adopts random sampling.
[0047] Hyperparameter configuration: learning rate = 0.0001; batch size = 32; training round = 500, etc.
[0048] Training environment: hardware selects NVIDIA GPU graphics card; software relies on PyTorch 1.12; training time is about 8 hours (single card).
[0049] S3, based on the trained neural network model, output the predicted energy gap value of the traditional Chinese medicine molecule, and the test set determination coefficient R 2 ≥0.9.
[0050] Through the designed API interface, users can directly call the trained model to predict the energy gap, and the performance index is the test set determination coefficient R 2 >0.9 (n>1000). As shown in Figures 3-4 . Figure 3In the figure, the RMSE of the ordinate is the mathematical root mean squared error (Root Mean Sququared Error, RMSE) that is an index for measuring the difference between the predicted value and the actual value, and is often used in regression analysis. The specific calculation formula can be searched on the network. The left figure is the training set, which is completed by about 8000 molecules. The abscissa is the training batch, as shown in the figure, as the training batch increases, it gradually stabilizes, indicating that the model may have found some unknown rules, i.e. the rules between'molecule SMILES-molecule energy gap'. The RMSE helps the model to 'train' forward, but the prediction accuracy may not be good enough, so the R 2 This index is to help the energy gap of each specific molecule to be predicted closer to the actual value (right figure). The abscissa is still the training batch, and as the batch increases, the predicted result is better (R 2 It is also a mathematical index for describing the whole of the test set, such as 2000 molecules. It is similar to the mathematical average, but not simply the average. Figure 4 In the figure, each circle is the case of a test molecule. The abscissa is the value measured by others in the data set, such as quantum chemical method or experiment (in the embodiment of the application, the QM9 data set is all quantum chemical calculation, and other data sets may have experimental measurements). The ordinate is the predicted value of the neural network model, i.e. after the MPNN network is trained, the SMILES of the molecule that the model has not seen before is input. The red dotted line represents the slope closer to 1, which means the better prediction, i.e. the predicted value is closer to the true value. In this example, the test example should have 2000 molecules, so there are 2000 circles. Figure 4 The specific R 2 value in the figure is Figure 3 the value of the R 2 value corresponding to the best point or the last batch in the figure.
[0051] On this basis, the application further discloses a traditional Chinese medicine molecule electronic energy gap prediction system based on a message passing neural network, a data preprocessing module, used for performing molecule filtering and feature extraction; wherein the molecule filtering is used for filtering invalid molecules from a quantum chemical database, the invalid molecules include molecules containing free radicals, metal atoms and molecules that cannot be parsed by built-in software; the feature extraction is used for extracting 9-dimensional atomic features and implicit bond features;
[0052] a model training module, used for constructing a training data set by using the filtered valid molecules, learning the mapping relationship between the SMILES string and the energy gap value through a three-layer message passing neural network, and obtaining a trained neural network model; wherein the atomic features of the neural network model include the 9-dimensional atomic features and the implicit bond features;
[0053] The application deployment module comprises a Python library for encapsulating the trained neural network model and an interactive interface supporting SMILES input and energy gap visualization; wherein the trained neural network model is used to output the predicted energy gap value of a traditional Chinese medicine molecule, and the determination coefficient R of the test set is ≥0.9 2 The visualization interface provides a SMILES input box (supporting single molecule or batch input) and a predicted result display function.
[0054] The method or system of the present application is applied to actual prediction, as follows.
[0055] Case object: baicalein (C 15 H 10 O5), the main active ingredient of traditional Chinese medicine Huangqi, has anti-inflammatory, antioxidant and other activities; resveratrol (C 14 H 12 O3), the main active ingredient of traditional Chinese medicine Huojing, grape and other plants, has anti-aging, cardiovascular protection and other activities.
[0056] Input information: the SMILES of baicalein is C1=CC(=C(C=C1C2=CC(=O)C3=C(C=C(C=C3O2)O)O); the SMILES of resveratrol is C1=CC(=CC=C1 / C=C / C2=CC(=CC(=C2)O)O.
[0057] Prediction result: for the two actual traditional Chinese medicine molecule cases, the model can successfully predict the gap value, and the difference between the model predicted energy gap and the high-precision DFT calculated value is less than 0.08 Hartree.
[0058] Comparison of calculation time consumption: for the same molecule, traditional DFT calculation needs about 3 hours to complete, while the model of the present application only needs about 1 second to obtain the prediction result, and the calculation speed is improved by about 10,000 times.
[0059] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. Any modification, equivalent replacement and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for predicting the electronic energy gap of traditional Chinese medicine molecules based on message passing neural network, characterized in that: The method comprises the following steps: S1. Filter invalid molecules from the quantum chemistry database, including molecules containing free radicals, metal atoms, and molecules that cannot be analyzed by the built-in software; S2. Use the filtered valid molecules to construct a training data set, and learn the mapping relationship between SMILES strings and energy gap values through a three-layer message passing neural network to obtain a trained neural network model; S3, based on the trained neural network model, outputs the predicted energy gap value of the Chinese medicine molecule, and its test set determination coefficient R 2 ≥0.
9.
2. The method according to claim 1, wherein In step S1 , the molecules containing free radicals and metal atoms are filtered by detecting the number of free radical electrons and the atomic number of the atoms to eliminate them.
3. The method according to claim 1, wherein In step S2, the training objective of the neural network is to minimize the mean square error between the predicted energy gap and the DFT calculated value.
4. The method according to claim 1, wherein In step S2, the atomic features of the neural network model include 9-dimensional atomic features and implicit bond features.
5. A Chinese medicine molecule electronic energy gap prediction system based on message passing neural network, characterized in that: The system includes: A data preprocessing module is used to perform molecular filtering and feature extraction; wherein, the molecular filtering is to filter out invalid molecules from the quantum chemistry database, and the invalid molecules include molecules containing free radicals, metal atoms, and molecules that cannot be parsed by the built-in software; the feature extraction is to extract 9-dimensional atomic features and implicit bond features; A model training module is used to construct a training data set using the filtered valid molecules, and learn the mapping relationship between SMILES strings and energy gap values through a three-layer message passing neural network to obtain a trained neural network model; wherein the atomic features of the neural network model include the 9-dimensional atomic features and implicit bond features; The application deployment module includes a Python library for encapsulating the trained neural network model and an interactive interface that supports SMILES input and energy gap visualization; wherein the trained neural network model is used to output the predicted energy gap value of the traditional Chinese medicine molecule, and its test set determination coefficient R 2 ≥0.9.