ApplicationsGuide

Classify irregular objects by appearance reliably

Classify irregular objects by appearance using controlled capture, endpoint measurements, learned models and independent tests with clear error limits.

LumaSpec Vision11 min read Share on LinkedIn

On this page 10 sections
  1. 01Define the decision before choosing an algorithm
  2. 02Make the feature visible and repeatable
  3. 03Size the image around the smallest useful feature
  4. 04Compare local measurements with learned classification
  5. 05Split physical objects, not just image files
  6. 06Report errors and review rates separately
  7. 07Diagnose failures before adding more training data
  8. 08Check hardware and timing before ordering
  9. 09Know when a classifier is the wrong answer
  10. 10Questions

An irregular object can vary in length, thickness and texture while still belonging to the same inspection class. When the deciding feature is a small projection or a different end profile, whole-object texture measurements can follow the wrong variation. A learned classifier can make the same mistake if the images contain misleading background or pose differences.

For inspection designers, the useful starting point is not a particular algorithm. It is a capture arrangement that exposes the feature, followed by a fair comparison of measurement-based and learned methods. The following workflow connects optical sampling, dataset design and acceptance testing.

Define the decision before choosing an algorithm

Write the classification rule in terms of the physical feature. For example: accept objects with an intact terminal projection, reject objects without it, and route ambiguous views for review. Define how broken projections, attached fragments and hidden ends should be labeled.

Separate three questions:

  • Visibility: does the image show the distinguishing feature?
  • Classification: can the available appearance separate the classes?
  • Disposition: what should happen when the image cannot support a reliable decision?

A classifier cannot establish that a feature is absent when the feature could be hidden underneath the object. That condition requires another view, controlled presentation or an uncertain outcome.

Specify error limits separately. Accepting an object with a missing feature may have a different consequence from rejecting an acceptable object. Also specify the maximum review rate; otherwise, a system can appear accurate by refusing difficult decisions.

For the broader choice between algorithm families, use the comparison of AI and rule-based inspection. Here, the deciding issue is whether a subtle local feature remains separable across genuine shape variation.

Make the feature visible and repeatable

Start with singulated objects against a consistent background. Keep both ends inside the image, with margin for placement variation. Overlapping objects should produce an invalid inspection rather than an assumed class.

Use the area scan cameras category to compare acquisition options, and the camera finder to narrow the interface, shutter and sensor requirements. For moving objects, a global shutter avoids the row-dependent geometric skew associated with rolling acquisition. Exposure duration still determines motion blur.

The MV-CU020-90GC is a global-shutter, C-mount camera candidate. Confirm its full acquisition specifications against the required inspection timing before selecting it.

Area scan camerasHikrobot MV-CU020-90GC 2.5 MP Area Scan Camera, GigE, GMAX4002, ColorMV-CU020-90GC
Sensor format
1/1.7"
Lens mount
C-mount
Interface
GigE
Resolution
Up to 3 MP
$309.00View partBuild a system with it

Test illumination according to the evidence you need:

Evidence needed Initial lighting approach Main limitation to test
Outer contour or projection Strong object-to-background contrast Internal surface details may disappear
End texture or shallow surface change Broad, diffuse illumination Small relief features may lose contrast
Raised edge or local relief Directional illumination from an angle Shadows can change with object rotation
Mixed contour and surface evidence Separate controlled lighting conditions Extra images increase timing and validation work

The lighting-angle guide explains why surface detail and silhouette often require different arrangements. Adjust the geometry before adding software enhancement.

Lock exposure, gain and illumination during the first comparison. If automatic controls are needed later, validate their complete operating range. Avoid creating a dataset where one class is consistently brighter than the other.

Size the image around the smallest useful feature

Select sampling from the distinguishing feature, not from the overall object size. A large object can still require fine sampling when its class depends on a small terminal detail.

For an illustrative setup, assume a horizontal field of view of 120 mm and a smallest relevant feature of 0.8 mm. Start by allocating 8 pixels across that feature. This is a planning target, not a guaranteed classification threshold.

Required horizontal pixels = field width × target feature pixels / feature width Required horizontal pixels = 120 × 8 / 0.8 = 1200 pixels Object sampling = field width / horizontal pixels For a hypothetical 1600-pixel image: Object sampling = 120 / 1600 = 0.075 mm/pixel Feature coverage = 0.8 / 0.075 ≈ 10.7 pixels
Camera resolution for the smallest feature
Units
Pixels needed
–
Sensor size
– MP
Smallest sensor that fits
–
Pixel on the part
– mm
Pixels across the feature, that sensor
–

Pixels needed = field / feature × pixels per feature on each axis (field incl. margin). The lens must resolve the pixels too: Nyquist = 1000 / (2 × pixel µm) lp/mm.

Find cameras with enough pixels Open the full calculator

The object-space sampling guide explains how magnification connects sensor pixels to physical detail.

