Prediction of System-Level Energy Harvesting Characteristics of a Thermoelectric Generator Operating in a Diesel Engine Using Artiﬁcial Neural Networks

: This study evaluated the potential of artiﬁcial neural networks (ANNs) to predict the system-level performance of a thermoelectric generator (TEG), whose performance depends on various variables including engine load, engine rotation speed, and external load resistance. Therefore, a Python code was developed to determine an optimal ANN structure by tracking the training/prediction errors of the ANN as a function of the number of hidden layers and nodes of hidden layers. The optimal ANN was trained using 484 output current ( I )–load resistance ( R ) datasets obtained under three different engine rotation speeds and ﬁve different engine loads. The prediction accuracy of the ANN was validated by comparing 88 I–R datasets reproduced by the ANN using experimental data that were not used for training. In the validation procedure, differences of only 3.49% and 2.59% were observed in the experimental and ANN-predicted output power obtained for the 1000 rpm–0.8 MPa brake mean effective pressure (BMEP) and 1500 rpm–0.4 MPa BMEP scenarios, respectively. The exhaust gas ﬂow characteristics were used for training and validation to predict the pumping loss caused by the installation of the TEG in the middle of the exhaust tailpipe with high accuracy. The results demonstrated that the ANN effectively reproduced datasets to ﬁll the gaps between the discretized experimental results for all the experimental scenarios without any noticeable overﬁtting and underﬁtting. The net power gain obtained by the ANN exhibited a clear peak point for the engine rotation speed of 2000 rpm, which is difﬁcult to obtain using experimental data.


Introduction
The thermoelectric generator (TEG) has received considerable attention because of its advantages of direct energy conversion into electricity, compact system configuration, flexible scalability, and solid-state conversion mechanism. Thus, the TEG is considered one of the promising candidates for mitigating global warming, environmental pollution, and fuel scarcity, in addition to the organic Rankine cycle [1] and turbo-compound system [2]. Owing to advances in material science, module fabrication methods [3], and optimal system design methods [4], the performance of thermoelectric energy harvesting systems has been improving rapidly.
One of the most significant challenges in the application of TEGs in the industry is the necessity of a method to predict variations in the system-wise performance of the TEG as a function of the engine operating conditions. This is because the use of a TEG can cause unexpected effects, such as negative net power gain and/or a significant increase in the backpressure in the tailpipe under certain engine operating conditions [5]. Therefore, because of filters and catalysts that are used to reduce exhaust gas emissions, strict guidelines must be followed when designing the internal structures of a TEG considering the temperature and flow rate of heat sources [6]. In our previous studies, conducted with Hyundai Motor Company to develop TEGs for automotive applications [7], internal finned structures and flow straighteners were designed to maintain the increase in backpressure caused by the TEG below the maximum allowable limits under the most frequently used engine operating conditions. Furthermore, it is challenging to establish an optimal TEG operating environment using a bypass device to maximize the net power gain of the TEG, even with an identical heat source [8]. To maximize the net output power by minimizing the negative effects, it is essential to acquire the detailed performance characteristics of the TEG as a function of the engine load and rotation speed. These determine the temperature and flow rate of the exhaust gas flow induced into the TEG. A promising candidate for predicting the nonlinear characteristics of TEGs, which depend on various variables, with high accuracy is an artificial neural network (ANN). Angeline et al. [9] predicted the waste-heat-recovery performance of a hybrid TEG consisting of a maximum of three of thermoelectric modules (TEMs), using an ANN tool provided in MATLAB. They analyzed the performance of the ANN by predicting the temperature difference across the TEG and the expected output power. Zhang et al. [10] investigated the effect of the greedy search-based data-driven method on the maximum power point tracking of a TEG. Selimefendigil and Öztop [11] suggested a computational fluid dynamics (CFD)-ANN hybrid problem-solving method for a TEG operating in bifurcating channels. They reported that the computational time required to obtain the electric potential and power generation in the TEG was reduced from 6 h when using high fidelity CFD simulations to 3 min using the hybrid method. Ang et al. [12] suggested a coupled neural network to predict not only the averaged output values but also the reliability of the output values of a TEG. Despite the novelty of the coupled network, their study was only focused on a single TEM operating using thermal energy dissipated by a light-emitting diode. Therefore, any energy harvesting characteristics of the TEM, such as output power and pumping loss, were not presented. Dimri et al. [13] developed a feed-forward ANN model for a glass-tedlar photovoltaic thermal air collector integrated with a thermoelectric cooler for predicting the overall thermal energy and exergy gain under varying weather conditions. Their results show that the employment of an appropriate ANN would be a time-effective operating method of a photovoltaic thermal hybrid system without any complex analysis and calculations; however, the scope of their study deviated from the application of ANNs to TEGs operating under various exhaust heat conditions. Kishore et al. [14] suggested a finite element-ANN combined model for predicting the performance of a TEG with a high degree of accuracy. They investigated the accuracy of the ANN while varying the design parameters of a single TEM, including the length of the nand p-type thermoelectric legs, cross-sectional area of the legs, and external load resistance. Using the combined model, they found that the output power was maximized using a TEM whose leg dimensions were 1.5×1.5×1.5 mm 3 . These studies demonstrated the potential of ANNs to predict the energy harvesting performance of TEGs; however, the limitations of ANNs, such as unexpected overfitting and underfitting, were also observed for several datasets. Moreover, most previous studies focused on the training of ANNs using experimental or analytical results without establishing a validation procedure to evaluate their prediction accuracy. Furthermore, investigations on ANNs for the prediction of system-level energy harvesting characteristics of TEGs operating under various operating conditions are still lacking.
Therefore, this study focused on overcoming the limitations of previous studies by employing ANNs to predict the system-level waste-heat-recovery performance of a TEG equipped with 30 TEMs that were custom-made for thermoelectric energy harvesting. Moreover, the convergence criteria for ANN calculations were provided to increase the learning and prediction accuracy of the ANN, while lowering the possibility of overfitting and underfitting, which are the most significant issues encountered in the practical use of ANNs. For this purpose, an in-house Python code was developed to build an ANN based on the backpropagation algorithm. To optimize the ANN structure, the training and prediction accuracies of the ANN were tracked, while varying the number of hidden layers and nodes of hidden layers. Experimental results obtained using a diesel engine while varying the engine load and rotation speed from 0.2 to 1.0 MPa brake mean effective pressure (BMEP) and 1000 to 2000 rpm, respectively, were used as reference datasets to train and validate the ANN previous. Of the five experimental output current (I)-load resistance (R) curves obtained under 1000 and 1500 rpm, one was randomly selected only for the validation but not for the training of the ANN. Both the training and prediction results of the ANN were in good agreement with the experimentally obtained I-R curves. Only a maximum difference of 5.84% was observed between the experimentally obtained and ANN-obtained maximum output power, including both ANN learning and prediction results. The ANN was also trained to reproduce the volumetric exhaust gas flow rate and pressure drop across the TEG. The product of these two quantities represents the pumping loss, due to the installation of the TEG in the middle of the tailpipe of a diesel engine, which acts as the heat source in this study. The gaps between the discretized experimental results were fully filled by the ANN learning and prediction results without any significant overfitting and underfitting. Additionally, the net power gain consistently increased as the engine load increased at a fixed engine rotation speed of 1000 rpm, while a peak point was observed for the other two engine rotation speeds of 1500 and 2000 rpm, at which the net power gain was maximum. For 2000 rpm, the peak point was determined by the ANN in a gap between two experimental data points, which emphasized the importance of ANNs in the TEG research field. The findings of this study can be used to widen the application areas of ANN toward the system-level performance predictions and optimal operations of various energy systems used in different industries.

