Technical Note Vol.9 December, 2015

# What is Algorithm for X-ray Inspection Systems?

## [1] What is algorithm?

X-ray inspection system performs image processing on x-ray image of the product obtained by x-ray irradiation, and extract only favorable shades (a mass of lines) to emphasize contaminants for evaluation. There are multiple numbers of image processing ﬁlters that can be processed at a time and a combination of these ﬁlters is called algorithm. Desirable algorithm may vary depending on the density and shape of products and contaminants.

Fig.1-1 : The diﬀerence of algorithms

## [2] What happens when algorithm is changed?

An optimal algorithm can make the shade of a product lighter to emphasize shade of contaminants. However, there are variety of shapes and composition of foods, for instance cereal, which small pieces overlap each other in a bag and butter which comes in a lump shape with certain thickness. X-ray image for each product appears in speciﬁc degrees of light and shade; however, a distinctive shade which can be easily mistaken for contaminants may appear. In order to suppress the appearance of this shade, prepare image processing which predicts the appearance of this distinctive shade. By this, false negatives (false detection) are reduced and the detection limit is lowered, making it possible to detect even smaller contaminants. On the contrary, choosing an algorithm which is not appropriate for the product's characteristics can cause false negatives.

Fig. 2-1: Inﬂuence of shade

## [3] Actual examples

Let's see how the shadow of a product transforms by changing algorithm using a projection monitor in KD7405AWH.(*)

*Projection monitor
The projection monitor displays signal waveforms after x-ray images are processed. Projection monitor exists by the number of processing imaging. Usually about six to nine projection monitors are displayed on a screen and any waveform that exceeds the detection limit is detected as NG. Some manufacturers of inspection systems use a bar graph for showing the intensity of a signal instead of a waveform.

### ① Example of a pack of dumplings with a tray

Keep in mind that joint parts of dumpling skins can be mistaken for linear contaminants. An increase in the thickness of a joint part of dumpling skins tends to produce the linear shade;therefore, it is essential to reduce the eﬀect of joint part for higher detection sensitivity.

Fig. 3-1: A pack of dumplings with a tray

Fig. 3-2: T1 waveforms of projection monitors (Algorithm 224 and 225)

### ② Example of cube-shaped chocolates in a bag

Since chocolate has a square shape, the contents of the bag shift unevenly when the product rotates and overlaps with each other. This leads shades of x-ray image to get darker steeply. It is essential to separate the product and contaminants by assuming the change in the level of product eﬀect that is hard to predict.

Fig. 3-3: Cube-shaped chocolates

Fig. 3-4: T5 waveforms of projection monitors (Algorithm 232 and 229)

### ③ Example of sausages that overlap each other

The changes in shade density are generated when sausages overlap with each other since the product has a round shape. It is important to separate the product and contaminants by predicting the level of product eﬀect.

Fig. 3-5: Sausages

Fig. 3-6: T4 waveforms of projection monitors (Algorithm 130 and 232)

### ④ Example of roast pork having a hard and rugged surface

The x-ray image of the product appears in a lump shape with the density which gradually changes. Adjusting shades into smoother and lighter shades makes easy to spot the change of images caused by contaminants.

Fig. 3-7: Roast pork

Fig. 3-8: T4 waveforms of projection monitors (Algorithm 130 and 232)

If you stop the system to change algorithms while in production, the occurrence of false negatives may drastically increased. In order to avoid this risk, change algorithms when the production line is not running. By using multiple sample products (the items of the same kind which vary in shape are preferable) and test pieces, observe how the waveform displayed on a "projection monitor" screen changes and see if detection of test pieces get smaller when algorithms are changed. Be sure to record the current algorithm number and other user settings before changing algorithms.

## [4] Let's try choosing algorithms.

Let's try choosing diﬀerent algorithms with test pieces.

### ① Feed the product without test pieces

First, convey only the product and check the following points from the waveform displayed on the projection monitor screen.

Does the height of a waveform get smaller?

The sensitivity is unlikely to be improved if a waveform does not get smaller or remains unchanged in comparison with a waveform before changing an algorithm, so please try diﬀerent algorithms.

Is a waveform stable?

It is desirable to have the condition of having no waveforms which rise irregularly when the product is conveyed. The distinction between the product and contaminants becomes diﬃcult to draw if the waveform rises irregularly when the product is.

### ② Feed the product with test pieces

Next, feed the product with test pieces and observe the waveform displayed on the projection monitor. Check if the followings are achieved.

Does the part of a waveform where the product with test pieces is conveyed rise?

The algorithm is changed successfully if the part of a waveform where the product is conveyed with test pieces rises remarkably. Please try again the same procedure from the beginning in Step 1 "Convey the product without test pieces" if there is no change in the waveform.

## [5] Conclusion

In this paper, we explained how the waveform appeared on the projection monitor transforms when an algorithm is changed as means of enhancing the inspection performance. Changing the algorithm normally does not cause an increase in load on the system or an increase of the processing time for evaluation. To ﬁnd out if the system you are using is capable of changing algorithms, contact your local Anritsu representative.