Pressure vessel heat treatment process parameter optimization method based on interpretable neural network
By using an interpretable neural network-based approach, combining adaptive normalization and genetic algorithm to optimize the BP neural network, and then using the SHAP algorithm to analyze the model output, the problems of input variable differences and model instability in the optimization of post-weld heat treatment processes for pressure vessels were solved. This approach enabled high-precision prediction of residual stress and optimization of process parameters, thereby improving the reliability and accuracy of heat treatment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-03-31
AI Technical Summary
Existing BP neural networks suffer from problems such as large differences in the scale of input variables, unstable model convergence, insufficient optimization ability, and lack of interpretability of prediction results in the optimization of post-weld heat treatment processes of pressure vessels, resulting in insufficient reliability and accuracy of heat treatment process optimization.
An interpretable neural network-based approach is adopted, combining adaptive normalization algorithm, genetic algorithm, and improved SHAP interpretable algorithm to construct an optimization model for pressure vessel heat treatment process parameters. The input features are processed by adaptive normalization, the weights and thresholds of the BP neural network are optimized by genetic algorithm, and the model output results are analyzed by SHAP algorithm to realize the calculation of the contribution rate of each input feature to the output feature.
It enables high-precision prediction of residual stress after welding heat treatment of pressure vessels and optimized control of key process parameters, provides quantitative analysis of the influence of each parameter on residual stress, and improves the reliability of heat treatment process design and residual stress control.
Smart Images

