Analysis Workflows for XCT Data

Author: Matthew Peter Jones

Summary

X-ray computed tomography (XCT) enables non-destructive, 3D visualization of lithium-ion (Li-ion) battery components and microstructure. At the cell level, XCT is especially useful for detecting manufacturing and quality issues in Li-ion cells [8]. However, turning XCT images into quantitative and reproducible quality assurance (QA) requires custom analysis pipelines that are rarely shared openly.

This submission provides a set of open Jupyter notebooks and machine learning (ML) models that demonstrate analysis workflows for battery XCT data. In version 1.0.3 the workflows target three critical QA tasks relevant to Li-ion cylindrical cells with the fourth notebook demonstrating relevant image segmentation approaches:

  1. Quantifying electrode overhang using multiple geometric measures;
  2. Measuring the canister (e.g., diameter, eccentricity) and detecting dents via ellipse fitting;
  3. Transforming 2D slices of the electrode winding into polar coordinates [6] and fitting an ideal spiral to quantify deviations from the expected winding pattern [7]; and
  4. Example segmentations using ML and classic computer vision (CV) approaches to segment electrode winding and overhangs (an open-source segmentation model is made available alongside this notebook).

Each workflow is implemented as a Jupyter notebook [9] and bundled with example data (images and, where appropriate, segmentation masks) so it can be run without specialized preprocessing. The workflows are written in Python and built on widely used scientific and machine-learning libraries, including NumPy [1], SciPy [2], scikit-image [3], Matplotlib [4], scikit-learn [5], OpenCV [12], TensorFlow [13], and Keras [14]. For ease of access, all notebooks can be launched directly in the browser via Binder [11], requiring no local installation.

All materials are archived with a Zenodo DOI to ensure long-term accessibility [10]. We hope to extend this offering in future versions to include further ML models for segmentation and denoising tasks, additional cell formats (pouch, prismatic), and further QA workflows, such as uncertainty reporting and demonstrating integration into larger data processing pipelines.

Statement of need

Although XCT is increasingly used to visualize battery structures and assess manufacturing quality, reproducible analysis workflows remain scarce. New users often stop at qualitative inspection, and many depend on proprietary software with limited documentation and availability. This fragmentation complicates comparisons across studies and slows the adoption of best practices.

This contribution meets this need as a set of open and reproducible analysis workflows rather than a standalone software library. Because XCT analysis typically involves iterative exploration, visualization, and interpretation, Jupyter notebooks are a natural format: they combine executable code, results, and narrative explanation in one place [9]. By sharing these notebooks, we aim to make quantitative XCT analysis easier to understand, adapt, and extend in both battery research and commercial environments. By lowering the barrier to quantitative XCT analysis, these notebooks promote transparent, reproducible practice in battery science and provide adaptable templates for researchers, battery engineers, and quality specialists.

Software Description

The battery_xct_workflows repository is organised around executable Jupyter notebooks rather than a standalone library. The top-level notebooks/ directory contains analysis workflows for Li-ion battery QA (overhangs, canister geometry, winding unrolling, and example segmentations), each bundled with small example datasets so they can be executed end-to-end (and on binder). Reusable image-processing and utility functions are collected in utils/, while ML-specific code lives under models/. For the current release, the segmentation model example is implemented in models/overhangs_mini_unet/, which provides data generators and a U-Net + ResNet model builder.

Large artefacts (trained network weights and full-resolution 3D image volumes) are not stored in the GitHub repository but are archived on Zenodo and referenced from the code and notebooks via DOIs. Each model directory includes a README describing its purpose, links to the corresponding Zenodo record, and instructions for reproducing or fine-tuning the model using the training scripts provided alongside the notebooks.

Testing is split between unit-style tests for the model code and integration tests for the notebooks. Lightweight Python tests under models/tests/ verify that data generators, model-building functions, and saved models have consistent interfaces (for example, checking tensor shapes, value ranges, and basic forward passes). These tests are run automatically via GitHub Actions on pushes and pull requests. A separate scheduled GitHub Actions workflow executes the core notebooks with nbconvert once per day, acting as an integration/smoke test that the published workflows still run to completion with the current dependency set.

Contributions are encouraged in the form of improvements to existing notebooks and utilities, additional QA workflows, or new segmentation/denoising models. Prospective contributors are invited to open an issue to discuss proposed changes, and to submit pull requests that (i) follow the existing directory layout (new models under models/ and new workflows under notebooks/), (ii) include minimal example data or clear links to public datasets, and (iii) add or update tests where appropriate so that the continuous integration checks remain green.

Illustrative outputs

Figure 1. (a) Slice through a cylindrical cell tomogram with overhang masks overlayed. (b) Distribution of overhang deflection angles in the analysed cell. Overhang faults can lead to increased lithium plating and eventually short circuits.

Figure 2. By fitting an ellipse to the canister we can measure a range of quality metrics. For example, the fitted ellipse is used to calculate canister eccentricity (a proxy for canister deformation) and is also used to detect and measure dents (calculated as error with respect to the ellipse). Both deformation and denting of the canister can lead to in-use safety issues.

Figure 3. Cylindrical cell slice unrolled into polar coordinates and showing maximum absolute error (MaxAE) from a fitted spiral to detect buckling. In this case large buckles are detected in the central layers of the cell (layers 2 -4). Buckling is known to negatively effect capacity and is a known indicator of poor cell health.

Conclusion

Reliable battery QA is essential for performance, safety, and trust in Li-ion technologies, and XCT is a key tool for observing defects before they become failures [8]. However, without open, shareable analysis pipelines, XCT results are difficult to compare or reproduce across labs and products. battery_xct_workflows addresses this gap by providing examples for common cylindrical cell QA tasks performed with XCT. Example segmentation methods are also demonstrated using both ML and classic CV approaches. By packaging runnable code, data, and narrative in one place, these workflows lower the barrier to quantitative XCT analysis. We hope this resource will seed a community of practice around open battery QA, with future extensions to additional open-source ML models, cell formats (pouch cells, prismatic cells), uncertainty reporting, and integration into automated testing pipelines.

