Quantitative spatiotemporal mapping of thermal runaway propagation rates in lithium-ion cells using cross-correlated Gabor filtering †

Abuse testing of lithium-ion batteries is widely performed in order to develop new safety standards and strategies. However, testing methodologies are not standardised across the research community, especially with failure mechanisms being inherently diﬃcult to reproduce. High-speed X-ray radiography is proven to be a valuable tool to capture events occurring during cell failure, but the observations made remain largely qualitative. We have therefore developed a robust image processing toolbox that can quantify, for the first time, the rate of propagation of battery failure mechanisms revealed by high-speed X-ray radiography. Using Gabor filter, the toolbox selectively tracks the electrode structure at the onset of failure. This facilitated the estimation of the displacement of electrodes undergoing abuse via nail penetration, and also the tracking of objects, such as the nail, as it propagates through a cell. Further, by cross-correlating the Gabor signals, we have produced practical, illustrative spatiotemporal maps of the failure events. From these, we can quantify the propagation rates of electrode displacement prior to the onset of thermal runaway. The highest recorded acceleration ( E 514 mm s (cid:2) 2 ) was when a nail penetrated a cell radially (perpendicular to the electrodes) as opposed to axially (parallel to the electrodes). The initiation of thermal runaway was also resolved in combination with electrode displacement, which occurred at a lower acceleration ( E 108 mm s (cid:2) 2 ). Our assistive toolbox can also be used to study other types of failure mechanisms, extracting otherwise unattainable kinetic data. Ultimately, this tool can be used to not only validate existing theoretical mechanical models, but also standardise battery failure testing procedures.


Introduction
Lithium-ion batteries offer a convenient power source for a broad range of mobile technologies, 1 as well as the potential to reduce greenhouse gas emissions, particularly in transport applications, if their life cycle is managed sustainably. 2 They are also finding increasing use in residential and grid energy storage. 3 However, their growing uptake poses a safety issue, owing to the potential for highly energetic failure events to occur. These can be triggered in a number of ways, such as electrically (short-circuiting), 4 thermally (overheating), 5 or mechanically (impact or penetration), 6 and can ultimately lead to explosions, fires, and the release of toxic and flammable ejecta and gases. 3,7 Although catastrophic failure is uncommon, occurring in around 1 in 10 million units, 1 tens of billions of batteries enter the market each year, making the risk significant. 8 This is a particular concern for 'mission critical' applications, for example in communications, electric vehicles and aerospace, in which the integration of lithium-ion batteries is hampered by concerns with their safety and reliability. 9 Therefore, to enable their continued uptake, it is crucial that lithium-ion battery failure is better understood, such that safer batteries may be engineered, with improved solutions and mitigation strategies for failure.
X-ray radiography is a powerful tool for capturing the degradation of individual lithium-ion cells operando, under both standard operation and abuse testing conditions. 4,5,[10][11][12] Real-time and high-speed (i.e., slow-motion) imaging offer a valuable insight into the mechanisms of failure, through directly observable changes to the cell structure. X-ray radiography can track three-dimensional structural information at high speeds (i.e., 2000 Hz) offering unparalleled insights into battery failure. Additionally, the efficacy of hazard mitigation strategies, such as safety vents, separator shutdown and current interruption, and positive temperature coefficient devices, may also be investigated. 4 However, most failure/safety testing methods do not have accompanying high-speed X-ray radiography data, and the analysis and interpretation of any such available data has remained largely qualitative. This is due to the presence of multiple complex events, involving both gradual and sudden shifts of the electrodes, and their decomposition, as well as, in some cases, the movement of a large object such as a nail. This poses a significant image-processing challenge, for which there is currently no robust, quantitative analytical approach. Typically, videos are examined by eye, with frames of interest selected to produce a timeline of visible events. Although informative, this is a very slow method, owing to the large amounts of information present in a single video, and mechanisms are typically postulated from qualitative observations. By extension, a broad, statistically significant analysis of multiple videos using the same approach is not only extremely time-consuming, but also supremely challenging. Subtle yet key events may also not be apparent to the eye, and such manual observations are likely to be inconsistent between measurements (due to the stochastic nature of these failure events) and between researchers undertaking the data analysis. 13 A robust analytical toolbox for quantifying the kinetics of cell failure is therefore required in order to fully exploit the information contained with existing and future X-ray radiography data that are now being collated in open-access databases (e.g., the Battery Failure Databank hosted by the National Renewable Energy Laboratory 14 ).
The internal structure of a lithium-ion cell is typically an assembly of periodic electrode layers, current collectors and separators. In X-ray radiography, this produces a distinct image 'texture', composed of bands of compositional contrast resulting from the different X-ray attenuation coefficients of each material. While a variety of feature-detection and objectclassification algorithms are available, X-ray radiography of lithium-ion cell failure poses a unique combination of challenges that hinder their applicability: (i) Although the electrode texture is well-defined, it degrades unevenly across the field of view, disappearing as failure occurs. Frequency-domain analyses, such as fast Fourier transforms, that can identify the initial texture based on spatial or temporal frequencies, 15 are unable to track the changes in phase and orientation in the spatial domain as failure progresses.
(ii) High frequency noise is typically present, making the identification of periodic or aperiodic features challenging. Pixel-based region-labelling algorithms fail in accurately deconvoluting the noise from the features of interest.
(iii) In some cases, for example during nail penetration testing, large objects are present in the field of view. These obscure objects introduce variations in the texture, leading to analytical artefacts.
In this work, we apply Gabor filter banks and subsequent post-processing algorithms to high-speed X-ray radiography data of lithium-ion cells undergoing abuse via nail penetration and ball compression testing. Gabor filter banks are commonly used in visual processing, owing to their sensitivity to the orientation (angle) and spacing (frequency) of edge features. 16,17 They have been effective in the automated recognition of textures, 18,19 structural variations in electron microscopy images, [20][21][22][23] anatomical structures in X-ray computed tomograms, 24,25 as well as human faces 26 and fingerprints. 27 Texture may be detected and quantified as a function of component feature size, orientation and distribution. The ability to control the frequency and orientation of the Gabor filters enables the user to selectively pick out the electrode texture and omit other objects. Furthermore, the filters can track changes in the spatial domain (directional sensitivity) as failure progresses within a cell. Ultimately, this approach produces frequency-sensitive spatial information, while at the same time being noise-insensitive. Thus, it addresses the challenges outlined above and is a powerful and an appropriate technique for analysis of X-ray radiography data.
We have developed an image processing toolbox outlined in the following manner: (i) We firstly objectively identify the internal cell structure and nail as separate textures, representing them as Gaborfiltered frames with features defined by distinct functions of angle and frequency. While failure may be induced in any direction, the electrodes present a highly ordered structure that can be resolved based on its particular orientation.
(ii) The Gabor-filtered frames are then cross-correlated over time, facilitating the tracking of the degradation and failure of cells with a high spatiotemporal resolution and allowing us to estimate the displacement of electrode layers before failure.
(iii) Finally, from the conversion to spatiotemporal information we produce a single practical, and illustrative map of the failure events occurring in an entire video, from which we quantify the rate of propagation of failure both axially (parallel to the electrodes) and radially (perpendicular to the electrodes).
Battery failure involves multiple complex events occurring in all three dimensions. Using our technique, we have, for the first time, tracked how the structure of electrodes changes over time, as a direct result of the forces acting on it. Not only does our approach introduce a means of quantifying failure processes, but it may also facilitate the validation of existing mechanistic models. Our spatiotemporal maps reveal that the rate of electrode displacement (before the onset of failure) is higher when a nail propagates radially rather than axially. We also identify and track the onset of failure, which occurs at slower velocities than the electrode displacement and exhibits varied third-order kinetic behaviour. With the spatiotemporal maps, we may accurately describe not only 'where and when' failure originates, but also 'how' it propagates over time. In the long term, we are confident that this toolbox can further the understanding of battery degradation mechanisms by coupling mechanical failure models [28][29][30] with electrochemical thermalrunaway models. 31 Furthermore, our approach provides an open-source analytical toolbox developed on Python that may be readily implemented on video data from any instrumental setup, including legacy data from archives (toolbox available upon request). Furthermore, the toolbox has a user-friendly interface to guide appropriate parameter selection. Not limited to visual assessments, any user may thus gain new perspectives on their data, from which they may readily distinguish interesting behaviours for further characterisation. Analysing a variety of datasets, each of which were clearly distinct from one another in both input and output, we have evidenced that our technique is an extremely robust, efficient, informative and transferable means of analysing such dense datasets. Our technique is therefore extremely promising in advancing and strengthening the understanding of failure mechanisms of lithium-ion cells.

