# Table Tennis Technical and Tactical Ability Based on Secure Internet of Things and BP Neural Network

Authors: Di Zhang
Journal: Mobile Information Systems
 (2022)

---

## Abstract

Table tennis forehand fast attack and loop technology is the core technology of the project, and table tennis footwork is directly related to the technical level and development prospects of athletes. However, it is very difficult to study technical issues such as the footwork of table tennis. This paper mainly studies the table tennis movement analysis and strength monitoring system based on the posture sensor. This article introduces the improved BP neural network algorithm of Secure Internet of Things. The dynamic error compensation of the sensor is verified by experiments. In the prediction stage, the system uses the estimated value of the previous state as the input value to estimate the current state. In the calibration stage, the output data of the current state can be used as the prediction data of the next state to get more accurate output value. MATLAB is used to read the data, the sampling frequency is 50 Hz, and the acceleration and angular velocity data are output at the same frequency. Finally, the flight trajectory of table tennis is predicted. The difference between the actual velocity and the carrier is about 0.07 m/s, and the actual displacement is about 0.45 m. The results show that the attitude sensor plays a good role in monitoring the movement track and serving strength of table tennis.


---

## Body

## 1. Introduction

With the improvement of computer processing capabilities and the development of sensor technology, motion capture has become a research hotspot in the field of computer vision and image processing in recent years, thereby greatly improving the training effect and level and also providing accurate quantitative basis and quantitative training indicators for scientific training. Therefore, it is of practical significance to analyze the technical and tactical capabilities of table tennis based on the secure Internet of Things and BP neural network.Based on the overall principle of the attitude sensor, the attitude sensor is designed through hardware. By using digital image technology, we can detect the moving target, study its three-dimensional motion track and speed, and analyze statistics to get the required motion state parameters, which will greatly help to improve the training level.Accurately measuring the attitude information of the target device through the attitude sensor is the basis for the balanced and stable operation of each control system. Erlend considered the problem of constructing a filter for estimating the deviation of attitude and rate sensors, which has been proven to be stable and near-optimal performance in terms of noise. He considered the entire nonlinear system and used these estimates as the linearization points of the linearized Kalman filter. Although his research is comprehensive, the focus of his research is rather vague [1]. Li believes that after the satellite is separated from the upper layer, the initial attitude is not known because the attitude sensor is invalid for measurement. To solve this problem, He used the information of the simulated solar vector detector to correct the inference; he proposed a simple method to convert the posture of the sun to the posture of the Earth. His research lacks experimental data [2]. Byeon uses the new sensor parameter enhancement filter to accurately estimate sensor parameter changes. Although the accuracy of his research has improved, there are many interference factors that have not been considered [3]. His research also has related problems such as low computational accuracy.Based on the analysis of the movement mechanism of table tennis, this paper studies the motion estimation algorithm aiming at the real-time and accuracy requirements of the table tennis automatic scorecard. Through the analysis of the mechanism of table tennis movement, a table tennis movement model is established. Aiming at the high real-time requirements of the system, an efficient and accurate moving object estimation algorithm is designed, and accurate motion estimation results are obtained, which solve the problem of incomplete image operation information and provides a basis for accurate refereeing.


## 2. Attitude Sensor and Table Tennis

### 2.1. Establishment of Table Tennis Tactical Ability Model

Value until the sum of squares of the error between the network output and the expected output is minimized, thereby training the optimal neural network model [4]. And the hidden layer to the output layer uses the linear function Purelin as the transfer function. The tactical ability model of table tennis is shown in Figure 1.Figure 1
BP neural network model construction.In the motion capture system, in order to capture the motion posture of the human body, it is necessary to bind sensor nodes to the designated joints of the human body and realize the collection of motion information through the sensor nodes [5, 6]. The corresponding data processing core needs to be added to read and process the data collected by the sensor [7]. The function of the sensor node mainly includes the following points: (1) collect the initial posture information of each limb part and combine the corresponding theory to perform the primary solution to obtain the initial motion posture information. (2) The format conversion of the motion posture data is converted into a data format that can be recognized by the bus [8, 9].When the external magnetic field interference is found, the attitude algorithm can temporarily reject the measured value of the magnetic field and rely on the gyroscope for attitude estimation [10] as shown in Figure 2.Figure 2
Pose estimation process.


### 2.2. Moving Target Detection Algorithm

#### 2.2.1. Difference Method

Compared with the background difference method, the former can only get the different parts of the moving object between two frames because the former is the difference between adjacent frames. Therefore, when performing moving target detection on long-term videos, the background template should be updated in real time [11]. Assuming that the background model is Bx,y=b1x,y,b2x,y,⋯,bNx,y and the current frame is ftx,y, the background difference is not just a simple calculation of the difference between the current frame and the background model, it also includes multiple methods. For example, the method of using each frame capture and so on. The intensity difference can be calculated separately and then thresholded as shown in the following equation:(1)It,nx,y=1,ftx,y−bnx,y≥T,n=1,2,⋯,N,0,ftx,y−bnx,y<T,n=1,2,⋯,N,where It,nx,y represents the detection result after the current frame is matched with the nth background model at time t. There are also some background models that are characterized by probability distributions. Taking Gaussian distribution as an example, the formula corresponding to the background model is shown in the following equation:(2)Bx,y∼Nμ,σ2.In the formula,μ is the mean of the normal distribution, and σ is the variance of the normal distribution.


#### 2.2.2. Background Modeling Method

In the process of moving target detection, the relatively static part is regarded as the background image, common background modeling methods include statistical average method and mixed Gaussian background modeling method [12, 13].The calculation formula of statistical average method for background modeling is as follows:(3)Bk=1nfk−n+1+fk−n+2+…+fk−1+fk=Bk−1+1nfk−fk−n.The most important thing for the statistical average method in background modeling is the selection of parametern. According to the frequency of the moving target in the video image, adjust the size of n appropriately.The mixed Gaussian background modeling approximates the density function of the background frame by using the weighted average ofm Gaussian probability density functions. Its expression is as follows:(4)PIt=∑i=1mwit⋅ηIt,μit,δit.Among them,m is the number of Gaussian distribution and It represents the pixel value of a certain point in the image at time t.


