# GAN-Based Image Dehazing for Intelligent Weld Shape Classification and Tracing Using Deep Learning
## 4 Results and Discussion
### Testing Phase of Weld Seam Detection Using YOLO Algorithms  
To test the effectiveness of the trained model, it was validated with 208 images and the generalisation ability of the model was tested on 212 test images with GA optimal parameters. Additionally, testing was performed by capturing the weld plates from the live camera kept in eye-to-hand configuration to show the robustness of detection. Furthermore, the inference speed of YOLOv5 was just 0.096 for the 212 test images, whereas DarkNet took 20.73 s, which was comparatively higher. The faster algorithms could be useful in meeting the requirements in robotic welding industries, saving computational cost and time. The real-time detection results of different YOLO algorithms for images with different backgrounds, hazy images, haze-free images, and dehazed images are shown in Figure 13a-m. The average validation accuracy obtained using YOLOv5 was 95%, whereas it was 90% with Scaled YOLOv4. The validation accuracy with YOLOv4 DarkNet was only 82%, and its performance in weld seam detection was poor compared to YOLOv5 and Scaled YOLOv4 since it had multiple predictions and overlapping bounding boxes. Additionally, it was seen that few shapes were not identified and gave true negative and false positive results because the precision was as low as 47%. Some shapes, such as shape 8 and shape 9, were intentionally similar so to increase the robustness of the detection augmentation. Flip and rotate were used and the model was able to differentiate between redundant shapes and classify them accurately. To further validate the generalisation ability, deep learning models were tested with datasets captured from a live camera which were not the part of test and validation datasets. The detection results are shown in Figure 14a-e. From the figure, it can be inferred that a live image of size 640 \(\times\) 480 was used for testing and the weld shapes were classified into eight shapes with an accuracy of 90% using YOLOv5. Furthermore, the performance of the YOLO algorithms was compared with Faster RCNN and EfficientDet. It was seen that accuracy for all the shapes was 72%, which was comparatively lower than other models. Additionally, it took 1.5 h to train the network, but EfficientDet performed better with an  
Figure 13: Real-time weld seam detection: (**a–e**) YOLOv5; (**d–h**) Scaled YOLOv4; (**i–m**) YOLOv4 DarkNet. accuracy of 95%. Additionally, the model performances of YOLO, EfficientDet and Faster RCNN were tested for different image sizes, namely, 640 \(\times\) 480 and 1600 \(\times\) 1200. These images were obtained from the GAN module and the 2D camera, so these sizes were taken for testing. The processing speed and validation accuracy were noted for each case, as shown in Figure 15a,b. From the histogram, it can be seen that validation accuracy was high for the resolution of 1600 \(\times\) 1200 using YOLOv5. Though the model was trained on 416 \(\times\) 416, weld shapes were detected for both the image sizes. It was further noted that the higher the resolution, the better the classification was. Additionally, for higher pixels, the inference time for a single image was more than the image size of 640 \(\times\) 480. However, detection was poor for Faster RCNN, as some shapes were misclassified and the bounding boxes did not exactly identify the weld shapes. Finally, an ablation study for the modules used in this work was conducted to demonstrate the needs of each module used. Figure 14: Generalization test of deep learning models: (**a**) YOLOv5; (**b**) Scaled YOLOv4; (**c**) YOLOv4 DarkNet; (**d**) Faster RCNN (**e**) EfficientDet. Figure 15: Deep learning model performance for different image sizes: (**a**) validation accuracy; (**b**) inference time. architectural level will be considered in the future. For the analysis, nonhomogeneous weld fume images were taken to analyse the performance of detection with and without the denoising module.