How sensor width, working distance and field of view set the focal length Rays from the edges of the sensor pass through the lens and spread to the edges of the field of view. The ratio of sensor width to field of view is the magnification m.CameraField of view (FOV)Working distance (WD)≈ fsensor width slensm = s / FOVf = WD × m / (1 + m)
How sensor width, working distance and field of view set the focal length. Rays from the edges of the sensor pass through the lens and spread to the edges of the field of view. The ratio of sensor width to field of view is the magnification m.

Now check what preprocessing does. Resizing the entire hypothetical image to 224 pixels across reduces the feature to approximately 0.8 × 224 / 120 = 1.5 pixels. A classifier cannot reliably recover detail discarded during resizing. Cropping a 24 mm endpoint region before resizing gives approximately 0.8 × 224 / 24 = 7.5 pixels across the feature.

Keep the original image available for review. If you resize or rotate crops, follow the resampling and antialiasing guidance.

The LS-FFL-0567 is a C-mount lens candidate. Check image-circle coverage, working distance, field of view and resolved detail before treating it as a suitable pairing.

Machine vision lenses16 mm, 1.1", 20 MP, C-mount machine vision lens, F2.8-22, <0.3% distortion (LS-FFL-0567)LS-FFL-0567
Type
Machine vision fixed
Sensor format
1.1"
Mount
C-mount
Resolution
16-25 MP
$679.00View partBuild a system with it

For moving inspection, estimate the exposure ceiling as well. At 200 mm/s and 0.075 mm/pixel, limiting blur to approximately 1 pixel gives 0.075 / 200 = 0.000375 s, or 0.375 ms. This illustrative limit must be checked against actual feature contrast and illumination.

Compare local measurements with learned classification

Build a simple measurement baseline before training a larger model. Its purpose is to reveal whether the image already contains an explainable separation between classes.

First segment the object, estimate its main axis and locate both ends. Extract endpoint regions using a consistent rule. When orientation does not identify the relevant end, inspect both rather than assigning meaning arbitrarily to the left side.

Possible measurements include endpoint width profiles, protrusion length, local curvature and the area outside a fitted body envelope. Normalize selected measurements by body width or length when that removes irrelevant size variation.

Normalization is not automatically beneficial. A long attachment can distort the estimated axis or body length. A broad, acceptable object may also resemble a narrow object with a missing projection. Examine the distributions rather than selecting a threshold from a few attractive examples.

Method Choose it when Warning sign
Shape measurements The feature has a stable geometric definition Class distributions overlap after pose correction
Learned endpoint classifier Local texture and shape jointly define the class Predictions follow background or acquisition batch
Hybrid inspection Visibility checks are simple but classification is variable The preliminary crop excludes valid unusual shapes

A useful hybrid first checks object count, clipping, focus and endpoint visibility. It then classifies local crops and routes uncertain cases for review. Keep the whole-object view as context when local crops can confuse harmless attachments with the actual terminal feature.

Train measurement thresholds and learned models on the same development objects. Compare them on the same untouched test objects, using identical handling of invalid images. A model should earn its additional complexity through better measured performance or simpler maintenance.

Split physical objects, not just image files

Different images of the same object are not independent examples. If one pose enters training and another enters testing, the reported performance can overstate generalization.

Assign every physical object an identifier. Keep all its views, repeated captures and derived crops in the same partition. Where production variation matters, also separate acquisition sessions, material batches or collection dates.

As an illustrative allocation, 1,800 distinct objects could be divided into:

  • 1,080 training objects: 60% for fitting parameters or model weights.
  • 360 validation objects: 20% for choosing thresholds, crops and model settings.
  • 360 test objects: 20% reserved for final acceptance assessment.

Those proportions are convenient, not mandatory. The test population must contain enough objects from each class and relevant operating condition. A larger total cannot compensate for missing difficult variants.

Include short, long, thin and broad objects; intact and damaged ends; attached fragments; orientation changes; and permitted placement variation. Have ambiguous labels resolved against a written physical definition. Do not silently remove hard examples to improve the score.

The capture and validation workflow for variable-shape classification provides related guidance on representative examples and independent evaluation.

Apply augmentation only within the training partition. Rotations, brightness changes and crops should represent plausible production conditions without removing or inventing the class-defining feature. Synthetic transformations do not replace real variation in physical shape.

Report errors and review rates separately

Define which class is acceptable before naming false acceptance and false rejection. In this example, an intact terminal feature is required for acceptance.

Suppose an independent test contains 180 objects from each class:

Actual condition Predicted intact Predicted missing Sent for review
Feature intact 170 4 6
Feature missing 8 168 4

The system makes 350 automatic decisions and sends 10 objects for review. Of the automatic decisions, 338 are correct and 12 are wrong.

Automatic decision accuracy = 338 / 350 ≈ 96.6% Review rate = 10 / 360 ≈ 2.8% False acceptance per actually missing object = 8 / 180 ≈ 4.4% False rejection per actually intact object = 4 / 180 ≈ 2.2%

Do not report only automatic decision accuracy. State all denominators and explain how reviewed objects are ultimately handled. If reviewed objects are discarded, they contribute to operational losses even though they are not classification mistakes.

