Abstract
Electrochemical impedance spectroscopy (EIS) is the established tool for the study of many electrochemical experiments. While the analysis of EIS data is challenging, this can be assisted by the distribution of relaxation time (DRT) method. However, obtaining the DRT is difficult as the underlying problem is ill-posed. Inspired by recent advances in image analysis, we develop a completely new approach, named the deep prior distribution of relaxation time (DP-DRT), for the deconvolution of the EIS to obtain the DRT. The DP-DRT uses a deep neural network fed with a single random input to deconvolve the DRT and fit the EIS data. The DP-DRT has the peculiarity of having a number of parameters much larger than the number of observations. Further, unlike most supervised deep learning models, large datasets are not needed as the DP-DRT is trained against a single available EIS spectrum. The DP-DRT was successfully tested against both synthetic and real experiments displaying considerable promise and opportunities for extensions.
Export citation and abstract BibTeX RIS
Electrochemical impedance spectroscopy (EIS) is one of the experimental techniques most frequently used in electrochemistry.1–4 This technique has several well-known strengths. First, it is relatively easy to implement. Second, it gives high precision measurements. And third, it provides data across a wide range of frequencies (from mHz to MHz).5 For these reasons, this technique has been used in many diverse applications including batteries,6–10 supercapacitors,11 solar cells,12 membranes,13 electrolyzers,14 fuel cells,15,16 medicine,17 and biology.18
In a typical EIS experiment, one takes an electrochemical system at steady-state and perturbs it with a small sinusoidal voltage (or current) with a given frequency. By measuring the current (or voltage) and repeating the same procedure for a given frequency range, the EIS spectrum can be obtained.1 In short, the EIS technique measures a voltage-to-current transfer function.5 In spite of the considerable power of this method, it is difficult to interpret EIS data because a model is needed.19 A common approach is to fit the EIS spectra against networks of elementary circuits. However, one should note that often the circuit networks are just analogs, which may lack uniqueness and physical meaning.2 Physical models of EIS data would be ideal, but they are problem-specific and can be computationally complex.20–24 Furthermore, even if a physical model is available, there is no guarantee that it can capture the entire physics of the electrochemical systems at hand. One alternative to these conventional methodologies is to use the distribution of relaxation times (DRT),25–32 which interprets the impedance as resulting from a distribution of relaxation timescales, i.e.
where is the impedance, is the frequency, is the DRT, is a timescale variable, is a resistance, and is an inductance. The DRT model has proven to be very powerful, and recently this method has been employed to understand the fundamentals of solid-state ionic systems,33,34 batteries,35–38 supercapacitors,39,40 porous electrochemical reactors,41 dielectrics,42 solar cells,43 and fuel cells.44–47 These applications have highlighted the promise of DRT models. However, there are still issues. The primary challenge is the estimation of the function because the deconvolution problem is ill-posed and depends very strongly on the experimental errors. To overcome this issue, Fourier,48,49 evolutionary,39,50,51 Monte Carlo,52 maximum entropy,53 probability-,54 and regression-based55–61 inversion methods have been developed. Among these approaches, regularized regression (RR) is perhaps the most popular and efficient. In general terms, RR consists of minimizing, with respect to a vector of DRT values a loss function defined as
where is the experimental impedance measured at the frequencies with is an approximation of (1), and is some penalty function multiplied by a parameter While RR is relatively well established and can be linked to, and extended by, Bayesian statistics,62,63 it has the drawback of depending on the parameter which biases the estimation of 56 In light of this, more extensions of this method are needed. In this work, we do that by assuming to be the output of a deep neural network (DNN). We should point the reader that from (1) to (2) the notation of changed slightly. In (1), we assumed that the impedance depended on the function and therefore we wrote Instead, in (2) we wrote, consistent with our earlier works,56,60,62,63 that the impedance of the DRT model depends on the vector whose entries correspond to the evaluated at certain collocation timescales with We will use the notation employed in (2) for the remainder of this article.
A seminal work by Ulyanov and co-workers on the deep image prior (DIP) has shown that a DNN with a random input can be trained against a single data point to perform image denoising, inpainting, and super-resolution.64 The DIP results are particularly striking for two reasons. First, they suggest that a DNN architecture without the pretraining on a large dataset is sufficient for image enhancement. Second, the DNN used by the DIP is heavily over parametrized, and, surprisingly, this property does not prevent improving images.65 In short, the DIP methodology suggests that the image characteristics (i.e. an image prior) can be directly encoded in the DNN architecture and a training dataset may not be needed for specific problems.66
Inspired by the flurry of results following this contribution and, in particular, its application to inverse problems, we adapted the DIP philosophy to develop the deep-prior distribution of relaxation times (DP-DRT).66–72 In short, we did not assume that the number of frequencies probed experimentally, has the same order of magnitude of the number the number of collocation points used to approximate Instead, we took to be the output of a DNN that depends on a rather large number of parameters. This is shown schematically in Fig. 1, where a DNN depends on (i) a set of weights and biases, which are written as a parameter vector with and (ii) on the chosen activation functions schematically displayed as colored circles. The key idea of the newly developed DP-DRT (DPλ-DRT) is to minimize the loss function (2) with 0 ( where is the lower bound of ) with respect to the large parameter vector rather than Using a simple and relatively shallow DNN, we found that the DP-DRT can perform inversion surprisingly well even without regularization. The DP-DRT method can capture overlapping features and discontinuities in the DRT, as well as significant noise in the experimental data. Furthermore, the DP-DRT can deconvolve experimental impedances with outcomes comparable to those of Bayesian methods. These results are particularly remarkable as we did not optimize the DNN architecture in this work.
In the remaining sections, we will first outline the DP-DRT method. Following that, we will show the results obtained with stochastic experiments whose purpose is to assess the consistency and robustness of the approach. Then, the deconvolution results from the DP-DRT of actual real experiments will be discussed and compared to some reference results. Finally, an outlook for future research in this exciting field will be provided.
Theory
The deep distribution of relaxation times
For the DRT deconvolution, we aim at solving an inverse problem. That is, given an experimental data vector, we want to determine a latent vector such that
where and are suitable matrices described elsewhere,56 is a vector-valued function dependent on the two scalar parameters and in (1) (i.e. with and ), and denotes the measurement noise. As already outlined and shown elsewhere,54,56,60,62,63 this linear model is an approximation of (1). The key contribution of this article is to take to be the output of a DNN. is a vector-valued function of a random input which depends on a set of parameters with
If and are also outputs of the DNN, i.e., and We can use (3) to write the loss function (2) as
where is the crm.
Implementation
For all simulations, we set the () and chose a relatively simple DNN, see Fig. 1, consisting of 4 layers with (i) a random input (ii) an output layer of dimension or depending on the total number of parameters outputted (i.e., for and the remaining for and ); and (iii) 2 hidden layers of the width The activation functions were chosen to be non-saturating exponential linear (ELU) units73 for the first three layers and a softmax () for the last layer. The weights and biases were initialized using the Xavier uniform method74 and to zero, respectively. Furthermore, the parameters of the network were optimized using the Adam algorithm75 with a learning rate of 10−5 and a maximum of 100,000 iterations. Also, early stopping (i.e. the iterations stop when the absolute value of the variation of the loss is less than 10−8) was used.76 The input was chosen randomly from a normal distribution with zero mean and unitary standard deviation, i.e. The code was implemented with PyTorch77 and all simulations were run on a GeForce RTX 2060 GPU.
Stochastic experiments
The stochastic experiments were generated by corrupting the "exact" impedances with random Gaussian noise, see (3), with
where and () are independent normal random variables of zero mean and variance i.e. The chosen frequencies ranged from to Hz with 10 points per decade corresponding to 81. As already mentioned above, the DRT was evaluated at implying that Correspondingly, 20170, 20252, or 20334 if the DNN outputs either or or respectively. The models used for the the noiseless part of (3), are reported in Table I with the corresponding parameters listed in Table II.
Table I. "Exact" impedances and DRTs used in the stochastic experiments.
Model | Notes | Reference | ||
---|---|---|---|---|
ZARC | [4] | |||
2-ZARCs | [4] | |||
Havriliak-Negami | [78] | |||
Piece-wise Constant | is the Heaviside function | [62] | ||
Fractal | [56] |
Table II. Values of the parameters used in the stochastic experiments.
Parameter | Numerical Value | ||||
---|---|---|---|---|---|
ZARC | 2 ZARCs | Havriliak-Negami | Piecewise Constant | Fractional | |
10 Ω | 10 Ω | 10 Ω | 10 Ω | 10 Ω | |
50 Ω | 50 Ω | 50 Ω | 50 Ω | 50 Ω | |
1 s | 0.1 s | 1 s | 10 s | 1 s | |
0.8 | 0.8 | 0.8 | 0.6 | ||
0.9 | |||||
1 s or 10 s | 0.1 s | ||||
Results
Stochastic experiments
We conducted stochastic experiments to validate the methodology against cases where impedance, DRT, as well as the noise level, are known. First, we will illustrate the DP-DRT framework. Then, we will show that the method can deconvolve spectra with overlapping timescales. After that, we will discuss the inclusion of a regularizing parameter as the output of the network and analyze the influence of noise level Lastly, we will demonstrate that the DP-DRT can deconvolve elements with discontinuous timescale distributions.
An introductory example
Our investigation started with an illustrative example. We drew the EIS of a single ZARC element with as shown in Fig. 2a. Again, the reader can find the analytical formulas and the parameters used in Table I and Table II, respectively. Then, we minimized the loss see (4). The loss, which is plotted as a function of the iteration number (iter) in Fig. 2c, decreases with increasing iteration number and so does the error defined as
and shown in Fig. 2d. Two vertical dashed lines are plotted in Fig. 2d and correspond to the early stopping and minimum error or optimal iteration. We also compared the 's obtained at those two iterations, see Fig. 2b. Both early-stopping and optimal values are capable of closely matching the EIS and the exact DRT, where only small ridges are present at the base of the i.e., for 10−2 10−1 and 101 102.
Download figure:
Standard image High-resolution imageOverlapping timescales
We then tested if the method can recover the DRT and EIS of two partially overlapping ZARC elements. The Nyquist plots of the two EIS spectra can be found in Figs. 3a and 3c with the parameters from Table II. The DP-DRT recovers closely the exact EIS. The can be obtained with a similarly limited discrepancy, as shown in Figs. 3b and 3d.
Download figure:
Standard image High-resolution imageDPλ-DRT: ridge regression with the DP-DRT
As proposed by Ulyanov and co-workers,64 adding a regularizing term to the loss can enhance images obtained by the DIP. In that regard, Dittmer and co-workers68 suggested to output from the network itself, where the optimal value is obtained by applying L-curve-like criterion. We attempted to implement a variation of what was proposed in these two articles and added to the loss an approximation of 's 2nd derivative.19,56,62,63 Furthermore, we set 10−6. We note that early stopping was still used. As shown in Fig. 4, this procedure leads only to a slight visual improvement in the recovered and because the regularizing parameter monotonically decreased to 10−6 with the number of iterations. A similar improvement cannot be seen if the lower positive bound on is not present (i.e. 0) as with
Download figure:
Standard image High-resolution imageIncreasing the noise
One may wonder what happens to the DP-DRT method if the experimental noise intensifies. We have tested this by increasing by one order of magnitude to This choice leads to heavily corrupted EIS spectra, as shown in Fig. 5a. The DP-DRT method can still recover the function well but a few additional ridges are triggered by the extra noise. It is important to note that, as shown in Fig. 5b, early stopping corresponds to an iteration where the error is near its minimum. As the number of iterations increases, overfitting of is expected to occur, leading to an increased error on the latent If we perform the same procedure with smoothing by using the DPλ-DRT with 0.1, the recovered DRT does not show any ridges, see Fig. 5d. However, both the loss and the error increase as shown in Fig. 5f. We must stress that a large i.e., 0.1 was chosen in order to emphasize the impact of the regularizing term.
Download figure:
Standard image High-resolution imageRepeating the same inversion procedure numerous times can help assess the robustness of the approach, which was conducted by performing 1,000 stochastic experiments under the same hypotheses as above. These experiments were followed by DP-DRT inversion with early stopping. In Fig. 6a, we plot the mean DP-DRT and the 5 and 95% confidence bands. It can be observed that the DRT shape is well captured, albeit with some scatter, especially near the peak, indicating strong sensitivity to noise at that location. Further, Fig. 6b plots the probability distribution function (PDF) of the relative error defined as Consistent with the data shown in Fig. 6a, Fig. 6c indicates that the relative error has a broad distribution. For comparison, Fig. 6b shows the outcome of the DPλ-DRT deconvolution of the same stochastic experiments with the DRT appearing to be smoother. In contrast with the outcome of the DP-DRT (without ), the recovered is insensitive to the noise, showing a narrow distribution for the relative error, see Fig. 6d. This is consistent with intuition: because of the large additional penalty of , the bias is large, but the variance is small.
Download figure:
Standard image High-resolution imageDeconvolving non-conventional distributions of relaxation times
We also tested whether the DP-DRT method can be used to fit non-conventional elements, whose DRT displays discontinuities and infinite values. For this reason, the EIS was computed for three circuits corresponding to the Havriliak-Negami (HN),78 piecewise constant (PWC),62 and fractal56 models. Then, the 'exact' impedance was corrupted with noise according to (4) with see Fig. 7. As shown there, the DP-DRT is able to recover both and well. This is evident for the HN and PWC elements, see Figs. 7a–7d. For the fractal element, whose impedance and DRT are shown in Figs. 7e and 7f, respectively, oscillations are visible for 1 s, though the timescale corresponding to the discontinuity appears to be captured well. We carried out identical stochastic experiments for a higher noise level by increasing to As reported in Fig. 8, increasing the random experimental error does not affect the recovery of the EIS significantly, but more oscillations appear in the deconvolved These simulation results are consistent with the analysis outlined above.
Download figure:
Standard image High-resolution imageDownload figure:
Standard image High-resolution imageWe also studied the performance of the DP-DRT and DPλ-DRT models for sharp DRTs by choosing similar synthetic experiments as those reported in An introductory example where the key differences are the number of collocation point 161 and either 0.9 or 0.99. For 0.9, DP-DRT and DPλ-DRT models can match the exact DRT well, Fig. S3. If instead 0.99, the timescale resolution is not sufficient to capture the peak value ( ∼500 ) as shown in Figs. S3d and S4d. Unsurprisingly, obtained by DPλ-DRT deconvolution displays a broader peak width than that from the DP-DRT, see Fig. S5. This difference is due to the penalty used and can be overcome using lasso regularization.56
Real experiments
After testing the consistency of the DP-DRT methodology, we also tested its performance on real experimental data. First, the EIS measurement performed on a symmetrical SOFC cell was analyzed, then the DRT from the EIS of a full Li-ion battery was deconvolved. Depending on whether the regularization term is added to the network, the total number of parameters is 24298 or 24388, and 20170 or 20252 for the SOFC and LIB EIS, respectively.
SOFC cathode
We first analyzed an EIS spectrum obtained by testing a symmetrical solid oxide fuel cell (SOFC). For comparison, the EIS is repeated in the Nyquist plots shown in Figs. 9a–9c. 15% Samarium-doped ceria was used as the electrolyte and sandwiched between two electrodes consisting of a mixture of Ag and Ba0.9La0.1FeO3−δ.79 The data was collected at 650 °C in a mixture of N2 and O2 ( 0.21 atm) in the frequency range from 0.1 Hz to 8.56 × 104 Hz with 15 points per decade.
Download figure:
Standard image High-resolution imageWe first modeled the experimental data with an equivalent circuit model (ECM) consisting of a ZARC element plus an inductance. The parameters estimated by regression are listed in Table III. The fitted EIS and obtained DRT are shown in Figs. S1a and S1b (available online at stacks.iop.org/JES/167/026506/mmedia), respectively. The EIS obtained by DP-DRT without regularization is shown in Fig. 9a. The corresponding is plotted in Fig. 9d, where, for reference, the DRT of the ECM54,60 is also shown. The DP-DRT method can recover well both the impedance and the DRT even without regularization. This is shown in Fig. 9g, where the loss (4) and the discrepancy are defined as
are plotted as a function of the iteration number. We further report the DPλ-DRT results obtained by setting 10−3, see Figs. 9b, 9e, and h, and 10−2, see Figs. 9c, 9f, and 9i. Consistent with intuition, the small ridges present in the DP-DRT deconvolution could be smoothed out by including a regularizer. Unsurprisingly, the larger the lower bound on λ is, the more prominent the loss. We should note again that no exact DRT is available, and the discrepancy between DP-DRT and ECM-based distribution serves only as a reference. To compare the performance of different models, we also calculated the mean squared error (MSE) defined as
with the results shown in Table SI. The DP-DRT method performed best with the lowest MSE value. In contrast, the ECM had the largest MSE among all four models.
Table III. Parameters of the ECM (a single ZARC element plus an inductance) used to fit the SOFC experiment and corresponding numerical values obtained by regression. The error of each parameter outputted by ZView is also shown.
Parameter | Regressed value | Error |
---|---|---|
1.81 Ω | 4.32 × 10-4 Ω | |
0.26 Ω | 5.56 × 10-4 Ω | |
2.19 × 10-4 s | 1.31 × 10-5 s | |
0.69 | 2.42 × 10-3 | |
5.36 × 10-7 H | 1.37 × 10-9 H |
LIB experiment
We also tested the DP-DRT model using lithium-ion battery (LIB) data taken from our earlier works.54,56,63 An ECM consisting of a series of 3 ZARCs and an inductance was used to model the experimental EIS.54 The parameters of the ECM are listed in Table IV, and the corresponding EIS spectra and DRT are shown in Figs. S2a and S2b, respectively. It is important to note that, as shown in Fig. S2a, the real and imaginary parts of the spectra are in the 0.11 to 0.16 Ω and 0 to 0.016 Ω range, respectively. Since the simulations are carried out in a single-precision floating-point format, the data was scaled to unity to avoid underflow or loss of accuracy. The results were then scaled back to the original values. Similar to the SOFC experiment, the DP-DRT without regularization can fit well to the impedance data, see Fig. 10a. Regarding the DRTs for low enough 's, the DP-DRT does not have obvious discrepancies with respect to the DRT reference obtained from the ECM, as the two leftmost peaks of the ECM-DRT can be recovered well, see Fig. 10d. For the rightmost peak, which corresponds to the lowest frequencies probed, and whose corresponding arc is incomplete (see Fig. 10a) the DP-DRT recovery is inconsistent with that obtained with the ECM-based DRT. However, we believe that this is reasonable, especially considering that the uncertainty on any estimate obtained from that part of the EIS spectrum is expected to be high. If the MSE is used as a metric for evaluating the quality of the model, we note that DP-DRT performs better than the ECM, see Table SI.
Table IV. Parameters of the ECM (3 ZARC elements) used to fit the LIB experiment and corresponding numerical values as obtained by regression. The error of each parameter outputted by ZView is also shown.
Parameter | Regressed value | Error |
---|---|---|
0.11 Ω | 4.44 × 10-4 Ω | |
1.69 × 10-2 Ω | 8.48 × 10-4 Ω | |
2.12 × 10-2 Ω | 4.42 × 10-4 Ω | |
5.23 × 10-2 Ω | 1.89 × 10-3 Ω | |
2.34 × 10-3 s | 1.23 × 10-3 s | |
0.20 s | 1.08 × 10-2 s | |
75.30 s | 2.33 s | |
0.54 | 2.31 × 10-2 | |
0.94 | 7.78 × 10-3 | |
0.79 | 1.03 × 10-2 | |
7.61 × 10-7 H | 3.64 × 10-8 H |
Download figure:
Standard image High-resolution imageAs conducted for the SOFC deconvolution of subsection 3.2.1, we computed the DPλ-DRT by setting 10−3 (Figs. 10b, 10e, and 10h) and 10−2 (Figs. 10c, 10f, and 10i). Consistent with our earlier insight, the predicted DRT curves are smoother than without regularization. Further, the loss increases if regularization is included affecting the recovered impedance. We point the reader to Fig. 10c where at around 11 Hz corresponding to the DPλ-DRT with 10−2; deviations in both EIS and DRT can be observed. For the largest the loss and MSE are also the largest among the cases studied, see Fig. 10i and Table S1. It should again be stressed that the DRT obtained from the ECM is only a reference and the "exact" DRT is unknown.
Future Work
We have shown that the DP-DRT model, whose underlying DNN is a function of the network input and is parameterized with respect to with can recover the EIS and DRT well. Despite the surprising result, several questions remain. For example, can we optimize the DNN architecture? One potential direction for that would be to include filtering, in the form of a 1D convolutional neural network or a U-net80 as originally used by Ulyanov and co-workers.64 Another interesting direction would be the study of under-parametrized networks with as done by Heckel and Hand.72 In principle, one could obtain a reasonable DRT deconvolution from a network with a scalar random input and a single layer without bias (this corresponds to ), as shown in Fig. 11. For that, we tested a single ZARC model as implemented in Fig. 2(a) with 0.5 The inverse problem solution obtained using conventional quadratic programming (QP)56,60,62 without regularization is shown for reference in Fig. 11a. The results with a single-layer neural network without bias are shown in Figs. 11b, 11c, and 11d, where no activation function, a leaky ReLU activation, and a softplus activation were used, respectively. While the lack of activation function leads to severe oscillations, the inclusion of an activation function together with early stopping has a smoothing effect, allowing the capture of the main peak of the impedance. Starting from these preliminary results, a thorough investigation of the role of DNN architecture, activation function, early stopping cutoff, and single-precision arithmetic should follow the present work.
Download figure:
Standard image High-resolution imageConclusions
Here, we report the surprising results that a DNN with a number of parameters much larger than the experimental data can be used for the estimation of the DRT from a single EIS spectrum without pretraining. The DP-DRT method is shown to be able to recover the impedance and its underlying DRT not only for simple elements but also in somewhat pathological situations, for example, when the timescales overlap, noise is significant, and for elements whose DRTs are discontinuous. The DP-DRT approach works well also for real experimental data as it closely matches reference values obtained with other methods.
This article opens up a new way to perform DRT deconvolution as well as opportunities for future works, including improving the DNN architecture, fine-tuning the early stopping criterion, adding ad-hoc regularization, and elucidating the role of single-precision arithmetic on DRT inversion.
Acknowledgments
The authors gratefully acknowledge the Research Grants Council of Hong Kong for support through the projects (16207615, 16227016, and 16204517). The authors also acknowledge the support from the Guangzhou Science and Technology Program (No. 201807010074), and Hong Kong Innovation and Technology Fund (No. ITS/292/18FP).