Failure testing setup
The nail penetration testing was performed as previously described by   6 inside a commercial nail penetration system (MTI Nail Penetration Tester, MSK-800-TE9002, MTI, Richmond, CA, USA), modified to have X-ray transparent 2 mm thick aluminium front and rear panels for X-ray imaging. The lithium-ion cells were held in place by hydraulic clamps that operated at 4 bar. The hydraulic piston nail penetrator was connected to a 5 bar air supply. All tests were carried out using the smart nail described by Finegan et al. 6 or a stainless steel ball of diameter 20 mm (see Table 1). Briefly, the smart nail is a 60 mm long stainless steel tube with an external diameter of 4 mm and an internal diameter of 2 mm. 32 The nail contains a thermocouple and has a conical tip that was sharpened using a lathe.
Collection of X-ray radiography data X-ray radiography was carried out at beamline ID19 at the European Synchrotron Radiation Facility (ESRF). A polychromatic beam was used with a LuAG:Ce (Lu 3 Al 5 O 12 :Ce) scintillator and a high-speed PCO.Dimax camera (PCO AG, Germany). Images were captured at 2000 fps with an exposure time of 457 ms and 10 mm pixel-size. The raw data were processed where flat-field correction was applied using a bespoke MATLAB code. The resulting videos are provided as Videos ('SI_Video_1'-'SI_Video_4', ESI †).

Processing of radiography data
The pre-processed radiography data were opened in a bespoke analytical toolbox developed on Python 3, 33 with the following packages installed: imageio, 34 numpy, 35 scipy, 36 scikit-image, 37 matplotlib, 38 and tkinter. 39 An experimental dataset consisting of a single AVI/MP4 video or Tiff stack, or a folder of images, was loaded through the imageio package and presented on a graphical interface via tkinter, where the user can select the region of interest (ROI) and the set of frames to be analysed. For datasets, especially legacy data that have gone through video compression software, where the number of frames has been altered -either through the introduction of duplicate frames or dropped frames, the original frame rate of video capture cannot be used for temporal analysis. To this end, the original timestamp embedded in the frames can be analysed using Google's optical character recognition engine, Tesseract, 40 via Pytesseract, 41 a wrapper for Python. Any duplicate frames were ignored from analysis based on the detected timestamps.
For a set of frames loaded, we define t = 0 s as the first frame selected for analysis, unless otherwise stated, for which the electrode structure is assumed to be pristine and unaffected by any abuse process. t i is defined as the time of the ith frame, where i frames are included in the analysis. All spatial information has been presented in the Cartesian coordinate system, where x represents the position in the axial direction, along the X axis (parallel to the electrodes), and y represents the position in the radial direction, along the Y axis (perpendicular to the electrodes). Unless otherwise stated, the origin, x = 0 mm, y = 0 mm, is the top-left corner of the rectangular ROI selected by the user.
Upon converting the frames to an 8-bit greyscale format, the contrast range of each selected frame was normalised (lowest pixel value set to 0 and highest pixel value set to 255) and a morphological reconstruction step applied to smoothen noise. 42 Gabor filter banks were then applied as discrete sinusoidal waves modulated by a Gaussian function. This implementation consisted of a [9 Â 9] pixel kernel, which scans across a frame (Fig. 1). The user can choose the most appropriate Gabor filter parameters (angle and frequency), which are then applied on all the selected frames of a dataset.
Following the Gabor filtering step as shown in Fig. 1, postprocessing analyses were performed on the filtered frames ( Fig. 1c), to estimate electrode displacements and build temporal and spatiotemporal maps, enabling the extraction of cell failure kinetics.