TEG Structure
For the experiments, a TEG used in our previous study [15] was reused to obtain the power generation and pumping loss characteristics ( Figure 1). The TEG consisted of a rectangular exhaust gas channel, a total of 40 TEMs, and two coolant channels. In the TEG, 4 × 5 TEM arrays were placed on the top and bottom surfaces of the exhaust gas channel and were then sandwiched between the exhaust gas and coolant channels. A serpentine flow channel was formed inside the coolant channel to enable a 50-50% waterethylene glycol mixture at 283 K to evenly flow over the TEM arrays at a flow rate of 8 SLPM. The warmed coolant flow while passing through the TEG was cooled to its original temperature using both a water-cooling heat exchanger and a coolant chiller (RW-3025G, Lab Companion, Korea Republic).
Plate-fin structures were used inside the exhaust gas channel to improve the wasteheat-recovery performance of the TEG. The fin thickness and the gap between two adjacent finned structures were 2 and 4.65 mm, respectively. Two pressure taps placed at the inlet and outlet of the exhaust gas channel were used to measure the pressure drop across the TEG for various engine operating conditions using a differential pressure transducer (DPLH0.03R, Sensor System Technology Co., Ltd., Korea Republic). Based on the findings of our previous study [16], all TEMs were electrically connected in series to maximize the output power of the TEG. The two ends of the TEM electrical circuit were connected to an electric load (IM3533, HIOKI E.E. Corp., Korea Republic), which was programmed to vary its electrical resistance from~0.4 to~20 Ω through 44 steps while acquiring the power generation characteristics of the TEG.

