# A Visual Human-Computer Interaction System Based on Hybrid Visual Model

Authors: Ziyi Ke; Ziqiang Chen; Huanlei Wang; Liang Yin
Journal: Security and Communication Networks
 (2022)

---

## Abstract

The traditional human-computer interaction is mainly through the mouse, keyboard, remote control, and other peripheral equipment electromagnetic signal transmission. This paper aims to build a visual human-computer interaction system through a series of deep learning and machine vision models, so that people can achieve complete human-computer interaction only through the camera and screen. The established visual human-computer interaction system mainly includes the function modes of three basic peripherals in human-computer interaction: keyboard, mouse (X-Y position indicator), and remote control. The convex hull method was used to switch between these three modes. After issuing the mode command, Gaussian mixture was used to quickly identify the moving human body to narrow the scope of our image processing. Subsequently, finger detection in human body was realized based on the Faster-RCNN-ResNET50-FPN model structure, and realized the function of moving mouse and keyboard through the relationship between different fingers. At the same time, the recognition of human body posture was done by using MediaPipe BlazePose, and the action classification models were established through the Angle between body movements so as to realize the control function of remote control. In order to ensure the real-time performance of the interactive system, according to the characteristics of different data processing processes, CPU and GPU computing power resources are used to cross-process images to ensure the real-time performance. The recognition accuracy of the human-computer interaction system is above 0.9 for the key feature points of human body, and above 0.87 for the recognition accuracy of four kinds of command actions. It is hoped that vision-based human-computer interaction will become a widely used interaction mode in the future.


---

## Body

## 1. Introduction

With the continuous development of computer technology and artificial intelligence, many new forms of human-computer interaction (HCI) [1] have appeared. The tracking and recognition of human movements based on computer vision is becoming a new generation of human-computer interaction [2]. In practical application scenarios, the realization of human motion recognition and tracking needs real-time work, which puts forward higher requirements for algorithm processing speed, accuracy, and hardware conditions. Heterogeneous computing based on CPU and GPU has become one of the mainstream modes in the field of high-performance computing. Meanwhile, most PC are equipped with GPU, and Nvidia offers a mature set of accelerated computing languages, libraries, and tools (CUDA C/C ++) for accelerated computing [3], which greatly improves the processing speed of complex high-precision models. This makes it possible to preprocess images in real-time operation.Over the past decade, many researchers have made great efforts to help computers better understand human movement language. In 2014, RCNN was published in CVPR2014 by Girshick and Donahue [4], which applied CNN method to target detection task for the first time. In the same year, Girshick improved this method and proposed the Fast R-CNN [5]. In 2015, Ren and He proposed the Faster R-CNN [6] and proposed the RPN method to generate candidate regions of objects. In this method, the traditional image processing algorithm is no longer needed to generate candidate regions. In 2017, He and Kioxari proposed the Mask R-CNN [7]. In 2015, four scholars from Microsoft Research proposed convolutional neural network [8]. Ghiasi and Lin proposed FPN algorithm in their paper published by CVPR in 2017 [9], using feature pyramid for target detection. This method is helpful for preserving image features in the process of image processing. Actions input from a regular camera can already be tracked in real time using Google tools (e. g., Google Mediapipe): Zhang and Bazarevsky provide a real-time device hand tracking pipeline for AR/VR applications that can predict hand bones from a single RGB camera [10]. Moreover, the model has been further improved, and the lightweight model can be widely used in various intelligent terminal devices. Caputo et al. optimized the processing models of static gesture language and dynamic gesture language [11]. Ahmadzadeh Esmaeilabadi established a graphics preprocessing method with small computational load [12]. Based on a variety of visual models, there are many visual interaction schemes in engineering technology, but most of them have realized limited functions. For mature HCI system also need to establish a set of complete interaction system. Besides, the switching of different interactive functions also needs to be improved.In this paper, based on the Faster-RCNN-ResNET50-FPN, MediaPipe BlazePose and other various Machine learning models, we mainly explore how to build a real-time visual interactive system, which can replace the physical peripheral interactive devices such as mouse, keyboard, and remote control to control the computer. The visual interaction system can be used as a supplement to the existing physical interaction, sensor interaction, and customized interaction. It is a cost-effective human-computer interaction scheme and provides a new choice for human-computer interaction.


## 2. Preliminaries

### 2.1. System Definition and Segmentation

The visual human-computer interaction scheme proposed by Saada and Mohamed gives us a lot of inspiration [13]. The input data is a sequence of images captured by the camera. Images used as training sets were obtained through cameras in advance, and key points needed to be detected and tracked were defined according to the needs of constructing visual interaction system. Meanwhile, algorithm model was built to track and locate these key points for the following visual interaction system. Visual interaction system is mainly divided into three modes: (1) mouse control, (2) remote control switch, and (3) virtual keyboard input. The switching between the modes is carried out after the corresponding actions are recognized by the machine, that is, the three modes are switched through gesture recognition. First of all, the interactive system will first conduct gesture recognition, and identify different gestures to decide which mode to use. Here, the three patterns are realized by the recognition of the left hand and right hand thumb and index finger, the recognition of the limb, and the recognition of the finger of one hand. After the image is acquired by the camera, the GPU is used to accelerate the image preprocessing, and then the motion is recognized and tracked by the trained model. Finally, corresponding instructions are given to the computer. The entire process is shown in Figure 1:Figure 1
Overall structure.


### 2.2. Gesture Recognition and Mode Selection

In order to implement the three different forms of interaction, each of them requires a different detection point. By splitting the three models into three parts and enabling only one algorithm at a time, the interactive system can speed up its processing performance by avoiding the need to categorize all checkpoints each time. Different gestures can be used at the start of the process, and three different modes can be launched for different gestures. Since this step is expected to be carried out on the host and only a simple classification of gestures is required, the convex hull method with low accuracy is used to detect the outline of gestures so as to initiate different interaction modes [14]. Convex hull is relative to a set of points, also known as the convex hull of a set of points. For a set of points, if there is a convex polygon that completely contains all the points in the set, then the convex polygon is called the convex hull of the set. The shape of the hand is a simple polygon outline, so here the convex hull can be used to identify the outline of the gesture. Considering that the system only needs to recognize several gestures, it is reasonably making use of the characteristics of different gestures on the tightness of the convex hull to distinguish these gesture contours. In this paper, the tightness of the gesture contour to its convex hull as the gesture convexity is represented by δ, and its value is the area ratio of the gesture contour to the convex hull.(1)δ=contour Areahull Area,hullArea is the area of convex hull, contourArea is the area of gesture contour, then it can identify three different gesture commands by the ratio of their areas. The following Figure 2 shows a simple definition of four start gestures that will launch different detection programs after recognition of the gesture.Figure 2
Convex hull method for four kinds of priming recognition gestures. (a) Mouse. (b) Control. (c) Keyboard. (d) Exit.
(a)(b)(c)(d)This detection box will always remain in the top right corner of the screen, and only those within this area will be identified using convex hull method. To switch mode, it is only needed to move hands to the corresponding box on the screen and make the corresponding switching gesture. At the same time, convex hull method can also get good performance when running on CPU.