Results and discussion
The cell types, the failure-testing modes, and the location of the tests are shown in Table 1. 'SI_Video_1' and 'SI_Video_2' (ESI †) involve radial penetration of the smart nail midway along the cell. 'SI_Video_3' (ESI †) entails axial propagation of the nail, where the nail penetrates through the base of the cell. 'SI_Video_4' (ESI †) involves compression of the electrodes by a ball, incident midway along the cell.

Texture detection using Gabor filters
We firstly applied a Gabor filter bank to a video to determine the efficacy of capturing the texture in each frame, representing the electrodes. Fig. 1a shows an example video frame, for which a pair of Gabor-filtered output images are shown in Fig. 1b.
In the foreground image, which has been filtered optimally (filter applied parallel to the electrodes, with a frequency similar to the electrode spacing), the electrode structure shows up as a strong signal (red -positive peak representing Cu/Al, blue -negative peaks denoting electrolyte or the graphite layer, and whites that represent the separator material or the Cuanode/Al-cathode interface). On the other hand, in the background image, which has been filtered poorly (filter applied perpendicular to the electrodes, with a low frequency), there are no features detected, aside from an artefact at the left side of the image. Taking a Y cross-section through the optimally filtered data, as shown in Fig. 1c, produces a very clear representation of the alternating electrode structure. So, by using an appropriate choice of filtering conditions (orientation, y and frequency, f, for example from those shown in Fig. 1d), we acquire output data which do not contain the high-frequency noise present in the raw image, with an electrode spacing and relative contrast that are extremely welldefined between large positive and negative values (normalised here, and in the rest of the manuscript, to AE1).
Once we had chosen optimal Gabor filter parameters for a single frame of 'SI_Video_1' (ESI †), we applied the same The scale bar indicates 1 mm. (b) Images filtered using the Gabor kernel as shown in (d); the electrodes are filtered out when the filter (the sinusoidal harmonic function) is applied perpendicular to the electrodes (radially, y = 01), whereas the electrode structure is captured when filter is applied parallel to the electrode layers (axially, y = 901). (c) Y cross-section of the image filtered at y = 901, representing the output of the Gabor filter that is most sensitive to the structure of the electrodes. (d) Gabor kernels with a sinusoidal wavelet (3D projections) applied at varying angles (y) and frequencies (f) on the inset image shown in (a). y offers directional sensitivity to selectively filter 'texture' of the electrodes and the frequency (f) resolves the individual electrode layers (optimal at f = 0.10 pixels À1 ). The output signal is maximised for y = 901 and f = 0.1, i.e., for the filter which best matches the orientation and spacing of the electrodes (orange inset). For filters that do not match with the electrodes, the output signal is reduced, and the texture is not well-represented (grey inset). For an appropriately filtered image, a Gabor signal of +1 represents the Cu/Al layers, À1 that of graphite/electrolyte and values around 0 represent the separator material or the Cu-anode interface/Al-cathode interface.

Paper
Energy & Environmental Science Open Access Article. Published on 06 July 2022. Downloaded on 10/30/2022 3:03:20 AM. This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.

View Article Online
process to each frame in the dataset and extracted the resulting cross-sections for comparison. This allowed us to monitor the condition of the cell over time. Fig. 2a, d and g show raw video frames of a nail gradually penetrating a cell and disrupting the electrodes. To the eye, there is a clear distinction between the nail and the electrodes, but to precisely define their relative arrangement is not trivial, particularly as the nail moves further into the cell and the electrodes deform. However, by filtering the images at y = 01 (radially) and y = 901 (axially), we were able to selectively identify the electrodes independently and filter out the nail. Fig. 2b, e, and h show the output frames filtered parallel to the nail. The signal is initially just noisy throughout the cell, i.e., the electrode texture is not picked out by the filter. When the nail enters, we observe the appearance of a corresponding texture perpendicular to the electrodes. Conversely, when the filter is aligned with the electrodes, as in Fig. 2c, f, and i, the signal is initially very pronounced. Its magnitude then decreases in accordance with the texture changing as the nail enters and causes a region of deformation to spread from its entry point (see 'SI_Video_5.avi' (ESI †) for an animated comparison of the Gabor filter ranging from y = 01 to 1801). The outcomes of these contrasting outputs of the filters are highlighted in the bottom row of Fig. 2, which shows singlepixel-wide Y cross-sections from the centres of the filtered images. So, the Gabor signal cross-sections allow us to compare distinct features by tracking, over time, the textures that best describe them. As the texture changes, such as the electrodes losing structural integrity, the corresponding signal changes.

Tracking the nail velocity
To expand the functionality of our Gabor filtering approach, we quantified the nail velocity using the video frames between t = 0.2075 s and t = 0.5445 s from 'SI_Video_1' (ESI †) (where t = 0 s refers to the first frame of analysis of the dataset shown in Fig. 2a). Fig. 3a shows a raw video frame, with the ROI cropped for nail tracking shown in Fig. 3a-(i). The corresponding Gabor-filtered frame is shown in Fig. 3a-(ii), where filter parameters of y = 1401 and f = 0.04 pixels À1 have been used in order to align the filter with the edge of the conical tip of the nail. The nail's conical tip is clearly highlighted by the filter, isolated from the rest of the ROI, and appears as a distinctive peak in the Y cross-section, as shown in Fig. 3b (blue circle marker) at a given frame. Applying the filter to each cropped video frame and finding the position of this peak

