# Improved Lightweight YOLOv4 Foreign Object Detection Method for Conveyor Belts Combined with CBAM
## 4 Experiments
### Experimental Comparison of Different Models  
Under the same training environment conditions, foreign object detection was performed on the same dataset using YOLOv3, YOLOv4, Faster-RCNN, YOLOX, YOLOv7, and Ghostnet-CBAM-YOLOv4 models, respectively. The experimental results are shown in Table 7. Figure 12 shows the foreign object target detection results on the belt for the algorithm in this paper. The MAP of the YOLOv3 model was lower than the other four \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Methods** & **Precision (\%)** & **Recall (\%)** & \
\begin{tabular}{c} **MAP** \\ **(\%)** \\ \end{tabular} &
\begin{tabular}{c} **Frequency** \\ **(Frame-S\({}^{-1}\))** \\ \end{tabular} \\ \hline YOLOv4 & 79.8 & 73.1 & 76.8 & 37.1 \\ Algorithm of this paper & 88.9 & 80.5 & 85.3 & 46.3 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Performance comparison between the improved algorithm and YOLOv4 on VOC data sets. Figure 11: Detection results of target objects on the VOC2007. models, and the detection speed was slower. The YOLOv4 model demonstrated high detection accuracy and speed. The algorithm's performance was more balanced than other network models, as shown in Figure 12a. However, it could not identify small target objects and had leakage detection. The Faster-RCNN model had a high detection accuracy and could identify multi-target foreign objects; however, its detection speed was slow, and it was challenging to achieve the requirement of real-time foreign object detection. The algorithm in this paper introduced the GhostNet-CBAM-YOLOv4 model, simplifying the network structure and reducing the number of parameters. The detection speed and accuracy were better than the YOLOv7 model, and the weight file was much smaller than YOLOv7. The average detection accuracy and detection speed of the advanced algorithm were slightly higher than that of YOLOX, which shows the superiority of this algorithm. This allows our solutions to be deployed on devices with limited resources, such as embedded systems. As shown in Figure 12d, the second smallest target object could be effectively detected without any leakage, which could realize real-time detection of foreign objects under working conditions. The experimental results derived from the improved algorithm show that our model's average detection accuracy and detection speed outperformed [PERSON]'s Fast-YOLOv3 algorithm and [PERSON]'s improved SSD algorithm and was capable of recognizing foreign objects in high-speed motion conveyor belts. Compared with HAO's improved YOLOv5 model, the number of parameters in our model was smaller, the detection speed was faster, and its recognition effect on small target objects was significantly improved, with no obvious misdetection or omission. Our model represents great progress in detection accuracy and speed, simplifying the parameters, and could be deployed on equipment with limited resources, realizing the real-time detection of foreign objects in conveyor belts. In order to verify the stability of this algorithm, we used the improved algorithm to train VOC2007 + 2012 and coal gangue data sets and obtained 46 sets of data. The experimental conditions and environment remain unchanged. We conducted a Kappa analysis on the data, and the results are shown in Table 8.  
In this paper, the average detection accuracy of MAP was divided into three interval categories, A (82,85); B(79,82); C(76,79). After the Kappa test, the statistic was 6.823, \(p<0.001\), which was statistically significant. It could be considered that there was a statistical correlation between VOC and the data results trained by Gangue in the improved model. The Kappa value of correlation strength was 0.613, and the consistency was good.