1 Introduction

In many industrial and civil applications, materials and structures are subjected to various manufacturing and service conditions. It is thus imperative to enhance the predictive capabilities of modeling various types of defects, e.g., micro-cracks or micro-voids, which anticipate possible fracture growth. A typical framework where the problem can be encountered is the welding process, i.e., the application of a joint on two or more pieces. In the welding strip, matter of discontinuity appears at micro-scale as either spherical or elliptical air bubbles. These discontinuities cause a stress concentration, modifying the constitutive response of the material, or, in other words, building a damage within the material. The latter phenomenon represents the initial step to crack extension and, consequently, the voids’ detection and control should be investigated by means of reliable devices and procedures. The quality of a welded joint depends on the product allocation. In fact, some types of welding are suitable for a particular case, the same type of welding will not be eligible in another situation. The quality is devised according to the intended use of the joint, but it takes into account all factors that may affect the welding. Scientific literature suggests a lot of different solutions for the problem of material inspection. Nowadays, the mostly used techniques are based on non-destructive testing and evaluation (NDT/E), having a very important role in inspecting aging materials for industrial applications or within the framework of civil engineering. Within this context, it is very important to plan a suitable method able to distinguish the presence or absence of defects within welds as well as a robust procedure able to characterize the defect itself: its implementation can be a useful support for inspectors. But, in order to characterize the defects within the inspected materials, it is necessary to solve an inverse problem that is mostly ill-posed. In this case, the main problems consist on both the accurate formulation of the direct problem and the correct regularization of the inverse electromagnetic problem. In the last decades, a useful and very performing way to regularize ill-posed inverse electromagnetic problems are based on the use of the so-called “learning by sample techniques”. They allow to heuristically solve the inverse problem, starting from the experience, and so implementing such intelligent and non-crisp algorithms as neural networks, fuzzy inference systems and so on. In this paper, we propose a performance analysis by using heuristic approaches and starting from a well-known way of inspecting welding strips [7, 12]. The latter exploits a rotating magnetic field, i.e., a magnetic field generated by a three-phase system, able to rotate in the time-space domain. The magnetic field induces eddy currents within the inspected specimens, which are influenced by the presence of a possible defect, e.g., voids, and in turn influences the external magnetic field. Its component normal to the upper surface of the modeled plate is measured on the specimen’s surface. In the past, a lot of experimentations [13] and numerical modeling [1, 13, 14] have been carried out in order to understand the behavior of eddy currents if a crack occurs into the inspected materials [13, 14]. In our work, we did not want to focus our attention to cracks in homogeneous materials, but we used a finite element method (FEM) in order to characterize eddy currents into welded objects. We studied the case in which an air bubble is present into the welding, thus weakening the strength of the finally obtained object. A number of simulations have been carried out, involving a number of welding strips with different elliptical voids, having varying shapes, locations, and orientations. All the collected data have been subsequently used in order to train and test a suitable Elman network, for evaluating the performance of the methodology characterizing the voids. The performances are satisfying: the approach is able to recognize position and dimensions of very small cracks. This paper can be considered an evolution of a previous work [8], based on a wavelet artificial neural network approach.

1.1 An overview of defectiveness in welding strip

Welding process could induce the following relevant defects, compromising the structural integrity of the same strips and consequently, of specific components and structures:

  • lack of fusion: if the fusion of the basic metal is excessive, continue grooves are formed on the sides, causing a depression along the sides of the cord; sometimes, the incisions can be eliminated by using a thin covering material;

  • excess of penetration on the top (dripping): if a huge quantity of metal is caught at the top of the weld, a toe crack could be determined;

  • incomplete penetration: it is caused by a lack of fusion at the welding apex and seriously reduces the resistance of the joint; in heading welding made with one or more rubs, the defect can be eliminated by chiseling out, and giving an additional rub;

  • gluing: it occurs when, during the welding process, the complete fusion of metal does not take place, i.e., when the welding metal overlaps the not-yet-fused material to weld, without a mixing between the metals;

  • cracks: the most serious kind of flaws, because they originate from phenomena of metallurgical nature. Since they depend on the cracking temperature, they are named as hot or cold cracks.