View Article Online
(black markers) allowed us to calculate the displacement of the nail tip over time, as shown in Fig. 3c. Thus, we may follow its trajectory and determine its velocity (see Video 'SI_Video_6.avi', ESI †). The nail pierces the cell casing and moves with a rather constant velocity of around 2.22 mm s À1 , balanced by the mechanical resistance of the electrodes. The electrodes then tear suddenly (t E 0.4645 s), allowing the nail to accelerate to a peak velocity of 113 mm s À1 under continued application of its driving force. It is worth noting that this is the first instance in which quantification of such information characterising cell failure has been reported. The understanding of safety testing procedures may therefore be enhanced by applying our toolbox to a range of failure scenarios. Such insight is likely to lead to improved cell safety standards, and thus engineering solutions for the production of safer cells.

Temporal cross-correlation of the Gabor signal
To quantify changes to the cell structure over time, we tracked the Gabor signal at a single X cross-section over time, as shown in the top plot of Fig. 4a. This location was chosen from the dataset shown in Fig. 2, close to the surface of the nail (x E 4.7 mm). Fig. 4a shows how the electrode structure in close proximity to the nail shifts over time before finally failing mechanically. We then compared the signal at time t i to the initial signal at time t 0 using cross-correlation, i.e., we calculated the similarity between the initial signal and signals from each subsequent frame. This is shown in the bottom plot of Fig. 4a, wherein the radial information (Y cross-section) at the chosen X cross-section in each frame is collapsed into a single value representing the 'similarity' with the first frame. When the cross-correlation is large and positive, the texture at t i resembles the initial texture at t 0 (Fig. 4b, t 1 ). When the value is large and negative, the signal appears inverted (Fig. 4b, t 3 ), i.e., the electrodes have shifted a distance equal to half the electrode thickness from its original position. When the value is close to zero, there is either a complete misalignment between the signals (Fig. 4b, t 2 ) or the Gabor signal is low at time t i , corresponding to the absence of electrode texture in the images (Fig. 4b, t 4 ). Until around 0.47 s in Fig. 4a, we can see that the electrodes shift gradually and linearly due to the View Article Online mechanical force from the nail. From the temporal crosscorrelation, this corresponds to the electrodes moving out of alignment and then realigning with neighbouring layers, giving a total shift of around 1.5 electrode layers (i.e., 1.5 full 'oscillations' are present in the shifting signal). When, at t i , the Gabor peak of an electrode layer aligns with the t 0 position of a neighbouring layer, the cross-correlation value is large and positive, corresponding to one complete 'electrode shift', seen as the second maxima in the cross-correlation plot. The temporal cross-correlation also accurately indicates the time at which the electrode structure completely failed (i.e., when the correlation becomes a flat line around zero) at t E 0.461 s. Although these processes may be observed in the raw video, they are challenging to quantify by eye, especially when thousands of frames must be examined. Instead, our toolbox can direct the user to the time-point corresponding to the failure event, as well as quantify the preceding behaviour as a function of time.

Estimation of electrode displacement
We extended our temporal cross-correlation to multiple X positions, which enabled us to observe the displacement of the electrodes along the length of the cell over time. We initially tried to identify and track individual peaks in the Gabor signal, but this proved problematic due to the disorderly nature of the failure; as electrode layers degraded, their corresponding peaks were lost, while new peaks were introduced by the cell casing entering the ROI due to the force of the nail. These issues produced mismatches in the peak tracking, rendering such algorithms impractical.
Instead, we estimated the electrode displacement using the temporal cross-correlation. This methodology was developed using 'SI_Video_4' (ESI †) as an ideal test case, involving compression of the electrodes by a ball (see Table 1), without subsequent mechanical failure or thermal runaway. Fig. 5a shows the raw video frames at t 0 and t i = 0.5 s, where the electrodes demonstrate a clear, symmetric shifting and bending under the incident ball. Fig. 5b shows three temporal cross-correlations at different X positions. At x 2 , corresponding to the centre of the ball, more electrode shifts (full oscillations in the cross-correlation) are present in comparison to x 1 and x 3 , at the edges of the ball. We estimated the electrode displacement by multiplying the number of shifts by the distance between electrodes, 66 AE 17 mm, which we calculated from the average distance between adjacent Gabor peaks in the 'pristine' structure, i.e., at t 0 . Fig. 5c, shows the resulting electrode displacement across the video frame at six time-points between t 0 and t i = 0.5 s. Directly below the centre of the ball, the displacement was the greatest, around 0.44 mm at 0.5 s. This drops off symmetrically in both x directions, to a minimum of around 0.08 mm at a distance of around 3.5 mm from the centre of the ball. We also note, from the broader colour bands in the centre of the plot (around x = 3.5 mm), that the displacement had a larger acceleration directly below the ball. We applied a similar approach to the nail penetration dataset 'SI_Video_1' (ESI †). Fig. 5d shows the displacement of the electrodes, wherein the nail (radius = 2 mm) is incident at the right side of the ROI (x = 6.7 mm). Here, the entire structure shifts homogeneously by around 0.1 mm over 0.36 s, before the displacement at the nail , with that of t 0 (black lines). When the electrode texture has a high similarity with the undisturbed texture (t 0 ), the correlation value is large and positive (normalised to +1), e.g., at t 1 where t 1 À t 0 = 5 ms. When the electrode is displaced and so appears inverted compared with the initial texture at t 0 , the correlation is large and negative (normalised to À1), e.g., at t 3 where t 3 À t 0 = 126 ms. When there is little or no similarity between the textures at t i and t 0 , the correlation value is close or equal to zero. This happens in two scenarios -when the electrode texture is displaced slightly but not inverted (e.g., at t 2 where t 2 À t 0 = 43.5 ms) or when the electrodes are completely delaminated or expelled from the field-of-view (e.g., at t 4 where t 4 À t 0 = 620 ms).

Energy & Environmental Science Paper
Open Access Article. Published on 06 July 2022. Downloaded on 10/30/2022 3:03:20 AM. This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.