Commercial Options

There are a number of commercial solution providers in this space:

Acknowledgements

X-ray Computed Tomography Data was acquired at The UCL Centre for Correlative X-ray Microscopy who are supported by the NXCT via EPSRC grant EP/T02593X/1.

This work was carried out with funding from the Faraday Institution (faraday.ac.uk; EP/S003053/1), grant numbers, FIRG060 and FIRG066; and the EPSRC grant EP/M014045/1. H.T.R. and J.B.R. acknowledge Innovate UK and the Aerospace Technology Institute for funding through the CEBD programme (10050803). M.P.J., P.R.S. and R.J. acknowledge Innovate UK for funding via the BATSEED Project (grant number: 10044823).

ChatGPT (OpenAI) was used to assist with language editing. All software, logic, and analyses were developed by the authors, who bear full responsibility for the content.

Competing Interests

Co-authors M.D.R.K., J.B.R. and P.R.S. are affiliated with Sention Technologies Limited, a company with potential commercial interest in applications related to this study. The company was not involved in the research presented.

References

  1. Charles R. Harris, K. Jarrod Millman, Stéfan J. van der Walt, Ralf Gommers, Pauli Virtanen, David Cournapeau, Eric Wieser, Julian Taylor, Sebastian Berg, Nathaniel J. Smith, Robert Kern, Matti Picus, Stephan Hoyer, Marten H. van Kerkwijk, Matthew Brett, Allan Haldane, Jaime Fernández del Río, Mark Wiebe, Pearu Peterson, Pierre Gérard-Marchant, Kevin Sheppard, Tyler Reddy, Warren Weckesser, Hameer Abbasi, Christoph Gohlke, Travis E. Oliphant, Array programming with {NumPy}, Nature
  2. Virtanen, P., Gommers, R., Oliphant, T.E. et al. SciPy 1.0: fundamental algorithms for scientific computing in Python. Nat Methods 17, 261–272 (2020).
  3. van der Walt S, Schönberger JL, Nunez-Iglesias J, Boulogne F, Warner JD, Yager N, Gouillart E, Yu T, the scikit-image contributors. 2014. scikit-image: image processing in Python. PeerJ 2:e453
  4. Hunter, John D., Matplotlib: A 2D graphics environment, Computing in Science & Engineering, IEEE
  5. Fabian Pedregosa, Ga¨el Varoquaux, Alexandre Gramfort, Vincent Michel, Bertrand Thirion, Olivier Grisel, Mathieu Blondel, Peter Prettenhofer, Ron Weiss, Vincent Dubourg, Jake Vanderplas, Alexandre Passos, David Cournapeau, Matthieu Brucher, Matthieu Perrot and ´ Edouard Duchesnay, Scikit-learn: Machine Learning in {P}ython, Journal of Machine Learning Research, 2011
  6. Matt D. R. Kok, James B. Robinson, Julia S. Weaving, Anmol Jnawali, Martin Pham, Francesco Iacoviello, Daniel J. L. Brett and Paul R. Shearing, Virtual unrolling of spirally-wound lithium-ion cells for correlative degradation studies and predictive fault detection, Sustainable Energy & Fuels, 2019
  7. Wenjuan Sun, Xiao Chen, Pierre Kubiak, Carmen M. López, A new approach for health monitoring of cylindrical lithium-ion cells using X-ray computed tomography, Journal of Energy Storage, Volume 111, 2025
  8. Attia, P.M., Moch, E. & Herring, P.K. Challenges and opportunities for high-quality battery production at scale. Nat Commun 16, 611 (2025).
  9. Kluyver, Thomas, Ragan-Kelley, Benjamin, Pérez, Fernando, Granger, Brian, Bussonnier, Matthias, Frederic, Jonathan, Kelley, Kyle, Hamrick, Jessica, Grout, Jason, Corlay, Sylvain, Ivanov, Paul, Avila, Damián, Abdalla, Safia, Willing, Carol and Jupyter development team, (2016) Jupyter Notebooks – a publishing format for reproducible computational workflows. Loizides, Fernando and Scmidt, Birgit (eds.) In Positioning and Power in Academic Publishing: Players, Agents and Agendas. IOS Press. pp. 87-90
  10. Jones, Matthew P. and Reid, Hamish T. and Young, Robert S. and Kok, Matt D. and Iacoviello, Francesco and Shearing, Paul R. and Jervis, Rhodri. battery_xct_workflows: Open Jupyter Notebooks for Lithium-Ion Battery QA using XCT}, 2025, Zenodo, v1.0.3
  11. Project Jupyter and Bussonnier, Matthias and Forde, Jessica and Freeman, Jeremy and Granger, Brian and Head, Tim and Holdgraf, Chris and Kelley, Kyle and Nalvarte, Gladys and Osheroff, Andrew and Pacer, Meghan and Panda, Yuvi and Perez, Fernando and Ragan-Kelley, Benjamin and Willing, Carol, Binder 2.0 – Reproducible, Interactive, Sharable Environments for Science at Scale, Proceedings of the 17th Python in Science Conference, 2018
  12. Bradski, G., The OpenCV Library, Dr. Dobb’s Journal of Software Tools, 2000
  13. Mart´ ın Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Man´e, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Vi´egas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng, Large-Scale Machine Learning on Heterogeneous Systems, Whitepaper, TensorFlow
  14. Chollet, Francois and others, Keras, 2015

Leave a Comment