A tomographic workflow to enable deep learning for X-ray based foreign object detection

Mathé T. Zeegers, Tristan van Leeuwen, Daniël Maria Pelt, Sophia Bethany Coban, Robert van Liere, Kees Joost Batenburg

Introduction

In industrial quality control, such as food processing or manufacturing, detecting foreign objects—like glass shards or bone splinters—is a critical safety requirement. X-ray imaging is the standard tool for this task due to its speed and non-invasive nature. However, traditional 2D X-ray inspection faces a significant challenge: "superposition." In a 2D projection, different materials overlap, making it difficult for automated algorithms to distinguish a foreign object from the product itself.

While deep learning models, particularly Convolutional Neural Networks (CNNs), offer a promising solution, they require vast amounts of labeled training data. Manually annotating thousands of noisy, blurry 2D X-ray images is labor-intensive, subjective, and prone to error. This paper presents a tomographic workflow that automates the generation of high-quality training datasets, effectively bypassing the manual labeling bottleneck.

The Tomographic Workflow

The core of the proposed method is leveraging the dimensionality advantage of 3D Computed Tomography (CT). While segmenting a foreign object in a 2D radiograph is difficult, it is often straightforward in a 3D reconstruction where material densities are spatially separated.

The proposed tomographic workflow for generating automated training data.

The workflow consists of five key stages:

  1. Scanning: A small set of representative samples (e.g., product containing foreign objects) is CT-scanned.
  2. 3D Reconstruction: A high-quality 3D volume is created using algorithms like the Simultaneous Iterative Reconstruction Technique (SIRT).
  3. 3D Segmentation: A simple global threshold (e.g., Otsu’s method) is applied to the 3D volume to isolate the foreign object.
  4. Virtual Projection: The resulting 3D mask is mathematically projected back onto a 2D plane at the same angles used in the original scan. This produces "perfect" 2D ground truth labels for every raw radiograph.
  5. Training: These automatically labeled images are used to train segmentation networks such as U-Net or Mixed-Scale Dense (MSD) networks.

Experimental Datasets

To validate the workflow, the researchers utilized both laboratory and simulated datasets. The laboratory dataset consisted of 111 objects made of modeling clay (Play-Doh) containing small stones as foreign objects. A collection of 131 such CT datasets has been released publicly on Zenodo.

Visualization of the laboratory dataset: (a) 2D radiograph with a stone highlighted, (b) 3D volume slices, and (c) a single 2D slice showing the stone clearly.

Additionally, a simulated dataset of 500 objects (cubes with internal ellipsoids) was generated to test the method's scalability and accuracy against an absolute ground truth.

Key Insights and Results

The study demonstrates that moving the labeling task from 2D to 3D provides several advantages:

  • Label Multiplication: A single 3D scan can generate hundreds of labeled 2D training images, providing the view diversity necessary for robust neural network training.
  • Efficiency: Scanning fewer than 10 representative objects was often sufficient to achieve high detection performance. The workflow can generate 1,800 labeled images per object, a task that would take human annotators weeks.
  • Accuracy: Models trained via this workflow consistently outperformed those trained with manual 2D annotations. In simulations, the workflow achieved a Jaccard index of 0.961, indicating extremely high overlap with the true object locations.
  • Robustness: The process is relatively insensitive to the exact threshold used in 3D segmentation, making the automation reliable without extensive fine-tuning.

Conclusion and Future Work

The tomographic shortcut effectively addresses the data bottleneck in X-ray inspection. While some 2D projections remain inherently ambiguous due to occlusion, the automated labels provide the best possible training signal. Future research could extend this workflow to spectral (multi-energy) X-ray imaging for even better material discrimination or explore dynamic CT for moving objects on production lines.

Summary updated

Abstract

Highlights•A tomographic workflow is proposed for deep learning based foreign object detection.•The workflow efficiently generates large annotated X-ray data required for training.•Real objects are scanned and 2D ground truth is generated with 3D CT reconstructions.•Results with trained networks show high detection accuracy with few training objects.•The workflow holds potential for applied industrial foreign object detection.
BibTeX
@article{zeegers2022tomographic,
  author = {Mathé T. Zeegers and Tristan van Leeuwen and Daniël Maria Pelt and Sophia Bethany Coban and Robert van Liere and Kees Joost Batenburg},
  title = {{A tomographic workflow to enable deep learning for X-ray based foreign object detection}},
  journal = {Expert Systems with Applications},
  year = {2022},
  doi = {10.1016/j.eswa.2022.117768},
}
Figure