# Evaluation of Human Action Based on Feature-Weighted Dynamic Time Warping
## 5 Template Creation and Action Evaluation
The input of DBA is a set of time series, and the output is the average sequence of the set of series. The purpose of DBA is to calculate an average sequence that minimizes the sum of squares of the DTW distances to all sequence in the series set. DTW alignment is performed on each time series to obtain the aligned sequence, that is, each sequence is mapped to the same timeline. Calculating the barycenter point of each sequence, that is, the points on each sequence are mapped to the average sequence to obtain the initial value of the average sequence. Then, DTW alignment is performed on the average sequence to obtain the aligned average sequence, and the center of gravity of the average sequence is calculated, that is, the points are mapped on each sequence to the aligned average sequence to obtain the new value of the average sequence. If the average sequence value changes, the average time series needs to be updated repeatedly until the value of the average series converges. DBA is an iterative algorithm, and the flowchart is shown in Figure 9.  
Action Evaluation  
DTW algorithm improvement: this paper improves the Euclidean distance calculation method in the DTW algorithm. Euclidean distance calculation method based on feature weights: Due to data point drift when selecting key points during movement, it has a greater impact on angle features than distance features, and the error of action evaluation will be larger, especially when the actions are closer to each other. Therefore, this paper proposes the Euclidean distance calculation method based on feature weights, setting the weight share of angle features and  
Figure 9: Flowchart of DBA algorithm. distance features in action features as \(w_{1}\) and \(w_{2}\), respectively, and the sum of \(w_{1}\) and \(w_{2}\) is \(1\). Equation (5) is changed to the following equation:  
\[d(i,j)=w_{1}\times\sqrt{\sum_{k_{1}=1}^{l_{1}}\left(F_{m}(i,k_{1})-F^{\prime}_{ m}(j,k_{1})\right)^{2}}+w_{2}\times\sqrt{\sum_{k_{2}=1}^{l_{2}}\left(F_{m}(i,k_{2})-F^{ \prime}_{m}(j,k_{2})\right)^{2}} \tag{6}\]  
where \(F_{m}(i,k_{1})\) is the \(k_{1}\)th feature value of the angle feature vector of the \(i\)th frame in the action feature matrix \(F_{m}\), \(F^{\prime}_{m}(j,k_{1})\) is the \(k1\)th feature value of the angle feature vector of the \(j\)th frame in the action feature matrix \(F^{\prime}_{m}\), and \(l_{1}\) is the number of angle feature values; \(F_{m}(i,k_{2})\) is the \(k_{2}\)th feature value of the distance feature vector of the \(i\)th frame in the action feature matrix \(F_{m}\), \(F^{\prime}_{m}(j,k_{2})\) is the \(k_{2}\)th feature value of the distance feature vector of the \(j\)th frame in the action feature matrix \(F^{\prime}_{m}\) and \(l_{2}\) is the number of distance feature values. 2. Similarity calculation: Action evaluation requires the actions to be quantified, evaluated, and compared to other actions by similarity calculations. Similarity measures can be used to compare how similar different people are when performing particular actions. It can reflect an individual's action control and determine their level of performance when executing a specific action. In this paper, DTW is used to calculate the distance between the action sequence to be tested and the template sequence, which is relative and cannot clearly reflect the degree of similarity between the two sequences. Therefore, after the cumulative shortest distance is obtained by DTW calculation, the similarity between the action sequence to be tested and the template sequence needs to be calculated in order to determine the degree of achievement of the action [21].