#### 2.2.3. Background Model Initialization

When the background model is initialized, we discard those methods based on training with a large number of samples and simply select the first N frames of the input video as the background samples. That is, the background sample is as follows:(5)Bx,y=b1x,y,b2x,y,⋯,bNx,y,(6)bnx,y=fnx,y,n=1,2,⋯,N.Back update algorithm will also be introduced; although it has the disadvantage that the operation process is more complicated, the initialization model will be continuously updated, and new background information will be continuously introduced to adapt to the interference of leaf shaking, lighting changes, and motion changes in the scene. The adverse effects caused by moving targets in the initial background will be gradually eliminated.


#### 2.2.4. Background Difference and Adaptive Threshold

It is differentiated from N background samples and thresholded to obtain N binary matrices as shown in equation (1). It,1x,y to It,Nx,y obtained after thresholding are called candidate segmentation results. After that, the threshold value M is set, and only the pixels that are detected as foreground in the majority of candidate results will be finally judged as foreground, namely:(7)Itx,y=1,∑n=1NIt,nx,y≥M,0,∑n=1NIt,nx,y<M..M is the threshold of the candidate results, and Itx,y is the final detection result, which is still a binary image. The reason for thresholding candidate results is to reduce errors. One or two wrong candidate segmentation is likely to be eliminated in the process of thresholding.When a pixel is detected as foreground, that is, the difference result of this pixel has K times (M < K < N) greater than the threshold T, the difference result of these K times is recorded as d1x,y,d2x,y,⋯,dKx,y, namely:(8)dnx,y=ftx,y−bnx,y.In the formula,n=1,2,⋯,K, in order to characterize the difference between the normalized RGB value of the foreground pixel and the background model, we introduce a contrast measurement factor:(9)Cx,y=∑n=1Kdnx,yK.If the measured result is that the contrast is too high, the threshold is increased; on the contrary, if the measured result is that the contrast factor C is too low, the threshold is decreased to adapt to the foreground protection color. The specific scheme is shown in the following equation:(10)Tt+1=1+aTt,C≥k1Tt,1−aTt,Tt<C≤k2Tt,Tt,else..Among them,Tt represents the threshold at time t, k1,k2 is two constant coefficients greater than 1, and there is k1>k2. They characterize the relationship between the contrast factor C and the historical threshold to determine whether to adjust and how to adjust the threshold. α is an adaptive threshold adjustment factor. When the contrast factor is relatively large, it indicates that the foreground and background contrast is obvious, and the threshold is increased by αT. When the contrast factor is relatively small relative to the threshold, it means that the difference between the foreground and the background is small. Consider reducing the threshold by αT. Through such a threshold adjustment mechanism, the threshold is connected with the foreground and background contrast factor, and an adaptive threshold is realized.


#### 2.2.5. Optical Flow Method

Optical flow method is also called field estimation method, which is a form of expression suitable for moving video images. For this method to work best, it is best to configure it on the hardware. For any video image sequence, the optical flow field reflects the change trend of the brightness of each pixel in the video image sequence, that is, the representation of the movement speed of the point on the space object on the image plane [14, 15]. The optical flow method has the advantages of fast calculation speed and is very accurate. Ix,y,t is the intensity value of point x,y at time t. In a short time dt, x and y increase by dx and dy, respectively, and we can get the following:(11)Ix+dx,y+dy,t+dt=Ix,y,t+∂I∂xdx+∂I∂ydy+∂I∂tdt+ε,ε is the second-order infinitesimal and can be ignored. According to the basic assumption that the instantaneous gray value does not change, there are(12)Ix,y,t=Ix+dx,y+dy,t+dt.u and v are the velocity vectors along the horizontal and vertical axis, respectively:(13)u=dxdt,v=dydt.The basic equation of the optical flow field can be obtained by substituting(14)−∂I∂t=∂I∂xu+∂I∂yv.The optical flow method is very rigorous, and the moving target detection algorithm based on it has high detection accuracy, which is its most obvious advantage. However, in the process of detecting the target by the optical flow method, the calculation is very complicated and the time complexity is high, and it usually requires special hardware equipment support, which is difficult to be widely promoted in practical applications. At the same time, its suppression effect is very limited for all kinds of interference factors existing in the scene.


### 2.3. Table Tennis Modeling

Due to the fast speed of table tennis and fierce competition scenes, motion estimation needs to have high real-time performance. Kalman filter and particle filter are the most commonly used motion estimation and tracking algorithms, but the latter is computationally intensive and difficult to meet the real-time requirements [16]. Through the operation of Kalman filter, the computer can track the movement of table tennis and do real-time processing. Kalman filter is a recursive operation, each iteration only needs to consider the input value at the previous moment, and the computer can process the data in real time, which is an optimal estimation method [17, 18]. In the design of the table tennis automatic scoring device, after force analysis and calculation, air resistance is two orders of magnitude smaller than other forces, which can be ignored, that is, table tennis is only subject to gravity and air resistance [19]. The resistance components of the three coordinate axis directions are expressed as follows:(15)Dx=−12ρSCdVV⟶x=KmVV⟶x,Dy=−12ρSCdVV⟶y=KmVV⟶y,Dz=−12ρSCdVV⟶z=KmVV⟶z..Set the displacement and speed of the table tennis movement as the state variables predicted by Kalman. According to the force analysis and the motion equation, the established state equation is as follows:(16)pxk+1vxk+1=1Δt01pxkvxk+Δt22Δtaxk,(17)pyk+1vyk+1=1Δt01pykvyk+Δt22Δtayk,(18)pzk+1vzk+1=1Δt01pzkvzk+Δt22Δtazk.Among them,pxk and vxk are the position and velocity components of the table tennis in the x-axis direction at time k, and if the distance is less than the standard distance, the marker points an image in the camera sensor plane. Through the homogeneous perspective transformation of the camera, the coordinate value of the marker point in the sensor plane is obtained from its 3D coordinate value in the environment coordinate system [20, 21].


