# Classification and Fast Few-Shot Learning of Steel Surface Defects with Randomized Network
## 1 Introduction  
There is a variety in the appearance of surface defects in industry, for example, hot-rolled steels, solar panels strips, electronic commutators, steel rails, fabrics, printed circuit boards, magnetic tiles, and more. Steel is the most important metal in terms of quantity and variety of applications in the modern world. Surface defects in hot-rolled steel can be associated with the steel production process, its casting, deformation conditions, crystallization of the ingot, etc. They have a considerable impact on the metal's technological qualities during future processing as well as on its operational features. Due to the manufacturing process and environmental conditions, steel surfaces can have a variety of defects. The non-uniform surface brightness and the variety of shapes of defects make their detection challenging. Additionally, new defects, which have never been seen before, may arise throughout the manufacturing process. In the beginning, these new defects may have few shots, so we have to go through fast incremental learning to incorporate them into the classification model as soon as possible. Steel surface defects show various random patterns, which are good targets for the testing and comparison of concurrent classification methods. Figures 1 and 2 illustrate samples of the two popular benchmark datasets: the Xsteel surface defect dataset (X-SSD) [1] and the Northeastern University surface defect database (NEU) [2]. There are six categories in NEU and seven in X-SSD, with two types of defects present in both. Since the two common artifacts (inclusion and scratches) look somewhat different, we handle them independently. The image processing methods dealing with steel surface defects can be classified into two main categories:  
* Detection: The task is to decide whether the image patch has any errors, sometimes the error should be localized (segmented) and also classified [3; 4; 5; 6; 7];
* Classification: In case of classification, the image patches should be labeled according to the visible defect type. Training examples are available to learn the visual features of known classes [8; 9; 10]. Surface defect detection can be considered as a typical problem in visual quality inspection thus it is related to many areas of pattern recognition, machine learning, image  
Figure 1: Examples for the six kinds of defect classes of the Northeastern University surface defect database (NEU) [2]: (**a**) crazing (Cr), (**b**) inclusion (In), (**c**) patches (Pa), (**d**) pitted surface (Ps), (**e**) rolled-in scale (Rs), (**f**) scratches (Sc). Figure 2: Examples for the seven kinds of defect classes of the Xsteel surface defect dataset (X-SSD) [1]: (**a**) inclusion (Si), (**b**) red iron sheet (Ri), (**c**) iron sheet ash (Is), (**d**) scratches (Ss), (**e**) oxide scale-of-plate system (Op), (**f**) finishing roll printing (Fr), (**g**) oxide scale-of-temperature system (Ot). processing, and computer vision. In most applications, beside the questions of detection and classification, the following key problems are to be answered [11]:  
* The real-time problem: The detection time should be fast enough to support the undergoing (production) process without significant loss in accuracy;
* Small target problem: Often the absolute or the relative (to the image) size of the defect is small. In our article we do not have to face this problem directly since we use benchmark datasets, however, in a real-life application, the size can have an indirect effect on the real-time problem;
* The small sample problem: The number of defect images, used either in manual parameter tuning or in automatic learning mechanisms, is often very limited;
* Unbalanced sample problem: This problem mainly exists in the task of supervised learning and relates to the previous one. Often the number of normal samples forms the majority, while the amount of defected samples only accounts for a small part.