Physics-informed neural network with transfer learning (TL-PINN) based on domain similarity measure for prediction of nuclear reactor transients

Nuclear reactor safety and efficiency can be enhanced through the development of accurate and fast methods for prediction of reactor transient (RT) states. Physics informed neural networks (PINNs) leverage deep learning methods to provide an alternative approach to RT modeling. Applications of PINNs in monitoring of RTs for operator support requires near real-time model performance. However, as with all machine learning models, development of a PINN involves time-consuming model training. Here, we show that a transfer learning (TL-PINN) approach achieves significant performance gain, as measured by reduction of the number of iterations for model training. Using point kinetic equations (PKEs) model with six neutron precursor groups, constructed with experimental parameters of the Purdue University Reactor One (PUR-1) research reactor, we generated different RTs with experimentally relevant range of variables. The RTs were characterized using Hausdorff and Fréchet distance. We have demonstrated that pre-training TL-PINN on one RT results in up to two orders of magnitude acceleration in prediction of a different RT. The mean error for conventional PINN and TL-PINN models prediction of neutron densities is smaller than 1%. We have developed a correlation between TL-PINN performance acceleration and similarity measure of RTs, which can be used as a guide for application of TL-PINNs.


Results
Five nuclear reactor transients (RT-1, RT-2, RT-3, RT-4, and RT-5) were generated using ODE45 FDM solver of PKEs, which were constructed using experimental parameters of PUR-1.All five reactor transients consist of 742 s-long transients of neutron density n(t) and delayed neutron precursor density concentration c i (t) for six groups.All RTs were generated via a positive reactivity insertion, as discussed in the Methods section.The range of values of n(t) in all RTs is consistent with order of magnitude of typical experimental observations of PUR-1 operation.Transients of reactivity insertion schedules for five RTs are plotted on the normalized time domain t ∈ [0, 1] s in Fig. 1a.Resulted transients of n(t) , scaled in the amplitude in the range of [0, 0.4] n/cm 2 s , are shown in Fig. 1b.
For RT-1, n(t) initially rises with approximately six-fold increase in the amplitude, reaching the maximum value at approximately 250 s (when reactivity begins to decrease), followed by decay to steady state.For RT-2, where the initial reactivity is larger by 70 pcm than that for RT-1, n(t) increases by approximately a factor of 10, reaching the maximum value at approximately 280 s (when reactivity insertion begins to decrease), followed by decay to steady state.For RT-3, where the initial reactivity insertion is larger than that for RT-2 by 20 pcm, n(t) increases by approximately a factor of 15, reaching the maximum value at approximately 270 s (when reactivity insertion begins to decrease), followed by decay to steady state.For RT-4, where the initial reactivity is larger than that of RT-3 by 10 pcm, n(t) increases by approximately a factor of 17, reaching the maximum value at approximately 250 s (when reactivity insertion begins to decrease), followed by decay to steady state.For RT-5, where the initial reactivity insertion is the same as for RT-4, but with later reactivity insertion reduction, n(t) increases by approximately a factor of 19, with the maximum value achieved at approximately 300 s (when reactivity insertion begins to decrease), followed by decay to steady state.
Using five RTs, we performed 25 numerical experiments, in which the PINN algorithms were developed to predict n(t) and c i (t) for six groups.As discussed in the Methods section, PINN was implemented using a fully connected feed forward neural network (FFNN).The list of Experiments indicating the training and testing domains in given in Tables 1 and 2 in the Discussion section.Examples of PINN performance (without transfer learning) are displayed in Fig. 2 for Experiments 1 and 16, which involve predictions of RT-1 and RT-4, respectively.
In Experiment 1, PINN algorithm required 95,000 iterations to converge, with training/prediction wall time of 62.94 s. Figure 2a display n(t) along with PINN training points and predictions.One can observe that PINN predictions closely follow the transients of n(t) for the entire computational domain.Similar results, not shown here, were obtained for other six groups c 1 (t) through c 6 (t) .Figure 2c displays the graphs of convergence of training and testing losses, and the test metric.The training and testing losses start at the value of 1.63 × 10 2 and decrease to the values of 6.58 × 10 -5 and 8.08 × 10 -5 , respectively.The test metric starts at the value of 1 and decreases to the value 1.19 × 10 -4 .The training and testing losses, and the test metric decrease by factors of 10 7 and 10 6 , respectively, which suggests low errors for the PINN algorithm tracking of RT-1. Figure 2e shows the residual error for n(t) .The largest outlier error is approximately 6%, while the majority of errors are below 1%.In Experiment 16, PINN algorithm required 95,000 iterations to converge (same as for Experiment 1), with the training/prediction wall time of 68.36 s (slightly larger than for Experiment 1).The results in Fig. 2b display n(t) transient along with PINN training points and predictions.One can observe that PINN predictions closely follow n(t) for the entire computational domain.Similar results, not shown here, were obtained for other six groups c 1 (t) through c 6 (t) .Figure 2d displays evolution of losses during 95,000 iterations.The training and test- ing losses start at the value of 1.85 × 10 2 , and decrease to the values of 5.47 × 10 -5 and 8.89 × 10 -5 , respectively.The test metric starts at the value of 1 and decreases to the value of 2.67 × 10 -4 .The training and testing losses, and the test metric decrease by a factor of 10 7 and 10 6 , respectively, which suggests low performance errors of the PINN algorithm.Figure 2f shows the residual error for n(t) .The majority of the errors is below 1%.The largest error appears to be an outlier, with the value of slightly above 6%, which occurs for prediction at the start of the transient.
Examples of TL-PINN performance for Experiment 4 where RT-1 was predicted with the TL-PINN model pre-trained on RT-4, and Experiment 17 where RT-4 was predicted with TL-PINN model pre-trained on RT-1, are displayed in Fig. 3.In Experiment 4, we obtained similar results for predictions of n(t) as those shown in Fig. 2a.In contrast to Experiment 1, the TL-PINN algorithm required 9000 iterations to converge in training on RT-1, with the training/prediction wall time of 5.06 s. Figure 3a displays the history of loss for up to 9000 iterations.The train and test loss have initial values of 3.68 and decrease to 1.65 × 10 -4 and 1.64 × 10 -4 , respectively.The test metric starts at the value of 1.29 × 10 -1 and decreases to 2.25 × 10 -4 .The train and test loss, and test metric decrease by factor of 10 4 to 10 3 , respectively, which gives an expectation of low performance errors of PINN algorithm.Figure 3c shows the residual percentage error plot of the neutron density concentration n(t) .The largest outlier error is approximately 8.5%, but the majority of the errors are below 1%.
In Experiment 17, we obtained similar results for predictions of n(t) and c i (t) as those shown in Fig. 2a and b.In contrast to Experiment 16, the TL-PINN algorithm required 18,000 iterations to converge in training on RT-4, with the training/prediction wall time of 9.83 s. Figure 3b displays the history of loss after 18,000 iterations.The train and test loss start at the value of 5.35 × 10 -1 and decreases to 2.05 × 10 -4 and 2.07 × 10 -4 , respectively.The test metric starts at 1.14 × 10 -1 and decreases to 4.74 × 10 -4 .The train and test losses, and test metric decrease by a factor of 10 3 , which gives an expectation of low errors in PINN prediction.Figure 3d displays the residual percentage error plot of n(t) , randomly sampled at 127 points.The largest outlier error of approximately 5.5%, but the majority of errors are below 1%.convergence was determined to be 0.0003, while the learning rate for TL-PINN models in the 6th column of Table 1 ranges from 0.0001 to 0.002.Columns 7, 8, 9, and 10 list the values of model runtimes (wall clock), train loss calculated as MSE, test loss calculated as MSE, and test metric calculated as L 2 , respectively.According to the results in Table 1, the pre-trained TL-PINN models require fewer iterations for convergence compared to conventional PINN models.In Experiments 2 to 5, TL-PINN models predicting RT-1 converge after 4000, 7000, 9000, and 10,000 iterations, respectively, as compared to 95,000 iterations for a PINN model in Experiment 1.This represents a nearly tenfold to 24-fold acceleration in prediction of RT-1 if another transient was previously learned.The training/testing time for RT-1 prediction decreases from approximately 63 s with PINN to approximately 2-6 s with TL-PINN, which places TL-PINN performance in the range of near real-time operation.
In Experiments 7 to 10, TL-PINN models predicting RT-2 converge after 3000, 4000, 5000, and 6000 iterations, respectively, as compared to 95,000 iterations for a PINN model in Experiment 6.This represents a nearly 16-fold to 32-fold acceleration for prediction of RT-2 if another transient was previously learned.The training/ testing time for prediction of RT-2 decreases from approximately 64 s with PINN to approximately 2-4 s with TL-PINN, which places TL-PINN performance in the range of near real-time operation.
Similar performance acceleration is achieved for TL-PINN models predicting RT-3, RT-4, and RT-5.For almost all RTs, the train losses, test losses, and test metrics are approximately an order of magnitude smaller for conventional PINNs relative to TL-PINNs, mainly due to the different convergence criteria.Experiments 14, 19, 22, 23, 24, and 25 that utilize TL-PINN models, achieve similar or lower train losses, test losses, and test metrics compared to conventional PINN models.
As an example, we consider an operational sequence consisting of the transient RT-1 followed by the transient RT-2.Using PINNs only (Experiments #1 and #6 in Table 1) would require 95,000 iterations for predicting each transient, for a total of 190,000 iterations in this operational scenario.On the other hand, using TL-PINN for RT-2 pre-trained on RT-1 (Experiment #7 in Table 1) would involve 5000 iterations, reducing the total number of iterations in this operational scenario to 100,000.
Table 2 lists the mean residual errors for PINN and TL-PINN predictions of 25 neutron and 150 neutron precursor densities for RT-1, RT-2, RT-3, RT-4, and RT-5.For all five RTs, the mean residual errors for PINN and TL-PINN predictions are of the same order of magnitude for respective variables.The general trend is that for all cases, the average for n(t) is slightly larger for predictions with TL-PINN.However, the average errors in prediction of n(t) for all 25 experiments in this study are below 1%, which is sufficient accuracy for reactor monitoring.The average errors in prediction of n (t) with PINN are in the range 0.33 to 0.61%, and the errors in predictions of n(t) with TL-PINN are in the range 0.41 to 0.87%.The errors for 146 neutron precursor densities range from 0.0029 to 0.92%.The exceptions are outliers for TL-PINN predictions of four neutron precursor densities c 6 with mean errors of 1.09%, 1.46%, 2%, and 2.18%.Unlike neutron density, the precursor density is not experimentally measurable.The average residual errors in predictions of c i (t) are generally smaller than those of n(t) .The general trend for all five RTs is that the errors for c i (t) are larger for predictions with TL-PINNs compared to those of conventional PINNs.
To elucidate the criteria for performance of transfer learning for different domains, we calculated the Hausdorff distance similarity measure between different RTs.Table 3 lists the values of Hausdorff distance similarity measure between scaled RTs, as shown in Fig. 1b.Hausdorff distance is symmetric, with zero value indicating maximum similarity between two curves.According to the values of Hausdorff distance, RT-1 is most similar to RT-2, with similarity progressively decreasing RT-3 and RT-4, and RT-5.For RT-2, the order of transients in decreasing similarity is RT-3, RT-1, RT-4 and RT-5.RT-3 is most similar with RT-4.RT-5 is most similar to RT-3, but shows the largest Hausdorff distance value among all RTs.
Figure 4a shows the number of iterations for TL-PINNs' convergence as a function of the Hausdorff distance.The data points were divided into two groups to highlight the following trend.Group 1 includes the results where TL-PINN was pre-trained on RTs with lower respective amplitudes than those of the predicted RTs.Group 2 includes the cases where TL-PINN algorithms were pre-trained on RTs with larger respective amplitudes than those of the predicted RTs.TL-PINNs of Group 1 needed more iterations to converge compared to TL-PINNs of Group 2 for all experiments except experiment 19.In addition, the statistical measure R 2 of the linear regression was calculated.The best linear fit to data in Fig. 4a has the value of R 2 = 0.41 .The relation between Hausdorff distance and transfer learning performance does not appear to be linear, but the general trend is that smaller Hausdorff distances between RTs correlates with better transfer learning performance.
To further demonstrate the trends, the data for Groups 1 and 2 in Fig. 4a was decomposed into Fig.4b and  c, respectively.Figure 4b indicates that as Hausdorff distance value becomes larger, the number of iterations needed for TL-PINN algorithms to converge fluctuates to larger values.More specifically, the relation between Hausdorff distance and transfer learning performance does not seem to be linear, as the iterations needed for convergence gradually increase but decline in four cases to lower values when the Hausdorff distance is equal to 0.105, 0.161, 0.202, and 0.272.However, a pattern shows that usually when Hausdorff distance is shorter, better transfer learning performance is achieved.The plotted line shows the best linear fit to data and has the value of R 2 = 0.57 .Figure 4c shows that as Hausdorff distance value becomes larger, the number of iterations needed for TL-PINN algorithms to converge increases or remain the same for every experiment tested, except experiment 15.The relation between Hausdorff distance and transfer learning performance appears to be linear.The strong relation is captured by the plotted best linear fit line that has the value of R 2 = 0.87.
In the numerical experiments conducted in this study it was found that the best TL-PINN performance was obtained when using the smallest Hausdorff distance pre-trained on RTs with smaller maximum amplitude than the predicted RTs.According to these results, in a real-world scenario, the reactor operator should be able to identify the most suitable pre trained TL-PINN algorithm for a target RT, using the Hausdorff distance metric and the maximum amplitude of target RT.
Furthermore, TL-PINN algorithms presented low computational time (ranging from 0.2 to 10 s) that can offer near real-time operation using conventional hardware.Real-world nuclear applications that leverage higher-level hardware, can potentially minimize the TL-PINN runtime from seconds to milliseconds, achieving real-time prediction.In the future work, we will investigate prediction of experimental PUR-1 transients using TL-PINN model pre-trained using computer simulations of different transients.We anticipate that the error in TL-PINN predictions will depend on the degree of agreement between the DE model and the experimental observations.

Point kinetics equations (PKEs)
The PKEs consist of a system of stiff nonlinear coupled differential equations, which model the kinetics of reactor variables, including neutron density concentration, the delayed neutron precursor density concentration for six groups, and reactivity.PKEs are the reduced order model of the Boltzmann neutron transport equation and the Bateman equation describing 3D spatial and temporal kinetics of a nuclear reactor.The PKEs are derived under the approximation that both the shape of the neutron flux and the neutron density distribution are ignored, thus assuming that the reactor acts as a point 30 .This approximation is generally valid for small reactors under the Table 3. Hausdorff distance similarity measure between RT-1, RT-2, RT-3, RT-4, and RT-5.where, n represents the neutron density concentration, c i is the delayed neutron precursor density concentration for group i , ρ is the reactivity feedback which is function of time t , β i is the delayed neutron fraction for each group, β = β i is the sum of the delayed neutron fractions.In addition, is the mean neutron lifetime in the reactor core, and i is the mean neutron precursor lifetime for each group i .At time t = 0 , the reactor is in steady state, and we use the following initial conditions 30 : where the values of β i , i , and are suggested by the experimental data.In most systems, β i /( i • �) ≫ 1, and therefore under steady state conditions we obtain c i ≫ n 30 .Because of stiffness of the ODE system, numerical solution of the PKEs requires using relatively small time steps in the computational domain to achieve accurate solution.
(1) Reactivity ρ defined as the deviation of an effective multiplication factor k eff from unity, is a measure of the state of a reactor relative to critical state 30 .When ρ < 0 the reactor is subcritical, when ρ = 0 the reactor is critical, and when ρ > 0 the reactor is supercritical.Reactivity is a dimensionless number, but it is commonly expressed in per cent mile or pcm units.
In this work, we generate five RTs (RT-1, RT-2, RT-3, RT-4, and RT-5), which are responses to five different reactivity insertion schedules.All reactivity curves start with positive values, with the range of initial values between 500 and 600 pcm.The reactivity curves remain constant for approximately the first 200 s, gradually decreases to zero value between 200 and 500 s, and remains at zero until the end of the transient at 742 s.In developing reactivity insertion schedules, the objective was to obtain five different neutron density transients with values in the range of typical experimental observations for PUR-1 operation.Because Python library computations are performed on normalized time domain t ∈ [0, 1] s, as discussed in the Methods section, the reactivity values were scaled to be two orders of magnitude higher than typical values of PUR-1.Table 4 lists the reactivity schedule equations in the normalized time domain, and neutron density initial conditions for the five reactor transients.

Purdue university reactor number one (PUR-1)
PUR-1 is an all-digital 10kWth material test reactor (MTR) -pool type, with flat plate type fuel by BWXT Technologies 31 .Fuel material consists of high essay low enriched uranium (19.75% 235 U) in the form of U 3 Si 2 -Al.There are 16 total assemblies, where each standard assembly has up to 14 fuel elements.The core is submerged into a 5.2 m deep water pool, where water is used for both neutron moderation and fuel heat removal.Average thermal neutron flux in the fuel region is 1.2 × 10 10 n/cm 2 •s, with the maximum thermal flux reaching the value of 2.1 × 10 11 n/cm 2 •s.The reactor power is controlled with three control rods.Two of them are borated stainless steel shim safety rods (SS1 and SS2), and the third one is 304 stainless steel regulating rod (RR).Figure 5 shows a schematic drawing of PUR-1 and an inset panel with the relative locations of the fuel elements and control rods.In principle, correlations can be established between reactivity and position of control rods 21 .
The PKEs with six groups of delayed neutron precursors were constructed using coefficients obtained from MCNP simulations of PUR-1.The values of β i and i are listed in Table 5, while = 1.2 • 10 10 s.

Physics-informed neural network (PINN) architecture
The architecture of PINN algorithm developed in this paper is shown in Fig. 6.The PINN is consisted of the surrogate and the residual network.The input of the surrogate network is a point in the computational time domain, also called the collocation point.A feed-forward neural network (FFNN) delivers the PKEs approximated solution, that is the state vector [n(t), c 1 (t), c 2 (t), c 3 (t), c 4 (t), c 5 (t), c 6 (t)] T .The weights of the surrogate network are trainable.The input to the residual network is the output of the surrogate network.The residual network includes the governing PKEs and the ICs, and calculates the residual that is used as a loss function to optimize the surrogate network.The loss function L is defined by the sum of the mean squared residual of the governing equations and initial conditions.The total loss is written as: where w f and w i are the scalar weights for the ODEs and the ICs, respectively.The scalar weights keep the loss terms balanced at the start of the training, so each term contributes equally.The FFNN's weights and biases are the parameter θ.The variables T f and T i are the training points inside the domain and at the IC's.These sets of points are referred to as the residual points.The terms L f and L i are the mean squared error (MSE) of the residuals for the ODEs and ICs, respectively: where u is the approximate numerical solution obtained from the surrogate network.The derivatives in the loss function are calculated using automatic differentiation.In this work, PINN implementation is based on FFNN, consisting of four-layers with hyperbolic tangent (tanh) as the activation function.The same activation function is applied to all layers, except for the output layer, which does not use any activation function.The FFNN input layer comprises of a single input variable, which is a point in the time domain.The hidden layers consist of 32 neurons.The output layer produces the final prediction of seven quantities, which are the neutron density concentration n and the delayed neutron precursor's density concentration c i for six groups.The Xavier Glorot method is used to initialize the weights of the FFNN, which is the most suitable initialization method when tanh is the activation function 32 .The Adam optimizer with a learning rate of = 0.0003 is used to minimize the loss function.The training data set is obtained using the ODE45 solver, and consists of 32 collocation points.The training data are divided into 30 training points inside (5) L(θ ; T) = w f L f θ; T f + w i L i (θ; T i ),    Table 6.Sequence of steps in PINN and TL-PINN algorithms.
Step # PINN procedure Step 1 Specify the computational domain Step 2 Specify the system of ODEs Step 3 Specify the training data, their distribution, and volume Step 4 Construct a FFNN Step 5 Define a model by combining the system of ODEs and the FFNN Step 6 Set the optimization hyperparameters Step 7 Train the network using specified initialization Step 8 Predict the ODEs solution Step 9 Save the model -TL-PINN procedure Step 10 Repeat steps 1-6 Step 11 Restore model from Step 9 Step 12 Train the network using restored model's initialization Step 13 Predict the ODEs solution

Figure 2 .
Figure 2. (a) Experiment 1: RT-1 n(t) along with PINN training points and predictions. (b) Experiment 16: RT-4 n(t) along with PINN training points and predictions. (c) Experiment 1: History of the training (blue) and testing (orange) losses, and the test metric (green) for PINN.(d) Experiment 16: History of the training (blue) and testing (orange) loss, and the test metric (green) for PINN algorithm.(e) Experiment 1: Residual error of n(t) at randomly sampled 127 points. (f) Experiment 16: Residual error of n(t) at randomly sampled 127 points.

Figure 3 .
Figure 3. (a) Experiment 4: History of the loss function of TL-PINN for training (blue) and testing (orange) loss, and the test metric (green).(b) Experiment 17: History of the loss function of TL-PINN for training (blue) and testing (orange) loss, and test metric (green).(c) Experiment 4: Residual error plot of n(t) randomly sampled at 127 points.(d) Experiment 17: Residual error plot of n(t) at randomly sampled 127 points.
0.174 0.138 0.161 0 condition of relatively small reactivity insertion.Solution of PKEs provides information of the nuclear reactor power level and the power fluctuation during reactivity transient.The PKEs for i groups of delayed neutrons are given as30 :

Figure 4 .
Figure 4. (a) Number of iterations for convergence vs. Hausdorff distance.Group 1: TL-PINNs were pretrained on RTs with lower respective amplitudes than those of the predicted RTs.Group 2: TL-PINNs were pre-trained on RTs with larger respective amplitudes compared to the predicted RTs.The linear regression fit is R 2 = 0.41 .(b) Number of iterations for convergence vs. Hausdorff distance for the TL-PINN for Group 1.The best linear fit has R 2 = 0.57 .(c) Number of iterations for convergence vs. Hausdorff distance for Group 2. The best linear fit has R 2 = 0.87.

Figure 6 .
Figure 6.Schematic of PINN for solving the PKEs with ICs.The input to surrogate network is time t, and the output is the solution vector [n(t), c 1 (t), c 2 (t), c 3 (t), c 4 (t), c 5 (t), c 6 (t)] T .The residual network tests if the solution vector satisfies the PKE governing equations and the ICs.

Table 1 .
Model structures, reactor transients, computational costs, MSEs, and relative errors.The total number of iterations in an operational sequence can be obtained by adding the corresponding number of iterations for PINN and TL-PINN models.
Vol.:(0123456789) Scientific Reports | (2023) 13:16840 | https://doi.org/10.1038/s41598-023-43325-1DiscussionIn this paper, we have demonstrated that TL-PINN, allows for significant acceleration of model training and testing.Five different RTs were generated via ODE45 solution of PKEs with coefficients taken from PUR-1.The transients, RT-1, RT-2, RT-3, RT-4, and RT-5, consist of reactor response to positive reactivity insertion.Summary of results of numerical experiments is presented in Table 1.The hypothetical sequence of operations involves two reactor transients.The first transient is predicted with PINN, and the second transient is predicted with TL-PINN.Acceleration of performance is achieved when using TL-PINN to predict the second transient instead of a PINN.Numerical experiments 1, 6, 11, 16, and 21 present the results for the first transient prediction with PINN, which provide the baseline performance metrics for TL-PINN performance evaluation.Numerical experiments in which the second transient is predicted with TL-PINN are grouped by the predicted RT.The 5th column ofTable 1 lists the number of iterations for convergence.The learning rate for PINN models to reach

Table 5 .
Parameters of PUR-1 for the PKE model development.