# An Intelligent Error Correction Algorithm for Elderly Care Robots
## 3 Intelligent Error Correction Algorithm
### Error Correction Algorithm Based on Convolution Layer
In order to increase the degree of difference between the two groups of data, the data is fitted with a curve, assuming that the point set is \(\mathrm{D}=\left\{\left(0,\gamma_{1,i}\right),\ \left(1,\gamma_{2,i}\right) \cdots\left(143,\gamma_{12,i}\right)\right\}\), finding approximate Equation (3). \[y=\phi(x)=a_{0}+a_{1}x+\cdots a_{k}x^{k}. \tag{3}\]  
Using the method of minimum deviation absolute Equation (4), we calculate the Pearson similarity [30] of the fitted curve. Equation (5) is the calculation equation of the Pearson similarity. Because there are 256 channels, we need to calculate 256 \(a_{i}\). \[\underset{\phi}{min}\underset{i=1}{\overset{144}{\sum}}|\delta_{i}|=\underset {i=1}{\overset{144}{\sum}}|\phi(x_{i})-y_{i}|, \tag{4}\]  
\[a_{i}=getSimilarity(X,Y)=\frac{Cov(X,Y)}{\sqrt{Var|x|Var|Y|}}. \tag{5}\]  
To select the two groups of matrices with the biggest difference, it is necessary to select the one with the smallest Pearson correlation coefficient, and use this method to calculate the layer numbers of the matrices with the biggest difference between 01 and 02, 01 and 03, 02 and 03, which are counted as \(x_{1}\), \(x_{2}\) and \(x_{3}\), and stored in the database, as shown in Figure 4.  
The error-correction algorithm will use a kind of game rule, that is, 01, 02, 03 to play a game, and use the round-robin rule. The winner who wins two games is the final winner  
Figure 4: Matrix layer number selection diagram. The advantage is that the data with the greatest difference can make the experimental results clear. The general process is shown in Figure 5.  
The feature matrices with layer numbers \(x_{1}\), \(x_{2}\), and \(x_{3}\) are extracted from the feature array of real-time recognition. First, we need to calculate the similarity between the x\({}_{1}\) layer characteristic matrix and the \(x_{1}\) layer matrix of 01 and 02 and record the gesture numbers with greater similarity. If the correct identification number is 01 at this time, we choose the feature matrix layer with the biggest difference between 01 gesture and 02 gesture, so this game is equivalent to comparing the strengths of 01 with the weaknesses of 02, and the result is very obvious. Using the same method to calculate the similarity between the \(x_{2}\) layer feature matrix and the \(x_{2}\) layer matrix of 01 and 03, and the similarity between the \(x_{3}\) layer matrix and the \(x_{3}\) layer matrix of 02 and 03. Finally, the two winning gesture numbers are selected as the error correction result. Detailed algorithm steps are shown in Algorithm 1. ```
1:Input: Gesture recognition number \(m^{*}\); Initialization \(n=0\). 2:Output: Correct gesture type number \(n\). 3:If (Input (?) \(\Rightarrow\) Output \(m^{*}\))
4:Search (?) = (\(m\), \(p\), \(q\));
5:Search Matrix layer number with the largest difference from (\(m\) and \(p\)) = \(x_{1}\), (\(m\) and \(q\)) = \(x_{2}\), (\(p\) and \(q\)) = \(x_{3}\);
6:\(a_{1}\gets getSimilarity\) (\(m^{*}\), \(m.x_{1}\));/* The similarity between layer \(x_{1}\) channel of \(m^{*}\) and layer \(x_{1}\) channel of \(m\) is calculated. */
7:\(a_{2}\gets getSimilarity\) (\(m^{*}\), \(x_{1}\), \(p.x_{1}\))
8:If (\(a_{1}\) > \(a_{2}\)) \(M\)++; else P++; /* \(M\) is the number of times \(m\) wins, \(P\) is the number of times \(p\) wins, and if\(a_{1}\) > \(a_{2}\), \(m\) wins. */
9:\(a_{3}\gets getSimilarity\) (\(m^{*}\), \(x_{2}\), \(m.x_{2}\));
10:\(a_{4}\gets getSimilarity\) (\(m^{*}\), \(x_{2}\), \(q.x_{2}\));
11:if (\(a_{3}\) > \(a_{4}\)) \(M\)++; else Q++;
12:\(a_{3}\gets getSimilarity\) (\(m^{*}\), \(x_{3}\), \(m.x_{3}\));
13:\(a_{4}\gets getSimilarity\) (\(m^{*}\), \(x_{3}\), \(q.x_{3}\));
14:if (\(a_{5}\) > \(a_{6}\)) P++; else Q++;
15:For (\(M\), \(P\)) 0 is 2/* Find out who won two games, because everyone can play two games at most. */
16:If (\(m\) = \(2\)) = \(m\) = \(m_{1}\)/* Correct the recognition gesture category to \(m\). */
17:If (\(P\) = \(2\)) = \(n\) = \(p\);
18:If (\(q==2\)) = \(q\);
19:If (\(n==0\)) Reenter gesture command;/* No best match template found.