Choose decision thresholds on validation data, then freeze them before testing. A learned score is not necessarily a calibrated probability. Establish the review band through observed error behavior rather than interpreting a score as certainty.

Small tests also have large uncertainty. With zero failures in 300 independent, representative trials, the approximate one-sided 95% upper failure-rate bound is 3 / 300 = 1%. Zero observed errors therefore does not establish perfect classification, and the estimate does not cover unrepresented conditions.

After reviewing test failures, any resulting design change needs another independent acceptance set. Repeatedly tuning against the same test objects turns them into development data.

Diagnose failures before adding more training data

Group failures by cause: hidden endpoint, clipped object, segmentation error, blur, glare, unusual valid shape, ambiguous label or genuine class overlap. The appropriate fix depends on the category.

For each group, compare the raw image, object mask, endpoint crop and final decision. Save the acquisition settings and software version alongside them. This distinguishes capture changes from model changes.

If broad objects fail because the crop is misplaced, repair localization. If a terminal projection disappears in shadow, change illumination or pose. If correctly captured examples still overlap in the selected measurements, test learned local features or a different representation.

When adding training examples, include both the newly discovered hard cases and representative earlier cases. Retraining can move decision boundaries and worsen previously acceptable behavior. Re-run the complete regression set rather than checking only the latest failures.

Use a fixed benchmark to compare revisions, but maintain a separate untouched acceptance collection. Track performance by class and failure category so that a better overall score cannot conceal a worse critical error.

Check hardware and timing before ordering

Treat the featured parts as evaluation candidates, not a validated system bill of materials. The optical and mechanical arrangement must be checked together.

The LS-BAR-1276 is a diffused bar light candidate for testing broad surface illumination. Verify contrast on representative objects rather than choosing from the light's physical size alone.

Bar lightsBar light, 372 x 28 mm, White (LS-BAR-1276)LS-BAR-1276
Size
200-400 mm
Type
Diffused
Voltage
24 V
$439.00View partBuild a system with it

Compare arrangements in the bar lights category and the lighting finder. A single bar may create asymmetric shadows; opposing illumination may help, but can also flatten the relief you need to inspect.

Before ordering, confirm:

  • The lens options cover the sensor and focus over the required placement range.
  • The lens finder candidates provide enough resolved detail at the intended aperture.
  • Both endpoints remain visible at every allowed object position.
  • Exposure freezes motion without losing useful contrast.
  • Triggering, acquisition, preprocessing, classification and output fit the timing budget.
  • Every uncertain or invalid inspection has an explicit destination.

For example, a station presenting 5 objects/s has an average interval of 1 / 5 = 0.2 s, or 200 ms. Average throughput alone is insufficient: measure worst-case latency and bursts, especially when multiple images are required.

Know when a classifier is the wrong answer

A second view or controlled rotation is preferable when the defining feature is frequently hidden. Another sensing method may be necessary when the classes differ internally but have indistinguishable visible surfaces.

Likewise, whole-object classification may be insufficient when the required output includes feature location, damage extent or multiple defects. Detection, segmentation or explicit measurement can provide more useful evidence for those tasks.

Use this release checklist:

  • The physical class definition is clear enough for consistent labeling.
  • Image sampling preserves the smallest deciding feature after preprocessing.
  • Physical objects and related captures stay within their assigned dataset partition.
  • False acceptance, false rejection and review rates meet separate agreed limits.
  • Difficult variants and permitted pose changes are represented in independent testing.
  • Software revisions and retraining pass the established regression procedure.

Start with capture trials and an explainable baseline, then add learned classification where the evidence supports it. Use the camera-led configurator to assemble an evaluation setup, or contact the applications team with representative images, feature dimensions, pose limits and acceptance criteria.

Questions

Do irregular objects always need deep learning?

Use deep learning when representative images show useful local differences that simple measurements cannot separate reliably. First verify feature visibility, sampling and crop placement. If a stable geometric rule separates the classes, a measurement-based method may be easier to explain, validate and maintain.

How many objects are needed to validate the classifier?

There is no universal sample count. You need coverage of both classes, permitted poses, shape variation and acquisition conditions. Reserve independent physical objects for testing, and size that test against the error rate you need to demonstrate rather than relying on a small perfect score.

Should the classifier inspect the whole object or just its ends?

A small endpoint feature can disappear when the entire object image is reduced to the model input size. Endpoint crops preserve more detail, provided localization is reliable. Retain whole-object context when an isolated crop could confuse an attachment with the actual class-defining feature.

What should happen when the terminal feature is hidden?

Check whether the missing evidence comes from pose, overlap or clipping. Use another view or controlled presentation when practical. Otherwise, report an uncertain inspection and route the object according to an agreed review policy instead of interpreting an invisible feature as absent.

Can a high accuracy score prove production readiness?

Only under a carefully controlled comparison. Reusing the same physical objects across training and testing, tuning thresholds on test images, or omitting review cases can inflate accuracy. Report class-specific errors and review frequency on an independent population that represents actual operating conditions.