Engine Experiments
The developed TEG was installed in the middle of the tailpipe of a 6-cylinder diesel engine. The engine experiments were performed under three different engine rotation speeds (1000, 1500, and 2000 rpm) and five different engine loads (0.2, 0.4, 0.6, 0.8, and 1.0 MPa BMEP). For the engine rotation speed of 2000 rpm, the hot-side surface of the reference TEM at the most upstream location along the centerline of the exhaust gas channel attained its maximum allowable temperature of ~493 K as the engine load increased beyond 0.6 MPa. Thus, only the first three engine load conditions of 0.2, 0.4, and 0.6 MPa were used for the rotation speed of 2000 rpm.
The exhaust gas temperatures at the TEG inlet and outlet were measured using ktype thermocouples for both data acquisition and evaluation of the steady-state condition. If the difference between the temperatures measured at the TEG inlet and outlet became less than 1 K for five consecutive minutes, the TEG was assumed to have attained the steady-state condition. When the TEG attained the steady-state condition, the engine operating conditions and TEG power generation characteristics, including the exhaust gas temperatures obtained at the TEG inlet and outlet and the TEG energy harvesting characteristics, such as the output current and the corresponding electric load resistance, were recorded. More detailed explanations on the engine experiments are provided in Refs. [17,18]

Data Preparation and Structure of the ANN
The detailed energy harvesting characteristics and maximum output power of a TEG can be determined using characteristic curves, such as I-R curves, whose trends and values are recorded by varying the external load resistance and engine operating conditions. Therefore, experimental conditions and load resistance were used as the input variables to train the ANN to obtain the corresponding target output data of the output current and maximum output power. For the pumping loss, which is defined as the product of the volume flow rate of exhaust gas and the pressure drop of the exhaust gas flow across the TEG, the engine operating conditions consisting of the engine load and rotation speeds were used as independent variables. The load resistance was excluded in the training of the ANN for pumping loss analysis because the variation in the exhaust gas flow characteristics, such as flow rate and pressure drop, would be negligible according to the change in the load resistance when the engine operating conditions were kept constant. The values of each input and output variable were normalized into the range of 0 to 1.

Engine Experiments
The developed TEG was installed in the middle of the tailpipe of a 6-cylinder diesel engine. The engine experiments were performed under three different engine rotation speeds (1000, 1500, and 2000 rpm) and five different engine loads (0.2, 0.4, 0.6, 0.8, and 1.0 MPa BMEP). For the engine rotation speed of 2000 rpm, the hot-side surface of the reference TEM at the most upstream location along the centerline of the exhaust gas channel attained its maximum allowable temperature of~493 K as the engine load increased beyond 0.6 MPa. Thus, only the first three engine load conditions of 0.2, 0.4, and 0.6 MPa were used for the rotation speed of 2000 rpm.
The exhaust gas temperatures at the TEG inlet and outlet were measured using k-type thermocouples for both data acquisition and evaluation of the steady-state condition. If the difference between the temperatures measured at the TEG inlet and outlet became less than 1 K for five consecutive minutes, the TEG was assumed to have attained the steady-state condition. When the TEG attained the steady-state condition, the engine operating conditions and TEG power generation characteristics, including the exhaust gas temperatures obtained at the TEG inlet and outlet and the TEG energy harvesting characteristics, such as the output current and the corresponding electric load resistance, were recorded. More detailed explanations on the engine experiments are provided in Refs. [17,18]

Data Preparation and Structure of the ANN
The detailed energy harvesting characteristics and maximum output power of a TEG can be determined using characteristic curves, such as I-R curves, whose trends and values are recorded by varying the external load resistance and engine operating conditions. Therefore, experimental conditions and load resistance were used as the input variables to train the ANN to obtain the corresponding target output data of the output current and maximum output power. For the pumping loss, which is defined as the product of the volume flow rate of exhaust gas and the pressure drop of the exhaust gas flow across the TEG, the engine operating conditions consisting of the engine load and rotation speeds were used as independent variables. The load resistance was excluded in the training of the ANN for pumping loss analysis because the variation in the exhaust gas flow characteristics, such as flow rate and pressure drop, would be negligible according to the change in the load resistance when the engine operating conditions were kept constant. The values of each input and output variable were normalized into the range of 0 to 1.
All the training datasets, including both the input and output datasets, were reorganized using the developed Python code to build the ANN according to the dimensions of the input and output variables ( Figure 2a). The weight of each neuron formed between the nodes of two adjacent layers was also generated according to the number of nodes, whose range was predetermined before the training of the ANN (Figure 2b). All the nodes of the hidden layers and output layer had a bias correction value that was also normalized before the training and was updated during the training procedure.
Energies 2021, 14, x FOR PEER REVIEW 5 of 14 All the training datasets, including both the input and output datasets, were reorganized using the developed Python code to build the ANN according to the dimensions of the input and output variables ( Figure 2a). The weight of each neuron formed between the nodes of two adjacent layers was also generated according to the number of nodes, whose range was predetermined before the training of the ANN (Figure 2b). All the nodes of the hidden layers and output layer had a bias correction value that was also normalized before the training and was updated during the training procedure.

