Crystal structure condition generation method combining large model and diffusion model
By combining large models and diffusion models, a multi-conditional crystal structure generation framework is constructed, which solves the problem of insufficient robustness and generalization capabilities of crystal structure generation methods in the existing technology, and achieves more efficient and accurate crystal structure generation, which promotes the development of materials science and industrial applications.
Patent Information
- Application Number
- CN202510252718.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-05
- Publication Date
- 2025-08-01
AI Technical Summary
The existing crystal structure generation methods have problems such as poor robustness and weak generalization ability in terms of controllable conditions, which makes it difficult to achieve an ideal state for the generation effect.
Combining the large model and diffusion model, a crystal structure is generated by constructing the crystal structure, preprocessing the data, fine-tuning the large model, constructing a multi-conditional crystal structure diffusion model, and cascade the large model and diffusion model to generate a crystal structure that meets the input constraints.
It significantly improves the accuracy and efficiency of crystal structure generation, shortens the R&D cycle, improves the prediction accuracy, and provides efficient and reliable materials science and industrial application tools.
Smart Images

Figure CN120412828A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of crystal structure condition generation, and particularly relates to a crystal structure condition generation method combining a large model and a diffusion model. Background Art
[0002] With the construction of open-source material databases such as Materials Project and Inorganic Crystal Structure Database (ICSD), and the publication of open-source material datasets such as Alexandira and OMat24, data-driven deep learning technologies are profoundly changing the research pattern of crystal structure generation. Models such as CrystalGAN based on generative adversarial networks, CrystalFormer using attention mechanisms, and DiffCSP++ based on diffusion models are gradually breaking through the limitations of traditional methods in exploring the configuration space. It is worth noting that among the above series of methods, the diffusion model shows unique advantages in maintaining the diversity of crystal phases and the rationality of structures by constructing a progressive denoising process.
[0003] However, current crystal structure generation research still faces a major technical challenge of conditional controllable generation: currently, there are still limited methods that can accurately generate the expected crystal structure according to input conditions. If the technical barriers of crystal structure condition generation can be broken through, it is expected to shorten the R & D cycle by more than 50% and improve the prediction accuracy by more than 10%, thus saving a large amount of R & D costs. Summary of the Invention
[0004] Therefore, the present invention provides a crystal structure condition generation method combining a large model and a diffusion model to solve the problems of poor robustness and weak generalization ability existing in the existing crystal structure condition generation methods, which further leads to the generation effect being difficult to reach the ideal state. By combining the advantages of the large model and the diffusion model, the present invention proposes an innovative crystal structure generation scheme, which can effectively improve the accuracy and reliability of crystal structure generation.
[0005] To achieve the above object, the present invention adopts the following technical solutions, which specifically include the following steps:
[0006] Step S1, constructing a crystal structure generation dataset: collecting an open-source crystal structure dataset as the crystal structure generation dataset, and screening according to the number of atoms and stability index of the crystal structure to obtain a million-level crystal structure generation training CSV dataset;
[0007] Step S2, Preprocessing of the crystal structure generation dataset: Extract crystal structures, crystal symmetries, and crystal material property information from the crystal structure generation training dataset. After combining with the designed prompt templates, generate a JSON-format dataset required for fine-tuning the symmetry large model.
[0008] Step S3, Fine-tuning the crystal symmetry prediction large model using the Llama-Factory framework: Based on the JSON-format dataset in Step S2, use the Llama-Factory architecture to fine-tune the mainstream large language models Qwen2.5-7B, Llama-3.1-8B, DeepSeek-R1-Distill-Llama-8B, and GLM-4-9B models respectively. After comparing the results, obtain the optimal crystal symmetry prediction large model.
[0009] Step S4, Constructing a multi-condition crystal structure diffusion model: Design a crystal structure generation strategy based on multiple constraint conditions. According to the designed multiple condition constraints and crystal structure generation methods, construct a multi-condition crystal structure diffusion model.
[0010] Step S5, Training the multi-condition crystal structure diffusion model: Based on the CSV-format crystal structure generation training dataset constructed in Step S1, train the multi-condition crystal structure diffusion model constructed in Step S4.
[0011] Step S6, Cascade the crystal symmetry prediction large model described in Step S3 and the multi-condition crystal structure diffusion model described in Step S5 to construct a crystal structure conditional generation framework based on multi-condition constraints.
[0012] Step S7, Crystal structure generation: According to the input constraint conditions, select the corresponding multi-condition crystal structure diffusion model weights in Step S5. Through the crystal structure conditional generation framework described in Step S6, output the crystal structure in CIF format that meets the input constraint requirements.
[0013] Step S8, Model verification: Use Quantum Espresso software to verify the performance of the crystal structure generated in Step S7, and accordingly judge the accuracy of the crystal structure conditional generation.
[0014] As a preferred embodiment of the crystal structure conditional generation method combining a large model and a diffusion model according to the present invention, in step S1 specifically includes: collecting original crystal structure data from the open-source Materials Project, ICSD crystal database, and Alexandira and Omat24 open-source datasets, and using the pymatgen library through Python scripts to save the CIF files, symmetry information, and material properties of the obtained crystal structures. Then, according to the number of atoms and stability indicators of the crystal structures, the crystal structure generation dataset is screened to obtain a million-level crystal structure generation training dataset, which is saved as a CSV format file.
[0015] As a preferred embodiment of the crystal structure conditional generation method combining a large model and a diffusion model according to the present invention, in step S2 specifically includes: extracting the crystal structure CIF format, crystal symmetry information, and crystal material property information from the crystal structure generation training dataset, where the crystal symmetry information includes the space group and Wyckoff positions, and the crystal material property information includes the band gap, formation energy, and material modulus; and after combining with the designed prompt template, it is saved as a JSON format dataset required for fine-tuning the crystal symmetry prediction large model; it should be noted that the above preprocessing steps are for the fine-tuning task of the crystal symmetry prediction large model; for the multi-condition crystal structure diffusion model training task, directly use the CSV format crystal structure generation training dataset in step S1 without special processing.
[0016] As a preferred embodiment of the crystal structure conditional generation method combining a large model and a diffusion model according to the present invention, in step S3 specifically includes: fine-tuning different base large models based on the crystal structure generation dataset, and using the current mainstream large models Qwen2.5-7B, Llama-3.1-8B, DeepSeek-R1-Distill-Llama-8B, GLM-4-9B as the base of the crystal symmetry prediction large model. Then, compare the prediction performances of Top-1, Top-3, and Top-5 after fine-tuning different large models, and select the one with the highest prediction accuracy of the space group and Wyckoff positions as the crystal symmetry prediction large model. This model can generate crystal symmetry through chemical formulas and material properties, providing symmetry constraint conditions for subsequent crystal structure generation.
[0017] As a preferred embodiment of the crystal structure conditional generation method combining a large model and a diffusion model according to the present invention, in step S4 specifically includes: The conditional constraint situations of the multi-conditional crystal structure diffusion model include: unconditional, chemical formula constraint, chemical formula + target property constraint, chemical formula + crystal symmetry constraint, chemical formula + crystal symmetry + target property constraint; In the process of constructing the multi-conditional crystal structure diffusion model, modules for chemical formula, crystal symmetry, and target property constraints are first constructed. The chemical formula constraint fixes the atomic type through one-hot encoding and fixes the number of atoms through Wyckoff letters; The symmetry constraint constrains the lattice parameters through the symmetry basis matrix and constrains the atomic coordinates through the Wyckoff positions; The target property constraint embeds the property values through Gaussian basis expansion and multi-layer perceptron. After the model analyzes the input conditional constraint combination, it enters the diffusion model for the noise addition and denoising processes.
[0018] As a preferred embodiment of the crystal structure conditional generation method combining a large model and a diffusion model according to the present invention, in step S5 specifically includes: Training the multi-conditional crystal structure diffusion model based on the crystal structure generation training dataset in CSV format. To ensure the prediction accuracy of the multi-conditional crystal structure diffusion model, for the following 5 constraint situations: unconditional, chemical formula constraint, chemical formula + target property constraint, chemical formula + crystal symmetry constraint, chemical formula + crystal symmetry + target property constraint, the optimal weights of the multi-conditional crystal structure diffusion model for each constraint situation are saved separately.
[0019] As a preferred embodiment of the crystal structure conditional generation method combining a large model and a diffusion model according to the present invention, in step S6 specifically includes: When crystal symmetry constraints are required in the input conditions but the space group or Wyckoff positions are not input, the crystal symmetry prediction large model and the multi-conditional crystal structure diffusion model need to be cascaded; At this time, the crystal symmetry prediction large model serves as a pre-module to provide space group and Wyckoff position constraint information for the multi-conditional crystal structure diffusion model.
[0020] As a preferred embodiment of the crystal structure conditional generation method combining a large model and a diffusion model according to the present invention, in step S7 specifically includes: If there is no unconditional constraint, the model will generate a crystal structure CIF file containing random element types, random lattice matrices, and random atomic positions; If eligible constraints are included, the model will select the weights of the multi-conditional crystal structure diffusion model corresponding to the constraint conditions, and during the crystal structure generation process, the multi-conditional crystal structure diffusion model will simultaneously generate lattice matrices, atomic coordinates, and generate a crystal structure CIF file that meets the constraint conditions according to the preset atoms.
[0021] As a preferred solution of a crystal structure conditional generation method combining a large model and a diffusion model according to the present invention, in step S7, during the generation process of the crystal structure based on conditions, different crystal structure generation strategies are adopted for different conditional constraint situations, including the following 5 cases:
[0022] When there are no constraint conditions, a randomly generated crystal structure in CIF format is output;
[0023] When there is only a chemical formula constraint, the weights of the multi-condition crystal structure diffusion model trained only with the chemical formula constraint are selected, and a crystal structure in CIF format that meets the requirements of the chemical formula is output;
[0024] When there are chemical formula and target material property constraints, according to the chemical formula and target material properties, the space group is predicted by using the large model of crystal symmetry prediction, and then according to the chemical formula, target properties and the predicted space group, the Wyckoff position corresponding to each atom is predicted by using the large model of crystal symmetry prediction. The weights of the multi-condition crystal structure diffusion model trained with chemical formula, crystal symmetry and target material property constraints are selected, and a crystal structure in CIF format that meets the requirements of chemical formula, crystal symmetry and target material properties is output;
[0025] When there are chemical formula and crystal symmetry constraints, first judge whether the space group and Wyckoff position are consistent. If the symmetry input is incorrect, it is necessary to re-enter or use the large model of crystal symmetry prediction to predict the required Wyckoff position according to the chemical formula and space group, and then select the weights of the multi-condition crystal structure diffusion model trained with chemical formula and crystal symmetry constraints, and output a crystal structure in CIF format that meets the requirements of chemical formula and crystal symmetry;
[0026] When there are chemical formula, crystal symmetry and target material property constraints, maintain the consistency of the space group and Wyckoff position according to the above method, select the weights of the multi-condition crystal structure diffusion model trained with chemical formula, crystal symmetry and target material property constraints, and output a crystal structure in CIF format that meets the requirements of chemical formula, crystal symmetry and target material properties.
[0027] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0028] Traditional crystal structure generation methods usually rely on complex physical simulations or exhaustive searches, which have high computational costs and low efficiency, and it is difficult to find the optimal solution in a high-dimensional search space. In contrast, the present invention combines the powerful feature extraction ability of large models and the generation optimization ability of diffusion models, not only significantly improving the generation efficiency, but also being able to generate richer and more reasonable crystal structures. The method of the present invention can not only accelerate the design and development of new materials, but also provide an efficient and reliable tool for materials science and industrial applications, promoting the innovative development of crystal structure generation technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. The drawings described herein are used to provide a further understanding of this specification and form a part of this specification. The illustrative embodiments of this specification and their descriptions are used to explain this specification and do not constitute an improper limitation of this specification. In the drawings:
[0030] Figure 1 is a schematic diagram of the framework structure of a crystal structure conditional generation method that combines a large model and a diffusion model provided by an embodiment of the present application;
[0031] Figure 2 is a schematic diagram of the crystal symmetry prediction prompt template of a crystal structure conditional generation method that combines a large model and a diffusion model provided by an embodiment of the present application;
[0032] Figure 3 is a schematic diagram of the inference process of a crystal structure conditional generation method that combines a large model and a diffusion model provided by an embodiment of the present application;
[0033] Figure 4 is a schematic diagram of the input and output of a crystal structure conditional generation method that combines a large model and a diffusion model provided by an embodiment of the present application; DETAILED DESCRIPTION OF THE EMBODIMENTS
[0034] To make the objectives, technical solutions, and innovation of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this specification without creative efforts shall fall within the scope of protection of this specification.
[0035] Embodiment 1: Refer to Figure 1 As shown, this embodiment provides a crystal material property prediction method based on multimodal joint learning, including:
[0036] Step S1. Construct a crystal structure generation dataset: Collect the original crystal structure data from the open-source Materials Project and ICSD crystal databases, as well as the Alexandira and Omat24 open-source datasets. Use a Python script with the pymatgen library to save the CIF files, symmetry information, and material properties of the obtained crystal structures. Next, filter the crystal structure generation dataset according to the number of atoms in the crystal structure (less than 20) and the stability index (atomic energy less than 0.1) to obtain a training dataset of millions of crystal structures for generation, and save it as a CSV format file.
[0037] Step S2. Preprocess the crystal structure generation dataset: For the fine-tuning task of the large model for crystal symmetry prediction, preprocess the crystal structure generation dataset described in Step S1, extract the crystal structure in CIF format, crystal symmetry information (space group and Wyckoff positions), and crystal material properties. After combining with the prompt template as Figure 2 shown, save it as a JSON format dataset required for fine-tuning the large model for crystal symmetry prediction; it should be noted that for the training of the multi-condition crystal structure diffusion model, directly use the CSV format crystal structure generation training dataset constructed in Step S1.
[0038] Step S3. Fine-tune the large model for crystal symmetry prediction using the Llama-Factory framework: The base of the large model for crystal symmetry prediction uses the current mainstream large models Qwen2.5-7B, Llama-3.1-8B, DeepSeek-R1-Distill-Llama-8B, GLM-4-9B. Use the JSON format crystal structure generation dataset described in Step S2 to perform Lora fine-tuning on the above different base large models respectively. Among them, the objects of Lora fine-tuning are the Q, K, and V layers in the attention mechanism. The initial learning rate for fine-tuning is 0.001, the learning rate decay strategy uses cosine annealing, the warm-up ratio is 0.1, the batch size is 16, the number of fine-tuning batches is 25 rounds, and the fine-tuning precision is FP32. After fine-tuning, compare the Top-1, Top-3, and Top-5 prediction performances of the above fine-tuned models, and select the one with the highest prediction accuracy for the space group and Wyckoff positions as the large model for crystal symmetry prediction, providing symmetry constraint conditions for subsequent crystal structure generation. The large model for crystal symmetry prediction is used to predict the space group and Wyckoff positions, and the application scenarios include: (1) Predict the Wyckoff positions based on the known chemical formula and space group; (2) Given the chemical formula and the target material properties, predict the space group and atomic Wyckoff positions of the crystal.
[0039] Step S4: Construct a multi - condition crystal structure diffusion model. The conditional constraints of the multi - condition crystal structure diffusion model include: unconditional, chemical formula constraint, chemical formula + target property constraint, chemical formula + crystal symmetry constraint, chemical formula + crystal symmetry + target property constraint. During the construction of the multi - condition crystal structure diffusion model, first, modules for chemical formula, crystal symmetry, and target property constraints are constructed to parse the input conditional constraint combinations, and then the denoising process is carried out in the diffusion model after adding noise.
[0040] Specifically, during the unconditional generation process, since the atomic type needs to be consistent with the Wyckoff position, when the atomic type A of the generated crystal structure is undetermined, the standard DDPM - based method is used to diffusively generate the atomic attribute A′ of the Wyckoff position, where The forward noise - adding process of the atomic type is as follows: The reverse denoising process is as follows:
[0041]
[0042] where is predicted by the denoising model The objective function for model training is:
[0043]
[0044] Specifically, during the diffusion generation process of the lattice matrix, the lattice matrix L can be uniquely represented by an O(3) - invariant coefficient vector k. Therefore, the diffusion process of the lattice matrix is the diffusion process of k, and the forward noise - adding process for the time step t is:
[0045] where and β t ∈(0,1) determine the variance of each diffusion step, which is controlled by the cosine scheduler. For the random prior The reverse denoising process is:
[0046]
[0047] where is predicted by the denoising model predicted.
[0048] Table 1 Constraints of crystal space groups on lattices and symmetry bases
[0049]
[0050] The space group in crystal symmetry imposes constraints on lattice angles and lattice lengths, as shown in the above table. When the input conditions include the space group, in order to restrict the generated crystal structure under the desired space group, a symmetry basis is considered to represent the lattice matrix. Each symmetry matrix can be expanded through the following symmetry basis, that is, for such that The prediction of the lattice matrix is converted into the prediction of the symmetry basis coefficients with 6 degrees of freedom in the above way.
[0051]
[0052] Specifically, first, k is diffused and generated without constraints, and then the predicted values in part of k are covered according to the constraints of the space group. To optimize the denoising term First, a random sample is taken for , and then k t is reparameterized as where the mask is given by m ∈ {0, 1} 6 , m i = 1 indicates that the i-th symmetry basis is unconstrained, ⊙ represents element-wise multiplication, and the final calculation of the target k is:
[0053] Specifically, during the atomic coordinate diffusion generation process, the fractional coordinates of N atoms in the unit cell can be represented as the fractional coordinates of N' Wyckoff positions. The forward noise addition process of F' is carried out through a wrapped normal distribution to maintain its periodic translational invariance: The forward sampling process of F' is where ω(·) retains the fractional part of the input. For the reverse denoising process, first, the initial value F' uniformly noise-added by forward sampling is obtained T , and then the sampling value F'0 is obtained through the denoising term output by the denoising model and the prediction-correction sampler. When the input conditions include the Wyckoff positions in the symmetry, the Wyckoff positions of the atoms are determined. At this time, the atomic coordinates do not always have 3 degrees of freedom. They may be located on specific planes, axes, or even fixed points, and the corresponding transformation matrix can be singular. Therefore, the noise term ∈ F′ is projected onto the constraint subspace by the least squares method: where is 's pseudo-inverse matrix. The training objective function of F' is: where is the pre-computed weight, and q' is the projected distribution of q.
[0054] In summary, the overall joint objective function of the model is as follows:
[0055] Specifically, the denoising model aims to predict the denoising term from the noisy parameters according to the conditions input to the model, such as chemical formula, symmetry, target performance, etc. and
[0056] . For the target performance, we expand the continuous performance values using Gaussian basis functions and embed them with a multi-layer perceptron MLP.
[0057]
[0058] where p is the target performance value, p min and p max are the minimum and maximum values of the target attribute in the dataset respectively, and σ is the interval space during expansion. Subsequently, we obtain the input node features by fusing the embedded atomic features f atom (A) and the sinusoidal time feature f time (t). where is a linear layer in the neural network, and the structure of the model encoder is designed as follows:
[0059]
[0060] where is a multi-layer perceptron, is a multi-head cross-attention layer, ψ FT : (-1, 1) 3 → [-1, 1] 3×K is the K-base Fourier transform for periodic embedding of the relative fractional coordinates f j - f i .
[0061] Step S5: Train the multi - conditional crystal structure diffusion model: Use the crystal structure generation training dataset constructed in Step S1 to train the multi - conditional crystal structure diffusion model constructed in Step S4. The crystal structure generation training dataset is divided into a training set, a validation set, and a test set in the ratio of 8:1:1. In terms of model hyperparameters, the model has a total of 6 iterative layers, where the dimension of the hidden layer is 512, the dimension of the Fourier embedding is 128, and the dimension of the atomic feature and property embedding is 256. The properties included in the embedding can be single or multiple of band gap, formation energy, and modulus. In terms of training hyperparameters, the number of training epochs of the model is 1500, the optimizer is Adam, the initial learning rate is 0.001, the learning rate decay strategy is ReduceLROnPlateau, the patience value is 30, the learning rate decay factor is 0.6, the minimum learning rate is 0.0001, and the data batch size is 256. After training, select multiple model weights with better performance on the validation set and conduct inference tests on the test set. Compare the matching rate and root - mean - square error of the crystal structure generation through the Structure Matcher library in Pymatgen to obtain the model weights with the best performance, where the matching rate comparison parameter stol is set to 0.5, angle tol is set to 10, and Itol is set to 0.3. To ensure the prediction accuracy of the multi - conditional crystal structure diffusion model, for different conditional constraint situations, separately save the optimal multi - conditional crystal structure diffusion model weights for each constraint situation.
[0062] Step S6: Cascade the crystal symmetry prediction large model and the multi - conditional crystal structure diffusion model: When crystal symmetry constraints are required in the input conditions but the space group or Wyckoff positions are missing in the input, it is necessary to cascade the crystal symmetry prediction large model and the multi - conditional crystal structure diffusion model. At this time, the crystal symmetry prediction large model serves as a pre - condition to provide space group and Wyckoff position constraint information for the multi - conditional crystal structure diffusion model.
[0063] Step S7: Generate crystal structures based on multi - conditional constraints: If there are no conditional constraints, the model will generate a crystal structure CIF file containing random element types, random lattice matrices, and random atomic positions. If there are conditional constraints that meet the conditions, the model will select the multi - conditional crystal structure diffusion model weights corresponding to the constraint conditions. And during the crystal structure generation process, the multi - conditional crystal structure diffusion model will simultaneously generate the lattice matrix, atomic coordinates, and atomic types, and accordingly generate a crystal structure in CIF format that meets the constraint conditions.
[0064] Specifically, during the generation process of conditional - based crystal structures, different crystal structure generation strategies are adopted for different conditional constraint situations, including the following 5 situations:
[0065] When there are no constraints, a randomly generated crystal structure in CIF format is output;
[0066] When there is only a chemical formula constraint, select the weights of the multi-constraint crystal structure diffusion model trained only with the chemical formula, and output the crystal structure in CIF format that meets the requirements of the chemical formula;
[0067] When there are chemical formula and target material property constraints, according to the chemical formula and target material properties, use the large crystal symmetry prediction model to predict the space group, and then according to the chemical formula, target properties and the predicted space group, use the large crystal symmetry prediction model to predict the Wyckoff position of each atom. Select the weights of the multi-constraint crystal structure diffusion model trained with chemical formula, crystal symmetry and target material properties, and output the crystal structure in CIF format that meets the requirements of chemical formula, crystal symmetry and target material properties;
[0068] When there are chemical formula and crystal symmetry constraints, first judge whether the space group and Wyckoff position are consistent. If the symmetry input is incorrect, it is necessary to re-enter or use the large crystal symmetry prediction model to predict the required Wyckoff position according to the chemical formula and space group. Then select the weights of the multi-constraint crystal structure diffusion model trained with chemical formula and crystal symmetry, and output the crystal structure in CIF format that meets the requirements of chemical formula and crystal symmetry;
[0069] When there are chemical formula, crystal symmetry and target material property constraints, maintain the consistency of the space group and Wyckoff position according to the above method, select the weights of the multi-constraint crystal structure diffusion model trained with chemical formula, crystal symmetry and target material properties, and output the crystal structure in CIF format that meets the requirements of chemical formula, crystal symmetry and target material properties.
[0070] Step S8: Verify the performance of the crystal structure using the Quantum Espresso software: Use the Quantum Espresso software to verify the performance of the crystal structure generated in step S7, and judge the accuracy of the crystal structure conditional generation accordingly.
[0071] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for generating crystal structures conditioned on a combined large model and a diffusion model, characterized in that, The method includes: Step S1, constructing a crystal structure generation dataset: Collecting open-source crystal structure datasets as crystal structure generation datasets, and screening them according to the number of atoms and stability indicators of the crystal structures to obtain a million-level crystal structure generation training CSV dataset; Step S2, preprocessing the crystal structure generation dataset: Extracting crystal structures, crystal symmetries, and crystal material property information from the crystal structure generation training dataset, and generating a JSON-format dataset required for fine-tuning the symmetry large model after combining with the designed prompt templates; Step S3, fine-tuning the crystal symmetry prediction large model using the Llama-Factory framework: Based on the JSON-format dataset in Step S2, using the Llama-Factory architecture to fine-tune the mainstream large language models Qwen2.5-7B, Llama-3.1-8B, DeepSeek-R1-Distill-Llama-8B, and GLM-4-9B models respectively, and obtaining the optimal crystal symmetry prediction large model after comparing the results; Step S4, constructing a multi-condition crystal structure diffusion model: Designing a crystal structure generation strategy based on multiple constraint conditions, and constructing a multi-condition crystal structure diffusion model according to the designed multiple condition constraints and crystal structure generation methods; Step S5, training the multi-condition crystal structure diffusion model: Training the multi-condition crystal structure diffusion model constructed in Step S4 based on the CSV-format crystal structure generation training dataset constructed in Step S1; Step S6, cascading the crystal symmetry prediction large model described in Step S3 and the multi-condition crystal structure diffusion model described in Step S5 to construct a crystal structure conditional generation framework based on multi-condition constraints; Step S7, crystal structure generation: According to the input constraint conditions, selecting the corresponding multi-condition crystal structure diffusion model weights in Step S5, and outputting the crystal structure in CIF format that meets the input constraint requirements through the crystal structure conditional generation framework in Step S6; Step S8, model verification: Using Quantum Espresso software to verify the performance of the crystal structure in Step S7, and judging the accuracy of crystal structure conditional generation accordingly.
2. The method for generating crystal structure conditions by combining a large model and a diffusion model according to claim 1, characterized in that In the said Step S1, collecting the original crystal structure data from the open-source Materials Project and ICSD crystal databases and the Alexandira and Omat24 open-source datasets, and using the pymatgen library through Python scripts to save the CIF files, symmetry information, and material properties of the obtained crystal structures; then screening the crystal structure generation dataset according to the number of atoms and stability indicators of the crystal structures to obtain a million-level crystal structure generation training dataset, and saving it as a CSV-format file.
3. The method for generating crystal structure conditions by combining a large model and a diffusion model according to claim 2, wherein, In step S2, the crystal structure CIF format, crystal symmetry information, and crystal material property information are extracted from the training dataset generated from the crystal structure. The crystal symmetry information includes the space group and Wyckoff positions, and the crystal material property information includes the bandgap, formation energy, and material modulus. After combining with the designed prompt template, it is saved as a JSON format dataset required for fine-tuning the crystal symmetry prediction large model.
4. The method for generating crystal structure conditions by combining a large model and a diffusion model according to claim 3, wherein, In step S3, different base large models are fine-tuned based on the dataset generated from the crystal structure. The bases of the crystal symmetry prediction large model adopt the current mainstream large models Qwen2.5-7B, Llama-3.1-8B, DeepSeek-R1-Distill-Llama-8B, and GLM-4-9B. Then, the prediction performances of Top-1, Top-3, and Top-5 after fine-tuning of different large models are compared, and the one with the highest prediction accuracy for the space group and Wyckoff positions is selected as the crystal symmetry prediction large model. This model can generate crystal symmetry through chemical formulas and material properties, providing symmetry constraint conditions for subsequent crystal structure generation.
5. The method for generating crystal structure conditions by combining a large model and a diffusion model according to claim 4, wherein In step S4, the conditional constraint situations of the multi-conditional crystal structure diffusion model include: unconditional, chemical formula constraint, chemical formula + target property constraint, chemical formula + crystal symmetry constraint, chemical formula + crystal symmetry + target property constraint. During the construction of the multi-conditional crystal structure diffusion model, first, the chemical formula, crystal symmetry, and target property constraint modules are constructed. The chemical formula constraint fixes the atomic type through one-hot encoding and fixes the atomic number through Wyckoff letters. The symmetry constraint constrains the lattice parameters through the symmetry basis matrix and constrains the atomic coordinates through Wyckoff positions. The target property constraint embeds the performance value through Gaussian basis expansion and multi-layer perceptron. After the model parses the input conditional constraint combination, it enters the diffusion model for the noise addition and denoising process.
6. The method for generating crystal structure conditions by combining a large model and a diffusion model according to claim 5, wherein In step S5, the multi-conditional crystal structure diffusion model is trained based on the training dataset for crystal structure generation in CSV format. To ensure the prediction accuracy of the multi-conditional crystal structure diffusion model, for the following 5 constraint situations: unconditional, chemical formula constraint, chemical formula + crystal symmetry constraint, chemical formula + target property constraint, chemical formula + crystal symmetry + target property constraint, the optimal weights of the multi-conditional crystal structure diffusion model for each constraint situation are saved separately.
7. The method for generating crystal structure conditions by combining a large model and a diffusion model according to claim 6, wherein, In step S6, when crystal symmetry constraints are required in the input conditions but the space group or Wyckoff positions are not input, the crystal symmetry prediction large model and the multi-conditional crystal structure diffusion model need to be cascaded. At this time, the crystal symmetry prediction large model serves as a pre-module to provide space group and Wyckoff position constraint information for the multi-conditional crystal structure diffusion model.
8. A method for generating crystal structure conditions by combining a large model and a diffusion model according to claim 7, characterized in that, In step S7, if there are no conditional constraints, the model will generate a crystal structure CIF file containing random element types, random lattice matrices, and random atomic positions; if there are conditional constraints that meet the conditions, the model will select the weights of the multi-conditional crystal structure diffusion model corresponding to the conditional constraints, and during the crystal structure generation process, the multi-conditional crystal structure diffusion model will simultaneously generate the lattice matrix and atomic coordinates, and generate a crystal structure CIF file that meets the conditional constraints according to the preset atoms.
9. The method for generating crystal structure conditions by combining a large model and a diffusion model according to claim 8, characterized in that, In step S7, during the generation of the crystal structure based on conditions, different conditional constraint situations adopt different crystal structure generation strategies, including the following five situations: When there are no conditional constraints, output a randomly generated crystal structure in CIF format; When there is only a chemical formula constraint, select the weights of the multi-conditional crystal structure diffusion model trained only with the chemical formula constraint, and output a crystal structure CIF format that meets the chemical formula requirements; When there are chemical formula and target material property constraints, according to the chemical formula and target material properties, use the large crystal symmetry prediction model to predict the space group, and then according to the chemical formula, target properties, and predicted space group, use the large crystal symmetry prediction model to predict the Wyckoff position corresponding to each atom, select the weights of the multi-conditional crystal structure diffusion model trained with chemical formula, crystal symmetry, and target material property constraints, and output a crystal structure CIF format that meets the requirements of chemical formula, crystal symmetry, and target material properties; When there are chemical formula and crystal symmetry constraints, first judge whether the space group and Wyckoff position are consistent. If the symmetry input is incorrect, it is necessary to re-enter or use the large crystal symmetry prediction model to predict the Wyckoff position that meets the requirements according to the chemical formula and space group, and then select the weights of the multi-conditional crystal structure diffusion model trained with chemical formula and crystal symmetry constraints, and output a crystal structure CIF format that meets the requirements of chemical formula and crystal symmetry; When there are chemical formula, crystal symmetry, and target material property constraints, maintain the consistency of the space group and Wyckoff position according to the above method, select the weights of the multi-conditional crystal structure diffusion model trained with chemical formula, crystal symmetry, and target material property constraints, and output a crystal structure CIF format that meets the requirements of chemical formula, crystal symmetry, and target material properties.
Citation Information
Cited By
Artificial intelligence grading classification-regression combination prediction method for multi-class materials
CN121171399A