## 2.1. Establishment of Table Tennis Tactical Ability Model

Value until the sum of squares of the error between the network output and the expected output is minimized, thereby training the optimal neural network model [4]. And the hidden layer to the output layer uses the linear function Purelin as the transfer function. The tactical ability model of table tennis is shown in Figure 1.Figure 1
BP neural network model construction.In the motion capture system, in order to capture the motion posture of the human body, it is necessary to bind sensor nodes to the designated joints of the human body and realize the collection of motion information through the sensor nodes [5, 6]. The corresponding data processing core needs to be added to read and process the data collected by the sensor [7]. The function of the sensor node mainly includes the following points: (1) collect the initial posture information of each limb part and combine the corresponding theory to perform the primary solution to obtain the initial motion posture information. (2) The format conversion of the motion posture data is converted into a data format that can be recognized by the bus [8, 9].When the external magnetic field interference is found, the attitude algorithm can temporarily reject the measured value of the magnetic field and rely on the gyroscope for attitude estimation [10] as shown in Figure 2.Figure 2
Pose estimation process.


## 2.2. Moving Target Detection Algorithm

### 2.2.1. Difference Method

Compared with the background difference method, the former can only get the different parts of the moving object between two frames because the former is the difference between adjacent frames. Therefore, when performing moving target detection on long-term videos, the background template should be updated in real time [11]. Assuming that the background model is Bx,y=b1x,y,b2x,y,⋯,bNx,y and the current frame is ftx,y, the background difference is not just a simple calculation of the difference between the current frame and the background model, it also includes multiple methods. For example, the method of using each frame capture and so on. The intensity difference can be calculated separately and then thresholded as shown in the following equation:(1)It,nx,y=1,ftx,y−bnx,y≥T,n=1,2,⋯,N,0,ftx,y−bnx,y<T,n=1,2,⋯,N,where It,nx,y represents the detection result after the current frame is matched with the nth background model at time t. There are also some background models that are characterized by probability distributions. Taking Gaussian distribution as an example, the formula corresponding to the background model is shown in the following equation:(2)Bx,y∼Nμ,σ2.In the formula,μ is the mean of the normal distribution, and σ is the variance of the normal distribution.


### 2.2.2. Background Modeling Method

In the process of moving target detection, the relatively static part is regarded as the background image, common background modeling methods include statistical average method and mixed Gaussian background modeling method [12, 13].The calculation formula of statistical average method for background modeling is as follows:(3)Bk=1nfk−n+1+fk−n+2+…+fk−1+fk=Bk−1+1nfk−fk−n.The most important thing for the statistical average method in background modeling is the selection of parametern. According to the frequency of the moving target in the video image, adjust the size of n appropriately.The mixed Gaussian background modeling approximates the density function of the background frame by using the weighted average ofm Gaussian probability density functions. Its expression is as follows:(4)PIt=∑i=1mwit⋅ηIt,μit,δit.Among them,m is the number of Gaussian distribution and It represents the pixel value of a certain point in the image at time t.


### 2.2.3. Background Model Initialization

When the background model is initialized, we discard those methods based on training with a large number of samples and simply select the first N frames of the input video as the background samples. That is, the background sample is as follows:(5)Bx,y=b1x,y,b2x,y,⋯,bNx,y,(6)bnx,y=fnx,y,n=1,2,⋯,N.Back update algorithm will also be introduced; although it has the disadvantage that the operation process is more complicated, the initialization model will be continuously updated, and new background information will be continuously introduced to adapt to the interference of leaf shaking, lighting changes, and motion changes in the scene. The adverse effects caused by moving targets in the initial background will be gradually eliminated.


### 2.2.4. Background Difference and Adaptive Threshold

It is differentiated from N background samples and thresholded to obtain N binary matrices as shown in equation (1). It,1x,y to It,Nx,y obtained after thresholding are called candidate segmentation results. After that, the threshold value M is set, and only the pixels that are detected as foreground in the majority of candidate results will be finally judged as foreground, namely:(7)Itx,y=1,∑n=1NIt,nx,y≥M,0,∑n=1NIt,nx,y<M..M is the threshold of the candidate results, and Itx,y is the final detection result, which is still a binary image. The reason for thresholding candidate results is to reduce errors. One or two wrong candidate segmentation is likely to be eliminated in the process of thresholding.When a pixel is detected as foreground, that is, the difference result of this pixel has K times (M < K < N) greater than the threshold T, the difference result of these K times is recorded as d1x,y,d2x,y,⋯,dKx,y, namely:(8)dnx,y=ftx,y−bnx,y.In the formula,n=1,2,⋯,K, in order to characterize the difference between the normalized RGB value of the foreground pixel and the background model, we introduce a contrast measurement factor:(9)Cx,y=∑n=1Kdnx,yK.If the measured result is that the contrast is too high, the threshold is increased; on the contrary, if the measured result is that the contrast factor C is too low, the threshold is decreased to adapt to the foreground protection color. The specific scheme is shown in the following equation:(10)Tt+1=1+aTt,C≥k1Tt,1−aTt,Tt<C≤k2Tt,Tt,else..Among them,Tt represents the threshold at time t, k1,k2 is two constant coefficients greater than 1, and there is k1>k2. They characterize the relationship between the contrast factor C and the historical threshold to determine whether to adjust and how to adjust the threshold. α is an adaptive threshold adjustment factor. When the contrast factor is relatively large, it indicates that the foreground and background contrast is obvious, and the threshold is increased by αT. When the contrast factor is relatively small relative to the threshold, it means that the difference between the foreground and the background is small. Consider reducing the threshold by αT. Through such a threshold adjustment mechanism, the threshold is connected with the foreground and background contrast factor, and an adaptive threshold is realized.


### 2.2.5. Optical Flow Method

