# Basketball Training Posture Monitoring Based on Intelligent Wearable Device

Authors: Xiangfeng Hou; Bo Qi
Journal: Mobile Information Systems
 (2022)

---

## Abstract

Aiming at the problems of low monitoring accuracy, long time, and poor effect in the current basketball training posture monitoring method, a basketball training posture monitoring method based on intelligent wearable devices is proposed. By analyzing the concept and classification of intelligent wearable devices, the attitude monitoring technology based on intelligent wearable devices is studied. A two-stage Kalman filter is used to correct the error caused by the drift of the gyroscope signal in the intelligent wearable device by constructing an adaptive acceleration error covariance matrix. The time sequence of collecting acceleration and angular velocity signals is segmented, and the characteristics of basketball training posture are extracted from the sensor signals of the intelligent wearable device. The SVM classification algorithm is used to monitor the basketball training posture and realize the basketball training posture monitoring. The experimental results show that the basketball training posture monitoring effect of the proposed method is better, which can effectively improve the monitoring accuracy and shorten the monitoring time.


---

## Body

## 1. Introduction

With the rapid development of microelectronics technology, electronic devices are becoming more and more intelligent and humanized. Various intelligent devices, such as smartphones and smartwatches, can handle a wider range of tasks, bringing great convenience to all aspects of life [1]. The development, processing power, and computing level of smartdevices have been greatly improved, and their functions are becoming more and more powerful. The role it plays in people’s lives has long been not limited to communication equipment, but is an indispensable necessity for people’s lives. These increasingly powerful smartmobile devices can be used anytime, anywhere, to check emails, read online news, communicate through social networks, etc. [2]. In the field of basketball, the formulation of the existing training plan mainly depends on the coaches’ manual observation and personal experience, which is inevitably subjective [3]. The application of body area network technology to the training of athletes and the monitoring of athletes’ posture can help coaches assist in decision-making and greatly improve athletes’ competitive ability. Therefore, the research on basketball training posture monitoring is of great significance.At present, scholars in related fields have studied attitude monitoring and made great progress. Reference [4] proposed a method for monitoring and controlling the position and attitude of a three degree of freedom flexible manipulator. A flexible manipulator based on three pneumatic muscles is designed and manufactured. Based on the flexible manipulator and its kinematics model, an experimental platform for position and attitude monitoring and control of flexible manipulator is built. The kinematic model designed by this method has certain effectiveness and feasibility. Reference [5] proposed an interframe motion detection method for large-scale dynamic image sequences. By analyzing the fluctuation and periodicity of the interference vector in the dynamic image sequence, the current state of the detection frame is determined and classified into fluctuation interference window, motion window, and background window. Using threshold segmentation and morphological processing, all motion windows are combined to determine the motion frame, and the interframe motion detection is completed. This method can effectively reduce the interference vector in dynamic image sequence and greatly improve the accuracy and robustness of interframe motion detection. However, the above methods still have the problems of low monitoring accuracy, long time, and poor effect.Aiming at the above problems, a basketball training posture monitoring method based on intelligent wearable devices is proposed. A two-stage Kalman filter is used to correct the error caused by gyro signal drift in intelligent wearable devices. The time series of the collected acceleration and angular velocity signals are segmented, and the basketball training posture characteristics are extracted from the sensor signals of the intelligent wearable device. The SVM classification algorithm is adopted to realize basketball training posture monitoring. The basketball training posture monitoring effect of this method is better, the monitoring accuracy is higher, and the monitoring time is shorter.The rest of the article is organized as follows: Section2 focuses on the intelligent wearable device, while Section 3 throws light on the basketball training posture monitoring method. Similarly, Section 4 is about experimental simulation and analysis, and Section 5 is the final concluding section of the article.


## 2. Intelligent Wearable Device

### 2.1. Concept and Classification of Intelligent Wearable Devices

Intelligent wearable device refers to a portable device that can be directly integrated into the user’s personal belongings (such as clothes and shoes) or directly used as accessories (watches, glasses, etc.) [6]. It is a high-tech technology that explores the way of interaction between people and the environment. It can realize the exclusive way of interaction between each person and the environment, or extract data from the way of interaction, so as to provide exclusive personalized services. Most of the calculation methods of intelligent wearable devices are mainly based on localized technology. However, the main reason for its rapid development in recent years is that it cannot only deal with local business, but also support the data interaction between the background and the cloud through software, which is more perfect in function. Finally, it can provide various specific targeted services for individuals through the information exchange with the central computing.Intelligent wearable devices can be divided into three categories: life and health, information consultation, and somatosensory control. The classification of intelligent wearable devices is shown in Figure1:(1)
Life health category: mainly includes sports wristbands and smartbracelets that provide users’ physical health data(2)
Information: mainly includes smartwatches and smartglasses that can provide information(3)
Somatosensory control: mainly refers to the somatosensory controller that can enhance the game experienceFigure 1
Classification of intelligent wearable devices.In terms of wearing methods, intelligent wearable devices can be divided into headwear, wristband, wearing, and portable. As an important application of the Internet of things, intelligent wearable devices have broad application prospects in medical care, youth growth, and elderly health care, which also means that they can bring very considerable economic benefits. It is a very meaningful work to study this field [7]. Intelligent wearable devices also collect a variety of data, such as the earliest wireless microphone and headset, and forward the collected data to background devices such as mobile phones through wireless devices such as Bluetooth. Among the intelligent wearable devices that have been put into use, the commonly used sensors include microphone, camera, GPS, accelerometer, gyroscope, optical sensor, and fingerprint sensor. With the help of this series of sensors, the background can collect a large number of user data, analyze and calculate these data, and finally complete various complex tasks such as voice monitoring, navigation, fingerprint monitoring, and step counting. The built-in sensor in the intelligent wearable device is shown in Figure 2.Figure 2
Built-in sensor in the intelligent wearable device.


### 2.2. Attitude Monitoring Based on Intelligent Wearable Devices

