Wavelet-artificial neural network to predict the acetone sensing by indium oxide/iron oxide nanocomposites

This study applies a hybridized wavelet transform-artificial neural network (WT-ANN) model to simulate the acetone detecting ability of the Indium oxide/Iron oxide (In2O3/Fe2O3) nanocomposite sensors. The WT-ANN has been constructed to extract the sensor resistance ratio (SRR) in the air with respect to the acetone from the nanocomposite chemistry, operating temperature, and acetone concentration. The performed sensitivity analyses demonstrate that a single hidden layer WT-ANN with nine nodes is the highest accurate model for automating the acetone-detecting ability of the In2O3/Fe2O3 sensors. Furthermore, the genetic algorithm has fine-tuned the shape-related parameters of the B-spline wavelet transfer function. This model accurately predicts the SRR of the 119 nanocomposite sensors with a mean absolute error of 0.7, absolute average relative deviation of 10.12%, root mean squared error of 1.14, and correlation coefficient of 0.95813. The In2O3-based nanocomposite with a 15 mol percent of Fe2O3 is the best sensor for detecting acetone at wide temperatures and concentration ranges. This type of reliable estimator is a step toward fully automating the gas-detecting ability of In2O3/Fe2O3 nanocomposite sensors.


Experimental data for the acetone sensing by In 2 O 3 /Fe 2 O 3 nanocomposites
A reliable databank should be available to construct and validate empirical 39 and semi-empirical 40 correlations and machine learning methods 41 .Hence, this study has collected 119 datasets about the acetone-detecting ability of the In 2 O 3 /Fe 2 O 3 nanocomposite sensors from valid references 4,8,9,21 .These laboratory-scale researches have monitored the sensor resistance ratio (SRR) of the In 2 O 3 -based sensors in the air with respect to the acetone as a function of the nanomaterial chemistry, operating temperature, and acetone concentration 4,8,9,21 .The ranges of independent (Fe 2 O 3 mole fraction in the nanocomposite sensor, operating temperature, and acetone concentration) and dependent (sensor resistance ratio) variables have been introduced in Table 1.
Figure 1 presents the histogram of independent and dependent variables gathered from the literature.This figure also reports the average and standard deviation (SD) of this collected database.Equations ( 1) and ( 2) have been utilized to calculate these statistical features 42 .
here, V and V ave are the variable and its average value.The number of available datasets has been shown by N.

Wavelet transform-artificial neural network
Both machine and deep learning methods are trustful tools to conduct sensitivity analysis 43 , parameter forecasting 44 , classification 45 , and control 46 purposes.As the most popular machine learning approach, an artificial neural network (ANN) can be constructed by combining several processing nodes (i.e., neurons or nodes) in some interconnected successive neuronic layers 47 .The multi-layer perceptron (MLP) is a well-established ANN type that often includes two feedforward neuronic layers, namely hidden and output 48 .Since the number of output nodes equals the number of dependent variables, it is always known 49 .On the other hand, a suitable number of hidden nodes is often found by applying the trial-and-error technique.
The artificial neuron can be viewed as a combination of linear (L) and non-linear (NL) mathematical operations.The linear part (Eq. 3) combines the multiplication of the node's entry vector (X) by the weight coefficients (W) and the bias (b).
The non-linear part is responsible for passing the linear part result through a specific equation, namely the transfer function (g).Equation (4) explains how the neuron's output (out) has been achieved.Indeed, the transfer function helps the neuron and artificial neural network to simulate non-linear problems.The main limitation of the MLP model is that it can only be equipped with some pre-defined transfer functions 50 .
(1) The most widely-used transfer functions, like tangent and logarithm sigmoid and radial basis, are not non-linear enough to correlate highly non-linear problems precisely.

Combining the MLP and wavelet transform
Researchers have included the wavelet transforms in the MLP body as a transfer function to build the WT-ANN model 51,52 .The B-spline wavelet is a function with tunable nonlinearity often used as a transfer function in the WT-ANN's hidden layer (g hid ) 53 .Equations ( 5) and (6) show the mathematical formula of the B-spline wavelet transfer function (BSWTF) 54 .
where α, β, and γ are the parameters related to the nonlinearity and shape of the BSWTF.The B-spline wavelet transfer functions with different α, β, and γ values have been depicted in Fig. 2. It can be observed that this function has enough nonlinearity to correlate even the most complex phenomena.Moreover, it is possible to engineer its shape by changing its shape-related parameters 55 .