Optical flow method is also called field estimation method, which is a form of expression suitable for moving video images. For this method to work best, it is best to configure it on the hardware. For any video image sequence, the optical flow field reflects the change trend of the brightness of each pixel in the video image sequence, that is, the representation of the movement speed of the point on the space object on the image plane [14, 15]. The optical flow method has the advantages of fast calculation speed and is very accurate. Ix,y,t is the intensity value of point x,y at time t. In a short time dt, x and y increase by dx and dy, respectively, and we can get the following:(11)Ix+dx,y+dy,t+dt=Ix,y,t+∂I∂xdx+∂I∂ydy+∂I∂tdt+ε,ε is the second-order infinitesimal and can be ignored. According to the basic assumption that the instantaneous gray value does not change, there are(12)Ix,y,t=Ix+dx,y+dy,t+dt.u and v are the velocity vectors along the horizontal and vertical axis, respectively:(13)u=dxdt,v=dydt.The basic equation of the optical flow field can be obtained by substituting(14)−∂I∂t=∂I∂xu+∂I∂yv.The optical flow method is very rigorous, and the moving target detection algorithm based on it has high detection accuracy, which is its most obvious advantage. However, in the process of detecting the target by the optical flow method, the calculation is very complicated and the time complexity is high, and it usually requires special hardware equipment support, which is difficult to be widely promoted in practical applications. At the same time, its suppression effect is very limited for all kinds of interference factors existing in the scene.


## 2.2.1. Difference Method

Compared with the background difference method, the former can only get the different parts of the moving object between two frames because the former is the difference between adjacent frames. Therefore, when performing moving target detection on long-term videos, the background template should be updated in real time [11]. Assuming that the background model is Bx,y=b1x,y,b2x,y,⋯,bNx,y and the current frame is ftx,y, the background difference is not just a simple calculation of the difference between the current frame and the background model, it also includes multiple methods. For example, the method of using each frame capture and so on. The intensity difference can be calculated separately and then thresholded as shown in the following equation:(1)It,nx,y=1,ftx,y−bnx,y≥T,n=1,2,⋯,N,0,ftx,y−bnx,y<T,n=1,2,⋯,N,where It,nx,y represents the detection result after the current frame is matched with the nth background model at time t. There are also some background models that are characterized by probability distributions. Taking Gaussian distribution as an example, the formula corresponding to the background model is shown in the following equation:(2)Bx,y∼Nμ,σ2.In the formula,μ is the mean of the normal distribution, and σ is the variance of the normal distribution.


## 2.2.2. Background Modeling Method

In the process of moving target detection, the relatively static part is regarded as the background image, common background modeling methods include statistical average method and mixed Gaussian background modeling method [12, 13].The calculation formula of statistical average method for background modeling is as follows:(3)Bk=1nfk−n+1+fk−n+2+…+fk−1+fk=Bk−1+1nfk−fk−n.The most important thing for the statistical average method in background modeling is the selection of parametern. According to the frequency of the moving target in the video image, adjust the size of n appropriately.The mixed Gaussian background modeling approximates the density function of the background frame by using the weighted average ofm Gaussian probability density functions. Its expression is as follows:(4)PIt=∑i=1mwit⋅ηIt,μit,δit.Among them,m is the number of Gaussian distribution and It represents the pixel value of a certain point in the image at time t.


## 2.2.3. Background Model Initialization

When the background model is initialized, we discard those methods based on training with a large number of samples and simply select the first N frames of the input video as the background samples. That is, the background sample is as follows:(5)Bx,y=b1x,y,b2x,y,⋯,bNx,y,(6)bnx,y=fnx,y,n=1,2,⋯,N.Back update algorithm will also be introduced; although it has the disadvantage that the operation process is more complicated, the initialization model will be continuously updated, and new background information will be continuously introduced to adapt to the interference of leaf shaking, lighting changes, and motion changes in the scene. The adverse effects caused by moving targets in the initial background will be gradually eliminated.


## 2.2.4. Background Difference and Adaptive Threshold

It is differentiated from N background samples and thresholded to obtain N binary matrices as shown in equation (1). It,1x,y to It,Nx,y obtained after thresholding are called candidate segmentation results. After that, the threshold value M is set, and only the pixels that are detected as foreground in the majority of candidate results will be finally judged as foreground, namely:(7)Itx,y=1,∑n=1NIt,nx,y≥M,0,∑n=1NIt,nx,y<M..M is the threshold of the candidate results, and Itx,y is the final detection result, which is still a binary image. The reason for thresholding candidate results is to reduce errors. One or two wrong candidate segmentation is likely to be eliminated in the process of thresholding.When a pixel is detected as foreground, that is, the difference result of this pixel has K times (M < K < N) greater than the threshold T, the difference result of these K times is recorded as d1x,y,d2x,y,⋯,dKx,y, namely:(8)dnx,y=ftx,y−bnx,y.In the formula,n=1,2,⋯,K, in order to characterize the difference between the normalized RGB value of the foreground pixel and the background model, we introduce a contrast measurement factor:(9)Cx,y=∑n=1Kdnx,yK.If the measured result is that the contrast is too high, the threshold is increased; on the contrary, if the measured result is that the contrast factor C is too low, the threshold is decreased to adapt to the foreground protection color. The specific scheme is shown in the following equation:(10)Tt+1=1+aTt,C≥k1Tt,1−aTt,Tt<C≤k2Tt,Tt,else..Among them,Tt represents the threshold at time t, k1,k2 is two constant coefficients greater than 1, and there is k1>k2. They characterize the relationship between the contrast factor C and the historical threshold to determine whether to adjust and how to adjust the threshold. α is an adaptive threshold adjustment factor. When the contrast factor is relatively large, it indicates that the foreground and background contrast is obvious, and the threshold is increased by αT. When the contrast factor is relatively small relative to the threshold, it means that the difference between the foreground and the background is small. Consider reducing the threshold by αT. Through such a threshold adjustment mechanism, the threshold is connected with the foreground and background contrast factor, and an adaptive threshold is realized.


## 2.2.5. Optical Flow Method