Attitude monitoring is a new research field that combines pervasive computing, context awareness, and multimedia. Monitoring activities of daily living is becoming a challenging application in pervasive computing. There are many interesting developments in the field of health care, human behavior model, and human-computer interaction [8]. Behavior analysis can be understood as automatically analyzing the obtained data by comprehensively using the knowledge and technology of computer vision, pattern monitoring, image processing, artificial intelligence, and other aspects without human intervention, so as to realize human body positioning, tracking, and monitoring in dynamic scenes. On this basis, analyze and judge human behavior, and its ultimate goal is to obtain the semantic description and understanding of behavior through the analysis of behavior characteristic data. In the past, these data mainly came from the image signals taken by the camera, but now the range and form of data are more diversified. In terms of behavior depth, attitude monitoring can be roughly divided into simple attitude monitoring and advanced attitude monitoring. Further subdivision can divide the behavior into four levels: attitude, action, interaction, and group behavior. The monitoring of attitude and action is simple attitude monitoring, and interaction and group attitude monitoring belong to advanced attitude monitoring. Simple posture monitoring has a great research value in the field of health and medical treatment, and advanced behavior plays a more obvious role in security.Generally speaking, human posture monitoring can be carried out in two different ways: computer vision-based and sensor-based activity monitoring. Vision-based activity monitoring is carried out using visual sensors such as cameras. In this method, the collected visual data (video, pictures, etc.) are transformed into digital sequence data, and then, different video processing technologies are used for feature extraction. Finally, the machine learning algorithm is used for pattern monitoring. The second type is sensor-based attitude monitoring, in which the time series data generated by the sensors monitoring activities can be classified and calculated by different machine learning methods. Such sensors include infrared sensors, accelerometers, gyroscopes, and other sensors that can reflect the relevant information of objects. Sensor-based attitude monitoring and computer vision-based attitude monitoring basically achieve the purpose of monitoring human activities in two different ways.Posture monitoring based on the intelligent wearable device is to wear the device at the relevant positions of the human body (such as legs, waist, and arms), read the data of sensors in the device, and identify different human postures through feature extraction. The human posture monitoring system realizes the interaction between wearable devices and server system, and adds other additional functions such as real-time display of recognition results on the basis of posture monitoring. The overall framework of the human posture monitoring system is shown in Figure3.Figure 3
Overall framework of the human posture monitoring system.The system is mainly composed of hardware and software:(1)
Hardware part: wearable equipment for human body information collection(2)
Software part: mobile app for data visualization and cloud service providing attitude monitoring functionSince the wearable device itself cannot be directly connected to the cloud, and the data in the device are transmitted to the mobile phone through Bluetooth, the mobile app is used to receive the data and upload it to the cloud through the network, so as to realize more complex attitude monitoring in the cloud and return the results to the mobile phone for display. In addition, the cloud service collects posture characteristics and physiological characteristics from different users, which can provide support for big data processing and statistics, and can also better correct the trained posture monitoring model.


## 2.1. Concept and Classification of Intelligent Wearable Devices

Intelligent wearable device refers to a portable device that can be directly integrated into the user’s personal belongings (such as clothes and shoes) or directly used as accessories (watches, glasses, etc.) [6]. It is a high-tech technology that explores the way of interaction between people and the environment. It can realize the exclusive way of interaction between each person and the environment, or extract data from the way of interaction, so as to provide exclusive personalized services. Most of the calculation methods of intelligent wearable devices are mainly based on localized technology. However, the main reason for its rapid development in recent years is that it cannot only deal with local business, but also support the data interaction between the background and the cloud through software, which is more perfect in function. Finally, it can provide various specific targeted services for individuals through the information exchange with the central computing.Intelligent wearable devices can be divided into three categories: life and health, information consultation, and somatosensory control. The classification of intelligent wearable devices is shown in Figure1:(1)
Life health category: mainly includes sports wristbands and smartbracelets that provide users’ physical health data(2)
Information: mainly includes smartwatches and smartglasses that can provide information(3)
Somatosensory control: mainly refers to the somatosensory controller that can enhance the game experienceFigure 1
Classification of intelligent wearable devices.In terms of wearing methods, intelligent wearable devices can be divided into headwear, wristband, wearing, and portable. As an important application of the Internet of things, intelligent wearable devices have broad application prospects in medical care, youth growth, and elderly health care, which also means that they can bring very considerable economic benefits. It is a very meaningful work to study this field [7]. Intelligent wearable devices also collect a variety of data, such as the earliest wireless microphone and headset, and forward the collected data to background devices such as mobile phones through wireless devices such as Bluetooth. Among the intelligent wearable devices that have been put into use, the commonly used sensors include microphone, camera, GPS, accelerometer, gyroscope, optical sensor, and fingerprint sensor. With the help of this series of sensors, the background can collect a large number of user data, analyze and calculate these data, and finally complete various complex tasks such as voice monitoring, navigation, fingerprint monitoring, and step counting. The built-in sensor in the intelligent wearable device is shown in Figure 2.Figure 2
Built-in sensor in the intelligent wearable device.


## 2.2. Attitude Monitoring Based on Intelligent Wearable Devices

Attitude monitoring is a new research field that combines pervasive computing, context awareness, and multimedia. Monitoring activities of daily living is becoming a challenging application in pervasive computing. There are many interesting developments in the field of health care, human behavior model, and human-computer interaction [8]. Behavior analysis can be understood as automatically analyzing the obtained data by comprehensively using the knowledge and technology of computer vision, pattern monitoring, image processing, artificial intelligence, and other aspects without human intervention, so as to realize human body positioning, tracking, and monitoring in dynamic scenes. On this basis, analyze and judge human behavior, and its ultimate goal is to obtain the semantic description and understanding of behavior through the analysis of behavior characteristic data. In the past, these data mainly came from the image signals taken by the camera, but now the range and form of data are more diversified. In terms of behavior depth, attitude monitoring can be roughly divided into simple attitude monitoring and advanced attitude monitoring. Further subdivision can divide the behavior into four levels: attitude, action, interaction, and group behavior. The monitoring of attitude and action is simple attitude monitoring, and interaction and group attitude monitoring belong to advanced attitude monitoring. Simple posture monitoring has a great research value in the field of health and medical treatment, and advanced behavior plays a more obvious role in security.Generally speaking, human posture monitoring can be carried out in two different ways: computer vision-based and sensor-based activity monitoring. Vision-based activity monitoring is carried out using visual sensors such as cameras. In this method, the collected visual data (video, pictures, etc.) are transformed into digital sequence data, and then, different video processing technologies are used for feature extraction. Finally, the machine learning algorithm is used for pattern monitoring. The second type is sensor-based attitude monitoring, in which the time series data generated by the sensors monitoring activities can be classified and calculated by different machine learning methods. Such sensors include infrared sensors, accelerometers, gyroscopes, and other sensors that can reflect the relevant information of objects. Sensor-based attitude monitoring and computer vision-based attitude monitoring basically achieve the purpose of monitoring human activities in two different ways.Posture monitoring based on the intelligent wearable device is to wear the device at the relevant positions of the human body (such as legs, waist, and arms), read the data of sensors in the device, and identify different human postures through feature extraction. The human posture monitoring system realizes the interaction between wearable devices and server system, and adds other additional functions such as real-time display of recognition results on the basis of posture monitoring. The overall framework of the human posture monitoring system is shown in Figure3.Figure 3
Overall framework of the human posture monitoring system.The system is mainly composed of hardware and software:(1)
Hardware part: wearable equipment for human body information collection(2)
Software part: mobile app for data visualization and cloud service providing attitude monitoring functionSince the wearable device itself cannot be directly connected to the cloud, and the data in the device are transmitted to the mobile phone through Bluetooth, the mobile app is used to receive the data and upload it to the cloud through the network, so as to realize more complex attitude monitoring in the cloud and return the results to the mobile phone for display. In addition, the cloud service collects posture characteristics and physiological characteristics from different users, which can provide support for big data processing and statistics, and can also better correct the trained posture monitoring model.


