LINGBANG · VisionAgent Snap-Button Patch Inspection · Few-shot Segmentation · ~6 min read 中文
FIELD DEPLOYMENT RECORD

Snap-Button Patch
Appearance Inspection

An oval nonwoven patch with two metal snap buttons — edge flash, wrinkles and lift, tears and holes, soiling and discolouration all have to be pulled per piece before discharge. Many pieces in one frame are judged at once, the defect mask labels each piece separately, and good ones are not over-rejected.

Flash / burr Wrinkle / lift Tear / hole Soil / discolour Multi-piece frame
Snap-button patch defect segmentation mask
On-site capture
Snap-button patch · AI defect segmentation · multi-defect labelling

Snap-button patch inspection is hard not because photographing one patch is hard, but because in a multi-piece-per-frame stream every flash, wrinkle, tear and soil has to be caught reliably — the two snaps set complete and square, the substrate undamaged: good ones not over-rejected, NG ones not let through.

This article is based on the real segmentation renders from the Qunyi Technology snap-button patch inspection, laid out as target → defect families → imaging & lighting → operator chain / judgment / parameter dictionary → live dashboard. The mask colour matches the field: orange marks the defect region (flash / tear / wrinkle), each labelled “defect”. UI screenshots are drawn to the product's real controls and wording.

01

The target: which faces of a patch matter

The target is an oval nonwoven patch with two metal snap buttons riveted on. The difficulty: the substrate is textured, matte, and the same colour as the defects — flash and tears are often the same material stacked or missing, hard to separate by grey threshold; plus the snaps reflect and many pieces enter the field together. The system uses semantic segmentation masks to carve the defect region out of the fabric — not just draw a box — so flash direction and a tear's hole shape become measurable.

Orange · defect region (flash / tear / wrinkle) Dark ring · metal snap button
Snap-button patch multiple defects

▲ Defect: one piece, several “defect” regions — orange outlines flash and tear

Good snap-button patch

▲ Good: flat substrate, both snaps complete and square, no mask

02

Defect families: five NG classes to pull out

From field samples and segmentation results, patch appearance NGs fall into five families, each mapping one-to-one to the defect dictionary later:

D1Flash / burr
D2Wrinkle / lift
D3Tear / hole
D4Soil / discolour
D5Snap missing / off-position
Edge flash burr

▲ D1 flash / burr: orange outlines substrate spilling over the edge

Side flash on patch

▲ D1 flash: a large overflow on the side, labelled “defect”

Tear hole multi-piece

▲ D3 tear / hole: black holes visible inside the top-left piece's mask

Same-colour defects are hardest; multi-piece frames need per-piece counting

Flash and tears are often the same colour and weave as the substrate, so a plain threshold can't separate them; and a single frame often carries good and defective pieces together, so you must first isolate each piece, then segment defects per piece — otherwise good and bad get counted as one.

03

Imaging & lighting: ring diffuse + dark-field background

To separate a same-colour defect from the weave, light is key. The solution uses one imaging station:

Ring diffuse
Even, shadow-free light suppresses the snaps' strong specular so the weave texture and the height / boundary of flash and tears stand out.
Dark-field bg
A dark carrier tray silhouettes each patch outline, making per-piece localisation quick in a multi-piece frame.
Sampling spec
Fix the light shape, exposure and magnification first, then talk about the model — many pieces per field: localise first, segment per piece after.
Multi-piece imaging

▲ Multi-piece frame: good and defective pieces mixed in one field

Multi-piece good and defective

▲ Multi-piece frame: most good, a few labelled “defect”

Fix the light first, then the model — solve same-colour defects with lighting and dark-field silhouette, not by force-tuning thresholds.
04

Workflow: multi-object + few-shot segmentation chain

FLOW

Drag-and-drop the inspection chain

Operator library · no-code

Create the project “Snap-button patch inspection”, drag operators from the left library and connect them (matching the real canvas):

Industrial camera→ Preprocessing→ Multi-piece localise→ Few-shot segmentation→ Grading
Camera
Ring light + dark field capture, covering a multi-piece field; multi-channel trigger supported.
Preprocessing
Suppress glare, flatten and enhance to stabilise the low-contrast weave of the matte substrate.
Localise
Isolate each patch in the field first, then feed each into segmentation.
Few-shot seg.
A few labelled samples segment flash / wrinkle / tear / soil, replacing per-class tuning of traditional AOI.
Grading
Take the strictest across defects per piece, output OK / NG and NG type, driving the sort.
VisionAgent · Tensor-flow canvas — Snap-button patch inspection5 operators linked
OPERATORS
Industrial camera
Preprocessing
Multi-piece localise
Few-shot segmentation
Grading
Data archive
CAM
Cameraring/dark
→
PRE
Preprocessde-glare
→
LOC
Localiseper piece
→
SEG
Few-shot seg.flash/tear
→
JDG
GradingOK / NG

▲ Tensor-flow canvas: camera → preprocess → multi-piece localise → few-shot segmentation → grading (real UI style)

Process engineers can read the flow; adding a new defect class only needs more samples, not new code.
05

