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.

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.
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.
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