View Article Online
location becomes much more pronounced, and then stops at around 0.22 mm, when the Gabor signals were lost. This is an interesting contrast with the ball compression, which instead produced a continuous bending. The initial homogenous shifting of the electrodes in the nail penetration dataset resulted from the overall displacement of the cell as the nail made contact, followed by displacement of the electrodes as the nail pierced through. We note that this is in the plastic flow regime, where the volumetric stress withstood by the electrodes is a property of their tensile strength and Poisson ratio, as discussed by Wierzbicki and Sahraei, 2013. 43 Subsequently, as discussed above, the mechanical resistance of the electrodes suddenly yields as their structure fractures, leading to an abrupt acceleration of the nail (to a maximum of 113 mm s À1 as shown in Fig. 3c).

Constructing spatiotemporal failure maps
We expanded our analysis by mapping the evolution of the cell structure in the ROI for the whole video in order to visualise the entire failure on a single spatiotemporal map. Fig. 6 shows the progression from cross-correlation information to mapping, using the dataset 'SI_Video_1' (ESI †). Fig. 6a shows the temporal cross-correlation plots at four X positions. Separately, these do not provide information on the failure propagation in the axial direction. However, to overcome this, we may plot the cross-correlation at every X cross-section as a surface plot to yield a spatiotemporal map, as shown in Fig. 6b. Such a map may be directly compared to the raw video frames, with time passing (positive vertical direction) as events develop across the X axis, (which is aligned with the width of the frames analysed).
It is important to note that representing the data in this way captures the y information at each t as a single cross-correlation value. Regions of high similarity to the initial electrode texture appear red, and regions of inverted alignment appear blue. Regions of complete misalignment or disappearance of the texture from the ROI are intermediate and appear green. The map may then be interpreted as follows: , where the distance between electrode layers was estimated to be 111 AE 10 mm. Analysis was cropped at t = 0.6 s, when the electrode layers fractured. At x = 6.7 mm (near the surface of the nail), the electrode displacement is estimated to be 221 AE 21 mm, above which the Gabor signals were lost. Error bars denote AE1 standard deviation in the distance between electrode layers.

Paper Energy & Environmental Science
Open Access Article. Published on 06 July 2022. Downloaded on 10/30/2022 3:03:20 AM. This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.

View Article Online
(i) Inspect the map for distinct features, such as continuous regions of a consistent colour (e.g., Event (1) in Fig. 6b), or abrupt axial discontinuities (e.g., Event (4) in Fig. 6b).
(ii) Continuous regions of colour characterise the behaviour of the electrodes across the length of the cell. Linear or nonlinear changes to such regions of a colour indicate changes to the electrode structure propagating across the X cross-section over time. For example, the dark blue region near the bottom of Fig. 6b suggests that the electrodes are becoming misaligned with their initial structure, and that it propagates in the negative X direction, where the origin is the top left of the frames (x = 0, y = 0) and the nail enters at the right-edge of the ROI. On the other hand, areas of a constant colour indicate that the electrode structure is not changing. For example, the green region at the top right of Fig. 6b suggests the electrode structure has disappeared and no further change takes place (this corresponds to the presence of the nail in the cell once it has stopped moving).
(iii) Axial discontinuities characterise events that take place simultaneously across the distance corresponding to the width of the feature in X; at a single point in time, the colour changes homogeneously. For example, if the electrodes in a region delaminate altogether, the map would show an abrupt transition to green, as we observe at around 0.42 s in Fig. 6b.
Using the map in Fig. 6b, we have identified four different events occurring in the electrode structure. These events overlap one another in time; a timeline of raw frames is shown in Fig. 6c. Firstly, the map highlights the point of entry of the nail (right edge of the cropped ROI, x E 6.7 mm) at t E 0.04 s, where the electrodes shift from the right edge to the left edge. Event (1), a region of inverted electrode alignment, represents the rate at which the nail pierces the cell casing and displaces  6 The region of inverted cross-correlation marked as Event (3) represents the point at which the electrodes fail structurally by fracturing, leading to localised delamination, shown as Event (4). This occurs very rapidly; the colour transition in the mapping appears horizontal, indicating that the delamination occurred almost homogeneously over 4 mm along the X cross-section. This indicates the need to analyse the Gabor signals in the radial direction (as discussed in the sections below). Fig. 6 demonstrates the strength of spatiotemporal mapping of X-ray radiography data. We can now assess an entire dataset of thousands of video frames, and thus an entire failure experiment with multiple sub-events, in a single picture. From this, we can observe, directly, how each process propagates along the cell, without needing to scroll through the video manually, further validating our analytical technique. The mapping also reveals and resolves processes that may be missed by manual interrogation, such as the distinction between the electrodes shifting, as in Event (1), and the onset of failure, as in Event (2) in Fig. 6b.
We produced spatiotemporal maps using multiple datasets of nail penetration, as well as the ball compression test, to unravel the events occurring in each experiment (Fig. 7). The maps are interpreted as follows: (a) Radial nail penetration. Fig. 7a and b show the spatiotemporal map of the datasets 'SI_Video_1' (ESI †) (also shown in Fig. 6b) and 'SI_Video_2' (ESI †), respectively, where the nail  Fig. 6b, that of 'SI_Video_1' (ESI †). The map shows the nail entering at the right edge (x = 6.7 mm), causing a more pronounced displacement of the electrodes (Fig. 5d). The map also shows multiple events that are distinct from the electrode displacement, such as failure propagation and localised delamination. View Article Online enters the cell in the radial direction. It has been previously reported that the tip of the nail can reach 820 1C under these conditions, 6 with such tests expected to result in hard-shorting that gradually relaxes due to the large surface area of the nail. Here, we chose the ROI such that the nail centre was at the right edge in Fig. 7a ('SI_Video_1', ESI †) and at the left edge in Fig. 7b ('SI_Video_2', ESI †). The spatiotemporal maps illustrate similar electrode displacements processes. In Fig. 7b the nail enters the ROI at t E 0.1 s. The gradual shift in the electrodes, similar to Event (1) in Fig. 6b and c ('SI_Video_1', ESI †), is apparent from the regions of transition from yellow to green between 0.1 s and 0.17 s. This has not previously been resolved quantitatively in the literature. After the nail penetrates the cell casing, the top electrode layers are pierced, and the onset of failure is captured between t = 0.17 s and 0.38 s. This non-linear region is similar to Events (2) and (3) in Fig. 6b and c ('SI_Video_1', ESI †), potentially due to the combined effect of failure of the top 2-3 electrode layers and the displacement of the rest of the layers. It has been reported that the onset of this hard-shorting effect is marked by the increase in internal temperature due to Joule heating, 6 which has been captured by our technique as the rapid non-linear trends in Fig. 7a and b -Events (2) and (3). At t = 0.38 s in Fig. 7b, there is a horizontal shift in crosscorrelation from x = 1 mm to the right edge of the frame, representing a rapid failure of the electrode structure (fracture of electrode layers). This dataset, however, did not exhibit localised delamination, in contrast to our observation of Event (4) in the dataset Fig. 6b and c. (b) Axial nail penetration. Fig. 7c shows the spatiotemporal map for the dataset 'SI_Video_3' (ESI †) in which the nail enters in the axial direction, piercing the bottom of the cell. In previous work it was shown that this orientation leads to the highest internal cell temperature during testing (4900 1C), and indeed the cell fails similarly to that of a thermal abuse condition. 6 This dataset demonstrates the functionality of our analytical approach, irrespective of the direction of incidence of mechanical objects with respect to the electrode structure. Here, the red area in the bottom left corresponds to the bottom of the cell (x = 0 mm to 2.3 mm), with high similarity due to the negligible electrode shifting, as the nail pierces only the cell casing until around 0.13 s. The blue area between x = 2.5 mm and 3.2 mm is outside the cell (and the cross-correlation is appropriately close to 0 as the Gabor signals are E0). The entry of the nail causes a gradual shift of the electrodes, so the correlation values reduce, shown as a transition from red to green between 0.13 s and 0.34 s. This is in agreement with the observations of   6 that there was no electrode fracturing due to the minimal tensile strain on the electrode with the parallel propagation of the nail.
At around 0.34 s, the decrease in cross-correlation speeds up, with a transition from green to blue as the nail begins pushing the electrodes. A sudden shift (seen from the horizontal dark blue line) indicates the mandrel detaching from the bottom of the cell, though thermal runaway has still not initiated. This is followed by another region of decreasing cross-correlation close to 0.39 s, where the onset of thermal runaway has been captured with the mandrel starting to disintegrate.
It is worth noting that the slope of this region represents the rate of propagation of thermal runaway for this dataset between 0.39 s and 0.8 s. Subsequently, there was a release of gas into the base of the cell, leading to the bulging of the base plate that then escaped through the vent.
(c) Radial ball compression. For the ball compression test in Fig. 7d, we observe a clear symmetrical electrode displacement centred on the incident location of the ball, x = 3.5 mm. There is a widening pattern of alternating positive (green) and negative (blue) correlation with time. This characterises the shifting of the electrodes under the ball, directly proportional to the distance from the centre of the ball, as previously discussed in Fig. 5a-c. It is interesting to note that this testing condition did not result in thermal runaway, probably due to the relatively large surface area of the ball that distributed the tensile strain axially along the cell. The experimental condition may also not have reached the maximum load-bearing capacity of the cell, as discussed by Wierzbicki and Sahraei (2013). 43 Comparing the three nail penetration and ball compression datasets, we observed reproducible spatiotemporal crosscorrelation patterns (especially in the radial direction), which may be distinguished as electrode shifting, failure propagation, and rapid delamination, among others. This methodology emphasises the distinct effects that mechanical objects, such as a nail, have on each region of a cell, along with the axial intra-cell effects leading to the propagation of failure within the electrodes. This toolbox, therefore, has the potential to extract and elucidate multiple failure mechanisms that may initiate under abuse testing.