Estimating acetone detecting ability of the In 2 O 3 /Fe 2 O 3 sensor
Figure 3 presents the WT-ANN deployed to estimate the acetone-detecting ability of the In 2 O 3 /Fe 2 O 3 sensor as a function of nanocomposite chemistry, operating temperature, and acetone concentration.It can be seen from Fig. 3 that the constructed WT-ANN constitutes an input layer and two neuronic layers of hidden and output.These layers are fully interconnected in a feedforward manner.The hidden layer has the B-spline wavelet transfer function, while the output layer equips with the linear transfer function.This figure states that the vector of independent variables (X) is fully connected to the hidden layer's nodes by weighted links ( W I→H ).Some mathematical processes based on Eq. ( 7) have been imposed on the entry vector of X to the hidden layer to achieve the outlet vector ( HL out ).
(5) The adjustable coefficients between the input and hidden layers are W I→H , a, and b.Equation ( 7) approves that the B-spline wavelet transfer function has been incorporated in the hidden layer of the WT-ANN.
Since the WT-ANN's output layer has the linear transfer function, it is possible to achieve the predicted sensor resistance ratio (SRR pred ) by multiplying the Out HL and the weighted connections between the output and hidden layers ( W H→O ).
It should be noted that the W H→O shows the adjustable coefficients between the output and hidden layers.All WT-ANN coefficients have been tuned during the cross-validation step employing an appropriate optimization algorithm 57,58 .The literature has extensively explained the tuning procedure of the W I→H , W H→O , a, and b 51 .

Determining the best structure of the WT-ANN
The BSWTF parameters 53 and the number of hidden nodes 51 are those structural properties of the WT-ANN that should be selected appropriately.This study uses the genetic algorithm 59 and the trial-and-error techniques to (7) www.nature.com/scientificreports/find these two structural properties, respectively.The deviation between actual and predicted SRRs is an objective function that must be minimized to construct the WT-ANN appropriately.The root mean squared error (RMSE), absolute average relative deviation (AARD%), MAE (mean absolute error), and coefficient of regression (R 2 ) measure this deviation.Equations ( 9)-( 12) express the formula of MAE, R 2 , MSE, and AARD%, respectively 60,61 .
The actual measurements, WT-ANN predictions, and average values have been shown by the superscripts of act, pred, and ave, respectively.

The best WT-ANN topology
It is obvious that at least one hidden node is required to build a WT-ANN with one hidden neuronic layer.Moreover, there is a rule of thumb to find the maximum allowable hidden nodes in the WT-ANN body 62 .The literature states that the numbers of the cross-validation datasets (here, 101 samples) should be at least two times the model's tunable coefficients 62 .Therefore, the WT-ANN models may be built with a maximum of ten hidden nodes.Table 2 presents the highest accurate predictions obtained by different WT-ANN topologies differing with respect to the number of hidden nodes and BSWTF shape.The accuracy of the WT-ANN models over the cross-validation and testing groups and all database has been monitored by four statistical matrices.It can be concluded that the WT-ANN with α = β = 0.5 and γ = 1.0 and nine hidden nodes (highlighted by the gray color) is the highest precise model for estimating the acetone detecting ability of the In 2 O 3 /Fe 2 O 3 nanocomposite sensors.Although Table 2 shows the best topology of the wavelet transform-artificial neural network, it is better to use the ranking analysis to approve this matter further.The ranking places of different WT-ANN structures in the development and validation stages have been depicted in Fig. 5. Equation (13) has been used to calculate the average rank of each WT-ANN system over the RMSE, MAE, AARD%, and R 2 indices.
The ranking analysis also supports nine hidden nodes, and α = β = 0.5 and γ = 1.0 is the best WT-ANN topology for simulating the acetone-detecting ability of the In 2 O 3 /Fe 2 O 3 nanocomposite sensors.
The learning algorithm's performance to tune the coefficients of the optimum WT-ANN (i.e., W, a, and b) during the five-fold cross-validation has been illustrated in Fig. 6.This figure clarifies how the mean squared error (MSE) between the actual SRRs and their counterpart predictions by the WT-ANN continuously declines by increasing the number of optimizing tries (i.e., epoch).The observed MSE eventually reaches the desired value of 0.009 after ~ 750 epochs.This figure approves an excellent performance of the optimum WT-ANN model for monitoring the acetone sensing by the In 2 O 3 /Fe 2 O 3 nanocomposites.The built WT-ANN successfully predicts the sensor resistance ratio by the residual error ranges from -2 to 2.5.Moreover, this analysis states that 35 cross-validation and five testing samples have been estimated with a residual error equal to zero.
The predicted SRRs by the well-structured WT-ANN model versus their laboratory-measured values in the cross-validation and testing stages have been separately indicated in Fig. 8.This figure states that the deployed WT-ANN model estimates the actual SRR values with acceptable accuracy.This finding can be highlighted as

