Surface Defect Detection on Metal and Plastic Parts with AI

By David Cook on October 26, 2026

surface-defect-detection-metal-plastic-parts-ai

A scratch a customer can see on a machined cover or a glossy moulded bezel is a defect, even when the part works perfectly. The difficulty is that the same scratch can vanish under one light and flare under another, and a textured plastic can look like a field of defects to a camera set up for polished metal. Surface defect detection works when the lighting, the resolution and the model are matched to each material and finish, and when borderline calls go to a person instead of a guess. See it on your own parts in a short surface AI demo.

AI VISION · METAL AND PLASTIC SURFACES

Find Scratches, Dents and Stains Without Rejecting Good Parts

iFactory Surface AI trains a model for each material and finish, runs every station under controlled lighting and sends borderline calls to an AI review queue. Clear defects are rejected at once. Unclear ones get a second look.

Cell 3 · Cover A12Machined Al
Dark field ring and dome · model for turned finish
Part 4817No defectPass
Part 4818Scratch, 0.4 mm wideReject
Part 4819Faint mark, low scoreReview
Review queue3 waitingShift B
Each review decision is added to the defect library
COSMETIC DEFECTS

Six Surface Defects and What Makes Each One Show

Cosmetic defects differ in how they change the light, which is why one camera setup rarely finds them all. A scratch is a narrow groove that scatters light. A dent changes the slope of the surface without breaking it. A stain changes colour or gloss but not shape. Knowing what each defect does to light is the first step in choosing how to light it. Map your own defect list with our vision support team.

01
ScratchNarrow groove that scatters low-angle light, so it shows bright in dark field
02
Dent or dingShallow change of slope, seen best by shape methods such as photometric stereo
03
PitSmall cavity, common on cast and plated faces, dark or bright by light angle
04
StainChange in colour or gloss with no depth, kept visible by even, diffuse light
05
Sink markMoulded surface drawn in over a thick section, a slope defect like a dent
06
Flow or knit lineWhere melt fronts meet or flow marks form, seen as a gloss or texture change
LIGHTING SETUP VISION

Match the Light to the Defect, Then Choose the Camera

Lighting decides contrast before the camera or the AI gets a say. Dark field puts light at shallow angles, so smooth surfaces stay dark while scratches, dents and particles show bright. A dome surrounds the part with diffuse light and calms hotspots on curved, shiny parts. Coaxial light comes down the lens axis through a beam splitter and suits flat, reflective faces. Photometric stereo takes several images from one viewpoint, each lit from a different direction. It needs at least three light directions, and four or more are used in practice. Test the options on real parts in a lighting trial.

Technique
How it lights the part
Shows best
Watch out for
Typical part
Bright field
Direct light from the front, close to the camera axis
Colour, print and high-contrast features
Glare and hotspots on shiny faces
Moulded parts with print
Dark field, low angle
Ring or bar lights at shallow angles
Scratches, nicks, raised particles, edge chips
Weak on stains and broad, shallow dents
Machined and turned faces
Diffuse dome
Even light from a hemisphere around the part
Stains and colour on curved or shiny parts
Lower contrast on very fine scratches
Plated or polished curved parts
Coaxial
Through the lens axis via a beam splitter
Marks on flat polished or machined faces
Only near-flat faces that face the lens
Seal and mating faces
Structured light
Known stripe or grid patterns projected on the part
Dents and waviness on larger surfaces
Calibration, less suited to tiny detail
Pressed and moulded housings
Photometric stereo
Three or more directional lights, one image each
Dents and scratches separated from colour and print
Moving parts need image alignment
Brushed metal, textured plastic
REFLECTIVE PARTS INSPECTION

Polarisers Tame Glare, Up to a Point

Put one polariser on the light and a second on the lens, turned at right angles, and light that keeps its polarisation when it reflects is blocked while scattered light passes. Shiny surfaces such as bare metal and paint keep much of that polarisation, so their mirror glare is cut and the diffuse light from the material shows through. On glossy plastic that can reveal stains hidden under the shine. On polished metal, nearly all the light is mirror glare, so crossed polarisers can leave a very dark image, and each filter costs light as well. Ask our optics team how your parts behave.

WHERE POLARISERS HELP
  • Glossy moulded plastic with stains or colour defects
  • Painted or coated parts with bright hotspots
  • Clear film or a window over the surface
  • Plastic parts where moulded-in stress matters
WHERE LIGHT GEOMETRY HELPS MORE
  • Bright turned or polished metal: dark field
  • Curved chrome or plated parts: dome
  • Flat machined faces: coaxial
  • Dents on shiny parts: photometric stereo
MATERIAL AND FINISH

