# Industrial Application of AI-Based Assistive Magnetic Particle Inspection
## 4 Software
### MPI Custom Dataset  
A dataset of images similar to those acquired via the PARADES system is mandatory to train our model. The images in this dataset must match the distribution of images that will be acquired by controllers using the PARADES machine in the production line. Therefore, the images must be green fluorescent (linked to the MPI process) with defects (linear scratches) ranging from 2 to 25 mm length in a 600 \(\times\) 400 mm field of view. Those images must show mechanical steel parts with granulated and smooth textures in order to represent forged, milled and foundry parts. In the literature, previous similar works in deep learning in MPI have been found [9; 11; 12; 13]; authors had to build their own dataset because there is no such dataset available publicly on the market. Unfortunately, those authors did not give access to their datasets. On the other hand, similar dataset in other fields could have been used, datasets of cracks on concrete [17; 18] representing scratches, but unfortunately, images in those datasets are not green fluorescent and furthermore cracks appear bigger in the images than in our case. Another approach could have been to use the NEU-DET dataset [19] or GC10-DET dataset [20], dedicated to steel surface defects. However the images are not fluorescent; images are small compared to our required 600 \(\times\) 400 mm field of view. In addition, the images in those datasets show defects other than scratches (crazing, inclusions, patches, etc.) which are useless in our case of MPI, containing only linear scratch defects. Regarding those considerations, we decided to build our own dataset, with the PARADES machine. Existing customer (forgery, foundry, etc.) parts have been used, along with manually created defects on metal plates or tubes in order to increase the number of total defective parts.  
Some image examples of our built dataset are given in Figure 11.  
The complete dataset consists of 233 train images and 29 test images. Some continuous, discontinuous, curved or straight line defects are presents. Defect length varies from small (3 mm) to longer defects (>25 mm). Several types of manufactured parts compose the dataset, such as welded, milled and raw foundry parts. Defect types can be foundry defects (Figure 12) or defects induced by mechanical stress (Figure 13).  
An example of a discontinuous foundry defect is shown in Figure 12.  
For the trainset, some smartphone-based (not PARADES machine) images acquired by a human controller during control sessions have been also included. The testset only includes images from the PARADES machine with all the diversity explained previously. This dataset is still under construction and will continuously be completed. It contains some proprietary manufacturer parts and so cannot be publicly available at the time of writing.  
Figure 10: An example MPI result acquired with PARADES machine.  
Figure 11: Customer’s part used in our dataset (1 st row) and manually created parts (2 nd row). (**a**) Forgery defect on customer’s part. (**b**) Stress defect on a customer’s screw. (**c**) Manually created defect on a metal tube. (**d**) Manually created defect on welded metal sheet.  
Figure 12: Example of a foundry defect on image acquired with the PARADES machine.