Quantifying the kinetics of failure
Qualitative assessment of failure has been well-documented in literature and has advised several preventative and mitigative safety considerations for the use of lithium-ion cells. We have demonstrated that, via spatiotemporal mapping of the crosscorrelation values, the user obtains a greatly enhanced map of events to produce a more robust understanding of failure. In this section, we realise the true potential of such maps by tracing the trends of multiple events identified in Fig. 6 and 7 for the three nail-penetration test conditions described in Table 1, to advance our mechanistic understanding of the onset of cell failure. From the spatiotemporal maps, we extracted the (x, t) coordinates of each distinctive event described by either a negative cross-correlation region, a positive cross-correlation region, or a sloping region (Fig. 8). We performed third order polynomial regression, equivalent to the Newtonian equations of motion, on these coordinates, to extract the initial jerk (3rd order coefficient), initial acceleration (2nd order coefficient), initial velocity (1st order coefficient) and origin of each event (x intercept). Since the propagation of failure occurs due to the combination of the force imparted by the nail and the initiation of exothermic thermal runaway, 1,[44][45][46][47][48] to capture the changing forces/stresses we assume that the rate of propagation of failure can be characterised under a time-dependent acceleration condition, such that: where, a is the acceleration with time, t, and the rate of change of acceleration is jerk, j, assumed to be constant. Further, this can be extended to a well-known form: where v is the velocity and x is the position. In polynomial terms, we can therefore express the change in position over time as: change in velocity over time as: and change in acceleration over time as: We used three methods to determine the coordinates of each trend, depending on whether we were tracing peaks or valleys. The 2D maps in Fig. 8a-c are the spatiotemporal maps that have been transposed to display time in the horizontal axis and X position on the vertical axis. Our primary approach was to find the peaks (or troughs) of the cross-correlations along x for each point in time. Alternatively, we found the peaks (or troughs) of the correlations along time for each X position. This resulted in multiple X positions for a given time, where multiple x values at each t were averaged and the standard deviation, s exp , in x was applied as experimental uncertainty of the data. Our final method, in the case that we needed to trace a gradual shift in the correlation values as opposed to a sudden shift (used for trend (iv) in Fig. 8), was to threshold the colour scale to the correlation values associated with the trend. This isolated a 2D shape containing the trend data, from which we could find the mid-point at each X position. Multiple x values at each t were also averaged and the experimental uncertainty, s exp , in x estimated, as in the case above. The bottom row of Fig. 8 shows the resulting data points with the 3rd order polynomial fits. The coefficients of the fits are shown in Table 2.
A non-linear least-squares fitting method was used to fit eqn (3) to the averaged x data (regression performed using Python 3, with a convergence tolerance = 1 Â 10 À8 ). The fitting coefficients were constrained such that v 0 is positive, i.e., we define that the events progress in the positive x direction due to the expected unidirectional movement from the nail surface propagating away from the nail. x 0 was constrained 0 AE 2 mm, i.e., events begin within the region defined by the diameter of the  Table 2. Note that (vi) is composed of two smaller sections, due to difficulty in reliable peak-tracing. nail. For each fit, the model uncertainty (AE1 standard deviation) was calculated from the square root of the diagonal of the covariance matrix. The corresponding R 2 of the fits was also estimated. Trends (i) and (iv) represent the shifting of the electrodes prior to structural failure for nail penetration in the radial direction. Trend (i) has j 0 = 0, i.e., there is no jerk present and the acceleration is constant, whereas trend (iv) has an initial jerk of 2570 mm s À3 . Trend (i) has an initial velocity of 91.7 mm s À1 but decelerates at 578 mm s À2 . We note that this deceleration term has quite a large error of AE29 mm s À2 , which might result from the noise in the data. Conversely, trend (iv) has an initial velocity of zero, but accelerates rapidly at 515 mm s À2 resulting in v(t 0.31 ) E 250 mm s À1 at t = 0.31 s. This highlights the intrinsic variation between the mechanical processes occurring during nail penetration tests carried under the same conditions. Trends (ii), (iii) and (v) correspond to the combined effects of failure propagation and electrode shifting. There are also distinct differences in the acceleration and initial velocity of these processes. Trends (ii) and (iii) have accelerations of 108 mm s À2 and À282 mm s À2 , and initial velocities of 22.7 mm s À1 and 24.6 mm s À1 , respectively. They accelerate to a velocity of v(t 0.42 ) E 62 mm s À1 and v(t 0.45 ) E 135 mm s À1 . Trend (v) appears to be much slower, with an initial velocity of 9.5 mm s À1 decelerating at À34.5 mm s À2 . This again emphasises the broad range of cell failure kinetics that result from nail penetration tests, although inspection of the videos might lead one to conclude that the processes leading up to full electrode destruction are quite similar.
Trend (iii) has a large initial jerk of 3210 mm s À3 , although (ii) and (v) have j 0 = 0. Trend (iii) has a high jerk potentially due to the rapid delamination of the bottom 3-4 electrode layers captured in the video, leading to a sudden inflexion in the x data. We note that fitting higher order polynomials is sensitive to input data, which in our case are peak traces from spatiotemporal maps extracted from legacy data. This may be overcome with acquisition of higher resolution images at higher frame rates, improving the quality of the peak traces.
We also observe abrupt transitions at 0.42 s in Fig. 8a and 0.37 s in Fig. 8b as the cells fail across their length, which effectively ends trends (iii) and (v). From the spatiotemporal maps the shape of the trends appears to diverge at these points. This end point corresponds to the nail reaching the middle of the cell as the electrodes fracture, so the spreading in the colour map likely indicates a rapid final shift of the electrodes away from the nail before they are destroyed.
Trends (vi) and (vii) characterise the electrode response for the case in which the nail entered the cell in the axial direction, causing reduced tensile strain on the electrodes in comparison to entering in the radial direction. a 0 and j 0 are relatively low in comparison to those for the nail entering in the radial direction. Trend (vi) has j 0 = 0 mm s À3 , while trend (vii) has j 0 = 872 mm s À3 . They have accelerations of 4.9 mm s À2 and À92.4 mm s À2 , and initial velocities of 2.5 mm s À1 and 7.5 mm s À1 , respectively. We also do not observe a nearhomogeneous electrode shift across the cell. We suspect that this contrast in behaviours is due to the difference in mechanical resistance of the electrode layers in each case. It is interesting to compare this behaviour to the ball compression in 'SI_Video_4' (ESI †), wherein the electrodes do not fracture and there is no thermal runaway. Likewise, axial penetration of the nail does not stress the electrodes into fracturing, thus it is likely that when thermal runaway occurs it results from internal shorting caused by the nail.
From our quantification of the failure kinetics, we note that the propagation of structural damage (i.e., at the onset of catastrophic failure or uncontrolled thermal runaway) is slower than previously believed. Ignoring the abrupt and total cell failure, and if a certain specific trend propagation were to travel the entire length of a cell (in our case 65 mm), we may extrapolate the model to estimate the velocities to which the failures would accelerate. In the case of trend (iv), the electrodes would be displaced at a maximum velocity of 396 mm s À1 (v 0 = 0 mm s À1 ) by t = 0.578 s, traversing the entire length of an 18 650 cell, whereas, a failure trend involving a delamination event, e.g., trend (iii), would traverse the entire length of an 18 650 cell by t = 0.7 s, reaching a maximum velocity of 163 mm s À1 (v 0 = 24.6 mm s À1 ). This reinforces the view previously put forward by the authors that, counter-intuitively, failure due to nail penetration may not be as severe a mode of failure/abuse as has been reported in the literature. Table 2 Results from the 3rd order polynomial fits of the seven trends shown in Fig. 8 from three different nail penetration datasets. The 3rd order polynomial was of the form xðtÞ ¼ where v 0 is the initial velocity term, a 0 is the initial acceleration, j 0 is the jerk and x 0 is the xintercept representing the origin of the event

