{'fraction_non_alphanumeric': 0.02764850807555434, 'fraction_numerical': 0.003387626608267178, 'mean_word_length': 4.713587487781036, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Efficient reconstruction of corrosion profiles by infrared thermography

In this paper, we propose a novel algorithm to solve the hidden corrosion estimation problem from experimental data produced by infrared thermography. This is therefore a thermal inverse problem. The algorithm is put in a predictor-corrector form and uses an Adaptive Finite Element model as the reference model. The adaptation is done in the (linear) predictor step, while the parameter estimation is done in the (nonlinear) corrector step. An ad-hoc regularization strategy has been developed. Experiments with real data have confirmed the effectiveness of the method. Considerable computational savings have been achieved compared to a standard algorithm formulation.


Introduction
Pulsed Infrared Thermography becomes practical in detecting hidden corrosion when induced temperature signals are high enough, even if they exist for short time intervals. The operating principle is based on analyzing spatial-temporal phenomena which occur in corroded sites subjected to stimulated heat diffusion. In the framework of the one-dimensional (1D) approach, it has been shown that pulse heating is capable to produce high temperature contrasts but absolute temperature signals might be low due to insufficient amount of total energy injected into the sample. Oppositely, long heating can significantly warm up the tested object but provides lower contrasts over defects. In this work the pulse heating is considered.
The 1D approach assumes that transient thermal events occur independently in sound and defect areas, therefore, defects are to be very large so that the boundary heat diffusion effect can be neglected in the defect center. In such a case an analytical approach is possible. It was shown in Vavilov et al [14] that the relative material loss (i.e. the ratio between the residual thickness in the corroded spot and the thickness of the defect-free area) is a function of the temperatures over the defect and the sound area.
When dealing with small defects, the lateral heat diffusion is no longer negligible and must be taken into account (2D and 3D cases). In Marinetti et al [12], a large number of numerical simulations allowed to define a correction curve that retrieves the actual amount of material loss from the underestimate obtained by applying the 1D formula, but only for some known-shaped defects. Moreover, the numerical model was used just in order to replicate virtual tests with different defect sizes and depths and did not play any role in the solution of the inverse problem.
In this paper, a Finite Element model is used in an optimization loop to solve the inverse heat transfer problem. In the numerical model, the corrosion profile is approximated by a general piecewise-constant function f (x). In particular, we consider situations in which the corrosion profile may have high gradients, as it happens e.g. in problems where there is a localized deep corrosion. It is important to be able to estimate the local depth of the corrosion. To represent adequately the corrosion profile with a piecewise-constant approximation it is necessary to use a quite small subdivision step, at least locally. A small subdivision step of the corrosion profile corresponds to a large number n θ of segments and, therefore, of parameters to be estimated. This fact increases the computational complexity of the estimation problem and, considering also the ill-conditioning of the problem, may ask for prohibitive computing times for a real-time diagnostic instrument, especially in a 3D problem setting. Moreover, a uniform subdivision of the corrosion profile means small segments even where the profile is almost constant, or possesses small gradients, and therefore the model may have more parameters than necessary, i.e. less parameters could be sufficient to approximate well the profile. The criterion of using a model of complexity not higher than necessary is a guideline in identification theory, suggested by computational and statistical arguments, see e.g. Ljung [10]. On the other hand, the corrosion profile is a-priori unknown. We propose an adaptive subdivision of the profile, based on indicators obtained after iterative comparisons between the experimental measurements and model predictions, i.e. a-posteriori.
We propose a novel algorithm to solve the corrosion estimation problem from experimental data produced by infrared thermography. The algorithm is put in a predictor-corrector form and uses an Adaptive Finite Element model as the reference model. The adaptation is done in the (linear) predictor step, while the parameter estimation is done in the (nonlinear) corrector step. An ad-hoc regularization strategy has been developed.
In the literature, different aspects and solution methods for this problem have been studied. In [9] the authors consider the time-harmonic case (thermal waves) and the impulsive excitation with a boundary integral formulation of the forward problem. Uniqueness and stability have been studied in [3,4]. Moreover, in [8,6] it is proposed a kind of predictor-corrector algorithm for a different thermal inverse problem. The topic of using an adaptive finite element model in parameter estimation problems is discussed, for example, in [2] and [1].

Model Problem
Let Ω c be a rectangular domain, having two sides much shorter than the others, see Figure 1. This can be seen as the section of a thin slab. The index c indicates that the geometry of the problem domain depends on the corrosion profile. Let us consider a process of heat diffusion into Ω c , governed by the well-known heat equation, and suppose to stimulate one face of the slab with an impulsive in time and uniform in space heat source: t ∈ [0, T ], 0 < t 0 < T and σ is small enough to have a very narrow pulse. The boundary conditions on Γ a , corresponding to the other faces of the slab (i.e. other edges of the problem domain), are simply adiabatic (= Neumann homogeneous), i.e. there is no heat exchange with the outside environment through Γ a . We assume that the corrosion does not modify the boundary conditions, but only the geometry of the domain. The initial conditions are simply set as a known uniform temperature. Moreover, let us assume to repeatedly measure the surface temperature at very short sampling intervals, until the internal diffusion of the heat produces again a uniform temperature distribution inside the slab. The physical phenomenon that makes it visible the eventual corrosion at the hidden face of the slab is, in general: in presence of corrosion, the heat supplied at the surface accessible from the source has less material to diffuse within and the superficial temperature remains locally higher for a nontrivial time-interval. This is a common experiment in infrared thermography for the non-destructive test of materials. The purpose is to recognize, from inspection of the thermographic data taken at the front (accessible) face, whether the rear (unaccessible) face is corrupted by corrosion and, in case, to estimate the corrosion profile. We make the simplifying assumption that the phenomenon is constant along z, the vertical axis. Therefore, we can study the problem in a two-dimensional horizontal section of the slab. Here, the two faces (rear-and front-) collapse to the corresponding edges of the section and, consequently, of the problem domain.
To this aim, in our model we define a parametric rear-edge, described by a piecewise-constant function, defined in a generally non uniform subdivision of the edge. The sizes of the segments defined by the subdivision are contained in the vector h c . To the i-th interval, of size h c (i), it is associated a parameter, whose value θ(i) indicates the mean depth of the corrosion in the segment. Therefore, a zero valued parameter vector indicates the sound (uncorroded) material. The corrosion profile is thus approximated with a piecewise-constant function.
Let us suppose to adopt an explicative mathematical model for the thermographic data, and in particular an heat transfer Finite Element model. Given n y measurement points and N data samples for each point, for each value of the parameter vector θ ∈ R n θ the numerical solution of the finite element model produces simulation dataŶ ∈ R ny×N that can be compared with the experimental data Y ∈ R ny×N , i.e.Ŷ = G(θ). This is our forward problem, which we solve as a main tool for the main problem of this paper, which is an inverse problem: from a given set of experimental data , find the value of the parameter vector θ such that the simulation data are as close as possible to the corresponding experimental ones. Different definition of distance can be used; we will adopt a cost function that uses the classical L 2 -norm. Usually, n y ≈ n θ and N > n y . Note that a positive value of θ means an excavation (corrosion) of the domain and, therefore, the domain varies with θ, i.e. Ω = Ω θ .
The map G : R n θ → R ny×N is, in general, nonlinear. Note that the simulation datâ Y ∈ R ny×N satisfy the heat transfer finite element model, with pre-assigned initial and boundary conditions. Starting from the knowledge that is a-priori available, i.e. that the system is still uncorroded, and looking at the experimental data, the algorithm that solves the inverse problem must produce a good estimateθ of the parameter vector, i.e. an estimate of the corrosion profile. Here we refer mainly to problems in which the corrosion may be arbitrarily distributed on the rear edge. No simplifying assumptions are taken about the corrosion pattern. It is particularly important to estimate the depth of narrow creaks.
We do a couple of main assumptions: (i) if we are able to accurately describe the (geometrical) profile of the corrosion, we can describe the thermal response of the corroded system at the same level of accuracy that we do with the uncorroded one. In this way we can distinguish whether we have reached a suboptimal estimate of the parameter vector θ; (ii) when the iterative estimation algorithm changes the i-th componentθ k (i) to a valueθ k+1 (i) closer to the true one, the cost function diminishes monotonically, at least locally. These assumptions are quite reasonable, in general; they cannot be demonstrated easily for a general application experimental setting, but it is quite easy to do experiments that satisfy them. Without entering in these details, which are out of the scope of this paper, we simply assume that they are valid in this discussion.

Basic algorithm
The corrosion profile is, in general, unknown. We suppose to approximate it with a piecewiseconstant function. The behaviour of its derivative determines the number of segments needed to approximate it at a prescribed level of accuracy and, in general, the unknown geometry of the profile influences the optimal number of parameters in our model, i.e. the dimension of the vector θ, and the sizes h c of the corresponding segments. Therefore, the quality of the estimated profile depends strongly on the choice of the parameterization (i.e. on the subdivision of the profile). The search for the optimal parameterization, which is a-priori unknown, must be done through an adaptive procedure, which tries by successive iterations to describe the corrosion profile efficiently, i.e. with a minimum number of parameters. A straightforward implementation of this concept is an algorithm made of two nested loops: an outer loop which improves adaptively the parameterization, and an inner loop which estimates the parameter values of each parameterization considered. They will be described in the following subsections.

Inner loop
Given a parameterization of the corrosion profile, the model problem of section 2 can be formulated as an (unconstrained) nonlinear optimization problem: let it be E θ ∈ R ny×N the matrix of prediction errors, whose n-th column n,θ ∈ R ny is the prediction error at the discrete time n and dependent on the parameter vector θ: where y n ∈ R ny is the n-th column of Y andŷ n,θ ∈ R ny is the n-th column ofŶ θ . Be V N,θ ∈ R ny a vector cost function whose generic component V N,θ (i) = 1 N N n=1 n,θ (i) 2 1/2 corresponds to the i-th measurement point. The parameter estimates are produced by solving a nonlinear least-squares problem: which is solved using the well-known damped Gauss-Newton method [13]. The matrix ψ θ ∈ R ny×N ×n θ , i.e. the sensitivity matrix of the simulation dataŶ θ ∈ ny×N with respect to parameter perturbations: has a central role in the method. Let ψ r θ ∈ R (nyN )×n θ be obtained through a reshape of the matrix ψ θ and, analogously, let the vector r θ ∈ R (nyN )×1 be a reshape of the matrix E θ (the index r indicates the reshape operation). Indeed, the Gauss-Newton update δθ comes from the least-squares solution of the overdetermined system solved using the normal equations. 3.1.1. ill-conditioning The perturbation of different parameters may produce quite similar responses in the simulation data, i.e. couples of columns in the matrix ψ r θ which are close to linear dependence. In our problem, this is related to the length of the corrosion profile segment corresponding to each parameter. The presence of short segments produces, in general, an illconditioned matrix ψ r θ . Therefore, the search for a better accuracy in the determination of the corrosion profile, which means to reduce the size of a few parameters, brings to higher numerical problems.
Let us study the behaviour of singular values of ψ r θ for diminishing values of the parameters length h c (see section 2). We want to see whether the parameter update problem in the Gauss-Newton direction is rank-deficient (i.e. there is a well-determined subset of nearly-zero singular values and an evident gap with non zeros) or ill-posed (i.e. the singular values decrease regularly, without an evident gap) [7]. The Figure 2 shows that in our model problem there is no evident gap between large and small singular values. This behaviour remains unchanged for decreasing values of h c . In section 4 we will discuss how to regularize the problem before computing the solution.

Outer-loop
Since the optimal parameterization is unknown, it is determined adaptively, starting from a coarse initial guess, i.e. a subdivision of the corrosion profile with quite large h c (i) values. This means that, according to suitable indicators, to be specified later, the algorithm decide where eventually to refine locally the subdivision of the corrosion profile. The refinement operation corresponds to a bisection of the indicated segments, with a consequent increase in the number of segments and, therefore, of parameters in the model. This is iteratively made until the comparison, between the actual value F N,θ of the cost function and the reference value previously obtained for the sound (uncorroded) system, shows that the model describes the experimental data in an optimal way.
A local refinement is more efficient than a uniform one. In a problem where the corrosion profile have strong gradients it can produce much less parameters to be estimated. But, a crucial aspect is where to refine. The distributed nature of the corrosion parameters and of the finite element model variables makes it possible to localize the discrepancies between experimental and simulation data. Note that the accuracy of this localization is disturbed from the strong diffusive character of the heat conduction process.
In the corrosion estimation problem we propose to use the parameter estimates, obtained at each execution of the inner-loop, as indicators for the local refinement. We have verified that their values are not always reliable estimates of the corrosion depth, since in general these values are good only when the parameterization is also good, but they are reliable indicators of the regions where the corrosion exists. In more detail, the segments where the actual estimates indicates a nontrivial corrosion are refined (bisected). This gives the possibility, at the next inner-loop execution, of estimating the corrosion with more detail, where it is needed.
For completeness, it should be mentioned that when dealing with real data, other than evaluating the cost function from the prediction error, we must also test the prediction error sequence from a statistical point of view [11], but this is not relevant in the discussion here.

Regularization
We have seen at section 3.1 that an accurate estimation of the corrosion profile may often produce parameterizations that makes ill-conditioned the corresponding parameter estimation problem. In particular, the more accurate is the actual parameterization in describing the corrosion profile, the more difficult is to obtain a valid numerical value for the parameter estimates. A regularization of the problem is needed.
The mostly used regularization methods, i.e. the method of Tikhonov and the Truncated Singular Value Decomposition (TSVD) [5] [15], are sound general methods, but they do not take into account the distributed nature of the parameters, as it is relevant in our model problem. The TSVD computes a better conditioned matrix which has minimum L 2 distance from the original matrix ψ r θ , but the truncation most often discards just the components due to the smallest parameters. In the Tikhonov approach, the addition of a regularizing term means the addition of some constraints to the parameters and requires preferably some knowledge about their true values. But, in our problem, they should trivially be imposed to zero. The Tikhonov method does not truncate and, instead, raises the small singular values, but not their relative importance in the estimation problem. Therefore, the components due to the smallest parameters remains the less visible and the poorest conditioned. In practice, both methods have a tendency to sacrifice the small parameters for a better conditioned estimation problem. This means that the regularized problem may loose accuracy. In our problem, the smallest components in L 2 -norm are often related to the smallest segments and they may be the most significant, if the purpose is to describe some details of a non smooth corrosion profile.
To overcome these limitations, we adopted a regularization strategy that takes into account the physical meaning of the parameters in our model problem. It could be quite general, at least for a class of distributed parameter problems. We discuss it in the following subsections.

Balancing the columns of ψ r θ
In our problem, the L 2 -norm of the columns of ψ r θ is almost proportional to the size of the corresponding segment. Therefore, reducing the size of a small segment corresponds to an increase of the condition number of ψ r θ . In unconstrained optimization, a problem is said to be poorly scaled if changes to θ in one direction produce much larger variations in the value of F than do changes to θ in another direction [13]. Now, we can say that the problem of estimating corrosion parameters corresponding to segments of variable size is a poorly scaled problem. In this case, diagonal scaling [13] improves the sensitivity of the problem. It can be seen as a diagonal preconditioning. In the model problem here discussed, each column of ψ r θ has a corresponding parameter in the model and a corresponding segment in the corrosion profile. Therefore, the scaling factors can be set simply equal to the relative size of the segments (with respect to the largest one). This is a convenient simplification for the computational cost of the algorithm. This balancing operation gives a more accurate estimate of the parameters corresponding to small segments and produces a better conditioned ψ r θ (cfr. section 7.2).

Selective update of the parameters
In general, excluding some parameters from the update process is not necessarily optimal. However, excluding a few parameters according with the assumption (ii) of section 2 makes the estimation problem better conditioned (see section 7.3). Precisely, at each each iteration k, the parameters whose single update from the valueθ k does not bring to a reduction of the cost function are not considered for the computation of the updateθ k+1 . For the implementation details, see section 6. In case the excluded parameters corresponds to the largest segments of the corrosion profile, situation that can often happen in the final iterations of the estimation process, we can obtain a substantial improvement in the conditioning of ψ r θ .

Convergence Issues
With the assumptions (i) and (ii) of section 2, there are two main reasons for not reaching the minimum value of the cost function F N,θ : the cost function is not the optimal one (it depends on the parameterization) or the algorithm has reached a local minimum.

Cost function misfit
The cost function depends on the parameterization. If the latter is not optimal, even the cost function differs from the right one. In general, with a parameterization (cost function) not optimal, we cannot reach the reference minimum level (see sec. 3.2). A way to recognize a cost-function misfit is when the perturbation of a parameter satisfies the assumption (ii) of section 2 only in a small region of the measurement boundary. This means that the segment corresponding to that parameter covers a bigger interval than the corrosion channel.

Local minima
In the model problem here considered, a local minimum arise mainly when the measurement points are not sufficiently sensitive to the perturbation of a small parameter. In this case, the parameter is not updated (the TSVD would even truncate this component). The regularization techniques proposed in section 4 avoid this problem effectively.

A predictor-corrector Newton method
Taking into account what we have seen in the previous sections, we propose here an improved solution method for the model problem of section 2. In particular, we want to improve the efficiency of the standard algorithm presented in section 3. The two nested loops (sections 3.1 and 3.2) are the main targets: their execution is computationally too expensive. Anyway, both have a specific task: the outer loop adapts the parameterization, while the inner loop estimates the model parameter values for the current parameterization. We propose to reorganize the inner loop in a predictor-corrector format. The motivation is mainly due to the fact that the corrosion estimation is a highly nonlinear task. Indeed, the algorithm must search for a good parameterization and good parameter values at the same time. We observed that performing a linear adaptation step (that we call the predictor step) can give a better starting point to the nonlinear estimation step (the corrector step).
The predictor step is linear and his task is to adaptively refine the parameterization. According to the assumption (ii) of section 2, perturbing each parameter of a predefined quantity (which depends essentially from the resolution of the measurement devices and other technicalities) we can easily decide if there is corrosion in the corresponding segment and if the size of the segment is adequate to describe it or it is necessary a local refinement. Precisely, chosen an α r < 1, we can have one of three possible situations: A. the perturbation of the parameter gives a prediction error reduced by a factor α < α r : the parameter will then be considered in the corrector step; B. the prediction error is reduced,but only by a factor α > α r : the corresponding segment is refined (bisected) in two smaller segments, the corresponding parameters are perturbed and only the one which gives the smallest reduction of the prediction error is included in the corrector step; C. there is no reduction of the prediction error (α > 1): the parameter is not considered in the corrector step.
Only n θ matrix-vector products are needed in this phase. The choice of the reduction factor threshold 0 < α r < 1 which discriminates between situation A and B is not a big problem (in the experiments we set it to 0.9). Anyway, if α r it is chosen too big it will favour situation A and the algorithm will refine the parameterization less than necessary. With an α r too small the algorithm will over-refine the parameterization. The optimal choice depends obviously on the specific application, but its tuning is not a problem. Instead, a general auto-tuning strategy is not easy to formulate. The corrector step is the entire inner-loop of section 3.1.
Note that the predictor phase does not produce an initial guess for the parameter values, which would be not significant. Instead, it does a selection and/or a refinement of the parameters that will be estimated in the corrector step, which is nonlinear (Gauss-Newton). The implementation we have tested, builds the matrix ψ r θ while it refines the parameterization. In practice, the predictor step does much of the job of the outer-loop, which becomes much less important: the number of outer iterations is, in this way, drastically reduced.

Numerical Experiments
In this section we present a few numerical experiments that explain in practice what has been asserted in the previous sections. All the following experiments are conducted in a problem domain like that of Figure 1. The Figures show the relevant domain discretizations: the measurement points are coincident with the mesh nodes at the lower edge (y = 0), the input flux is the function f (t) of section 2. The sampling time used to collect data is sufficiently short to describe accurately the edge cooling phenomenon, after the source has given its impulsive heat. In this paper the experiments are purely deterministic. The description and analysis of the stochastic aspects of the model, algorithm and data is out of scope and will be detailed in a separate work. Anyway, the algorithm here presented has been tested also on real data (controlled laboratory experiments) and has given results comparable with that here presented.

Tikhonov and TSVD regularization
Here we see that the method of Tikhonov and the TSVD produce a better conditioned matrix problem, but they cut the update for the smallest parameters (see sec. 4). Let us see a small example (the real ill-conditioning arise in bigger problems, but here the phenomenon can be shown much more easily). Let us consider the problem in Figure 3: we want to estimate a small corrosion defect (left) and we use a mesh where the parameterization of the corrosion profile is optimal (right). Note that the profile is described by 7 segments (parameters  Table 1 it is shown the behaviour of Tikhonov, TSVD and column scaling (see next section). The second row contains the regularization parameter value adopted. In rows 3 to 9, corresponding to each parameter of the model when we read the corrosion profile   Table 1: results for example 1.
Note that Tikhonov and TSVD actually improves the condition number of an order of magnitude but totally destroy the estimation of the corrosion parameter, which was exactly a small one. The two methods behaves equivalently, as already known.

Regularization from balancing the columns of ψ r θ
The example is the same of the previous section. Now we consider the column marked with "'scaling"' in Table 1. We can see that in case of parameters of variable size, the column scaling of ψ r θ improves the condition number while maintaining the accuracy of the estimate.

Selective update of the parameters
To implement in a general way a selection criterion based on the assumption (ii) of section 2, we assume that the resolution of the corrosion estimates is given. It is the minimum perturbation value that can reasonably be sensed at the measurement points. Example 2: the results are shown in Figure 4. From top-left: the true corrosion pattern, the initial parameterization (top  Note from the figure that, without selection, there are more updated parameters than necessary. This can produce a relevant computational overhead if it is done during the beginning of the adaptation process, where the updated parameters are then also refined.

Predictor-corrector Newton method
Example 3: the results of the first iteration of the algorithm are shown in Figure 5. From top-left: the true corrosion pattern, the initial parameterization (top right), the corrosion estimate at the beginning of the corrector step (bottom left), the corrosion estimate at the end of the corrector step (bottom right). Note that the predictor step has produced an effective local refinement of the parameterization.
Note also the interaction with the finite element numerical solution: the refinement to the left is due to the need of adapting the model to the experimental data, i.e. to adapt the mesh, not to indicate a corrosion. The example shows in practice the fact that the adaptation algorithm of the predictor step is guided by a modeling error that can have multiple origins.

Conclusions
We have proposed a novel algorithm to solve the corrosion estimation problem. Experiments with real data have confirmed the effectiveness of the method. Considerable computational savings have been achieved compared to a standard algorithm formulation.