# An Improved Lightweight Model for Defect Detection on Paths in Images
## 2 Materials and Methods
### Network Structure and Parameters  
Table 1 illustrates the architecture of the ACD-YOLO model. To enhance the efficiency and speed of object detection, we integrated multiple strategies into the new framework. First, a lightweight Cross-scale Feature Fusion Module (CCFM) was introduced to optimize the neck structure of YOLOv8s. Second, the ADown module was used to reconstruct both the backbone and neck, further reducing the model complexity. Finally, in the detection head, the model adopts Microsoft's dynamic head framework and leverages attention mechanisms to improve both efficiency and performance. Collectively, these enhancements result in a final model that reduces the parameter count by 3.72 million (33.3%) compared to the baseline YOLOv8s. Figure 5 presents the final architecture of our proposed ACD-YOLOv8 model, clearly illustrating the structural differences from the baseline YOLOv8s model shown in Figure 1. In the backbone, all four Conv modules responsible for down-sampling have been replaced by the lightweight ADown module. Similarly, in the neck, two Conv modules in the down-sampling path are also substituted with the ADown module. Finally, the standard Detect heads are replaced with the more powerful Detect_dyhead, which incorporates a dynamic attention mechanism. These modifications collectively contribute to the model's lightweight characteristics and enhanced performance.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Layers** & **From** & **N** & **Params** & **Module** & **Arguments** \\ \hline
0 & \(-1\) & 1 & 928 & Conv & (3, 32, 3, 2) \\
1 & \(-1\) & 1 & 5248 & ADown & (32, 64) \\
2 & \(-1\) & 1 & 29,056 & C2f & (64, 64, 1, True) \\
3 & \(-1\) & 1 & 20,736 & ADown & (64, 128) \\
4 & \(-1\) & 2 & 197,632 & C2f & (128, 128, 2, True) \\
5 & \(-1\) & 1 & 82,432 & ADown & (128, 256) \\
6 & \(-1\) & 2 & 788,480 & C2f & (256, 256, 2, True) \\
7 & \(-1\) & 1 & 328,704 & ADown & (256, 512) \\
8 & \(-1\) & 1 & 1,838,080 & C2f & (512, 512, 1, True) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Network structure and parameters of ACD-YOLOv8.  
\begin{table}
\begin{tabular}{c c c c c c} \hline
**Layers** & **From** & **N** & **Params** & **Module** & **Arguments** \\ \hline
9 & \(-1\) & 1 & 656,896 & SPPF & (512, 512, 5) \\
10 & \(-1\) & 1 & 65,792 & Conv & (512, 128, 1, 1) \\
11 & 4 & 1 & 0 & Upsample & (None, 2, ’nearest’) \\
12 & 6 & 1 & 33,024 & Conv & (256, 128, 1, 1, None, 1, 1, False) \\
13 & \([-2,-1]\) & 1 & 0 & Concat & (1) \\
14 & \(-1\) & 1 & 131,840 & C2f & (256, 128, 1) \\
15 & \(-1\) & 1 & 16,640 & Conv & (128, 128, 1, 1) \\
16 & \(-1\) & 1 & 0 & Upsample & (None, 2, ’nearest’) \\
17 & 4 & 1 & 16,640 & Conv & (128, 128, 1, 1, None, 1, 1, False) \\
18 & \([-2,-1]\) & 1 & 0 & Concat & (1) \\
19 & \(-1\) & 1 & 131,840 & C2f & (256, 128, 1) \\
20 & \(-1\) & 1 & 41,216 & ADown & (128, 128) \\
21 & \([-1,-15]\) & 1 & 0 & Concat & (1) \\
22 & \(-1\) & 1 & 131,840 & C2f & (256, 128, 1) \\
23 & \(-1\) & 1 & 41,216 & ADown & (128, 128) \\
24 & \([-1,-10]\) & 1 & 0 & Concat & (1) \\
25 & \(-1\) & 1 & 131,840 & C2f & (256, 128, 1) \\
26 & \([19,-22,-25]\) & 1 & 2,720,659 & Detect\_dyhead & (5, (128, 128, 128)) \\ \hline \end{tabular}
\end{table}
Table 1: _Cont._  
Figure 5: The final structure of ACD-YOLOv8 is shown in Figure 5. This figure highlights the key modifications compared to the baseline model in Figure 1, specifically the integration of the CCFM in the neck, the replacement of standard Conv down-sampling blocks with our ADown modules, and the integration of the Detect_dyhead in the detection head.