### 2.3. Image Processing

Background subtraction can be used to quickly lock images of moving objects before input to trained models. Gaussian mixture method is a common method for image preprocessing, which is very effective for modeling background. Gaussian mixture method is used to subtract background from video stream to separate foreground and background. The background is constantly updated from the frame sequence, and a mixed K-Gaussian distribution is used to classify pixels as foreground or background. Here, the intensity of continuous variation is classified as foreground intensity, and the intensity of long periods of absence is classified as background intensity. Then, the boundary between foreground and background is detected, and also the smallest and largest coordinate points.X and Y in the boundary are found. Mixed Gaussian (MoG) [15] uses K Gaussian components, each with a weight wi,t, an intensity mean ui,t, and a standard deviation σi,t(2)∑i=1kwi,tηu;ui,t,σi,t.MoG uses multiple Gaussian components to simulate the background of a pixel. Each Gaussian component is represented by three parameters: mean value (BG gray intensity), weight, and deviation. By comparing the newly input pixel value with the original pixel value, the changing area can be quickly determined to locate the detected object, which can reduce the range of subsequent target detection and tracking and improve the accuracy of the model, as shown in Figure3.Figure 3
Primary background elimination, after the video stream is processed, the portrait is extracted first to reduce the workload of the following model. (a) Input. (b) Mixture of Gaussians (MoG). (c) Background subtraction.
(a)(b)(c)Different from target detection, Gaussian mixture method is sensitive to moving targets, but insensitive to stationary objects. In an interactive system, the range of movement of human beings in the interaction process is limited, so it is only necessary to determine the position of human beings detected when they move, which can greatly reduce the need for hardware. This kind of image processing does have a disadvantage; relying on the CPU alone to process the image will reduce the input FPS while it can still meet the simple positioning requirements of the interactive system. As shown in Figure4, if GPU acceleration is used in this process, image processing efficiency can be greatly improved. The following figure shows the statistics of ordinary CPU video stream, FPS after MoG processing under CPU and GPU acceleration.Figure 4
The difference of real-time performance of video stream under the support of the same algorithm and different hardware devices.


## 2.1. System Definition and Segmentation

The visual human-computer interaction scheme proposed by Saada and Mohamed gives us a lot of inspiration [13]. The input data is a sequence of images captured by the camera. Images used as training sets were obtained through cameras in advance, and key points needed to be detected and tracked were defined according to the needs of constructing visual interaction system. Meanwhile, algorithm model was built to track and locate these key points for the following visual interaction system. Visual interaction system is mainly divided into three modes: (1) mouse control, (2) remote control switch, and (3) virtual keyboard input. The switching between the modes is carried out after the corresponding actions are recognized by the machine, that is, the three modes are switched through gesture recognition. First of all, the interactive system will first conduct gesture recognition, and identify different gestures to decide which mode to use. Here, the three patterns are realized by the recognition of the left hand and right hand thumb and index finger, the recognition of the limb, and the recognition of the finger of one hand. After the image is acquired by the camera, the GPU is used to accelerate the image preprocessing, and then the motion is recognized and tracked by the trained model. Finally, corresponding instructions are given to the computer. The entire process is shown in Figure 1:Figure 1
Overall structure.


## 2.2. Gesture Recognition and Mode Selection

In order to implement the three different forms of interaction, each of them requires a different detection point. By splitting the three models into three parts and enabling only one algorithm at a time, the interactive system can speed up its processing performance by avoiding the need to categorize all checkpoints each time. Different gestures can be used at the start of the process, and three different modes can be launched for different gestures. Since this step is expected to be carried out on the host and only a simple classification of gestures is required, the convex hull method with low accuracy is used to detect the outline of gestures so as to initiate different interaction modes [14]. Convex hull is relative to a set of points, also known as the convex hull of a set of points. For a set of points, if there is a convex polygon that completely contains all the points in the set, then the convex polygon is called the convex hull of the set. The shape of the hand is a simple polygon outline, so here the convex hull can be used to identify the outline of the gesture. Considering that the system only needs to recognize several gestures, it is reasonably making use of the characteristics of different gestures on the tightness of the convex hull to distinguish these gesture contours. In this paper, the tightness of the gesture contour to its convex hull as the gesture convexity is represented by δ, and its value is the area ratio of the gesture contour to the convex hull.(1)δ=contour Areahull Area,hullArea is the area of convex hull, contourArea is the area of gesture contour, then it can identify three different gesture commands by the ratio of their areas. The following Figure 2 shows a simple definition of four start gestures that will launch different detection programs after recognition of the gesture.Figure 2
Convex hull method for four kinds of priming recognition gestures. (a) Mouse. (b) Control. (c) Keyboard. (d) Exit.
(a)(b)(c)(d)This detection box will always remain in the top right corner of the screen, and only those within this area will be identified using convex hull method. To switch mode, it is only needed to move hands to the corresponding box on the screen and make the corresponding switching gesture. At the same time, convex hull method can also get good performance when running on CPU.


## 2.3. Image Processing

Background subtraction can be used to quickly lock images of moving objects before input to trained models. Gaussian mixture method is a common method for image preprocessing, which is very effective for modeling background. Gaussian mixture method is used to subtract background from video stream to separate foreground and background. The background is constantly updated from the frame sequence, and a mixed K-Gaussian distribution is used to classify pixels as foreground or background. Here, the intensity of continuous variation is classified as foreground intensity, and the intensity of long periods of absence is classified as background intensity. Then, the boundary between foreground and background is detected, and also the smallest and largest coordinate points.X and Y in the boundary are found. Mixed Gaussian (MoG) [15] uses K Gaussian components, each with a weight wi,t, an intensity mean ui,t, and a standard deviation σi,t(2)∑i=1kwi,tηu;ui,t,σi,t.MoG uses multiple Gaussian components to simulate the background of a pixel. Each Gaussian component is represented by three parameters: mean value (BG gray intensity), weight, and deviation. By comparing the newly input pixel value with the original pixel value, the changing area can be quickly determined to locate the detected object, which can reduce the range of subsequent target detection and tracking and improve the accuracy of the model, as shown in Figure3.Figure 3
Primary background elimination, after the video stream is processed, the portrait is extracted first to reduce the workload of the following model. (a) Input. (b) Mixture of Gaussians (MoG). (c) Background subtraction.
(a)(b)(c)Different from target detection, Gaussian mixture method is sensitive to moving targets, but insensitive to stationary objects. In an interactive system, the range of movement of human beings in the interaction process is limited, so it is only necessary to determine the position of human beings detected when they move, which can greatly reduce the need for hardware. This kind of image processing does have a disadvantage; relying on the CPU alone to process the image will reduce the input FPS while it can still meet the simple positioning requirements of the interactive system. As shown in Figure4, if GPU acceleration is used in this process, image processing efficiency can be greatly improved. The following figure shows the statistics of ordinary CPU video stream, FPS after MoG processing under CPU and GPU acceleration.Figure 4
The difference of real-time performance of video stream under the support of the same algorithm and different hardware devices.