Training of ANN
For the forward propagation of the input variables, the values of the nodes of the hidden and output layers are determined using Equation (1): where , , , , m, f, and k are the value of the n-th node of the k-th layer, the value of the m-th node of the (k − 1)-th layer, the weight of the neuron formed between the i-th node of the (k − 1)-th layer and the n-th node of the k-th layer, an activation function, and the dimension of the (k − 1)-th layer, respectively. In this study, a leaky rectified linear unit (LReLU), expressed as Equation (2), was determined as the activation function f(x) based on the training reliability of the ANN.
Accordingly, He initialization, which is specialized for LReLUs, was used to initialize the weight of each neuron and bias correction value of each node of hidden and output layers. As a result of initialization, the weights and biases of the k-th layer were normally distributed with a standard deviation of 2⁄ , where m is the dimension of the (k − 1)-th layer.
When the output values were estimated by the ANN, the error was propagated backward while updating the weight of each neuron using the gradient descent method expressed in Equation (3) to minimize the loss function (L) defined by the sum of squares for the error as expressed by Equation (4):

Training of ANN
For the forward propagation of the input variables, the values of the nodes of the hidden and output layers are determined using Equation (1): n,i , m, f, and k are the value of the n-th node of the k-th layer, the value of the m-th node of the (k − 1)-th layer, the weight of the neuron formed between the i-th node of the (k − 1)-th layer and the n-th node of the k-th layer, an activation function, and the dimension of the (k − 1)-th layer, respectively. In this study, a leaky rectified linear unit (LReLU), expressed as Equation (2), was determined as the activation function f(x) based on the training reliability of the ANN.
Accordingly, He initialization, which is specialized for LReLUs, was used to initialize the weight of each neuron and bias correction value of each node of hidden and output layers. As a result of initialization, the weights and biases of the k-th layer were normally distributed with a standard deviation of √ 2/m, where m is the dimension of the (k − 1)-th layer.
When the output values were estimated by the ANN, the error was propagated backward while updating the weight of each neuron using the gradient descent method expressed in Equation (3) to minimize the loss function (L) defined by the sum of squares for the error as expressed by Equation (4): where η, L, N, Y, and T denote the learning rate, loss function, dimension of output data, output value estimated by the ANN at each epoch, and target values, which are the experimental results, respectively. The learning rate, i.e., the algorithm hyperparameter, was determined through a trial-and-error method to be 0.005, with which an acceptable accuracy of ANN could be ensured. A series of forward and backward propagations was repeated until the calculation of the ANN converged.

Convergence Criterion
The convergence criterion, in addition to the number of nodes of hidden layers, was observed to have a significant effect on both the training accuracy and prevention of the overfitting and/or underfitting, particularly when the output variables had a nonlinear relationship with the input variables. To establish the convergence criterion, the averaged percentage error (E ave ) was used, as defined in Equation (5), and tracked during the training.
When the difference between the maximum and minimum values of the averaged error obtained for 500 consecutive epochs was smaller than the predetermined criterion of 0.005, the calculation was assumed to be converged. After an optimal structure of the ANN with an appropriate number of nodes for hidden layers (discussed in Section 4.1) was determined, the averaged error was also used as a criterion for the restart and termination of the ANN calculation in the actual training procedure. This is because the starting point of an ANN calculation is randomly determined by initialization; thus, the calculation may converge to local minimum loss or saddle points, indicating a high level of calculation error and underfitting of results. Moreover, a significantly low level of averaged calculation error can result in overfitting, in which the overall trend of the calculation results significantly deviates from the actual experimental results. Therefore, by setting the target averaged error in the range of 1-2.5%, which varies according to the type of the output variable, the possibility of underfitting and overfitting was lowered in this study.

Validation of the ANN
To validate the robustness and reliability of the developed ANN, the actual experimental data and the results predicted by the ANN that was trained without the experimental results were compared. Therefore, in total, 88 datasets of two I-R curves obtained under the 1000 rpm-0.8 MPa and 1500 rpm-0.4 MPa conditions were randomly selected, only for the validation but not for training of the ANN. Table 1

Optimal Structure of the ANN
By varying the number of hidden layers and nodes of the hidden layers, an optimal ANN structure was determined. For the single hidden layer, the calculation did not converge for several scenarios or exhibited a high level of the averaged error beyond 25%, implying that a two-layer multi-perceptron ANN was inappropriate to predict the waste-heat-recovery performance of the TEG. As the number of the hidden layers was increased to two, the ANN calculation converged regardless of the number of nodes of hidden layers. To enhance the accuracy and consistency of the results, it was empirically determined that the number of nodes of the second hidden layer should be 1.5 times that of the first hidden layer.
The averaged error between the experimental results and ANN estimations was tracked by varying the number of nodes of the hidden layers for 484 datasets obtained for eleven I-R curves. A series of tests was conducted five times by varying the nodes of the first hidden layer from 1 to 11. The error bars shown in Figure 3 indicate the standard deviation of each scenario. As shown in Figure 3, the increase in the number of nodes tended to lower the difference between the experimental and ANN training results. When the number of nodes of the first hidden layer was identical to or larger than 7, the threelayer ANN with an odd number of nodes for the first hidden layer exhibited an averaged error smaller than 5%. When nine nodes were allocated for the first hidden layer, the training results become most stable with the lowest standard deviation of 1.6% and an acceptable averaged error of 2.4%. Therefore, in this study, the ANN with two hidden layers, which had 9 and 14 nodes, respectively, was determined as the optimal structure to reduce the calculation time, while ensuring a high training accuracy. It was used for further analyses.

