# A Symbol Recognition System for Single-Line Diagrams Developed Using a Deep-Learning Approach
## 4 Experiments and Results
### Evaluation of YOLO V5 Training
#### 4.2.3 Results and Evaluations  
The prediction results of the classification task were classified into four categories based on the relationship between the prediction output and the ground-truth value: (a) True Positive (TP); (b) True Negative (TN); (c) False Positive (FP); and (d) False Negative (FN). This study evaluated the effectiveness of defect detection by calculating the precision, recall, and F1 scores of the detection model for various types of defects. The precision rate reflects the accuracy of the detection findings and is calculated as the ratio of correctly predicted positive samples to all predicted positive samples. The recall rate measures the comprehensiveness of the detection findings and is calculated by dividing the number of correctly predicted positive samples by the total number of actual positive occurrences.  
\[\text{Precision }=\frac{\text{TP}}{\text{TP }+\text{FP}} \tag{23}\]  
\[\text{Recall }=\frac{\text{TP}}{\text{TP }+\text{ FN}} \tag{24}\]  
The classification issue should consider both the precision of classification and the thoroughness of detection. To assess the model by combining precision and recall, the F1 score is used:  
\[\text{F1}-\text{score }=\frac{2}{\frac{1}{\text{Precision}}+\frac{1}{\text{Recall }}}=\frac{2\cdot\text{Precision}\cdot\text{Recall}}{\text{Precision }+\text{Recall}} \tag{25}\]  
Table 3 presents the detection data. Every row represents the predicted category, and every attribute represents the actual class. The overall number of symbols in each category is represented by the sum of each column. The predicted category and the overall number of predicted symbols for each category are shown in each row. Our proposed approach can essentially detect a majority of single-line-based engineering symbols while ensuring accuracy. In this study, the average recall rate was 90.67%, the precision of all kinds of symbol detection was above 90%, and the F1 score was greater than 0.9. The average recollection rate was 90.67%, the average detection time for each frame was 0.074 s, and the average detection time for each frame was 0.074 s.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Symbol Name** & **Original Symbol** & **Original Instances** & **Generated Symbol** & **Generated Instances** \\ \hline \hline Voltmeter & \(\bigtriangleup\) & 66 & \(\bigtriangledown\) & 600 \\ CT & \(\bigtriangleup\) & 102 & \(\bigtriangleup\) & 569 \\ Circuit Breaker & \(\bigtriangleup\) & 298 & \(\bigtriangleup\) & 610 \\ Delta & \(\bigtriangleup\) & 158 & \(\bigtriangleup\) & 690 \\ Transformer & \(\bigtriangledown\) & 89 & \(\bigtriangleup\) & 577 \\ Inductance & \(\bigtriangleup\) & 35 & \(\bigtriangleup\) & 687 \\ Generator & \(\bigtriangleup\) & 309 & \(\bigtriangleup\) & 689 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Symbol instances in original and synthetic datasets.  
The model was divided into two groups in this research, each with its own dataset. The second group used both the real images and the DCGAN and LSGAN synthetic images, as opposed to the first group, which only employed actual images. Table 4 displays the training achievement results. Additionally, the Group 2 (original pictures, DCGAN, and LSGAN) dataset achieved the highest mAP of approximately 99.83% with an IoU of 73.11% for YOLO V5. As a consequence, Table 4 shows that combining real and fake images strengthened all models and raised the percentages of IoU and mAP. In this research, the boundary of the real object served as the ground truth to determine how much our predicted border overlapped with it.