## 3. Basketball Training Posture Monitoring Method

### 3.1. Intelligent Wearable Device Data Preprocessing

#### 3.1.1. Signal Noise Reduction

The original sensor signals of intelligent wearable devices are usually mixed with random noise, instrument noise, and electromagnetic noise, and it is not conducive to the extraction of basketball training posture features. Therefore, it is necessary to filter the original acceleration signal of the intelligent wearable device. On the one hand, it is necessary to remove the noise of the original signal, and on the other hand, it is necessary to keep the data characteristics of the original signal from distortion.The Kalman filter only uses the previous data to estimate the current state, which has good real-time performance and short delay [9]. Therefore, the Kalman filter is widely used in the data filtering stage of basketball training posture monitoring. In addition, the gyroscope in intelligent wearable devices is affected by the superposition of gravity acceleration and carrier linear acceleration and signal drift. In view of this situation, a two-stage Kalman filter can be used to better correct the error caused by gyro signal drift in intelligent wearable devices by constructing an adaptive acceleration error covariance matrix. The algorithm of the two-stage Kalman filter is described as follows.The angular position is represented by a quaternionx=x0,x1,x2,x3T. The quaternion is composed of a real number and a vector. x0 represents a real number, and z=x1,x2,x3T represents a vector. First, perform a priori system estimation, read the angular velocity data αx,αy,αz in the three-axis gyroscope sensor in the intelligent wearable device, and calculate the discrete-time state transition matrix:(1)Qa=1+12βnbnW.Here,W represents the time step of each execution of the algorithm. The prior noise covariance matrix can be expressed as(2)Aa=QaZa−1QaW.Here,Za−1 is the posterior error covariance matrix in the previous filter iteration. Then, perform the first-stage Kalman filter correction and read the accelerometer data. Since the acceleration measured by the accelerometer in the intelligent wearable device is affected by gravity, it must be weighted with Kalman gain. In order to calculate the Kalman gain, it is necessary to calculate the Jacobian matrix of the partial derivative of the quaternion noise:(3)Sa1=−2x22x3−2x02x12x12x02x32x22x0−2x1−2x22x3.From this, the Kalman gainXa1 that has been corrected by one level can be obtained:(4)Xa1=AaSa1WSa1AaSa1W+Ea1−1.Here,Ea1 is the noise covariance matrix of the accelerometer, and since the noise generated by the accelerometer has nothing to do with the current angular position, the Jacobian matrix Sa1 is an identity matrix [10]. After that, the posterior error covariance matrix can be calculated as follows:(5)Aa1=Aa1−Xa1Sa1.The correction of the second-stage Kalman filter is similar to that of the first stage, but different noise covariance matrices are used to obtain Kalman gain, read the magnetic field data in the electronic compass, and calculate the corresponding Jacobian matrix:(6)Sa2=2x32x22x12x02x0−2x1−2x2−2x3−2x1−2x02x32x2.Similarly, the two-level modified Kalman gainXa2 and the posterior error covariance matrix Aa2 can be obtained as follows:(7)Xa2=AaSa2WSa2AaSa2W+Ea1−1,Aa2=Aa1−Xa2Sa2.The two-stage Kalman filter model is shown in Figure4.Figure 4
Two-stage Kalman filter model.This method has lower requirements for hardware computing power and is more robust to abnormal magnetic fields.


#### 3.1.2. Time Series Segmentation

The collected acceleration and angular velocity signals are a typical time series. It is necessary to segment the sensor signals in intelligent wearable devices to facilitate the effective extraction of basketball training posture features. The first step of time series data segmentation in this study is to extract the features that can distinguish different categories from the labeled dataset and label the time series of unknown classes. If the datasetP=p1,p2,…,pn, pi in P has m sample values and a category label li, it can be expressed as(8)pi=li,pi1,pi2,…,pim.A shapelet is a tuplek,o composed of a subsequence k of a certain time series in the dataset P and a split threshold o, where δ is the distance threshold. It divides P into two subsets, where(9)Pl=χ:χ∈P,subdistk,o≤δ,Pr=χ:χ∈P,subdistk,o>δ.In order to obtain the most recognizable shapelet, the quality of the shapelet needs to be evaluated. This study uses the information gain method to test [11]. Let L1=Pl,L2=Pr, and its information gain be(10)Ik,o=EP−L1LEPl−L2LEPr,(11)EP=−∑i=1εLiLlogLiL.Here,EP is information entropy, ε is the number of classes, and L is the number of time series in P.


#### 3.1.3. Feature Extraction