Figure 1 shows the most typical defects in metal welded strips. Sizes can vary, greatly depending on the welding process and conditions. For instance, according to European laws UNI EN 287-2 and UNI EN 288-4, the maximum tolerable crack dimension is fixed to 0.5 (mm) of diameter for a circular defect. In many cases, it is very difficult to distinguish between the kind of defects starting from typical NDTs’ measurements. In fact, at the state-of-the-art, non destructive identification systems allow to allocate a defect but without being able to determine its shape. In addition, different kinds of defects can cause similar signals. Therefore, a soft computing-based approach can be very useful for an automatic and, for instance, for real-time classification. In the following section, rotating magnetic field based on finite element analysis (FEA) will be described. Subsequently, techniques used for defect classification will theoretically be presented.

Fig. 1
figure 1

Output simulation signal

2 On the A–ψ formulation for building the dataset

For our purposes, we need to implement a suitable database, useful for subsequent regularization of the ill-posed inverse problem. It can be stated as follows: evaluating the extension of voids starting from suitable data. The goal is the detection of defects in the welding and the realization of a data set in order to train and test a suitable Elman network. Usually, data are represented by in-lab measurements or numerical simulations [10]. In our case, we exploited the latter path, modeling the direct problem through a commercial FEM software. We aim to analyze the effectiveness of a welding performed on two slabs of structural steel. The geometry of the examined case presents a “V” type welding, where a bubble-shaped defect has been modeled. Geometrical dimensions of our model are listed in Table 1. For our purpose, we verified the distortion of the magnetic field density (T) [11, 15] to detect the defect presence of a porosity bubble, formed during welding process. Figure 2 shows the effect of the presence of defect in our FEM analysis. The simulations have been carried out by changing the size of the flaw, and exploiting the phenomenon of magnetic rotating field, since its main advantage is the insensitivity to crack’s orientation. In the proposed approach, we exploit the A–ψ formulation [16]. In the case of magnetostatic and quasi-static fields, Ampère–Maxwell’s equation can be written as

$$ \nabla\times{\mathbf{H}}={\mathbf{J}} $$
(1)

where \(\mathbf{H}\) represents the magnetic field and \(\mathbf{J}\) the current density, respectively. If we consider a moving object with velocity \(\mathbf{v}\) relative to the reference system, the Lorentz force equation establishes that the force \(\mathbf{F}\) per charge q is then given by

$$ \frac{{\mathbf{F}}}{q}={\mathbf{E}}+{\mathbf{v}}\times{\mathbf{B}} $$
(2)

where \(\mathbf{E}\) represents the electric field; \(\mathbf{v}\) the instantaneous velocity of the object derived from the expression of the Lorentz force and \(\mathbf{B}\) the magnetic induction. In a conductive medium, an observer traveling with the geometry sees the current density (considering that σ is the electric conductivity) \(\mathbf{J}=\sigma\left(\mathbf{E}+\mathbf{v} \times\mathbf{B}\right)+\mathbf{J^{e}}; \) therefore, we can rewrite (1) as follows

$$ \nabla\times{\mathbf{H}}=\sigma\left({\mathbf{E}}+{\mathbf{v}} \times{\mathbf{B}}\right)+{\mathbf{J^{e}}} $$
(3)

where \(\mathbf{J^{e}}\) [A/m2] is an externally generated current density. Considering, for a transient analysis, the definitions of magnetic vector potential \(\mathbf{A}\) and electric scalar potential V:

$$ \begin{aligned} {\mathbf{B}}&=\nabla\times{\mathbf{A}}\\ {\mathbf{E}}&=-\nabla V-\frac{\partial{\mathbf{A}}}{\partial t} \end{aligned} $$
(4)

