Introduction

Induction hardening is a multi-physics process which is widely employed to enhance the fatigue behavior of many critically loaded mechanical workpieces in automotive and aerospace industries. During the process, the ferrous components such as steel grades are rapidly heated to a very high temperature (heating phase), then quickly cooled to room temperature (quenching phase) [1]. As a result, a fine-grain martensite phase [2, 3] as well as a compressive residual stress field [4] are induced in the superficial layer which enhance fatigue life of engineering components [5, 6]. Industries use more and more this process because it provides a high quality over time, good repeatability, fast, and clean processing for precise heating of the interested zones without affecting the metallurgy of the bulk material. [7, 8].

The main process parameters are the frequency, power level of the employed source currents, and heating time. Depending on how the frequency is applied, there are two usual heating approaches that can impact the heating phase. The former is induction with a single-frequency and the latter one consists of combining two different frequencies, medium and high frequencies, applied simultaneously or sequentially. These two approaches have been employed in numerical and experimental investigations. It is worth mentioning that these two approaches have differences in terms of precision and quality of the treatment[9]. In fact, the use of a double-frequency induction heating allows a full hardening of the superficial layer of a complex geometry, which can be incomplete with the single-frequency heating [10].

In practical applications, an appropriate selection of the process parameters is highly important to carry out a desired contour free of cracks. Many experimental investigations have been carried out to study this induction surface hardening process. These investigations have focused on the influence of process parameters on the induced residual stresses of hardened cylindrical specimens [11], the relationship between the change in mechanical properties and the microstructure of 45 steel bars [12], the effects of different quenching parameters on distortion of cylindrical parts [13], the influence of different grinding parameters on residual stress results [14], the effects of spray cooling for gearwheel induction [15], the consequences of the variation of initial hardness level of discs on the distortion and hardening depth [16]. However, experimental approach is not only time consuming but requires significant experimental tests for a restricted validation range. More promising approach for orienting and optimizing the experimental activity is provided by numerical techniques such as the finite element method (FEM). It has proven to be highly efficient for dealing with multiphysics-based parametrized problems thanks to the advanced numerical simulation codes [17]. Consequently, a large number of research works has focused on the use of FEM to analyze the hardness [18, 19], the temperature field [20, 21], the residual stress fields [22] and the microstructure [19, 23].

Although the different mechanical and microstructural fields are predicted, 3D-FEM still suffers from some drawbacks. To name a few, they are high computational cost, supporting the use of multiple frequencies, and data exchange between solvers [24, 25].

Several analytical models have been proposed and used mainly to describe the phenomena involved during the induction hardening process [26,27,28,29,30]. However, these models are very limited by the geometry of the inductor and the workpiece. This made way to integrate analytical models to the FEM to solve the coupled electromagnetic-thermomechanical problem [31, 32]. The computational time, however, is still too high.

In recent years, the rise of different machine learning algorithms, coupled with more efficient optimization techniques, allows a relevant alternative for this type of analyses [33,34,35]. Machine learning represents different techniques such as Artificial Neural Network (ANN), Random Forest (RF) or Gradient-Boosted Trees (GBT). The classical machine learning pipeline (sequence of actions) for modeling is used to analyze the data, treat the variables, split them into train and test sets, fit and construct the model, predict the results with testing data, and compare the model predictions with the ground truth to quantify the result error. ANN are regularly involved in metallurgy analysis under induction heating [36], surface hardness in carburizing quenching [37] and in laser hardening [38], and various mechanical properties in metal rolling [39]. Also, machine learning algorithms from the XGBoost library [40] are recognized of being efficient in some challenges while being convenient in the use and optimization [41]. Despite the relative well-known lack of data in the field of metallurgy, it is possible to propose reliable models. In fact, XGBoost has been used with success for predicting some mechanical properties like hardenability [42] and tensile strength, compressive strength, and elongation of hot-rolled strips [43] using small and big datasets, respectively.

The literature review shows a particular interest on both single and double-frequency induction hardening experiments [44] either to validate results obtained by modeling in FEM [45] or to optimize the process parameters [46]. Studying both of them should be interesting anyway.