The quality of feature extraction is very important for correctly distinguishing data. The quality of feature selection will directly affect the basketball training posture monitoring. Different applications need to use different metrics, and the metrics used depends on the characteristics and characteristic domain of the data itself. Because features have different functions in different feature domains, different information can be extracted from sensor signals in intelligent wearable devices.(1) Time Domain Characteristics. The time domain characteristics of data also become statistical characteristics, which are calculated by the method of probability statistics [12]. The mean describes the average value of acceleration signal in a data segment, and its calculation formula is as follows:(12)ϕ=1L∑n=1Lxn.The root mean square describes the trend of the overall value, and its calculation method is as follows:(13)Mrms=1L∑n=1nxn2.The standard deviation reflects the dispersion of data. The standard deviation is the square of variance, and its calculation method is as follows:(14)φ=1L∑i=1nxn2−γ2.The standard deviation also reflects the dispersion of data, and its calculation method is as follows:(15)U=1L−1∑i=1nxn2−γ2.Interquartile spacing can describe the degree of variation of data. First, sort the data segments. The difference between the upper quartile and the lower quartile is the interquartile spacing. Skewness can describe the degree of symmetry of data with respect to the mean, and its calculation method is as follows:(16)skewY=EY−tη3.Kurtosis can describe the central aggregation degree of data, and its calculation method is as follows:(17)kurtosisY=∑i=1nxn2−γ4L−1η.In linear space, in addition to the data features described above, there are extreme value, maximum value, minimum value, and other data features. The main time domain features used in this study are mean and variance.(2) Frequency Domain Characteristics. Frequency domain is a coordinate system used to describe the frequency characteristics of signals [13]. Frequency domain features include signal amplitude and energy. The signal transformation from time domain to frequency domain is mainly realized by fast Fourier transform (FFT) [14]. FFT is based on the optimization of Fourier transform. The discrete Fourier transform formula is as follows:(18)Yj=∑n=0L−1xnGLnk.Here,xn is a sample point of a complex point sequence corresponding to it after FFT transformation. The DC component of the signal corresponds to the first value of Y. The residual value corresponds to the amplitude of the component of the signal in the frequency band. The amplitude of the signal component is calculated as follows:(19)Hn=2c2+v2L.The energy of the signal is the square sum of the amplitudes of each low-frequency component, and its calculation formula is as follows:(20)EY=∑n=1LHi2.


### 3.2. Basketball Training Posture Monitoring

Based on a statistical theory, support vector machine (SVM) seeks the best compromise between the complexity of a limited sample information model and learning ability to obtain the best generalization ability [15]. SVM is mainly used to solve a small number of samples and has great advantages in pattern monitoring. It can be extended to other machine learning problems such as function fitting. Based on the basketball training posture monitoring based on intelligent wearable devices, this study uses the SVM classification algorithm to monitor the basketball training posture. Its concrete realization needs two stages: training stage and monitoring stage. In the training stage, different classification models are mainly established for the acceleration values of several different dimensions of the acceleration sensor. In the monitoring stage, online monitoring is carried out for different test samples. The intelligent wearable basketball training posture monitoring model is shown in Figure 5.Figure 5
Intelligent wearable basketball training posture monitoring model.Let the sample set beQi,Wi,i=1,2,…,n, and x∈Rd,y∈+1,−1 is the category symbol. The median linear discriminant function of the d dimensional space is bx=yη+h, and the classification surface equation is yη+h=0. Normalize the discriminant function so that all samples satisfy bx=1, that is, to ensure the bx=1 of the closest point to the classification surface, so that the classification interval is equal to 2/ω, so maximizing the interval is equivalent to minimizing ω. If the classification line is used to correctly classify the sample, the following formula needs to be satisfied:(21)ξiy×η+h−1≥0.The classification plane with the minimum value ofω is the optimal classification plane. The training samples passing through the nearest point from the classification plane and parallel to the hyperplane G1,G2 of the optimal classification plane in the two types of samples are support vectors. The constraints are as follows:(22)∑i=1nξiψi=0.Solve for the maximum value of the following function forψi:(23)Vψ=∑i=1nψi−12∑i,j=1nψiψjξiξj.Ifψ∗ is the optimal solution, then(24)y∗=∑i=1nψ∗uψiThat is, the weight coefficient vector of the optimal classification surface is a linear combination of training samples.This is the extreme value problem of the quadratic function, and it has a unique solution. Generally, a small number ofψi is not zero, and the samples corresponding to the nonzero solution are called support vectors. The optimal classification function obtained after solving is(25)Fη=sgny∗×η+h∗=sgn∑i=1nψi∗ηiy∗×η+h∗.Here,ψi corresponding to the non-support vectors are all zero, so the summation of the above formula is only performed on the support vectors. h∗ is the classification threshold, which can be calculated from any support vector by formula (21) (only the support vector satisfies the equal sign condition) or calculated by taking the median of any of the support vectors of the two types.From the above analysis, the optimal classification surface is obtained under the premise of linear separability. In the case of inseparability, it means that some training samples cannot satisfy the condition of formula (21), so a relaxation term parameter is added to the condition μi≥0:(26)ξiy×ηi+h−1+μi≥0.For a particularly smallσ>0, as long as it satisfies the following:(27)Fϖθ=∑i=1nθiϖ.Minimum can minimize the number of wrong classification samples and maximize the classification interval in the case of linear separability. In the case of nonseparability of linearity, the following constraints can be introduced:(28)ω2≤sg.For simplification, the minimum value can be obtained under the constraint of conditional formula (26):(29)ιμ,ν=12κ,λ+K∑i=1nμi.Here,K is a certain constant, which plays a role in controlling the degree of punishment for subsamples. The method of solving this problem is similar to the method of solving the optimal classification surface. Both can be transformed into the extreme value problem of the quadratic function, but the constraint formula (22) is as follows:(30)0≤ψi≤K.The training of original data samples is mainly composed of the following three steps. The corresponding SVM basketball training posture monitoring steps are as follows:Step 1. Collect data on the training posture dii=1,2,3,…,n of known smart wearable basketball as training samples.Step 2. Extract the same eigen values (three-axis directions and parameter sizes of different postures) for the data to form a feature vector. Suppose that the intelligent wearable basketball training posture υ has Sυ feature values, then τ intelligent wearable basketball training postures have ∑i=1nSυ feature vectors.Step 3. Establish a multiclassification model for the existing data samples.After the training, monitor the data collected in real time. The specific steps are as follows:Step 1. Intercept the acceleration value of the real-time intelligent wearable basketball training posture, extract the same eigenvalue as that in the training stage, and obtain the test vector.Step 2. Generate test samples according to eigenvalues.Step 3. Input the test samples into the previous multiclass classifier for monitoring to obtain the corresponding monitoring results. Through the above steps, basketball training posture monitoring is realized.


