In the ice cream industry, in addition to taste, visual appearance is very important because it
has a strong influence on the sale of a certain product. To control the visual adequacy of
products, certain image standards have been developed that are required by customers. In our case, we set for the image standard that anomalies should not be larger than 5 mm to be
considered acceptable. Since manual control of individual products is a time-consuming task,
optical systems have been developed. Utilizing the latter, these image standards can be
implemented quickly and easily. Because of the high prices of such systems, we decided to
design a system for the autonomous detection of anomalies in ice cream products, which
represents the essence of this master's thesis.
For the issue in question, it was first necessary to gain a database of marked product images, for which we built a device with suitable housing, lighting, and lens. For our system, we designed appropriate housing that meets the strict standards of the food industry and shadowfree brightfield lighting with upgrade options. We chose the camera sensor so that it was compatible with selected embedded computers and was sensitive enough to capture a series of sharp images. For the camera lens, we chose an ultra-wide angle lens to enable more flexibility in camera placement. We could take a smaller viewing angle, which would increase the resolution of the products, but in the system planning phase, we did not know exactly how the device would be installed on the industrial line. To control the device, we used three builtin computers that control the lights and the camera and take care of data storage. We also set several camera parameters to record as sharp video as possible. From the latter, we cut out images of products through which we built a test and training database.
We had to multiply the resulting database with a binary mask by which we limited the area of
interest to avoid the problem where the chosen anomaly detection method considers the
background of the product as an anomaly. We tested the one-class PaDiM method on the
database processed in this way. Based on the model testing results, we can see that the method can distinguish successfully between products without anomalies and all others (ROCAUC = 0.975). We wanted to find a threshold that would separate products with larger (over 5 mm) and smaller anomalies (up to 5 mm). However, we were unable to determine such a threshold that would be feasible. We tried to reach this threshold through the application of anomaly intensity maps unsuccessfully. This threshold turned out to be not proportional to the size of the anomaly of an individual product. We also could not use the assessment of the maximum error that PaDiM attributes to each image because it only reflects whether it is an image of a product with or without an error and does not say anything about the size of the anomaly. Namely, the intensity of the anomaly detected by the PaDiM model depends on both the contrast of the anomaly and the size of the anomaly. Based on this finding, we can conclude that the PaDiM model is an inappropriate model for determining whether a certain product is still acceptable according to a certain visual standard. With it, we can only determine whether a product is defect-free or not.
|