Why the Model Is Trained per Material and Finish

Every finish has its own normal texture, and the model has to learn it before it can spot what is abnormal. Machined metal carries tool marks in one direction. Cast skin is rough and varies from part to part. Moulded plastic copies the mould finish, which is graded: SPI runs from A-1, a diamond-buffed high polish, through paper and stone grades to D-3, a coarse dry-blasted dull finish. VDI 3400 numbers rise with roughness, and those textures are mostly made by EDM. A model trained on one grade will misread another. See per-finish models in a model walkthrough.

Machined metal
Directional tool marks are normalScratches across the lay stand out. Scratches along it can hide, so light from two directions helps.
Cast metal
Rough, varied skin is normalOpen pores and pits must be told apart from the as-cast surface. Inspect cast and machined zones as separate regions.
Moulded plastic
Gloss or texture copies the mouldPolished SPI A and B parts show every scratch. Textured SPI D or VDI parts hide small ones and shift as the mould wears.

Borderline Calls Get a Second Look, Not a Guess

Surface AI rejects clear defects at the station and sends unclear ones to a review queue with the image, the score and the closest library examples. Every review decision becomes a new labelled sample.

Moulding hall · Quality engineer and iFactory
Quality engineerWhy did the review queue double on the textured bezel this week?
iFactoryMost items came from cavity 2. Its texture now reads coarser than the finish the model learned. Cavities 1, 3 and 4 look normal.
Quality engineerSo the mould changed, not the parts.
iFactoryThat is the likely cause. Cavity 2 is flagged for a texture check, and its calls stay in review until you confirm.
SURFACE INSPECTION CAMERA

Worked Example: Can One 5 MP Camera See a 0.1 mm Scratch?

A common machine vision rule says a feature needs at least two pixels across it with excellent contrast, and three to four pixels for reliable results. The example checks a 100 × 80 mm moulded cover against a spec that says scratches 0.1 mm wide must be caught. The figures are illustrative, so run your own part through the same steps with our vision engineers.

1
One view of the whole partField of view 120 × 100 mm, sensor 2,448 × 2,048 pixels
120 ÷ 2,448 = 0.049 mm per pixel
2
Smallest reliable defectFour pixels across the defect
4 × 0.049 = 0.196 mm, about 0.2 mm
3
Compare with the specScratch 0.1 mm wide must be caught
0.1 ÷ 0.049 = about 2 pixels, too few
4
Split into four viewsEach 55 × 45 mm: half the part plus 5 mm overlap
55 ÷ 2,448 = 0.0225 mm · 4 × 0.0225 = 0.09 mm
Before you order a camera

A higher-resolution sensor with one view is the other route, but the lens must resolve pixels that small. Four views mean four images per part, so check the cycle time. A fine scratch still needs dark field to give it contrast.

DEFECT LIBRARY

Boundary Samples Decide Where a Pass Ends

A defect library is more than a folder of bad parts. It holds clear passes, clear fails and, most important, boundary samples: parts right at the edge of the cosmetic standard, agreed by quality and, where needed, the customer. Train on them, test on them and use them to check that reviewers agree with each other. AIAG suggests a kappa of at least 0.75 indicates good agreement, with values near 0.90 preferred. Build your first library in a library setup session.

Clear pass
Normal finish, nothing worth noting
Boundary pass
Just inside the limit, kept as a signed reference
Boundary fail
Just outside the limit, the hardest case to teach
Clear fail
Obvious defect, quick to label
Unknown
Unlike anything in the library, sent to review
FALSE REJECTS VS ESCAPES

How the AI Review Queue Handles Borderline Calls

Every inspection makes two kinds of error. A false reject scraps or re-checks a good part, which costs yield and labour. An escape ships a defective part, which costs a complaint or a claim. Moving a single threshold only trades one error for the other. A review band between two thresholds lets clear calls run automatically while uncertain ones go to a person. Tune your bands with our quality support team.

1ScoreEach region of the part gets a defect score
2Auto passBelow the lower threshold, the part runs on
3Review bandBetween thresholds, the image joins the queue
4Auto rejectAbove the upper threshold, the gate fires
5LearnThe reviewer's call is labelled and stored
SURFACE DEFECT DETECTION FOR PLANT MANAGERS

Six Numbers That Show Whether Surface AI Is Working

Track these from the first week of shadow running so you have a baseline. Keep false rejects and escapes side by side, because improving one while hiding the other is easy. Ask for a sample weekly report in a reporting demo.

False reject rateGood parts rejected or sent to re-check, per thousand inspected
Escape rateSurface defects found later, at audit, assembly or the customer
Review shareShare of parts landing in the review band, by station
Review turnaroundMinutes from queue to decision, by shift
Boundary agreementKappa between reviewers and the model on the boundary set
Defects by finishTop defect types per material, finish and mould cavity
SURFACE DEFECT DETECTION COST AND ROI