Optical flow method is also called field estimation method, which is a form of expression suitable for moving video images. For this method to work best, it is best to configure it on the hardware. For any video image sequence, the optical flow field reflects the change trend of the brightness of each pixel in the video image sequence, that is, the representation of the movement speed of the point on the space object on the image plane [14, 15]. The optical flow method has the advantages of fast calculation speed and is very accurate. Ix,y,t is the intensity value of point x,y at time t. In a short time dt, x and y increase by dx and dy, respectively, and we can get the following:(11)Ix+dx,y+dy,t+dt=Ix,y,t+∂I∂xdx+∂I∂ydy+∂I∂tdt+ε,ε is the second-order infinitesimal and can be ignored. According to the basic assumption that the instantaneous gray value does not change, there are(12)Ix,y,t=Ix+dx,y+dy,t+dt.u and v are the velocity vectors along the horizontal and vertical axis, respectively:(13)u=dxdt,v=dydt.The basic equation of the optical flow field can be obtained by substituting(14)−∂I∂t=∂I∂xu+∂I∂yv.The optical flow method is very rigorous, and the moving target detection algorithm based on it has high detection accuracy, which is its most obvious advantage. However, in the process of detecting the target by the optical flow method, the calculation is very complicated and the time complexity is high, and it usually requires special hardware equipment support, which is difficult to be widely promoted in practical applications. At the same time, its suppression effect is very limited for all kinds of interference factors existing in the scene.


## 2.3. Table Tennis Modeling

Due to the fast speed of table tennis and fierce competition scenes, motion estimation needs to have high real-time performance. Kalman filter and particle filter are the most commonly used motion estimation and tracking algorithms, but the latter is computationally intensive and difficult to meet the real-time requirements [16]. Through the operation of Kalman filter, the computer can track the movement of table tennis and do real-time processing. Kalman filter is a recursive operation, each iteration only needs to consider the input value at the previous moment, and the computer can process the data in real time, which is an optimal estimation method [17, 18]. In the design of the table tennis automatic scoring device, after force analysis and calculation, air resistance is two orders of magnitude smaller than other forces, which can be ignored, that is, table tennis is only subject to gravity and air resistance [19]. The resistance components of the three coordinate axis directions are expressed as follows:(15)Dx=−12ρSCdVV⟶x=KmVV⟶x,Dy=−12ρSCdVV⟶y=KmVV⟶y,Dz=−12ρSCdVV⟶z=KmVV⟶z..Set the displacement and speed of the table tennis movement as the state variables predicted by Kalman. According to the force analysis and the motion equation, the established state equation is as follows:(16)pxk+1vxk+1=1Δt01pxkvxk+Δt22Δtaxk,(17)pyk+1vyk+1=1Δt01pykvyk+Δt22Δtayk,(18)pzk+1vzk+1=1Δt01pzkvzk+Δt22Δtazk.Among them,pxk and vxk are the position and velocity components of the table tennis in the x-axis direction at time k, and if the distance is less than the standard distance, the marker points an image in the camera sensor plane. Through the homogeneous perspective transformation of the camera, the coordinate value of the marker point in the sensor plane is obtained from its 3D coordinate value in the environment coordinate system [20, 21].


## 3. Table Tennis Motion Detection Experiment Based on Attitude Sensor

### 3.1. Structural Design of the Attitude Sensor

The attitude sensor detection platform mainly includes support mechanism, executive member, driving element, transmission part, detection element, and human-computer interactive display interface. The selection and main functions of each component are as follows:(1)
Drive element: the hand crank is the drive element of the detection platform, which drives the worm gear to rotate by shaking the hand crank [22, 23].(2)
Transmission components: the driving torque of the hand wheel is transmitted to the inner and outer frame small shafts through the worm gear transmission device.(3)
Actuating component: the rotation of the inner and outer frame detection platform is driven by the rotation of the inner and outer frame small shaft.The operation of the 3D attitude sensor can be divided into two basic modes, namely, the debugging phase and the normal operation. The data of the gyroscope and the angle sensor are used to compare the data to obtain the attitude information of the carrier, and the gap between the two can also be judged [24].


### 3.2. BP Neural Network Algorithm Based on Secure Internet of Things Optimization

Through Secure Internet of Things classification and optimization, the optimal individual can be screened out, and BP network decomposition calculation can play their respective advantages so that the network has both the nonlinear interpolation calculation ability of the BP network algorithm and the characteristics of the overall optimization calculation of Secure Internet of Things so as to obtain more accurate data as the weight of the BP neural network and improve the stability and accuracy of the BP network model so as to better optimize the effect. Compared with the common Internet of things, the biggest advantage of the secure Internet of things is its security and confidentiality.The learning process of Secure Internet of Things to optimize the weights of the BP learning algorithm is as follows:(1)
The network weight value set is represented by a randomly generated binary representation, which can be transformed by encoding and decoding;(2)
The fitness function of the Secure Internet of Things is related to the total error function of the neural network. The expression of the fitness function is(19)f=1+1E.Among them, use formula (2) to express the total error of the neural network.(20)E=12∑k−1K∑j−1Qdkj−ykj2.(3)
The weight of each network is decoded from each binary string, and the performance characteristics of the network are evaluated through network training. Assuming the group size is, the probability that the algorithm selects individual i is as follows:(21)Pi=fi∑j=1nfj.In the formula,fi is the fitness value of the ith chromosome, and the probability of each chromosome being selected is Pi.(4)
After the network is selected, genetic operations such as crossover and mutation are performed with the preset probability valuesPC and PM to produce the next generation network. Repeat (2)–(4) operations until the network is optimized by Secure Internet of Things and reaches the required accuracy.


### 3.3. Algorithm Improvement Steps

GA-LM-BP algorithm is an effective method combining BP algorithm with Secure Internet of Things and L-M algorithm to speed up the convergence speed and avoid falling into local minimum. The algorithm steps are as follows:(1)
Assign the random number between [−1, 1] to the weight and get the initial weight w (0)(2)
Carry out forward operation to calculate the total error function of the network. If the set target is reached, stop the calculation and if it fails to meet the target, calculate the change value of the error function, ΔE = E(£+1)-E(£), and ΔE < e(s in [0, 1 ]). When the random number reaches a given number of times, it means that the neural network has converged to the local minimum value and then proceed to step (3)(3)
Calling Secure Internet of Things: its function subroutine is shown as follows :(1)
Perform binary coding and initialize the population(2)
Input samples and train BP network(3)
Calculate the fitness value of the individual(4)
Selection, crossover, and mutation operations act on the current population


