# Surgical Instrument Recognition Based on Improved YOLOv5
## 4 Experimental Results  
Firstly, the improvement effect of the loss function was assessed by comparing the loss curve of YOLOv5 before and after implementation. The loss curve of a neural network represents the change in the loss function as the number of training iterations increases during the model training process. Figure 7 illustrates the comparative analysis of the algorithm's loss curve before and after the improvement. The data clearly indicate that the YOLO network with Wise-IoU achieves a faster convergence rate, as evidenced by reaching a lower loss value by the tenth batch. Secondly, the accuracy comparison between the original YOLOv5 and the improved version is displayed in Table 3, using AP50-95 and mAP50-95 metrics. The improved YOLOv5 shows an increase in AP50-95 for most surgical instrument classes, except for the speculum class, compared to the original YOLOv5 and the SSD, as presented in Table 3. Despite the significantly compressed structure of the improved network model, the mAP50-95 of the algorithm in this paper is 1.8% higher than the original YOLOv5. Analyzing the SSD data reveals that the training outcomes of the SSD neural network exhibit average performance across different devices. Notably, the average precision (AP) values for most devices are lower compared to the YOLOv5 network model. Thirdly, FLOPs was utilized as the determinant of neural network detection speed. FLOPs denotes the tally of floating-point operations that the algorithm necessitates to execute during the process. It is not related to the hardware and software specifications of the program's running environment, and it allows for a relatively fair comparison of the \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**Detection Index**} & \multicolumn{2}{c}{
\begin{tabular}{c} **The Original** \\ **YOLOv5** \\ \end{tabular} } & \multirow{2}{*}{**SE**} & \multirow{2}{*}{**DSC**} & \multirow{2}{*}{**Wise-IoU**} & \multirow{2}{*}{**SE + DSC**} & \multirow{2}{*}{**SE + Wise-IoU**} & \multirow{2}{*}{**DSC + Wise-IoU**} \\ \hline Hemostat’s AP (\%) & 93.4 & 94.9 & 94.6 & 94.7 & 94.3 & 94 & 94.9 \\ Speculum’s AP (\%) & 94.1 & 93.4 & 92 & 92.9 & 92.1 & 92.5 & 92.3 \\ Napkinton’s AP (\%) & 92.2 & 94.3 & 95.1 & 95 & 95.2 & 95.2 & 95 \\ Scissors’ AP (\%) & 90.9 & 94.2 & 92.2 & 93.3 & 93.2 & 92.9 & 92.1 \\ Tweezers’ AP (\%) & 76 & 75.7 & 76.4 & 76.1 & 77.1 & 77.5 & 77.4 \\ Colposcope’s AP (\%) & 96.7 & 97 & 96.4 & 96.1 & 96.9 & 97.3 & 96.4 \\ Attractor’s AP (\%) & 75.8 & 77.2 & 79.5 & 79.2 & 79.2 & 79.1 & 78.8 \\ Stripper’s AP (\%) & 75.9 & 78.2 & 76.4 & 77.2 & 78.4 & 77.9 & 79.6 \\ mAP (\%) & 86.9 & 88.1 & 87.8 & 88 & 88.3 & 88.3 & 88.3 \\ FLOPs (G) & 16.9 & 16.9 & 10.3 & 16.9 & 10.3 & 16.9 & 10.3 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The results of the ablation experiments. Figure 7: The loss curve comparison of Wise-IoU and GIoU. detection speed between algorithms. The comparison between the floating-point operations required by the algorithm before and after enhancement and the SSD is displayed in Table 3. The FLOPs of SSD are 47.7G, which is much larger than YOLOv5. That is, the model complexity of the SSD neural network is much larger than YOLOv5. The FLOPs demand of the YOLOv5 for image detection has been considerably lowered from its original 16.9 G to 10.3 G, which reduced by 39%. This drastic reduction has expedited the neural network's detection rate. Figure 8 presents non-stacked examples of surgical instrument images recognized by the improved network. The recognition results are mostly accurate. Figure 9 illustrates examples of stacked surgical instrument images generated by the improved network. The results indicate that while the stacked images consisting of multiple types of surgical instruments are successful, those comprising highly stacked images of multiple attractors produce false detections.