This work aims at proposing an approach based on artificial intelligence technique to build more predictive fast running models of the induced hardness profile within a cylindrical bar of 300M steel alloy and spur-gear of C45 steel during the induction heating process. To conduct such a study, experimental data under single and double frequencies are presented in Section 2. Section 3 concerns the development of data-driven model based on XGBoost library to predict the hardness profile under the effect of the process parameters. The obtained results are presented and discussed in Section 4. The main conclusions and the relevancy of the work are exposed in Section 5.

Experimental procedure

Induction hardening of cylindrical bars

The first series of experiments were conducted on a cylindrical bar made of 300M low alloy steel. The process parameters are listed in Table 1. During these experiments, samples rotated around a vertical axis and each one was used to carry out several induction treatments at different positions sufficiently spaced to avoid any eventual interaction effects which was verified by the infrared camera. The heating phase was carried out by a ring inductor encircling the sample and having a rectangular shape of 2x5mm and an air-gap of 3mm while the subsequent cooling shower of a polymer-water mixture was applied by another coaxial ring as shown in Fig. 1. During heating, temperature measurements on surface were obtained using a bichromatic pyrometer (see Table 1) while the in-depth temperature profile was predicted based on FEM (see Fig. 2). Micro-hardness Vickers (HV0.3) profiles were carried out in the radial direction of the sample in order to determine the penetration hardening. These analyses were performed after the induction treatment and performed on a transversal section according to ISO 6507 [47].

Fig. 1
figure 1

Experimental setup utilized during the induction hardening treatment of cylindrical bars under a high single-frequency

Table 1 Induction heat treatment conditions for cylindrical samples
Fig. 2
figure 2

Predicted in-depth temperature profiles by FEM for experimental runs

Induction hardening of gears

The second series of experiments were carried out on C45 steel spur gears. The main gear data were summarized in Table 2 while the process parameters were listed in Table 3 and Table 4. For these experiments, gears were mounted on a rotating chuck during the process. An Optris pyrometer was used to measure the temperature on surface at the tooth root during the treatment. The heating phase was conducted with ring inductor encircling the sample having a rectangular shape of 12.25x20mm and an air-gap of 2mm while the subsequent cooling shower of a polymer-water mixture was applied by another coaxial ring as shown in Figure 3. Micro-hardness Vickers (HV0.3) profiles were carried out in the radial direction of the sample at the tooth tip and the tooth root in order to determine the penetration hardening on these two locations. These analyses were performed after the induction treatment and performed on a transversal section according to ISO 6507 [47].

Table 2 Gear data for double-frequency induction hardening experiments
Fig. 3
figure 3

Experimental setup utilized during the induction hardening treatment of gears under a double-frequency

Table 3 Induction heat treatment conditions for gears with module m=2.5
Table 4 Induction heat treatment conditions for gears with module m=3

It is worth noting that the frequency ranges from 12 to 14 kHz in MF and from 150 to 350 kHZ in HF. The final measured frequency depends on the torque between the gear and the inductor. So, the measured frequency will not be the same, especially in high frequency. It is clear that the frequencies are not the main variable to describe the system due to their slight variation. This point will be investigated in next sections.

Hardness modeling

XGBoost algorithm

In the present work, the EXtrem Gradient Boosting (XGBoost) algorithm was chosen because it is one of the most effective boosting tree algorithms for gradient boosting machine (GBM) and highly efficient for machine learning prediction problems with a few pre-processing requirements [48, 49]. It has the advantage of being convenient and easy to test and manipulate because there is no need to search and optimize an architecture like neural networks: only a few hyperparameters related to the trees such as the maximum depth or the number of estimators. Moreover, it has been proven that the XGBoost is robust enough [50, 51] while requiring a satisfying training time. XGBoost is based on gradient-boosted decision-tree. In fact, XGBoost build sequentially a forest of gradient boosted decision trees. For the sake of completeness here we briefly revisit the technique, and for a deeper illustration, the interested reader can refer to Appendix A.

Each iteration of a tree compute the residuals \(r_{k}\) of each k observed value \(y_{obs,k}\) of the dataset with respect to a predicted value \(y_{pred,k}\):