## 3.1. Structural Design of the Attitude Sensor

The attitude sensor detection platform mainly includes support mechanism, executive member, driving element, transmission part, detection element, and human-computer interactive display interface. The selection and main functions of each component are as follows:(1)
Drive element: the hand crank is the drive element of the detection platform, which drives the worm gear to rotate by shaking the hand crank [22, 23].(2)
Transmission components: the driving torque of the hand wheel is transmitted to the inner and outer frame small shafts through the worm gear transmission device.(3)
Actuating component: the rotation of the inner and outer frame detection platform is driven by the rotation of the inner and outer frame small shaft.The operation of the 3D attitude sensor can be divided into two basic modes, namely, the debugging phase and the normal operation. The data of the gyroscope and the angle sensor are used to compare the data to obtain the attitude information of the carrier, and the gap between the two can also be judged [24].


## 3.2. BP Neural Network Algorithm Based on Secure Internet of Things Optimization

Through Secure Internet of Things classification and optimization, the optimal individual can be screened out, and BP network decomposition calculation can play their respective advantages so that the network has both the nonlinear interpolation calculation ability of the BP network algorithm and the characteristics of the overall optimization calculation of Secure Internet of Things so as to obtain more accurate data as the weight of the BP neural network and improve the stability and accuracy of the BP network model so as to better optimize the effect. Compared with the common Internet of things, the biggest advantage of the secure Internet of things is its security and confidentiality.The learning process of Secure Internet of Things to optimize the weights of the BP learning algorithm is as follows:(1)
The network weight value set is represented by a randomly generated binary representation, which can be transformed by encoding and decoding;(2)
The fitness function of the Secure Internet of Things is related to the total error function of the neural network. The expression of the fitness function is(19)f=1+1E.Among them, use formula (2) to express the total error of the neural network.(20)E=12∑k−1K∑j−1Qdkj−ykj2.(3)
The weight of each network is decoded from each binary string, and the performance characteristics of the network are evaluated through network training. Assuming the group size is, the probability that the algorithm selects individual i is as follows:(21)Pi=fi∑j=1nfj.In the formula,fi is the fitness value of the ith chromosome, and the probability of each chromosome being selected is Pi.(4)
After the network is selected, genetic operations such as crossover and mutation are performed with the preset probability valuesPC and PM to produce the next generation network. Repeat (2)–(4) operations until the network is optimized by Secure Internet of Things and reaches the required accuracy.


## 3.3. Algorithm Improvement Steps

GA-LM-BP algorithm is an effective method combining BP algorithm with Secure Internet of Things and L-M algorithm to speed up the convergence speed and avoid falling into local minimum. The algorithm steps are as follows:(1)
Assign the random number between [−1, 1] to the weight and get the initial weight w (0)(2)
Carry out forward operation to calculate the total error function of the network. If the set target is reached, stop the calculation and if it fails to meet the target, calculate the change value of the error function, ΔE = E(£+1)-E(£), and ΔE < e(s in [0, 1 ]). When the random number reaches a given number of times, it means that the neural network has converged to the local minimum value and then proceed to step (3)(3)
Calling Secure Internet of Things: its function subroutine is shown as follows :(1)
Perform binary coding and initialize the population(2)
Input samples and train BP network(3)
Calculate the fitness value of the individual(4)
Selection, crossover, and mutation operations act on the current population


## 4. Analysis of Table Tennis

### 4.1. Power Analysis of Sport Posture and Serve

In table tennis reverse rotation serve technical action, the change of body center of gravity is mainly reflected in the change of its center of gravity in the four directions: up, down, left, and right. In each stage of the technical process, the change of center of gravity is of great significance. This shows that in this process, the athlete’s right lower limb does the push and extension movement, while the left lower limb is in the flexion movement, and its center of gravity gradually moves to the left side. The larger the prediction step size from the current input time to the current output time, the smaller the prediction error is from the current input to the output as shown in Table1 and Figure 3.Table 1
Forecast error results.
Prediction frame152025303540Step size is 5 network prediction error (×10−3m)3.9124.4455.1626.0757.1428.289Step size is 10 network prediction error (×10−3m)4.1614.6775.2796.0997.0818.140Step size is 15 network prediction error (×10−3m)4.3744.6985.1925.8786.5197.406Figure 3
Forecast error results.


### 4.2. Performance Analysis of the Attitude Sensor

In the process of dynamic motion of the attitude sensor, the signal received by the tilt sensor is often instantaneous signal, so the acquisition and analysis of these instantaneous and fast-changing signals need to study the dynamic characteristics of the attitude sensor. With the improvement of the accuracy of sensor testing and the requirement of stability assurance of the attitude sensor in a complex environment, it is necessary for the sensor to have good dynamic characteristics. It can be seen from Figure4 that the real-time velocity of the carrier calculated by the uncorrected system is about 0.07 m/s, and the displacement is about 1.55 m. The difference between the actual velocity and the carrier is about 0.07 m/s, and the actual displacement is about 0.45 m. The modified velocity of the carrier is close to 0.01 m/s, and the displacement of the carrier is about 1.9 m. The measurement results are closer to the real motion state of the carrier.Figure 4
Comparison of exercise data before and after correction.The experimental results of random displacement of the self-positioning system are shown in Table2 and Figure 5. The results show that the average measurement errors of x, y, and z axes are 8.17%, 7.51%, and 9.72% respectively, and the average errors of three-dimensional measurement are 8.7%. Therefore, the positioning error of the positioning system is relatively large. Due to the inherent defects of this positioning theory, track the moving target continuously and stably.Table 2
Random displacement experiment results of the self-positioning system.
Serial numberX-axis displacementY-axis displacementZ-axis displacementX-axis true displacementY-axis true displacementZ-axis true displacement11.580.470.871.730.410.9221.670.781.621.830.861.5331.821.551.311.801.761.5441.191.071.351.121.031.2551.211.430.671.351.520.7361.381.181.141.521.371.2271.350.921.221.521.011.3480.781.141.180.831.251.1192.051.861.951.841.681.76102.262.542.212.522.732.36Figure 5
Random displacement experiment results of the self-positioning system.In the process of table tennis, the sensor signal is easily influenced by the human body and the external environment.Figure6 shows the curve of the angle of the calf during walking. In the figure, the abscissa represents time.Figure 6
Angle contrast of Kalman filter during walking.Figure7 is a comparison diagram of the angular velocity and angle of the forearm when hitting the ball, and Figure 8 is a comparison diagram of the angular velocity and angle of the lower leg when hitting the ball, so the division of unit actions based on angles can reduce the complexity of implementation.Figure 7
Comparison chart of angular velocity (a) and angle (b) of the forearm.
(a)(b)Figure 8
Comparison of the angular velocity (a) and angle (b) of the calf.
(a)(b)


