Defective detection with Create ML

MLBoy
3 min readAug 7, 2020

--

Can Create ML be used in the factory?

Create ML can detect scratches on a metal surface of a size that can be seen by humans.

We conducted technical research in collaboration with automobile parts manufacturers. And we achieved a 100% accuracy rate with Create ML.

The size of the scratches we detect is 1 to 4 mm.

good surface.
defective surface.

Experiment with data on 30 good products and 30 bad products.

99% detection capability is required.

Even 90% classification accuracy is not sufficient in manufacturing premise.

It costs a lot of re-inspection and makes automation meaningless.

Tips for classifying metal surfaces.

The key is to make the dataset as consistent as possible.

1, Crop the image to the focus area

When we modeled an image of an entire car part, we could only get near random results.

We cropped and used only the scratched areas of the part.

2. Make the image shooting environment constant

By making the imaging environment constant, it is possible to learn only scratches while ignoring the variations in light reflection.

3. Carefully augment the data.

When we trained Create ML without data expansion, the training accuracy rate was 100% and the validation accuracy rate was around 70%.

The difference between the training accuracy rate and the verification accuracy rate is a sign of overfitting.

Overfitting generally occurs when the dataset is not large enough.

If it is difficult to get enough data, use data augmentation.

However, it is not a matter of blindly augmenting the data.

Create ML has data augmentation options called…
Add Noise, Blur, Crop, Flip, Rotate
When we rotate the image at random angles, the accuracy rate decreased.

Using only Flip, we were able to achieve 100% accuracy.

When the image is rotated, the reflection of light and the streaks on the surface are in different directions, and what you want to ignore as noise is captured as a feature of the image.

What you need to do to introduce the Create ML model to the factory.

1. It is necessary to recognize the entire surface of the component

Take a video while rotating the parts and analyze every frame.

2. It is necessary to send a signal to the device that eliminates defective products

You need to communicate with BlueTooth etc.

3, prevent over detection

It is necessary to ignore “noise that is not a defective product but is transmitted as a surface abnormality” such as dust, fibers, and white powder generated on factory.

To prevent over-detection, it is effective to pre-process the image so that noise is not noticeable.
Use CIFilter etc.

Refer to “Explore Computer Vision APIs” of WWDC 2020.

Only edges

We publish machine learning informations.

https://twitter.com/JackdeS11

rockyshikoku@gmail.com

--

--

MLBoy
MLBoy

No responses yet