View Article Online
Tracking the radial propagation of failure processes So far, we have quantified the propagation of failure and the intra-cell effects in the axial direction. However, it is clear from the spatiotemporal maps that some events happen abruptly, homogeneously across the X cross-section. In these cases, we cannot track the shape of a cross-correlation trend because it describes a process occurring in the radial direction; the transformation from Gabor signals to cross-correlation collapses the information in the y direction into single values at each x position. Thus, events that appear instantaneous on the (x, t) cross-correlation maps can only be quantified by accessing the y coordinate system. Fig. 9a shows the temporal Gabor signal from the 'SI_Vi-deo_1' (ESI †) dataset (nail travelling in the radial direction), 3.7 mm from the nail surface (x E 1 mm); similar to that of Fig. 4a which represents the temporal map at the nail surface (x E 4.7 mm). Until around 0.5 s, the electrode structure remains intact with just a gradual shift due to the nail. However, there is then a sudden shift and loss in magnitude in the lower electrode layers, from y = 2.75 mm to 6 mm, which indicates the localised delamination captured in this dataset (Fig. 6b, Event (4)). In order to extract the kinetics of this event, which was very abrupt on the (x, t) spatiotemporal maps, we tracked the net shift of each Gabor peak in the temporal Gabor map (along the y axis). Fig. 9b shows data manually cropped from Fig. 9a, corresponding to the delamination. This region appears disordered, with electrodes shifting in the positive y direction at different rates. In order to characterise how this failure propagates, we studied the distribution of electrode-shift velocities by capitalising on the power of Gabor filter banks again. We applied a further Gabor filter bank (y = 1001 to 1601) on the temporal Gabor signal data, with a fixed frequency equivalent to the electrode width. For each orientation we obtained an output image highlighting the most prominent trajectory taken by each electrode over time (see 'SI_Video_7.avi', ESI †). Fig. 9b shows the segments picked out at three angles, where we can observe a range of trajectories taken by each electrode layer. However, the filter produced some signal even for features that are slightly misaligned with the orientation. The output signals were therefore binarized in order to convert the trajectories into single-pixel-wide skeletal lines, on which a linear regression was performed to extract the velocities. By summing all the pixels of the Gabor-filtered trajectory images for every angle, we also obtain a signal intensity (Fig. 9c, top panel), wherein a higher signal indicates a greater presence of structure aligned with the filter. For a range of velocities of the electrodes per orientation, as shown in Fig. 9c bottom panel, we may use the signal intensity to guide the user to obtain the velocity distribution for angles that produce high signal intensities. Fig. 9c shows the signal intensity plot and associated velocity distribution. Interestingly, there were two distinct peaks in the intensity, at y = 1101 and 1551. At y = 1001 we captured the top electrode layers at the onset of delamination with a velocity of around 4 mm s À1 , while at y = 162.51 we captured the bottom-most electrodes that delaminated the fastest, at a velocity of 140 mm s À1 leading on to delamination. Above y = 162.51, the extracted Gabor lines were that of the noise from the filter and not representative of the temporal electrode shifts. The orientation at y = 1301 was representative of the delamination velocities of most of the electrodes in the cropped ROI, with an average velocity of 13 mm s À1 . We suggest that this delamination velocity acts as a point of transition between the electrode shifting due to the force from the nail, and a fully uncontrolled thermal runaway process.