### 4.3. Correlation Analysis of Sports Posture and Serving Power

Table tennis will be affected by air resistance in the process of high-speed flight. Therefore, when establishing the motion model of table tennis flight, it is necessary to analyze the air resistance and evaluate its impact on the target tracking of table tennis. Based on the extended continuous model of table tennis flight motion, the unsupervised clustering algorithm is used to cluster the trajectory of table tennis in different rotation states. This method has good prediction accuracy and fast convergence speed, but it can only adapt to the specific type of table tennis trajectory prediction, and the prediction accuracy of the low-speed rotating ball is low.


### 4.4. Comparative Analysis of Algorithms

The optimal Kalman filtering algorithm has recursive minimum variance estimation. The filter designed by the state space method in the time domain can complete the optimal linear filtering of the random signal. Although the fitting methods are different, the correlation coefficient between the expected results and the fitting results is very high, as shown in Figure9, which further proves that there is a great correlation between the starting speed, rotation, and coordinates and the coordinates of the falling point of the ball.Figure 9
Comparison of algorithm fitting results.


### 4.5. Attitude Calculation Accuracy Test

The completion of table tennis is mainly achieved through the coordinated movement of the upper and lower limbs of the athlete. Therefore, when understanding the movement of table tennis, it is necessary to discuss the movements of the upper and lower limbs separately.It can be seen from Tables3 and 4 that for the classification of movements of different limbs, the recognition effect achieved by BP artificial neural network is better. Table 5 shows the recognition results for merged limbs motion.Table 3
Recognition results for upper limbs motions.
BehaviorC4.5 accuracyC4.5 recall rateSVM accuracySVM recall rateBN accuracyBN recall rateBP-ANN accuracyBP-ANN recall rateServe0.9370.9520.9630.9740.8950.9270.9640.976Standing catch0.9080.9300.9740.9880.9340.9540.9810.978Running catch0.9230.9070.9860.9920.9560.9130.9720.976Jump catch0.7800.8000.6910.8620.8020.7550.8740.897Average0.8600.8600.8710.8660.8470.8470.9320.932Table 4
Recognition results for lower limbs motions.
BehaviorC4.5 accuracyC4.5 recall rateSVM accuracySVM recall rateBN accuracyBN recall rateBP-ANN accuracyBP-ANN recall rateJump0.9940.9920.9760.9990.9790.9730.9850.999Run0.9760.9740.9930.9730.9550.9720.9940.985Walk0.9660.9660.9860.9920.9770.9590.9930.988Average0.9840.9840.9880.9880.9700.9700.9920.992Table 5
Recognition results for merged limbs motion.
BehaviorC4.5 accuracyC4.5 recall rateSVM accuracySVM recall rateBN accuracyBN recall rateBP-ANN accuracyBP-ANN recall rateServe0.9430.9380.9680.9710.8640.9590.9840.990Catch0.9170.9390.9770.9900.9320.9890.9940.993Smash0.9840.9850.9850.9920.9850.9090.9730.985Average0.9630.9630.9880.9880.9630.9630.9900.990As shown in Figure10, where the abscissa represents the type of action, the ordinate represents the accuracy rate, and the recognition method is for each table tennis. The recognition accuracy rate of ball movements exceeded 95%, and the average accuracy rate reached 98.85%.Figure 10
Recognition result for basketball motion by BP-ANN.


## 4.1. Power Analysis of Sport Posture and Serve

In table tennis reverse rotation serve technical action, the change of body center of gravity is mainly reflected in the change of its center of gravity in the four directions: up, down, left, and right. In each stage of the technical process, the change of center of gravity is of great significance. This shows that in this process, the athlete’s right lower limb does the push and extension movement, while the left lower limb is in the flexion movement, and its center of gravity gradually moves to the left side. The larger the prediction step size from the current input time to the current output time, the smaller the prediction error is from the current input to the output as shown in Table1 and Figure 3.Table 1
Forecast error results.
Prediction frame152025303540Step size is 5 network prediction error (×10−3m)3.9124.4455.1626.0757.1428.289Step size is 10 network prediction error (×10−3m)4.1614.6775.2796.0997.0818.140Step size is 15 network prediction error (×10−3m)4.3744.6985.1925.8786.5197.406Figure 3
Forecast error results.


## 4.2. Performance Analysis of the Attitude Sensor

