# A New Instrument Monitoring Method Based on Few-Shot Learning
## 2 Methods and Dataset
### Data Augmentation  
Deep neural networks have higher accuracy and better sensitivity than traditional algorithms for complex backgrounds, noisy environments, and random targets. However, traditional neural networks usually require a large amount of training data, at least hundreds for a single class. Because the actual environment is often high temperature, high radiation, and high pollution, data collection for specific scenarios may be expensive and dangerous. In addition, instrument panels often consist of multiple digits that need to be manually labeled bit by bit, which also makes data annotation costly. In order to minimize data collection costs and improve data annotation efficiency, we propose a Fully Automated Digital Generation and Annotation Method. In the design of the data augmentation method, we refer to the self-attention mechanism, and consider that the background information is less useful for on-screen digital recognition, although it accounts for a relatively large part of the whole image, and the real useful information comes from the digital distinction on the screen. Therefore, in the simulation, we focused on the simulation of the arrangement and combination pattern of different numbers on the screen, so as to achieve higher accuracy with less raw data for the recognition in specific scenes. In our simulation method we also have multi-digit and single-digit, where multi-digit means that multiple freely arranged digits are simulated by the FLIMM method and single-digit is simulated as a single digit. The multi-digit is mainly used with a blank screen background to simulate as many digit combinations as possible, while the single-digit is mainly used with a screen image with digits to rewrite specific digits to enhance the recognition of confusing digit pairs (e.g., 6 and 9). For the multi-digit augmentation mode of FADGAM, it calculates the starting coordinates of the first screen digits number (N1) as the initial input parameter. Since the screen remains horizontal, \(y_{1}\) remains unchanged for all digits, and \(x_{1}\) decreases with equal spacing, showing the characteristics of arithmetic sequence numerically. The \(x\)-coordinates of other digits are calculated as the Formula (1) shows:  
\[x_{n}=x_{1}-k*I_{w}\qquad k\bigg{\{}0,1,...,\frac{S_{w}}{I_{w}}\bigg{\}},P_{k=i }=\frac{I_{w}}{S_{w}} \tag{1}\]  
\[y_{n}=y_{1} \tag{2}\]  
in which the \(x_{1}\) is the x-coordinate of N1, \(I_{w}\) is the interval value between adjacent digit centers, \(S_{w}\) is the width of the screen, and \(k\) is a set of the array with positive integers \(\geq 0\). Since \(k\) is the core parameter that controls the number of digits generated by FADGAM, in order to prevent the situation where two digits repeatedly select the same digit, in the actual algorithm, FADGAM uses the combination of random.sample() function and range() function of python by random.sample(range(\(n_{s}\),\(n_{e}\)),\(n_{t}\)) to construct a sequence \(K\) with \(n_{t}\) number, and \(n_{t}\) is a positive integer. For the above function, range() is used to build a sequence of numbers spaced 1 apart starting with \(n_{s}\) and ending with \(n_{e}\), random.sample() is used to pick \(n_{t}\) numbers from the sequence randomly. For example, our experiment set the \(n_{s}=0\), \(n_{e}=15\), and \(n_{t}=10\), which means randomly picking 10 numbers from the array [0,1,2,...,15] with non-repetitive ordering, such as [3,1,4,5,6,8,9,0,2,11]. Furthermore, the above-selected arrays are used as \(K\) values to calculate the x-coordinates (\(x_{n}\)) of the numbers 0-9 in turn, thus realizing the simulation of the random position arrangement of numbers. After calculating the center position of each generated figure, the FADGAM core performs edge region fusion through the seamlessClone function that is provided by OpenCV during image fusion. The seamlessClone function used in this paper requires five parameters: SRC, DST, MASK, POINT, FLAGS.