A method for predicting the microstructure of titanium alloy based on deep learning
Through the combination of deep learning and transfer learning, a data expansion and prediction module is built, which solves the problem of microstructure prediction of titanium alloys across operating conditions and achieves a higher precision prediction effect.
Patent Information
- Application Number
- CN202411572211.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2044-11-06
AI Technical Summary
The prior art is difficult to effectively predict the microstructure of titanium alloys across operating conditions, traditional deep learning models cannot capture the characteristics of new operating conditions, and transfer learning algorithms have the problem of insufficient learning ability in complex data processing.
The microstructure sample data expansion module based on deep learning is adopted, and the data expansion is expanded using the generative adversarial network. The cross-condition microstructure prediction module of transfer learning is combined with the transfer learning, and the existing operating condition data is divided into source domain and target domain, pre-training and parameter fine-tuning is carried out to build a transfer learning model.
The accuracy and adaptability of microstructure prediction of titanium alloys across operating conditions is significantly improved, and the prediction error of α phase content and α phase spheroidization percentage is reduced by 20-38%, which is better than the existing methods.
Smart Images

Figure CN119445574B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of prediction of titanium alloy microstructure and deep learning, and particularly relates to a method for predicting titanium alloy microstructure based on deep learning. Background Art
[0002] Titanium alloys are widely used in industries such as aerospace due to their high strength, low density, excellent high-temperature performance, and corrosion resistance. The key to improving the performance of titanium alloys is to form specific microstructures during the hot processing process. Therefore, exploring the correlation between hot processing process parameters and the evolution law of microstructures has become a research hotspot.
[0003] During the hot processing of titanium alloys, the main process parameters are deformation temperature, solution temperature, and strain. Among them, the deformation temperature refers to the temperature at which the titanium alloy undergoes hot deformation; the solution temperature refers to the temperature at which the titanium alloy undergoes heat treatment; the strain refers to the degree of deformation generated by the titanium alloy due to hot deformation. In order to study the correlation between the above process parameters and the evolution law of microstructures, in materials science experiments, setting a group of fixed deformation temperature and solution temperature and adjusting the strain range of experimental conditions is called a working condition. For example, Figure 1 each rectangular box in represents a working condition (i.e., a set of experimental conditions that generate associated data), and different working conditions are called cross-working conditions (i.e., different experimental conditions).
[0004] Due to the large number of different working condition combinations, the experimental process is complex and time-consuming, resulting in incomplete data of microstructure specimens under all working conditions. Therefore, establishing a prediction model between hot processing process parameters and microstructure characteristic parameters to infer microstructure characteristic parameters under cross-working conditions is helpful to guide process optimization, thereby improving the performance of titanium alloys. The establishment of the prediction model is mainly divided into three parts: specimen preparation, data extraction, and construction of the prediction model. As Figure 2 shown, in the first step, specimen preparation is to obtain the corresponding microstructure data of titanium alloys under different working conditions, that is, using the lamellar TC18 titanium alloy double-cone specimens to carry out high-temperature compression experiments at different temperatures to obtain specimens with different deformation degrees; in the second step, data extraction is to obtain hot processing process parameters and their corresponding microstructure characteristic parameters. This process is divided into two parts. One part extracts the strain generated at different parts of the same specimen after hot processing through Deform software, and together with the deformation temperature and solution temperature obtained in the previous step, they form the hot processing process parameters. The other part extracts the microstructure characteristic parameters generated by the same specimen after material characterization experiments through ImageJ software; in the third step, constructing the model is to establish a prediction model between hot processing process parameters and microstructure characteristic parameters through the above data, that is, to study the evolution law of microstructures under cross-working conditions and guide process optimization.
[0005] To achieve the prediction of the microstructure of titanium alloys under cross - working conditions, there are mainly two parts. First, expand the sample data to improve the adaptability and generalization ability of the model to diverse working conditions. Second, predict the microstructure under cross - working conditions to improve the prediction accuracy of the model for diverse working conditions. In terms of expanding sample data, few - shot learning methods have received extensive attention due to their excellent performance under incomplete data conditions and have become an important means to solve this problem. Few - shot learning methods mainly include methods based on model fine - tuning, methods based on data augmentation, methods based on metric learning, and methods based on meta - learning. Among them, model fine - tuning, metric learning, and meta - learning methods are difficult to handle the complex characteristics of the microstructure and task adaptability problems. However, the method based on data augmentation can significantly improve the generalization ability and robustness of the model by generating new samples that are similar but not exactly the same as the real data to expand the small - sample data set. Currently, there are studies applying data augmentation methods to few - shot learning. For example, the article [He Xijun, Ma Shan, Wu Yuying, et al. Prediction of E - commerce Product Sales with Multi - Dimensional Index Fusion under Few - Shot Conditions [J]. Computer Engineering and Applications, 2019, 55(15): 177 - 184.] uses an ensemble learning method combined with multi - dimensional index fusion technology to collect data from multiple dimensions. Through technical means such as the entropy value method, the indicators are effectively fused and weighted to reduce the correlation between indicators and extract more crucial information for sales prediction. To enhance the generalization ability of the model, the article [Liu Y, Lee J, Park M, et al. Learning to Propagate Labels: Transductive Propagation Network for Few - Shot Learning [J]. arxiv preprint arxiv: 1805.10002, 2018.] designs a transductive propagation network. By learning the propagation path of labels, the label information can be effectively transmitted between samples, thus improving the classification accuracy. The article [Zhang R, Che T, Ghahramani Z, et al. MetaGAN: An Adversarial Approach to Few - Shot Learning [J]. Advances in Neural Information Processing Systems, 2018, 31.] proposes an adversarial few - shot learning method based on generative adversarial network technology. By generating samples that are similar but not exactly the same as the real data, it forces the discriminator to learn more robust feature representations, significantly improving the robustness and prediction performance of the model in few - shot learning. The above methods use the data augmentation strategy of few - shot learning technology to significantly enhance the performance and accuracy of the model in the prediction field.Although small-sample learning techniques have made progress in data augmentation, traditional deep learning models often fail to effectively capture the characteristics of new working conditions when using augmented data for prediction, resulting in poor prediction performance. Therefore, it is very important to use the augmented microstructure specimen data to complete the prediction of the microstructure under cross-working conditions.
[0006] In the aspect of microstructure prediction under cross-operating conditions, transfer learning provides an effective adaptive strategy. The goal of transfer learning is to apply the knowledge learned in one domain or task to another different but related domain or task to improve learning efficiency and performance, especially when the data of the target task is limited. There are mainly several methods of transfer learning, such as instance weighting, parameter transfer, feature adaptation, and domain adaptation. Among them, the instance weighting method, parameter transfer method, and feature adaptation method are difficult to accurately capture the tissue change characteristics of titanium alloy under different temperature and strain conditions due to the diversity and complex evolution law of the microstructure of titanium alloy. The domain adaptation method can better capture the differences between the two by dynamically adjusting the data distributions of the source domain and the target domain, and is more suitable for prediction under cross-operating conditions. There are already models that apply domain adaptation to cross-operating condition prediction. For example, the article [Li Wei, Chen Jian, Tao Shanyong. An Adaptive Coupling Periodic Potential System for Random Resonance Signal Enhancement Method [J]. Journal of Jilin University (Engineering and Technology Edition), 2021, 51(03): 1091-1096.] uses a conditional generative adversarial network model to enhance data diversity and solve the problem of mode collapse. The article [Liu Fei, Chen Renwen, Xing Kailing, et al. A Fast Fault Diagnosis Algorithm for Rolling Bearings Based on Transfer Learning and Deep Residual Network [J]. Journal of Vibration and Shock, 2022, 41(03): 154-164.] proposes a model combining a deep residual variational autoencoder and a self-attention mechanism to extract and retain key feature information. The article [Zhang B, Li W, Li XL, et al. Intelligent Fault Diagnosis under Varying Working Conditions Based on Domain Adaptive Convolutional Neural Networks [J]. IEEE Access, 2018, 6: 66367-66384.] proposes a convolutional neural network based on maximum mean discrepancy to align the feature distributions under different working conditions. And the article [Tang Z, Bo L, Liu X, et al. A Semi-Supervised Transferable LSTM with Feature Evaluation for Fault Diagnosis of Rotating Machinery [J]. Applied Intelligence, 2022, 52(2): 1703-1717.] combines a semi-supervised transferable network model of entropy increase ratio and long short-term memory network (LSTM) to evaluate and select features helpful for prediction.Although transfer learning provides an effective strategy for predicting microstructures across different working conditions, existing domain adaptation algorithms still have deficiencies in retaining the learning ability of pre-trained models when dealing with complex data due to the coexistence of differences and similarities between different working conditions. Therefore, how to further optimize domain adaptation algorithms to enhance their adaptability in complex environments and improve prediction accuracy remains an unsolved problem. Summary of the Invention
[0007] The object of the present invention is to provide a method for predicting the microstructure of titanium alloy based on deep learning. This method analyzes the characteristics of sample data under existing working conditions, uses the results of feature analysis to expand the model of sample data under new working conditions, and uses the data expansion results for subsequent prediction work. At the same time, in order to fully consider the differences and similarities between different working conditions during model prediction, the sample data set under existing working conditions and the expanded sample data under new working conditions are divided into source domain data set and target domain data set. The source domain data set is pre-trained, and then parameter fine-tuning is performed on the target domain data set to obtain a transfer learning model, thereby achieving accurate prediction of the microstructure across different working conditions.
[0008] The technical solution adopted by the present invention is as follows:
[0009] A method for predicting the microstructure of titanium alloy based on deep learning, comprising the following steps:
[0010] S1: Construct a method framework including a microstructure sample data expansion module based on deep learning and a cross-working-condition microstructure prediction module based on transfer learning;
[0011] S2: Preprocess the real data of the titanium alloy microstructure sample, including the steps of collection and normalization, to obtain the preprocessed data, and divide it into a training set and a test set;
[0012] S3: Construct a data expansion model in the microstructure sample data expansion module based on deep learning, analyze the characteristics of the sample data under existing working conditions, use the generative adversarial network method for data expansion, and perform data guidance on the expanded data according to the feature analysis results, and finally obtain the sample data under new working conditions;
[0013] S4: In the cross-working-condition microstructure prediction module based on transfer learning, divide the sample data under existing working conditions and the expanded sample data under new working conditions into a source domain data set and a target domain data set, use transfer learning technology, and use a deep learning algorithm to pre-train the source domain data set, and then perform parameter fine-tuning on the target domain data to obtain a transfer learning model;
[0014] S5: For the microstructure sample data under new working conditions, use the transfer learning model for prediction.
[0015] Furthermore, in step S3, a data expansion model is constructed in the microstructure sample data expansion module based on deep learning to complete sample data expansion under the new working condition, including the following steps:
[0016] 1-1) Construct an isolation forest anomaly detection algorithm (iForest) to identify abnormal samples in microscopic specimen data. The original sample X = [x1, x2, ..., x n ], the algorithm constructs a set of decision trees, each tree divides the sample data by randomly selecting a feature and a random value of the feature. The path length h(x i ) is the number of splits it goes through from the root node to the leaf node in the tree. Because the outliers are easy to be isolated, their path length h(x i ) are usually shorter.
[0017] The anomaly score s(x i ) is calculated as:
[0018]
[0019] Among them, h(x i ) is the sample x i The average path length in the tree, and E(h(x i )) is the expected path length of the sample in the same size data set. For the number of samples n, the expected path length E(h(x i The formula for )) is:
[0020]
[0021] H(i)=ln(i)+γ
[0022] Among them, H(i) is the harmonic number, γ is the Euler constant, when s(x i )≈1, the sample x1 is judged as an outlier; when s(x i )≈1, sample x1 is judged as an outlier;
[0023] 1-2) After abnormality detection processing is performed on the microstructure sample data, trend analysis is performed on it.
[0024] The range of data variation is determined by calculating the upper and lower limits of the data. Set the minimum and maximum values of strain (∈) to be ∈ min and ∈ max , and then perform constraint analysis of linear and nonlinear trends on the data.
[0025] The linear trend of strain and content (C) can be expressed as:
[0026]
[0027] Among them, C trend (∈) represents the linear trend of the content C that changes with the strain variable ∈, C start and C end are the content values at the starting point and the ending point respectively.
[0028] Next, for the non-linear trend analysis of the strain and the spheroidization rate (S), a parabola model is used to describe the relationship between the two:
[0029]
[0030] Among them, S trend (∈) represents the non-linear trend of the spheroidization rate S that changes with the strain variable ∈. The constant p determines the curvature of the parabola, and S min is the lower limit of the spheroidization rate;
[0031] 1 - 3) Data augmentation is realized by the generative adversarial network algorithm (GAN). GAN consists of a generator and a discriminator. The generator generates sample data G(z|v) through random noise z and conditional input v, and the discriminator classifies the real sample x and the generated sample data G(z|v);
[0032] 1 - 4) The generator is mainly divided into two parts: the core calculation and the output layer.
[0033] The core calculation part of the generator is realized through the following formula:
[0034]
[0035] Among them, represents the output of the generator, that is, the generated sample or data, θ g is the parameter of the generator, z is the random noise, v is the conditional input, and the generator generates the target data through the fully connected layer and the non-linear activation function.
[0036] A clipping layer and a distribution regularization layer are added to the output layer of the generator. Among them, the clipping layer constrains the generated data to ensure it is within a predetermined range:
[0037]
[0038] Among them, represents the value of the data output by the generator after the clipping operation, B i and T i are the lower limit and the upper limit of the data respectively. The max() function returns the maximum value in a set of numerical values, and the min() function returns the minimum value in a set of numerical values.
[0039] In addition, the distribution regularization layer introduces a penalty term to prevent the generated data from being overly concentrated near the upper and lower limits:
[0040]
[0041] where L penalty represents the penalty term of the distribution regularization layer, which is used to introduce a constraint during the generation process to prevent the generated data from being overly concentrated near the upper and lower limits. λ i is the penalty weight that controls the distribution of the generated data;
[0042] 1 - 5) The discriminator classifies the real data x and the generated data G(z|v), and its loss function is:
[0043]
[0044] where L D represents the loss function of the discriminator. x ∼ p data means that x is a real sample from the real data distribution p data and z ∼ p z means that z is a generated sample from the generated data distribution p z . D(x) is the probability prediction of the discriminator for the real sample x;
[0045] 1 - 6) By training the GAN model, the generator and the discriminator perform adversarial training to gradually optimize the quality of the generated samples. The generator can output the initial generated sample X' = [x'1, x'2,..., x' m ;
[0046] 1 - 7) Apply double trend constraints to the initial generated sample, namely the linear trend constraint of strain (∈) and content (C) and the non - linear trend constraint of strain (∈) and spheroidization rate (S). Finally, obtain the augmented sample X” = [x”1, x”2,..., x” m under the new working conditions after double trend constraints.
[0047] Furthermore, in the described step S4, when constructing a transfer learning model in the cross - working - condition microstructure prediction module based on transfer learning, it includes the following steps:
[0048] 2 - 1) Divide the original sample X and the augmented sample X” into a source - domain dataset and a target - domain dataset;
[0049] 2 - 2) The construction process of the transfer learning model is divided into two processes: pre - training and parameter fine - tuning;
[0050] 2 - 3) Construct a pre - training model, which is divided into three main parts: feature extraction, sequence information processing, and fusion output;
[0051] 2-4) The feature extraction part is carried out through multiple convolution operations. The input data undergoes multiple linear transformations to calculate new feature maps. Let the output of the convolution operation be F, then the output of each layer of convolution can be expressed as:
[0052] F (i) =σ(W (i) *X (i-1) +b (i) )
[0053] where F (i) represents the convolution output of the i-th layer, W (i) and b (i) are the weight matrix and bias term of the i-th layer respectively, X (i -1) , represents the output feature map of the (i - 1)-th layer, that is, the input data of the convolution operation of the current layer (the i-th layer), * represents the convolution operation, and σ(·) is the activation function;
[0054] 2-5) The sequence information processing part relies on recursive calculation to capture the time-dependent features of the data. For the input at each time step, the hidden state is updated through a recursive function. For the hidden state p t , its update rule is:
[0055] p t =φ(M*p t-1 +N*x t +c)
[0056] where p t represents the hidden state at the current time t, M and N are weight matrices, p t-1 is the hidden state at the previous time t - 1, x t is the input data at the current time t, c is the bias term, and φ(·) is the activation function. To further stabilize the training process, normalization is applied to the hidden state, and a random dropout mechanism is added to the last layer to prevent overfitting;
[0057] 2-6) The fusion output part adopts an attention mechanism to perform weighted combination on the processed sequence features. Let the feature matrix be K and the attention weight be A, then the fused output Z can be expressed as:
[0058] Z=A·K
[0059] where A is obtained by calculating the correlation in K;
[0060] 2-7) After multiple fully connected operations, the fused features are finally mapped to the output space to obtain the prediction result The calculation formula is:
[0061]
[0062] Among them, W out and b out are the weight matrix and bias term of the fully connected layer respectively. Finally, the model uses the mean squared error (MSE) as the loss function, which is defined as follows:
[0063]
[0064] Among them, represents the loss function MSE, is the predicted value y of the model for the i-th sample i is the true value of the i-th sample, and N is the total number of samples.
[0065] By minimizing this loss function, the model realizes effective prediction of data and completes the pre-training process;
[0066] 2-8) Perform the fine-tuning process of transfer learning. Starting from the pre-trained model, adjust its parameters to adapt to the target domain data. Update the parameters θ of the model by minimizing a new loss function L(θ, X”), and the goal of fine-tuning is to minimize the loss function of the model, that is:
[0067]
[0068] Among them, θ * represents finding the best parameters in the parameter space that minimize the loss function L(θ, X”).
[0069] In the fine-tuning process, through the hierarchical freezing mechanism, only the first several layers of the pre-trained model are frozen, making their parameters remain unchanged, and only the subsequent layers of the model are updated. The parameter update of the frozen layer is set to zero, that is:
[0070] Δθ freeze = 0
[0071] Among them, Δθ freeze represents the update amount of the parameters in the frozen layer.
[0072] The parameter update of the layer that needs to be fine-tuned is calculated by the gradient descent method:
[0073]
[0074] Among them, Δθ trainable represents the parameter adjustment amount of the layer that allows updates (trainable layer), η is the learning rate, is the gradient of the loss function with respect to the trainable parameters. In each iteration, the optimizer uses these gradients to update the parameters:
[0075]
[0076] where, θ t represents the model parameters at the current time t, and θ t+1 represents the new model parameters obtained after updating at the current time t, represents the gradient of the loss function with respect to the current model parameters θ t of.
[0077] Finally, through continuous iterative optimization, a transfer learning model capable of predicting the microstructure under new working conditions is obtained.
[0078] The beneficial effects of adopting the above technical solutions are as follows:
[0079] The purpose of the present invention is to provide a method for predicting the microstructure of titanium alloy based on deep learning, which includes a microstructure sample data augmentation model based on deep learning and a cross-working-condition microstructure prediction module based on transfer learning. Among them, the microstructure sample data augmentation model based on deep learning first analyzes the characteristics of the sample data under the existing working conditions, uses the generative adversarial network method for data augmentation, and according to the results of the characteristic analysis, conducts data guidance on the augmented data to achieve high-quality augmentation of the sample data under the new working conditions and the merging of the data sets, and obtains the final data set; the cross-working-condition microstructure prediction module based on transfer learning divides the final data set into a source domain data set and a target domain data set, uses a deep learning algorithm to pre-train the source domain data set, obtains the feature representation obtained by the pre-trained model on the source domain data, and after parameter fine-tuning, obtains a transfer model, and uses the transfer model to predict the microstructure under the cross-working conditions of the target domain data set.
[0080] The cross-working-condition microstructure prediction method proposed in this paper is used for the microstructure sample data of TC18 titanium alloy. Through experimental analysis, on the microstructure sample data under two different working conditions, the characteristic parameters of the microstructure are predicted, including the α-phase content and the α-phase spheroidization percentage. Among them, in the prediction of the α-phase content, the mean absolute error and the root mean square error are reduced by at least about 20% and at most about 32% compared with the mainstream methods, and in the prediction of the α-phase spheroidization percentage, the mean absolute error and the root mean square error are reduced by at least about 10% and at most about 38% compared with the mainstream methods, both of which are better than the mainstream methods, verifying the cross-working-condition prediction ability of the method for predicting the microstructure of titanium alloy based on deep learning. Description of the Drawings
[0081] Figure 1 is a schematic diagram of the working condition in the microstructure research;
[0082] Figure 2 is a schematic diagram of the establishment process of the titanium alloy prediction model;
[0083] Figure 3It is a framework diagram of a titanium alloy microstructure prediction method based on deep learning;
[0084] Figure 4 It is a framework diagram of a microstructure specimen data augmentation module based on deep learning;
[0085] Figure 5 It is a framework diagram of a cross - working - condition microstructure prediction module based on transfer learning;
[0086] Figure 6 It is a process diagram of titanium alloy specimen preparation and characterization;
[0087] Figure 7 It is a prediction result diagram of a comparative experiment;
[0088] Figure 8 It is a prediction result diagram of an ablation experiment. Specific implementation manners
[0089] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.
[0090] The present invention takes the prediction of titanium alloy microstructure as the background, uses deep learning as the carrier, and uses a microstructure specimen data augmentation module based on deep learning and a cross - working - condition microstructure prediction module based on transfer learning as the main algorithm framework. Its architecture is as Figure 3 shown, and includes the following steps:
[0091] S1: Construct a method framework including a microstructure specimen data augmentation module based on deep learning and a cross - working - condition microstructure prediction module based on transfer learning;
[0092] S2: Pre - process the real data of titanium alloy microstructure specimens, including steps of collection and normalization, to obtain pre - processed data, and divide it into a training set and a test set;
[0093] S3: Construct a data augmentation model in the microstructure specimen data augmentation module based on deep learning, perform feature analysis on the specimen data under existing working conditions, use the generative adversarial network method for data augmentation, and according to the feature analysis results, conduct data guidance on the augmented data, and finally obtain the specimen data under new working conditions, including the following steps:
[0094] 1 - 1) Construct an isolation forest anomaly detection algorithm (iForest) to identify abnormal samples in the microstructure specimen data. The original sample X = [x1, x2, …, x n , and the algorithm constructs a set of decision trees. Each tree divides the sample data by randomly selecting a feature and a random value of the feature. The path length h(x i) is the number of splits it undergoes from the root node to the leaf node in the tree. Outliers are easy to isolate, and their path length h(x i ) is usually short.
[0095] The outlier score s(x i ) of the Isolation Forest algorithm is calculated as follows:
[0096]
[0097] where h(x i ) is the average path length of the sample x i in the tree, and E(h(x i )) is the expected path length of the sample in a dataset of the same size. For a dataset with n samples, the formula for its expected path length E(h(x i )) is:
[0098]
[0099] H(i) = ln(i) + γ
[0100] where H(i) is the harmonic number and γ is the Euler constant. When s(x i ) ≈ 1, the sample x1 is determined to be an outlier; when s(x i ) ≈ 1, the sample x1 is determined to be an outlier;
[0101] 1 - 2) After performing outlier detection on the microstructure sample data, trend analysis is carried out on it.
[0102] The range of data variation is determined by calculating the upper and lower limits of the data. The minimum and maximum values of the strain (∈) are set as ∈ min and ∈ max respectively, and then constraint analysis of the linear and non - linear trends of the data is carried out.
[0103] For the linear trend of strain and content (C), it can be expressed as:
[0104]
[0105] where C trend (∈) represents the linear trend of the content C changing with the strain ∈, and C start and C end are the content values at the starting point and the ending point respectively.
[0106] Next, for the non - linear trend analysis of strain and spheroidization rate (S), a parabolic model is used to describe the relationship between the two:
[0107]
[0108] Among them, S trend (∈) represents the non-linear trend of the spheroidization rate S that changes with the strain variable ∈. The constant p determines the curvature of the parabola, and S min is the lower limit of the spheroidization rate;
[0109] 1 - 3) Data augmentation is implemented by the generative adversarial network algorithm (GAN). GAN consists of a generator and a discriminator. The generator generates sample data G(z|v) through random noise z and conditional input v, and the discriminator classifies the real sample x and the generated sample data G(z|v);
[0110] 1 - 4) The generator is mainly divided into two parts: the core calculation and the output layer.
[0111] The core calculation part of the generator is implemented by the following formula:
[0112]
[0113] Among them, represents the output of the generator, that is, the generated sample or data, and θ g is the parameter of the generator, z is the random noise, v is the conditional input, and the generator generates the target data through the fully connected layer and the non-linear activation function.
[0114] The output layer of the generator adds a clipping layer and a distribution regularization layer. Among them, the clipping layer constrains the generated data to ensure it is within a predetermined range:
[0115]
[0116] Among them, represents the value of the data output by the generator after the clipping operation, B i and T i are the lower and upper limits of the data respectively. The max() function returns the maximum value in a set of numerical values, and the min() function returns the minimum value in a set of numerical values.
[0117] In addition, the distribution regularization layer introduces a penalty term to avoid the generated data being overly concentrated near the upper and lower limits:
[0118]
[0119] Among them, L penalty represents the penalty term of the distribution regularization layer, which is used to introduce a constraint during the generation process to avoid the generated data being overly concentrated near the upper and lower limits, and λ i is the penalty weight, which controls the distribution of the generated data;
[0120] 1 - 5) The discriminator classifies the real data x and the generated data G(z|v), and its loss function is:
[0121]
[0122] where L D represents the loss function of the discriminator, x ∼ p data indicates that x is a real sample from the real data distribution p data and z ∼ p z indicates that z is a generated sample from the generated data distribution p z . D(x) is the probability prediction of the discriminator for the real sample x;
[0123] 1 - 6) By training the GAN model, the generator and the discriminator perform adversarial training to gradually optimize the quality of the generated samples. The generator can output the initial generated sample X' = [x'1, x'2,..., x' m ;
[0124] 1 - 7) Apply double trend constraints to the initial generated samples, namely the linear trend constraint of strain (∈) and content (C) and the non - linear trend constraint of strain (∈) and spheroidization rate (S). Finally, obtain the expanded samples X” = [x”1, x”2,..., x” m under the new working conditions after double trend constraints.
[0125] S4: In the cross - working - condition microstructure prediction module based on transfer learning, divide the sample data under the existing working conditions and the expanded sample data under the new working conditions into the source - domain dataset and the target - domain dataset. Use transfer learning technology and adopt a deep - learning algorithm to pre - train the source - domain dataset, and then fine - tune the parameters on the target - domain data to obtain the transfer - learning model, including the following steps:
[0126] 2 - 1) Divide the original sample X and the expanded sample X” into the source - domain dataset and the target - domain dataset;
[0127] 2 - 2) The construction process of the transfer - learning model is divided into two processes: pre - training and parameter fine - tuning;
[0128] 2 - 3) Construct a pre - training model, which is divided into three main parts: feature extraction, sequence information processing, and fusion output;
[0129] 2 - 4) The feature extraction part is performed through multiple convolution operations. The input data undergoes multiple linear transformations to calculate new feature maps. Let the output of the convolution operation be F, then the output of each layer of convolution can be expressed as:
[0130] F (i) = σ(W (i) *X (i-1) +b (i) )
[0131] Among them, F (i) represents the convolutional output of the i-th layer, W (i) and b (i) are the weight matrix and bias term of the i-th layer respectively, X (i -1) , represents the output feature map of the (i - 1)-th layer, that is, the input data for the convolutional operation of the current layer (the i-th layer), * represents the convolutional operation, and σ(·) is the activation function;
[0132] 2 - 5) The sequence information processing part relies on recursive calculation to capture the temporal dependence features of the data. For the input at each time step, the hidden state is updated through a recursive function. For the hidden state p t , its update rule is:
[0133] p t = φ(M * p t-1 + N * x t + c)
[0134] Among them, p t represents the hidden state at the current time t, N and B are weight matrices, p t-1 is the hidden state at the previous time t - 1, x t is the input data at the current time t, c is the bias term, and φ(·) is the activation function. To further stabilize the training process, normalization is applied to the hidden state, and a random dropout mechanism is added to the last layer to prevent overfitting;
[0135] 2 - 6) The fusion output part adopts an attention mechanism to perform weighted combination on the processed sequence features. Let the feature matrix be K and the attention weight be A, then the fused output Z can be expressed as:
[0136] Z = A · K
[0137] Among them, A is obtained by calculating the correlation in K;
[0138] 2 - 7) After multiple fully connected operations, the fused features are finally mapped to the output space to obtain the prediction result The calculation formula is:
[0139]
[0140] Among them, W out and b out are the weight matrix and bias term of the fully connected layer respectively. Finally, the model uses the mean squared error (MSE) as the loss function, which is defined as follows:
[0141]
[0142] Among them, denotes the loss function MSE, is the predicted value y of the model for the i-th sample i is the true value of the i-th sample, and N is the total number of samples.
[0143] By minimizing this loss function, the model achieves effective prediction of the data and completes the pre-training process;
[0144] 2 - 8) Perform the fine-tuning process of transfer learning. Starting from the pre-trained model, adjust its parameters to adapt to the target domain data. Update the parameters θ of the model by minimizing a new loss function L(θ, X"), and the goal of fine-tuning is to minimize the loss function of the model, that is:
[0145]
[0146] where θ * represents finding the optimal parameters in the parameter space that minimize the loss function L(θ, X").
[0147] During the fine-tuning process, through the hierarchical freezing mechanism, only the first several layers of the pre-trained model are frozen, making their parameters remain unchanged, and only the subsequent layers of the model are updated. The parameter update of the frozen layer is set to zero, that is:
[0148] Δθ freeze = 0
[0149] where Δθ freeze represents the update amount of the parameters in the frozen layer.
[0150] The parameter update of the layer that needs to be fine-tuned is calculated by the gradient descent method:
[0151]
[0152] where Δθ trainable represents the parameter adjustment amount of the layer that allows updates (trainable layer), η is the learning rate, is the gradient of the loss function with respect to the trainable parameters. In each iteration, the optimizer uses these gradients to update the parameters:
[0153]
[0154] where θ t represents the model parameters at the current time t, θ t+1 represents the new model parameters obtained after update at the current time t, represents the gradient of the loss function with respect to the current model parameters θ t of.
[0155] Finally, through continuous iterative optimization, a transfer learning model capable of predicting the microstructure under new working conditions is obtained.
[0156] S5: For the microstructure sample data under new working conditions, use the transfer learning model for prediction.
[0157] Based on the above steps, the present invention effectively solves the problems that the experimental time for preparing titanium alloy microstructure samples is long and difficult, it is difficult to obtain microstructure sample data under all working conditions, resulting in little effect of traditional technologies on predicting the microstructure under new working conditions. A method for predicting the titanium alloy microstructure based on deep learning is proposed. This method analyzes the characteristics of the microstructure sample data set under existing working conditions, and uses the results of the characteristic analysis to assist in constructing a new working condition sample data expansion model. The expanded new working condition sample data is used for subsequent prediction work. At the same time, in order to fully consider the differences and similarities between different working conditions during model prediction, the sample data set under existing working conditions and the expanded new working condition sample data set are divided into source domain data and target domain data sets. The source domain data set is pre-trained, and parameter fine-tuning is performed on the target domain data set to obtain a transfer learning model. The transfer learning model is used to predict the microstructure under cross-working conditions, thus achieving accurate prediction of the microstructure under cross-working conditions.
[0158] Experimental verification of the method for predicting the titanium alloy microstructure based on deep learning in the present invention:
[0159] Experimental environment
[0160] Windows 11 system, Intel Core i5-1035G7 CPU@1.20GHz and NVIDIA GeForce RTX2080Ti GPU, the development environment is Python 3.9.5, the deep learning framework is selected as PyTorch 2.1.0, and the machine learning method uses the API provided by Scikit-learn1.3.0.
[0161] Experimental verification
[0162] Experimental results and analysis on TC18 titanium alloy microstructure sample data
[0163] (1) Dataset description
[0164] To verify the effectiveness of the method proposed in this paper, TC18 titanium alloy microstructure sample data is used in the experiment. The data acquisition process is divided into two parts: sample preparation and data extraction. The sample preparation process includes the following steps: First, cut the material into a cylindrical sample with a diameter of φ55×50mm, as Figure 6 (a) shown, and process it into a double-tapered sample; then perform hot deformation, and the obtained sample is as Figure 6(As shown in (b), after the deformation is completed, a thin slice with a distance of 10 mm from the core is taken along the axial direction of the specimen as Figure 6 (c). Then, a heat treatment experiment is carried out; finally, the surface of the specimen is mechanically polished and corroded. The corroded specimen is as Figure 6 (d). The specimen is characterized by a Zeiss Sigma 300 scanning electron microscope. Some of the characterization results are as Figure 6 (e). What this paper aims to study are the characteristic parameters of the α-phase marked in the figure. Data extraction process The data extraction process extracts the specimens after hot deformation and the specimens after characterization through Deform software and Image J software respectively to obtain the final data.
[0165] The data of the TC18 titanium alloy microstructure specimens includes the experimental results of TC18 titanium alloy under 10 different working conditions, which are divided into hot processing process parameters and tissue characteristic parameters. Among them, the hot forming process parameters include deformation temperature, solution temperature and strain, and the tissue characteristic parameters include α-phase content and α-phase spheroidization percentage. Some of its data are shown in Table 1. The specimens' data under 8 working conditions are selected as the training set, and the specimens' data under 2 working conditions are selected as the test set. The hot forming process parameters are selected as the input variables, and the tissue characteristic parameters are selected as the output variables to be measured.
[0166] Table 1 Partial data of TC18 titanium alloy microstructure specimens
[0167]
[0168]
[0169] (2) Evaluation indexes
[0170] To evaluate the prediction performance of the model, the root mean square error (RMSE) and the mean absolute error (MAE) are used as evaluation indexes, and their definitions are as follows:
[0171]
[0172] Among them, y i 、 and respectively represent the true value of the target variable, the mean value of the true value and the model prediction. RMSE measures the average error between the model prediction value and the true value, and is more sensitive to the prediction error. The smaller this index, the better the model performance; MAE measures the average value of the absolute error between the prediction value and the true value. The smaller this index, the better the model performance.
[0173] (3) Comparative experiments
[0174] To verify the effectiveness of the deep learning-based prediction method for titanium alloy microstructures, a comparative experiment was conducted on this model. Denote the method in this paper as GAN-ACTL, and two different transfer learning methods were selected for comparison with GAN-ACTL. Although the selected transfer learning methods come from different fields, these models are representative in dealing with complex data distributions, cross-domain migrations, etc., and can provide reference for cross-condition prediction of microstructures. A brief description of each model is as follows:
[0175] Temporal-spatial transfer network (TL-TCN-BIGRU): Integrating transfer learning and deep learning, it transfers the knowledge of source domain data to the target domain through transfer learning, analyzes data features using the k-center clustering algorithm, and combines a temporal convolutional network and a bidirectional gated recurrent unit to extract multi-scale and non-linear features of time series. Hybrid deep learning model (TraTCN-LSTM-BiGRU): Based on the transfer learning theory, it selects relevant features using the mean heatmap method, divides source domain and target domain data through relative entropy, combines a temporal convolutional network to extract spatial features, a long short-term memory network to extract temporal features, and finally uses a bidirectional gated recurrent unit for feature fusion.
[0176] Table 2 Comparison of prediction results of TL-TCN-BIGRU, TraTCN-LSTM-BiGRU and GAN-ACTL
[0177]
[0178] According to the experimental results, it can be seen that the GAN-ACTL model has significantly improved in various indicators compared with the TL-TCN-BIGRU model and the TraTCN-LSTM-BiGRU model. In the prediction of the α-phase content, the RMSE and MAE of the GAN-ACTL model decreased by 20.59% to 32.04% respectively, showing higher prediction accuracy. In the prediction of the α-phase spheroidization percentage, the RMSE and MAE of the GAN-ACTL model are 10.77% to 38.0% lower than those of other models, showing more stable prediction ability. This is because the GAN-ACTL model introduces the idea of microstructure sample data augmentation and the hierarchical freezing mechanism on the basis of the transfer learning model. On the one hand, it can augment more microstructure data under new working conditions, enrich the training data of the model, and thus improve the model's prediction ability for new samples; on the other hand, it can reduce the overfitting risk of the model during training by freezing the parameters of some layers and improve the generalization ability on the test data.
[0179] Furthermore, in order to explore the contribution of the cross-condition prediction module in the GAN-ACTL model to the performance, a base model GAN-ACTL-SingleRD without cross-condition prediction ability was set as the control group, and tests were carried out on the microstructure data of two conditions, condition 1 and condition 2, respectively.
[0180] Table 3 Comparison of prediction results between GAN-ACTL-SingleRD and GAN-ACTL
[0181]
[0182] It can be seen from Table 3 that GAN-ACTL shows lower RMSE and MAE. Compared with the control group GAN-ACTL-SingleRD, the RMSE of the α-phase content on the microstructure data under two different conditions is reduced by about 69.4% and 36.8% respectively, the RMSE of the α-phase spheroidization percentage is reduced by 13.1% and 33.5% respectively, the MAE of the α-phase content is reduced by 75% and 48.2% respectively, and the MAE of the α-phase spheroidization percentage is reduced by 20.3% and 40.7% respectively. This is because the base model GAN-ACTL-SingleRD cannot learn the characteristics of the microstructure data under the new condition, while GAN-ACTL introducing data augmentation can effectively use the augmented data characteristics to adjust the parameters of the pre-trained model, enabling the model to more accurately capture the actual change trend of the data under cross-conditions, significantly reducing the prediction error, and proving the effectiveness of the cross-condition microstructure prediction ability in the face of the differential changes in the microstructure.
[0183] To sum up, the GAN-ACTL prediction method proposed in this paper has better prediction results of the microstructure under cross-conditions than other prediction models. GAN-ACTL analyzes the characteristics of the microstructure sample data under the existing conditions, and uses the results of the characteristic analysis to guide the augmentation of the sample data under the new conditions, realizing the high-quality augmentation of the sample data under the new conditions and the merging of the data sets to obtain the final data set. At the same time, a cross-condition microstructure prediction module based on transfer learning is constructed. The final data set is divided into a source domain data set and a target domain data set. Deep learning is used to pre-train the source domain data set, and parameter fine-tuning is carried out on the target domain data set to obtain a transfer learning model, enabling the model to fully consider the differences and similarities between different conditions during prediction, so as to achieve accurate prediction of the microstructure data under cross-conditions.
[0184] Aiming at the problems that the preparation experiment of titanium alloy microstructure specimens takes a long time and is difficult, it is difficult to obtain the microstructure specimen data under all working conditions, resulting in little effect of traditional technology on predicting the microstructure under new working conditions, this paper proposes a method for predicting the microstructure of titanium alloy based on deep learning. This aspect includes two parts. First, conduct feature analysis on the specimen data under existing working conditions, use the generative adversarial network method for data augmentation, and according to the feature analysis results, conduct data guidance on the augmented data to achieve high-quality augmentation of the specimen data under new working conditions and the merger of the data sets, and obtain the final data set. Second, divide the final data set into a source domain data set and a target domain data set, use a deep learning algorithm to pre-train the source domain data set, obtain the feature representation obtained by the pre-trained model on the source domain data, and obtain a transfer model after parameter fine-tuning. Finally, use the transfer model to predict the microstructure under cross-working conditions.
[0185] The above has described the examples of the present invention in detail, but the content is only the preferred embodiment of the present invention and cannot be considered as limiting the scope of implementation of the present invention. All equal changes and improvements made according to the scope of the application of the present invention shall still fall within the scope covered by the patent of the present invention.
Claims
1. A titanium alloy microstructure prediction method based on deep learning, characterized in that: The steps include: S1: Construct a method framework including a deep learning-based microstructure sample data expansion module and a cross-process microstructure prediction module based on transfer learning; S2: Preprocessing the real data of titanium alloy microstructure samples, including acquisition and normalization steps, to obtain preprocessed data, which is then divided into training and test sets; S3: Construct a data expansion model in the deep learning-based microstructure sample data expansion module, perform feature analysis on the sample data under existing working conditions, use the generative adversarial network method to expand the data, and provide data guidance for the expanded data based on the feature analysis results, ultimately obtaining the sample data under the new working conditions; S4: In the cross-condition microstructure prediction module based on transfer learning, the sample data under the existing working condition and the expanded sample data under the new working condition are divided into a source domain dataset and a target domain dataset. Using transfer learning technology, a deep learning algorithm is used to pre-train the source domain dataset, and then the parameters are fine-tuned on the target domain data to obtain the transfer learning model; S5: For the microstructure sample data under the new working conditions, the transfer learning model is used to make predictions; In step S3, a data expansion model is constructed in the microstructure sample data expansion module based on deep learning to complete sample data expansion under the new working condition, including the following steps: 1-1) Construct an isolation forest anomaly detection algorithm (iForest) to identify abnormal samples in microscopic specimen data. The original sample X = [x1, x2, ..., x n ], the algorithm constructs a set of decision trees, each tree divides the sample data by randomly selecting a feature and a random value of the feature, and the path length h(x i ) is the number of splits from the root node to the leaf node in the tree. Since the abnormal point is easy to be isolated, its path length h(x i ) is usually shorter, the anomaly score s(x i ) is calculated as: Among them, h(x i ) is the sample x i The average path length in the tree, and E(h(x i )) is the expected path length of the sample in the same size data set. For the number of samples n, the expected path length E(h(x i The formula for )) is: H(i)=ln(i)+γ Among them, H(i) is the harmonic number, γ is the Euler constant, when s(x i )≈1, the sample x1 is judged as an outlier; when s(x i )≈1, sample x1 is judged as an outlier; 1-2) After performing anomaly detection on the microstructure sample data, trend analysis is performed on it; The range of data variation is determined by calculating the upper and lower limits of the data, and the minimum and maximum values of the strain (∈) are set to ∈ min and ∈ max ,Then the data is subjected to constraint analysis of linear and nonlinear trends; The linear trend of strain and content (C) can be expressed as: Among them, C trend (∈) represents the linear trend of the content C as the strain ∈ changes, C start and C end are the content values at the starting point and end point, respectively; Next, the nonlinear trend analysis of strain and spheroidization rate (S) was performed, and the parabolic model was used to describe the relationship between the two: Among them, S trend (∈) represents the nonlinear trend of the spheroidization rate S as the strain ∈ changes. The constant p determines the curvature of the parabola, S min is the lower limit of spheroidization rate; 1-3) Data augmentation is implemented using a generative adversarial network (GAN) algorithm. GAN consists of a generator and a discriminator. The generator generates sample data G(z|v) using random noise z and conditional input v, while the discriminator classifies the real sample x and the generated sample data G(z|v). 1-4) The generator is mainly divided into two parts: core calculation and output layer; The core calculation part of the generator is implemented by the following formula: in, represents the output of the generator, that is, the generated samples or data, θ g is the parameter of the generator, z is random noise, v is the conditional input, and the generator generates target data through a fully connected layer and a nonlinear activation function; The output layer of the generator adds a cropping layer and a distribution normalization layer. The cropping layer constrains the generated data to ensure that it is within a predetermined range: in, Represents the value of the data output by the generator after clipping operation, B i and T i The max() function returns the maximum value in a set of values, and the min() function returns the minimum value in a set of values; In addition, the distribution regularization layer introduces a penalty term to prevent the generated data from being overly concentrated near the upper and lower limits: Among them, L penalty represents the penalty term of the distribution regularization layer, which is used to introduce a constraint in the generation process to avoid the generated data being overly concentrated near the upper and lower limits, λ i To penalize weights and control the distribution of generated data; 1-5) The discriminator classifies the real data x and the generated data G(z|v), and its loss function is: Among them L D Represents the loss function of the discriminator, x~P data Indicates that x comes from the real data distribution p data The real sample, z~p z Denote z as the data generated from the distribution p z The generated sample, D(x) is the probability prediction of the discriminator for the real sample x; 1-6) By training the GAN model, the generator and the discriminator are trained adversarially to gradually optimize the quality of the generated samples. The generator can output the initial generated sample X′=[x′1,x′2,...,x′ m ]; 1-7) Double trend constraints are applied to the initial generated samples, namely the linear trend constraint between strain (∈) and content (C) and the nonlinear trend constraint between strain (∈) and spheroidization rate (S). Finally, the expanded sample X″=[x″1,x″2,...,x″] under the new working condition after the double trend constraints is obtained. m ].
2. The method for predicting titanium alloy microstructure based on deep learning according to claim 1, characterized in that: In the described step S4, constructing a transfer learning model in the cross-operating condition microstructure prediction module based on transfer learning includes the following steps: 2-1) Divide the original sample X and the expanded sample X″ into a source domain dataset and a target domain dataset; 2-2) The construction process of the transfer learning model is divided into two steps: pre-training and parameter fine-tuning; 2-3) Construct a pre-training model, which is divided into three main parts: feature extraction, sequence information processing and fusion output; 2-4) The feature extraction part is performed through multiple convolution operations. The input data undergoes multiple layers of linear transformation to calculate a new feature map. Let the output of the convolution operation be F, then the output of each layer of convolution can be expressed as: F (i) =σ(W (i) *X (i-1) +b (i) ) Among them, F (i) represents the convolution output of layer i, W (i) and b (i) are the weight matrix and bias term of the i-th layer, X (i-1) , represents the output feature map of the i-1th layer, that is, the input data of the convolution operation of the current layer (i-th layer), * represents the convolution operation, and σ(·) is the activation function; 2-5) The sequence information processing part relies on recursive calculation to capture the time-dependent characteristics of the data. For each time step input, the hidden state is updated through a recursive function. For the hidden state p t , and its update rule is: p t =φ(M*p t-1 +N*x t +c) Among them, p t represents the hidden state at the current time t, M and N are weight matrices, p t-1 is the hidden state at the previous time t-1, x t is the input data at the current time t, c is the bias term, φ(·) is the activation function. To further stabilize the training process, normalization is applied to the hidden state, and a random dropout mechanism is added to the last layer to prevent overfitting. 2-6) The fusion output part uses the attention mechanism to perform weighted combination of the processed sequence features. Let the feature matrix be K and the attention weight be A. The fused output Z can be expressed as: Z=A·K Among them, A is obtained by calculating the correlation in K; 2-7) After multiple layers of fully connected operations, the fused feature input is finally mapped to the output space to obtain the prediction result The calculation formula is: Among them, W out and b out are the weight matrix and bias term of the fully connected layer respectively. Finally, the model uses the mean square error (MSE) as the loss function, which is defined as follows: in, represents the loss function MSE, is the model's predicted value y for the i-th sample i is the true value of the i-th sample, N is the total number of samples; By minimizing the loss function, the model achieves effective prediction of the data and completes the pre-training process; 2-8) Perform fine-tuning of transfer learning. Starting from the pre-trained model, adjust its parameters to adapt to the target domain data. Update the model parameters θ by minimizing a new loss function L(θ,X”). The goal of fine-tuning is to minimize the model loss function, that is: Among them, θ * It means finding the best parameters in the parameter space to minimize the loss function L(θ,X”); During fine-tuning, the layer freezing mechanism is used to freeze only the first few layers of the pre-trained model, keeping their parameters unchanged, and only the subsequent layers of the model are updated. The parameter updates of the frozen layers are set to zero, that is: Dth freeze =0 Where Δθ freeze Indicates the update amount of the parameters in the frozen layer; The parameter updates for the layers that need fine-tuning are calculated using the gradient descent method: Where Δθ trainable represents the parameter adjustment amount of the layer (trainable layer) allowed to be updated, η is the learning rate, are the gradients of the loss function with respect to the trainable parameters. At each iteration, the optimizer uses these gradients to update the parameters: Among them, θ t represents the model parameters at the current time t, θ t+1 Represents the new model parameters obtained after updating at the current time t, Represents the loss function for the current model parameters θ t gradient; Finally, through continuous iterative optimization, a transfer learning model that can predict the microstructure under new working conditions is obtained.
Citation Information
Patent Citations
Cast aluminum cylinder cover mechanical property prediction method based on GAN and CNN
CN116152146A
High-precision fatigue life prediction method based on small sample machine learning
CN117150918A