and the constitutive relationships

$$ {\mathbf{B}}=\mu_{0}\mu_{r}{\mathbf{H}}\Leftrightarrow{\mathbf{H}}= \mu_{0}^{-1}\mu_{r}^{-1}{\mathbf{B}} $$
(5)

where μ0 and μ r are free space and relative magnetic permeability; we may rewrite (3), by substituting (4) and (5) in it, as

$$ \sigma\frac{\partial{\mathbf{A}}}{\partial t}+\nabla\times\left(\mu_{0}^{-1}\mu_{r}^{-1}\nabla\times{\mathbf{A}}\right) -\sigma{\mathbf{v}}\times\left(\nabla\times{\mathbf{A}}\right)+\sigma\nabla V ={\mathbf{J^{e}}} $$
(6)

Since we are interested in perpendicular induction current, only the z-component of \(\mathbf{A}\) is non null. Therefore, the formulation of the 3-D equation (5) is simplified to

$$ \sigma\frac{\partial{\mathbf{A}}_{z}}{\partial t}+\nabla\times\left(\mu_{0}^{-1}\mu_{r}^{-1}\nabla\times{\mathbf{A}}_{z}\right) - \sigma{\mathbf{v}}\times\left(\nabla\times{\mathbf{A}}_{z}\right) =\sigma\frac{\Updelta V}{L}+{\mathbf{J^{e}}}_{z} $$
(7)

where \(\Updelta V\) is the difference of electric potential and L is the thickness along the z-axis. The partial difference equation (PDE) formulation of equation (7) can be written as

$$ \sigma\frac{\partial A_{z}}{\partial t}+\nabla\cdot\left(\mu_{0}^{-1}\mu_{r}^{-1}\nabla A_{z}\right) -\sigma{\mathbf{v}}\cdot\nabla A_{z} =\sigma\frac{\Updelta V}{L}+J^{e}_{z} $$
(8)

In this way, we calculated the magnetic vector potential \(\mathbf{A}\) in a generic subdomain \(\mathrm{\Upomega}. \) For our aim, it is necessary to impose the boundary conditions as follows. Magnetic field (\(\mathbf{n}\times\mathbf{H}=\mathbf{n}\times\mathbf{H_{0}}\)) for boundary of air where acting the rotating magnetic field; for remaining boundaries, included the defect, the continuity is assured by the expression \(\mathbf{n}\times\left(\mathbf{H_{1}}-\mathbf{H_{2}}\right)=0\) [11, 16]. The rotation effect of the magnetic field vector has been simulated by applying a uniform \(\mathbf{B}\) vector, timely rotated according to the following Euler rotation formulation [18]:

$$ \left[ \begin{array}{c} {\mathbf{x}}(t+\tau) \\ {\mathbf{y}}(t+\tau) \end{array}\right]=\left[\begin{array}{cc} \cos\left(\omega t\right) & \sin\left(\omega t\right) \\ -\sin\left(\omega t\right) & \cos\left(\omega t\right) \\ \end{array} \right]\left[\begin{array}{c}{\mathbf{x}}(t) \\ {\mathbf{y}}(t)\end{array} \right] $$
(9)

Table 2 resumes the values of set electrical parameters. The collected database is composed by 1,000 numerically simulated signals, characterized by defect’s presence with different frequency values and 200 numerically simulated signals showing absence of defect. We added Gaussian noise with different magnitudes to the retained simulation results.

Table 1 General settings of numerical models
Table 2 Electrical parameters
Fig. 2
figure 2

Categories of discontinuity in metal welded strips

3 Elman network for the solution of inverse problem and testing results

Since nowadays, a lot of researchers exploited the affordability of neural networks to inspect and characterize weldings [3, 6, 17, 19]. In this paper, we approach the problem of estimate the diameter of the bubble within the welding starting from experimental measurements. It can be solved as a typical inverse problem of pattern regression starting from computed measurements (see the previous work [2]). Our proposed approach, useful to detect the flaw presence, exploits a particular version of recurrent neural networks (RNN), i.e., Elman neural network (ENN) [5].

