A machine learning force field development dataset sampling method
Patent Information
- Application Number
- CN202210769717.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-30
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2042-06-30
AI Technical Summary
[0005]本发明解决的问题是机器学习力场训练时数据集质量较差
[0024]本发明提供了一种构建机器学习力场开发数据集的方法,利用初始构象经训练、模拟、计算、筛选获得候选构象,并利用候选构象继续训练、模拟,得到新的候选构象,并当新的候选构象的比例达到设定比例时结束采样,具有明确的收敛准则,经过多轮迭代可构建完成收敛的数据集。构建的数据集大小适中,既包含所有必要的信息进行训练,也不会增加机器学习难度,且能够节省计算资源,为构建准确表征材料各项理化性质的机器学习力场提供了必要基础,在新型材料的设计开发方面有着明显的优势和广泛的应用前景。
Smart Images

Figure CN115169454B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine learning technology, and more specifically, to a dataset sampling method for developing machine learning force fields. Background Technology
[0002] Experimental methods can serve as the basis for theoretical calculations, but they cannot delve into the dynamic processes underlying the various physicochemical properties of materials, nor can they reveal the relationship between these properties and the material's microstructure. Molecular dynamics (MD) simulations can handle timescales from femtoseconds to nanoseconds and system sizes from thousands to millions of atoms, making them an important method for studying the various physicochemical properties of materials. However, the accuracy of MD simulations is highly dependent on the accuracy of the force field in the molecular simulation. Currently, there are very few force field models that can accurately describe materials, especially for some novel materials, where there is often no specific force field model to predict their physicochemical properties. Therefore, there is an urgent need to develop high-precision force fields for molecular simulations that can characterize the physicochemical properties of materials.
[0003] Machine learning methods are an effective means of developing high-precision force fields for molecular simulations. Force fields for molecular dynamics simulations can be trained using first-principles calculation data. The trained force fields possess accuracy close to that of first-principles calculations and can handle molecular dynamics simulation-level models compared to first-principles calculations. Therefore, developing machine learning force fields for materials can achieve accurate molecular dynamics simulations, thereby providing more reliable predictions of material physicochemical properties and laying the foundation for improving material performance.
[0004] The effectiveness of a machine learning model is fundamentally determined by the dataset. The dataset cannot be too large, containing excessive redundant information and increasing the difficulty of the machine learning process, nor can it be too small, lacking necessary information and preventing the model from describing specific properties. Meanwhile, constructing a machine learning force field requires labeling the conformations in the dataset, i.e., using first-principles calculations to determine the potential energy of the conformations and the forces acting on atoms. However, first-principles calculations are very expensive and cannot label all conformations in massive datasets. Therefore, it is necessary to choose a dataset of appropriate size that contains all the necessary information for training, and an appropriately sized dataset can also save computational resources. Summary of the Invention
[0005] The problem addressed by this invention is the poor quality of the dataset during machine learning force field training.
[0006] To address the above problems, this invention provides a dataset sampling method for developing machine learning force fields, comprising:
[0007] Using the initial conformation as the training set, multiple machine learning force fields are obtained through training.
[0008] Using multiple machine learning force fields, molecular dynamics simulations are performed on the calibration properties of the material to obtain multiple molecular dynamics simulation trajectories;
[0009] Calculate the atomic forces for each conformation in each of the molecular dynamics simulation trajectories, and calculate the average atomic forces for each conformation obtained using all of the machine learning force fields;
[0010] The standard deviation of each conformation is calculated based on the atomic force, average atomic force, and number of machine learning force fields. Candidate conformations of the dataset are determined based on the magnitude of the standard deviation.
[0011] Repeat the above steps using the candidate conformation as the initial conformation until the proportion of the new candidate conformation to the initial conformation reaches a set proportion, thus completing the sampling of the dataset.
[0012] Preferably, the candidate conformation is the conformation in which the standard deviation falls between a set upper limit and a set lower limit.
[0013] Preferably, the upper limit is set to 200-400 meV / Angstrom, and the lower limit is set to 20 meV / Angstrom.
[0014] Preferably, the set ratio is 95%.
[0015] Preferably, the standard deviation of each conformation is calculated using the following formula:
[0016]
[0017] Where σ is the standard deviation, m is the number of machine learning force fields, and Fi is the atomic force obtained by using the i-th machine learning force field in the conformation. The average atomic force is obtained for the conformation using all the machine learning force fields.
[0018] Preferably, the step of using the initial conformation as a training set to train multiple machine learning force fields includes:
[0019] Using the initial conformation as a sample, and the potential energy and atomic forces of the initial conformation as labels, the Adam method is used to train a neural network with different random numbers and the same hyperparameters to obtain multiple machine learning force fields.
[0020] Preferably, the neural network training includes three hidden layers, each containing 240 nodes, with an initial learning rate of 0.005 and an ending learning rate of 1.0E. -8 -1.0E -7 The training batch size is 1,000,000.
[0021] Preferably, the process of performing molecular dynamics simulations on the calibration properties of the material to obtain multiple molecular dynamics simulation trajectories includes:
[0022] The simulation parameters, including the initial conformation, time step, and ensemble, are set. Molecular dynamics simulations are performed using LAMMPS software, and the molecular dynamics simulation trajectories are obtained from the LAMMPS software.
[0023] The advantages of this invention compared to existing technologies are:
[0024] This invention provides a method for constructing a machine learning force field development dataset. It utilizes an initial conformation for training, simulation, computation, and selection to obtain candidate conformations. These candidate conformations are then used for further training and simulation to obtain new candidate conformations. Sampling terminates when the proportion of new candidate conformations reaches a predetermined ratio. The method has a clear convergence criterion, and a converged dataset can be constructed through multiple iterations. The constructed dataset is of moderate size, containing all necessary information for training without increasing the difficulty of machine learning, and saving computational resources. This provides a necessary foundation for constructing machine learning force fields that accurately characterize various physicochemical properties of materials, offering significant advantages and broad application prospects in the design and development of novel materials. Attached Figure Description
[0025] Figure 1 This is a flowchart of the dataset sampling method for developing machine learning force fields in an embodiment of the present invention. Detailed Implementation
[0026] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0027] Please see Figure 1 As shown, an embodiment of the present invention provides a dataset sampling method for machine learning force field development, comprising:
[0028] Step S1: Using the initial conformation as the training set, multiple machine learning force fields are trained.
[0029] Step S2: Using multiple machine learning force fields, molecular dynamics simulations are performed on the calibration properties of the material to obtain multiple molecular dynamics simulation trajectories;
[0030] Step S3: Calculate the atomic forces of each conformation in each molecular dynamics simulation trajectory, and calculate the average atomic forces of each conformation obtained using all machine learning force fields;
[0031] Step S4: Calculate the standard deviation of each conformation based on the atomic force, average atomic force, and number of machine learning force fields for each conformation. Determine the candidate conformations of the dataset based on the magnitude of the standard deviation.
[0032] Step S5: Repeat the above steps with the candidate conformation as the initial conformation until the proportion of the new candidate conformation to the initial conformation reaches the set proportion, and then the sampling of the dataset is completed.
[0033] This embodiment provides a method for constructing a machine learning force field development dataset. The method first uses existing initial conformations as a training set to train several machine learning force fields. Then, molecular dynamics simulations are performed using these machine learning force fields to obtain molecular dynamics simulation trajectories. For each conformation in the trajectory, the atomic forces obtained by each conformation using these machine learning force fields are calculated, and the average atomic forces obtained using all force fields are calculated. Thus, for each conformation in the trajectory, the standard deviation is calculated and used as the error index of the conformation. Based on the magnitude of the standard deviation, a conformation of a suitable size is selected as a candidate conformation for the dataset. The selected candidate conformations are used as initial conformations, and steps S1 to S4 are repeated until the proportion of the selected new candidate conformations (i.e., the proportion of the initial conformations) reaches a set proportion, at which point the sampling of the dataset is considered complete.
[0034] This embodiment utilizes an initial conformation for training, simulation, computation, and screening to obtain candidate conformations. These candidate conformations are then used for further training and simulation to generate new candidate conformations. Sampling terminates when the proportion of new candidate conformations reaches a predetermined level, exhibiting a clear convergence criterion. Through multiple iterations, a converged dataset can be constructed. The constructed dataset is of moderate size, containing all necessary information for training without increasing the difficulty of machine learning, and saving computational resources. It provides a necessary foundation for constructing machine learning force fields that accurately characterize various physicochemical properties of materials, demonstrating significant advantages and broad application prospects in the design and development of novel materials.
[0035] According to this invention, multiple machine learning force fields are first trained using the initial conformation as a training set. Specifically, this includes: using the initial conformation as samples, and the potential energy and atomic forces of the initial conformation as labels; employing different random numbers and the same hyperparameters; and using the Adam method to train a neural network, thereby obtaining m machine learning force fields M0, M1, M2, ..., M m .
[0036] The neural network used to train the machine learning force field typically has three hidden layers, each containing 240 nodes. The initial learning rate is 0.005, and the final learning rate is 1.0E. -8 -1.0E -7 The training batch is typically 1,000,000.
[0037] According to this invention, the next step involves using the multiple machine learning force fields obtained in step one to perform molecular dynamics simulations on the calibration properties of the material using LAMMPS software. During the molecular dynamics simulation, simulation parameters such as the initial conformation, time step, and ensemble are first set, then the molecular dynamics simulation begins, and finally, the molecular dynamics simulation trajectories are obtained from the LAMMPS software. Since one simulation trajectory is obtained under each force field, m simulation trajectories are obtained in step S2.
[0038] According to the present invention, in step S3, for each conformation in the trajectory, the atomic force Fi obtained using the i-th force field is calculated, which is a matrix of size N*3, where N is the number of atoms. Then, the average atomic force obtained using all force fields is calculated. In step S4, for each conformation of the trajectory, a standard deviation σ is given as the error index for that conformation. Based on the magnitude of the standard deviation σ, conformations of moderate magnitude are selected as candidate conformations for the dataset. Generally, an upper limit and a lower limit are set, and only conformations whose standard deviation σ falls between the upper and lower limits are selected as candidate conformations for the dataset. That is, candidate conformations are conformations whose standard deviation falls between the set upper and lower limits. In step S5, the obtained candidate conformations are returned to step S1, and the steps of training to obtain the force field, obtaining the trajectory through molecular dynamics simulation, calculating the atomic force information of the conformations in the trajectory, obtaining the standard deviation, and screening candidate conformations again are repeated. When the proportion of new candidate conformations obtained by screening based on the standard deviation reaches a certain level, the new candidate conformations are used as the dataset, thus completing the sampling of the dataset.
[0039] Wherein, the standard deviation σ is:
[0040]
[0041] In the formula, m represents the number of machine learning force fields, and Fi represents the atomic forces obtained by using the i-th machine learning force field in the conformation. The average atomic force is obtained by using all machine learning force fields for the conformation.
[0042] In some implementations, the upper limit is set to 200-400 meV / Angstrom, the lower limit is set to 20 meV / Angstrom, and the ratio is set to 95%, that is, 95% of the new conformations fall between the set upper and lower limits.
[0043] For example, force fields M0, M1, M2, ..., M m Molecular dynamics simulations were performed, and the simulated molecular dynamics trajectories L0, L1, L2, ..., L were obtained. mThe conformations in the trajectory are conformation a, conformation b, ..., conformation n. During calculation, the forces F1, F2, ..., Fi, ..., Fm experienced by atoms in conformation a under m force fields are obtained, and then the average atomic force of conformation a under the m force fields is calculated. Calculate the standard deviation of conformation a. Similarly, calculate the standard deviations of conformations b, c, etc., based on the set upper limit σ of the standard deviation. up and setting a lower limit σ low The standard deviation falls within σ up and σ low The conformations between the two are taken as candidate conformations, and then the candidate conformations are taken as the initial conformations. Steps S1 to S4 are repeated, and the dataset sampling is considered to be completed when 95% of the new conformations fall between the set upper limit and the set lower limit.
[0044] While the disclosure is as stated above, its scope of protection is not limited thereto. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of this disclosure, and all such changes and modifications will fall within the protection scope of this invention.
Claims
1. A dataset sampling method for developing machine learning force fields, characterized in that, include: Using the initial conformation as the training set, multiple machine learning force fields are obtained through training. Using multiple machine learning force fields, molecular dynamics simulations are performed on the calibration properties of the material to obtain multiple molecular dynamics simulation trajectories, wherein each machine learning force field obtains one molecular dynamics simulation trajectory; Calculate the atomic forces for each conformation in each of the molecular dynamics simulation trajectories, and calculate the average atomic forces for each conformation obtained using all of the machine learning force fields; The standard deviation of each conformation is calculated based on the atomic forces, average atomic forces, and the number of machine learning force fields. Candidate conformations for the dataset are then determined based on the magnitude of the standard deviation. The standard deviation of each conformation is calculated using the following formula: ; Where σ is the standard deviation, m is the number of machine learning force fields, and Fi is the atomic force obtained by using the i-th machine learning force field in the conformation. The average atomic force is obtained for the conformation using all of the machine learning force fields; Repeat the above steps using the candidate conformation as the initial conformation until the proportion of the new candidate conformation to the initial conformation reaches a set proportion, thus completing the sampling of the dataset.
2. The dataset sampling method for developing machine learning force fields according to claim 1, characterized in that, The candidate conformation is the conformation whose standard deviation falls between a set upper limit and a set lower limit.
3. The dataset sampling method for developing machine learning force fields according to claim 2, characterized in that, The upper limit is set at 200-400 meV / Angstrom, and the lower limit is set at 20 meV / Angstrom.
4. The dataset sampling method for developing machine learning force fields according to claim 2, characterized in that, The set ratio is 95%.
5. The dataset sampling method for developing machine learning force fields according to claim 1, characterized in that, The method of using the initial conformation as a training set to train multiple machine learning force fields includes: Using the initial conformation as a sample, and the potential energy and atomic forces of the initial conformation as labels, the Adam method is used to train a neural network with different random numbers and the same hyperparameters to obtain multiple machine learning force fields.
6. The dataset sampling method for developing machine learning force fields according to claim 5, characterized in that, The neural network training includes three hidden layers, each containing 240 nodes. The initial learning rate is 0.005, and the final learning rate is 1.0E. -8 -1.0E -7 The training batch size is 1,000,000.
7. The dataset sampling method for developing machine learning force fields according to claim 1, characterized in that, The molecular dynamics simulation of the material's calibration properties yields multiple molecular dynamics simulation trajectories, including: The simulation parameters, including the initial conformation, time step, and ensemble, are set. Molecular dynamics simulations are performed using LAMMPS software, and the molecular dynamics simulation trajectories are obtained from the LAMMPS software.
Citation Information
Patent Citations
Method for constructing neural network force field model based on global optimization algorithm
CN113807025A