Parametric study
The variation of the acetone detecting ability of nanocomposite sensors with different chemistry by temperature has been plotted in Fig. 9.This figure includes both experimentally reported samples and their counterpart estimations by the well-tuned WT-ANN model.A high level of agreement exists between the actual and predicted values of the sensor resistance ratios in a wide range of operating temperatures and nanocomposite chemistries.
Although pure Fe 2 O 3 and In 2 O 3 sensors have shown the minimum acetone detecting ability, their composites almost show better sensing performances.Generally, there is no specific trend for the acetone-detecting ability of nanocomposite with different chemistry.The acetone sensing ability of the In 2 O 3 -based nanocomposites increases by increasing their Fe 2 O 3 molar content up to 15%, and after that, it decreases dramatically.
The In 2 O 3 -based nanocomposite sensor fabricated by 15 molar percent of Fe 2 O 3 has the highest sensitivity for detecting the acetone agent in all temperature ranges.The 0.75In 2 O 3 /0.15Fe 2 O 3 nanocomposite shows its maximum SRR at 473 K (200 °C).Despite this complex behavior, the constructed WT-ANN precisely identifies the SRR variation trend and estimates relatively all individual data samples.It can also be concluded that the acetone-detecting ability of the given nanocomposite continuously improves by increasing the acetone concentration.Indeed, raising the acetone concentration from 10 to 1000 ppm increases the SRR by more than 400%.

Conclusions
A straightforward intelligent correlation based on the wavelet transform-artificial neural network has been built to calculate In 2 O 3 /Fe 2 O 3 sensor resistance ratio in the air with respect to the acetone from nanocomposite chemistry, temperature, and acetone concentration.Combining the genetic algorithm and trial-and-error analysis approved that a WT-ANN model with only nine hidden neurons and α = β = 0.5 and γ = 1.0 is the highest accurate model for the considered task.The deployed WT-ANN shows an incredible performance for precisely estimating 119 SRR data points of the nanocomposites ranging from pure In 2 O 3 to pure Fe 2 O 3 .The overall MAE = 0.7, AARD% = 10.12%,RMSE = 1.14, and R 2 = 0.95813 have been presented by the WT-ANN for calculating the SRR at wide ranges of acetone concentration, sensor chemistry, and temperature.The modeling results indicated that 0.75In 2 O 3 /0.15Fe 2 O 3 nanocomposite has the highest acetone sensing ability over wide ranges of operating conditions.The proposed WT-ANN model in this study can help full-automating the acetone detecting ability of the In 2 O 3 /Fe 2 O 3 sensor and enhance the knowledge about the sensor behavior in different operating conditions.

Figure 2 .Figure 3 .
Figure 2. The general shape of the B-spline wavelet incorporated in the WT-ANN model.

Figure 4
Figure 4 is an understandable flowchart to explain the processes followed to design the well-tuned WT-ANN model for estimating the acetone detecting ability of the In 2 O 3 /Fe 2 O 3 sensors.This flowchart mainly includes three separate parts as follows: I. Constructing the WT-ANN model (green part) II.Five-fold cross-validation (red part) III.Comparing the WT-ANNs performance to select a model with the highest prediction accuracy (blue part)This flowchart also has two internal and external loops for adjusting the BSWTF parameters and WT-ANN coefficients, respectively.

Figure 4 .
Figure 4. Constructing the WT-ANN model utilizing the trial-and-error technique and genetic algorithm (GA).

Figure 7
Figure 7 introduces the histogram of residual error (RE) between actual and estimated SRRs in the crossvalidation and testing stages.The numerical values of this residual error can be obtained from Eq. (15).

Figure 5 .Figure 6 .
Figure 5. Rank order of different WT-ANN topologies differing from their number of hidden nodes and B-spline wavelet shape.

Figure 7 .
Figure 7.The histogram of the observed residual error by the optimum WT-ANN in the cross-validation and testing stages.

Figure 8 .
Figure 8. Correlation between predicted SRRs by the optimum WT-ANN and their related actual measurements.

Figure 9 .
Figure 9.The influence of sensor chemistry and operating temperature on the acetone sensing (100 ppm).

Figure 10 .
Figure 10.The effect of acetone concentration on the performance of the highest sensitive sensor (0.15 Fe 2 O 3 ) at 473 K.
Independent DependentRange of the Fe 2 O 3 content of nanocomposite (mole fraction) Range of temperature (K) Range of acetone concentration (ppm) Range of SRR (-)

Table 2 .
The best results obtained by the different topologies of the wavelet neural network.