## 3. Interaction Detection

### 3.1. Gesture Control Mouse

In the visual interaction system, we hope that the mouse on the screen can follow the movement of the finger of the right hand, and at the same time can adjust the continuous changes of volume, size, and zoom by the distance between the index finger and thumb of the left hand. Not surprisingly, it all has to do with how to detect the thumb and index finger positions on both hands in the video. Here, the Faster-RCNN-ResNet50-FPN algorithm is used to detect the locations of these key points. The training data set mainly consists of the pictures obtained by the camera, and the four finger tips are marked for the training of the model.The main part is mainly composed of Transform, RESNET-50, FPN, RPN, and ROI, as we could see in Figure5. Due to the different sizes of background images obtained during image pretreatment, it is easier to use neural network for processing after image pretreatment. The first step is to transform the image and coordinate through a partial Transform. Then, it was sent to resNET-50 for feature extraction. Next, it is fed to FPN, which will build a feature pyramid and provide input feature map to RPN. RPN will generate the region proposals. Finally, object region, labels of each region, and scores of each region are detected through ROI.Figure 5
Overall structure.The input from Transform is a list of images, and the output is the transformed image tensor. There are three main steps. First, the image is normalized. The resulting tensor values are now distributed near 0, which is easier for neural network processing. The input image is scaled based on length or width, resulting in a scaled image. Interpolate in PyTorch is used to interpolate an image tensor batch_images. The ResNet50-FPN is used of which its source code is provided in torch vision, which is shown in Table1.Table 1
Architecture of ResNet50.
Layer nameOutput size50-layerconv1112 × 1127 × 7,64, stride 2conv2_x56 × 563 × 3 max pool, stride 256 × 561×1,643×3,641×1,256×3conv3_x28 × 281×1,1283×3,1281×1,512×4conv4_x14 × 141×1,2563×3,2561×1,1024×6conv5_x7 × 71×1,5123×3,5121×1,2048×3If only Faster RCNN is used for target detection, ROI will apply only to the last layer. This has no problem in the detection of large targets, but if it is used in the detection of small targets like fingers, when the convolutional pooling reaches the last layer, the semantic information is actually gone. Therefore, in order to solve the problem of multi-scale detection, the feature pyramid network (FPN) is introduced [16]. FPN is designed to utilize the pyramid form of CNN level features and generate feature pyramids with strong semantic information at all scales [17]. Therefore, top-down structure and horizontal connection are designed in FPN to integrate shallow layer with high resolution and deep layer with rich semantic information. The model is divided into three parts: the bottom-up pathway on the left and the top-down pathway on the right. ResNet50 is exported from each layer on the left to the pathway on the right, which is called lateral connections. Feedforward calculation of CNN is the bottom-up path. For ResNets, it is mainly the feature activation output of the last residual structure at each stage. The top-down approach is to sample the upper-level feature map with stronger semantics, and then connect the features with lateral connections to the features of the previous layer, so that the upper-level features are strengthened. The connection details are displayed in the rectangular box. The process of connection is to double upsampling (nearest upsampling method) for the high-level features, and then convolve it with the corresponding previous layer by 1∗1, and then combine the features of the two by adding between pixels. The process is repeated until the finest feature map is produced. In general, FPN can be expressed by the following formula:(3)FPN=Top−downpathway+laterconnection.Finally, the model uses a3∗3 convolution kernel to process the fused feature images to generate the final required feature images. These outputs will be fed into the RPN network for background foreground dichotomy and bound-box regression, as shown in Figure 6.Figure 6
The Resne-50 is used in combination with FPN action diagrams.RPN (Region Proposal Network) is mainly used to generate regional Proposal, a multi-scale Anchor based on the introduction of the Network model, with SoftMax to sort anchors (background or foreground), And Bounding Box Regression is used to make Regression prediction for anchor to obtain the precise position of the Proposal, which is used for subsequent target identification and detection.RPN determines whether an Anchor belongs to the foreground or background by calculating the IoU of Anchor and tag. IoU refers to the proportion of the common parts of two boxes to all parts (the overlap ratio). When IoU is greater than a certain value, the truth value of this Anchor is foreground; when IoU is lower than a certain value, the truth value of this Anchor is background. In terms of the true value of the offset, assuming that the central coordinates of Anchor arexa and ya, the width and height are wa and ha, respectively, the central coordinates of label are x and y, and the width and height are w and h, respectively, the corresponding offset truth calculation formula is obtained(4)tx=x−xawa,ty=y−yaha,tω=logwwa,th=loghha.The position offsetth and ty are normalized by width and height, while the width and height offset th and tw are logarithmic, which further limits the range of offset and facilitates prediction. Given the above truth values, RPN obtains the predicted values of category and offset, respectively, through the convolutional network in order to calculate the loss. To be specific, RPN needs to predict the probability that each Anchor belongs to foreground and background, as well as the offset of real objects relative to Anchor. In addition, after the predicted offset is obtained, the predicted offset can be applied to the corresponding Anchor to obtain the actual position of the prediction box. If there is no Anchor, it is necessary to directly predict the coordinate of each frame for object detection. Since the coordinate of the frame varies greatly, it is difficult for the network to converge and make accurate prediction. Anchor is equivalent to providing a prior ladder, so that the model can predict the offset of Anchor and better approach the real object. The loss function of RPN includes classification and regression:(5)Lpi,ti=1Ncls∑iLclspi,pi∗+λ1Nreg∑ipi∗Lregti,ti∗,∑iLclspi,pi∗,represents the loss of classification for 256 filtered Anchors, with Pi being the category truth value for each Anchor and P∗ being the predicted category for each Anchor. Since the role of RPN is to select the Proposal, it does not require the segmentation of which kind of prospect, so it is dichotomous at this stage, and cross entropy loss is used. ∑ipi∗Lregti,ti∗ represents a return to loss. Regression loss uses the smoothL1 function, and the specific formula is(6)Lregti,t∗=∑i∈x⋅y⋅w⋅hsmoothL1ti−t1∗,smoothL1x=0.5x2,ifx<1,x−0.5,otherwise.As can be seen from the second formula of the formula, smoothL1 function combines the first-order loss function with the second-order loss function. The reason is that when there is a large gap between the predicted offset and the truth value, the derivative of the second-order function is too large and the model is easy to diverge rather than converge. Therefore, the first-order loss function with a smaller derivative is adopted when it is greater than 1. Finally, the convolutional layer processes the feature maps of each layer and splices them, and the sequence after splicing is arranged. The ROI steps are mainly as shown in Figure 7: ROI will input Proposal Boxes selected from RPN and multi-layer feature map output from FPN into ROI Pool. Box ROI Pool determines which layer feature map to select for ROI Pool operation according to the area of Proposal Box. It is then fed into the Box Head, which consists of two fully connected layers. Next, the results obtained from Box Head processing are further classified and the Box offset is used for numerical regression. Softmax was applied to the classification results, and the final classification was carried out. Then, the position offset regression results of Box were combined with Proposal boxes to obtain the adjusted Detection boxes. Finally, maximum value suppression (NMS) was applied to filter out valid results.Figure 7
The flow chart of ROI.Box ROI Pool can process multiple images at the same time and detect the objects in each image, respectively. Therefore, first of all, convert to ROi format is required to merge the feature images of each layer of each image together for unified ROI Align processing. Setup_scales configure mapper objects for the first four output feature maps (the smallest pool layer is not used). Mapper is a new concept introduced in FPN. It mainly calculates the area of the Proposal Box and calculates which feature layer to perform ROI Align according to the area. It can be expressed as the following formula:(7)k=k0+log2wh224.The image below shows the effect of the model. At the same time, the coordinates of the obtained boxes are calculated to calculate their midpoint. With the midpoint as the center of the circle, a small circle is drawn, which is proportional to the coordinate movement of the cursor in the computer.The physical mouse provides four types of physical input to the host: right click, left click, scroll wheel, and move cursor.(1)
Move cursor—the detection point of the detected finger could be matched with the coordinate point of the mouse on the screen, and the mouse on the screen will follow the index finger by Autopy, which is a simple cross-platform GUI automation kit that can be used to control the keyboard and mouse. In this process, the detected interfinger coordinates in the image are converted into corresponding mouse coordinates in a certain proportion, and then the transformed coordinates are sent to Autopy to move the mouse on the screen.(2)
Mouse right-click—from the detected coordinate points, the distance between the two coordinate points can be calculated using the distance formula (8). When the index finger touches the thumb, the distance becomes very small. When the distance is less than a certain value, the right mouse click command will be sent to the host.(8)distance=y2−y12+x2−x12.(3)
Mouse left-click—the same principle, if the index finger and middle finger contact, the computer will be transmitted to click the left button instruction.(4)
Scroll wheel—the scroll wheel is essentially a continuous change, which can be equaled by the distance between the left index finger and thumb. The change in the distance between the two fingers is proportional to the change in the mouse wheel. The visual effect is shown in Figure8.Figure 8
After recognizing and tracking the finger position, the mathematical relationship between the coordinate systems of four objects is used to simulate the mouse.
(a)(b)


