Case Studies · Computer Vision ·
Weld cross-section measurement with AI: 10‑20 seams in about a second
By Khadim Hussain · 2 min read
In short
Welds are checked by cutting through the part and measuring the cut face under a microscope, by hand, seam by seam. I developed the AI that does the measuring for a manufacturer's welding line: models find the weld, its measuring points and any cracks or pores, and the dimensions come out as a report. It measures 10-20 seams in about a second and cut inspection time by about 80%.
−80%
inspection time
~1 s
to measure 10-20 seams
<2%
off the reference (a human: ~5%)
- PyTorch
- YOLO
- Segmentation
- Keypoint Detection
- OpenCV
The problem
To check a weld, a lab cuts through the welded part, polishes the cut face and photographs it under a microscope. That image is a micrograph, or cross-section (Schliffbild in German). It shows what the weld looks like inside: how wide the seam is, how deep it went into the material, how the sheets are joined, and whether there are cracks or pores.
An inspector then measures each of those dimensions by hand on the image and types the values into a report. It's slow, and it isn't perfectly repeatable: on this project the customer found human readings about 5% off the reference measurement.

How it works
Several models run one after another, and then plain arithmetic turns what they found into measurements:
- Weld type. A classifier decides which kind of weld or joint is in the image, because that decides which dimensions apply.
- Regions and defects. Segmentation models outline the weld seam, the base material, and any cracks or pores.
- Measuring points. Keypoint models place the points each dimension is measured between.
- Measurements. The points and outlines become lengths in millimetres, angles in degrees and defect areas, using the image's scale.
- Report. The image comes back with every point and outline drawn on it, plus a measurement table for the pass/fail decision. Because the points are drawn, an inspector can see where each number came from.

Results
| Result | Value | Measured by |
|---|---|---|
| Inspection time | down about 80% | me |
| Time to measure 10-20 seams | about 1 second | the customer |
| Deviation from the reference measurement | under 2% (a human: about 5%) | the customer's own checks |
| Accuracy in series use | 99% | the customer |
The system's readings land closer to the reference than a person's, it takes about a second, and the inspector checks a marked-up report instead of measuring every seam.
My role
I was the machine learning engineer on the project and developed the AI behind it: the models for weld type, regions, defects and measuring points, and the step that turns their output into measurements.
Is this a fit for your lab?
If your lab still measures micrographs by hand, whether welds, coatings or other joints, the first question is whether the images and reference measurements you already have are enough to train on. That's what the free 15-minute intro call is for. For inspection work more broadly, see defect detection consulting.
Next
Related
Defect detection consultant: AI visual inspection with RF-DETR and YOLO
Defect detection consultant for AI visual inspection: I review your images, train RF-DETR or YOLO models and test them on your line's hardware.
Computer Vision · · 8 min read
TensorRT INT8 vs FP16 on RF-DETR: why INT8 and distillation didn't pay off
A calibrated TensorRT INT8 build of RF-DETR put 0 layers in INT8 on an RTX 5090. Measured INT8, FP16, CPU quantization and distillation side by side.
Generative AI · · 7 min read
Kiffusion and SpaceVision: a FLUX LoRA training dataset and space LoRAs
How I built a FLUX LoRA training dataset of 1,964 space images, captioned with JoyCaption, and trained LoRAs for FLUX.2-klein (9B) and Kolors.
Frequently asked questions
What is a weld micrograph?
A photo of a polished cut through a weld, taken under a microscope; in German, a Schliffbild. Labs use it to measure how wide and deep the seam is and to find cracks and pores.
Can AI measure a weld cross-section as accurately as an inspector?
On this project it came closer to the reference than a person: the customer found the AI's readings within 2% of the reference measurement, where a human inspector was about 5% off.
How fast is AI weld cross-section measurement?
On this project, about a second to measure 10-20 weld seams, and the report is built from those measurements.
Want a second pair of eyes on this?
Book a 15-minute intro call. Bring the problem, and you leave with a concrete next step.