## 3.1. Intelligent Wearable Device Data Preprocessing

### 3.1.1. Signal Noise Reduction

The original sensor signals of intelligent wearable devices are usually mixed with random noise, instrument noise, and electromagnetic noise, and it is not conducive to the extraction of basketball training posture features. Therefore, it is necessary to filter the original acceleration signal of the intelligent wearable device. On the one hand, it is necessary to remove the noise of the original signal, and on the other hand, it is necessary to keep the data characteristics of the original signal from distortion.The Kalman filter only uses the previous data to estimate the current state, which has good real-time performance and short delay [9]. Therefore, the Kalman filter is widely used in the data filtering stage of basketball training posture monitoring. In addition, the gyroscope in intelligent wearable devices is affected by the superposition of gravity acceleration and carrier linear acceleration and signal drift. In view of this situation, a two-stage Kalman filter can be used to better correct the error caused by gyro signal drift in intelligent wearable devices by constructing an adaptive acceleration error covariance matrix. The algorithm of the two-stage Kalman filter is described as follows.The angular position is represented by a quaternionx=x0,x1,x2,x3T. The quaternion is composed of a real number and a vector. x0 represents a real number, and z=x1,x2,x3T represents a vector. First, perform a priori system estimation, read the angular velocity data αx,αy,αz in the three-axis gyroscope sensor in the intelligent wearable device, and calculate the discrete-time state transition matrix:(1)Qa=1+12βnbnW.Here,W represents the time step of each execution of the algorithm. The prior noise covariance matrix can be expressed as(2)Aa=QaZa−1QaW.Here,Za−1 is the posterior error covariance matrix in the previous filter iteration. Then, perform the first-stage Kalman filter correction and read the accelerometer data. Since the acceleration measured by the accelerometer in the intelligent wearable device is affected by gravity, it must be weighted with Kalman gain. In order to calculate the Kalman gain, it is necessary to calculate the Jacobian matrix of the partial derivative of the quaternion noise:(3)Sa1=−2x22x3−2x02x12x12x02x32x22x0−2x1−2x22x3.From this, the Kalman gainXa1 that has been corrected by one level can be obtained:(4)Xa1=AaSa1WSa1AaSa1W+Ea1−1.Here,Ea1 is the noise covariance matrix of the accelerometer, and since the noise generated by the accelerometer has nothing to do with the current angular position, the Jacobian matrix Sa1 is an identity matrix [10]. After that, the posterior error covariance matrix can be calculated as follows:(5)Aa1=Aa1−Xa1Sa1.The correction of the second-stage Kalman filter is similar to that of the first stage, but different noise covariance matrices are used to obtain Kalman gain, read the magnetic field data in the electronic compass, and calculate the corresponding Jacobian matrix:(6)Sa2=2x32x22x12x02x0−2x1−2x2−2x3−2x1−2x02x32x2.Similarly, the two-level modified Kalman gainXa2 and the posterior error covariance matrix Aa2 can be obtained as follows:(7)Xa2=AaSa2WSa2AaSa2W+Ea1−1,Aa2=Aa1−Xa2Sa2.The two-stage Kalman filter model is shown in Figure4.Figure 4
Two-stage Kalman filter model.This method has lower requirements for hardware computing power and is more robust to abnormal magnetic fields.


### 3.1.2. Time Series Segmentation

The collected acceleration and angular velocity signals are a typical time series. It is necessary to segment the sensor signals in intelligent wearable devices to facilitate the effective extraction of basketball training posture features. The first step of time series data segmentation in this study is to extract the features that can distinguish different categories from the labeled dataset and label the time series of unknown classes. If the datasetP=p1,p2,…,pn, pi in P has m sample values and a category label li, it can be expressed as(8)pi=li,pi1,pi2,…,pim.A shapelet is a tuplek,o composed of a subsequence k of a certain time series in the dataset P and a split threshold o, where δ is the distance threshold. It divides P into two subsets, where(9)Pl=χ:χ∈P,subdistk,o≤δ,Pr=χ:χ∈P,subdistk,o>δ.In order to obtain the most recognizable shapelet, the quality of the shapelet needs to be evaluated. This study uses the information gain method to test [11]. Let L1=Pl,L2=Pr, and its information gain be(10)Ik,o=EP−L1LEPl−L2LEPr,(11)EP=−∑i=1εLiLlogLiL.Here,EP is information entropy, ε is the number of classes, and L is the number of time series in P.


### 3.1.3. Feature Extraction

The quality of feature extraction is very important for correctly distinguishing data. The quality of feature selection will directly affect the basketball training posture monitoring. Different applications need to use different metrics, and the metrics used depends on the characteristics and characteristic domain of the data itself. Because features have different functions in different feature domains, different information can be extracted from sensor signals in intelligent wearable devices.(1) Time Domain Characteristics. The time domain characteristics of data also become statistical characteristics, which are calculated by the method of probability statistics [12]. The mean describes the average value of acceleration signal in a data segment, and its calculation formula is as follows:(12)ϕ=1L∑n=1Lxn.The root mean square describes the trend of the overall value, and its calculation method is as follows:(13)Mrms=1L∑n=1nxn2.The standard deviation reflects the dispersion of data. The standard deviation is the square of variance, and its calculation method is as follows:(14)φ=1L∑i=1nxn2−γ2.The standard deviation also reflects the dispersion of data, and its calculation method is as follows:(15)U=1L−1∑i=1nxn2−γ2.Interquartile spacing can describe the degree of variation of data. First, sort the data segments. The difference between the upper quartile and the lower quartile is the interquartile spacing. Skewness can describe the degree of symmetry of data with respect to the mean, and its calculation method is as follows:(16)skewY=EY−tη3.Kurtosis can describe the central aggregation degree of data, and its calculation method is as follows:(17)kurtosisY=∑i=1nxn2−γ4L−1η.In linear space, in addition to the data features described above, there are extreme value, maximum value, minimum value, and other data features. The main time domain features used in this study are mean and variance.(2) Frequency Domain Characteristics. Frequency domain is a coordinate system used to describe the frequency characteristics of signals [13]. Frequency domain features include signal amplitude and energy. The signal transformation from time domain to frequency domain is mainly realized by fast Fourier transform (FFT) [14]. FFT is based on the optimization of Fourier transform. The discrete Fourier transform formula is as follows:(18)Yj=∑n=0L−1xnGLnk.Here,xn is a sample point of a complex point sequence corresponding to it after FFT transformation. The DC component of the signal corresponds to the first value of Y. The residual value corresponds to the amplitude of the component of the signal in the frequency band. The amplitude of the signal component is calculated as follows:(19)Hn=2c2+v2L.The energy of the signal is the square sum of the amplitudes of each low-frequency component, and its calculation formula is as follows:(20)EY=∑n=1LHi2.