### 3.2. Gestures to Keyboard

Based on the above model, this step becomes quite simple. We modelled the virtual keyboard form used by Hsuan et al. in the usability study of multiple vibratory tactile feedback stimuli [18] and combined pynput and visual methods to build a virtual keyboard on the screen (thirty characters and a space bar are displayed on the screen in a loop). When the two conditions are met, the system inputs the corresponding characters into the device. The first is that the index finger and thumb touch each other, and the second is that the contact point should be inside a printed rectangular letter box on the screen. In this way, visual interaction systems can use their fingers to select letters to type when facing the screen. As shown in Figure 9, it is the virtual keyboard generated on the screen.Figure 9
The virtual keyboard. Creating a virtual keyboard on the screen, character input can be realized by recognizing the distance between keyboard characters and fingertip.


### 3.3. Gestures to Remote Control

In this paper, MediaPipe BlazePose lite was used to fulfill the achievement of the real-time body pose tracking and through action recognition, action information is transformed into our interactive command information. MediaPipe BlazePose [19]. This approach provides human pose tracking by employing machine learning (ML) to infer 33, 2D landmarks of a body from a single frame. BlazePose pinpoints more of the key points, and its sibling model, BlazePose lite, can achieve over 40FPS performance on CPU. For body language recognition, there are not many detection points available. Since most human body language is expressed by a series of movements of hands and arms, we use eight detection points for this visual interaction system, as shown in Figure 10.Figure 10
Limb detection point. According to the needs of body movements, eight self-defined human body key points need to be detected and tracked. (a) Left hand heart. (b) Left wrist. (c) Left arm joint. (d) Left shoulder joint. (e) Right shoulder joint. (f) Right arm joint. (g) Right wrist. (h) Right hand heart.Considering the differences between the left-handed and right-handed people in different populations, the research only focus on the right-handed people for the next four instructions. In the remote control mode, the visual interaction system needs to give instructions to the computer by detecting the gesture of the detected object. Trying to identify four body movements, they are arm up, down, left, and right four reverse smooth. Based on the previous method of detecting key points of limbs, the coordinate positions of key points of palm, wrist, arm, and shoulder can be obtained. At the same time, pose detection model and time series model can be used to detect the movement recognition of arm waving in different directions [20], but this is not conducive to the construction of real-time interaction. In study, an interesting phenomenon was found that when the arm swung in different directions, the angles of the two joints changed significantly from the normal posture. So, you can do multiple categories and identify these four movements by collecting data from these angles. Through the coordinate points returned by the network model, every three close coordinate points can determine an Angle (angle is shown in Figure 11). For instance, the network sends back three coordinate points (x1,y1) (x2,y2) (x3,y3). So, this Angle can be calculated by this formula:(9)θ=arccosx1−x2x3−x2+y1−y2y3−y2y1−y22+x1−x22y3−y22+x3−x22.Figure 11
The key points are detected and tracked, and two angle relations are constructed through the coordinate relations of the key points, which are used for gesture recognition. (a) Detection of key points of limbs. (b) Angle model between joints.
(a)(b)The model used for training here mainly repeats these four actions in the camera, thus collecting 4892 pairs of Angle data for the training of the model. The collected data is drawn into a scatter graph, and the Angle between the two limbs is called the horizontal axis and the vertical axis of the image, respectively. As can be seen from the scatter plot, the points corresponding to these actions are obvious, as shown in Figure12 and Table 2, which means that the data set can be easily distinguished by multiple classification models.Figure 12
The body angle corresponding to four gestures. By repeatedly collecting the data of two angles of four gestures, it can judge the types of gestures by the characteristics of the two angles.Table 2
The angles calculated by the detected limb nodes.
East_angleEast_angle1West_angleWest_angle1Up_angleUp_angle1Down_angleDown_angle11233.9112101160.7384397160.7384397161.9888326270.539793194.3570452181.8763717335.39249922236.2409878208.7810938154.2881748207.3077962271.0865778194.7662916184.3999738332.10198763236.0207256208.9682472160.7877393203.1866738270.9976778194.3265265190.5816355305.75058434237.8808253206.2495742157.5754429215.0381846271.0748416194.6171873190.2804779310.75215135237.7074799207.1708902154.0873884173.8235978271.7457149192.471614180.6669049347.29254416237.3341667211.6287803159.1671883167.6419484270.6189166191.7456334175.8326988.5087033167237.8064669210.6465166160.5405952165.734688270.2126508191.7095657171.341634616.758958428238.909603211.3171845160.0909223166.8243379270.0260721190.7648494169.796026320.635580569238.7817063209.7652164159.0786308158.8888677268.4592591190.7307791173.0151289.62524815610238.1619349209.926914159.0057672162.6954323268.2550024191.0791822183.57025342.92207449611239.1276187211.9197267160.573348164.5675398268.8947866190.5398551183.939298921.0165848812240.8562331215.9951808174.9425694160.4717909267.7364216189.767331180.027462427.2532556713239.5769707214.8217346168.2938777168.6934751267.4030335188.8413938173.7078241.312942814236.7658171213.5535815169.8761187167.9412875267.5801093188.5749343147.088802870.1881881115235.2610628213.4668425183.4526659162.0393303268.3741338188.1267289110.3386268107.7058291………………………1221255.2871037211.945188927.74305317164.8374219283.2114361194.7066666203.2408752230.85601361222256.4778067209.7139429.52417006165.2423816283.287503194.0362435203.6928564226.9109861223256.7575089209.826704227.91685417165.337185281.8335229196.3093648204.9666287245.5905584There are a variety of algorithm models for classification. Data classification could be done by using various models, so as to find out the model with the best performance for our action classification. Then, some classical classification algorithms will be used to make the comparison.(1)
k-Nearest Neighbors (kNN) (different distances)(2)
Decision Tree (Entropy/Gini)(3)
Random Forest (number of trees, Gini, Entropy, (no)bootstrapping)(4)
Gaussian kernel SVM (RBF)(5)
Deep neural network (Sigmoid activation/ReLu activation)Most of these algorithms can be found in Python’s Sklearn library and are classic classification algorithms. For K-nearest Neighbors (kNN), the model behaves differently if different distance methods are used. In the experiment, we, respectively, used Euclidean K-NN, Manhattan K-NN, and Minkowski K-NN KNNS with different distances to classify the data points. At the same time, both Gini impurity criterion and entropy criterion will be used to measure the quality of the split. The Gini impurity measures the frequency at which any element of the data set will be mislabelled when it is randomly labeled, whereas entropy is a measure of information that indicates the disorder of the features with the target. If using the character P for probability, they can be written in the following two formulas(10)GiniIndex=1−∑jpj2,Entropy=−∑jpj⋅log2⋅pj.The third model is random forest. We mainly try to find the model with the highest accuracy by using different numbers of trees, the methods (Gini and Entropy) for splitting and (no) bootstrapping. We cyclically tested the accuracy of the model from 1 to 1000 trees, and structurally the accuracy did not change much after the number of trees reached 600, so the number of trees at 600 will be set in the model, as shown in Figure13.Figure 13
The influence of the number of trees in the random forest on the accuracy of the model is counted so as to select the random forest model with the highest accuracy.For the Gaussian kernel, we are using the RBF kernel. The RBF kernel on two samplesx and x′ represented as feature vectors in some input space, is defined as:(11)Kx,x′=exp−x−x′22σ2.Finally, we tried two neural networks with different cores (Sigmoid activation/ReLu activation) and going to use all of these models to train data sets and compare them to find the ones that are more accurate. We summarize the result data in Table3 into Figure 14Table 3
The accuracy of different classification algorithms for Angle data processing.
Algorithm modelEuclidean k-NNManhattan k-NNMinkowski k-NNEntropy decision treeAccuracy0.844730.845550.84780.82692Algorithm modelGini decision treeEntropy random forestGini random forestBootstrapping random forestAccuracy0.825230.738760.852710.73808Algorithm modelNo bootstrapping random forestGaussian kernel SVM (RBF)Sigmoid NNReLu NNAccuracy0.726560.87540.85840.85207Figure 14
Multiple classification models are used for multi-classification processing of the two angles collected as well as comparing their accuracy.The model with high probability of correctness is selected to calculate its other parameters such as recall, precision, and F1-score，shown in Figure15 and Table 4. Gaussian kernel SVM (RBF) is more appropriate to help with the problem.Figure 15
Performance of different classifiers model. Further performance comparison is conducted on the models after the first screening to select the models that can effectively classify data.Table 4
Algorithms with relatively high accuracy are extracted for further evaluation, including accuracy, F1-score, and recall. SVM (RBF) has the best performance among various algorithms.
Calssification methodManhattan k-NNEntropy decisio treeGini random forestGaussian kernel SVM (RBF)Sigmoid NNReLu NNRecall0.7114950.6945320.6951010.7409830.6713180.660655Precision0.7161160.6771130.7452030.7937910.7668720.764888F1-score0.6942130.6640860.7041730.7443840.7003540.691554Accuracy0.8447350.8242810.8527150.8754040.8584060.852071


