610-459-9646
sales@sciotex.com

AI Counting and Sorting: How It Works and When to Use It

Written by Sciotex Engineering
In this article

AI counting uses cameras and trained image analysis models to find, separate and count parts or products, even when they touch, overlap or vary in shape. AI sorting adds a decision for each item, such as its size, type, grade or defect, and routes it to the right bin, lane or reject. AI is one of three ways to analyze counting images. Rule-based analysis and machine learning are often faster and simpler for consistent parts, so the best systems use AI where parts vary and simpler methods where they do not.

This article is part of our complete guide to automated counting. Here we explain how AI counting and sorting work, how AI compares with rule-based and machine learning analysis, and how to tell which your application needs.

How AI counting works

  1. Capture images: cameras image parts as they fall through a drop zone, move on a conveyor or lie on a work surface, under controlled lighting.
  2. Detect each item: a trained model finds every part in the image, including parts that touch, overlap or sit at odd angles.
  3. Separate and track: clusters are split into individual parts, and on a conveyor each part is tracked across frames so it is counted once.
  4. Count and record: the count is kept per batch, per type or per lane, and passed to packing equipment or line controls.

The model is trained on labeled images of your parts: examples of single parts, clusters, different orientations and anything that should not be counted. That training is what lets AI count parts that are hard to describe with fixed rules, such as natural products, flexible parts or cluttered scenes.

How AI sorting works

Sorting uses the same images. For each part the system decides a class, then acts on it:

  • Size and shape: length, diameter, roundness or outline, to grade parts or separate types.
  • Color and surface: to separate materials, finishes or grades.
  • Defects: chips, cracks, contamination or missing features, often where AI does best because defects vary so much.
  • Part type in a mixed stream: counting each type separately, or diverting the wrong parts.

The decision then drives an air jet, gate, diverter or robot, depending on whether parts are falling, moving on a belt or need careful placement. When sorting becomes checking parts against a quality standard, it is inspection; our guide to machine vision covers that in depth.

AI vs. rule-based vs. machine learning image analysis

Rule-basedMachine learningDeep learning AI
How it worksEngineers set measurements and limits: area, length, roundness, colorA model classifies parts from features the software measuresA neural network learns features directly from labeled images
Best forConsistent parts with clear, measurable differencesModerate variation where a few measurements separate the classesHigh natural variation, cosmetic differences, cluttered scenes
Training dataSample parts to set the limitsLabeled examples of each classMany labeled images covering the variation
SpeedVery fastFastFast at run time with suitable computing hardware
Explaining a decisionEasy: a measurement was out of limitsModerateHarder: decisions come from learned features
New part changeoverAdjust limitsRetrain on examplesRetrain on images

Not every counting job needs AI. Uniform parts such as pellets, nuts or washers are often counted fastest and most reliably with rule-based measurements. AI earns its place when parts vary, overlap in complex ways or need judgment that rules cannot capture. Sciotex selects the approach, or a mix of them, for each application rather than defaulting to one.

Worked example: when rules are enough

A rule-based counter knows that one part covers about 120 pixels in the image. Two or more parts fall together and appear as one shape of 365 pixels. 365 ÷ 120 = 3.04, so the software counts the shape as 3 parts. For uniform parts this simple method is fast and accurate. When parts vary in size, nest inside one another or overlap unpredictably, an AI model trained on images of real clusters separates them more reliably.

Where AI counting and sorting is used

PresentationHow it worksTypical useSciotex system
Drop zone (gravity)Parts fall past cameras that image them from two anglesCounting small loose parts into batchesPerfectCount
ConveyorA camera images and tracks items on a moving beltInline counting and sorting, single or mixed itemsConveyorCount
BenchtopParts are spread on a surface for an instant snapshot countKitting, small lots, QC samplingBenchCount
RoboticA robot picks parts the camera has located and classifiedSorting and handling high-value partsRobotic vision system

For more on counting moving products, see how to count products on a conveyor belt. For loose parts in batches, see how to automate bulk and batch counting.

Benefits of AI counting and sorting

  • Counts difficult parts: touching, overlapping, irregular and mixed items that defeat beam sensors and weight-based counting.
  • Consistent decisions: the same criteria on every part, every shift.
  • Count and sort in one step: the images used to count also grade and route each part.
  • Records: counts and classifications are logged for each batch, with images available for review.
  • Adaptable: new parts or grades can be added by retraining instead of redesigning the machine.

How to choose: does your application need AI?

  1. Describe the difference you need to detect. If it can be measured, such as size, length or color, rule-based analysis may be enough.
  2. Look at the variation. If good parts vary a lot or the difference is hard to put into numbers, AI is likely the better tool.
  3. Check the examples you can provide. AI models need labeled images; more variation means more examples.
  4. Consider changeovers. Frequent new parts favor methods that are quick to set up or retrain.
  5. Test with real parts. A feasibility test shows which approach meets your speed and accuracy targets.

Need parts counted or sorted with AI?

Sciotex designs and builds AI, machine learning and rule-based counting and sorting systems, choosing what each application needs, designed, programmed, built and supported in the US since 1997.

Explore our counting machines

Frequently asked questions

What is AI counting?

AI counting uses cameras and trained image analysis models to detect and count parts or products, including items that touch, overlap or vary in shape. The model is trained on labeled images of the parts.

How does AI sorting work?

The system images each part, classifies it by size, shape, color, type or defect, and triggers an air jet, gate, diverter or robot to route it to the right bin or lane.

Do all counting machines use AI?

No. Counting machines use rule-based, machine learning or AI image analysis, depending on the parts. Uniform parts are often counted best with rule-based measurements; AI is used where parts vary too much for fixed rules.

Can AI count overlapping parts?

Yes. Models trained on images of real clusters can separate parts that touch or overlap. Drop zone counters also view each part from two angles, and conveyor systems track each part across frames.

Can one machine count and sort?

Yes. The images used to count parts can also classify them, so one system can count each part and route it by size, type or grade.

Related articles

Written by

Sciotex Engineering

The Sciotex engineering team has designed and built vision, automation and test systems since 1997.

Have an inspection problem to solve?

Talk it through with a Sciotex engineer.

In this article
Have a counting problem to solve?

Talk it through with a Sciotex engineer.

Next step

See your parts counted