## 3.1.1. Signal Noise Reduction

The original sensor signals of intelligent wearable devices are usually mixed with random noise, instrument noise, and electromagnetic noise, and it is not conducive to the extraction of basketball training posture features. Therefore, it is necessary to filter the original acceleration signal of the intelligent wearable device. On the one hand, it is necessary to remove the noise of the original signal, and on the other hand, it is necessary to keep the data characteristics of the original signal from distortion.The Kalman filter only uses the previous data to estimate the current state, which has good real-time performance and short delay [9]. Therefore, the Kalman filter is widely used in the data filtering stage of basketball training posture monitoring. In addition, the gyroscope in intelligent wearable devices is affected by the superposition of gravity acceleration and carrier linear acceleration and signal drift. In view of this situation, a two-stage Kalman filter can be used to better correct the error caused by gyro signal drift in intelligent wearable devices by constructing an adaptive acceleration error covariance matrix. The algorithm of the two-stage Kalman filter is described as follows.The angular position is represented by a quaternionx=x0,x1,x2,x3T. The quaternion is composed of a real number and a vector. x0 represents a real number, and z=x1,x2,x3T represents a vector. First, perform a priori system estimation, read the angular velocity data αx,αy,αz in the three-axis gyroscope sensor in the intelligent wearable device, and calculate the discrete-time state transition matrix:(1)Qa=1+12βnbnW.Here,W represents the time step of each execution of the algorithm. The prior noise covariance matrix can be expressed as(2)Aa=QaZa−1QaW.Here,Za−1 is the posterior error covariance matrix in the previous filter iteration. Then, perform the first-stage Kalman filter correction and read the accelerometer data. Since the acceleration measured by the accelerometer in the intelligent wearable device is affected by gravity, it must be weighted with Kalman gain. In order to calculate the Kalman gain, it is necessary to calculate the Jacobian matrix of the partial derivative of the quaternion noise:(3)Sa1=−2x22x3−2x02x12x12x02x32x22x0−2x1−2x22x3.From this, the Kalman gainXa1 that has been corrected by one level can be obtained:(4)Xa1=AaSa1WSa1AaSa1W+Ea1−1.Here,Ea1 is the noise covariance matrix of the accelerometer, and since the noise generated by the accelerometer has nothing to do with the current angular position, the Jacobian matrix Sa1 is an identity matrix [10]. After that, the posterior error covariance matrix can be calculated as follows:(5)Aa1=Aa1−Xa1Sa1.The correction of the second-stage Kalman filter is similar to that of the first stage, but different noise covariance matrices are used to obtain Kalman gain, read the magnetic field data in the electronic compass, and calculate the corresponding Jacobian matrix:(6)Sa2=2x32x22x12x02x0−2x1−2x2−2x3−2x1−2x02x32x2.Similarly, the two-level modified Kalman gainXa2 and the posterior error covariance matrix Aa2 can be obtained as follows:(7)Xa2=AaSa2WSa2AaSa2W+Ea1−1,Aa2=Aa1−Xa2Sa2.The two-stage Kalman filter model is shown in Figure4.Figure 4
Two-stage Kalman filter model.This method has lower requirements for hardware computing power and is more robust to abnormal magnetic fields.


## 3.1.2. Time Series Segmentation

The collected acceleration and angular velocity signals are a typical time series. It is necessary to segment the sensor signals in intelligent wearable devices to facilitate the effective extraction of basketball training posture features. The first step of time series data segmentation in this study is to extract the features that can distinguish different categories from the labeled dataset and label the time series of unknown classes. If the datasetP=p1,p2,…,pn, pi in P has m sample values and a category label li, it can be expressed as(8)pi=li,pi1,pi2,…,pim.A shapelet is a tuplek,o composed of a subsequence k of a certain time series in the dataset P and a split threshold o, where δ is the distance threshold. It divides P into two subsets, where(9)Pl=χ:χ∈P,subdistk,o≤δ,Pr=χ:χ∈P,subdistk,o>δ.In order to obtain the most recognizable shapelet, the quality of the shapelet needs to be evaluated. This study uses the information gain method to test [11]. Let L1=Pl,L2=Pr, and its information gain be(10)Ik,o=EP−L1LEPl−L2LEPr,(11)EP=−∑i=1εLiLlogLiL.Here,EP is information entropy, ε is the number of classes, and L is the number of time series in P.


## 3.1.3. Feature Extraction

The quality of feature extraction is very important for correctly distinguishing data. The quality of feature selection will directly affect the basketball training posture monitoring. Different applications need to use different metrics, and the metrics used depends on the characteristics and characteristic domain of the data itself. Because features have different functions in different feature domains, different information can be extracted from sensor signals in intelligent wearable devices.(1) Time Domain Characteristics. The time domain characteristics of data also become statistical characteristics, which are calculated by the method of probability statistics [12]. The mean describes the average value of acceleration signal in a data segment, and its calculation formula is as follows:(12)ϕ=1L∑n=1Lxn.The root mean square describes the trend of the overall value, and its calculation method is as follows:(13)Mrms=1L∑n=1nxn2.The standard deviation reflects the dispersion of data. The standard deviation is the square of variance, and its calculation method is as follows:(14)φ=1L∑i=1nxn2−γ2.The standard deviation also reflects the dispersion of data, and its calculation method is as follows:(15)U=1L−1∑i=1nxn2−γ2.Interquartile spacing can describe the degree of variation of data. First, sort the data segments. The difference between the upper quartile and the lower quartile is the interquartile spacing. Skewness can describe the degree of symmetry of data with respect to the mean, and its calculation method is as follows:(16)skewY=EY−tη3.Kurtosis can describe the central aggregation degree of data, and its calculation method is as follows:(17)kurtosisY=∑i=1nxn2−γ4L−1η.In linear space, in addition to the data features described above, there are extreme value, maximum value, minimum value, and other data features. The main time domain features used in this study are mean and variance.(2) Frequency Domain Characteristics. Frequency domain is a coordinate system used to describe the frequency characteristics of signals [13]. Frequency domain features include signal amplitude and energy. The signal transformation from time domain to frequency domain is mainly realized by fast Fourier transform (FFT) [14]. FFT is based on the optimization of Fourier transform. The discrete Fourier transform formula is as follows:(18)Yj=∑n=0L−1xnGLnk.Here,xn is a sample point of a complex point sequence corresponding to it after FFT transformation. The DC component of the signal corresponds to the first value of Y. The residual value corresponds to the amplitude of the component of the signal in the frequency band. The amplitude of the signal component is calculated as follows:(19)Hn=2c2+v2L.The energy of the signal is the square sum of the amplitudes of each low-frequency component, and its calculation formula is as follows:(20)EY=∑n=1LHi2.


