## 2 Materials and Methods
### Improved-YOLOv5
#### 2.2.2 GhostNet Module  
GhostNet is a neural network architecture that seeks to balance high accuracy with a low computational cost. It was created to address the shortcomings of traditional deep neural network models, which are too complex to run on resource-constrained devices [26]. In this research, the YOLOv5 architecture was modified by replacing the original C3 module with the C3 Ghost module from GhostNet. This module was created to reduce the model's computational complexity by sharing weights across multiple convolution layers. As a result, the model had fewer parameters while maintaining its accuracy. This was especially important for a real-time application such as bus detection, where detection speed is critical. We also replaced the CBS module with the Ghost conv module. The Ghost conv module is a lightweight alternative to the traditional convolution layer that reduces the number of model parameters. This enabled the model to make better use of the computational resources, making it more suitable for deployment on resource-constrained devices. Figure 3 depicts the operation of the ghost module.  
Figure 3: Schematic diagram of the Ghost module.  
Figure 2: Structure of the SimSPPF Module.  
For the input image, \(X\in\mathbb{R}^{c\times h\times w}\), where \(c,h\), and \(w\) are the number of input channels, input image height, and input image width, respectively. In general, the operations of an arbitrary convolutional layer for producing n feature maps can be written as Equation (6).  
\[Y=X*f+b, \tag{6}\]  
where \(*\) represents the convolution operation, \(b\) represents the bias, \(Y\in\mathbb{R}^{h^{\prime}\times w^{\prime}\times n}\) represents the output feature map with \(n\) channels, and \(f\in\mathbb{R}^{c\times k\times k\times n}\) represents the convolution filters in this layer. Furthermore, \(h^{\prime}\) and \(w^{\prime}\) are the height and width of the output feature maps, respectively, and \(k\times k\) is the kernel size of the convolution filters \(f\)[26]. The required number of FLOPs during this convolution procedure can be calculated as \(n\cdot h^{\prime}\cdot w^{\prime}\cdot c\cdot k\cdot k\), which is often in the hundreds of thousands because the number of filters \(n\) and the number of channels \(c\) are generally very large.  
We can discover that some features are similar by visualizing some feature maps, and we can obtain them by performing some simple operations instead. Equation (7) can be used to generate \(m\) intrinsic feature maps \(Y^{\prime}\in\mathbb{R}^{h^{\prime}\times w^{\prime}\times m}\), where \(f^{\prime}\in\mathbb{R}^{c\times k\times k\times m}\) represents the convolution filters, and it is similar to Equation (6). However, we only work with partial convolutions and generate the remaining feature maps with a linear operation, as shown in Equation (8).  
\[Y^{\prime}=X*f^{\prime}+b \tag{7}\]  
\[y_{i,j}=\Phi_{i,j}\big{(}y^{\prime}_{i}\big{)},\forall i=1,\ldots,m,j=1,\ldots,s, \tag{8}\]  
where \(y^{\prime}_{i}\) is the \(i\)-th intrinsic feature map in \(Y^{\prime}\), and \(\Phi_{i,j}\) is the linear operation for \(y^{\prime}_{i}\) that generates the \(j\)-th ghost feature map \(y_{i}\), \(j\).  
In general, the parameter \(p\) utilizes standard 2D convolution, as shown in Equation (9), and the parameter \(P^{\prime}\) is shown in Equation (10) with group convolution, where \(h_{1},w_{1},C_{1},C_{2}\), and \(g\) are the filter height, the filter width, the input channels, the output channels, and the number of groups, respectively. We can obtain similar feature maps with \(1/\)g times the number of parameters.  
\[P=h_{1}\times w_{1}\times C_{1}\times C_{2} \tag{9}\]  
\[P^{\prime}=h_{1}\times w_{1}\times C_{1}\times C_{2}\times\frac{1}{g} \tag{10}\]  
The Conv and GhostConv modules both have the same number of input and output channels. The number of input channels is C1, and the number of output channels is C2. Figure 4 depicts the detailed structure of YOLOv5 with GhostNet.