Training and Prediction Results for I-R Characteristic Curves
The optimal ANN was trained for the bias corrections and weights of neurons with which the I-R characteristic curves could be reproduced with the maximum averaged error of 2.0%. After the training procedure, the prediction performance of the ANN was validated. Figure 4 shows the I-R curves obtained through experiments and ANN training/prediction for three engine rotation speeds of 1000, 1500, and 2000 rpm and five different engine loads ranging from 0.2 to 1.0 MPa BMEP. As shown in Figure 4, the trained optimal ANN adequately reproduced the detailed I-R energy harvesting characteristics for 13 experimental scenarios, including the two scenarios of 1000 rpm-0.8 MPa and 1500 rpm-0.4 MPa that were not used for ANN training. The average and maximum difference between the experimental results used for validation and the corresponding ones for predictions in the 1000 rpm-0.8 MPa scenario were 3.3 and 7.2%, respectively. For the 1500 rpm-0.4 MPa scenario, the average and maximum difference between the experimental data and corresponding ANN prediction results were 3.7% and 10.1%, respectively. This comparison emphasized the ability of a well-trained ANN to predict the waste-heat-recovery performance of the TEG by filling the gaps formed between discretized experimental datasets with a noticeably high accuracy.

Training and Prediction Results for I-R Characteristic Curves
The optimal ANN was trained for the bias corrections and weights of neurons with which the I-R characteristic curves could be reproduced with the maximum averaged error of 2.0%. After the training procedure, the prediction performance of the ANN was validated. Figure 4 shows the I-R curves obtained through experiments and ANN training/prediction for three engine rotation speeds of 1000, 1500, and 2000 rpm and five different engine loads ranging from 0.2 to 1.0 MPa BMEP. As shown in Figure 4, the trained optimal ANN adequately reproduced the detailed I-R energy harvesting characteristics for 13 experimental scenarios, including the two scenarios of 1000 rpm-0.8 MPa and 1500 rpm-0.4 MPa that were not used for ANN training. The average and maximum difference between the experimental results used for validation and the corresponding ones for predictions in the 1000 rpm-0.8 MPa scenario were 3.3 and 7.2%, respectively. For the 1500 rpm-0.4 MPa scenario, the average and maximum difference between the experimental data and corresponding ANN prediction results were 3.7% and 10.1%, respectively. This comparison emphasized the ability of a well-trained ANN to predict the waste-heat-recovery performance of the TEG by filling the gaps formed between discretized experimental datasets with a noticeably high accuracy.

Maximum Output Power
The prediction of the maximum output power is an important TEG research topic. The output power, defined as the product of the load resistance and the square of the corresponding output current, was determined using the trained and prediction results. Therefore, the value of the maximum output power for each operating condition was obtained from the I-R curves described in the previous section. Figure 5 shows the maximum output power obtained through experiments and ANN calculation for each experimental scenario. The results obtained using the two different methods were in good agreement from the perspective of the output power variation, according to the engine operating conditions. When the engine rotation speed was kept constant, the maximum output power tended to increase with the engine load. For similar engine load conditions, the increase in the engine rotation speeds resulted in an increase in the maximum output power. The number above each bar graph indicates the percentage difference between the experimental and ANN training/prediction results. A maximum difference between the experimental and ANN results of 5.84% was observed for the 1000 rpm-1.0 MPa scenario.