A simple recurrent network (SRN) is a variation on the multi-layer perceptron (MLP), sometimes called an “Elman network” due to its invention by Elman [5]. The ENN commonly is a three-layer network with feedback from the first-layer output to the first-layer input. This recurrent connection allows the ENN to both detect and generate time-varying patterns. A three-layer ENN is shown in Fig. 3. The ENN has hyperbolic tangent sigmoid transfer function (tansig in the figure) neurons in its hidden (recurrent) layer and linear transfer function (purelin in the figure) neurons in its output layer. This combination is special in that three-layer networks with these transfer functions can approximate any function (with a finite number of discontinuities) with arbitrary accuracy. The only requirement is that the hidden layer must have enough neurons. More hidden neurons are needed as the function being fitted increases in complexity. In our work, a three-layer network has been used, with the addition of a set of “context units” in the input layer. There are connections from the middle (hidden) layer to these context units fixed with a weight of one. At each time step, the input is propagated in a standard feed-forward fashion, and then a learning rule (usually back-propagation) is applied. The fixed back connections result in the context units always maintaining a copy of the previous values of the hidden units (since they propagate over the connections before the learning rule is applied). Thus the network can maintain a sort of state, allowing it to perform such tasks as sequence prediction that are beyond the power of a standard MLP. In a fully recurrent network, every neuron receives inputs from every other neuron in the network. These networks are not arranged in layers. Usually, only a subset of the neurons receive external inputs in addition to the inputs from all the other neurons, and another disjunct subset of neurons report their output externally as well as sending it to all the neurons. These distinctive inputs and outputs perform the function of the input and output layers of a feed forward or simple recurrent network and also join all the other neurons in the recurrent processing. Particularly, the use of RNNs as system identification networks and feedback controllers offers a number of potential advantages. RNNs provide a means for encoding and representing internal or hidden state, albeit in a potentially distributed fashion, which leads to capabilities that are similar to those of an observer in modern control theory. Moreover, RNNs are capable of providing estimations even in the presence of measurements noise and provide increasing flexibility for filtering noisy inputs [5]. Proposed computational intelligence applications utilizes an ENN as heuristic pattern classifier. We chose this kind of network since it can store information for future reference, and thus it is able to learn temporal patterns as well as spatial patterns (our case). The ENN can be trained to respond to, and to generate, both kinds of patterns.

Fig. 3
figure 3

A graphical depiction of a generic ENN, having an input layer, an output layer, and a recurrent (hidden) layer

In order to set the amount of training signals, we made a trade-off between the requirements of an as large as possible training subset and a significant availability of testing signals. Thus, in our experimentations, training set has been composed by 85 of collected signals. Remaining pulses compose the test subset. Inputs of the system are the FEM signals. The output of the system is represented by standards errors described below. EN having a different number of neurons for the hidden layer (according to the Kurková’s theorem [9]) uses a back-propagation (BP) algorithm. Different activation functions have been considered in order to train test the EN with a consequent analysis of the best performances by a convenient variation of the training parameters. Particularly, best performances have been obtained with log-sigmoid activation function. Here, standard errors, mean squared error (MSE, 10), mean absolute error (MAE, 11), root mean squared error (RMSE, 12), root relative squared error (RRSE, 13), relative absolute error (RAE, 14), and one regression index, Willmott’s index of agreement (WIA, 15), are used as derivation measurements between measured and predicted values. The square of the so called Pearson’s coefficient of regression [4], i.e., the regression R value (please, note that R = 1 means perfect correlation), learning performance indexes, as a consequence of application of the BP algorithm. Generally, WIA measures the regression degree, and the larger the WIA, the more accurate are the prediction results.

