Paul FOLTZEREmbedded systems · AI
FR
All projects
Research projectCompletedApril – August 2026

3D defect segmentation in industrial CT

How much real data does it take to detect internal defects automatically? A study run from manufacturing the parts all the way to the trained model.

A four-month research internship at the University of Bradford (Smart Manufacturing lab): design and evaluate a complete pipeline for segmenting internal defects in X-ray computed tomography automatically, while working around the field's central obstacle — the scarcity of annotated industrial volumes.

A real industrial part in 3D Slicer: segmented defects in green, 3D rendering and three CT slices
One of the nine real industrial parts, opened in 3D Slicer. Top: the 3D rendering of the segmented defects — a string of pores following a ring of the part; bottom: the three CT slices with the hand-corrected ground truth, in green. This is the kind of data — scarce and expensive to annotate — on which the internship's result turns.

Non-destructive testing by computed tomography reveals porosity, cracks and inclusions without damaging the part, but automating that inspection with deep learning runs into a wall: each scan is several billion voxels, defects are rare and irregular, and manual annotation by an expert is slow, subjective and impossible to scale. The internship's question was therefore as much economic as scientific: how much real data do you actually need, and what are surrogate sources worth?

First lever: manufacture the data rather than annotate it. I wrote a parametric generator of test parts in Python (trimesh, mesh boolean operations) that carves deliberate internal defects — spheres, ellipsoids, blobs, thin cracks, clusters of pores — into simple bodies, printed at 100 % infill and then scanned on the lab's CT system. Since the part is nominally solid, every internal void is by construction a defect: ground truth then follows from the scan by simple intensity thresholding, with no CAD registration and no manual work.

From parametric model to annotated mask PHYSICAL CHAIN — MANUFACTURING THE DATA generator trimesh · cubes, cylinders 5 defect primitives 3D printing FDM · 100 % infill nominally solid part X-ray CT reconstructed volume VGStudio DERIVATION — LABELS FOR FREE thresholding two separate modes: air / material mask ground truth voxel by voxel One rule: every void inside the part's envelope is a defect. Since the part is printed solid, only the designed defects hollow out material — so ground truth reads straight off the scan. RESULT 90 annotated parts · 0 manual labels · 0 CAD ↔ scan registration
The data manufacturing chain: the parametric generator draws the defects, printing solid guarantees no other void exists, and thresholding the scan turns that physical guarantee into free annotation.

Second lever: transfer learning from medical imaging, where large public datasets exist. I calibrated the segmentation pipeline (Swin-UNETR architecture, PyTorch and MONAI) on public chest CT volumes, raising Dice from 0.33 to 0.53 through six methodological improvements validated one at a time — class-weighted cross-entropy, spatial and intensity augmentation, learning-rate scheduling at encoder unfreezing, balanced patch sampling, and a focal term.

The core of the study compares three initialisations of the same network under a strictly identical protocol: random weights, self-supervised pre-training, and self-supervised pre-training followed by medical fine-tuning. Retraining each on nested subsets of 5 to 63 parts with several random seeds yields a data-efficiency curve showing that pre-training consistently speeds up convergence, but only improves final accuracy beyond roughly twenty parts — below that, it can even be counter-productive.

Final validation used real industrial parts with genuine machining defects, scanned and hand-corrected in 3D Slicer, evaluated under leave-one-out cross-validation. This is where the result most useful to industry emerges, and it is unambiguous: a handful of real parts from the target domain beats a far larger volume of manufactured data, however carefully that data is built.

Three imaging domains, one question of data efficiency THE PROJECT'S THREE IMAGING DOMAINS SOURCE — MEDICAL 63 volumes public chest CT (Task06_Lung) abundant, annotated, documented → pre-training checkpoint SURROGATE — PRINTED 90 parts manufactured and auto-annotated designed defects, free ground truth → efficiency curve, N = 5 … 63 TARGET — REAL INDUSTRIAL 9 parts genuine machining defects masks hand-corrected (3D Slicer) → leave-one-out cross-validation pre-training transfer HEADLINE RESULT Fine-tuning on 7 real parts beats training on 63 printed ones — Dice multiplied by 1.8 to 2.1. A handful of target-domain data is worth more than nine times the volume of surrogate data. SIDE ANALYSIS — DOMAIN SIMILARITY Medical CT is closer to the real domain (Wasserstein 0.159) than the printed set is (0.402). Counter-intuitive: the odd one out is not the medical domain but the purpose-built one — printed parts are almost solid.
The project's three datasets and what they taught: the purpose-built domain turned out to be more atypical than the medical one, and a handful of real parts beat nine times as many printed ones.

Beyond the results, this internship was a lesson in method. Two bugs found mid-study could each have silently skewed the conclusions: a crash-resume mechanism that mechanically favoured random initialisation, and an over-permissive weight loader that silently discarded an entire pre-trained checkpoint while reporting success. Since then I no longer assume a component works because it says so: explicit counting of loaded tensors, and loud failure rather than silent degradation.

Key points

  • Full chain run single-handed: parametric design, 3D printing, CT acquisition, automatic annotation, training, statistical validation
  • 90 parts annotated with zero manual labelling, thanks to the ground-truth generation pipeline
  • Controlled comparison of three initialisation strategies, backed by multiple seeds and paired Wilcoxon tests
  • 13-page research paper written in English, currently under review