Binary Particle Classification
- Updated2025-11-25
- 5 minute(s) read
Use binary particle classification to identify samples based on their shape.
Ideal Images for Classification
Images of samples acquired in a backlit environment are ideal for particle classification. The following figures show examples images of backlit samples.
The following figures show samples that are not ideal for particle classification because they contain several unconnected parts or are grayscale and have an internal pattern.
General Classification Procedure
Consider an example application whose purpose is to sort nuts and bolts. The classes in this example are Nut and Bolt.
Before you can train a classification application, you must determine a set of features, known as a feature vector, on which to base the comparison of the unknown sample to the classes of known samples. Features in the feature vector must uniquely describe the classes of known samples. An appropriate feature vector for the example application would be {Heywood Circularity, Elongation Factor}.
The following table shows good feature values for the nuts and bolts shown in the subsequent figure. The closer the shape of a sample is to a circle, the closer its Heywood circularity factor is to 1. The more elongated the shape of a sample, the higher its elongation factor.
| Class | Average HeywoodCircularity | Average ElongationFactor |
|---|---|---|
| Nut | 1.109 | 1.505 |
| Bolt | 1.914 | 3.380 |
The class Nut is characterized by a strong circularity feature and a weak elongation feature. The class Bolt is characterized by a weak circularity feature and a strong elongation feature.
After you determine a feature vector, gather examples of the samples you want to classify. A robust classification system contains many example samples for each class. All the samples belonging to a class should have similar feature vector values to prevent mismatches.
After you have gathered the samples, train the classifier by computing the feature vector values for all of the samples. Then you can begin to classify samples by calculating the same feature vector for the unknown sample and comparing those values to the feature vector values of the known samples. The classifier assigns the unknown sample a class name based on how similar its feature values are to the values of a known sample.
Illustration A shows a binary image of nuts and bolts. Illustration B shows these samples classified by circularity and elongation.
- Circularity
- Elongation
- Bolts
- Nuts
Preprocessing
Preprocessing operations prepare images for better feature extraction. Preprocessing includes noise filtering; thresholding; rejecting particles that touch the image border; and removing small, insignificant particles.
For best results, acquire the inspection images under the same lighting conditions in which you acquired the training images. Also, apply the same preprocessing options to the inspection images that you used to preprocess the training images.
Feature Extraction
Feature extraction computes the feature vector in the feature space from an input image. Feature extraction reduces the input image data by measuring certain features or properties that distinguish images of different classes. Which features to use depends on the goal of the classification system. The features could be raw pixel values or some abstract representation of the image data. For identification applications, select features that most efficiently preserve class separability—feature values for one class should be significantly different from the values for another class. For inspection applications, select features that distinguish the acceptable from the defective.
The Particle Classifier classifies samples using different types of shape descriptors. A shape descriptor is a feature vector based on particle analysis measurements. Each type of shape descriptor contains one or more shape measurements made from a sample.
The default Particle Classifier shape descriptor is based on shape characteristics that are invariant to scale changes, rotation, and mirror symmetry. Another type of shape descriptor is based on the size of the sample and is used along with the default shape descriptor to distinguish samples with the same shape but different scale, such as different sized coins. The Particle Classifier also uses a reflection-dependent shape descriptor to distinguish samples that are the same shape but exhibit mirror symmetry, such as a lowercase letter p and a lowercase letter q. The Particle Classifier uses these different types of shape descriptors in a multi-classifier system to achieve scale-dependent classification, reflection-dependent classification, or scale and reflection-dependent classification.
Invariant Features
The Particle Classifier uses the following features for scale-invariant, rotation-invariant, and reflection-invariant shape descriptors:
- Feature 1 describes the circularity of the sample.
- Feature 2 describes the degree of elongation of the sample.
- Feature 3 represents the convexity of the sample shape.
- Feature 4 is a more detailed description of the convexity of a sample shape.
- Feature 5 is used for the discrimination of samples with holes.
- Feature 6 is used for more detailed discrimination of samples with holes.
- Feature 7 represents the spread of the sample.
- Feature 8 represents the slenderness of the sample.
Classification
The Particle Classifier can apply the following classification algorithms: Minimum Mean Distance, Nearest Neighbor, and K-Nearest Neighbor. Each of these methods may employ different distance metrics: Maximum distance (L∞), Sum distance (L1), and Euclidean distance (L2).
Cascaded Classification System
In a cascaded classification system, cascaded multiple classifiers make classification decisions based on multiple classification stages. Classifier 1 outputs several candidates for Classifier 2 in the second stage. Classification is based on different features.
Parallel Classification Systems
Combining results from multiple classifiers may generate more accurate classification results than any of the constituent classifiers alone. Combining results is often based on fixed combination rules, such as the product and/or average of the classifier outputs.
The Particle Classifier uses a parallel classification system with three classifiers, as illustrated in the following figure. Two classifiers are used for scale-dependent classification. One of these classifiers uses scale-invariant features, and the other uses a scale-dependant feature. Additionally, the Particle Classifier uses a third classifier to distinguish samples with mirror symmetry. The outputs of the classifiers are combined using user-specified weights to get the result.