$$ \hbox{MSE}=\frac{\sum_{i=1}^{n}(x_{i}-\widehat{x_{i}})^{2}}{n} $$
(10)
$$ \hbox{MAE}=\frac{1}{n}\sum_{i=1}^{n}|x_{i}-\widehat{x_{i}}| =\frac{1}{n}\sum_{i=1}^{n}|e_{i}| $$
(11)
$$ \hbox{RMSE}=\sqrt{\frac{\sum_{1}^{n}(x_{i}-\overline{x})^{2}}{n}} $$
(12)
$$ \hbox{RRSE}=\sqrt{\frac{\sum_{j=1}^{n}(P_{ij}-T_{j})^{2}} {\sum_{j=1}^{n}(T_{j}-\overline{T})^{2}}} $$
(13)
$$ \hbox{RAE}=\frac{\sum_{j=1}^{n}|P_{ij}-T_{j}|}{\sum_{j=1}^{n}|T_{j}-T|} $$
(14)
$$ \hbox{WIA}=\frac{\sum_{i=1}^{n}(x_{i}-\widehat{x_{i}})^{2}}{\sum_{i=1}^{n} (|x_{i}^{'}|-|\widehat{x_{i}}^{'}|)^{2}} $$
(15)

where x is the predict result, \(\widehat{x}\) is the measured result of the network, P ij is the predict value, T is the actually value, n is the number of considered patterns. Figure 4 below shows the performances for each one of the considered setting of the network. A maximum on R and WIA represents good regression abilities of the network and thus good performances in terms of estimation voids’ sizes. Vice versa, the lower the values of MAE, RRSE, RMSE, RAE, and MAE (representing statistical distribution of errors between actual and estimated values) the better the ENN’s performances. Therefore, ENNs having 4, 5, or 6 hidden neurons in recurrent layer represent a good compromise for our purposes. Tables 3 and 4 resume values of evaluation indexes for 4 and 6 hidden neurons in recurrent layer, respectively.

Fig. 4
figure 4

Performances in terms of estimation errors (MAE, RRSE, RMSE, RAE, and MAE) and regression abilities (R and WIA) for the considered configurations of Elman networks, in which we changed the number of hidden neurons

Table 3 ENN performances: 4-neurons in hidden layer
Table 4 ENN performances: 6-neurons in hidden layer

4 Concluding remarks

On the basis of the numerical method presented in this paper, the authors have developed a finite element code for the analysis of the rotating magnetic field for metal welding strips. For our analysis, we used a classical “V”-profile welding and simulated different sizes of defects according to the UNI EN law. Specifically, exploiting rotating magnetic field using a self implemented FEA code, a bi-dimensional time-dependent model has been studied to evaluate the distortion of the magnetic field and the magnetic field density due to the defect presence. The variation of the magnetic field \(\mathbf{H}, \) induced by the variation of eddy currents, particularly, the normal component of \(\mathbf{H}, \) i.e. \(\mathbf{H}\bot, \) is measured by suitable sensors in order to detect the presence of cracks, since it is not influenced by the exciting coils. The magnetic rotating field represents an insensitive solution to the crack’s orientation, which induces variation of the eddy current density without a mechanical movement, with a remarkable economic saving. With these information, an ENN-based approach has been exploited in order to characterized the defect, starting from signals obtained by computer simulations. Numerically obtained rotating magnetic field signals have been used to train the ENN-based regressor. The proposed method provides a good overall accuracy in reconstructing the defect’s diameter, as our experimentations demonstrate. This aspect represents an useful support to the inspector, specially regarding the detection of defects with small size, improving their resolution. At the same time, the procedure should be validate for defect with different shape. The presented method can be considered more effective for dealing with dense training sets. The presented results can be considered as preliminary results; anyway, they are very encouraging and suggest the possibility of increasing and generalizing the performance of the EN-based classifier just refining its training step, for instance including, within the training set, rotating magnetic field signals able to describe flaws with different spatial extension and for different positions. The authors are actually engaged in this direction.