# Smart System to Detect Painting Defects in Shipyards: Vision AI and a Deep-Learning Approach
## 3 Deep-Learning Model for Detecting Painting Defects on Steel Plates
### Experiments on Speed and Accuracy  
Since the production sites at the target factory were composed of fast-moving conveyor lines, swift judgment and action are important. Therefore, comparative experiments were conducted based on the you-only-look-once (YOLO) and single-shot multibox detector (SSD) models that are known for their high speed and accuracy. In the case of YOLO, the model is lightweight and operates at a high speed, detecting defects in real-time. According to the paper _\"YOLOv3: An Invention Improvement\"_, a 28.2 mAP and 22 ms processing speed accuracy is nearly three times faster than the SSD model [8]. The SSD algorithm used in the comparative experiments used a single neural network to detect objects in an image. Unlike other detection methods that require an object proposal, the biggest advantage of the SSD is the collection of all operations in a single network, which eliminates the need to create proposals and re-sample pixels and their features. The SSD, trained with NVIDIA Titan X GPU to input images within the VOC2007 dataset,  
Figure 5: Sample images of defectively painted steel plates. Figure 6: Sample images of painted, “dry” steel plates with wet paint. displayed performance of 74.3 mAP and 59 FPS for images input with a resolution of 300 \(\times\) 300 and 76.9 mAP for those inputs with a resolution of 512 \(\times\) 512, performing better than the Fast R-CNN model [9]. The network of YOLO and SSD can be shown in Figure 7.  
A comparative experiment was performed based on the data acquired by the camera at the top. This camera was selected for its superior ability to capture, over a wide range, the various types of data present at the site. Table 2 shows the hyperparameters and Table 3 shows the hardware specifications used in the training and test experiments. Experiments 1 and 2 compared defect detection based on YOLO-v3 and SSD. Figures 8 and 9 show the YOLO-v3 mAP and loss graphs for 16,000 iterations and 200,000 iterations, respectively. Figure 10 shows the SSD mAP and loss graph. The total dataset had 3532 images, of which 3179 (90%) were training and the remaining (353, 10%) were tests. The batch size at the time of training was 64; the training involved  
Figure 8: YOLO-v3 mAP and loss graph (16,000 iterations). Figure 9: YOLO-v3 mAP and loss graph (200,000 iterations) of the top images. approximately 12,800 iterations, corresponding to 256 epochs (1 epoch \(\approx\) 50 iterations). Figure 8 shows the result of Experiment 1. The experiment converged to an average loss of 0.147. This was confirmed by training it for a minimum of 16,000 to a maximum of 200,000 iterations, as shown in Figures 8 and 9. The loss corresponding to training with the YOLO-v3 model was approximately 0.06%, whereas the model itself had an accuracy of 90.4%. **Experiment 2. Experimental results for SSD-based defect detection. **  
The accuracy of the SSD model was 82%, and the loss was approximately 1%, as shown in Figure 10. Although the SSD processing speed, at 90 FPS, was similar to the YOLO-v3 model, the YOLO-v3 model was approximately 8% more accurate. Therefore, the YOLO-v3 model was selected for the final system development. Figure 11 shows the result of the top image. Thereafter, the YOLO-v3 model was also used to train the data acquired using the bottom camera. Figure 11: YOLO-v3-based result of top image. Figure 10: Experimental results of SSD (**a**) mAP (**b**) loss graph. Figure 12 shows the experimental results of the data acquired from the bottom of the plate. When compared to data obtained from the top, what was acquired from the bottom was inadequate and, due to the limited view angle, less accurate, with a rate of only 82% compared to the 90.4% accuracy from the top. However, the bottom data did exhibit sufficient defect-detection capability when it was actually operated in the shipyard system. Experiments with the bottom data were conducted with varying parameters. It was determined that the maximum accuracy occurred at approximately 10,800 iterations (\(\sim\)216 epochs).