Maximum Output Power
The prediction of the maximum output power is an important TEG research topic. The output power, defined as the product of the load resistance and the square of the corresponding output current, was determined using the trained and prediction results. Therefore, the value of the maximum output power for each operating condition was obtained from the I-R curves described in the previous section. Figure 5 shows the maximum output power obtained through experiments and ANN calculation for each experimental scenario. The results obtained using the two different methods were in good agreement from the perspective of the output power variation, according to the engine operating conditions. When the engine rotation speed was kept constant, the maximum output power tended to increase with the engine load. For similar engine load conditions, the increase in the engine rotation speeds resulted in an increase in the maximum output power. The number above each bar graph indicates the percentage difference between the experimental and ANN training/prediction results. A maximum difference between the experimental and ANN results of 5.84% was observed for the 1000 rpm-1.0 MPa scenario.
The minimum difference between the experimental and ANN results was observed to be 0.02% for the 1000 rpm-0.4 MPa scenario.
For the two operating conditions of 1000 rpm-0.8 MPa and 1500 rpm-0.4 MPa, for which the experimental results were used only for ANN validation, a high accuracy of the ANN prediction results was observed, indicating differences of only 3.49% and 2.59% compared with the actual maximum output power, respectively. In the previous section, the maximum differences between the experimental and ANN prediction results were observed to be 7.2% and 10.1% for I-R curves obtained for the two operating conditions used for ANN validation. However, the relatively large differences were obtained at a load resistance that deviated significantly from the optimal resistance, with which the output power was maximized. Hence, the values of the maximum output power obtained through the ANN prediction were well-matched with the experimental results.
The prediction results obtained using the ANN exhibited certain trends. As shown in Figure 4, the ANN results are in good agreement with the I-R experimental curves. The maximum output power, shown in Figure 5, is obtained by multiplying half of the short circuit current with the corresponding load resistance. In this context, the difference between the experimental and ANN results would exhibit certain trends as well. When training datasets are used, the ANN would be trained better for some cases compared to the remaining at the beginning of the training. For the case of 1000 rpm, there is a high possibility that the ANN was trained better for the lower engine load conditions, compared to the higher engine load conditions at the beginning of training. As the ANN was trained further, the errors for all conditions would become smaller. When the error for the higher load conditions became small, thereby satisfying the convergence criterion, the lower load conditions would have a smaller percentage error. This could explain the trends in the percentage error. However, it is noteworthy that the increasing or decreasing trends in the error would be determined by the results of the initialization of weights. Thus, the variation in the trends among the different engine speed conditions would not have any physical meaning. The minimum difference between the experimental and ANN results was observed to be 0.02% for the 1000 rpm-0.4 MPa scenario. For the two operating conditions of 1000 rpm-0.8 MPa and 1500 rpm-0.4 MPa, for which the experimental results were used only for ANN validation, a high accuracy of the ANN prediction results was observed, indicating differences of only 3.49% and 2.59% compared with the actual maximum output power, respectively. In the previous section, the maximum differences between the experimental and ANN prediction results were observed to be 7.2% and 10.1% for I-R curves obtained for the two operating conditions used for ANN validation. However, the relatively large differences were obtained at a load resistance that deviated significantly from the optimal resistance, with which the output power was maximized. Hence, the values of the maximum output power obtained through the ANN prediction were well-matched with the experimental results.
The prediction results obtained using the ANN exhibited certain trends. As shown in Figure 4, the ANN results are in good agreement with the I-R experimental curves. The maximum output power, shown in Figure 5, is obtained by multiplying half of the short circuit current with the corresponding load resistance. In this context, the difference between the experimental and ANN results would exhibit certain trends as well. When training datasets are used, the ANN would be trained better for some cases compared to the remaining at the beginning of the training. For the case of 1000 rpm, there is a high possibility that the ANN was trained better for the lower engine load conditions, compared to the higher engine load conditions at the beginning of training. As the ANN was trained further, the errors for all conditions would become smaller. When the error for the higher load conditions became small, thereby satisfying the convergence criterion, the lower load conditions would have a smaller percentage error. This could explain the trends in the percentage error. However, it is noteworthy that the increasing or decreasing trends in the error would be determined by the results of the initialization of weights. Thus, the variation in the trends among the different engine speed conditions would not have any physical meaning.

Fluid Flow Characteristics of the TEG
The pumping loss caused by the installation of the TEG in the middle of the exhaust tailpipe of the test engine can be obtained using the volume flow rate of the exhaust gas passing through the TEG and the pressure drop of the exhaust gas flow across the TEG.

Fluid Flow Characteristics of the TEG
The pumping loss caused by the installation of the TEG in the middle of the exhaust tailpipe of the test engine can be obtained using the volume flow rate of the exhaust gas passing through the TEG and the pressure drop of the exhaust gas flow across the TEG. Therefore, the optimal ANN was also used to reproduce the fluid flow characteristics of the developed TEG. Because of relatively small datasets for the volumetric flow rate and pressure drop measurements, a higher convergence criterion-1% to 1.5% averaged errorwas permitted to improve the training/prediction accuracy. As in the previous section, the two experimental datasets obtained at 1000 rpm-0.8 MPa and 1500 rpm-0.4 MPa were also used only for the validation but not for the training of the ANN. Therefore, three volumetric flow rate and pressure drop curves were produced for the three different engine rotation speeds as a function of the engine load. The averaged error between the experimental and ANN-trained results were 1.0% and 1.47% for the volumetric flow rate and pressure drop datasets, respectively. As shown in Figure 6a,b, the ANN could reproduce the two types of fluid flow characteristics curves without any noticeable overfitting and underfitting. This would be primarily attributed to the almost linear relationship between the two fluid flow characteristic variables-the volume flow rate and pressure drop-and the engine load. However, the effects both of the ANN structure and convergence criterion were also significant because overfitting and underfitting were more frequently observed when the numbers of nodes of hidden layers and convergence criterion were changed.
In some research fields, the increase in backpressure is used as one of the most important design criteria because the heat source, such as the diesel engine in this study, can be damaged under high backpressure conditions. However, estimating which value of the variables causes an increase in the backpressure beyond the allowable limit is difficult using discretized experimental results. Based on the high-accuracy prediction capability, a well-trained ANN with its optimal structure would be a promising candidate in the industries in which failure predictability and/or failure diagnosis techniques are required. Therefore, the optimal ANN was also used to reproduce the fluid flow characteristics of the developed TEG. Because of relatively small datasets for the volumetric flow rate and pressure drop measurements, a higher convergence criterion-1% to 1.5% averaged error-was permitted to improve the training/prediction accuracy. As in the previous section, the two experimental datasets obtained at 1000 rpm-0.8 MPa and 1500 rpm-0.4 MPa were also used only for the validation but not for the training of the ANN. Therefore, three volumetric flow rate and pressure drop curves were produced for the three different engine rotation speeds as a function of the engine load. The averaged error between the experimental and ANN-trained results were 1.0% and 1.47% for the volumetric flow rate and pressure drop datasets, respectively. As shown in Figure 6a,b, the ANN could reproduce the two types of fluid flow characteristics curves without any noticeable overfitting and underfitting. This would be primarily attributed to the almost linear relationship between the two fluid flow characteristic variables-the volume flow rate and pressure drop-and the engine load. However, the effects both of the ANN structure and convergence criterion were also significant because overfitting and underfitting were more frequently observed when the numbers of nodes of hidden layers and convergence criterion were changed. In some research fields, the increase in backpressure is used as one of the most important design criteria because the heat source, such as the diesel engine in this study, can be damaged under high backpressure conditions. However, estimating which value of the variables causes an increase in the backpressure beyond the allowable limit is difficult using discretized experimental results. Based on the high-accuracy prediction capability, a well-trained ANN with its optimal structure would be a promising candidate in the industries in which failure predictability and/or failure diagnosis techniques are required.