In the process of dynamic motion of the attitude sensor, the signal received by the tilt sensor is often instantaneous signal, so the acquisition and analysis of these instantaneous and fast-changing signals need to study the dynamic characteristics of the attitude sensor. With the improvement of the accuracy of sensor testing and the requirement of stability assurance of the attitude sensor in a complex environment, it is necessary for the sensor to have good dynamic characteristics. It can be seen from Figure4 that the real-time velocity of the carrier calculated by the uncorrected system is about 0.07 m/s, and the displacement is about 1.55 m. The difference between the actual velocity and the carrier is about 0.07 m/s, and the actual displacement is about 0.45 m. The modified velocity of the carrier is close to 0.01 m/s, and the displacement of the carrier is about 1.9 m. The measurement results are closer to the real motion state of the carrier.Figure 4
Comparison of exercise data before and after correction.The experimental results of random displacement of the self-positioning system are shown in Table2 and Figure 5. The results show that the average measurement errors of x, y, and z axes are 8.17%, 7.51%, and 9.72% respectively, and the average errors of three-dimensional measurement are 8.7%. Therefore, the positioning error of the positioning system is relatively large. Due to the inherent defects of this positioning theory, track the moving target continuously and stably.Table 2
Random displacement experiment results of the self-positioning system.
Serial numberX-axis displacementY-axis displacementZ-axis displacementX-axis true displacementY-axis true displacementZ-axis true displacement11.580.470.871.730.410.9221.670.781.621.830.861.5331.821.551.311.801.761.5441.191.071.351.121.031.2551.211.430.671.351.520.7361.381.181.141.521.371.2271.350.921.221.521.011.3480.781.141.180.831.251.1192.051.861.951.841.681.76102.262.542.212.522.732.36Figure 5
Random displacement experiment results of the self-positioning system.In the process of table tennis, the sensor signal is easily influenced by the human body and the external environment.Figure6 shows the curve of the angle of the calf during walking. In the figure, the abscissa represents time.Figure 6
Angle contrast of Kalman filter during walking.Figure7 is a comparison diagram of the angular velocity and angle of the forearm when hitting the ball, and Figure 8 is a comparison diagram of the angular velocity and angle of the lower leg when hitting the ball, so the division of unit actions based on angles can reduce the complexity of implementation.Figure 7
Comparison chart of angular velocity (a) and angle (b) of the forearm.
(a)(b)Figure 8
Comparison of the angular velocity (a) and angle (b) of the calf.
(a)(b)


## 4.3. Correlation Analysis of Sports Posture and Serving Power

Table tennis will be affected by air resistance in the process of high-speed flight. Therefore, when establishing the motion model of table tennis flight, it is necessary to analyze the air resistance and evaluate its impact on the target tracking of table tennis. Based on the extended continuous model of table tennis flight motion, the unsupervised clustering algorithm is used to cluster the trajectory of table tennis in different rotation states. This method has good prediction accuracy and fast convergence speed, but it can only adapt to the specific type of table tennis trajectory prediction, and the prediction accuracy of the low-speed rotating ball is low.


## 4.4. Comparative Analysis of Algorithms

The optimal Kalman filtering algorithm has recursive minimum variance estimation. The filter designed by the state space method in the time domain can complete the optimal linear filtering of the random signal. Although the fitting methods are different, the correlation coefficient between the expected results and the fitting results is very high, as shown in Figure9, which further proves that there is a great correlation between the starting speed, rotation, and coordinates and the coordinates of the falling point of the ball.Figure 9
Comparison of algorithm fitting results.


## 4.5. Attitude Calculation Accuracy Test

The completion of table tennis is mainly achieved through the coordinated movement of the upper and lower limbs of the athlete. Therefore, when understanding the movement of table tennis, it is necessary to discuss the movements of the upper and lower limbs separately.It can be seen from Tables3 and 4 that for the classification of movements of different limbs, the recognition effect achieved by BP artificial neural network is better. Table 5 shows the recognition results for merged limbs motion.Table 3
Recognition results for upper limbs motions.
BehaviorC4.5 accuracyC4.5 recall rateSVM accuracySVM recall rateBN accuracyBN recall rateBP-ANN accuracyBP-ANN recall rateServe0.9370.9520.9630.9740.8950.9270.9640.976Standing catch0.9080.9300.9740.9880.9340.9540.9810.978Running catch0.9230.9070.9860.9920.9560.9130.9720.976Jump catch0.7800.8000.6910.8620.8020.7550.8740.897Average0.8600.8600.8710.8660.8470.8470.9320.932Table 4
Recognition results for lower limbs motions.
BehaviorC4.5 accuracyC4.5 recall rateSVM accuracySVM recall rateBN accuracyBN recall rateBP-ANN accuracyBP-ANN recall rateJump0.9940.9920.9760.9990.9790.9730.9850.999Run0.9760.9740.9930.9730.9550.9720.9940.985Walk0.9660.9660.9860.9920.9770.9590.9930.988Average0.9840.9840.9880.9880.9700.9700.9920.992Table 5
Recognition results for merged limbs motion.
BehaviorC4.5 accuracyC4.5 recall rateSVM accuracySVM recall rateBN accuracyBN recall rateBP-ANN accuracyBP-ANN recall rateServe0.9430.9380.9680.9710.8640.9590.9840.990Catch0.9170.9390.9770.9900.9320.9890.9940.993Smash0.9840.9850.9850.9920.9850.9090.9730.985Average0.9630.9630.9880.9880.9630.9630.9900.990As shown in Figure10, where the abscissa represents the type of action, the ordinate represents the accuracy rate, and the recognition method is for each table tennis. The recognition accuracy rate of ball movements exceeded 95%, and the average accuracy rate reached 98.85%.Figure 10
Recognition result for basketball motion by BP-ANN.


## 5. Conclusions

This paper mainly studies the table tennis movement analysis and strength monitoring system based on the posture sensor. By introducing the dynamic characteristics of the attitude sensor, the expression method of its dynamic characteristics is studied. The estimation method of table tennis rotation parameters is deduced based on the Kalman filter. The complete motion estimation algorithm is composed of the trajectory prediction part and rotation parameter estimation part.In this paper, on the basis of obtaining the coordinates of the center image of the table tennis target, according to the camera geometry model and its internal and external parameters, the three-dimensional position of the table tennis target is reconstructed and the positioning of the table tennis target is realized. Because the closed solution has high accuracy, the optimization calculation process can also converge quickly. Finally, the external parameters of the camera and the structural parameters of the vision system are used to locate the table tennis ball. The accuracy and real-time performance of the calibration method are verified by comparative experiments. However, due to the limited length of the article, the method and experimental derivation of the article are still too rough. In the future, the author looks forward to conducting in-depth research with a more accurate method.



---

*Source: 6145450-2022-09-08.xml*