## 3.1. Gesture Control Mouse

In the visual interaction system, we hope that the mouse on the screen can follow the movement of the finger of the right hand, and at the same time can adjust the continuous changes of volume, size, and zoom by the distance between the index finger and thumb of the left hand. Not surprisingly, it all has to do with how to detect the thumb and index finger positions on both hands in the video. Here, the Faster-RCNN-ResNet50-FPN algorithm is used to detect the locations of these key points. The training data set mainly consists of the pictures obtained by the camera, and the four finger tips are marked for the training of the model.The main part is mainly composed of Transform, RESNET-50, FPN, RPN, and ROI, as we could see in Figure5. Due to the different sizes of background images obtained during image pretreatment, it is easier to use neural network for processing after image pretreatment. The first step is to transform the image and coordinate through a partial Transform. Then, it was sent to resNET-50 for feature extraction. Next, it is fed to FPN, which will build a feature pyramid and provide input feature map to RPN. RPN will generate the region proposals. Finally, object region, labels of each region, and scores of each region are detected through ROI.Figure 5
Overall structure.The input from Transform is a list of images, and the output is the transformed image tensor. There are three main steps. First, the image is normalized. The resulting tensor values are now distributed near 0, which is easier for neural network processing. The input image is scaled based on length or width, resulting in a scaled image. Interpolate in PyTorch is used to interpolate an image tensor batch_images. The ResNet50-FPN is used of which its source code is provided in torch vision, which is shown in Table1.Table 1
Architecture of ResNet50.
Layer nameOutput size50-layerconv1112 × 1127 × 7,64, stride 2conv2_x56 × 563 × 3 max pool, stride 256 × 561×1,643×3,641×1,256×3conv3_x28 × 281×1,1283×3,1281×1,512×4conv4_x14 × 141×1,2563×3,2561×1,1024×6conv5_x7 × 71×1,5123×3,5121×1,2048×3If only Faster RCNN is used for target detection, ROI will apply only to the last layer. This has no problem in the detection of large targets, but if it is used in the detection of small targets like fingers, when the convolutional pooling reaches the last layer, the semantic information is actually gone. Therefore, in order to solve the problem of multi-scale detection, the feature pyramid network (FPN) is introduced [16]. FPN is designed to utilize the pyramid form of CNN level features and generate feature pyramids with strong semantic information at all scales [17]. Therefore, top-down structure and horizontal connection are designed in FPN to integrate shallow layer with high resolution and deep layer with rich semantic information. The model is divided into three parts: the bottom-up pathway on the left and the top-down pathway on the right. ResNet50 is exported from each layer on the left to the pathway on the right, which is called lateral connections. Feedforward calculation of CNN is the bottom-up path. For ResNets, it is mainly the feature activation output of the last residual structure at each stage. The top-down approach is to sample the upper-level feature map with stronger semantics, and then connect the features with lateral connections to the features of the previous layer, so that the upper-level features are strengthened. The connection details are displayed in the rectangular box. The process of connection is to double upsampling (nearest upsampling method) for the high-level features, and then convolve it with the corresponding previous layer by 1∗1, and then combine the features of the two by adding between pixels. The process is repeated until the finest feature map is produced. In general, FPN can be expressed by the following formula:(3)FPN=Top−downpathway+laterconnection.Finally, the model uses a3∗3 convolution kernel to process the fused feature images to generate the final required feature images. These outputs will be fed into the RPN network for background foreground dichotomy and bound-box regression, as shown in Figure 6.Figure 6
The Resne-50 is used in combination with FPN action diagrams.RPN (Region Proposal Network) is mainly used to generate regional Proposal, a multi-scale Anchor based on the introduction of the Network model, with SoftMax to sort anchors (background or foreground), And Bounding Box Regression is used to make Regression prediction for anchor to obtain the precise position of the Proposal, which is used for subsequent target identification and detection.RPN determines whether an Anchor belongs to the foreground or background by calculating the IoU of Anchor and tag. IoU refers to the proportion of the common parts of two boxes to all parts (the overlap ratio). When IoU is greater than a certain value, the truth value of this Anchor is foreground; when IoU is lower than a certain value, the truth value of this Anchor is background. In terms of the true value of the offset, assuming that the central coordinates of Anchor arexa and ya, the width and height are wa and ha, respectively, the central coordinates of label are x and y, and the width and height are w and h, respectively, the corresponding offset truth calculation formula is obtained(4)tx=x−xawa,ty=y−yaha,tω=logwwa,th=loghha.The position offsetth and ty are normalized by width and height, while the width and height offset th and tw are logarithmic, which further limits the range of offset and facilitates prediction. Given the above truth values, RPN obtains the predicted values of category and offset, respectively, through the convolutional network in order to calculate the loss. To be specific, RPN needs to predict the probability that each Anchor belongs to foreground and background, as well as the offset of real objects relative to Anchor. In addition, after the predicted offset is obtained, the predicted offset can be applied to the corresponding Anchor to obtain the actual position of the prediction box. If there is no Anchor, it is necessary to directly predict the coordinate of each frame for object detection. Since the coordinate of the frame varies greatly, it is difficult for the network to converge and make accurate prediction. Anchor is equivalent to providing a prior ladder, so that the model can predict the offset of Anchor and better approach the real object. The loss function of RPN includes classification and regression:(5)Lpi,ti=1Ncls∑iLclspi,pi∗+λ1Nreg∑ipi∗Lregti,ti∗,∑iLclspi,pi∗,represents the loss of classification for 256 filtered Anchors, with Pi being the category truth value for each Anchor and P∗ being the predicted category for each Anchor. Since the role of RPN is to select the Proposal, it does not require the segmentation of which kind of prospect, so it is dichotomous at this stage, and cross entropy loss is used. ∑ipi∗Lregti,ti∗ represents a return to loss. Regression loss uses the smoothL1 function, and the specific formula is(6)Lregti,t∗=∑i∈x⋅y⋅w⋅hsmoothL1ti−t1∗,smoothL1x=0.5x2,ifx<1,x−0.5,otherwise.As can be seen from the second formula of the formula, smoothL1 function combines the first-order loss function with the second-order loss function. The reason is that when there is a large gap between the predicted offset and the truth value, the derivative of the second-order function is too large and the model is easy to diverge rather than converge. Therefore, the first-order loss function with a smaller derivative is adopted when it is greater than 1. Finally, the convolutional layer processes the feature maps of each layer and splices them, and the sequence after splicing is arranged. The ROI steps are mainly as shown in Figure 7: ROI will input Proposal Boxes selected from RPN and multi-layer feature map output from FPN into ROI Pool. Box ROI Pool determines which layer feature map to select for ROI Pool operation according to the area of Proposal Box. It is then fed into the Box Head, which consists of two fully connected layers. Next, the results obtained from Box Head processing are further classified and the Box offset is used for numerical regression. Softmax was applied to the classification results, and the final classification was carried out. Then, the position offset regression results of Box were combined with Proposal boxes to obtain the adjusted Detection boxes. Finally, maximum value suppression (NMS) was applied to filter out valid results.Figure 7
The flow chart of ROI.Box ROI Pool can process multiple images at the same time and detect the objects in each image, respectively. Therefore, first of all, convert to ROi format is required to merge the feature images of each layer of each image together for unified ROI Align processing. Setup_scales configure mapper objects for the first four output feature maps (the smallest pool layer is not used). Mapper is a new concept introduced in FPN. It mainly calculates the area of the Proposal Box and calculates which feature layer to perform ROI Align according to the area. It can be expressed as the following formula:(7)k=k0+log2wh224.The image below shows the effect of the model. At the same time, the coordinates of the obtained boxes are calculated to calculate their midpoint. With the midpoint as the center of the circle, a small circle is drawn, which is proportional to the coordinate movement of the cursor in the computer.The physical mouse provides four types of physical input to the host: right click, left click, scroll wheel, and move cursor.(1)
Move cursor—the detection point of the detected finger could be matched with the coordinate point of the mouse on the screen, and the mouse on the screen will follow the index finger by Autopy, which is a simple cross-platform GUI automation kit that can be used to control the keyboard and mouse. In this process, the detected interfinger coordinates in the image are converted into corresponding mouse coordinates in a certain proportion, and then the transformed coordinates are sent to Autopy to move the mouse on the screen.(2)
Mouse right-click—from the detected coordinate points, the distance between the two coordinate points can be calculated using the distance formula (8). When the index finger touches the thumb, the distance becomes very small. When the distance is less than a certain value, the right mouse click command will be sent to the host.(8)distance=y2−y12+x2−x12.(3)
Mouse left-click—the same principle, if the index finger and middle finger contact, the computer will be transmitted to click the left button instruction.(4)
Scroll wheel—the scroll wheel is essentially a continuous change, which can be equaled by the distance between the left index finger and thumb. The change in the distance between the two fingers is proportional to the change in the mouse wheel. The visual effect is shown in Figure8.Figure 8
After recognizing and tracking the finger position, the mathematical relationship between the coordinate systems of four objects is used to simulate the mouse.
(a)(b)


