# A New Instrument Monitoring Method Based on Few-Shot Learning
## 3 Results and Discussion  
For the digital instrument monitoring, the measurement results of different methods are shown in Table 2, where ACC represents the average accuracy. The calculation method of ACC is \(ACC=(TN+TP)/(TN+TP+FN+FP)\), in which the TP represents True Positive, FP represents False Positive, FN represents False Negative, TN represents the True Negative. For our task, the TN is not suitable so is set to be 0 for all methods. Furthermore, the Human measurements are selected as the gold standard in the form of ignoring random errors and are considered to be 100%, and all other results will be measured against human results. Although the manual measurement is the most accurate method, it also has the slowest detection speed. For a single image with eight digits, the average time to detect and record each digital value is 22.925 s. Template Matching is limited by the difficulty of automatic threshold selection during threshold segmentation step and is susceptible to factors such as noise, light, and uneven screen color, resulting in a large difference between the segmentation result and the template. The above reasons lead to a large number of erroneous and missing results of template matching, with the lowest accuracy of 49.2% and a relatively slow detection speed. Compared with the traditional methods, the deep learning algorithms have improved the recognition results significantly, and the accuracies of the Pure YOLOv5 and Mask R-CNN models that are trained with 280 real data are 84.1% and 89.6%, respectively.Both methods are among the most widely used deep learning algorithms for target detection in industry and academia. In general, Pure YOLOv5 has faster detection speed but more False Negative targets, and Mask R-CNN has higher average accuracy but more false positive targets. Pure YOLOv5 adopts the mosaic augmentation method, which can effectively increase the number of targets in the training image but cannot accurately simulate random permutations of numbers, so the overall accuracy is lower than that of FLIMM. A typical example of detection results is shown in Figure 6. Template matching has one False Positive result and two False Negative results, Mask R-CNN has one False Negative result and one False Positive result, Pure YOLOv5 has two False Negative results, and all results of FLIMM are correct. So, the accuracy of Mask R-CNN and Pure YOLOv5 is higher than template matching but lower than FLIMM. FLIMM is pre-trained with a large number of simulation-generated images (Figure 2b), which largely produces the possible alignments in the real situation. The model was then fine-tuned with single-digit simulated images (Figure 2c) generated from 16 real images, effectively achieving an average accuracy of more than 99%. Figure 7 shows the confusion matrix of FLIMM, and it can be clearly found that the detection rate of all kinds of samples is maintained at a high level of over 96%, which proves the effectiveness of the FLIMM \begin{table}
\begin{tabular}{l c c c c c} \hline \hline
**Method** & **TP** & **FP** & **FN** & **ACC** & **Detection Time/s** \\ \hline Human & 2581 & 0 & 0 & 100\% & 22.925 \\ Template Matching & 1672 & 815 & 909 & 49.2\% & 15.971 \\ Pure YOLOv5 & 2170 & 0 & 411 & 84.1\% & 0.107 \\ Mask R-CNN & 2361 & 53 & 220 & 89.6\% & 4.131 \\ FLIMM & 2560 & 0 & 21 & 99.2\% & 0.092 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison of the results of different methods for the test dataset. Figure 6: An example of the detection results. (**a**) Original Image. (**b**) Template Matching result. (**c**) Mask R-CNN result. (**d**) Pure YOLOv5 result. (**e**) FLIMM result. The detection results of (**b**) are, from left to right: 0,1,1,0,0,0 1, where the last two digits are missed and a 0 is mistakenly checked for 1 at the same time. The results of mask detection in (**c**) are, from left to right: 0,1,0,0,0,2,2 and 6, where the second bit is missed and the last bit is incorrectly detected by an additional 2.