Pumping Loss and Net Power Gain
By combining the volume flow rate and pressure drop obtained in the previous section, the pumping loss of the TEG was acquired for the experimental and ANN results as a function of the engine load and rotation speed. As shown in Figure 7, the optimal ANN could reproduce the experimentally obtained pumping loss data and fill the gaps between the discretized experimental data without any noticeable overfitting and underfitting.
The pumping loss tended to increase as the engine load increased when the engine rotation speed was fixed. Additionally, the rate of increase of the pumping loss became larger with respect to the increase in the load as the engine rotation speed increased. This

Pumping Loss and Net Power Gain
By combining the volume flow rate and pressure drop obtained in the previous section, the pumping loss of the TEG was acquired for the experimental and ANN results as a function of the engine load and rotation speed. As shown in Figure 7, the optimal ANN could reproduce the experimentally obtained pumping loss data and fill the gaps between the discretized experimental data without any noticeable overfitting and underfitting.
The pumping loss tended to increase as the engine load increased when the engine rotation speed was fixed. Additionally, the rate of increase of the pumping loss became larger with respect to the increase in the load as the engine rotation speed increased. This was because both the volume flow rate and pressure drop across the TEG varied rapidly, with respect to the engine load as the engine rotation speed increased.
was because both the volume flow rate and pressure drop across the TEG varied rapidly, with respect to the engine load as the engine rotation speed increased. In contrast to the pumping loss, the rate of increase in the maximum output power became smaller because of the increase in the engine load when the engine rotation speed was equal to or larger than 1500 rpm ( Figure 5). Thus, a peak point existed at which the net power gain had the largest value for the two engine rotation speeds of 1500 and 2000 rpm. For the 1500 rpm condition, both the experimental and ANN results indicated the engine load of 0.8 MPa as the point at which the maximum output gain could be obtained. While for the 2000 rpm condition, the optimal ANN indicated 0.5 MPa as the point at which the net power gain was maximum, which could not be obtained using discretized experimental results. For the 1000 rpm condition, the net output gain tended to consistently increase as the engine load increased. This was because the rate of increase in the maximum output power with respect to the engine load was larger than that of the pumping loss. Thus, the largest net power gain of ~65 W was observed for 1000 rpm-1.0 MPa BMEP.
As shown in Figure 8, the net power gain was positive under all the engine operating conditions used in this study. This was because the TEG was designed by considering the heat transfer characteristics, as well as the pressure drop characteristics of the internal finned structures. The net power gain may be negative under certain engine operating conditions when the TEG is poorly designed or when the engine operating range is extremely large. In such scenarios, an optimal ANN would have a key function in preventing net power loss and maximizing the net power gain by controlling the exhaust gas flow rate using a bypass system. In contrast to the pumping loss, the rate of increase in the maximum output power became smaller because of the increase in the engine load when the engine rotation speed was equal to or larger than 1500 rpm ( Figure 5). Thus, a peak point existed at which the net power gain had the largest value for the two engine rotation speeds of 1500 and 2000 rpm. For the 1500 rpm condition, both the experimental and ANN results indicated the engine load of 0.8 MPa as the point at which the maximum output gain could be obtained. While for the 2000 rpm condition, the optimal ANN indicated 0.5 MPa as the point at which the net power gain was maximum, which could not be obtained using discretized experimental results. For the 1000 rpm condition, the net output gain tended to consistently increase as the engine load increased. This was because the rate of increase in the maximum output power with respect to the engine load was larger than that of the pumping loss. Thus, the largest net power gain of~65 W was observed for 1000 rpm-1.0 MPa BMEP.
As shown in Figure 8, the net power gain was positive under all the engine operating conditions used in this study. This was because the TEG was designed by considering the heat transfer characteristics, as well as the pressure drop characteristics of the internal finned structures. The net power gain may be negative under certain engine operating conditions when the TEG is poorly designed or when the engine operating range is extremely large. In such scenarios, an optimal ANN would have a key function in preventing net power loss and maximizing the net power gain by controlling the exhaust gas flow rate using a bypass system.

