# Magnus-Forces Analysis of Pitched-Baseball Trajectories Using YOLOv3-Tiny Deep Learning Algorithm
## 3 Experiments  
To use the deep-learning algorithm to recognize the baseball and its flight trajectory, this study used 485 screenshots of the baseball TV broadcast. Among them, 80% of the screenshots (388 sheets) were randomly selected as training data sets, and the remaining 20% (97 sheets) were used for verification. In addition, this study sets the hyperparameters to a learning rate of 0.001, a mini-batch size of 64, a momentum of 0.9, and weight decay of 0.0005. First, the size of the input image was adjusted. As the resolution increases, the detection of small objects improves, but the computational load increases, and the computational speed decreases during training. Therefore, this study used a 416 \(\times\) 416-pixel (referred to as the tiny-416 model) and a 608 \(\times\) 608-pixel (referred to as the tiny-6081 model) resolution to analyze the baseball recognition capability by YOLOv3-tiny. Moreover, the intersection over union (IoU) and mean average precision (mAP) were used to compare and analyze the accuracy [20; 24; 25; 31; 32]. IoU is the intersection of the combined points of the predicted and actual frames. In this study, the object was considered to be successfully recognized when the IoU was greater than 0.5. Additionally, the calculations of mAP, Precision, Recall, and F1-score based on the IoU of 0.5 is as follows:  
\[\text{mAP}=\frac{\sum\text{AP}}{N_{\text{C}}}, \tag{16}\]  
where \(N_{\text{C}}\) is the target type. AP is  
\[\text{AP}=\frac{\sum\text{Precision}}{N}, \tag{17}\]  
Figure 6: Architecture of YOLOv3-tiny. where \(N\) is the number of pictures. Precision, recall, and F1-score are expressed as  
\[\text{Precision}=\frac{\text{TP}}{\text{TP}+\text{FP}}, \tag{18}\]  
\[\text{Recall}=\frac{\text{TP}}{\text{TP}+\text{FN}}, \tag{19}\]  
\[\text{F1}=\frac{2\times\text{Precision}\times\text{Recall}}{\text{Precision}+ \text{Recall}}, \tag{20}\]  
where TP is a positive sample that is correctly classified, FP is a positive sample that is misclassified, and FN is a negative sample that is misclassified. Regarding the tiny-416 and tiny-6081 models, based on the results of 6000 epochs of training experiments, it is clear that the IoU, precision, recall, F1-score, and mAP of the tiny-6081 model are better than those of the tiny-416 model, as shown in Table 1. This verifies that the larger the resolution of the picture, the better the recognition of the small objects. In addition, the number of training epochs is positively correlated with accuracy, but numerous monotonic samples may lead to overfitting, making it difficult to identify images that are not in the training set. Therefore, this study adjusted the number of training epochs from 6000 (tiny-6081 model) to 12,000 (tiny-6082 model) in the initial training by YOLOv3-tiny. Table 1 shows that the IoU, precision, recall, F1-score, and mAP of the tiny-6082 model are better than those of the tiny-6081 model. In addition to using YOLOv3-tiny, this study trained a model using YOLOv3 as well for comparison purposes. In the comparative experiment, the input image was trained with 12,000 epochs at the 416 \(\times\) 416 (v3-416 model) and 608 \(\times\) 608 (v3-608 model) resolutions by YOLOv3, and the 608 \(\times\) 608 (v4-608 model) resolution by YOLOv4. The training results in Table 1 show that the IoU, precision, recall, F1-score, and mPA of the v3-416, v3-608, and v4-608 models are better than those of the tiny-6082 model. Moreover, the performance of the v4-608 model by YOLOv4 is the best of all models in Table 1. However, the execution speed of the tiny-6082 model is approximately 2.5 times that of the v3-416, v3-608, and v4-608 models. Additionally, the execution speeds of the v3-416, v3-608, and v4-608 models perform below 20 fps. Live-action TV videos like sports and concerts are typically at least 24 fps or more [27]. Therefore, this study utilized the tiny-6082 model with an image resolution of 608 \(\times\) 608 pixels and 12,000 epochs of training set to complete the recognition of the baseball and its flight trajectory.