A Prediction Method for Metal Solidification Process
Through the prediction model based on the Transformer network, the problem that traditional methods are difficult to predict the evolution of microstructure during metal solidification is solved, and the dynamic evolution law of microstructure during metal solidification is accurately predicted and the calculation efficiency is improved.
Patent Information
- Application Number
- CN202410195515.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-21
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-02-21
AI Technical Summary
It is difficult for traditional methods to restore the metal solidification process at the fine microscopic level and give accurate predictions of complex morphological evolution rules, especially in heterogeneous polycrystalline structures.
Using a prediction model based on the Transformer network architecture, the encoder and decoder are used to extract features and predict the output of the metal microstructure state, and use the self-attention mechanism to capture important feature information in the time series to achieve microstructure analysis during the metal solidification process. Accurate predictions of evolution.
It achieves accurate prediction of the dynamic evolution of microstructure during the metal solidification process, improves calculation efficiency, and can significantly increase prediction speed while ensuring prediction accuracy.
Smart Images

Figure CN118095071B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of materials engineering, and in particular to a method for predicting a metal solidification process. Background Art
[0002] The solidification process of alloys and the resulting microstructure are important factors that have a decisive influence on their terminal mechanical properties. Over the years, researchers have been trying to study and predict the formation and dynamic evolution of polycrystalline microstructures during the solidification process of alloys through theoretical analysis, physical experiments, and simulation calculations.
[0003] In the process of conceiving and forming the research of this application, the applicant has found at least the following problems: in traditional analysis methods, physical experiments and theoretical calculations are the most commonly used means. However, since metal materials will form complex non-uniform polycrystalline structures during the solidification process, this microscopic non-uniformity makes it quite difficult to systematically reveal the evolution law of the multi-grain microstructure through physical experiments and theoretical calculations. In other words, traditional research methods cannot restore the real solidification process at a subtle microscopic level, and traditional methods cannot give accurate predictions for complex morphological evolution laws. Summary of the invention
[0004] In order to alleviate the above problems, the present application provides a metal solidification process prediction method, comprising:
[0005] Building a prediction model based on the Transformer network architecture, the prediction model includes multiple encoders and decoders, the encoder is used to extract features from the input sequence, and the decoder is used to generate a prediction output based on the encoder;
[0006] Setting the state data of the metal microstructure state as the input sequence of the prediction model, and setting the state data of the next state of the metal microstructure state corresponding to the input sequence as the output sequence of the prediction model;
[0007] Acquire state data of microstructure evolution during metal solidification, and train and verify the prediction model according to the mechanism of Transformer network based on the state data of microstructure evolution;
[0008] The target state data before the time to be predicted is obtained, and the target state data is input into the trained prediction model for prediction.
[0009] Optionally, the encoder includes an input layer, a position encoding layer and a plurality of identical encoding layers; and the process of building a prediction model based on the Transformer network architecture further includes:
[0010] Using the position encoding of sine and cosine functions, a coding vector is obtained corresponding to each input value in the timeline position and embedding dimension;
[0011] Adding the input vector and the encoding vector of the time position one by one to obtain an addition vector, so that the prediction model obtains the position relationship between different time points in the input sequence;
[0012] Passing the addition vector to the encoding layer, configuring multiple attention heads to perform parallel calculations on multiple grains;
[0013] Connect and linearly transform the corresponding multiple outputs of multiple attention heads to obtain the output result of the encoder.
[0014] Optionally, the decoder includes an input layer, multiple decoding layers and an output layer, each decoding layer includes a first self-attention sublayer, an encoding and decoding attention sublayer and a feedforward neural network sublayer; the process of building a prediction model based on the Transformer network architecture also includes:
[0015] The input of the decoder starts from the last data point input by the encoder, and the output result of the encoder is converted into a one-dimensional vector representation result through linear mapping;
[0016] By performing attention calculation on the decoder itself, the dependencies between different timeline positions in the input sequence are captured to generate an intermediate representation result of the decoder;
[0017] Compare the output of the encoder with the intermediate representation result of the decoder, and perform information fusion by calculating attention weights to generate a target sequence;
[0018] Processing the target sequence through linear transformation and activation function so that the prediction model performs nonlinear modeling to generate a decoding layer result;
[0019] The decoding layer result is mapped to the dimension of the target time series through linear mapping.
[0020] Optionally, the decoder also includes a second self-attention sublayer. In the process of building a prediction model based on the Transformer network architecture, the second self-attention sublayer applies a self-attention mechanism to the output of the encoder to extract information from the output result of the encoder.
[0021] Optionally, in the process of building the prediction model based on the Transformer network architecture, the prediction model is made to rely on target state data before the time to be predicted based on forward masking and the offset of the timeline position between the decoder input and the target output in the decoder.
[0022] Optionally, before the step of setting the state data of the metal microstructure state as the input sequence of the prediction model and setting the state data of the next state of the metal microstructure state corresponding to the input sequence as the output sequence of the prediction model, the step includes:
[0023] Based on the characteristics of the metal solidification system, the metal microstructure state at each stage of the metal solidification process is determined.
[0024] Optionally, the process of obtaining the state data of microstructure evolution during metal solidification includes:
[0025] Based on the two-dimensional multiphase field numerical simulation model, the metal solidification process is simulated to generate microstructure evolution data, so as to obtain the corresponding microstructure state data at each time node on the timeline;
[0026] The state data of multiple consecutive time nodes are used as training samples so that the prediction model can obtain the dynamic evolution process of the microstructure.
[0027] Optionally, in the process of taking the state data of multiple consecutive time nodes as training samples so that the prediction model can capture the dynamic evolution process of the microstructure, the training samples are structured to generate time series data consisting of multiple multidimensional descriptors to obtain a training data set, so that the prediction model can obtain the dynamic evolution characteristics of the microstructure.
[0028] Optionally, the process of training the prediction model according to the state data of the microstructure evolution according to the mechanism of the Transformer network includes:
[0029] Divide the training data set into multiple batches, and set the batch order based on the gradient optimization algorithm;
[0030] Extract training samples batch by batch according to the batch order and input them into the prediction model to generate corresponding prediction data for each time node in the sequence according to the Transformer network mechanism;
[0031] The error between the prediction result of the prediction model and the actual result of the training data set is calculated according to the mean square error loss function, and the model parameters are adjusted according to the gradient information of the parameters to gradually reduce the training error.
[0032] Optionally, the process of training the prediction model according to the state data of the microstructure evolution according to the mechanism of the Transformer network also includes:
[0033] If the performance of the prediction model does not improve during the training process, the training is stopped to avoid overfitting of the prediction model.
[0034] Optionally, the process of training the prediction model according to the state data of the microstructure evolution according to the mechanism of the Transformer network also includes:
[0035] Regularization or dropout techniques are used to prevent the prediction model from overfitting during the training process.
[0036] Optionally, the process of verifying the prediction model according to the mechanism of the Transformer network further includes:
[0037] Use a two-dimensional multiphase field model to perform numerical simulations, collect microscopic state data at each time point during the solidification process, and create a validation data set for microstructural evolution;
[0038] Inputting the input sequence of the verification data set into the prediction model for prediction, and obtaining a prediction result;
[0039] Based on the root mean square error, the degree of closeness between the model prediction results and the actual results of the verification data set is measured to determine the performance of the prediction model.
[0040] The present application also provides an electronic device, the electronic device comprising a processor and a memory;
[0041] The memory stores a computer program, and when the computer program is executed by the processor, the steps of the metal solidification process prediction method as described above are implemented.
[0042] The present application also provides a storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the metal solidification process prediction method as described above are implemented.
[0043] The metal solidification process prediction method provided in the present application builds a prediction model based on the Transformer network architecture, sets the state data of the metal microstructure state as the input sequence of the prediction model, and sets the state data of the next state of the metal microstructure state corresponding to the input sequence as the output sequence of the prediction model; trains and verifies the prediction model according to the mechanism of the Transformer network based on the state data of the microstructure evolution; obtains the target state data before the prediction time, and inputs the trained prediction model for prediction; can give full play to the advantages of the Transformer network multi-head attention mechanism, can automatically capture the characteristic information in the input sequence that is crucial to the structural evolution, so as to accurately predict the change law of the microstructure during the crystal growth dynamics, and the computational efficiency is greatly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor.
[0045] Figure 1 This is a flow chart of a method for predicting a metal solidification process according to an embodiment of the present application.
[0046] Figure 2 Schematic diagram of a prediction model network architecture according to an embodiment of the present application.
[0047] Figure 3 This is a feature descriptor selection process according to an embodiment of the present application.
[0048] Figure 4 This is an example of the prediction of the dynamic evolution of grains by the PGTs network according to an embodiment of the present application and a comparison chart of the simulation efficiency.
[0049] The realization of the purpose, functional features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. The above-mentioned drawings have shown clear embodiments of this application, which will be described in more detail later. These drawings and textual descriptions are not intended to limit the scope of the concept of this application in any way, but to illustrate the concept of this application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0050] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0051] It should be noted that, in this article, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element. In addition, components, features, and elements with the same name in different embodiments of the present application may have the same meaning or different meanings, and their specific meanings need to be determined by their explanation in the specific embodiment or further combined with the context of the specific embodiment.
[0052] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] The microstructure of the alloy has a decisive influence on its final mechanical properties, and the formation and change of the microstructure are mainly determined during the solidification process of the metal. With the development of computational science, numerical simulation based on the phase field method (PFM) has become an effective tool for studying the solidification dynamics process. The phase field method can simulate the solid-liquid phase change process of real materials by describing the interaction between different phases of the material.
[0054] First embodiment
[0055] The present application provides a method for predicting a metal solidification process. Figure 1 This is a flow chart of a method for predicting a metal solidification process according to an embodiment of the present application.
[0056] like Figure 1 As shown, in one embodiment, the metal solidification process prediction method includes:
[0057] S10: Building a prediction model based on the Transformer network architecture, the prediction model includes multiple encoders and decoders. The encoder is used to extract features from the input sequence, and the decoder is used to generate a prediction output based on the encoder.
[0058] The Transformer network is a deep learning model for processing sequence data. Its advantage is that it has a self-attention mechanism that can automatically capture and understand important feature information in the input sequence. This application introduces it into the microstructure prediction of the metal solidification process, so that the model can automatically understand and extract key information in the dynamic evolution of the microstructure.
[0059] Exemplarily, the encoder processes input information and the decoder generates output information. The encoder is a special neural network that can fit a neural network with the same number of neurons in the input layer and the output layer. It can approximate an identity function so that the output of the neural network is close to the input. The significance of using an encoder is that the output result of its hidden layer can be used. If the output result of the hidden layer is a matrix (vector) with a smaller dimension, optimizations such as dimensionality reduction and data noise reduction can be achieved.
[0060] The encoder-decoder structure plays an important role in tasks such as machine translation, image description generation, and video understanding. In the field of deep learning, it has been successfully applied to various tasks such as image classification and sequence-to-sequence models (such as machine translation). At the same time, encoder-decoders are also widely used in natural language processing tasks.
[0061] The encoder-decoder is an end-to-end network structure consisting of two parts: the encoder and the decoder. The encoder converts the input sequence information into a fixed-length vector representation. Then, the decoder outputs the corresponding sequence information based on the input fixed-length vector representation. This structure can not only improve the efficiency of the model, but also retain the original input information. Therefore, the encoder-decoder plays an important role in processing time series tasks.
[0062] S20: setting the state data of the metal microstructure state as the input sequence of the prediction model, and setting the state data of the next state of the metal microstructure state corresponding to the input sequence as the output sequence of the prediction model.
[0063] In the process of metal solidification, the dynamic evolution of microstructure is essentially a continuous time series problem. The ultimate goal of the prediction model is to predict the next state of the input sequence. Therefore, the metal microstructure state at each stage of the solidification process is selected as the input sequence, and the next state of the input sequence is set as the output sequence.
[0064] S30: Acquire state data of microstructure evolution during metal solidification, and train and verify the prediction model according to the mechanism of the Transformer network based on the state data of microstructure evolution.
[0065] For example, a large amount of training data can be used to effectively train the PGTs (Polycrystalline grain transformers) model. The specific process includes the generation of data sets and the establishment of model training methods. In order for the model to obtain better prediction results, model training is also a process of continuously adjusting parameters and optimizing the model. When the cyclic training is skipped, the parameters of the model are adjusted to a suitable value, so that the model can generate more accurate predictions based on the input sequence, helping to better understand and control the evolution of the microstructure during metal solidification.
[0066] S40: Acquire target state data before the time to be predicted, and input the target state data into the trained prediction model for prediction.
[0067] Exemplarily, after completing the model training, the model can also be verified to ensure the ability of the PGTs model to predict the dynamic evolution of the microstructure of the solidification system. The verification stage can include the generation of a verification data set, the use of the model, and the evaluation of the model performance. After obtaining a successfully trained prediction model, it means that this prediction model has been able to better understand and control the evolution of the microstructure during the metal solidification process. The trained prediction model can be used to accurately predict the state data of the next state of the time node to be predicted by inputting the target state data before the time node to be predicted, so that engineering personnel can better deal with related engineering problems in terms of data accuracy and work efficiency.
[0068] This embodiment builds a prediction model based on the Transformer network architecture, sets the state data of the metal microstructure state as the input sequence of the prediction model, and sets the state data of the next state of the metal microstructure state corresponding to the input sequence as the output sequence of the prediction model; trains and verifies the prediction model according to the state data of the microstructure evolution according to the mechanism of the Transformer network; obtains the target state data before the prediction time, and inputs the trained prediction model for prediction; can give full play to the advantages of the Transformer network multi-head attention mechanism, can automatically capture the characteristic information in the input sequence that is crucial to the structural evolution, so as to accurately predict the change law of the microstructure during the crystal growth dynamics, and the calculation efficiency is greatly improved.
[0069] Optionally, the encoder comprises an input layer, a position encoding layer and a plurality of identical encoding layers.
[0070] The Transformer network consists of multiple encoder and decoder layers. Exemplarily, in the network architecture of the prediction model, the encoder is responsible for deep feature extraction of the input sequence, and the decoder generates prediction output based on the encoder. By building multiple layers of encoders and decoders, a deep understanding of the input sequence and accurate prediction of future trends can be achieved. For example, for an input sequence with five time nodes, a five-layer encoder can enable the model to understand the entire evolution process from the starting state to the fifth state, and the decoder can predict the state of the sequence at the sixth time node. Exemplarily, the encoder consists of an input layer, a position encoding layer, and multiple identical encoder layers.
[0071] Optionally, the process of building a prediction model based on the Transformer network architecture further includes:
[0072] Using the position encoding of sine and cosine functions, a coding vector is obtained corresponding to each input value in the timeline position and embedding dimension;
[0073] Adding the input vector and the encoding vector of the time position one by one to obtain an addition vector, so that the prediction model obtains the position relationship between different time points in the input sequence;
[0074] Passing the addition vector to the encoding layer, configuring multiple attention heads to perform parallel calculations on multiple grains;
[0075] Connect and linearly transform the corresponding multiple outputs of multiple attention heads to obtain the output result of the encoder.
[0076] Figure 2 Schematic diagram of a prediction model network architecture according to an embodiment of the present application.
[0077] like Figure 2 As shown, in a highly complex large language model, there can be a dedicated tagger to convert text data into integer tags and map them to integer identifiers in a predefined vocabulary. The present invention is mainly used to process sequence data, so no tagger is required for conversion. Exemplarily, the time series data from a polycrystalline system contains state information in the form of floating point values ([X t ,X t-1 ,X t-2 ...X t-window_size ]). Given an input tensor with window size window_size Among them, F in It is worth noting that the number of grains is N, and each grain has a set of eigenvalues, so the dimensions of the input and output tensors are N times the feature dimensions, which is achieved in the preprocessing stage of the input layer.
[0078] By using the position encoding of sine and cosine functions, each unique input value in the position and dimension of the time node obtains a unique encoding vector. By adding the input vector to the position encoding vector element by element, the prediction model can perceive the position order in the input sequence, understand the relative relationship between different time nodes, and better model and process the interaction between different time nodes in the self-attention mechanism.
[0079] The resulting vector is passed into the encoder layer, which consists of two sublayers: a self-attention sublayer and a fully connected feed-forward sublayer, each followed by a normalization layer. The self-attention layer used in multi-grain time series is implemented by the Query-Key-Value method, which is given by the scaled dot product calculation.
[0080] In addition, by using multiple attention heads, the above calculations can be performed in parallel. The multi-head attention layer can also capture different sequence information and relationships, enhancing the model's expressiveness in processing complex data. Finally, the multi-head attention layer connects and linearly transforms the outputs of multiple heads to obtain the output of the encoder layer.
[0081] Optionally, the decoder comprises an input layer, a plurality of decoding layers and an output layer.
[0082] Exemplarily, the decoder consists of an input layer, multiple decoder layers, and an output layer, which is responsible for generating the output of the target sequence.
[0083] Optionally, each decoding layer includes a first self-attention sublayer, an encoding and decoding attention sublayer, and a feedforward neural network sublayer; and the process of building a prediction model based on the Transformer network architecture also includes:
[0084] The input of the decoder starts from the last data point input by the encoder, and the output result of the encoder is converted into a one-dimensional vector representation result through linear mapping;
[0085] The first self-attention sublayer captures the dependencies between different timeline positions in the input sequence by performing attention calculation on the decoder itself, and generates an intermediate representation result of the decoder;
[0086] The encoder-decoder attention sublayer compares the output of the encoder with the intermediate representation result of the decoder, and performs information fusion by calculating the attention weight to generate the target sequence;
[0087] The feedforward neural network sublayer processes the target sequence through linear transformation and activation function, so that the prediction model performs nonlinear modeling to generate a decoding layer result;
[0088] The decoding layer result is mapped to the dimension of the target time series through linear mapping.
[0089] Exemplarily, the input of the decoder starts from the last data point input by the encoder. The input is converted into a vector representation of dimension d_model through linear mapping. The decoder consists of multiple identical decoder layers, each of which contains three sublayers, namely the first self-attention sublayer, the encoder-decoder attention sublayer, and the feedforward neural network sublayer.
[0090] The first self-attention sublayer captures the dependencies between different positions in the input sequence by performing attention calculations on the decoder itself, helping the model understand the important connections between the elements in the input sequence. The encoder-decoder attention sublayer is used to compare the output of the encoder with the intermediate representation of the decoder, and fuse the information of the two by calculating the attention weights to better generate the target sequence. At the end of each decoder layer, there is a feedforward neural network sublayer, which processes the output of the decoder layer through linear transformations and activation functions, which can help the model perform nonlinear modeling and enhance the model's expressiveness. Finally, the output of the decoder passes through a linear mapping layer to map it to the dimension of the target time series.
[0091] Optionally, the decoder also includes a second self-attention sublayer. In the process of building a prediction model based on the Transformer network architecture, the second self-attention sublayer applies a self-attention mechanism to the output of the encoder to extract information from the output result of the encoder.
[0092] Exemplarily, in addition to the three sub-layers in each decoder layer, the decoder inserts an additional second self-attention sub-layer to apply a self-attention mechanism to the encoder output to further extract information from the encoder output.
[0093] Optionally, in the process of building the prediction model based on the Transformer network architecture, the prediction model is made to rely on target state data before the time to be predicted based on forward masking and the offset of the timeline position between the decoder input and the target output in the decoder.
[0094] Illustratively, during the prediction process, in order to ensure that the prediction depends only on previous data points, look-ahead masking and a position offset between the decoder input and the target output in the decoder are applied.
[0095] Optionally, before the step of setting the state data of the metal microstructure state as the input sequence of the prediction model and setting the state data of the next state of the metal microstructure state corresponding to the input sequence as the output sequence of the prediction model, the step includes:
[0096] Based on the characteristics of the metal solidification system, the metal microstructure state at each stage of the metal solidification process is determined.
[0097] For example, during the solidification process of metal, the dynamic evolution of microstructure is essentially a continuous time series problem. Therefore, the metal microstructure state at each stage of the solidification process is selected as the input sequence. This sequence is considered to be the data form that best reflects the changes in microstructure.
[0098] Figure 3 This is a feature descriptor selection process according to an embodiment of the present application.
[0099] like Figure 3 As shown, for example, in the state selection process, the state data can be a multi-dimensional descriptor, so as to fully reflect the metal microstructure information. The determination of the descriptor can be combined with the characteristics of the solidification system and the target to be predicted.
[0100] Optionally, the process of obtaining the state data of microstructure evolution during metal solidification includes:
[0101] Based on the two-dimensional multiphase field numerical simulation model, the metal solidification process is simulated to generate microstructure evolution data, so as to obtain the corresponding microstructure state data at each time node on the timeline;
[0102] The state data of multiple consecutive time nodes are used as training samples so that the prediction model can obtain the dynamic evolution process of the microstructure.
[0103] Exemplarily, a large amount of training data may be used to effectively train a prediction model, and the specific process includes generating a data set and establishing a model training method.
[0104] For example, the phase field method can be used to generate the data set required for training the prediction model. With the help of a two-dimensional multiphase field numerical simulation model, a large-scale simulation of the metal solidification process is performed to generate rich microstructure evolution data. The advantage of the phase field method simulation is that a detailed microstructure state is output at each time step, which makes it possible to use the state of several consecutive time steps as a training sample, aiming to capture the dynamic evolution of the microstructure.
[0105] Optionally, in the process of taking the state data of multiple consecutive time nodes as training samples so that the prediction model can capture the dynamic evolution process of the microstructure, the training samples are structured to generate time series data consisting of multiple multidimensional descriptors to obtain a training data set, so that the prediction model can obtain the dynamic evolution characteristics of the microstructure.
[0106] For example, when generating data samples of a training data set, a large number of samples can be obtained through large-scale simulation and structured into a training data set. The training sample is a time series consisting of several states. The length of the sequence can be adjusted according to actual needs, but the basic principle is to ensure that the sequence is long enough to capture the dynamic evolution characteristics of the microstructure. Each state in each time series is a multidimensional descriptor, which can reflect various properties of the metal microstructure.
[0107] Optionally, the process of training the prediction model according to the state data of the microstructure evolution according to the mechanism of the Transformer network includes:
[0108] Divide the training data set into multiple batches, and set the batch order based on the gradient optimization algorithm;
[0109] Extract training samples batch by batch according to the batch order and input them into the prediction model to generate corresponding prediction data for each time node in the sequence according to the Transformer network mechanism;
[0110] The error between the prediction result of the prediction model and the actual result of the training data set is calculated according to the mean square error loss function, and the model parameters are adjusted according to the gradient information of the parameters to gradually reduce the training error.
[0111] For example, in the process of preparing for prediction model training, since sufficient training data sets are obtained, prediction model training can be performed. The prediction model is trained using a gradient-based optimization algorithm, such as the Adam algorithm. Before the prediction model training begins, the entire data set can be divided into multiple batches, and in the subsequent training process, the prediction model will be trained batch by batch according to the set batch size.
[0112] Exemplarily, during the training of the prediction model, at the beginning of each round of training, a batch of samples are first extracted from the training data set, and then these samples are input into the PGTs model. The prediction model generates predictions for each step in the sequence based on the mechanism of the Transformer network. After the prediction is completed, the error between the model's predicted results and the actual results is calculated using a preset loss function to evaluate the training effect of the prediction model. The mean square error (MSE) is selected as the loss function here. During the training process, the prediction model will continuously update the model parameters according to the gradient information of the parameters to gradually reduce the training error.
[0113] Optionally, the process of training the prediction model according to the state data of the microstructure evolution according to the mechanism of the Transformer network also includes:
[0114] If the performance of the prediction model does not improve during the training process, the training is stopped to avoid overfitting of the prediction model.
[0115] Optionally, the process of training the prediction model according to the state data of the microstructure evolution according to the mechanism of the Transformer network also includes:
[0116] Regularization or dropout techniques are used to prevent the prediction model from overfitting during the training process.
[0117] For example, during the training process, we can pay close attention to whether the model is overfitting and take measures to prevent it from performing poorly on new data. In view of this, early stopping is set during the training process. As long as the performance of the model on the validation set does not improve, the training is stopped to avoid overfitting of the model. In addition, regularization and dropout techniques are also used to prevent overfitting and ensure the generalization ability of the model.
[0118] Optionally, the process of verifying the prediction model according to the mechanism of the Transformer network further includes:
[0119] Use a two-dimensional multiphase field model to perform numerical simulations, collect microscopic state data at each time point during the solidification process, and create a validation data set for microstructural evolution;
[0120] Inputting the input sequence of the verification data set into the prediction model for prediction, and obtaining a prediction result;
[0121] Based on the root mean square error (RMSE), the degree of closeness between the model prediction results and the actual results of the validation data set is measured to determine the performance of the prediction model.
[0122] Exemplarily, after completing the model training, the model can be verified to ensure the ability of the prediction model to predict the dynamic evolution of the microstructure of the solidification system. This stage mainly includes the generation of a verification data set, the use of the model, and the evaluation of the model performance. In order to comprehensively and objectively evaluate the prediction effect of the PGTs model, a verification data set can be generated separately. This data set should be independent and non-overlapping with the data set used to train the prediction model. Similarly, a two-dimensional multiphase field model can be used for large-scale numerical simulation to create a microstructure evolution data set for verification. During the simulation process, various time nodes in the solidification process will also be traversed to collect a large amount of microstate data. Optionally, when generating a verification data set, the microstructure states in the data set should have a certain diversity and difficulty to test the generalization ability of the prediction model. At the same time, the methods of data structure extraction and sequence state setting should be consistent with the training set.
[0123] For example, after generating the validation data set, the input sequence of the validation data set can be input into the prediction model for prediction. This step can be performed automatically after the prediction model has trained its parameters. The prediction model will calculate the input sequence path according to the previously trained parameters and generate the prediction results. This generation process utilizes the self-attention mechanism and feedforward neural network part of the Transformer network design to understand the sequence content and generate accurate predictions.
[0124] Exemplarily, after the prediction of the validation data set is completed, the effect of the prediction model can be confirmed by a professional evaluation method. Here, the root mean square error (RMSE) can be selected as the evaluation criterion, which is a commonly used prediction performance evaluation criterion that can better measure the closeness of the model prediction results to the actual results. If the prediction model performs well on the validation data set, then there is reason to believe that the model has good generalization ability and can accurately predict the microstructural evolution in new and unseen metal solidification systems. If the performance of the model still needs to be improved, the model architecture can be adjusted to a certain extent, or the model can be retrained.
[0125] Second embodiment
[0126] Based on the above embodiments, the present application further provides an electronic device, the electronic device comprising a processor and a memory;
[0127] The memory stores a computer program, and when the computer program is executed by the processor, the steps of the solid state drive configuration method as described above are implemented.
[0128] For example, in the process of designing the PGTs model (a microstructure prediction model of metal solidification process based on Transformer network), the electronic device takes the self-attention mechanism of the Transformer network as the core, which can automatically capture and understand the key feature information in the input sequence, thereby effectively predicting the dynamic evolution of the microstructure during the metal solidification process.
[0129] (I) Model architecture design
[0130] For example, the framework of the PGTs network is as follows Figure 2 shown.
[0131] 1. Transformer Network
[0132] (1) Network infrastructure: The Transformer network consists of multiple encoder and decoder layers. The encoder is responsible for deep feature extraction of the input sequence, and the decoder generates prediction output based on the encoder. By building multiple layers of encoders and decoders, we can achieve a deep understanding of the input sequence and accurate prediction of future trends. For example, for an input sequence with five time nodes, a five-layer encoder can enable the model to understand the entire evolution process from the starting state to the fifth state, and the decoder can predict the sequence data of the sequence at subsequent time nodes.
[0133] (2) Encoder layer: The encoder consists of an input layer, a positional encoding layer, and multiple identical encoder layers. In highly complex large language models, specialized tokenizers can be used to convert text data into integer tokens and map them to integer identifiers in a predefined vocabulary. However, time series data from polycrystalline systems contain state information in the form of floating-point values ([X t ,X t-1 ,X t-2 ...X t-window_size ]), so no tokenizer is needed. Given an input tensor with window size window_size where F in It is worth noting that the number of grains is N, and each grain has a set of eigenvalues, so the dimensions of the input and output tensors are N times the feature dimensions, which is achieved in the preprocessing stage of the input layer.
[0134]
[0135]
[0136] In the positional encoding (PE) process, 10000 is a hyperparameter, j represents the number of a specific dimension, (2j) and (2j+1) represent the positions where the dimension number is even and odd, respectively, d_model represents the embedding dimension, and t i is the time of position i in the input sequence. Using the position encoding of sine and cosine functions, the time position t i Each unique input value in and dimension j obtains a unique encoding vector. By adding the input vector to the position encoding vector element by element, the PGTs model is able to perceive the position order in the input sequence, understand the relative relationship between different positions, and better model and handle the interaction between different positions in the self-attention mechanism.
[0137] The resulting vector is passed into the encoder layer, which consists of two sublayers: a self-attention sublayer and a fully connected feed-forward sublayer, each followed by a normalization layer. The self-attention layer used in the multi-grain time series is implemented by the Query-Key-Value method, which is given by the scaled dot product calculation as follows:
[0138]
[0139]
[0140]
[0141] Among them, A n represents the attention output of the nth input element, which is the weighted sum of all value vectors; n,i represents the attention weight, which is the importance of the corresponding key vector, and is a scalar; V represents the value vector, which generates a corresponding vector for each word in the input sequence in the self-attention mechanism. Q and K represent the query vector and the key vector, respectively. In the self-attention mechanism, they also generate a corresponding vector for each word in the input sequence. D k Represents the dimension of the key vector, Used to adjust the range of attention scores to prevent the dot product result from being too large and causing the gradient to disappear. k represents the length of the sequence being processed.
[0142] In addition, by using multiple attention heads, the above calculations can be performed in parallel. The multi-head attention layer can also capture different sequence information and relationships, enhancing the model's expressiveness in processing complex data. Finally, the multi-head attention layer concatenates and linearly transforms the outputs of multiple heads to obtain the output of the encoder layer, which can be described as:
[0143] FFN(σ i+1 )=ReLU(σ i W i +b i ) (6)
[0144] where σ i is the intermediate state of the first few layers, W i and b i It is a trainable parameter of the neural network. At the same time, a dropout layer is used between hidden layers to avoid overfitting and improve generalization ability. Finally, the encoder generates a d_model dimensional vector and feeds it back to the decoder.
[0145] (3) Decoder layer: The decoder consists of an input layer, multiple decoder layers, and an output layer. It is responsible for generating the output of the target sequence. The decoder input starts from the last data point input by the encoder. The input is converted into a vector representation of dimension d_model through linear mapping. The decoder consists of multiple identical decoder layers, each of which contains three sublayers, namely, the self-attention sublayer, the encoder-decoder attention sublayer, and the feedforward network sublayer.
[0146] The self-attention sublayer captures the dependencies between different positions in the input sequence by performing attention calculations on the decoder itself, helping the model understand the important connections between the elements in the input sequence. The encoder-decoder attention sublayer is used to compare the output of the encoder with the intermediate representation of the decoder, and fuse the information of the two by calculating the attention weights to better generate the target sequence. At the end of each decoder layer, there is a feedforward neural network sublayer, which processes the output of the decoder layer through linear transformations and activation functions, which can help the model perform nonlinear modeling and enhance the model's expressiveness.
[0147] In addition to the three sub-layers in each decoder layer, the decoder inserts an additional self-attention sub-layer to apply a self-attention mechanism to the encoder output to further extract information from the encoder output. Finally, the decoder output passes through a linear mapping layer to map it to the dimension of the target time series. During the prediction process, in order to ensure that the prediction only depends on previous data points, look-ahead masking and position offset between the decoder input and the target output in the decoder are applied.
[0148] 2. Input and output sequence
[0149] (1) Input sequence setting: During the metal solidification process, the dynamic evolution of the microstructure is essentially a continuous time series problem. Therefore, the metal microstructure state at each stage of the solidification process is selected as the input sequence. This sequence is considered to be the data form that best reflects the changes in the microstructure.
[0150] (2) Setting of output sequence: The goal of the PGTs model is to predict the next state of the input sequence, so the next state of the input sequence is set as the output sequence. Under this setting scheme, the task of the model becomes to predict the next state of the solidification process given the input sequence.
[0151] (3) Selection of sequence state: The state here is a multidimensional descriptor that can fully reflect the metal microstructure information. The determination of this descriptor can be combined with the characteristics of the solidification system and the target to be predicted. Figure 3 The selection process of feature descriptors.
[0152] (II) Model training
[0153] Effectively training the PGTs model can use a large amount of training data. The specific process includes the generation of data sets and the establishment of model training methods.
[0154] 1. Dataset Generation
[0155] (1) Using the phase field method: With the help of a two-dimensional multiphase field numerical simulation model, a large-scale simulation of the metal solidification process is performed to generate rich microstructure evolution data. The advantage of the phase field method simulation is that a detailed microstructure state is output at each time step, which makes it possible to use the state of several consecutive time steps as a training sample to capture the dynamic evolution of the microstructure.
[0156] (2) Training sample generation: A large number of samples can be obtained through large-scale simulation and structured into training data sets. The training sample is a time series consisting of several states. The sequence length can be adjusted according to actual needs, but the basic principle is to ensure that the sequence is long enough to capture the dynamic evolution characteristics of the microstructure. Each state in each time series is a multidimensional descriptor, which can reflect the various properties of the metal microstructure.
[0157] 2. Model training
[0158] (1) Model training preparation: After obtaining enough training data sets, model training can be performed. The PGTs model is trained using a gradient-based optimization algorithm, also known as the Adam algorithm. Before model training begins, the entire data set can be divided into multiple batches. In the subsequent training process, the model will be trained batch by batch according to the set batch size.
[0159] (2) Model training process: At the beginning of each round of training, a batch of samples are extracted from the training data set and then input into the PGTs model. The model generates predictions for each step in the sequence based on the mechanism of the Transformer network. After the prediction is completed, the error between the model's predicted results and the actual results is calculated using a preset loss function to evaluate the model's training effect. Here, the mean square error is selected as the loss function. During the training process, the model will continuously update the model parameters based on the gradient information of the parameters to gradually reduce the training error.
[0160] (3) Optimization of the training process: During the training process, we can pay close attention to whether the model is overfitting and take measures to prevent it from performing poorly on new data. In view of this, early stopping is set during the training process. As long as the performance of the model on the validation set no longer improves, the training is stopped to avoid overfitting of the model. In addition, regularization and dropout techniques are also used to prevent overfitting and ensure the generalization ability of the model.
[0161] In order to make the model obtain better prediction results, model training is also a process of constantly adjusting parameters and optimizing the model. When the training cycle is skipped, the parameters of the model are adjusted to a suitable value, so that the model can generate more accurate predictions based on the input sequence, helping to better understand and control the evolution of the microstructure during the metal solidification process.
[0162] (III) Model verification
[0163] After model training is completed, model validation can be performed to ensure the ability of the PGTs model to predict the dynamic evolution of the microstructure of the solidification system. This stage mainly includes the generation of validation data sets, the use of the model, and the evaluation of model performance.
[0164] Figure 4 This is an example of the prediction of the dynamic evolution of grains by the PGTs network according to an embodiment of the present application and a comparison chart of the simulation efficiency.
[0165] Figure 4 Six test samples were randomly selected from the test set to investigate the ability and efficiency of the PGTs network in predicting the dynamic evolution of grains.
[0166] 1. Verification dataset generation
[0167] (1) Importance of validation dataset: In order to comprehensively and objectively evaluate the prediction effect of the PGTs model, a validation dataset can be generated. This dataset should be independent of the dataset used to train the PGTs model and have no overlap.
[0168] (2) Dataset generation: A large-scale numerical simulation is also performed using a two-dimensional multiphase field model to create a microstructure evolution dataset for verification. During the simulation, a large amount of microstructure data is collected at various time points during the solidification process.
[0169] (3) Dataset characteristics: When generating a validation dataset, it is important to note that the microstructural states in the dataset should have a certain degree of diversity and difficulty to test the generalization ability of the model. At the same time, the methods of data structure extraction and sequence state setting should be consistent with those of the training set.
[0170] 2. Model prediction
[0171] (1) Input parameter preparation: After generating the validation dataset, the input sequence of the validation dataset can be input into the PGTs model for prediction. This step can be performed automatically after the model parameters have been trained.
[0172] (2) Prediction generation: The model generates predictions based on the input sequence path and previously trained parameters. This generation process utilizes the self-attention mechanism and feedforward neural network part of the Transformer network design to understand the sequence content and generate accurate predictions.
[0173] 3. Model performance evaluation
[0174] (1) Performance evaluation method: After the prediction is completed, the effectiveness of the model can be verified by professional evaluation methods. Here, the root mean square error (RMSE) is selected as the evaluation standard, which is a commonly used prediction performance evaluation standard that can better measure the closeness between the model prediction results and the actual results.
[0175] (2) Model performance judgment: If the PGTs model performs well on the validation data set, then there is reason to believe that the model has good generalization ability and can accurately predict the microstructural evolution in new and unseen metal solidification systems. If the performance of the model still needs to be improved, the model architecture can be adjusted or the model can be retrained.
[0176] (3) Efficiency of model prediction: 8 NVIDIA Tesla P100 GPUs were used to acquire the data set (calculation of the phase field model) and train the network model. The time overhead for 3000 phase field simulations was about 7 hours, and the training time for a PGTs model was about 40 minutes. After the model training was completed, it took about 0.08 seconds to predict the evolution process of a multi-grain.
[0177] like Figure 4 As shown in the figure, 6 samples were randomly selected and predicted using the PGTs model and simulated using the high-fidelity phase field model, and the speed and results of the two were compared. It can be seen that for the simulation of a multi-grain evolution process, the efficiency of the PGTs model prediction is about 700 times that of the high-fidelity phase field model simulation, and its ability to accelerate phase field simulation has been fully demonstrated.
[0178] In this example, a new Transformer network-based microstructure prediction model (PGTs) for metal solidification process is proposed.
[0179] First, the model architecture design based on the Transformer network is the core solution of this technical solution. The Transformer network is a deep learning model for processing sequence data. Its advantage is that it has a self-attention mechanism that can automatically capture and understand important feature information in the input sequence. This application introduces it into the microstructure prediction of the metal solidification process, so that the model can automatically understand and extract key information in the dynamic evolution of the microstructure.
[0180] Second, in order to effectively train the PGTs model, this application uses a two-dimensional multiphase field numerical simulation model to generate a large-scale training data set. Each generated data sample contains the microstructural state information of the metal material at different time points, which can ensure that the PGTs model fully learns the laws of dynamic evolution of the microstructure during the training process.
[0181] Third, to verify the prediction accuracy and computational efficiency of the PGTs model, this application compared the prediction results of the PGTs model with those of the traditional phase field method. The results show that the PGTs model is not only on par with the phase field method in terms of prediction accuracy, but also significantly improves in computational efficiency, which also indirectly proves the superiority of the Transformer network in dealing with such problems.
[0182] Through this series of technical solutions, this technical solution successfully solves the problem of effectively improving the efficiency of traditional methods in predicting the microstructure of metal solidification while ensuring accuracy, and provides a solid foundation for its application in material design, additive manufacturing and other related process fields. This Transformer network-based metal solidification process microstructure prediction model undoubtedly provides a new way to study the formation mechanism of material microstructure and its influencing factors, and then accurately design material properties.
[0183] The metal solidification process microstructure prediction model (PGTs) based on the Transformer network in this embodiment has significant advantages and beneficial effects.
[0184] 1. High precision
[0185] The PGTs model uses the powerful feature extraction and understanding capabilities of the Transformer network to effectively understand and grasp the inherent laws of the dynamic evolution of the microstructure during metal solidification, so it performs well in prediction accuracy. Experiments have shown that the prediction results of the PGTs model are comparable to those of the phase field method in terms of accuracy, and can achieve a very high prediction accuracy.
[0186] (II) Significant improvement in efficiency
[0187] If the traditional phase field method is used for numerical simulation of large-scale problems, it will consume a lot of computing resources and time, which is impractical for practical projects with limited resources. The PGTs model can make full use of the parallel computing power of the Transformer network, significantly improving the computing efficiency, and can handle larger-scale problems with the same computing resources, or obtain prediction results in a shorter time.
[0188] (III) Wide range of applications
[0189] The PGTs model is not only applicable to the microstructure prediction of metal materials, but its principles and implementation methods can also be extended to the microstructure prediction of other materials, such as ceramics, polymers, etc. This makes this technical solution widely applicable to various fields such as materials science, additive manufacturing, process optimization, etc.
[0190] The above beneficial effects make the PGTs model of this technical solution have important practical value in the fields of material design, additive manufacturing, process optimization, etc., and are of great significance for promoting scientific research progress and practical applications in related fields.
[0191] Third embodiment
[0192] The present application also provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the solid state drive configuration method as described above are implemented.
[0193] The metal solidification process prediction method provided in the present application builds a prediction model based on the Transformer network architecture, sets the state data of the metal microstructure state as the input sequence of the prediction model, and sets the state data of the next state of the metal microstructure state corresponding to the input sequence as the output sequence of the prediction model; trains and verifies the prediction model according to the mechanism of the Transformer network based on the state data of the microstructure evolution; obtains the target state data before the prediction time, and inputs the trained prediction model for prediction; can give full play to the advantages of the Transformer network multi-head attention mechanism, can automatically capture the characteristic information in the input sequence that is crucial to the structural evolution, so as to accurately predict the change law of the microstructure during the crystal growth dynamics, and the computational efficiency is greatly improved.
[0194] It should be noted that in the present application, step codes such as S10, S20, etc. are used for the purpose of expressing the corresponding content more clearly and concisely, and do not constitute a substantial limitation on the sequence. When implementing the step, those skilled in the art may execute S20 first and then S10, etc., but these should all be within the scope of protection of the present application.
[0195] In the embodiments of the system and storage medium provided in the present application, all technical features of any of the above-mentioned method embodiments may be included, and the expanded and explained contents of the specification are basically the same as those of the above-mentioned method embodiments, and will not be repeated here.
[0196] The embodiment of the present application further provides a computer program product, which includes a computer program code. When the computer program code runs on a computer, the computer executes the methods in the above various possible implementation modes.
[0197] An embodiment of the present application also provides a chip, including a memory and a processor, the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that a device equipped with the chip executes the methods in various possible implementation modes as described above.
[0198] It is understood that the above scenarios are only examples and do not constitute a limitation on the application scenarios of the technical solutions provided in the embodiments of the present application. The technical solutions of the present application can also be applied to other scenarios. For example, it is known to those skilled in the art that with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0199] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0200] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.
[0201] The units in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.
[0202] In the present application, the same or similar terminology concepts, technical solutions and / or application scenario descriptions are generally described in detail only the first time they appear. When they appear again later, they are generally not repeated for the sake of brevity. When understanding the technical solutions and other contents of the present application, for the same or similar terminology concepts, technical solutions and / or application scenario descriptions that are not described in detail later, reference can be made to the previous related detailed descriptions.
[0203] In the present application, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0204] The various technical features of the technical solution of the present application can be arbitrarily combined. In order to make the description concise, not all possible combinations of the various technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of the present application.
[0205] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for predicting a metal solidification process, characterized in that: include: A prediction model is built based on a Transformer network architecture, wherein the prediction model includes multiple encoders and decoders, wherein the encoder is used to extract features from an input sequence, and the decoder is used to generate a prediction output based on the encoder, wherein the encoder is connected to the decoder, the encoder converts the input sequence information into a vector representation of a fixed length, and the decoder outputs the corresponding sequence information according to the input vector representation of the fixed length; Setting the state data of the metal microstructure state as the input sequence of the prediction model, and setting the state data of the next state of the metal microstructure state corresponding to the input sequence as the output sequence of the prediction model; Acquire state data of microstructure evolution during metal solidification, and train and verify the prediction model according to the mechanism of Transformer network based on the state data of microstructure evolution; Obtaining target state data before the time to be predicted, and inputting the target state data into the trained prediction model for prediction; The encoder includes an input layer, a position encoding layer and multiple identical encoding layers; the process of building a prediction model based on the Transformer network architecture also includes: Using the position encoding of sine and cosine functions, a coding vector is obtained corresponding to each input value in the timeline position and embedding dimension; Adding the input vector and the encoding vector of the time position one by one to obtain an addition vector, so that the prediction model obtains the position relationship between different time points in the input sequence; Passing the addition vector to the encoding layer, configuring multiple attention heads to perform parallel calculations on multiple grains; Connect and linearly transform the corresponding multiple outputs of multiple attention heads to obtain the output result of the encoder; The decoder includes an input layer, multiple decoding layers and an output layer, each decoding layer includes a first self-attention sublayer, an encoding and decoding attention sublayer and a feedforward neural network sublayer; the process of building a prediction model based on the Transformer network architecture also includes: The input of the decoder starts from the last data point input by the encoder, and the output result of the encoder is converted into a one-dimensional vector representation result through linear mapping; By performing attention calculation on the decoder itself, the dependencies between different timeline positions in the input sequence are captured to generate an intermediate representation result of the decoder; Compare the output of the encoder with the intermediate representation result of the decoder, and perform information fusion by calculating attention weights to generate a target sequence; Processing the target sequence through linear transformation and activation function so that the prediction model performs nonlinear modeling to generate a decoding layer result; The decoding layer result is mapped to the dimension of the target time series through linear mapping.
2. A metal solidification process prediction method according to claim 1, characterized in that: The decoder further includes a second self-attention sublayer, and in the process of building a prediction model based on the Transformer network architecture, the second self-attention sublayer applies a self-attention mechanism to the output of the encoder to extract information from the output result of the encoder; and / or, In the process of building the prediction model based on the Transformer network architecture, the prediction model is made to rely on the target state data before the time to be predicted based on the forward masking and the offset of the timeline position between the decoder input and the target output in the decoder.
3. A metal solidification process prediction method according to claim 1, characterized in that: The step of setting the state data of the metal microstructure state as the input sequence of the prediction model and setting the state data of the next state of the metal microstructure state corresponding to the input sequence as the output sequence of the prediction model comprises: Based on the characteristics of the metal solidification system, the metal microstructure state at each stage of the metal solidification process is determined.
4. A metal solidification process prediction method according to claim 1, characterized in that: The process of obtaining the state data of the microstructure evolution during the metal solidification process includes: Based on the two-dimensional multiphase field numerical simulation model, the metal solidification process is simulated to generate microstructure evolution data, so as to obtain the corresponding microstructure state data at each time node on the timeline; The state data of multiple consecutive time nodes are used as training samples so that the prediction model can obtain the dynamic evolution process of the microstructure.
5. A metal solidification process prediction method according to claim 4, characterized in that: In the process of using the state data of multiple consecutive time nodes as training samples so that the prediction model can capture the dynamic evolution process of the microstructure, the training samples are structured to generate time series data consisting of multiple multidimensional descriptors to obtain a training data set, so that the prediction model can obtain the dynamic evolution characteristics of the microstructure.
6. A metal solidification process prediction method according to claim 5, characterized in that: The process of training the prediction model according to the state data of the microstructure evolution according to the mechanism of the Transformer network includes: Divide the training data set into multiple batches, and set the batch order based on the gradient optimization algorithm; Extract training samples batch by batch according to the batch order and input them into the prediction model to generate corresponding prediction data for each time node in the sequence according to the Transformer network mechanism; The error between the prediction result of the prediction model and the actual result of the training data set is calculated according to the mean square error loss function, and the model parameters are adjusted according to the gradient information of the parameters to gradually reduce the training error.
7. A metal solidification process prediction method according to claim 6, characterized in that: The process of training the prediction model according to the state data of the microstructure evolution according to the mechanism of the Transformer network also includes: If the performance of the prediction model no longer improves during the training process, the training is stopped to avoid overfitting of the prediction model; and / or, Regularization or dropout techniques are used to prevent the prediction model from overfitting during the training process.
8. A metal solidification process prediction method according to any one of claims 1 to 7, characterized in that: The process of verifying the prediction model according to the mechanism of the Transformer network also includes: Use a two-dimensional multiphase field model to perform numerical simulations, collect microscopic state data at each time point during the solidification process, and create a validation data set for microstructural evolution; Inputting the input sequence of the verification data set into the prediction model for prediction, and obtaining a prediction result; Based on the root mean square error, the degree of closeness between the model prediction results and the actual results of the verification data set is measured to determine the performance of the prediction model.
Citation Information
Patent Citations
Student score prediction system based on multi-view encoder-decoder architecture
CN111754097A
State sensing method and device based on artificial intelligence Transform and storage medium
CN117494575A
