# Steel Surface Defect Detection Algorithm Based on Improved YOLOv8 Modeling
## 1 Introduction  
Steel is an essential basic material for the global industry [1], and it is used extensively in construction, machinery manufacturing, transportation, energy, and other fields [2]; but in the steelmaking process, defects such as cracks, spots, scratches, corrosion, and so on [3, 4] may appear on the surface [5], and these defects will affect corrosion resistance, surface flatness, etc., which will in turn affect the end product performance. This is particularly noticeable in some industries that require a very high quality of materials, such as in the aviation, aerospace, and automobile manufacturing industries, where quality problems on the surface of the material can create safety hazards. Accordingly, the timely and effective detection of steel surface defects is the basis for the assurance of product safety and reliability [6]. Nowadays, the main methods for steel surface defect detection [7] are dependent on deep learning methods and methods based on traditional techniques [8]. Among them, traditional methods [9] include magnetic particle inspection, penetration inspection, eddy current inspection, ultrasonic inspection, X-ray inspection, and machine vision inspection. Although these techniques have made progress in defect detection, they still have the disadvantages of limited applicable materials, a large influence of detection results by inspectors, and low detection accuracy. It is on this basis that methods rooted in deeplearning have come to the forefront, with target detection algorithms of this kind falling into two distinct categories, namely one-stage approaches and two-stage approaches. One-stage approaches are represented by YOLO (You Only Look Once) [10] and SSD (Single Shot Multibox Detector) [11], which predict the location and category of the target object directly from the input image by one-time forward propagation. The two-stage approaches are based on the sliding window and candidate region generation, which are mainly based on the R-CNN family, with R-CNN [12], Fast R-CNN [13], Mask R-CNN [14], RetinaNet [15], and so on. These algorithms first generate the appropriate alternative regions and then classify and adjust the boundaries of these regions to achieve the recognition effect. Despite the superiority of two-stage algorithms in terms of accuracy when compared with single-stage algorithms, they have problems such as difficulty in detecting small objects and high computational overhead. Therefore, in the field of materials science and automation, the development of efficient and accurate strip surface defect detection technology has become a popular research topic. Currently, deep learning techniques [16] have been shown to be an effective method for improving the precision and efficiency of defect detection. Of these, the YOLO series [17] represents a turning point in the evolution of machine vision, which is inspired by the GoogLeNet classification network [18] architecture to meet the stringent requirements of real-time detection with high accuracy, and it has been widely used in the detection of tiny surface defects. As a one-stage target detection approach, the YOLO series has gone through many versions since its introduction [19], and each iteration has considerable improvements in power, speed, and accuracy. YOLOv8 has increased speed in defect detection compared with its predecessor, but the detection accuracy has yet to be optimized. Therefore, this paper mainly aims to improve the YOLOv8 model in terms of detection accuracy. The main contributions are twofold. First, we embed a multi-scale attention mechanism into YOLOv8 to suppress noise and enhance model stability. Second, we implement group reconstruction, parallel multi-scale learning, and cross-spatial interaction to achieve efficient, high-performance feature enhancement. These improvements address the challenges of detecting defects on steel surfaces, including significant variations in defect size, low contrast, and low detection accuracy in complex backgrounds.