$$\begin{aligned} r_{k} = y_{obs,k} - y_{pred,k} \end{aligned}$$
(1)

The residuals are collected in the first leaf of the tree called the root node. The goal is to split considering a threshold condition on a given variable. Each possible split is defined by the average value between two consecutive observed data points. The residuals are used to compute the similarity score S, which is defined as

$$\begin{aligned} S = \frac{({\sum }^{m}_{k=1}r_{k})^{2}}{m+ \lambda } \end{aligned}$$
(2)

where m is the number of residuals and \(\lambda\) is the user-defined regulation hyperparameter. Depending on the value of S, the different residuals are set into the right and left leaves given the chosen split, making new similarity scores. In fact, S score of the root node and the left and right leaves are used to calculate the gain G such as:

$$\begin{aligned} G=S_{left}-S_{right}-S_{root} \end{aligned}$$
(3)

The split inducing the highest gain G is kept. Then, splits can be made again on the lastest nodes. A branch with a negative gain should be removed as the tree is pruned. The output value of the full tree is expressed as:

$$\begin{aligned} y_{output}= \frac{\sum ^{m}_{k=1} r_{k} }{(m+ \lambda )} \end{aligned}$$
(4)

The predicted value of the tree \(\hat{y}_{n}\) using the previous one \(\hat{y}_{n-1}\) and the output \(y_{output}\) of the built tree is obtained as follows:

$$\begin{aligned} \hat{y}_{n} = \hat{y}_{n-1} + \eta \cdot y_{output} \end{aligned}$$
(5)

where \(\eta\) is the learning rate. If \(n=1\), \(y_{0}\) is a default value. Now a single tree is built and the predicted values \(\hat{y}_{n}\) are involved for the calculation of the residuals of the next tree. The goal is to minimize the residuals to a value close to 0. When all trees are built it is possible to compute a final and accurate prediction \(\hat{y}\), it is defined as a weighted sum of trees output and can be written as:

$$\begin{aligned} \forall i \in [1;n], \;\; \hat{y} = \sum ^{n}_{i=1} \eta \cdot y_{output,i} \end{aligned}$$
(6)

where n is the final number of trees. The final ensemble of trees can be summarized in Fig. 4.

Fig. 4
figure 4

Ensemble of the XGBoost trees

Extraction of intermediate parameters

Extraction of intermediate parameters of any system for the training phase is highly important. This is because, in the present work, the temperature profiles and the surface temperature for cylindrical bars and gears, respectively, were considered as an important parameter to describe the hardness. In fact, preliminary analysis have shown that first results lacked of accuracy without it. The temperature is not a machine parameter and requires a particular system (pyrometer of thermocouple) to be measured which is not present in the industrial case. Therefore, the temperature was predicted to be used as input for hardness modeling. Predictions were carried out using XGBoost algorithm using the process parameters previously listed in Table 3 as input without any further optimization. Figures 5 and 6 show the comparison between the real and the predicted heating temperature for cylindrical bars and gears, respectively. The test error for both predictions was found to be 1.5% and 0.24%, for cylindrical bars and gears, respectively. These results indicated that the XGBoost algorithm gave a good prediction of the heating temperature.

Fig. 5
figure 5

Predicted versus real in-depth temperatures for cylindrical bars showing training (red) and testing (green) data points

Fig. 6
figure 6

Predicted versus real surface temperatures for gears showing training (red) and testing (green) data points

Determination of space of variables for different cases

In order to use all the collected data with some missing ones, it is necessary to consider several cases.

Experiments carried out on cylindrical bars

The space of variables for the induction hardening of cylindrical bars is expressed as:

$$\begin{aligned} X_{1f} = {F, P, T, d, t} \end{aligned}$$
(7)

where F is the frequency; P is the generator power; T is the in-depth temperature; d is the depth at which the hardness was measured and t is the heating duration.

Experiments carried out on gears

In general, the space of variables for the induction hardening of gears could be expressed as:

$$\begin{aligned} X_{2f} = \{MF, HF, P_{MF}, P_{HF}, T, d, t\} \end{aligned}$$
(8)

