# Few-Shot Steel Defect Detection Based on a Fine-Tuned Network with Serial Multi-Scale Attention
## 3 Methodology
### Dataset Construction and Analysis  
The investigation is centered on a dataset relevant to steel defect detection, provided by the Severtal company. This dataset has been partitioned into training and test subsets. The training set encompasses 12,568 images, each with a resolution of \(1600\times 256\) pixels. Significantly, among these, 6666 images were observed to contain at least one form of defect, resulting in 7095 labeled instances. The dataset categorizes defects into four distinct types as illustrated in Figure 1, namely, pits, cracks, scratches, and iron oxide scales, with scratches comprising a significant majority with a total of 5150 instances. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Reference** & **Methods** & **Performance** & **Disadvantages** \\ \hline \multirow{6}{*}{[PERSON] et al. [26]} & The paper proposed a Style-based & Accuracy is preserved early in & \\  & Recalibration Module (SRM) that & pruning but drops after a certain & \\  & adaptively recalibrates intermediate & ratio. SRM maintains higher & \\  & feature maps by leveraging & accuracy than SE and GE, & \\  & their styles. & indicating it learns channel & \\  & & importance better. & \\ \hline \multirow{3}{*}{[PERSON] et al. [27]} & This study introduced a learnable & The spatial transformer module & It has only been explored in \\  & module, the spatial transformer, which & significantly improves accuracy & feed-forward networks, \\  & allows explicit spatial manipulation of & across tasks and excels in recurrent & limiting validation in other \\  & data within the network. & models and complex tasks. & network structures. \\ \hline \multirow{6}{*}{[PERSON] et al. [28]} & This research introduced the Dynamic & The DCN adaptively allocates & \\  & Capacity Network (DCN), which & computational resources, & \\  & adaptively assigns capacity using & enhancing efficiency in critical & The model’s computational \\  & low-capacity and high-capacity & regions, and performs excellently & complexity remains high with \\  & sub-networks. & on Cluttered MNIST and & large spatial inputs. \\  & & SVHN datasets. & \\ \hline \multirow{6}{*}{[PERSON] et al. [29]} & This paper proposed a deep & The proposed deep learning & The algorithm struggles with \\  & learning-based algorithm using & detection technique significantly & low accuracy in detecting \\  & CSP\_ResNet and DWAS-FPN to & improves the accuracy of strip steel & small-sized defects, requiring \\  & enhance strip steel surface defect & surface defect detection while & further algorithmic \\  & detection, improving gradient fusion & maintaining good detection speed. & improvements and \\  & and multi-scale information gathering. & & integration with other fields. \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Existing methods in surface attention mechanism research. To build few-shot datasets, it is imperative to adhere to the N-way K-shot principle. In this context, N-way K-shot denotes a methodological framework facilitating models to be trained on a constrained sample size with a view to enhancing generalization capabilities. Herein, 'N' signifies the quantity of categories, while 'K' represents the number of samples allocated to each category. We adopted the N-way K-shot criteria specified by [PERSON] et al. (2018), which mandated that the value of 'K' should not exceed 10, thus ensuring no more than 10 samples per category. Consequently, scratches and pits were designated as base class defects, whereas cracks and iron oxide scales were classified as new types of defects. Considering the fine-tuning process of the model, a mere ten samples of new classes were deemed adequate. As such, the dataset for our study comprised two base and two new classes, with N equated to 2, and K constrained to a maximum of 10. After conducting a visual analysis of the defects in the steel dataset, we observed substantial variations in the sizes of defects across different categories. For instance, iron oxide scales were found to be immensely larger than pits.