## 2 Related Work
### Segmentation Methods  
Image segmentation has proven to be one of the best ways of detecting defects on any surface. Various semantic segmentation models have been introduced for defect detection in the past few years. In the paper [35], the model used is a convolutional auto-encoder and sharpening process to highlight the defective area on the NEU dataset. The model segmented the illuminated parts of an image as defects, which led to compromised efficacy and incorrect defect detection. The evaluation parameters are not discussed for diagnosing the performance of the model. With regard to the other segmentation model, a fully convolutional network (FCN), ref. [36] with transfer learning was proposed. The model is tested on the NEU dataset, obtaining 98% classification accuracy. Although the classification accuracy is satisfactory, the author still feels the contours of the defect images are not segmented appropriately, due to which model is unable to achieve high segmentation accuracy. Various papers have included the promising model UNet as their base model with slight changes in the architecture and showed satisfactory results. The author [37] proposed an FCN model influenced by UNet to detect defects on the DAGM 2007 textured surface dataset. The paper introduced two models with a slight tweak in the architecture. Model 2 performed slightly better than model 1, with the intersection over union (IoU) value of 68.3% and F1-score of 79%. However, the model accuracy is still low, and there is room for further improvement. The paper [38] proposed UNet with ResNet34 and an additional decoder for severity evaluation of the defects and to obtain the two segmented images, one for defect information and another for defect severity. They included production process parameters to improve the performance of the model. The ground truth image provides a mask in box form, which led to false positive detection and resulted in the poor performance of the model. The model is evaluated through IoU metrics, which is around 40%. The paper [39] introduces DSUNet to overcome the variability in the types of defects, shape and location. They introduced a multi-scale module to improve segmentation between the encoder end and decoder start. The model's dice coefficient of 80.8% and accuracy of 95.4% were achieved on the SD-saliency-900 dataset. The generalization of the model for other defects is not clear. The paper [40] used the pre-trained transfer learning classic UNet model for feature extraction. No additional features are used in the model to improve the segmentation, and model generalization is fuzzy. The model resulted in a mean IOU (mIoU) of 84.3%. Various enhancements have been carried out to existing models for better performance; one of them is the attention module. Some papers have discussed the advantageous use of the attention module in their proposed models. In paper [41], the author proposed the PGA-Net model, a combination of two main modules, pyramid feature fusion (PFF) and global context attention (GCA) network. The PFF module extracts features for fusing into five resolutions. Along the boundary refinement block, the GCA network propagates the information and refines boundaries from low to high-resolution feature maps. The model is evaluated on the NEU dataset (containing three defects), resulting in 82.15% mIOU. Despite the promising results, the model failed to detect some defects correctly due to overfitting. The paper [42] discussed the dual attention network (DAN)-DeepLabv3+ model, including a dual attention module and Xception as the backbone. Only three defects of the Several defect dataset were considered. The first defect was weakly detected out of the three, due to data imbalance and shape. The mIoU value of 89.9% was evaluated. The paper [43] proposed a triple attention semantic segmentation network (TAS\({}^{2}\)-Net) architecture. Multi-level feature extraction and focus context module are introduced to extract and fuse the small defects with multi-level feature information for defect segmentation.