Conclusions
We have demonstrated for the first time that the texturesensitivity of Gabor filtering is very well-suited to quantifying X-ray radiography data of lithium-ion cell failure tests. We have built an assistive toolbox for the rapid and reproducible analysis of both legacy X-ray synchrotron radiography data and future data, where the user is guided to the exact location and time-point at which interesting events occur. Using the directional sensitivity of the Gabor filter, we were able to not only selectively filter the electrodes, but also select and study other objects, such as estimating the penetration velocity of a nail. Further, upon estimating the displacement profiles of electrodes before failure, we have established a platform that extensively analyses and resolves multiple failure events occurring concurrently. These events have been spatiotemporally mapped on a quantitative scale, where an entire failure testing dataset has been condensed and projected onto a single 2D map with distinguishable events.
The true novelty of this analytical technique is the amount of kinetic information that may now be extracted, relating to the events propagating axially and radially in these datasets. Through proof-of-concept validation of our method via the analysis of distinct battery failure datasets, we observed that the nail penetration event occurs more slowly than previously supposed, indicating that the slower onset of electrode failure might render them less dangerous than instantaneous shortcircuiting events or thermally induced degradation events.
With an automated, user-friendly toolbox that helps to reduce human-induced error, several X-ray radiography datasets are currently being processed to elucidate the mechanisms and rates of failure induced by a range of thermal, electrical and mechanical sources. It is worth noting that unique events such as mechanical delamination, gas generation and gas-induced electrode shifting can now be robustly identified and their propagation rates quantified. The toolbox can be applied to existing data available from databanks, such as the one hosted by the National Renewable Energy Laboratory, which can help standardise abuse testing procedures. As a first step, the toolbox directly outputs empirical data describing the mechanics of failure, presenting an opportunity for these data to be applied to mechanical as well as thermal runaway multiphysics models of Li-ion batteries. Our toolbox also has the potential to analyse high-resolution, low frame rate images captured using X-ray CT instruments, highlighting that our technique may not be limited to synchrotron radiography data.
Furthermore, this toolbox will be powerful in helping to couple mechanical models with electrochemical thermal runaway models, when used in conjunction with other electrochemical techniques, such as fractional thermal runaway calorimetry (FTRC). 49 Despite the lower sampling resolution of FTRC compared to high-speed imaging, with advances in calorimetry measurements, it may be possible for high-resolution FTRC data to be used in conjunction with our toolbox to advance understanding of battery degradation.
In the future, the many advantages of this technique can be further exploited by incorporating the ability to analyse data presented radially, i.e., investigating the failure mechanisms across the 'jelly-roll'. One possible feature addition to our toolbox would be to apply 'virtual unrolling' of the jelly-roll before performing Gabor filtering, 50 thereby facilitating the analysis of batteries with any form-factor, interrogated in any direction, to truly capture the complex nature of thermal runaway.

Conflicts of interest
There are no conflicts to declare.