Styrofoam plates of different types and grades were produced in an automatic moulding machine, and the surface features were recorded using a simple, practical illumination geometry. For defect detection, a neural network was used which is not trained for defect classification as is usually done, but which outputs a measure for the similarity of images, i.e., for the property "similar/dissimilar to a good part". Such a network – known in AI science as "Siamese network" – is geared for comparisons and is thus not trained with single images, but with image pairs. This can be done with image tiles or downscaled complete images. If synthetic data is added during learning by reflection, translation, shearing, etc., care must of course be taken that the alterations do not match any expected fault signature. Any combination of OK and NOK images in black and white or colour can be used, and training is done on quality grades rather than on individual errors. As a result, over time the network becomes more and more reliable at detecting part or features it has rarely or never seen.
This approach offers the advantage that image data from current production can be used for learning without requiring resources to wait for, collect, and catalogue defects. The sliding similarity score can be used not only to detect rejects, but also, for example, to automatically divide parts into higher and lower grades.
In this project it was shown that even with small amounts of data, meaningful Deep Learning for quality assessment is possible. Equal numbers of good and bad parts of each defect type are not needed, as is often assumed. Even further automation and more convenient application would be achieved by a feedback loop that automatically pre-labels data, and by a network that can automatically adapt to the amount of information processed, or adaptive control of the ongoing learning process.