Method for optimizing machine learning potential function training set
By combining Boltzmann energy distribution theory and furthest point sampling technology, the representative subset of the machine learning potential function training set is automatically identified and extracted, which solves the problem of poor results in traditional methods and achieves an efficient and accurate training set Build.
Patent Information
- Application Number
- CN202411540448.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-10-31
AI Technical Summary
The traditional machine learning potential function training set sampling method ignores subtle differences in real physical situations, resulting in poor results in practical applications, and the practice of increasing the training set scale is expensive and has limited results.
Using a method that combines Boltzmann energy distribution theory and furthest point sampling technology, the most representative and most informative subsets in the data set are automatically identified and extracted to build the optimal training set.
The quality and efficiency of the machine learning potential function training set is improved, and the automatic identification and extraction of the most representative subset in the data set is realized, which improves the speed and reliability of data acquisition.
Smart Images

Figure CN119479843A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of force field development, and in particular to a method for optimizing a machine learning potential function training set. Background Art
[0002] Molecular dynamics simulation, as a powerful tool to reveal the microscopic behavior and properties of matter, has shown great potential and remarkable achievements in many scientific research fields. However, the accuracy of this technology has always been limited by the force field model, and the limitations of traditional empirical potentials often restrict the accuracy of simulation results. With the rise of machine learning potential functions, the field of molecular dynamics simulation has ushered in revolutionary changes. By training machine learning models to predict the interactions between atoms, machine learning potential functions not only break the accuracy bottleneck of traditional empirical potentials, but also achieve high accuracy comparable to ab initio molecular dynamics, while maintaining the advantages of molecular dynamics in computational efficiency. This breakthrough has greatly enhanced the practical value of molecular dynamics simulations, enabling researchers to explore the dynamic behavior of molecules and materials with unprecedented accuracy and speed, thereby accelerating the development of materials science, biochemistry, drug design and other fields. The core of training machine learning potential functions lies in building high-quality training sets, and the key lies in how to accurately capture and generalize to a wide range of physical configurations with limited and representative configurations.
[0003] Currently, many training set sampling methods ignore the subtle differences in real physical situations, resulting in poor performance of the trained machine learning potential functions in practical applications. In addition, although increasing the size of the training set is intended to improve performance, this practice is often accompanied by high costs and limited effects. Summary of the invention
[0004] In order to overcome the shortcomings of the prior art, the purpose of the present invention is to provide a method for optimizing the training set of machine learning potential functions. By integrating the Boltzmann energy distribution theory and the farthest point sampling technology, the problem of poor effect of traditional data sampling technology is solved, and the most representative and information-rich subset of the data set can be automatically identified and extracted.
[0005] To achieve the above object, the present invention provides the following solutions:
[0006] A method for optimizing a machine learning potential function training set, comprising:
[0007] Construct machine learning potential functions;
[0008] Performing molecular dynamics simulation using the machine learning potential function to obtain an original database;
[0009] Using first principle software to perform single point energy calculation on the original database to obtain configuration data;
[0010] Performing target parameter analysis and data elimination on the configuration data to obtain preprocessed data; the target parameter analysis includes: energy analysis, force analysis and potential force distribution analysis;
[0011] Performing atomic average energy calculation on the preprocessed data to obtain atomic average energy data;
[0012] Using Boltzmann energy distribution to perform probability distribution calculation on the atomic average energy data to obtain probability distribution data;
[0013] Determine the overall configuration sampling quantity according to the probability distribution data;
[0014] Dividing the atomic average energy data into intervals to obtain a plurality of energy intervals, and performing configuration calculation on the atomic average energy data in each energy interval according to the probability distribution data and the overall configuration sampling number to obtain the configuration sampling number in the interval;
[0015] The configurations in different energy intervals are marked according to the number of configuration samples in the intervals, and the Cartesian distance descriptors of the configurations in different energy intervals are calculated using the farthest point sampling technique to obtain difference data;
[0016] According to the difference data, the farthest point sampling method is used to select the configuration with the largest Cartesian distance descriptor distance in each energy interval to obtain a training set, and the configurations in each energy interval except the training set are integrated into a test set.
[0017] Preferably, the calculation formula of the probability distribution data is: in, Wherein, P(E) is the probability distribution data; E is the average particle energy of the atomic average energy data; k is the Boltzmann constant; T is the temperature; Z is the partition function; E i is the average particle energy in the i-th energy interval.
[0018] Preferably, the construction techniques of the machine learning potential function include: ab initio molecular dynamics, stretch-compression simulation and density functional theory single point energy calculation method.
[0019] The present invention discloses the following technical effects:
[0020] The present invention provides a method for optimizing a training set of a machine learning potential function. By integrating the Boltzmann energy distribution theory with the farthest point sampling technology, the problem of poor effect of traditional data sampling technology is solved, and the automatic identification and extraction of the most representative and information-rich subsets in the data set is realized. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0022] Figure 1 A schematic diagram of a process flow for optimizing a machine learning potential function training set provided by an embodiment of the present invention;
[0023] Figure 2 An implementation flow chart provided for an embodiment of the present invention;
[0024] Figure 3 The energy force distribution diagram provided by the embodiment of the present invention is Figure 3 (a) is the energy distribution diagram of the data set. Figure 3 (b) is the distribution diagram of the force in the data set. Figure 3 (c) is the potential distribution diagram;
[0025] Figure 4 A schematic diagram of screening results provided by an embodiment of the present invention, Figure 4 (a) is the distribution statistics of the selected configurations of AlN-wz in the total configuration space; Figure 4 (b) Distribution statistics of the selected configurations of AlN-rs in the total configuration space
[0026] Figure 5 A schematic diagram of the fitting principle provided by an embodiment of the present invention;
[0027] Figure 6 A schematic diagram showing the comparison of the losses of the training set constructed by different methods provided in the embodiments of the present invention. Figure 6 (a) is a comparison chart of the total loss function. Figure 6 (b) is the comparison diagram of the root mean square error of the energy of the training set and the test set of the three methods. Figure 6 (c) is a comparison chart of the root mean square error of the force between the training set and the test set of the three methods. Figure 6 (d) is the comparison diagram of the root mean square error of the potential between the training set and the test set of the three methods;
[0028] Figure 7 A schematic diagram of energy and volume comparison provided by an embodiment of the present invention;
[0029] Figure 8 A schematic diagram of phase change provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] The purpose of the present invention is to provide a method for optimizing the training set of machine learning potential functions, which solves the problem of poor effect of traditional data sampling technology by integrating Boltzmann energy distribution theory and farthest point sampling technology, and realizes automatic identification and extraction of the most representative and information-rich subsets in the data set.
[0032] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0033] Figure 1 A schematic diagram of a process flow for optimizing a machine learning potential function training set provided by an embodiment of the present invention, Figure 2 The implementation flow chart provided for the embodiment of the present invention is as follows: Figure 1 and Figure 2 As shown, the present invention provides a method for optimizing a machine learning potential function training set, comprising:
[0034] Step 100: Constructing a machine learning potential function;
[0035] Step 200: Perform molecular dynamics simulation using a machine learning potential function to obtain an original database;
[0036] Step 300: Calculate the single-point energy of the original database using first-principles software to obtain configuration data;
[0037] Step 400: performing target parameter analysis and data elimination on the configuration data to obtain preprocessed data; the target parameter analysis includes: energy analysis, force analysis and potential force distribution analysis;
[0038] Step 500: Calculate atomic average energy of preprocessed data to obtain atomic average energy data;
[0039] Step 600: Calculate the probability distribution of atomic average energy data using Boltzmann energy distribution to obtain probability distribution data;
[0040] Step 700: Determine the number of overall configuration sampling according to the probability distribution data;
[0041] Step 800: Divide the atomic average energy data into intervals to obtain a number of energy intervals, and perform configuration calculation on the atomic average energy data in each energy interval according to the probability distribution data and the overall configuration sampling number to obtain the configuration sampling number in the interval;
[0042] Step 900: marking the configurations in different energy intervals according to the number of configuration samples in the interval, and calculating the Cartesian distance descriptors of the configurations in different energy intervals using the farthest point sampling technique to obtain difference data;
[0043] Step 1000: Based on the difference data, the farthest point sampling method is used to select the configuration with the largest Cartesian distance descriptor distance in each energy interval to obtain a training set, and the configurations in each energy interval except the training set are integrated into a test set.
[0044] Specifically, the calculation formula for probability distribution data is: in, Where P(E) is the probability distribution data; E is the average atomic energy data average particle energy; k is the Boltzmann constant; T is the temperature; Z is the partition function; E i is the average particle energy in the ith energy interval.
[0045] Preferably, the construction techniques of the machine learning potential function include: ab initio molecular dynamics, stretch-compression simulation and density functional theory single point energy calculation method.
[0046] Optionally, this embodiment provides a method for constructing a data set (molecular dynamics part): using molecular dynamics simulation to obtain various stretching and compression models to obtain configurations, such as enlarging or reducing the box by a certain proportion to explore the configuration space of molecules under different density and pressure conditions, or performing a certain perturbation on the positions of all atoms, thereby simulating the configurations that the molecules may reach after multiple molecular dynamics evolutions, and then using high-precision density functional theory single-point energy calculations to calculate these configuration energy, force, potential and other information, and then add them to the data set.
[0047] Furthermore, the configuration data obtained by high-precision single-point energy calculation using first-principles software are collated and uniformly managed, and these data are stored in a file for subsequent processing.
[0048] refer to Figure 3 (a) to Figure 3 (c) Figure 3 (a) is the energy distribution diagram of the data set, where the horizontal axis is the average energy of each atom and the vertical axis is the frequency; Figure 3 (b) is the distribution diagram of the force in the data set, where the abscissa is the average interaction force of each atom and the ordinate is the frequency; Figure 3 (c) is a virial distribution diagram, where the horizontal axis is the average virial of each atom and the vertical axis is the frequency; analyze the energy, force and virial distribution of the configuration. By observing the distribution of these physical quantities, identify those configurations with abnormally high energy or force. Based on professional knowledge and experience, screen out unreasonable configurations and consider deleting them from the training set to avoid affecting the training effect.
[0049] Specifically, the average atomic energy of the screened data set is accurately calculated. The Boltzmann energy distribution principle is applied to quantitatively evaluate the probability of each configuration appearing in the current configuration space. This provides a probabilistic basis for subsequent data set optimization and ensures the statistical representativeness of the samples in the training set.
[0050] Furthermore, based on the predetermined number of sample extractions, the configuration space is divided into detailed regions. Through scientific calculations, the number of configurations to be extracted in each region is determined to achieve uniform distribution and comprehensive coverage of samples.
[0051] Preferably, in each divided area, the farthest point sampling technique is used to reduce the data dimension and extract key features. Subsequently, the farthest point sampling method is used to carefully select the configurations that are farthest apart in the feature space to ensure that the selected samples can fully reflect the diversity of the configuration space. Finally, these selected configurations are defined as the training set, and the remaining configurations are used as the test set to complete the optimization selection of the training set.
[0052] Specifically, in this embodiment, a machine learning potential function for AlN is developed. First, the initial configuration is obtained by ab initio molecular dynamics, stretching and compression simulation, etc., and then these configurations are accurately calculated using high-precision ab initio molecular dynamics to obtain information such as energy, force, and potential, and the information is summarized in one file. Taking the two configurations of AlN-wz and AlN-rs as examples, ab initio molecular dynamics simulation calculations were performed, and the initial configurations were perturbed and scaled by scripts to construct a preliminary machine learning potential function. Subsequently, the potential energy was used for molecular dynamics simulations, and tensile strain and other simulations were performed on the two configurations to obtain a large number of configurations, and then high-precision single-point energy calculations were performed by VASP to establish a configuration database.
[0053] Optionally, after determining the quantity, the configurations in the database need to be divided into regions according to the average energy of the atoms. The probability of the configuration in each region is obtained by summing the probabilities of each atom in the region, which will be used as the probability of sampling in this interval. Based on the required number of configurations, the number of configurations that should be sampled in each energy interval is calculated.
[0054] Specifically, in the configuration interval that needs to be sampled, the farthest point sampling technique is applied to analyze the Cartesian distance descriptor distance between configurations, and the farthest point sampling is performed to select several configurations with the farthest distance. This process is applied to all divided configuration spaces, and the selected configurations are summarized into the training set, and the unselected configurations are placed in the test set. The screening results can be found in Figure 4 (a) and Figure 4 (b). Figure 4 (a) is the distribution statistics of the selected configurations of AlN-wz in the total configuration space, where the abscissa is the average energy of each atom and the ordinate is the frequency; Figure 4 (b) is a statistical diagram of the distribution of the selected configurations of AlN-rs in the total configuration space, where the horizontal axis is the average energy of each atom and the vertical axis is the frequency.
[0055] Specifically, the final machine learning standpoint developed using the optimized training set of this example is used as the force field for the molecular dynamics simulation of AlN, and calculations show that:
[0056] First, using the method of this embodiment to divide the database can achieve a more scientific data set division. For neural fitting, a more scientific data distribution is important. Using traditional manual training set screening, or just selecting a single configuration with greater differences, will cause the fitting results to deviate to a more unreliable direction, such as Figure 5 As shown. Using a straight line to fit the data, it can be seen that if the data at both ends of the straight line are evenly distributed, the most suitable straight line can be fitted, but if there are more data on one side, the fitted straight line will be offset downward. In the simulation of the nanoscale, a slight deviation of the force will have serious consequences. If the data is manually selected in the calculation of molecular dynamics from the beginning, the above situation is inevitable. Using this embodiment will make the sampling of the data set closer to the natural rules.
[0057] Second, after multiple rounds of stretching, perturbation, adding strain and other means to enrich the data set, the amount of data may be very large. After various manual screening, the data set will become very complex while being rich, which may seriously slow down the speed of researchers developing machine learning potential functions. However, using this method, there is no need to manually divide the training set too much. You only need to put the data obtained by various methods into a database and directly use this method to screen it, which will greatly improve the speed of developers.
[0058] Third, this method can improve the accuracy and breadth of training machine learning potential functions. Figure 6 (a) to Figure 6 (d) Figure 6A schematic diagram showing the comparison of the losses of the training set constructed by different methods provided in the embodiments of the present invention. Figure 6 (a) is a comparison chart of the total loss function, where the horizontal axis is the number of iterations and the vertical axis is the loss; Figure 6 (b) is a comparison diagram of the RMS error of the energy of the training set and the test set of the three methods, where the horizontal axis is the iteration number and the vertical axis is the RMS error of the energy; Figure 6 (c) is a comparison chart of the root mean square error of force between the training set and the test set of the three methods, where the horizontal axis is the iteration number and the vertical axis is the root mean square error of force; Figure 6 (d) is a comparison chart of the root mean square error of the potential of the training set and the test set of the three methods, where the horizontal axis is the iteration number and the vertical axis is the root mean square error of the potential. The accuracy of the machine learning potential function trained by this method and other methods is compared. The other methods are: first: no distinction between training set and test set, the training set and test set are the same; second: use the farthest point sampling technology, and perform farthest point sampling together to obtain the training set. It can be seen that the total loss of this method is significantly reduced compared with the other two methods. In terms of energy, both the test set and the training set are at the highest accuracy. Although the method that uses the farthest point sampling technology completely has a smaller error in the energy of the test set, this is because it puts the data that is difficult to fit into the training set, and its fitting of the training set data is not good. The same is true for the fitting of force. The machine learning potential function trained entirely using the farthest point sampling technology does not fit the training set well, but the fitting using this method has high accuracy for both the training set and the test set.
[0059] Fourth, the properties of AlN-wz and AlN-rs were calculated using the machine learning potential function fitted by this method. Figure 7 As shown in the figure (where the horizontal axis is the average volume of atoms and the vertical axis is the average energy of atoms), the relationship between energy and volume is calculated by molecular dynamics simulation and ab initio molecular dynamics calculation for the two configurations respectively. It can be seen that the results calculated by the machine learning potential function fit very well with the results calculated by DFT.
[0060] Fifth, the machine learning potential function fitted after constructing the training set using this method has a good description of the phase transition, such as Figure 8 As shown, it shows the transition between AlN-rs and AlN-wz very well. It can be seen that the machine learning potential function constructed in the example can be used to describe the phase transition very well. The dark part represents the atoms of the AlN-rs structure, and the light-colored atoms that appear after stretching represent the atoms of the AlN-wz structure.
[0061] Furthermore, the method of this embodiment improves the accuracy of machine learning potential function training by scientifically screening the database, and shows significant advantages and application potential compared to traditional manual screening.
[0062] The beneficial effects of the present invention are as follows:
[0063] The present invention solves the problem of poor effect of traditional data sampling technology by integrating Boltzmann energy distribution theory and farthest point sampling technology, realizes automatic identification and extraction of the most representative and information-rich subsets in the data set, and improves the speed and reliability of data acquisition.
[0064] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0065] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A method for optimizing a machine learning potential function training set, characterized in that: include: Construct machine learning potential functions; Performing molecular dynamics simulation using the machine learning potential function to obtain an original database; Using first principle software to perform single point energy calculation on the original database to obtain configuration data; Performing target parameter analysis and data elimination on the configuration data to obtain preprocessed data; The target parameter analysis includes: energy analysis, force analysis and potential force distribution analysis; Performing atomic average energy calculation on the preprocessed data to obtain atomic average energy data; Using Boltzmann energy distribution to perform probability distribution calculation on the atomic average energy data to obtain probability distribution data; Determine the overall configuration sampling quantity according to the probability distribution data; Dividing the atomic average energy data into intervals to obtain a plurality of energy intervals, and performing configuration calculation on the atomic average energy data in each energy interval according to the probability distribution data and the overall configuration sampling number to obtain the configuration sampling number in the interval; The configurations in different energy intervals are marked according to the number of configuration samples in the intervals, and the Cartesian distance descriptors of the configurations in different energy intervals are calculated using the farthest point sampling technique to obtain difference data; According to the difference data, the farthest point sampling method is used to select the configuration with the largest Cartesian distance descriptor distance in each energy interval to obtain a training set, and the configurations in each energy interval except the training set are integrated into a test set.
2. A method for optimizing a machine learning potential function training set according to claim 1, characterized in that: The calculation formula of the probability distribution data is: in, Wherein, P(E) is the probability distribution data; E is the average particle energy of the atomic average energy data; k is the Boltzmann constant; T is the temperature; Z is the partition function; E i is the average particle energy in the i-th energy interval.
3. The method for optimizing a machine learning potential function training set according to claim 1, characterized in that: The construction techniques of the machine learning potential function include: ab initio molecular dynamics, stretching and compression simulation, and density functional theory single point energy calculation method.
Citation Information
Patent Citations
Machine learning potential energy surface model construction method
CN117273169A
Computer-aided neural network force field training routines for molecular dynamics computer simulations
DE102022210046A1
Neural network-based molecular structure and chemical reaction energy function building method
WO2019210524A1
Denoising diffusion model for coarse-grained molecular dynamics
WO2024158519A1