Skip to content

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
Contents

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.

Drawing of a weld cross-section: two stacked sheets joined by a weld seam, with the seam width w, penetration depth p, sheet thicknesses t1 and t2, a pore and a crack marked
Fig. 1 · A drawing, not a real part: w seam width, p penetration depth, t1 and t2 sheet thicknesses, plus any pores and cracks inside the seam.

How it works

Several models run one after another, and then plain arithmetic turns what they found into measurements:

  1. Weld type. A classifier decides which kind of weld or joint is in the image, because that decides which dimensions apply.
  2. Regions and defects. Segmentation models outline the weld seam, the base material, and any cracks or pores.
  3. Measuring points. Keypoint models place the points each dimension is measured between.
  4. Measurements. The points and outlines become lengths in millimetres, angles in degrees and defect areas, using the image's scale.
  5. 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.
The five steps from micrograph to report: classify the weld type, segment the seam, sheets and defects, place keypoints, measure, and report
Fig. 2 · From micrograph to report. Built with PyTorch, YOLO and OpenCV.

Results

ResultValueMeasured by
Inspection timedown about 80%me
Time to measure 10-20 seamsabout 1 secondthe customer
Deviation from the reference measurementunder 2% (a human: about 5%)the customer's own checks
Accuracy in series use99%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

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.