Conclusions
In this study, an ANN was developed using an in-house Python code to predict the system-wise energy harvesting performance of a TEG whose performance depended on various variables, such as engine load, engine rotation speed, and external load resistance.
The key points and findings of this study are as follows: • An ANN composed of two hidden layers with 9 and 14 nodes, respectively, was determined as the optimal ANN structure for this study through a series of analyses performed by tracking the averaged error while varying the number of nodes.

•
Convergence criteria based on the averaged percentage error were the key factors in ensuring the accuracy of the ANN and avoiding noticeable overfitting and underfitting.

•
The optimal ANN could reproduce the nonlinear I-R relationship. Two I-R experimental curves used only for validation were predicted with high accuracy with the well-trained optimal ANN. • The largest difference between the experimentally obtained and ANN training/prediction maximum output power was only 5.84% for a total of 13 engine operating conditions. • The exact values and variation trends of pumping loss caused by the installation of TEG in the middle of the exhaust tailpipe were well reproduced by integrating the ANN training/prediction results for the two fluid flow characteristic variables: volumetric flow rate and pressure drop.

•
The optimal ANN could fill the gaps formed between discretized experimental results to clearly obtain the variation in the net power gain trends and the point at which the net power gain became maximum compared with the experimental results.
The applicability of the proposed method would depend on the quality of the experimental datasets used for training of the ANN, but not on the experimental setup and condition. Therefore, the present method would be still applicable with some conditions changed, such as the types of engine and target energy system. Assuming the quality and number of experimental data are sufficient, one of the advantages of the proposed ANN model is that it can be used to predict the trends of results without overfitting and underfitting in a time-effective manner. Once the ANN is trained for a system, then the result at any operating condition can be found within 1 s. For example, the I-R prediction results shown in Figure 4 were obtained within 1 s, whereas it would be almost impossible to obtain the nonlinear I-R curves accurately, using experimental data. Furthermore, as the

Conclusions
In this study, an ANN was developed using an in-house Python code to predict the system-wise energy harvesting performance of a TEG whose performance depended on various variables, such as engine load, engine rotation speed, and external load resistance.
The key points and findings of this study are as follows: • An ANN composed of two hidden layers with 9 and 14 nodes, respectively, was determined as the optimal ANN structure for this study through a series of analyses performed by tracking the averaged error while varying the number of nodes.

•
Convergence criteria based on the averaged percentage error were the key factors in ensuring the accuracy of the ANN and avoiding noticeable overfitting and underfitting.

•
The optimal ANN could reproduce the nonlinear I-R relationship. Two I-R experimental curves used only for validation were predicted with high accuracy with the well-trained optimal ANN. • The largest difference between the experimentally obtained and ANN training/prediction maximum output power was only 5.84% for a total of 13 engine operating conditions. • The exact values and variation trends of pumping loss caused by the installation of TEG in the middle of the exhaust tailpipe were well reproduced by integrating the ANN training/prediction results for the two fluid flow characteristic variables: volumetric flow rate and pressure drop.

•
The optimal ANN could fill the gaps formed between discretized experimental results to clearly obtain the variation in the net power gain trends and the point at which the net power gain became maximum compared with the experimental results.
The applicability of the proposed method would depend on the quality of the experimental datasets used for training of the ANN, but not on the experimental setup and condition. Therefore, the present method would be still applicable with some conditions changed, such as the types of engine and target energy system. Assuming the quality and number of experimental data are sufficient, one of the advantages of the proposed ANN model is that it can be used to predict the trends of results without overfitting and underfitting in a time-effective manner. Once the ANN is trained for a system, then the result at any operating condition can be found within 1 s. For example, the I-R prediction results shown in Figure 4 were obtained within 1 s, whereas it would be almost impossible to obtain the nonlinear I-R curves accurately, using experimental data. Furthermore, as the ANN is trained not only for a single dataset but also for the multiple datasets, the possibility of the predictions not being consistent with the trends of system characteristics would be low, as shown in this paper. Based on the findings of this study, the applicability of ANNs to various industrial and research domains can be improved, particularly in cases where failure diagnosis and predictability are required.
Funding: This study was financially supported by Seoul National University of Science and Technology.