## 2 Materials and Methods
### Camellia Oleifera Fruit Object Detection Algorithm
#### 2.3.2 Lightweight Improvements to the Backbone Network for YOLOv5  
On the input side, the image is scaled to 640 pixels \(\times\) 640 pixels and then fed into the backbone network for feature extraction operation. The original YOLOv5s network  
Figure 3: Improved lightweight YOLOv5s-Camellia network structure. Figure 2: Flowchart of YOLOv5s-Camellia methodology. model uses CSP-Darknet53 (Cross Stage Partial Darknet) as the backbone network to extract feature maps and obtains three different 80 \(\times\) 80 \(\times\) 256, 40 \(\times\) 40 \(\times\) 512, and 20 \(\times\) 20 \(\times\) 1024 scales of feature layers. Although the CSP-Darknet53 network is very deep to extract more detailed features, such as the shape, color, and texture of the _Camelia oleifera_ fruit, while avoiding gradient disappearance and network degradation, each C3 (concentrated-comprehensive convolution module, one of the components of the backbone network) contains extensive network parameters, which limits the computing power and storage capacity of mobile devices, which cannot meet the real-time detection requirements. Therefore, this paper intends to achieve the lightweight YOLOv5s-Camellia network model by improving the backbone network of the original YOLOv5s, which consisted of CBRM, Shuffle Light Block, ECA, and SPPF. As shown in Figure 4, where the Shuffle Block (the network unit of ShuffleNetV2) with stride 1 is the basic unit and stride 2 is the downsampling unit, both blocks follow the channel mixing operation and the depth separable convolution of the ShuffleNetV1 [31; 32; 33]. In the basic unit shown in Figure 4a, when the feature maps are input, the channel slicing operation is first performed to divide the network channels into two branches, and the number of channels in each branch is equal to c/2. Branch 1 is passed down directly without any processing, and branch 2 is passed through 1 \(\times\) 1 Conv, 3 \(\times\) 3 DWConv (Stride = 1, DWConv is the depthwise convolutional part of the depthwise separable convolution), and 1 \(\times\) 1 Conv (the 1 \(\times\) 1 convolution at this point is the pointwise convolution part of the depthwise separable convolution) in order, and then the splicing operation is performed with branch 1. The size of the feature maps remains the same, the number of channels is added to achieve feature fusion, and finally, a channel blending operation is performed to fuse the information between the channels. Since the number of input feature channels in the convolution layer is the same as the number of output feature channels, i.e., there is no difference in the number of convolution kernels, the memory access cost during the convolution operation is reduced. In the downsampling unit of Figure 4b, the channel cutting operation is canceled, so the feature maps are directly input into two branches with stride 2 for height and width dimensionality reduction. Then, the splicing operation is performed after the output, which halves the height and width of the feature maps and doubles the number of channels, increasing the network width and improving the feature extraction capacity of the network without significantly increasing the computation. Finally, channel randomization is performed to strengthen the information fusion between channels. Figure 4: The structure of Shuffle Block: (**a**) base unit; (**b**) downsampling unit; (**c**) the structure of depthwise separable convolution. Depthwise separable convolution differs from an ordinary convolution, as shown in Figure 4c, and consists of two parts: depthwise convolution and pointwise convolution. When the number of input image channels is \"s\", depthwise convolution first processes the spatial information in the aspect direction where each \(3\times 3\) two-dimensional convolution kernel is responsible for processing only one channel individually, and the number of channels in the generated feature maps is exactly the same as the number of input channels, with the parameter only 1/s of the ordinary convolution.