## 3.2. Basketball Training Posture Monitoring

Based on a statistical theory, support vector machine (SVM) seeks the best compromise between the complexity of a limited sample information model and learning ability to obtain the best generalization ability [15]. SVM is mainly used to solve a small number of samples and has great advantages in pattern monitoring. It can be extended to other machine learning problems such as function fitting. Based on the basketball training posture monitoring based on intelligent wearable devices, this study uses the SVM classification algorithm to monitor the basketball training posture. Its concrete realization needs two stages: training stage and monitoring stage. In the training stage, different classification models are mainly established for the acceleration values of several different dimensions of the acceleration sensor. In the monitoring stage, online monitoring is carried out for different test samples. The intelligent wearable basketball training posture monitoring model is shown in Figure 5.Figure 5
Intelligent wearable basketball training posture monitoring model.Let the sample set beQi,Wi,i=1,2,…,n, and x∈Rd,y∈+1,−1 is the category symbol. The median linear discriminant function of the d dimensional space is bx=yη+h, and the classification surface equation is yη+h=0. Normalize the discriminant function so that all samples satisfy bx=1, that is, to ensure the bx=1 of the closest point to the classification surface, so that the classification interval is equal to 2/ω, so maximizing the interval is equivalent to minimizing ω. If the classification line is used to correctly classify the sample, the following formula needs to be satisfied:(21)ξiy×η+h−1≥0.The classification plane with the minimum value ofω is the optimal classification plane. The training samples passing through the nearest point from the classification plane and parallel to the hyperplane G1,G2 of the optimal classification plane in the two types of samples are support vectors. The constraints are as follows:(22)∑i=1nξiψi=0.Solve for the maximum value of the following function forψi:(23)Vψ=∑i=1nψi−12∑i,j=1nψiψjξiξj.Ifψ∗ is the optimal solution, then(24)y∗=∑i=1nψ∗uψiThat is, the weight coefficient vector of the optimal classification surface is a linear combination of training samples.This is the extreme value problem of the quadratic function, and it has a unique solution. Generally, a small number ofψi is not zero, and the samples corresponding to the nonzero solution are called support vectors. The optimal classification function obtained after solving is(25)Fη=sgny∗×η+h∗=sgn∑i=1nψi∗ηiy∗×η+h∗.Here,ψi corresponding to the non-support vectors are all zero, so the summation of the above formula is only performed on the support vectors. h∗ is the classification threshold, which can be calculated from any support vector by formula (21) (only the support vector satisfies the equal sign condition) or calculated by taking the median of any of the support vectors of the two types.From the above analysis, the optimal classification surface is obtained under the premise of linear separability. In the case of inseparability, it means that some training samples cannot satisfy the condition of formula (21), so a relaxation term parameter is added to the condition μi≥0:(26)ξiy×ηi+h−1+μi≥0.For a particularly smallσ>0, as long as it satisfies the following:(27)Fϖθ=∑i=1nθiϖ.Minimum can minimize the number of wrong classification samples and maximize the classification interval in the case of linear separability. In the case of nonseparability of linearity, the following constraints can be introduced:(28)ω2≤sg.For simplification, the minimum value can be obtained under the constraint of conditional formula (26):(29)ιμ,ν=12κ,λ+K∑i=1nμi.Here,K is a certain constant, which plays a role in controlling the degree of punishment for subsamples. The method of solving this problem is similar to the method of solving the optimal classification surface. Both can be transformed into the extreme value problem of the quadratic function, but the constraint formula (22) is as follows:(30)0≤ψi≤K.The training of original data samples is mainly composed of the following three steps. The corresponding SVM basketball training posture monitoring steps are as follows:Step 1. Collect data on the training posture dii=1,2,3,…,n of known smart wearable basketball as training samples.Step 2. Extract the same eigen values (three-axis directions and parameter sizes of different postures) for the data to form a feature vector. Suppose that the intelligent wearable basketball training posture υ has Sυ feature values, then τ intelligent wearable basketball training postures have ∑i=1nSυ feature vectors.Step 3. Establish a multiclassification model for the existing data samples.After the training, monitor the data collected in real time. The specific steps are as follows:Step 1. Intercept the acceleration value of the real-time intelligent wearable basketball training posture, extract the same eigenvalue as that in the training stage, and obtain the test vector.Step 2. Generate test samples according to eigenvalues.Step 3. Input the test samples into the previous multiclass classifier for monitoring to obtain the corresponding monitoring results. Through the above steps, basketball training posture monitoring is realized.


## 4. Experimental Simulation and Analysis

### 4.1. Setting Up the Experimental Environment

In order to verify the effectiveness of the basketball training posture monitoring method based on intelligent wearable devices, the Windows system is used as the operating platform and the MATLAB simulation software is used as the experimental platform. Select 80 sets of existing basketball training postures and 320 feature vectors for training extraction. Among them are 160 shots, 40 defenses, 40 offenses, 40 slips, and 40 starts. These original feature vectors are correlated, and every four vectors are used as a monitoring group. In the training process, the self-monitoring classification algorithm is used for evaluation, the training dataset is used to train the classification model, and the monitoring model is used to classify the tested data. The SVM classification algorithm is used to monitor the test data.


### 4.2. Analysis of Basketball Training Posture Monitoring Effect