where MF and HF are the medium and high frequency respectively; \(P_{MF}\) and \(P_{HF}\) are their respective generator powers; T is the temperature measured at the side surface close to the tooth root; d is the depth at which the hardness was measured, and t is the heating duration.

Case 1: Cloud of points-based dataset from both modules

The space of variables could be expressed as:

$$\begin{aligned} X_{C1} = \{MF, HF, P_{MF}, P_{HF}, T,t, d\} \end{aligned}$$
(9)

The dataset is composed of two subsets of 20 runs each for each gear module. In this first case, the two subsets are merged to make a greater dataset allowing to verify if there is a significant difference of the hardness measured between the two gear modules data. This dataset contains a total of 2215 randomly mixed data points. Usually, and in the rest of this work, 70% of the dataset is considered for training, leaving 30% to the testing phase. Here, it represents 1697 training points versus 518 testing points

Case 2: Cloud of points-based dataset added from module 2.5 gear

The second case brings new data concerning the gear with module 2.5 with 4 extra runs added to the initial induction heat treatment conditions. The space of variables remains as case 1:

$$\begin{aligned} X_{C2} = \{MF, HF, P_{MF}, P_{HF}, T,t, d\} \end{aligned}$$
(10)

In this case, 1058 points were considered for training, leaving 322 to the testing phase.

Case 3: Cloud of points-based dataset with frequencies taken off

In this case, the modeling was carried out without frequencies and hence the space of variables is given as:

$$\begin{aligned} X_{C3} = \{P_{MF}, P_{HF}, T,t, d\} \end{aligned}$$
(11)

In this case, 1426 points were considered for training, leaving 434 to the testing phase.

Case 4: Profiles-based dataset without frequencies

In this case, data points were aggregated into profiles with respect to their run. Therefore, 24 profiles were considered for training, leaving 7 profiles to the testing phase.

Data smoothing and experimental variation area

Experimental data are noisy because of the intrinsic physical variability and the uncertainty of measurements. Therefore, it is interesting to smooth the data to increase model training ease. The data to be smoothed are the hardness profiles. There are several statistical methods for reducing output noise. For this work, the method of Kernel Regression [52] was chosen because it implies a conditional expectation. Figure 7 shows the smoothed in-depth hardness profile.

Fig. 7
figure 7

Smoothed in-depth hardness profile using Kernel regression

Moreover, after applying Kernel Regression to smooth the data, the noisy nature of the data was taken into account by integrating an experimental variation area. Each smoothed point has a higher and lower hardness point defining the experimental variation area. This area was considered up to \(\pm 5\%\) of the smoothed hardness as set by industrial practice and will be illustrated in the next Figures as a light-red zone.

Optimized data selection

Specifically for the case 4, because each run belongs to only one set, either train or test, the number of different values for each variable is restricted in each. Hence, the train test split stage has particularly a large impact on the final result because all patterns are not necessarily represented in the training set. To have the most suitable patterns in the training set, a selection is made for the training set based on the test results so the predictions could be more accurate. This allows to avoid extrapolation and to take data that are more likely to train the model.

Results and discussion

Hardness profile prediction in the cylindrical bar

A Random Forest (RF) regressor as well as the XGBoost model were used for a comparative investigation. The metrics used to evaluate the results are the Root Mean Squared Error (RMSE) and the Root Mean Squared Percentage Error (RMSPE) which is a relative error. They are defined as follows in Eq 12.

$$\begin{aligned} RMSE= & {} \sqrt{\frac{1}{n}\sum ^{n}_{i=1}{(y_{pred} - y_{true})^{2}}} \nonumber \\ RMSPE= & {} \sqrt{\frac{1}{n}\sum ^{n}_{i=1}(\frac{{y_{pred} - y_{true}}}{y_{true}})^{2}} \times 100 \end{aligned}$$
(12)

where \(y_{true}\) and \(y_{pred}\) are the real hardness and the predicted one, respectively. As can be seen in Table 5, although the RF shows good results, the XGBoost gives better prediction with smaller relative errors. It is worth mentioning that even though this problem involves complex multi-physical behavior, the geometry being a simple cylinder makes it relatively easy to treat. Hence, it is clear that the results are good enough and that the RF could be considered as an alternative approach.

