# PRC-Light YOLO: An Efficient Lightweight Model for Fabric Defect Detection
## 3 Fabric Defect Detection Based on PRC-Light YOLO
### Lightweight Backbone Network  
The reduction of floating-point operations (_FLOPs_) can alleviate the computational burden of neural networks, thereby shortening both forward and backward propagation times. This reduction significantly contributes to achieving lower latency. Simultaneously, lower _FLOPs_ can enhance the parallelism of neural networks on hardware, increasing throughput and enabling faster processing of input data streams. Consequently, to achieve lightweight neural networks that meet the demands of low latency and high throughput, the focus of most researchers remains on minimizing the total number of _FLOPs_. This is because there exists the following relationship between neural network latency and _FLOPs_:  
\[Latency=\frac{FLOPs}{FLOPS} \tag{1}\]  
Floating-point operations per second (_FLOPS_) is a metric for computing speed efficiency. As indicated by Equation (1), reducing the number of _FLOPs_ does not always guarantee a decrease in neural network latency. Hence, it is essential to concurrently reduce _FLOPs_ and optimize _FLOPS_ to truly achieve low latency. [PERSON] et al. demonstrated that frequent memory accesses by convolution operations reduced _FLOPS_ values in neural networks [25]. ShuffleNet [26], MobileNet [27] and GhostNet [28], for example, embed Group Convolution (GConv) or Depthwise Convolution (DWConv) to extract spatial features. For an input \(I\in R^{c\times h\times w}\), with c convolution kernels \(W\in R^{k\times k}\), we obtain an output \(O\in R^{c\times h\times w}\). Then, the _FLOPs_ for regular convolution is \(h\times w\times k^{2}\times c^{2}\), and the DWConv's _FLOPs_ is \(h\times w\times k^{2}\times c\). Despite the lower _FLOPs_, the DWConv operation cannot be directly followed by the regular convolution operation, or it will lead to a significant degradation of model accuracy. To compensate for the drop in precision, the PointWise Convolution (PWConv) operation is typically employed after DWConv, with the channel count in DWConv being augmented to \(c\). As a result, the Memory Access Cost (MAC) for DWConv is as follow:  
\[h\times w\times 2c^{\prime}+k^{2}\times c^{\prime}\approx h\times w\times 2c^{\prime} \tag{2}\]  
The MAC for regular convolution can be represented as follows:  
\[h\times w\times 2c^{\prime}+k^{2}\times\mathrm{c}\approx h\times w\times 2c \tag{3}\]  
A comparison of Equations (2) and (3) suggests that the DWConv operation may elevate the frequency of memory accesses in the process of reducing _FLOPs_. Furthermore, since these models typically involve extra data processing operations such as splicing, disambiguation, and pooling, the inclusion of DWConv does not invariably curtail the neural network's latency. Therefore, we adopt a novel partially convolution PConv in the Backbone, which reduces the _FLOPs_ and MAC of neural networks. The principle of the PConv is illustrated in Figure 2.  
As can be seen from Figure 2, PConv only performs the convolution operation on part of the input channels by using the regular conventional Conv for spatial feature extraction. Meanwhile, the remaining \(c-c_{p}\) channels keep an identity mapping to Output. This approach allows selective processing while preserving certain channel information. The _FLOPs_ of PConv is calculated to be \(h\times w\times k^{2}\times c_{p}^{2}\), and the MAC is \(h\times w\times 2c_{p}+k^{2}\times c_{p}^{2}\approx h\times w\times 2c_{p}\), where \(c_{p}\) denotes the number of channels in PConv that perform regular convolution. The \(c_{p}\) is usually taken to be \(1/4c\). Therefore, the _FLOPs_ of PConv are only \(1/16\) of those of the regular Conv, resulting in reduced memory access. This paper replaces all \(3\times 3\) convolution operations within E-ELAN of the YOLOv7 Backbone network with PConv. This substitution allowed for a reduction in the frequency of memory accesses by the neural network.