## 3 Results and Discussion
### Reducing Model Size Using Quantitative Pruning  
The ultimate goal of this paper is to deploy the real-time detection model to different hardware devices. Therefore, lightweighting is a necessary optimization step, and we use the quantitative pruning algorithm to prune the model to reduce the number of model parameters and improve the speed of the model by pruning the channels that account for a lower percentage of importance in the model. First, we use YOLO-chili to train the model in the fitted state, and then perform quantitative pruning on the trained model. At the same time, the sparsity of the lower weight layer is trimmed from 0.5 to 0.9 and then the model is quantized and compressed. After that, this paper retrains the YOLO-chili model until it converges. This method can effectively reduce the model parameters, model computational complexity, and the size of the weight file while preserving the accuracy of the model. The results are shown in Table 4. The original model parameters are 18.7 M, and after quantized training of the model weight file, the pruned model parameters are 9.64 M, and the model accuracy reaches 93.66%, which is only 0.45% decrease in accuracy, while the model volume is reduced by half, and the FPS is only 65, which makes YOLO-chili fully adaptable to a variety of different mobile devices to accomplish the real-time detection tasks.  
Figure 10: Comparison of Learning Convergence.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**Models**} & \multirow{2}{*}{**Parameters/M**} & \multirow{2}{*}{**FLOPs/G**} & \
\begin{tabular}{c} **Model** \\ **Size/MB** \\ \end{tabular} & \multirow{2}{*}{**AP (\%)**} & \multirow{2}{*}{**Precision (\%)**} & \multirow{2}{*}{**Recall (\%)**} & \multirow{2}{*}{
\begin{tabular}{c} **Test** \\ **Time/ms** \\ \end{tabular} } \\ \hline YOLOv5 & 7.24 & 16.6 & 14.1 & 85.53 & 91.33 & 81.77 & 47.7 \\ YOLOv7 & 37.49 & 123.5 & 74.5 & 92.39 & 94.24 & 91.65 & 97.2 \\ YOLOv7-tiny & 6.51 & 14.2 & 12.1 & 89.32 & 93.93 & 87.62 & 46.8 \\ SSD & 26.29 & 62.8 & 93.3 & 91.24 & 93.42 & 73.19 & 65.5 \\ Faster-RCNN & 137.10 & 370.2 & 111.5 & 83.63 & 67.84 & 81.62 & 126.3 \\ YOLO-chili & 11.4 & 21.2 & 18.7 & 94.11 & 94.42 & 92.25 & 55.4 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Detection Results of Different Target Detection Algorithms.  
Although the effect of FPS is reduced, this is acceptable compared to the improvement in detection performance.  
The detection results of YOLO-chili are presented in Figure 11. These results demonstrate that YOLO-chili can effectively identify the location of chili peppers in complex scenarios, including multilayered targets, cloudy skies, and occlusion, thereby validating the algorithm's effectiveness. However, as shown in the bottom left corner of the second image in Figure 11, the model fails to detect a chili pepper because only a quarter of the pepper is visible, highlighting a limitation in detecting partially exposed fruits. Our observations indicate that different lighting conditions have minimal impact on the automatic detection of pepper fruits. Instead, factors such as occlusion by other fruits and debris, like leaves, and the color similarity between the leaves and the fruits significantly affect the detection performance.