Table 5 XGBoost and Random Forest results for hardness prediction for cylindrical bars

Figure 8 shows the predicted and experimental in-depth hardness profiles. As shown in this figure, three zones could be identified from the surface: a hardened zone, a transition zone where the hardness drops drastically, and the core of the workpiece unaffected by the induction treatment. Although the predicted profile exceeds the experimental variation area at certain zones, it appeared that the predicted profiles gave the same trends and the same type of hardness level at surface as the measured ones.

Fig. 8
figure 8

Comparison of the XGBoost model with the experimental hardness for the cylindrical bars treated under single frequency. T represents the measured surface temperature

Hardness profile prediction in the gear

All the errors obtained after modeling each of the different cases presented in Section 3 are analyzed and listed in Table 6. Firstly, for each cases the tooth tip seems to be easier to predict than the tooth root. This could be explained by the fact that there is comparatively more data in the tooth tip. However, it is noticeable that this tendency is reversed in the case of indivisible profiles. This could be explained by the fact that the profiles in the tooth are comparatively less diversive than in the tooth tip.

Secondly, it is interesting to see that whatever the case studied: different modules, different frequencies and powers, with or without frequency and profile-based dataset, the results remain more or less always precise. Therefore, there is a certain global efficiency to describe different cases for a global overview, despite some differences in the inputs.

In any case, the error being always lower than 10%, it is reasonable to say that the numerical results are encouraging and satisfying.

Table 6 Training and testing errors of the XGBoost models at the tooth tip and the tooth root for different cases

For the sake of clarity, only few results were presented in Figures 9,10 and 11. Nonetheless, more testing runs of the case 4 will be displayed because it is considered as a validation case. Finally, it is worth mentioning that data from gear with module 3 are not modeled after case 1 because the results obtained in that case prove that it is possible with the data merged from both of these gears to have a relevant hardness prediction. Moreover, data from gear with module 2.5 has more and complete available data. Therefore, it was chosen for further modeling.

Fig. 9
figure 9

Comparison of the XGBoost model with the experimental hardness for the gear treated under double frequency - Case 1. T is the measured surface temperature

Fig. 10
figure 10

Comparison of the XGBoost model with the experimental hardness for the gear treated under double frequency - Case 2. T is the measured surface temperature

Fig. 11
figure 11

Comparison of the XGBoost model with the experimental hardness for the gear treated under double frequency - Case 3. T is the measured surface temperature

It is clear that for each case, regardless of the illustrated run, The XGBoost predictions were in good agreement with the experimental results.

Fig. 12
figure 12

Comparison of the XGBoost model with the experimental hardness for the gear treated under double frequency - Case 4. T is the measured surface temperature

Although some errors appear more remarkable than in the previous cases, as in Figure 12 (b), the XGBoost results are still in good agreement with the experimental hardness profiles and none of them is unconsistent. This case serving as a global validation of the ability of an XGBoost model to describe the hardness of an hardened gear, the model presented is quite efficient and accurate.

Conclusion

In this work, an approach based on artificial intelligence technique was developed to predict the in-depth hardness profile within 300M steel bar and C45 steel spur-gear. The capability of this approach to get a representative induction hardening treatment was evaluated and discussed. The main conclusions were as follows:

  • Two experiments were carried out on cylinder bars and gears with single and double-frequency induction hardening, respectively. Data-driven models were developed based on XGBoost library, a tree-based gradient-boosted machine learning model.

  • The low value of RMSPE and the accurate predicted profiles found indicated that the XGBoost model could adequately predict the hardness profiles.

  • The space of variables did not have a significant impact on the training nor the testing results.

  • Results showed that the XGBoost model predictions were in good agreement with experimental measurements in each case studied.

It is worth outlining that it is possible to improve the space of variables, considering in-depth temperature for the gear case and not only the surface temperature: it could be easier to describe the hardness. Even if the obtained results are satisfying, it is worth noticing that they can be improved with more runs considering more different process parameters. The predictions could be more accurate and provide a higher threshold of confidence. According to the obtained results, the proposed modeling can be used in induction treatment process optimization and extended to other geometries or treatments.