## 3.2. Gestures to Keyboard

Based on the above model, this step becomes quite simple. We modelled the virtual keyboard form used by Hsuan et al. in the usability study of multiple vibratory tactile feedback stimuli [18] and combined pynput and visual methods to build a virtual keyboard on the screen (thirty characters and a space bar are displayed on the screen in a loop). When the two conditions are met, the system inputs the corresponding characters into the device. The first is that the index finger and thumb touch each other, and the second is that the contact point should be inside a printed rectangular letter box on the screen. In this way, visual interaction systems can use their fingers to select letters to type when facing the screen. As shown in Figure 9, it is the virtual keyboard generated on the screen.Figure 9
The virtual keyboard. Creating a virtual keyboard on the screen, character input can be realized by recognizing the distance between keyboard characters and fingertip.


## 3.3. Gestures to Remote Control

In this paper, MediaPipe BlazePose lite was used to fulfill the achievement of the real-time body pose tracking and through action recognition, action information is transformed into our interactive command information. MediaPipe BlazePose [19]. This approach provides human pose tracking by employing machine learning (ML) to infer 33, 2D landmarks of a body from a single frame. BlazePose pinpoints more of the key points, and its sibling model, BlazePose lite, can achieve over 40FPS performance on CPU. For body language recognition, there are not many detection points available. Since most human body language is expressed by a series of movements of hands and arms, we use eight detection points for this visual interaction system, as shown in Figure 10.Figure 10
Limb detection point. According to the needs of body movements, eight self-defined human body key points need to be detected and tracked. (a) Left hand heart. (b) Left wrist. (c) Left arm joint. (d) Left shoulder joint. (e) Right shoulder joint. (f) Right arm joint. (g) Right wrist. (h) Right hand heart.Considering the differences between the left-handed and right-handed people in different populations, the research only focus on the right-handed people for the next four instructions. In the remote control mode, the visual interaction system needs to give instructions to the computer by detecting the gesture of the detected object. Trying to identify four body movements, they are arm up, down, left, and right four reverse smooth. Based on the previous method of detecting key points of limbs, the coordinate positions of key points of palm, wrist, arm, and shoulder can be obtained. At the same time, pose detection model and time series model can be used to detect the movement recognition of arm waving in different directions [20], but this is not conducive to the construction of real-time interaction. In study, an interesting phenomenon was found that when the arm swung in different directions, the angles of the two joints changed significantly from the normal posture. So, you can do multiple categories and identify these four movements by collecting data from these angles. Through the coordinate points returned by the network model, every three close coordinate points can determine an Angle (angle is shown in Figure 11). For instance, the network sends back three coordinate points (x1,y1) (x2,y2) (x3,y3). So, this Angle can be calculated by this formula:(9)θ=arccosx1−x2x3−x2+y1−y2y3−y2y1−y22+x1−x22y3−y22+x3−x22.Figure 11
The key points are detected and tracked, and two angle relations are constructed through the coordinate relations of the key points, which are used for gesture recognition. (a) Detection of key points of limbs. (b) Angle model between joints.
(a)(b)The model used for training here mainly repeats these four actions in the camera, thus collecting 4892 pairs of Angle data for the training of the model. The collected data is drawn into a scatter graph, and the Angle between the two limbs is called the horizontal axis and the vertical axis of the image, respectively. As can be seen from the scatter plot, the points corresponding to these actions are obvious, as shown in Figure12 and Table 2, which means that the data set can be easily distinguished by multiple classification models.Figure 12
The body angle corresponding to four gestures. By repeatedly collecting the data of two angles of four gestures, it can judge the types of gestures by the characteristics of the two angles.Table 2
The angles calculated by the detected limb nodes.
East_angleEast_angle1West_angleWest_angle1Up_angleUp_angle1Down_angleDown_angle11233.9112101160.7384397160.7384397161.9888326270.539793194.3570452181.8763717335.39249922236.2409878208.7810938154.2881748207.3077962271.0865778194.7662916184.3999738332.10198763236.0207256208.9682472160.7877393203.1866738270.9976778194.3265265190.5816355305.75058434237.8808253206.2495742157.5754429215.0381846271.0748416194.6171873190.2804779310.75215135237.7074799207.1708902154.0873884173.8235978271.7457149192.471614180.6669049347.29254416237.3341667211.6287803159.1671883167.6419484270.6189166191.7456334175.8326988.5087033167237.8064669210.6465166160.5405952165.734688270.2126508191.7095657171.341634616.758958428238.909603211.3171845160.0909223166.8243379270.0260721190.7648494169.796026320.635580569238.7817063209.7652164159.0786308158.8888677268.4592591190.7307791173.0151289.62524815610238.1619349209.926914159.0057672162.6954323268.2550024191.0791822183.57025342.92207449611239.1276187211.9197267160.573348164.5675398268.8947866190.5398551183.939298921.0165848812240.8562331215.9951808174.9425694160.4717909267.7364216189.767331180.027462427.2532556713239.5769707214.8217346168.2938777168.6934751267.4030335188.8413938173.7078241.312942814236.7658171213.5535815169.8761187167.9412875267.5801093188.5749343147.088802870.1881881115235.2610628213.4668425183.4526659162.0393303268.3741338188.1267289110.3386268107.7058291………………………1221255.2871037211.945188927.74305317164.8374219283.2114361194.7066666203.2408752230.85601361222256.4778067209.7139429.52417006165.2423816283.287503194.0362435203.6928564226.9109861223256.7575089209.826704227.91685417165.337185281.8335229196.3093648204.9666287245.5905584There are a variety of algorithm models for classification. Data classification could be done by using various models, so as to find out the model with the best performance for our action classification. Then, some classical classification algorithms will be used to make the comparison.(1)
k-Nearest Neighbors (kNN) (different distances)(2)
Decision Tree (Entropy/Gini)(3)
Random Forest (number of trees, Gini, Entropy, (no)bootstrapping)(4)
Gaussian kernel SVM (RBF)(5)
Deep neural network (Sigmoid activation/ReLu activation)Most of these algorithms can be found in Python’s Sklearn library and are classic classification algorithms. For K-nearest Neighbors (kNN), the model behaves differently if different distance methods are used. In the experiment, we, respectively, used Euclidean K-NN, Manhattan K-NN, and Minkowski K-NN KNNS with different distances to classify the data points. At the same time, both Gini impurity criterion and entropy criterion will be used to measure the quality of the split. The Gini impurity measures the frequency at which any element of the data set will be mislabelled when it is randomly labeled, whereas entropy is a measure of information that indicates the disorder of the features with the target. If using the character P for probability, they can be written in the following two formulas(10)GiniIndex=1−∑jpj2,Entropy=−∑jpj⋅log2⋅pj.The third model is random forest. We mainly try to find the model with the highest accuracy by using different numbers of trees, the methods (Gini and Entropy) for splitting and (no) bootstrapping. We cyclically tested the accuracy of the model from 1 to 1000 trees, and structurally the accuracy did not change much after the number of trees reached 600, so the number of trees at 600 will be set in the model, as shown in Figure13.Figure 13
The influence of the number of trees in the random forest on the accuracy of the model is counted so as to select the random forest model with the highest accuracy.For the Gaussian kernel, we are using the RBF kernel. The RBF kernel on two samplesx and x′ represented as feature vectors in some input space, is defined as:(11)Kx,x′=exp−x−x′22σ2.Finally, we tried two neural networks with different cores (Sigmoid activation/ReLu activation) and going to use all of these models to train data sets and compare them to find the ones that are more accurate. We summarize the result data in Table3 into Figure 14Table 3
The accuracy of different classification algorithms for Angle data processing.
Algorithm modelEuclidean k-NNManhattan k-NNMinkowski k-NNEntropy decision treeAccuracy0.844730.845550.84780.82692Algorithm modelGini decision treeEntropy random forestGini random forestBootstrapping random forestAccuracy0.825230.738760.852710.73808Algorithm modelNo bootstrapping random forestGaussian kernel SVM (RBF)Sigmoid NNReLu NNAccuracy0.726560.87540.85840.85207Figure 14
Multiple classification models are used for multi-classification processing of the two angles collected as well as comparing their accuracy.The model with high probability of correctness is selected to calculate its other parameters such as recall, precision, and F1-score，shown in Figure15 and Table 4. Gaussian kernel SVM (RBF) is more appropriate to help with the problem.Figure 15
Performance of different classifiers model. Further performance comparison is conducted on the models after the first screening to select the models that can effectively classify data.Table 4
Algorithms with relatively high accuracy are extracted for further evaluation, including accuracy, F1-score, and recall. SVM (RBF) has the best performance among various algorithms.
Calssification methodManhattan k-NNEntropy decisio treeGini random forestGaussian kernel SVM (RBF)Sigmoid NNReLu NNRecall0.7114950.6945320.6951010.7409830.6713180.660655Precision0.7161160.6771130.7452030.7937910.7668720.764888F1-score0.6942130.6640860.7041730.7443840.7003540.691554Accuracy0.8447350.8242810.8527150.8754040.8584060.852071


