# A Fast Recognition Method for Dynamic Blasting Fragmentation Based on YOLOv8 and Binocular Vision
## 3 Results  
In the evaluation of algorithm models, a confusion matrix is generally used to measure the classification performance of a classification model. The rows of the confusion matrix represent the actual categories labeled manually, while the columns represent the categories of data predicted by the model. In a binary classification task, the confusion matrix typically consists of four elements: True Positive (TP), False Positive (FP), True Negative (TN), and False Negative (FN). TP is the number of targets where the model's prediction matches the actual result. FP is the number of instances in which the model incorrectly identifies a non-target as a target. TN is the number of instances in which the model correctly identifies a non-target as a non-target. FN is the number of instances in which the model incorrectly identifies a target as a non-target.  
Using the four elements described above, evaluation metrics such as Accuracy, Precision, Recall, and F1 Score can be calculated to assess the model training results. Precision refers to the proportion of True Positives in the predicted TRUE class by the model. Recall refers to the proportion of target class samples successfully predicted by the model out of all target class samples. Accuracy refers to the proportion of target class samples correctly predicted by the model in all data. However, in object detection, the number of positive and negative class samples may be imbalanced, so some evaluation indicators are not suitable as a decisive evaluation metric in some cases. This study uses Mean Average Precision for evaluation, which is widely used to evaluate the effectiveness of block recognition. Mean Average Precision (mAP), is typically calculated by determining the Precision for all classes at different confidence thresholds and then averaging these Precision values, resulting in the mAP. After training the YOLOv8 model for 1000 epochs, the confusion matrix shown in Figure 14 is obtained. The mAP derived from the normalized _TP_ and _FP_ is 0.84.  
\[\text{Precision}=\frac{TP}{TP+FP}, \tag{5}\]  
The optimization process of the model training is shown in Figure 15. Figure 15a shows the loss function curves of the model on the training and validation sets, where the terms represent bounding box prediction loss, segmentation mask loss, classification loss, and distribution aggregation loss, respectively. The trend of the results (blue curve) shows that as the number of training epochs increases, the loss function on both the training and validation sets gradually decreases. This indicates that the model performs well on the  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Type** & **Configuration** \\ \hline Image size & 640\({}^{\circ}\)640\({}^{\circ}\)3 \\ Epochs & 1000 \\ Optimizer & SGD \\ Number of works & 16 \\ Learning rate & 0.01 \\ Patience & 50 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Model hyperparameter settings.  
training set and its generalization ability on the validation set improves, without obvious signs of overfitting. Figure 15b shows the evaluation metric curves of the model during the training process. Where (B) represents the bounding box, (M) represents the segmentation mask, Precision, and Recall, and mAP50 represents Precision, Recall, and Mean Average Precision, respectively. From Figure 15b, it can be observed that the Precision, Recall, and mAP50 metrics gradually increase and stabilize, reflecting the continuous optimization of the model's prediction performance, reaching a high level.