Traditional Chinese medicine small molecule gibbs free energy prediction method and system based on deep learning
By using a deep learning-based method, small molecules of traditional Chinese medicine are transformed into molecular graph representations and Gibbs free energy is predicted using a deep learning model. This solves the problems of low computational efficiency and insufficient accuracy in the prediction of small molecules of traditional Chinese medicine, and achieves efficient and accurate Gibbs free energy prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING UNIV OF TRADITIONAL CHINESE MEDICINE
- Filing Date
- 2026-02-10
- Publication Date
- 2026-05-29
Smart Images

Figure CN122117140A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of pharmaceutical science, computational chemistry and artificial intelligence, and in particular to a method and system for predicting the Gibbs free energy of small molecules in traditional Chinese medicine based on deep learning. Background Technology
[0002] In existing technologies, the evaluation of the thermodynamic properties of small molecules in traditional Chinese medicine (TCM) based on quantum chemical calculations is typically computationally expensive and time-consuming, making large-scale applications difficult. This is especially true for the task of predicting the Gibbs free energy of TCM small molecules, where traditional methods suffer from high computational overhead and low efficiency. Furthermore, most existing models are based on general datasets and are not optimized for TCM small molecule systems, resulting in insufficient accuracy and applicability in practical TCM analysis scenarios. Therefore, there is an urgent need for an efficient, accurate, and easily deployable prediction method to meet the needs of TCM molecule screening and property evaluation. Summary of the Invention
[0003] To address the shortcomings of existing technologies, the purpose of this invention is to provide a method and system for predicting the Gibbs free energy of small molecules in traditional Chinese medicine based on deep learning.
[0004] The technical solution provided by this invention is as follows: A deep learning-based method for predicting the Gibbs free energy of small molecules in traditional Chinese medicine, the method comprising the following steps: S1. Receive small molecules of traditional Chinese medicine as input in the form of SMILES string or molecular structure file, and after performing structure verification and standardization processing, convert the small molecules of traditional Chinese medicine into molecular diagram representation; S2. The molecular graph is input into a deep learning model. The model captures molecular structural features and interaction relationships through a graph representation learning mechanism, refines the representation through multi-layer updates, and finally outputs the predicted Gibbs free energy value of the small molecules of traditional Chinese medicine through pooling operations. Its test set determination coefficient R²≥0.99.
[0005] Preferably, in step S1, the molecular diagram representation includes atomic node features and chemical bond edge features.
[0006] Preferably, in step S2, the training process of the deep learning model is completed on accelerated hardware, and after training, it is deployed on a general-purpose computing device for prediction.
[0007] Preferably, in step S2, during the training of the deep learning model, structural features are extracted using a dataset of molecules related to traditional Chinese medicine, and a partitioning strategy is adopted to ensure the consistency of data distribution.
[0008] Preferably, in step S2, the number of parameters of the deep learning model is controlled within a reasonable range, the structure learning mechanism is preserved, and optimization is performed for the characteristics of small molecules in traditional Chinese medicine.
[0009] This invention further discloses a deep learning-based Gibbs free energy prediction system for small molecules of traditional Chinese medicine, the system comprising: The preprocessing module is used to receive small molecules of traditional Chinese medicine as input in the form of SMILES strings or molecular structure files, and after performing structural verification and standardization processing, convert the small molecules of traditional Chinese medicine into molecular diagram representations. The prediction module is used to input the molecular graph into a deep learning model. The model captures molecular structural features and interaction relationships through a graph representation learning mechanism, refines the representation through multi-layer updates, and finally outputs the predicted Gibbs free energy value of the small molecules of traditional Chinese medicine through pooling operations. Its test set determination coefficient R²≥0.99.
[0010] Preferably, in the preprocessing module, the molecular diagram representation includes atomic node features and chemical bond edge features.
[0011] Preferably, in the prediction module, the training process of the deep learning model is completed on accelerated hardware, and after training, it is deployed on a general-purpose computing device for prediction.
[0012] Preferably, during the training of the deep learning model, structural features are extracted using a dataset of molecules related to traditional Chinese medicine, and a partitioning strategy is adopted to ensure the consistency of data distribution.
[0013] Preferably, the number of parameters of the deep learning model is controlled within a reasonable range, the structure learning mechanism is preserved, and optimization is performed for the small molecule characteristics of traditional Chinese medicine.
[0014] This invention overcomes the shortcomings of existing technologies and provides a method and system for predicting the Gibbs free energy of small molecules in traditional Chinese medicine based on deep learning. The specific technical solution of this invention is as follows: First, the system receives small molecules of traditional Chinese medicine as input in the form of SMILES strings or molecular structure files, performs structural verification and standardization processing, and converts them into molecular graph representations. Subsequently, the molecular graph is input into a deep learning model. This model captures structural features and interaction relationships through a graph representation learning mechanism, refines the representation through multi-layer updates, and finally quickly calculates the Gibbs free energy value through pooling operations. The entire model training process is completed on accelerated hardware, and the prediction can be implemented on general-purpose devices, supporting high-throughput applications.
[0015] The beneficial effects of this invention after adopting the above technical solution are as follows: (1) Maintaining the advantages of structure learning: This invention inherits the mechanism of graph representation learning, which improves computational efficiency while maintaining accuracy, and achieves high prediction accuracy on the small molecule dataset of traditional Chinese medicine.
[0016] (2) Enhanced deployment flexibility: The model of this invention supports deployment on general-purpose devices; single-molecule prediction time is short.
[0017] (3) Empirically proven prediction accuracy: Through testing of Chinese medicine molecules, the predicted values of the model of this invention are very close to the benchmark values, verifying its high accuracy in the task of predicting the Gibbs free energy of small molecules of Chinese medicine. Attached Figure Description
[0018] Figure 1 This is a flowchart of the steps of the method of the present invention; Figure 2 This is a framework structure diagram of the system of the present invention; Figure 3 These are the training loss curve and R² curve of the GIN model; Figure 4 This is a scatter plot of the test set predictions for the GIN model; Figure 5 These are the training loss curve and R² curve of the MPNN model; Figure 6 Predict a scatter plot for the test set of the MPNN model; Figure 7 The error distribution of the MPNN model is shown. Figure 8 This is the residual plot of the MPNN model. Detailed Implementation
[0019] The technical solution of the present invention will be further described in detail below with reference to specific embodiments, but this does not constitute any limitation on the present invention.
[0020] A deep learning-based method for predicting the Gibbs free energy of small molecules in traditional Chinese medicine, such as... Figure 1 As shown, the method includes the following steps: S1. Receive small molecules of traditional Chinese medicine as input in the form of SMILES string or molecular structure file, and after performing structure verification and standardization processing, convert the small molecules of traditional Chinese medicine into molecular diagram representation.
[0021] In step S1, the execution entity is the preprocessing module based on the RDKit library. Structural verification specifically refers to using the Chem.MolFromSmiles function to check if the SMILES string can be parsed into a valid molecular object, and performing sanitization processing using Chem.SanitizeMol, including valence bond checks and aromaticity verification. Standardization processing specifically refers to removing free radicals (checking if the atom GetNumRadicalElectrons > 0), removing invalid molecules, and extracting atomic features (such as atomic number, chirality, degree, formal charge, etc.) and edge features (such as bond type, bidirectional edge index). The molecular graph representation includes atomic node features (a 9-dimensional vector: atomic number, chiral label, degree, formal charge, number of free radical electrons, hybridization type, aromaticity, number of hydrogen atoms, whether in a ring) and chemical bond edge features (edge index matrix, representing connection relationships).
[0022] S2. The molecular graph is input into a deep learning model. The model captures molecular structural features and interaction relationships through a graph representation learning mechanism, refines the representation through multi-layer updates, and finally outputs the predicted Gibbs free energy value of the small molecules of traditional Chinese medicine through pooling operations. Its test set determination coefficient R²≥0.99.
[0023] In step S2, the deep learning models are GIN (original model reference: https: / / arxiv.org / abs / 1704.01212 The deep learning model (original model reference: https: / / arxiv.org / abs / 1810.00826) and MPNN model were used. The training process was completed on accelerated hardware, and the model was deployed on general-purpose computing devices for prediction after training. During the training of the deep learning model, structural features were extracted using a dataset of molecules related to traditional Chinese medicine, and a partitioning strategy was adopted to ensure data distribution consistency. Furthermore, the number of parameters in the deep learning model was controlled within a reasonable range, preserving the structure learning mechanism and optimizing for the small molecule characteristics of traditional Chinese medicine.
[0024] This invention further discloses a deep learning-based Gibbs free energy prediction system for small molecules of traditional Chinese medicine, such as... Figure 2 As shown, the system includes: Preprocessing module 1 is used to receive small molecules of traditional Chinese medicine input in the form of SMILES strings or molecular structure files, and after performing structural verification and standardization processing, convert the small molecules of traditional Chinese medicine into molecular diagram representations.
[0025] In preprocessing module 1, the molecular diagram representation includes atomic node features and chemical bond edge features.
[0026] Prediction module 2 is used to input the molecular graph into a deep learning model. The model captures molecular structural features and interaction relationships through a graph representation learning mechanism, refines the representation through multi-layer updates, and finally outputs the predicted Gibbs free energy value of the small molecules of traditional Chinese medicine through pooling operations. Its test set determination coefficient R²≥0.99.
[0027] In prediction module 2, the training process of the deep learning model is completed on accelerated hardware, and after training, it is deployed on a general-purpose computing device for prediction. Furthermore, during the training of the deep learning model, structural features are extracted using a dataset of molecules related to traditional Chinese medicine, and a partitioning strategy is employed to ensure data distribution consistency. Moreover, the number of parameters in the deep learning model is controlled within a reasonable range, preserving the structure learning mechanism, and is optimized for the small molecule characteristics of traditional Chinese medicine.
[0028] In this embodiment of the invention, the deep learning model undergoes architectural optimization, achieving efficient inference on a general-purpose hardware platform. Model training is performed on accelerated hardware, and after completion, the weights are saved. The model is then reconstructed on a general-purpose device for prediction. This invention further tested randomized traditional Chinese medicine molecules using the above-described method or system. Detailed testing process: (1) Data preparation: Use job20251111.csv (containing small molecules of traditional Chinese medicine SMILES and Gibbs free energy labels, totaling about 10^4 data entries), run clean_dataset_and_save to clean (remove invalid SMILES strings and molecules containing free radicals, output clean CSV, the proportion of effective molecules after cleaning is about 95% or more); create_random_subset to get 100% subset; split_dataset to split (80% training set, 20% test set, using pd.qcut to bin and using the stratify parameter to ensure the consistency of Gibbs free energy distribution).
[0029] (2) Model training: Load graph data using CustomMoleculeDataset (molecules are converted into PyTorchGeometric Data objects, including node features and edge features), DataLoader(batch_size=64, shuffle=True for train); optimizer Adam(lr=0.0001), loss function is RMSE (square root of MSE); train for 2001 epochs, evaluate R², RMSE, MAE and MAPE at each epoch, and save the best model (based on test set R²).
[0030] (3) Evaluation: The evaluate function calculates the test set R² (squared using numpy.corrcoef), RMSE (root mean square error), MAE (mean absolute error), and MAPE (mean absolute percentage error); generates scatter plots, residual plots, and error distribution plots (using Matplotlib and Seaborn).
[0031] Experimental reproducibility: Environment: Python 3.12.3; Libraries: torch, torch_geometric, rdkit, pandas, numpy, sklearn, matplotlib, seaborn; random seed: 42; run the main() function to train only GIN and MPNN models. GIN model test results: R²=0.9982, RMSE=19.69, MAE=14.55, MAPE=2.82%; MPNN model test results: R²=0.9156, RMSE=109.21, MAE=65.69, MAPE=10.34%.
[0032] The results are as follows Figures 3-5 As shown. Figure 3 The training loss curve and R² curve of the GIN model are shown (x-axis is epoch, y-axis is RMSE or R², showing the loss rapidly decreasing to a stable state and R² rising to 0.9982). Figure 4 A scatter plot of predictions for the test set of the GIN model (x-axis represents the actual Gibbs free energy (U), y-axis represents the predicted value, red line represents the ideal line y=x, gradient color of points indicates absolute error, most points closely follow the ideal line, indicating high accuracy); Figure 5 The training loss curve and R² curve of the MPNN model (similar) Figure 3 R² reaches 0.9156). Figure 6 Predict scatter plots for the test set of the MPNN model (similar to...) Figure 4 However, the scattered points are more dispersed, resulting in larger errors in color display. Figure 7 The error distribution plots for the MPNN model are shown below (the left subplot is the absolute error distribution histogram, with the frequency decreasing as the error increases from 0 to 600, and the red line indicates the mean of 65.69; the right subplot is the relative error distribution histogram, with the frequency decreasing as the error increases from 0% to 80%, and the red line indicates the median of 6.42%). Figure 8The image shows the residual plot for the MPNN model (x-axis represents predicted values, y-axis represents residuals (actual - predicted). Blue dots cluster near the red line y=0, ranging from -400 to 400, indicating no significant systematic bias but a few outliers). Additional information: The GIN model has similar results, including absolute error distribution (mean 14.55, narrower range 0-140) and relative error distribution (median 1.98%, frequency concentrated in low errors); the GIN residual plot (residuals range -100 to 50, more compactly clustered, confirming model robustness).
[0033] The results show that the model's predicted values are close to the benchmark values, indicating that the model of this invention has high accuracy. Furthermore, the model's single-molecule prediction speed is fast, making it suitable for practical scenarios.
[0034] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.
Claims
1. A deep learning-based method for predicting the Gibbs free energy of small molecules in traditional Chinese medicine, characterized in that, The method includes the following steps: S1. Receive small molecules of traditional Chinese medicine as input in the form of SMILES string or molecular structure file, and after performing structural verification and standardization processing, convert the small molecules of traditional Chinese medicine into molecular diagram representation; S2. The molecular graph is input into a deep learning model. The model captures molecular structural features and interaction relationships through a graph representation learning mechanism, refines the representation through multi-layer updates, and finally outputs the predicted Gibbs free energy value of the small molecules of traditional Chinese medicine through pooling operations. Its test set determination coefficient R²≥0.
99.
2. The method as described in claim 1, characterized in that, In step S1, the molecular diagram representation includes atomic node features and chemical bond edge features.
3. The method as described in claim 1, characterized in that, In step S2, the training process of the deep learning model is completed on accelerated hardware, and after training, it is deployed on a general-purpose computing device for prediction.
4. The method as described in claim 3, characterized in that, In step S2, during the training of the deep learning model, structural features are extracted using a dataset of molecules related to traditional Chinese medicine, and a partitioning strategy is adopted to ensure the consistency of data distribution.
5. The method as described in claim 4, characterized in that, In step S2, the number of parameters of the deep learning model is controlled within a reasonable range, the structure learning mechanism is preserved, and optimization is performed for the small molecule characteristics of traditional Chinese medicine.
6. A deep learning-based system for predicting the Gibbs free energy of small molecules in traditional Chinese medicine, characterized in that, The system includes: The preprocessing module is used to receive small molecules of traditional Chinese medicine as input in the form of SMILES strings or molecular structure files, and after performing structural verification and standardization processing, convert the small molecules of traditional Chinese medicine into molecular diagram representations. The prediction module is used to input the molecular graph into a deep learning model. The model captures molecular structural features and interaction relationships through a graph representation learning mechanism, refines the representation through multi-layer updates, and finally outputs the predicted Gibbs free energy value of the small molecules of traditional Chinese medicine through pooling operations. Its test set determination coefficient R²≥0.
99.
7. The system as described in claim 6, characterized in that, In the preprocessing module, the molecular graph representation includes atomic node features and chemical bond edge features.
8. The system as described in claim 6, characterized in that, In the prediction module, the training process of the deep learning model is completed on accelerated hardware, and after training, it is deployed on a general-purpose computing device for prediction.
9. The system as described in claim 8, characterized in that, During the training of the deep learning model, structural features are extracted using a dataset of molecules related to traditional Chinese medicine, and a partitioning strategy is adopted to ensure the consistency of data distribution.
10. The system as described in claim 9, characterized in that, The parameters of the deep learning model are controlled within a reasonable range, the structure learning mechanism is preserved, and optimization is performed for the small molecule characteristics of traditional Chinese medicine.