Price Your False Rejects First

Escapes are hard to price honestly, so start with false rejects, which you can count. The worksheet uses assumed inputs to show the arithmetic only. Use your own shift counts, and our support team can help build the fuller case.

Parts inspected per shift6,000, assumed
False reject rate today1.5%, assumed
Good parts sent to re-check per shift6,000 × 0.015 = 90
Re-check time per part40 s, assumed
Re-check time per shift90 × 40 s = 3,600 s = 60 min
Each 0.5 point cut in false rejects6,000 × 0.005 × 40 s = 1,200 s = 20 min per shift

Add scrapped good parts at your own part cost. Keep escape savings out of the sum until shadow results show what the model really catches.

TURNKEY AI DEPLOYMENT

Cameras, Lighting and an NVIDIA Server Set Up for Your Finishes

iFactory delivers Surface AI as one package. Cameras and lights are chosen per station from trials on your parts, and a pre-configured NVIDIA AI server ships racked and ready with the review queue and defect library pre-loaded. You rack it, plug in power and Ethernet, and the AI is live. Price your stations in a turnkey quote call.

What's Included
  • Pre-configured NVIDIA AI server, racked and ready
  • Cameras and lighting chosen from trials on your parts
  • Models trained per material and finish
  • Defect library with signed boundary samples
  • AI review queue for borderline calls
  • PLC link to each reject gate
  • 24×7 remote monitoring of models and hardware
Live in 6–12 weeks
Wk 1–4
Trial and Build

Defects listed, lighting tried on real parts, stations and server installed.

Wk 5–8
Train and Shadow

Per-finish models run silently and are compared with inspector calls.

Wk 9–12
Release and Train

Gate switched on, review band set, reviewers and operators trained.

HOW iFACTORY FITS

Surface Defect Detection Software Built Around the Finish

Surface AI treats each material and finish as its own inspection job, which is what keeps good parts moving. Our support team can walk you through a pilot plan.

1
Trained per finish. Separate models for machined, cast and moulded surfaces, and for each mould texture.
2
Lit for the defect. Controlled lighting set up per station from trials on real parts.
3
Reviews the borderline. Uncertain calls reach a queue with the image, score and library matches.
4
Learns from reviews. Each decision becomes a labelled sample in the defect library.
1000+
Industrial clients running iFactory
99.9%
Platform uptime for production lines
6-12 wks
From racked server to live surface checks
FREQUENTLY ASKED QUESTIONS

What Quality Teams Ask About Surface Defect Detection

What surface defects can AI find on metal and plastic parts?
Scratches, dents, pits, stains, sink marks, flow lines and similar cosmetic defects, as long as the lighting gives each one contrast and the camera puts enough pixels across the smallest one. The model learns your normal finish first, so it can tell a defect from tool marks or texture. You can see it on your own parts in a short session.
Why do surface inspection systems reject so many good parts?
Usually because glare looks like a defect, the model learned a different finish, or one threshold is doing the job of two. Fix the lighting first, train per finish and use a review band for the uncertain calls instead of rejecting them all.
Which lighting works best for scratches on shiny metal?
Dark field or low-angle light is the usual start, because smooth metal stays dark while the scratch scatters light toward the camera. Light from two directions helps with directional tool marks. Coaxial suits flat faces and a dome suits curved, plated ones. Talk your parts through with our optics support team.
How small a defect can the camera see?
Divide the field of view by the sensor's pixel count to get millimetres per pixel, then multiply by three or four, the pixels a defect needs for reliable results. If the answer is larger than your spec, split the part into more views or use a higher-resolution sensor with a lens that can resolve it.
What is a boundary sample and why does it matter?
It is a part right at the edge of the cosmetic limit, agreed by quality as the line between pass and fail. Boundary samples teach the model where the limit sits and let you check that reviewers agree. We can walk through a library setup with your team.
How do we start?
Pick one station with a known false reject or escape problem, list its defects and finishes, and run a lighting trial on real parts. Then train, run in shadow against inspectors and switch on the gate. Book a 30-minute demo to plan that first station.

Catch Real Defects and Keep Good Parts Moving

Train per finish, light each station for its defects and send borderline calls to review. The full system is delivered turnkey and goes live in 6 to 12 weeks.

Example station summary · Cover A12
FinishMachined aluminium, turned
LightingDark field ring and dome
Review bandSet from boundary samples
LibraryBoundary set signed by QA
Every reject and review traceable to an image

Share This Story, Choose Your Platform!