# Steel Surface Defect Detection Algorithm Based on Improved YOLOv8n
## 2 Related Works
### Based on the Improved YOLOv8 Algorithm (DDI-YOLO)
#### 2.2.2 C2f-DWR Module  
The network structure of YOLOv8 contains a large number of C2f modules, the full name of which is \"Cross Stage Partial Feature Fusion\", which improve the performance and efficiency of the model by partially fusing features at different stages of the network. Further, the C2f module performs feature fusion at different stages of the network to fully utilize the multilayer feature representation of the network. This feature fusion method helps increase the model's detection accuracy and cut down on the number of parameters while the model's computational effectiveness is also enhanced. However, because the defects on the steel surface are relatively large no matter the shape, location, or size differences, especially the cracking-type defects, rolling oxide skin defects, and pitting surface defects, the defects have a large distribution range, the size and shape are not uniform, and the original C2f module of YOLOv8 has insufficient ability to extract the defective features on the steel surface and it cannot extract the multiscale contextual information. Therefore, in this paper, to enhance the network's capacity of extracting multiscale contextual information, a brand-new module, the C2f-DWR module, is designed. The C2f-DWR structure is characterized by the addition of the DWR module to the original C2f module, a decision which strengthens the extraction of features from the extensible sensory field at the higher level of the network.  
The DWR module is fully known as a dilation-wise residual [28], which is also known as a dilation residual module. The DWR module is designed in a residual manner. With the residual, a two-step approach is used to efficiently extract multiscale contextual information and then fuse the feature maps derived from multiscale sensory fields. Specifically, the earlier method of acquiring multiscale context information in a single step is decomposed into a two-step method to reduce the acquisition difficulty.  
The network structure of the DWR module, which comprises two branches, is shown in Figure 3. The two branches are implemented as follows:  
The first branch generates the associated residual features from the input features of the steel surface defects which are referred to as region residuals. In this branch, a series of concise feature maps in the form of regions with different sizes are generated as material for the next morphological filtering. This step is achieved by a common 3 \(\times\) 3 convolution paired with a ReLU and a BN layer. The 3 \(\times\) 3 convolution is employed for initial feature  
Figure 2: The overall process of DDI-YOLO model steel defect detection.  
extraction. The ReLU activation function, instead of the commonly used PReLU layer, has a significant impact on the activation of the region features and on their conciseness.  
The second branch consists of the morphological filtering of the regional features of steel surface defects using multirate extended depth direction convolution, which becomes the semantic decidualization of steel defects. For every channel feature, just one intended receptive field is applied to avoid, if at all possible, redundant receptive fields. In practical steel surface defect detection, the desired concise region feature map can be judiciously discovered in the initial phase based on the extent of the second step's receptive field for fast matching with the receptive field.