## 4. Results

Table5 mainly shows the performance of detection such as accuracy, F1-score, and recall. The right thumb, index finger, and left index finger were all about 90 percent accurate, but the right thumb was far behind. This error may be due to manually annotating the data set. The index finger of the right hand and the thumb of the left hand are slightly lower than the other two. At the same time, for f1-score performance of different thresholds, when the threshold size is 0.5, F1-score is the largest.Table 5
The evaluation results of the index finger and thumb detection model.
labelAccuracyRecallF1-scorer_thumb0.7740.710.73l_index_finger0.8960.790.77l_thumb0.9100.890.83r_index_finger0.8960.930.84According to the data in Table6, the model performs well in the recognition of human bone points, and all bone points have an accuracy rate of more than 0.9.Table 6
The accuracy of eight nodes on a limb.
labelLeft hand heartLeft wristLeft arm jointLeft shoulder jointAccuracy0.99860.9830.92540.9688LabelRight hand heartRight wristRight arm jointRight shoulder jointAccuracy0.9730.99630.99450.9945The first Angle is the special angle between the detection point at the wrist and two adjacent points, and the second Angle1 is the Angle formed by the detection point at the arm and the adjacent Angle. Table2 includes two angles as the arm slides in all four directions. It can be seen from the results that when different actions are made, the changes of the two angles are in different intervals, which enables the computer to judge the actions by classifying the angles.It shows common machine learning models in machine learning. The first considering indicator is the accuracy of motion classification. We select models with better accuracy for further selection.It can be seen from Table4 that SVM (RBF) is more suitable for solving problems, and its four indicators are better than the other models.


## 5. Conclusions

The detection accuracy of each finger of gesture is above 0.9, which can accurately detect finger movements and give control instructions to the computer. The recognition of human bone points can reach more than 0.97, which can better lay the position of human limbs. By calculating the included Angle between the key points and using a variety of classification algorithms to classify the actions, the classification accuracy of the four instructions reaches 0.875. This paper also constructed a visual human-computer interaction system with basic functions, and achieved good performance in human bone point recognition and finger recognition. In the future, it is hoped to further refine and distill these models so that HCI systems can complete high-performance reasoning and efficient HCI with only CPU.



---

*Source: 9562104-2022-06-30.xml*