Judgment: turning masks into defect events

EVENT

Turn “edge flash” into a standard judgment

Primitives · area threshold

Open the “GPU event orchestrator”; the top reads “Configuring defect: flash / burr”. Drag in the primitive “region area > threshold”:

  • The defect list on the right: D1 flash/burr, D2 wrinkle/lift, D3 tear/hole, D4 soil/discolour, D5 snap missing/off-position… unconfigured ones read “pending”;
  • Tears use a “holes-in-mask count / area” primitive; snap faults use an “object presence + position constraint” primitive, checking both snaps' presence and spacing;
  • Each class binds an area / count / position threshold; crossing it fires the matching NG and drives the sort.
GPU event orchestrator — Configuring defect: flash / burrPrimitive · region area
PRIMITIVES
region area > th.
hole count / area
presence + position
grey / colour diff
count = N
DEFECT JUDGMENT LIST
D1Flash / burrconfiguring…
D2Wrinkle / liftconfigured
D3Tear / holeconfigured
D4Soil / discolourconfigured
D5Snap missing / off-positionpending

▲ GPU event orchestrator: configuring “flash / burr” = primitive “region area > threshold” (real UI style)

Thresholds decouple from perception — tighten or loosen grading by tuning thresholds, no retraining.
06

Camera & page parameters

PARAMS

Defect dictionary / display parameters

Parameters · page params

Open “Parameters” and switch to the page parameters tab. The left “defect statistics” align with the defect families for per-batch NG reporting:

  • Columns: defect type (NG0…NG4), defect name (flash/burr, wrinkle/lift, tear/hole, soil/discolour, snap fault), count;
  • “Add / remove defect type” is supported; edit name and threshold on the right, click “Save parameters” to apply;
  • Result display: mask overlay on, defect name on, font size 40, line width 2 — matching the field mask look;
  • On the camera side, the “Industrial camera” node configures channel, exposure and ROI so a multi-piece frame is fully framed.
Parameters · page parametersSave parameters
TypeDefect nameCount
NG0Flash / burr4
NG1Wrinkle / lift1
NG2Tear / hole2
NG3Soil / discolour1
NG4Snap fault0
Mask overlay
Show defect name
Font size40
Line width2
Camera channelCH1 · ring light
ROIMulti-piece

▲ Parameters · page params: defect dictionary and display settings (real UI style)

Defect name, NG code, threshold and overlay are set once; the live dashboard and batch report share one dictionary.
07

Live run: per-piece grading of a multi-piece frame

RUN

Monitoring and verdict on one screen

Edge runtime
  • Left: live view + segmentation mask, each piece in the frame isolated and defect-labelled;
  • Right: a five-class defect checklist — flash/burr, wrinkle/lift, tear/hole, soil/discolour, snap fault; hits marked red;
  • Verdict: any piece, any class over threshold → NG, counted by class and sort driven; only a full miss lets a piece pass.
Live monitor — Camera 01 · Snap-button patch stationEdge running
Live monitoring view
Live · multi-piece frame
!D1Flash / burr · hit
!D3Tear / hole · hit
✓D2Wrinkle / lift · miss
✓D4Soil / discolour · miss
✓D5Snap fault · miss
5 pieces in frame · 1 NG (D1 flash + D3 tear) → sort out

▲ Live monitor: multi-piece live segmentation on the left, five-class verdict on the right

Configuration, recognition, per-piece grading and sort verdict live on one screen; the line can be accepted the same day.
08

Comparison table & takeaways

AspectManual sorting / traditional AOIVisionAgent snap-patch inspection
DefectsVisual check under lamp, same-colour defects missedFew-shot segmentation outlines flash / tear / wrinkle live
Multi-pieceGood vs bad told apart by eye in one frameLocalise per piece first, then segment & grade each
StandardBy the master's experience, person to personArea / hole / position thresholds grade uniformly
ChangeoverTraditional AOI retunes per classJust add a few samples; thresholds decouple from perception
RecordsPaper spot-checks filled in laterPer-piece result and defect type auto-logged into reports

Four questions run throughout: what the system looks at, what counts as good, when to reject, and how results reach the report.

Closing note

Snap-button patch inspection is hard not because of photographing one patch, but because of chaining capture → multi-piece localisation → few-shot segmentation → defect metrics → grading & sort → batch logging into a link the floor is willing to use and quality can re-audit.

In one line: lighting decides whether a same-colour defect can be seen, multi-piece localisation decides whether good and bad can be told apart in one frame, few-shot segmentation decides whether it can be recognised — no-code turns patch sorting from “eyeballing” into “system grading, piece by piece”.
b
blue
PhD in computer vision · VisionAgent solutions and delivery

Works on few-shot segmentation and industrial scene understanding; argues for moving appearance QC from “one long training run per defect” to “few-shot segmentation + event composition + state-machine aggregation”, so thresholds decouple from perception and a grade change needs no retraining.

Currently focused on edge GPU inference, cross-domain generalisation and closing the data loop on site. This piece records the family grouping, sampling derivation and platform configuration path behind a battery tab inspection plan.