In order to verify the basketball training posture monitoring effect of the proposed method, the confusion matrix is used to represent the basketball training posture monitoring effect. Five kinds of basketball training postures are selected: shooting, defense, attack, sliding, and starting. The basketball training postures are monitored by the proposed method. The comparison results of the monitoring effects of the proposed method are shown in Figure6.Figure 6
Comparison results of basketball training posture monitoring effect of the proposed method.It can be seen from Figure6 that shooting, sliding, and starting have good monitoring effects, and their confusion matrices reach 1.00, 0.96, and 0.95, respectively, while defense and attack have less error monitoring, and their confusion matrices reach 0.88 and 0.85, respectively. However, based on the above analysis, the proposed method can effectively realize five kinds of basketball training posture monitoring, and its basketball training posture monitoring effect is better.


### 4.3. Analysis of the Accuracy of Basketball Training Posture Monitoring

On this basis, in order to further verify the basketball training posture monitoring accuracy of the proposed method, the monitoring accuracy is used as the evaluation index. The greater the monitoring accuracy, the greater the monitoring accuracy of the method. The calculation formula is as follows:(31)Ar=λϑ×100%.Here,λ is the number of samples that are monitored correctly, and ϑ is the total number of samples. The proposed method, the method in reference [4], and the method in reference [5] are used to monitor the basketball training posture, and the comparison results of the basketball training posture monitoring accuracy of different methods are shown in Figure 7.Figure 7
Comparison results of different methods of basketball training posture monitoring accuracy.It can be seen from Figure7 that when the total number of basketball training posture samples is 320, the average monitoring accuracy of basketball training posture of the method in reference [4] is 88.1%, the average monitoring accuracy of basketball training posture of the method in reference [5] is 83.2%, and the average monitoring accuracy of basketball training posture of the proposed method is as high as 95.4%. It can be seen that the proposed method has a high accuracy of basketball training posture monitoring and can effectively improve the accuracy of basketball training posture monitoring.


### 4.4. Analysis of Basketball Training Posture Monitoring Time

To further verify the basketball training posture monitoring time of the proposed method, compare and analyze the proposed method, the method in reference [4], and the method in reference [5], and get the comparison results of basketball training posture monitoring time of different methods, as shown in Figure 8.Figure 8
Comparison results of different methods of basketball training posture monitoring time.It can be seen from Figure8 that the basketball training posture monitoring time of different methods increases with the increase in the overall number of basketball training posture samples. When the total number of basketball training posture samples is 320, the basketball training posture monitoring time of the method in reference [4] is 22.5 s, the basketball training posture monitoring time of the method in reference [5] is 16.8 s, while the basketball training posture monitoring time of the proposed method is only 7.2 s. Therefore, the basketball training posture monitoring time of the proposed method is short.


## 4.1. Setting Up the Experimental Environment

In order to verify the effectiveness of the basketball training posture monitoring method based on intelligent wearable devices, the Windows system is used as the operating platform and the MATLAB simulation software is used as the experimental platform. Select 80 sets of existing basketball training postures and 320 feature vectors for training extraction. Among them are 160 shots, 40 defenses, 40 offenses, 40 slips, and 40 starts. These original feature vectors are correlated, and every four vectors are used as a monitoring group. In the training process, the self-monitoring classification algorithm is used for evaluation, the training dataset is used to train the classification model, and the monitoring model is used to classify the tested data. The SVM classification algorithm is used to monitor the test data.


## 4.2. Analysis of Basketball Training Posture Monitoring Effect

In order to verify the basketball training posture monitoring effect of the proposed method, the confusion matrix is used to represent the basketball training posture monitoring effect. Five kinds of basketball training postures are selected: shooting, defense, attack, sliding, and starting. The basketball training postures are monitored by the proposed method. The comparison results of the monitoring effects of the proposed method are shown in Figure6.Figure 6
Comparison results of basketball training posture monitoring effect of the proposed method.It can be seen from Figure6 that shooting, sliding, and starting have good monitoring effects, and their confusion matrices reach 1.00, 0.96, and 0.95, respectively, while defense and attack have less error monitoring, and their confusion matrices reach 0.88 and 0.85, respectively. However, based on the above analysis, the proposed method can effectively realize five kinds of basketball training posture monitoring, and its basketball training posture monitoring effect is better.


## 4.3. Analysis of the Accuracy of Basketball Training Posture Monitoring

On this basis, in order to further verify the basketball training posture monitoring accuracy of the proposed method, the monitoring accuracy is used as the evaluation index. The greater the monitoring accuracy, the greater the monitoring accuracy of the method. The calculation formula is as follows:(31)Ar=λϑ×100%.Here,λ is the number of samples that are monitored correctly, and ϑ is the total number of samples. The proposed method, the method in reference [4], and the method in reference [5] are used to monitor the basketball training posture, and the comparison results of the basketball training posture monitoring accuracy of different methods are shown in Figure 7.Figure 7
Comparison results of different methods of basketball training posture monitoring accuracy.It can be seen from Figure7 that when the total number of basketball training posture samples is 320, the average monitoring accuracy of basketball training posture of the method in reference [4] is 88.1%, the average monitoring accuracy of basketball training posture of the method in reference [5] is 83.2%, and the average monitoring accuracy of basketball training posture of the proposed method is as high as 95.4%. It can be seen that the proposed method has a high accuracy of basketball training posture monitoring and can effectively improve the accuracy of basketball training posture monitoring.


## 4.4. Analysis of Basketball Training Posture Monitoring Time

To further verify the basketball training posture monitoring time of the proposed method, compare and analyze the proposed method, the method in reference [4], and the method in reference [5], and get the comparison results of basketball training posture monitoring time of different methods, as shown in Figure 8.Figure 8
Comparison results of different methods of basketball training posture monitoring time.It can be seen from Figure8 that the basketball training posture monitoring time of different methods increases with the increase in the overall number of basketball training posture samples. When the total number of basketball training posture samples is 320, the basketball training posture monitoring time of the method in reference [4] is 22.5 s, the basketball training posture monitoring time of the method in reference [5] is 16.8 s, while the basketball training posture monitoring time of the proposed method is only 7.2 s. Therefore, the basketball training posture monitoring time of the proposed method is short.


## 5. Conclusion

The basketball training posture monitoring method based on intelligent wearable devices proposed in this study can effectively improve the basketball training posture monitoring accuracy, shorten the basketball training posture monitoring time, and ensure the basketball training posture monitoring effect. However, this study ignores the physiological characteristics of different height, weight, age, and gender.



---

*Source: 4945534-2022-02-27.xml*