Figure CN121413467B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of numerical optimization technology for heat treatment process parameters, and specifically to a method for optimizing heat treatment process parameters of pressure vessels based on an interpretable neural network. Background Technology
[0002] Pressure vessels, as one of the most critical pressure-bearing components in energy, chemical, and marine equipment, directly impact the long-term stable operation of production facilities. Welding is a primary connection method in pressure vessel manufacturing, widely used for parts such as cylinders, heads, and nozzles. However, uneven heating and cooling during welding can lead to significant residual stress in the weld and heat-affected zone. This residual stress not only reduces the fatigue life of the material but also promotes crack initiation and propagation, potentially causing weld deformation, stress corrosion cracking, or even vessel failure. Therefore, post-weld heat treatment is an indispensable and critical process in pressure vessel manufacturing. Its purpose is to effectively release residual welding stress, restore material microstructure, and improve the structural safety and stability through heating, heat preservation, and slow cooling.
[0003] In post-weld heat treatment, significant nonlinear coupling relationships exist among various process parameters such as holding temperature, holding time, heating rate, and cooling rate. Even minor adjustments to these parameters can affect the final residual stress distribution and release effect. Traditional heat treatment process parameter formulation relies primarily on operator experience or finite element numerical simulation results. While the experience-based method depends on individual judgment and lacks systematicity and repeatability, numerical simulation, although capable of accurately predicting residual stress distribution, suffers from complex modeling, high computational cost, and low optimization efficiency, making it difficult to meet the rapid optimization needs under multiple operating conditions and objectives. Therefore, establishing a precise mapping relationship between heat treatment process parameters and residual stress, and achieving intelligent parameter optimization, has become a critical technical problem urgently needing to be solved in the field of pressure vessel heat treatment.
[0004] In recent years, the application of artificial intelligence algorithms in materials processing and process optimization has gradually increased. Using backpropagation (BP) neural networks to establish a nonlinear mapping relationship between heat treatment parameters and residual stress can achieve rapid prediction of residual stress, providing new ideas for heat treatment process design. However, there are several limitations to using existing BP neural networks for heat treatment process optimization: First, there is a lack of adaptive normalization methods for multi-source, multi-scale process parameters, leading to data imbalance when the model handles parameters of different dimensions, thus affecting the accuracy of residual stress prediction and reducing the reliability and practical application effect of heat treatment process optimization. Second, BP neural networks and their improved models are prone to getting trapped in local optima when dealing with the complex nonlinear mapping relationship between heat treatment process parameters and residual stress, resulting in significant differences in prediction results obtained by the model in different training processes, with obvious fluctuations in the predicted residual stress values, making it difficult to guarantee the stability and consistency of the prediction results, thus affecting the reliability of heat treatment process optimization. Third, existing methods cannot quantitatively reveal the degree of influence of each heat treatment process parameter on residual stress, resulting in unclear laws governing the effect of each parameter on the heat treatment results, making it difficult to provide a reliable basis for process optimization and parameter control.
[0005] Therefore, there is an urgent need to study a method for optimizing the process parameters of post-weld heat treatment of pressure vessels. Summary of the Invention
[0006] To address the technical problems existing in the optimization of heat treatment processes using neural networks, such as large differences in the scale of input variables, unstable model convergence, insufficient optimization ability, and lack of interpretability of prediction results, this invention provides a method for optimizing heat treatment process parameters of pressure vessels based on interpretable neural networks.
[0007] The technical solution adopted in this invention is as follows:
[0008] A method for optimizing process parameters of heat treatment of pressure vessels based on interpretable neural networks includes the following steps:
[0009] Step 1: Obtain several heat treatment process parameter data of pressure vessels and corresponding transverse residual stress and longitudinal residual stress data. Use the holding temperature, holding time, heating rate and cooling rate in the heat treatment process parameters as input features, and use the transverse residual stress and longitudinal residual stress as output features to construct data samples, and divide them into training set, validation set and test set.
[0010] Step 2: Perform adaptive normalization preprocessing on the data samples constructed in Step 1 to obtain the preprocessed training set, validation set, and test set;
[0011] Step 3: Establish a BP neural network prediction model, and use a genetic algorithm to globally optimize the initial weights and thresholds of the BP neural network prediction model to obtain the optimal weights and thresholds. Use the optimal weights and thresholds as the initial parameters of the BP neural network prediction model, and train it using the training set preprocessed in Step 2 to obtain a mature BP neural network prediction model. Input the test set preprocessed in Step 2 into the mature BP neural network prediction model for testing to evaluate the final performance of the BP neural network prediction model.
[0012] Step 4: Based on the physical span weighting and output adaptive normalization, the improved SHAP interpretable algorithm analyzes the output results of the mature BP neural network prediction model trained in Step 3, and calculates the contribution rate of each input feature to the output feature.
[0013] Step 5: Based on the mature BP neural network prediction model obtained in Step 3 and the contribution rate of each input feature to the output feature obtained in Step 4, the genetic algorithm is used to perform multi-objective optimization of the process parameters to obtain the optimal process parameters suitable for post-weld heat treatment of pressure vessels.
[0014] Furthermore, the adaptive normalization formula in step two is:
[0015] ;
[0016] ;
[0017] Where i represents the category of input feature, and i represents the holding temperature T, holding time t, heating rate V1, and cooling rate V2, respectively; j is the index of the specific input value in each category of input feature. Let j be the j-th input value of the i-th type of input feature after normalization. Let j be the j-th input value of the i-th type of input feature before normalization. The average value of the input features of the i-th class is... Let be the standard deviation of the input feature of class i. For the adaptive weight coefficients of the i-th type of input features, For adjustment coefficients, The span value of the i-th type of input feature, i.e. ,and , Let be the maximum and minimum values of the input feature of the i-th class, respectively. The average span value for the input features across all categories.
[0018] Furthermore, step three specifically includes the following sub-steps:
[0019] Step (3-1): Determine the topology and loss function of the BP neural network prediction model, and randomly generate the initial weights and thresholds of the BP neural network;
[0020] Step (3-2): A genetic algorithm is used to perform a global search for the initial weights and thresholds of the BP neural network prediction model, randomly generating several sets of candidate weights and thresholds as individuals in the population. The training set samples preprocessed in Step 2 are then input into the BP neural network prediction model for forward prediction calculation. The prediction error of the BP neural network prediction model is used as the fitness function. Through selection, crossover, and mutation operations, iterative optimization is performed. When the fitness improvement rate is <10 for 10 consecutive generations... -4 Stop when the optimal initial weight and threshold combination is obtained;
[0021] Step (3-3): The optimal initial weight and threshold combination determined in step (3-2) is used as the initial parameters of the BP neural network prediction model. The model is trained using the training set preprocessed in step two, and the generalization error of the model is monitored using the validation set preprocessed in step two. This helps determine the termination time of network training and related hyperparameter settings. Training stops when the loss function converges, resulting in a mature BP neural network prediction model. During the training process, the weights and thresholds are continuously adjusted, and the weights and thresholds corresponding to the convergence of the loss function are taken as the optimal solution of the BP neural network prediction model.
[0022] Step (3-4): Input the preprocessed test set from step 2 into the trained and mature BP neural network prediction model obtained in step (3-3) for testing and evaluate the final performance of the BP neural network prediction model.
[0023] Furthermore, the BP neural network prediction model established in step (3-1) includes an input layer, a hidden layer, and an output layer. The hidden layer uses Sigmoid activation, the output layer uses linear activation, and the loss function is the mean squared error (MSE) function.
[0024] Furthermore, step four specifically includes the following sub-steps:
[0025] Step (4-1): Take several sets of data samples from the training set after adaptive normalization preprocessing in Step 2;
[0026] Step (4-2): For each data sample X k First, determine the combination of the input feature category i to be calculated and all other input features except for the i-th type, and generate all feature subsets S of this combination; then, use the well-trained BP neural network prediction model obtained in step three to calculate the predicted value of each feature subset S and normalize it; simultaneously, add the input feature i to the feature subset S and denote it as... Calculate each feature subset again The predicted values are normalized, and the change in the normalized predicted values is output. Then calculate the sample X for each data group. k The standard SHAP value of the i-th type of input feature to the output feature;
[0027] Step (4-3): Determine the span value of the i-th type of input feature and calculate the corresponding feature physical weight coefficient;
[0028] Step (4-4): Introduce the physical weight coefficients of the i-th type of input features obtained in step (4-3) into the standard SHAP value obtained in step (4-2) to obtain the data sample X for each group. k The comprehensive contribution index of the i-th type of input feature to the output feature;
[0029] Step (4-5): Take the absolute value of the comprehensive contribution index obtained in step (4-4) and normalize it to obtain the data sample X for each group. k The contribution rate of the i-th type of input feature to the output feature is calculated; then, the average contribution rate of the i-th type of input feature to the output feature is obtained by averaging the contribution rates of the i-th type of input feature to the output feature across all data samples.
[0030] Step (4-6): Based on the average contribution rate of various input features to output features obtained in step (4-5), draw a SHAP summary chart to visually display the contribution order and influence direction of each heat treatment process parameter to the prediction of residual stress.
[0031] Furthermore, the specific calculation process of step (4-2) is as follows:
[0032] The predicted values output by the BP neural network prediction model are normalized using the following formula:
[0033] ;
[0034] In the formula, The predicted value is the direct output of the BP neural network prediction model. For normalized predicted values, The mean of the predicted outputs for the sample set participating in the SHAP predicted value normalization calculation. The standard deviation of the predicted output for the sample set participating in the SHAP predicted value normalization calculation. It is a constant, with a value of 10. -8 ~10 -4 ;
[0035] For each feature subset The change in the predicted value after adding input feature i for:
[0036] ;
[0037] In the formula, N is the set of all category input features. Let represent any subset of features that does not contain the i-th type of input features. For data sample X k The predicted value corresponding to the feature subset S in the middle. For data sample X k Feature subset The corresponding predicted value;
[0038] Data sample X k The standard SHAP value of the i-th input feature with respect to the output feature is:
[0039] ;
[0040] In the formula, For data sample X k The standard SHAP value of the i-th type of input feature to the output feature. S is the number of elements in the feature subset S, and M is the total number of input feature categories.
[0041] Furthermore, the specific calculation process of step (4-3) is as follows:
[0042] Define the span value of the i-th type of input feature as:
[0043] ;
[0044] The feature physical weight coefficient of the i-th type of input feature is:
[0045] ;
[0046] In the formula, Let be the span value of the i-th type of input feature. , Let be the maximum and minimum values of the input feature of the i-th class, respectively. The physical weight coefficients of the input features of the i-th class;
[0047] The comprehensive contribution index in step (4-4) The calculation formula is:
[0048] .
[0049] Furthermore, the specific calculation process for step (4-5) is as follows:
[0050] Calculate data sample X kThe contribution rate of the i-th type of input feature to the output feature:
[0051] ;
[0052] Calculate the average contribution rate of the i-th type of input feature to the output feature across all data samples:
[0053] ;
[0054] In the formula, For data sample X k The contribution rate of the i-th type of input feature to the output feature. Let k be the average contribution rate of the i-th type of input feature to the output feature in all data samples, where k is the index of the data sample and n is the total number of data samples.
[0055] Furthermore, step five specifically includes the following sub-steps:
[0056] Step (5-1): Select the target parameters to be optimized as the input features: heat preservation temperature, heat preservation time, heating rate and cooling rate. Based on the contribution rate of each input feature to the output feature obtained in Step 4, set the optimization range of the target parameters and generate several candidate combinations within the optimization range. Input the candidate combinations into the well-trained BP neural network prediction model obtained in Step 3 to predict the corresponding transverse residual stress and longitudinal residual stress output features.
[0057] Step (5-2): Quantify the relative importance of the output characteristics of transverse residual stress and longitudinal residual stress in the heat treatment process through sensitivity analysis, and convert them into weighting coefficients, thus transforming the dual-objective optimization index of transverse residual stress and longitudinal residual stress into a single-objective function.
[0058] Step (5-3): Substitute the predicted transverse and longitudinal residual stresses from step (5-1) into the single objective function established in step (5-2) to obtain the objective function value. Then, based on the genetic algorithm, use an iterative search method to continuously update the objective parameter combination, so that the objective function value gradually decreases until convergence, and the optimal objective parameter combination is obtained. At the same time, the predicted results of transverse and longitudinal residual stresses are output.
[0059] Furthermore, the single-objective function established in step (5-2) is:
[0060] ;
[0061] In the formula, The objective function value, , These are the weighting coefficients for transverse residual stress and longitudinal residual stress, respectively. , These are the predicted values of transverse residual stress and longitudinal residual stress, respectively. This represents the target value for residual stress.
[0062] The beneficial effects of this invention are as follows:
[0063] This invention provides a method for optimizing heat treatment process parameters of pressure vessels based on interpretable neural networks. Taking the mapping relationship between heat treatment process parameters and residual stress as the research object, it combines adaptive normalization algorithms, genetic algorithms, and an improved SHAP interpretability analysis model to construct an intelligent optimization method integrating prediction, optimization, and interpretation. The method of this invention can achieve high-precision prediction of residual stress after welding heat treatment of pressure vessels, optimized control of key process parameters, and quantitative analysis of the influence of each parameter on residual stress, providing reliable technical support for heat treatment process design and residual stress control. Attached Figure Description
[0064] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0065] Figure 1 This is a flowchart of the method for optimizing the heat treatment process parameters of a pressure vessel in Embodiment 1 of the present invention;
[0066] Figure 2 This is a flowchart illustrating the optimization of the BP neural network prediction model using a genetic algorithm in Embodiment 1 of the present invention;
[0067] Figure 3 This is a topology diagram of the BP neural network prediction model constructed in Embodiment 1 of the present invention;
[0068] Figure 4 The above are comparison charts of the predicted residual stress values and the actual values predicted by the BP neural network prediction model in Embodiment 1 of the present invention; wherein, (a) is a comparison chart of the predicted and actual values of the transverse residual stress, and (b) is a comparison chart of the predicted and actual values of the longitudinal residual stress.
[0069] Figure 5 The following is a trend diagram showing the influence of different process parameters on residual stress obtained in Example 1 of the present invention; wherein, (a) is a trend diagram showing the influence of different process parameters on the contribution rate of transverse residual stress, and (b) is a trend diagram showing the influence of different process parameters on the contribution rate of longitudinal residual stress.
[0070] Figure 6This is the curve of the single objective function changing with the number of iterations when optimizing process parameters using a genetic algorithm in Embodiment 1 of the present invention;
[0071] Figure 7 This is a bar chart showing the error between the predicted residual stress value and the target residual stress value corresponding to the optimal combination of target parameters obtained by using a genetic algorithm to optimize process parameters in Embodiment 1 of the present invention.
[0072] Figure 8 The above are comparison charts of the predicted and actual residual stress values using the BP neural network prediction model in Comparative Example 1 of the present invention; wherein, (a) is a comparison chart of the predicted and actual residual stress values in the transverse direction, and (b) is a comparison chart of the predicted and actual residual stress values in the longitudinal direction. Detailed Implementation
[0073] This invention provides a method for optimizing process parameters of heat treatment for pressure vessels based on interpretable neural networks. To make the objectives, technical solutions, and effects of this invention clearer and more explicit, the invention is further described in detail below. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0074] Example 1
[0075] Reference Figure 1 This embodiment provides a method for optimizing the heat treatment process parameters of pressure vessels based on an interpretable neural network. Taking the mapping relationship between heat treatment process parameters and residual stress as the research object, it combines an adaptive normalization algorithm, a genetic algorithm, and an improved SHAP interpretable analysis model to optimize the heat treatment process parameters of pressure vessels. The specific steps are as follows.
[0076] Step 1: Obtain several heat treatment process parameter data of pressure vessels and corresponding transverse residual stress and longitudinal residual stress data. Use the holding temperature, holding time, heating rate and cooling rate in the heat treatment process parameters as input features, and use the transverse residual stress and longitudinal residual stress as output features to construct data samples, and divide them into training set, validation set and test set.
[0077] This embodiment first collects sample data from experimental measurements and numerical simulation (ABAQUS) results. The input features include: holding temperature T, ranging from 600 to 640℃; holding time t, ranging from 15 to 30 minutes; heating rate V1, ranging from 40 to 56℃ / h; and cooling rate V2, ranging from 40 to 56℃ / h. The output feature is: transverse residual stress. (Value range is 50~150MPa), longitudinal residual stress (Value range is 50~150MPa).
[0078] The total number of samples collected in this embodiment is 1000, and the data is divided into 80% training set, 10% validation set, and 10% test set.
[0079] Step 2: Perform adaptive normalization preprocessing on the data samples constructed in Step 1 to obtain the preprocessed training set, validation set, and test set.
[0080] In this embodiment, the heat treatment process parameters—holding temperature, holding time, heating rate, and cooling rate—varie significantly under different experimental conditions. If a conventional normalization method with fixed mean and standard deviation is used, some features may be over-compressed or amplified, reducing the model's ability to identify differences under different operating conditions and thus lowering prediction accuracy. Therefore, this embodiment proposes an adaptive normalization method that dynamically calculates the mean and standard deviation based on the actual fluctuation range of the input features, making the normalization results more reflective of the true changes of each variable under the given operating conditions. Furthermore, in this embodiment, the mean, standard deviation, and the maximum, minimum, and span values of each input feature required for adaptive normalization are all obtained statistically from the training set samples, while the validation and test sets are processed using the same normalization parameters.
[0081] Specifically, in this step, the input features of heat preservation temperature, heat preservation time, heating rate, and cooling rate are subjected to adaptive normalization preprocessing, and the calculation formula is as follows:
[0082] ;
[0083] ;
[0084] Where i represents the category of input feature, and i represents the holding temperature T, holding time t, heating rate V1, and cooling rate V2, respectively; j is the index of the specific input value in each category of input feature. Let j be the j-th input value of the i-th type of input feature after normalization. Let j be the j-th input value of the i-th type of input feature before normalization. The average value of the input features of the i-th class is... Let be the standard deviation of the input feature of class i. For the adaptive weight coefficients of the i-th type of input features, This is an adjustment coefficient used to gently compensate for the differences in physical span between different input features, with a value range of 0.9 to 1.3. The span value of the i-th type of input feature, i.e. ,and , Let be the maximum and minimum values of the input feature of the i-th class, respectively. The average span value for the input features across all categories.
[0085] Based on the above formula, the input features of heat preservation temperature, heat preservation time, heating rate, and cooling rate obtained in step one are subjected to adaptive normalization preprocessing. Specifically, the heat preservation temperature range is 600~640℃, with a span of 40℃, a mean of 620℃, and a standard deviation of 14.14℃; the heat preservation time range is 15~30 min, with a span of 15 min, a mean of 22.5 min, and a standard deviation of 5.59 min; the heating rate range is 40~56℃ / h, with a span of 16℃ / h, a mean of 49.2℃ / h, and a standard deviation of 6.04℃ / h; and the cooling rate range is 40~56℃ / h, with a span of 16℃ / h, a mean of 49.2℃ / h, and a standard deviation of 6.04℃ / h. Therefore, the average span of the above input features of heat preservation temperature, heat preservation time, heating rate, and cooling rate is... It is 21.75. When the value is 1.1, the adaptive weighting coefficients for the input features of heat preservation temperature, heat preservation time, heating rate, and cooling rate are as follows: , , , .
[0086] The normalized input values for one set of heat treatment process parameters (holding temperature 630℃, holding time 20min, heating rate 50℃ / h, cooling rate 45℃ / h) are 0.62, -0.39, 0.12, and -0.61, respectively.
[0087] Step 3: Establish a BP neural network prediction model and use a genetic algorithm to globally optimize the initial weights and thresholds of the BP neural network prediction model to obtain the optimal weights and thresholds. Use the optimal weights and thresholds as the initial parameters of the BP neural network prediction model and train it using the training set after adaptive normalization preprocessing in Step 2 to obtain a mature BP neural network prediction model. Input the test set into the mature BP neural network prediction model to test and evaluate the final performance of the BP neural network prediction model.
[0088] Reference Figure 2 Step three above specifically includes the following sub-steps:
[0089] Step (3-1): Determine the topology and loss function of the BP neural network prediction model, and randomly generate the initial weights and thresholds of the BP neural network;
[0090] Step (3-2): A genetic algorithm is used to perform a global search for the initial weights and thresholds of the BP neural network prediction model, randomly generating several sets of candidate weights and thresholds as individuals in the population. The training set samples preprocessed in Step 2 are then input into the BP neural network prediction model for forward prediction calculation. The prediction error (MSE) of the BP neural network prediction model is used as the fitness function. After iterative optimization through selection, crossover, and mutation operations, when the fitness improvement rate is <10 for 10 consecutive generations... -4 Stop when the optimal initial weight and threshold combination is obtained;
[0091] Step (3-3): The optimal initial weight and threshold combination determined in step (3-2) is used as the initial parameters of the BP neural network prediction model. The model is trained using the training set preprocessed in step two, and the generalization error of the model is monitored using the validation set preprocessed in step two. This helps determine the termination time of network training and related hyperparameter settings. Training stops when the loss function converges, resulting in a mature BP neural network prediction model. During the training process, the weights and thresholds are continuously adjusted, and the weights and thresholds corresponding to the convergence of the loss function are taken as the optimal solution of the BP neural network prediction model.
[0092] Step (3-4): Input the preprocessed test set from step 2 into the trained and mature BP neural network prediction model obtained in step (3-3) for testing and evaluate the final performance of the BP neural network prediction model.
[0093] Reference Figure 3 The topology of the BP neural network prediction model in step (3-1) above includes an input layer, a hidden layer, and an output layer; the input layer has 4 nodes, the hidden layer has 10 nodes, and the output layer has 2 nodes; the hidden layer uses Sigmoid activation, the output layer uses linear activation, and the loss function is mean squared error (MSE).
[0094] In step (3-2) above, the selected operations are roulette wheel selection, the crossover operation is single-point crossover, and the mutation operation is Gaussian mutation; the termination condition is that the fitness improvement rate is <10 for 10 consecutive generations. -4 .
[0095] Specifically, in this embodiment, the initial weights and thresholds of the BP neural network prediction model are randomly generated by the system. The weight range from the input layer to the hidden layer is approximately -88 to 92, the weight range from the hidden layer to the output layer is approximately -12 to 0.2, and the threshold range is between -84 and 66. Using these randomly initialized weights and thresholds for BP neural network training results in a slow convergence speed due to the highly discrete distribution of weights and thresholds, and the prediction accuracy (comprehensive accuracy based on dual-output residual stress) R... 2 The accuracy is only 0.8344, which is low.
[0096] Based on the aforementioned weight and threshold ranges, a genetic algorithm was used for optimization. The parameters of the genetic algorithm optimization module were set as follows: population size of 50, maximum number of iterations of 100 generations, crossover probability of 0.8, and mutation probability of 0.05. The optimal initial weights obtained after genetic algorithm optimization significantly converged to a smaller range, with the weight range from the input layer to the hidden layer being -0.49 to 0.49, the weight range from the hidden layer to the output layer being -0.43 to 0.48, and the threshold range converging to -0.45 to 0.20. Using these optimal weight and threshold ranges as the initial parameters for training the BP neural network prediction model, the network convergence speed was significantly accelerated, and the prediction accuracy (comprehensive accuracy based on dual-output residual stress) R... 2 The value was increased to 0.9549, which is about 14% higher than the value of the randomly initialized parameters. This indicates that the BP neural network prediction model obtained after optimization by the genetic algorithm can predict residual stress more accurately.
[0097] In addition, such as Figure 4 As shown, the test set is input into the BP neural network prediction model to predict residual stress. Comparing the predicted residual stress values with the actual values reveals a high degree of agreement. Furthermore, calculating the error between the predicted and actual values yields the following results for transverse residual stress: MAE = 2.278, RMSE = 3.340, and R... 2 The value is 0.947; for longitudinal residual stress, the MAE is 3.239, the RMSE is 1.288, and the R... 2 The value is 0.935. This also verifies that the well-trained BP neural network prediction model obtained in this embodiment can accurately predict residual stress.
[0098] Step 4: Based on the improved SHAP interpretable algorithm with physical span weighting and output adaptive normalization, analyze the output results of the mature BP neural network prediction model trained in Step 3, and calculate the contribution rate of each input feature to the output feature.
[0099] Because there is a clear coupling relationship among the various input characteristics of the heat treatment process parameters in this embodiment—holding temperature, holding time, heating rate, and cooling rate—but the value ranges and physical meanings of each input characteristic differ greatly, this embodiment first calculates the contribution of all input characteristics under the same, unified standard, and then makes appropriate corrections based on the physical range of each input characteristic itself, thereby obtaining parameter contribution results that conform to both numerical laws and the heat treatment mechanism.
[0100] This step specifically includes the following sub-steps:
[0101] Step (4-1): Take several sets of data samples from the training set after adaptive normalization preprocessing in Step 2;
[0102] Step (4-2): For each data sample X k First, determine the combination of the input feature category i to be calculated and all other input features except for the i-th type, and generate all feature subsets S of this combination; then, use the well-trained BP neural network prediction model obtained in step three to calculate the predicted values of the transverse and longitudinal residual stresses for each feature subset S and normalize them; simultaneously, add the input feature i to the feature subset S and denote it as... Calculate each feature subset again The predicted values of transverse and longitudinal residual stress are obtained and normalized, and the changes in the predicted values of transverse and longitudinal residual stress after normalization are output respectively. Then calculate X for each data sample group. k The standard SHAP values of the transverse and longitudinal residual stresses of the i-th type of input feature in the output feature;
[0103] The specific calculation process for this step is as follows:
[0104] The predicted values of transverse and longitudinal residual stresses output by the BP neural network prediction model are normalized, and the calculation formula is as follows:
[0105] ;
[0106] In the formula, These are the predicted values of transverse or longitudinal residual stress directly output by the BP neural network prediction model. For normalized predicted values, The mean of the predicted output of transverse or longitudinal residual stress is used to calculate the normalization of the sample set (i.e., the set of data samples selected in step (4-1)) participating in the SHAP prediction value normalization calculation. To output the standard deviation of the transverse or longitudinal residual stress predictions for the sample set participating in the SHAP prediction normalization calculation, To prevent the denominator from being 0, the value is 10. -8 ~10 -4 In this embodiment, the positive number is taken as 10. -6 ;
[0107] For each feature subset The change in the predicted value of transverse or longitudinal residual stress after adding input feature i for:
[0108] ;
[0109] In the formula, N is the set of all category input features, N={T,t,V1,V2}; It represents any subset of features that does not contain input feature i. For data sample X k The predicted values of transverse or longitudinal residual stress corresponding to the feature subset S in the middle. For data sample X k Feature subset The corresponding predicted values of transverse or longitudinal residual stress;
[0110] Data sample X k The standard SHAP values of the transverse residual stress and longitudinal residual stress of the i-th type of input feature for the output feature are as follows:
[0111] ;
[0112] In the formula, For data sample X k The i-th type of input feature corresponds to the standard SHAP value of the transverse or longitudinal residual stress in the output feature. Let S be the number of elements in the feature subset S, and M be the total number of input feature categories, M=4;
[0113] Step (4-3): Determine the span value of the i-th type of input feature and calculate the corresponding feature physical weight coefficient;
[0114] The specific calculation process for this step is as follows:
[0115] Define the span value of the i-th type of input feature as:
[0116] ;
[0117] The feature physical weight coefficient of the i-th type of input feature is:
[0118] ;
[0119] In the formula, Let be the span value of the i-th type of input feature. , Let be the maximum and minimum values of the input feature of the i-th class, respectively. The physical weight coefficients of the input features of the i-th class;
[0120] Step (4-4): Introduce the physical weight coefficients of the i-th type of input features obtained in step (4-3) into the standard SHAP value obtained in step (4-2) to obtain the data sample X for each group. k The comprehensive contribution index of the i-th type of input feature to the output features of transverse residual stress and longitudinal residual stress;
[0121] Comprehensive contribution indicators The calculation formula is:
[0122] ;
[0123] The above comprehensive contribution indicators take into account both statistical effects and physical variability.
[0124] Step (4-5): Take the absolute value of the comprehensive contribution index obtained in step (4-4) and normalize it to obtain the data sample X for each group. k The contribution rate of the i-th type of input feature to the transverse and longitudinal residual stress of the output feature is calculated. Then, the average contribution rate of the i-th type of input feature to the transverse and longitudinal residual stress of the output feature is calculated for all groups of data samples.
[0125] The specific calculation process for this step is as follows:
[0126] Calculate data sample X k The contribution rate of the i-th type of input feature to the output feature, either the transverse residual stress or the longitudinal residual stress:
[0127] ;
[0128] Calculate the average contribution rate of the i-th type of input feature to the output feature, either transverse or longitudinal residual stress, across all data samples:
[0129] ;
[0130] In the formula, For data sample X k The contribution rate of the i-th type of input feature to the output feature, either the transverse residual stress or the longitudinal residual stress. The average contribution rate of the i-th type of input feature to the output feature transverse residual stress or longitudinal residual stress in all data samples, where k is the index of the data sample and n is the total number of data samples;
[0131] Step (4-6): Based on the average contribution rate of various input features to the output features of transverse residual stress and longitudinal residual stress obtained in step (4-5), draw a SHAP summary diagram to intuitively show the contribution order and influence direction of each heat treatment process parameter on the prediction of residual stress.
[0132] The average contribution rate of each input feature to the transverse and longitudinal residual stress of the output feature is calculated through the above steps. Then, the comprehensive average value of the average contribution rate of each input feature to the transverse and longitudinal residual stress is taken to reflect the relative importance of the input feature to the overall control effect of residual stress, as shown in Table 1 below.
[0133] Table 1. Average combined contribution rate of each input feature to the output feature
[0134]
[0135] Analysis of Table 1 above: In this embodiment, the heat preservation temperature and heat preservation time are the main influencing factors (totaling about 83.5%), while the heating rate and cooling rate have a weaker influence (totaling about 16.5%).
[0136] In addition, this embodiment also calculates each data sample X. k The contribution rate of the i-th type of input feature to the output feature, specifically the contribution rate of the transverse and longitudinal residual stresses, is statistically analyzed. The influence of different process parameter values on the transverse and longitudinal residual stresses is also analyzed, such as... Figure 5 As shown. From Figure 5 As can be seen, the influence of different process parameters on residual stress varies significantly. Higher holding temperatures correspond to a negative contribution rate, indicating that increased temperature reduces residual stress; conversely, lower holding temperatures result in a positive contribution rate, increasing residual stress. Holding time also shows a negative contribution rate at higher values, indicating that extending holding time reduces residual stress. Heating rate exhibits the opposite trend, with higher values corresponding to a positive contribution rate, indicating that faster heating increases residual stress. Conversely, higher cooling rates correspond to a negative contribution rate, suggesting that rapid cooling helps reduce residual stress, while slow cooling leads to higher residual stress. Therefore, the improved SHAP in this embodiment not only reveals the importance ranking of each process parameter but also clearly defines the influence direction of each process parameter variable, providing a reliable basis for subsequent process optimization.
[0137] Step 5: Based on the mature BP neural network prediction model obtained in Step 3 and the contribution rate of each input feature to the output feature obtained in Step 4, the genetic algorithm is used to perform multi-objective optimization of the process parameters to obtain the optimal process parameters suitable for post-weld heat treatment of pressure vessels.
[0138] The mature BP neural network prediction model obtained in step three above can predict the corresponding transverse and longitudinal residual stresses based on different combinations of heat treatment process parameters, i.e., predict the post-weld heat treatment effect. The contribution rate of each input feature to the output feature obtained in step four above represents the contribution of each heat treatment process parameter to the residual stress, which can guide the heat treatment optimization process. Specifically, during optimization, process parameters with high contribution rates are prioritized and have a wider search range. Process parameters with lower contribution rates can be fine-tuned within a narrow range, or even remain unchanged during optimization to reduce computational load. Furthermore, the optimization range of process parameters can be subject to both physical and data constraints based on the "input feature-contribution trend." For example, if a significant negative effect occurs when the holding temperature exceeds 630℃, the optimization search range can be limited to T≤630℃. The above SHAP interpretable analysis not only explains the model but also provides an interpretation-driven search strategy for subsequent process optimization, improving the efficiency and reliability of process optimization.
[0139] Specifically, this step includes the following sub-steps:
[0140] Step (5-1): Select the target parameters to be optimized as the input features: heat preservation temperature, heat preservation time, heating rate and cooling rate. Based on the contribution rate of each input feature to the output feature obtained in Step 4, set the optimization range of the target parameters and generate several candidate combinations within the optimization range. Input the candidate combinations into the well-trained BP neural network prediction model obtained in Step 3 to predict the corresponding transverse residual stress and longitudinal residual stress output features.
[0141] Step (5-2): Quantify the relative importance of the output characteristics of transverse residual stress and longitudinal residual stress in the heat treatment process through sensitivity analysis, and convert them into weighting coefficients, thus transforming the dual-objective optimization index of transverse residual stress and longitudinal residual stress into a single-objective function.
[0142] The single-objective function established in this step is:
[0143] ;
[0144] In the formula, The objective function value, , These are the weighting coefficients for transverse residual stress and longitudinal residual stress, respectively. , ; , These are the predicted values of transverse residual stress and longitudinal residual stress, respectively. The residual stress target value is 100 MPa;
[0145] Step (5-3): Substitute the predicted transverse and longitudinal residual stresses from step (5-1) into the single objective function established in step (5-2) to obtain the objective function value. Then, based on the genetic algorithm, use an iterative search method to continuously update the objective parameter combination, so that the objective function value gradually decreases until convergence. Visualize the optimal objective parameter combination and output the predicted results of transverse and longitudinal residual stresses.
[0146] In this embodiment, the optimization range for each target parameter is set as follows: holding temperature 600~640℃, holding time 15~30min, heating rate 40~56℃ / h, and cooling rate 40~56℃ / h. Within this process range, a genetic algorithm is used for optimization. The final optimal combination of heat treatment process parameters is: holding temperature T=613.94℃, holding time t=25.01min, heating rate V1=53.20℃ / h, and cooling rate V2=43.14℃ / h. The predicted residual stress results corresponding to this combination of heat treatment process parameters are: transverse residual stress=99.87MPa, and longitudinal residual stress=100.17MPa.
[0147] Regarding the above optimization results, the holding temperature of 613.94℃ falls within the intermediate level of the set process range for heat treatment. This holding temperature promotes stress relaxation, thereby reducing residual stress. Furthermore, the SHAP results also show a negative change in the SHAP value as the temperature increases, indicating a decrease in residual stress. The holding time of 25 minutes is moderate, allowing sufficient relaxation of internal stress while avoiding the risk of grain coarsening caused by excessively long holding times. SHAP results also show that longer holding times generally result in lower residual stress; therefore, 25 minutes is a reasonable choice, satisfying the relaxation requirements while avoiding performance degradation. For the heating stage, the heating rate of 53.20℃ / h is also in the moderately fast range, helping to control the temperature gradient. Although excessively rapid heating introduces additional thermal stress, while excessively slow heating affects production efficiency, SHAP shows that the heating rate has a relatively weak impact on the results. As long as it is controlled within a reasonable range, 53.20℃ / h is the optimal compromise. During the cooling phase, a cooling rate of 43.14℃ / h is considered moderately fast, which can reduce the reformation of residual stress. SHAP's results also indicate that a faster cooling rate results in lower residual stress, but excessively fast cooling may lead to other defects; therefore, selecting an optimization rate within a safe range is appropriate.
[0148] Through the above optimization, the final residual stresses obtained are 99.87 MPa and 100.17 MPa, respectively, both of which meet the requirements of engineering applications. The combination of process parameters optimized in this embodiment is reasonable in terms of physical mechanism, performs excellently in mathematical optimization, has credibility, and can be directly used in engineering practice.
[0149] Furthermore, in the above optimization process, the curve showing the change of the objective function value with the number of iterations is as follows: Figure 6 As shown. From Figure 6 As can be seen, the value of f decreases continuously with the increase of the number of iterations, indicating that the combination of target parameters is gradually approaching the optimum. When the curve tends to be stable, it indicates that the algorithm has converged, and when it finally stabilizes near the minimum value, it means that the optimal combination of target parameters has been found. This also demonstrates that the optimization method in this embodiment is effective and can automatically find the optimal solution for process parameters. Meanwhile, Figure 7 The absolute and relative errors between the predicted values of transverse and longitudinal residual stress corresponding to the optimal combination of target parameters and the target value of 100 MPa residual stress are displayed intuitively. The errors are extremely small, which indicates that the predicted values of transverse and longitudinal residual stress corresponding to the optimal combination of target parameters are close to the target value of residual stress.
[0150] Comparative Example 1
[0151] The difference between this comparative example and Example 1 is that this comparative example uses a normalized processing method in step two and uses the normalized data samples for training to obtain a well-trained BP neural network prediction model. The rest is the same as in Example 1.
[0152] Reference Figure 8 The test set was input into the BP neural network prediction model obtained in Comparative Example 1 to predict residual stress. Comparing the predicted residual stress values with the actual values, it can be found that the agreement between the predicted and actual values is low. Furthermore, the error between the predicted and actual values was calculated, yielding the following results for transverse residual stress: MAE = 10.063, RMSE = 12.567, and R... 2 The value is 0.764; for longitudinal residual stress, the MAE is 8.570, the RMSE is 10.823, and the R... 2 The value is 0.878. The mature BP neural network prediction model obtained in this comparative example has low prediction accuracy for residual stress, and is significantly lower than the prediction accuracy of Example 1. The comparison of prediction accuracy between Example 1 and Comparative Example 1 also reflects that the adaptive normalization method proposed in this invention is more suitable for processing sample data with relatively large fluctuation ranges of each input feature under different experimental conditions.
[0153] It should be noted that any parts not mentioned in this invention can be achieved by using or referencing existing technologies.
[0154] Of course, the above description is not intended to limit the present invention, and the present invention is not limited to the examples given above. Any changes, modifications, additions or substitutions made by those skilled in the art within the scope of the present invention should also fall within the protection scope of the present invention.
Claims
1. A method for optimizing process parameters of a pressure vessel heat treatment based on an interpretable neural network, characterized in that, The method comprises the steps of: Step one, obtaining a plurality of pressure vessel heat treatment process parameter data and corresponding transverse residual stress and longitudinal residual stress data, taking the heat treatment process parameters of holding temperature, holding time, heating rate and cooling rate as input characteristics, taking the transverse residual stress and longitudinal residual stress as output characteristics to construct data samples, and dividing them into a training set, a validation set and a test set; Step two, performing adaptive normalization preprocessing on the data samples constructed in step one to obtain preprocessed training set, validation set and test set; Step three, establishing a BP neural network prediction model, and using a genetic algorithm to globally optimize the initial weights and thresholds of the BP neural network prediction model to obtain optimal weights and thresholds, using the optimal weights and thresholds as the initial parameters of the BP neural network prediction model, and using the preprocessed training set in step two for training to obtain a mature BP neural network prediction model; the preprocessed test set in step two is input into the mature BP neural network prediction model for testing to evaluate the final performance of the BP neural network prediction model; Step four, using an improved SHAP interpretable algorithm based on physical span weighting and output adaptive normalization to analyze the output results of the mature BP neural network prediction model in step three, and calculating the contribution rate of each input characteristic to the output characteristic; Step five, based on the mature BP neural network prediction model obtained in step three and the contribution rate of each input characteristic to the output characteristic obtained in step four, using a genetic algorithm to perform multi-objective optimization on the process parameters to obtain optimal process parameters suitable for pressure vessel post-weld heat treatment; The adaptive normalization formula in step two is: ; ; wherein i represents the category of input features, i respectively represents the holding temperature T, the holding time t, the heating rate V1 and the cooling rate V2; j is the serial number of the specific input value in each category of input features, is the jth input value of the ith normalized input feature, is the jth input value of the ith input feature before normalization, is the average value of the ith input feature, is the standard deviation of the ith input feature, is the adaptive weight coefficient of the ith input feature, is the adjustment coefficient, is the span value of the ith input feature, i.e. , and , are respectively the maximum value and the minimum value of the ith input feature, is the average span value of the input features of all categories; Step four specifically comprises the following sub-steps: Step (4-1), taking a plurality of data samples from the preprocessed training set in step two; Step (4-2), for each group of data samples X k , determine the combination of the input feature class i to be calculated and all other input features except the i-th input feature, and generate all feature subsets S of the combination; calculate the prediction value of each feature subset S using the trained BP neural network prediction model obtained in step three and normalize the processing; at the same time, add the input feature i to the feature subset S and mark it as , calculate the prediction value of each feature subset again and normalize the processing, and output the change amount of the normalized prediction value ; then calculate the standard SHAP value of the i-th input feature to the output feature in each group of data samples X k ; Step (4-3), determining the span value of the i-th input characteristic and calculating the corresponding characteristic physical weight coefficient; Step (4-4), introducing the feature physical weight coefficient of the i-th input feature obtained in step (4-3) into the standard SHAP value obtained in step (4-2) to obtain the comprehensive contribution index of the i-th input feature to the output feature of each group of data samples X k Step (4-4), introducing the feature physical weight coefficient of the i-th input feature obtained in step (4-3) into the standard SHAP value obtained in step (4-2) to obtain the comprehensive contribution index of the i-th input feature to the output feature of each group of data samples X k Step (4-4), introducing the feature physical weight coefficient of the i-th input feature obtained in step (4-3) into the standard SHAP value obtained in Step (4-5), taking absolute value and normalizing the comprehensive contribution index obtained in step (4-4) to obtain each group of data samples X k The average contribution rate of the i-th input feature to the output feature is obtained by averaging the contribution rate of the i-th input feature to the output feature in all groups of data samples. Step (4-6), according to the average contribution rate of each input characteristic to the output characteristic obtained in step (4-5), drawing a SHAP summary chart to intuitively display the contribution order and influence direction of each heat treatment process parameter on residual stress prediction; The prediction value output by the BP neural network prediction model in step (4-2) is normalized, and the calculation formula is: ; In the formula, is the prediction value directly output by the BP neural network prediction model, is the normalized prediction value, is the mean of the prediction output of the sample set participating in the SHAP prediction value normalization calculation, is the standard deviation of the prediction output of the sample set participating in the SHAP prediction value normalization calculation, is a constant, and the value is 10 -8 ~10 -4 .
2. The method of claim 1, wherein the method is characterized by: Step three specifically comprises the following sub-steps: Step (3-1), determining the topological structure and loss function of the BP neural network prediction model, and randomly generating the initial weights and thresholds of the BP neural network; Step (3-2), using genetic algorithm to globally search the initial weights and thresholds of the BP neural network prediction model, randomly generating several groups of candidate weights and thresholds as population individuals, and inputting the preprocessed training set samples into the BP neural network prediction model for forward prediction calculation, taking the prediction error of the BP neural network prediction model as the fitness function, and iteratively optimizing through selection, crossover and mutation operations, stopping when the continuous 10 generations of fitness improvement rate is <10 -4 , and obtaining the optimal initial weight and threshold combination; Step (3-3), combining the optimal initial weights and thresholds determined in step (3-2) as the initial parameters of the BP neural network prediction model, using the preprocessed training set in step two for training, and simultaneously using the preprocessed validation set in step two to monitor the model generalization error, to assist in determining the network training termination time and related hyperparameter settings, until the loss function converges, the training is stopped, and a mature BP neural network prediction model is obtained; and the weights and thresholds are adjusted during the training process, and the weights and thresholds corresponding to the converged loss function are used as the optimal solution of the BP neural network prediction model; Step (3-4), the test set after pretreatment in step two is input into the trained BP neural network prediction model obtained in step (3-3) for testing, so as to evaluate the final performance of the BP neural network prediction model.
3. The method of claim 2, wherein the method is characterized by: The BP neural network prediction model established in step (3-1) comprises an input layer, a hidden layer and an output layer, the hidden layer adopts Sigmoid activation, the output layer adopts linear activation, and the loss function is a mean square error (MSE) function.
4. The method of claim 1, wherein the method is characterized by: The specific calculation process of step (4-2) is as follows: For each feature subset , the change in the predicted value after adding input feature i is : ; where N is the set of all input features of the class, denotes any subset of features excluding the i-th input feature, is the prediction value corresponding to the feature subset S in the data sample X k is the prediction value corresponding to the feature subset S in the data sample X is the prediction value corresponding to the feature subset S in the data sample X k is the prediction value corresponding to the feature subset S in the data sample X is the prediction value corresponding to the feature subset S in the data sample X Data sample X k The standard SHAP value of the ith input feature on the output feature is: ; wherein is the data sample X k is the standard SHAP value of the i-th input feature on the output feature, is the number of elements of the feature subset S, and M is the total number of input feature categories.
5. The method of claim 4, wherein the method is characterized by: The specific calculation process of step (4-3) is as follows: The span value of the ith input feature is defined as: ; The feature physical weight coefficient of the ith input feature is: ; In the formula, is the span value of the i-th input feature, , is the maximum value and the minimum value of the i-th input feature, respectively, is the feature physical weight coefficient of the i-th input feature. The step (4-4) synthesizes the contribution indexes The calculation formula is: 。 6. The method of claim 5, wherein the method is characterized by: The specific calculation process of step (4-5) is as follows: Computing data samples X k Contribution rate of the i-th input feature to the output feature: ; The average contribution rate of the ith input feature to the output feature in all data samples is calculated as: ; wherein is the data sample X k is the contribution rate of the i-th input feature to the output feature in the data sample X is the average contribution rate of the i-th input feature to the output feature in all data samples, k is the serial number of the data sample, and n is the total number of data samples.
7. The method of claim 1, wherein the method is based on an interpretable neural network. Step five specifically comprises the following sub-steps: Step (5-1), the target parameters to be optimized are selected as the input features of holding temperature, holding time, heating rate and cooling rate, the optimization range of the target parameters is set according to the contribution rate of each input feature to the output feature obtained in step four, and a plurality of candidate combinations are generated in the optimization range, the candidate combinations are input into the trained BP neural network prediction model obtained in step three, and the corresponding transverse residual stress and longitudinal residual stress output features are predicted; Step (5-2), the relative importance of the transverse residual stress and longitudinal residual stress output features in the heat treatment process is quantified through sensitivity analysis, and is converted into a weight coefficient, and the double-target optimization index of the transverse residual stress and longitudinal residual stress is converted into a single-target function; Step (5-3), the transverse residual stress and longitudinal residual stress predicted in step (5-1) are substituted into the single-target function established in step (5-2) to obtain a target function value, and the target parameter combination is constantly updated based on the genetic algorithm in an iterative search manner, so that the target function value gradually decreases until convergence, and the optimal target parameter combination is obtained, and the transverse residual stress and longitudinal residual stress prediction results are output.
8. The method of claim 7, wherein the method is characterized by: The single-target function established in step (5-2) is: ; In the formula, is the target function value, , are weight coefficients of the transverse residual stress and the longitudinal residual stress, respectively; , are predicted values of the transverse residual stress and the longitudinal residual stress, respectively, is the target value of the residual stress.
Citation Information
Patent Citations
Wind power interval prediction and interpretable method considering space-time correlation
CN116937579A
Nuclear power plant state prediction method based on interpretable machine learning
CN117390390A