Next Article in Journal
Unsupervised Spiking Neural Network with Dynamic Learning of Inhibitory Neurons
Previous Article in Journal
Block-Active ADMM to Minimize NMF with Bregman Divergences
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

C-DTW for Human Action Recognition Based on Nanogenerator

School of Electrical and Information Engineering, Tianjin University, Tianjin 300072, China
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Sensors 2023, 23(16), 7230; https://doi.org/10.3390/s23167230
Submission received: 5 May 2023 / Revised: 3 August 2023 / Accepted: 13 August 2023 / Published: 17 August 2023
(This article belongs to the Section Wearables)

Abstract

:
Sensor-based human action recognition (HAR) is considered to have broad practical prospects. It applies to wearable devices to collect plantar pressure or acceleration information at human joints during human actions, thereby identifying human motion patterns. Existing related works have mainly focused on improving recognition accuracy, and have rarely considered energy-efficient management of portable HAR systems. Considering the high sensitivity and energy harvesting ability of triboelectric nanogenerators (TENGs), in this research a TENG which achieved output performance of 9.98 mW/cm 2 was fabricated using polydimethylsiloxane and carbon nanotube film for sensor-based HAR as a wearable sensor. Considering real-time identification, data are acquired using a sliding window approach. However, the classification accuracy is challenged by quasi-periodic characteristics of the intercepted sequence. To solve this problem, compensatory dynamic time warping (C-DTW) is proposed, which adjusts the DTW result based on the proportion of points separated by small distances under DTW alignment. Our simulation results show that the classification accuracy of C-DTW is higher than that of DTW and its improved versions (e.g., WDTW, DDTW and softDTW), with almost the same complexity. Moreover, C-DTW is much faster than shapeDTW under the same classification accuracy. Without loss of generality, the performance of the existing DTW versions can be enhanced using the compensatory mechanism of C-DTW.

1. Introduction

Human action recognition (HAR) refers to the recognition of various human activities through signal processing. It is widely applied in competitive sports, health detection, medical research, and pedestrian navigation [1]. HAR is an emerging application direction in human–computer interaction, such as using gestures to control computers or robots and providing real-time feedback on human actions to virtual environments, allowing users to have a better virtual reality experience [2]. Research on HAR can be categorized into video-based HAR and sensor-based HAR. Video-based HAR is primarily used to analyze human behavior in videos and conduct real-time monitoring [3], in which multispectral devices, cameras, infrared spectrometers, etc., are used to collect video or image data. The analysis of these data necessitates careful consideration of the instrument’s position as well as the influence of various factors, including lighting, occlusion, background, and object angle. These factors pose challenges when attempting to employ video-based HAR. Furthermore, the high cost of video recording equipment and the significant computing resources needed for video recognition algorithms such as Convolutional Neural Network [4] and Vision Transformer [5] have restricted the widespread adoption of this technology among individuals.
Sensor-based HAR utilizes data on human activity and the environment collected through sensor devices, such as accelerometers, gyroscopes, and magnetometers. Consequently, sensor-based HAR offers several advantages, including low cost, convenience, noninvasiveness, and enhanced privacy protection, by leveraging sensors to gather the necessary data. In addition, sensor technology has developed in various aspects over the past decade, including computing power, size, accuracy, and manufacturing cost. Nowadays, sensor devices can be readily integrated into portable devices such as mobile phones and watches as well as larger devices such as cars, walls, and furniture. As a result, there is growing interest in wearable sensor-based Human Activity Recognition [6]. Sensor data are collected in natural chronological order with a specific time interval, and comprise real-valued measurements; these are categorized as time series data [7]. Consequently, the sensor-based human action recognition problem primarily revolves around the classification of time-series data. In [8], environmental sensors were used to implement HAR tasks in multi-tenant smart home scenarios. In [9], the authors focused on the accurate classification of daily human activities from accelerometer and gyroscope sensor data. To reduce the computational time and storage of data processing, ref. [10] proposed a semisupervised method called tri-very fast decision tree, which was applied to embedded devices after applying the simulated annealing algorithm for feature selection. In order to identify complex actions, ref. [11] took into consideration the correlation between different sensor positions on the body, achieving high action recognition accuracy and generalization ability. From the above studies, it is apparent that using new types of sensors and developing action recognition algorithms based on these new sensors is an interesting problem in the field of sensor-based HAR. Consequently, we propose the use of a contact–separation TENG as a sensor for HAR tasks. When the positive and negative electrodes of the TENG are connected to the load, the voltage waveform of the load becomes associated with the movement of the nanogenerator’s electrodes. By establishing a correlation between human body movements and the movement of the nanogenerator’s electrodes, the HAR task can be accomplished effectively. Moreover, a sensor based on TENG and a piezoelectric nanogenerator (PENG) has the advantages of low power consumption, high sensitivity, high stability, and low cost [12].
Since [13] first fabricated TENGs, achieving 10.4 mW/cm 2 output performance, research on nanogenerators have made breakthroughs in terms of power generation efficiency, sensitivity, and production processes. Nanogenerators, including PENG and TENG varieties, can effectively convert mechanical energy into electrical power or signals [14]. PENGs exhibit the advantage of providing a stable output that remains unaffected by environmental factors such as temperature and humidity. However, their application is limited due to the constrained piezoelectric and mechanical properties of the piezoelectric nanowires or composite films that they use, restricting their ability to harvest energy to only a specific range of weak mechanical energy [15]. Thus, we did not select a PENG for this paper. In recent years, TENGs have seen significant advancements in terms of their material structure and functionality. To achieve a more stable power supply, ref. [16] developed a fully stretchable and highly durable one-horsepower TENG with gold nanosheets embedded into both a PDMS matrix and a micropyramid-patterned PDMS. By introducing 4D printing technology to manufacture a transparent self-recovery TENG using a fused deposition modeling (FDM) printer and spray technique, ref. [17] achieved excellent self-recovery capability of device performance, improved the robustness of the device structure, and achieved an output performance of 56 mW/m 2 . In [18], fragile and rigid mica with strong triboelectric positivity was exfoliated into 2D nanosheets and electrospun into flexible and stretchable thermoplastic polyurethane nanofibers for a high-performance TENG that achieved 1458 mW/m 2 output performance. Although TENGs have seen major breakthroughs in energy harvesting ability, and potential applications are becoming widespread, there are three difficulties when applying them to a wearable sensor-based HAR(ws-HAR) system:
(i)
The contradiction between large-scale production and high-performance products has not been resolved;
(ii)
The nonlinear relationship between pressure and generated voltage makes it difficult to directly infer pressure magnitude through voltage;
(iii)
Energy harvesting remains challenging, as low-frequency components account for a large proportion of the generated energy.
Fortunately, the time-domain voltage waveform of TENGs has specific characteristics which can be utilized in WS-HAR. WS-HAR can be treated as a typical time series classification task. Common classifiers for times series include support vector machine [19], deep belief network [20], convolutional network [21,22], long short-term memory network [23], and transformer [24]. Deep learning methods often suffer from long training inference times, which hinders their advantage to handle real-time processing demands in the context of WS-HAR. Moreover, support vector machine heavily relies on heuristic hand-crafted feature extraction before classification. Unlike the aforementioned classification methods, DTW has the advantage of invariance against signal warping (shifting and scaling in time), leading to its becoming one of the most preferable measures in classification tasks for time series data [25].
In order to address practical applications, extensive research was conducted on DTW. To improve path searching speed, ref. [26] assumed a limited optimal warping path range and proposed an adaptive window restriction method. In order to achieve more reasonable matching, ref. [27] weighted the distance matrix. In [28], the sequence was differentiated before DTW to make the alignment more rational. In [29], the authors improved DTW alignment by considering the local structural information of the sequence. In order to use DTW as the loss function of neural network, ref. [30] applied a soft minimum. Subsequently, DTW has been applied in machine learning as a loss function for times series classification tasks such as HAR [31,32] and EEG classification [33]. The majority of the current research concentrates on integrating DTW with other algorithms to explore its application in new scenarios and to suppress cases of one-to-many DTW in order to achieve improved shape-based point-to-point correspondences. One aspect that has often been overlooked is the selection of DTW alignment. Therefore, in this paper we propose a compensatory mechanism based on correspondence selection to address the aforementioned limitations. Moreover, this compensatory mechanism enables quasi-periodic sequences to attain satisfactory classification accuracy without requiring endpoint detection.
Considering all the facts mentioned above, this paper proposes a recognition framework based on TENG and DTW with a compensatory mechanism. The main contributions of this paper are listed as follows:
  • Application of new materials: carbon nanotubes (CNTs) doped in PDMS were transferred to commercial silver textiles using a novel brush method to fabricate the TENG and the application feasibility of the TENG was proven through experiments. This solves contradiction (i) above.
  • Flexible compensatory mechanism: the compensatory mechanism based on DTW alignment selection proposed in this paper can be flexibly applied to improved DTW. The compensatory mechanism can increase the weighting of information from alignments with similar shapes while reducing the weighting of information from alignments with dissimilar shapes caused by greedy algorithm. Moreover, as the improved DTW focuses on alignment based on the shape of the sequence, the compensatory mechanism can achieve a greater performance improvement.
  • Improvement of DTW: under the traditional DTW framework, misclassification occurs when a sequence exhibits incompleteness after interception. Therefore, compensatory DTW (C-DTW) is proposed to solve this deficiency. The DTW result is compensated using the proportion of points with small distance under DTW alignment, making C-DTW more robust against quasi-periodic sequence classification, thereby solving contradiction (ii) in WS-HAR.
  • Simplification of WS-HAR system: the combination of energy harvesting and sensing through TENG can simplify the system design. Moreover, neither endpoint detection nor manual feature extraction are required when using C-DTW. As a result, the proposed WS-HAR with TENG approach can be more efficient than traditional HAR system, opening up the possibility of eventually solving contradiction (iii).
In this paper, we use a specialized TENG to collect mechanical energy. The TENG possesses high performance and is a good fit for mass production. The sensor is able to realize human action recognition based on voltage waveforms. The rest of this paper is organized as follows. In Section 2, we demonstrate how to accommodate TENGs in WS-HAR and propose a fabrication method. Section 3 describes traditional DTW and the proposed C-DTW. In Section 4, the WS-HAR block diagram is provided and the performance of the C-DTW approach is verified through experiments. In Section 5, the conclusion of this paper is provided.

2. HAR Sensor

2.1. Theoretical Analysis of TENG Sensor

TENGs can convert mechanical energy into electrical energy through the coupling effect between friction induction and electrostatic induction. To facilitate the analysis of sensor properties in contact-mode TENGs, two dielectric plates are stacked face to face as two triboelectric layers, as shown in Figure 1. The distance x ( t ) between the two triboelectric layers can be varied under external force, i.e., plantar pressure in this paper. As a result, there are three states in the power generation process of TENGs: (1) when x ( t ) = 0 , two contact surfaces form charges with opposite polarity; (2) after contact, i.e., x ( t ) 0 , the triboelectric layers have opposite static charges with equal density of σ and form an induced potential difference between two metal electrodes. Differences in the pressure placed on the TENG lead to different microcontact areas between the two triboelectric layers, meaning that σ varies with the pressurel (3) when x ( t ) = 0 again, the potential difference formed by the friction charge disappears and the electrons return. For one working cycle of TENG, σ is constant. If two metal electrodes are connected by resistor R, electrons flow from one electrode to the other through R. According to [34], the V Q x relationship of a contact-mode TENG can be written as follows:
V ( t ) = Q ( t ) S ε 0 ( d 1 ε 1 + d 2 ε 2 + x ( t ) ) + σ x ( t ) ε 0
where V ( t ) is voltage between the two electrodes, Q ( t ) is the amount of transferred charge, ε 0 is the permittivity of air, ε 1 and ε 2 are the relative permittivities of the triboelectric material, and S is the area size of the metals.
When the contact-mode TENG is connected to the resistor R, the voltage generated by the internal electric field of the TENG (the right side in (2)) is equal to the voltage of external circuit (the left side in (2)).
R d Q ( t ) t = Q ( t ) S ε 0 ( d 1 ε 1 + d 2 ε 2 + x ( t ) ) + σ x ( t ) ε 0
Assuming that there is no charge transfer between the two electrodes at t = 0 , we obtain
Q ( t ) | t = 0 = 0 .
Assuming
c 0 = d 1 ε 1 + d 2 ε 2 ,
the solution of (2) can be as follows:
Q ( t ) = σ S σ S exp 1 R S ε 0 c 0 t + 0 t x ( t ) d t σ c 0 R ε 0 exp 1 R S ε 0 c 0 t + 0 t x ( t ) d t × 0 t exp 1 R S ε 0 c 0 z + 0 z x ( z ) d z d z .
Combining the definition of the current with Ohm’s law, the output voltage of the TENG is
V ( t ) = R I ( t ) = R d Q ( t ) d t .
When the foot steps on the TENG, the pressure differential caused by various actions means that the two materials have different degrees of friction; this directly affects σ in (2), which in turn causes V ( t ) to change. Different actions lead to variations in the regularity of x ( t ) , directly affecting V ( t ) according to (7). In this way, TENGs can be used in WS-HAR. An embedded voltage detection device can store V ( t ) with a sampling interval of δ t . Assuming that the time frame is t = 1 , , I , the voltage sequence can be expressed by the following equation.
v = [ V ( 1 ) , , V ( t ) , , V ( I ) ] = [ v i ] 1 × I

2.2. TENG Preparation

Based on the above theoretical analysis of TENGs and following [35], a more specific TENG design for WS-HAR and mass production is proposed below and its parameters are optimized. The manufacturing process of the TENG for WS-HAR is threefold. First, a 3 cm × 3 cm silver textile is soaked in anhydrous ethanol. Second, CNTs are added to the curing agent and the mixture is combined with PDMS in a mass ratio of 1:10 and remixed for 10 min. Third, 1 g of the mixture solution is transferred by brush to the commercial silver textile. Compared with the traditional dip-coating method, which forms a flat and smooth surface, the brush method used in this paper can form a wavy shape on the macro-level; this can method can be used in large-scale manufacturing. Finally, the silver textile is placed in a vacuum dryer for 20 min, then transferred to an oven with the temperature adjusted to 75  C for 1.5 h.

3. HAR Method

3.1. Traditional DTW

Human beings have specialized action habits which do not change over the short term [36]; in this case, the plantar pressure regularity and the separation distance between the heel and insole remain almost constant. When the TENG is placed at the heel, its output voltage waveform ( V ( t ) in (2)) is related to foot movements, which influence x ( t ) and σ in (2). DTW is a robust method for measuring the similarity between two time series through norm distance [37]; moreover, DTW is applicable to both univariate time series and multivariate time series [35]. In this paper, DTW is combined with 1-NN, which uses local memory as a template. As a result, the feature extraction steps of HAR can be avoided via DTW during recognition.
Suppose that the sequences v ^ = [ v ^ m ] 1 × M and v ˜ = [ v ˜ n ] 1 × N represent two different voltage sequences; in order to align v ^ and v ˜ , the distance matrix D R M × N is constructed by calculating the distance between each point in v ^ and v ˜ . Element d m , n in D is calculated by
d m , n = ( v ^ m v ˜ n ) 2 .
The warping path is calculated between adjacent points in D according to the following criteria: the DTW warping paths of v ^ and v ˜ are expressed as a set W = { w 1 , , w t , w T } with max ( M , N ) T < M + N 1 , where w t = ( m , n ) indicates that v ^ m matches v ˜ n . Each element of W needs to meet the following conditions:
(1)
Boundedness
w 1 = ( 1 , 1 ) , w T = ( M , N )
(2)
Continuity
m m 1 , n n 1
(3)
Monotonicity
m m 0 , n n 0 ,
where m and n are the elements of w t 1 . According to (9)–(11), we can find that ( m + 1 , n ) , ( m , n + 1 ) or that ( m + 1 , n + 1 ) W .
Greedy dynamic programming is utilized to calculate the warping path in D [38]; specifically,
DTW ( 1 , 1 ) = d 1 , 1 ,
DTW ( m , n ) = d m , n + min DTW ( m , n 1 ) , DTW ( m 1 , n 1 ) , DTW ( m 1 , n ) .
The DTW algorithm is presented in Algorithm 1. The distance matrix D R 7 × 10 for the two sequences v ^ = [ 0.95 , 0.21 , 1.31 , 0.96 , 0.61 , 1.34 , 0.95 ] and v ˜ = [ 0.92 , 0.16 , 1.29 , 0.92 , 0.04 , 1.39 , 0.91 , 0.07 , 1.48 , 0.92 ] is shown in Figure 2A, while the alignment of these two sequence is shown in Figure 2B.
Algorithm 1 DTW
Require:
  • sequence v ^ = [ v ^ m ] 1 × M
  • sequence v ˜ = [ v ˜ n ] 1 × N
Ensure:
  • the DTW distance between v ^ and v ˜
  • the optimal warping path: W
  • initialize:
  • M = length( v ^ )
  • N = length( v ˜ )
  • DTW ( 1 , 1 ) = d 1 , 1
  • for  m = 1 to M do
  •    for  n = 1 to N do
  •       d m , n = ( v ^ m v ˜ n ) 2 ;
  •      execute (13) to obtain DTW ( m , n ) and w t W
  •    end for
  • end for
  • return:  DTW ( M , N ) , W ;

3.2. Compensatory DTW

DTW is usually combined with K-nearest neighbor (KNN) for classification; thus, the shapes between the two sequences match. When K = 1 in KNN, this method is denoted as DTW+1NN. To best of our knowledge, the predominant focus of current research lies in integrating DTW with other algorithms [31,32,33] in order to investigate its applicability in novel scenarios. Another research focus lies in tackling the challenge of one-to-many alignment issues in order to achieve enhanced shape-based point-to-point alignments. However, researchers have not taken into account that there are similar parts shared among the shapes of the same class of sequences in time-series classification tasks using DTW. When aligned by DTW, these similar parts exhibit smaller distances than dissimilar parts. Therefore, a compensatory mechanism based on DTW alignment selection using these distance properties is proposed here. The proposed compensatory mechanism offers the further advantage of facilitating quasi-periodic sequences to attain satisfactory classification accuracy without requiring endpoint detection. The proposed compensatory DTW (C-DTW) is able to solve the above deficiencies.
For a point w t = ( m , n ) in warping path W , a maximum tolerance α is determined; when the distance between v ^ m and v ˜ n satisfies
d m , n < α ,
then ( m , n ) is input to the optional shape indicator, i.e., ( m , n ) S . From this, it is easy to draw the conclusion that the probability of two sequences indicating the same actions becomes higher when there are more points in S . Assuming that N v ^ and N v ˜ are the number of non-repeating indices in v ^ and v ˜ which are input to S , as shown in Figure 3, the number of subscripts in the red part should satisfy (14). The compensation coefficient γ c is defined as
γ c = 1 min ( N v ^ , N v ˜ ) ( M + N ) / 2 ;
thus, C DTW ( M , N ) = DTW ( M , N ) × γ c . For example, based on the DTW alignment between the example sequences v ^ and v ˜ , we can replicate the one-to-many points issue to calculate the DTW distance in Euclidean space, as shown in Figure 3. Assuming that α = 0.6 , according to (14) the selected alignment is indicated by the red lines; the number of non-repeating indices N v ^ = 6 with (0, 1, 2, 3, 4, 5, 6) and N v ˜ with (0, 1, 3, 4, 6, 8, 9). Using Equation (15), we can obtain the value of γ c as 1 6 ( 10 + 7 ) / 2 = 0.294 . Thus, the value of C-DTW is 5.68 × 0.294 = 1.67 .
In this paper, because the original data are intercepted by the sliding window, the length of two sequences is equal, i.e., M = N . Thus, (15) can be rewritten as
γ c = 1 min ( N v ^ , N v ˜ ) N .
The technical process of C-DTW is shown in Algorithm 2.
Algorithm 2 C-DTW
Require:
  • sequence v ^ = [ v ^ m ] 1 × M
  • sequence v ˜ = [ v ˜ n ] 1 × N
Ensure:
  • the DTW distance of v ^ and v ˜
  • the optimal warping path: W
  • initialize:
  • M = length( v ^ )
  • N = length( v ˜ )
  • DTW ( 1 , 1 ) = d ( 1 , 1 )
  • for  m = 1 to M do
  •    for  n = 1 to N do
  •       d ( i , j ) = ( v ^ m v ˜ n ) 2 ;
  •      execute (13) to obtain DTW ( m , n ) and w t W
  •    end for
  • end for
  • for  i = 1 to T do
  •    count N v ^ , N v ˜
  • end for
  • execute (16)
  • C DTW ( M , N ) = DTW ( M , N ) × γ c
  • return:  C DTW ( M , N ) , W

4. Experiment

4.1. Experimental Setup

During data acquisition, the TENG proposed in Section 2.2 was placed at heel, as shown in Figure 1. As shown in the Figure 4, the embedded device can recognize different actions. The energy of the TENG is stored in the battery through the power management circuit. The battery supplies power to the embedded device. Finally, the recognition result of the embedded device is transmitted to the computer or mobile phone through WiFi. In order to make the experiment more tractable, we split the data acquisition phase and the signal processing phase. In the data acquisition phase, the TENG electrode is connected to voltage detection equipment, as shown in the physical connection diagram part of Figure 1. Voltage data on activities is recorded on the embedded device with a sampling frequency of 1000 Hz. When reading actions from voltage data (running, jumping, or walking), the jumping height was randomized, as were the running and walking speeds. In order to obtain voltage data including only stable operation of the TENG, we removed the non-informative parts at the beginning and end of the collected data. For example, Figure 5 shows stable voltage data for the jumping action. Considering the requirement of real-time recognition, the sequence is intercepted by the sliding window. The window length is 2000 points, with a step size of 500 points. The duration of the intercepted sequence is 2 s. In the signal processing phase, we simulated C-DTW in Matlab2020a with an Intel(R) Core(TM) i5-6500 processor manufactured in Vietnam and Crucial 8GB DDR4-2133 RAM manufactured in Vietnam. The classification confusion matrix and computing time were used to evaluate the performance of Algorithm 2. In order to be practical, a WS-HAR system should be able to work with online data. This is inconsistent with leave-one-out cross-validation. Thus, the following experimental step was adopted: 200 sequences of each action were randomly selected from the preprocessed data for z-score standardization, then a small number (10 or 3) in each class were selected from 600 sequences as the template sequences of the 1-NN. Then, we classified the remaining sequences and drew the confusion matrix.

4.2. Data Preprocessing

It can be seen from Figure 6a,d,g that discontinuities exist in the intercepted sequences due to inevitable environmental influences. Thus, it is necessary to eliminate these discontinuous points prior to classification. By drawing the derivatives of the intercepted sequences, it can been seen that the sequence derivative suddenly increases when discontinuous points appear. Therefore, it is easy to locate discontinuous points by setting a threshold for the sequence derivatives. After locating discontinuous points, we take the average of two points among the discontinuous points to replace it. Thus, assuming a discontinuous point appears at v ( i ) , its replacement is represented by
v ( i ) = v ( i 1 ) + v ( i + 1 ) 2 .
When a discontinuous point appears at the front or rear, it is replaced by its successor.

4.3. Influence of α Parameter

In this section, 200 sequences of each action were randomly selected for z-score standardization, then three sequences in each class were selected among 600 as the template for the 1-NN. To ensure the stability of the results, the whole process was repeated 40 times. We varied the α value used in C-DTW to investigate its influence on the classification accuracy. From Figure 7, it can be inferred that when α is too small a large number discontinuous points are ignored, which makes the compensation force deficient. This means that DTW alignments with similar shapes may not be selected, leading to potential inaccuracies in classification. When α is too large, too many unqualified points are included in S , resulting in excessive compensation force. To explain this more intuitively, in this condition DTW alignments with dissimilar shapes are more likely to be selected, contradicting the original intent of the compensatory mechanism based on alignment selection. Both of these two cases can invalidate the C-DTW proces. Classification accuracy shows an arch variation regularity with α , and the optimal α is 0.2.
From the experimental results, it can be seen that the optimal classification result for a granularity of 0.1 is obtained when α = 0.2 . Therefore, α was set to 0.2 in the subsequent experiments.

4.4. Method Comparison

The methods compared in this experiment were C-DTW + 1NN, DTW [39] + 1NN, WDTW [27] + 1NN, DDTW [28] + 1NN, and softDTW (i.e., soft-DTW [30]) + 1NN and shapeDTW [29] + 1NN. The reason for comparing our method with DTW, WDTW, DDTW, softDTW, and shapeDTW was that we conducted a thorough investigation into the methods that have been proposed to improve the classification ability of DTW. The methods compared in this experiment were chosen because they are the most recent. In shapeDTW, DTW is improved by considering similar shapes in the same class. Here, the sub-sequence length in shapeDTW was set to 100, as the pattern of the proposed WS-HAR system lasts about 100 points. The experimental results are shown in Figure 8, Figure 9 and Figure 10. Considering the unacceptable complexity when the number of templates exceeds 10, three templates were randomly selected from 200 for each class. The experiment was repeated 40 times. The times required to compute the distance between two 2000-point sequences using different DTW improvement methods are shown in Table 1.
From Figure 8, it can be seen that when the number of template sequences is large (ten in each class), the classification performance of DTW and its improved version are similar to that of C-DTW. When the number of template sequences is reduced to three, as shown in Figure 9, a significant improvement is observed in the classification accuracy of “walking” with C-DTW compared to DTW, with an increase of 8.48 % . Compared to the classification accuracy of DTW, C-DTW shows an improvement of 4.8%, while WDTW decreases by 0.77%, DDTW improves by 4.3%, softDTW decreases by 6.15%, and shapeDTW improves by 4.84%. The C-DTW method achieves a 0.5% higher classification accuracy than DDTW with the same computation time. On the other hand, while shapeDTW achieves a 0.04% higher classification accuracy than C-DTW, the computation time increases from 0.32 s to 7.42 s. The improvement of C-DTW is due to the additional compensatory mechanism, which filters out parts with different shapes based on DTW alignment and retains only the parts with similar shapes. The resulting information is then fused into DTW through multiplication. DDTW (d) and shapeDTW (f) achieve similar results to C-DTW, as both methods incorporate shape information. DDTW transforms the original time series into high-level features containing shape information by using the differences between the sequences [40], while shapeDTW considers the shape correspondence of each sub-sequence using a sliding window [29]. On the other hand, WDTW (c) and softDTW (e) do not take shape features into account. Moreover, the window constraints of WDTW [41] and the softmin [42] operation in softDTW cause information loss, resulting in slightly lower classification performance compared to the other methods.
According to Figure 10, when the length of the classification sequence is 1500 and the length of the template sequence is 2000, it can be observed that C-DTW benefits from the compensatory mechanism based on alignment selection and achieves higher classification performance than DTW. However, it falls short of the performance achieved by DDTW and shapeDTW. The reason for this lies in the inherent limitations of DTW, which stem from the features it considers. DTW only takes into account the y-axis values of datapoints, and does not effectively handle their shapes [40]. Thus, even with the selection of DTW alignment it is not possible to achieve better results on the basis of alignments that inherently do not take shape relationships into account. Furthermore, it can be observed that both DDTW and shapeDTW show gaps in the “running” classification. This is because the classification sequences are truncated in these approaches compared to the template sequences, making their shapes more incomplete. However, shapeDTW, which uses sliding windows to handle the shape sub-sequences of the entire sequence, is less affected by shape incompleteness.
Below, we provide an analysis of the compensatory mechanism proposed in this paper and how it is able to achieve better classification performance. In Figure 11A, the blue and green lines represent two untreated jumping sequences. The red parts represent points which satisfy (14) under the DTW alignment. We utilize m i n ( N v ^ , v ˜ ) to calculate the compensation weight according to (15). After applying traditional DTW, it can be seen that the DTW value between two jumping sequences is 864.82 (the left side in Figure 11A), while the DTW value between jumping and walking is 651.38 (the left side in Figure 11B). According to the compensatory mechanism, points that satisfy (14) are found, then γ c is calculated for compensation according to (16). The compensatory mechanism proposed in this paper is based on the notion that if two sequences belong to the same class, the number of points that satisfy (14) under DTW alignment will occupy a relatively larger proportion. Conversely, for different class of sequences the number of points that satisfy (14) under DTW alignment occupies a relatively smaller proportion. After compensation, the C-DTW value between the two jumping sequences is 0.432, while the C-DTW value between jumping and walking is 461.18. Therefore, C-DTW substantially reduces the distance between sequences of the same category and slightly reduces the distance between sequences among different categories.
Next, we discuss the problem of why the “walking” classification shows relatively lower performance in our experiments. Figure 12 shows that when “jumping” and “walking” have similar starting and ending shapes in their sequences, alignment of points using DTW cannot perfectly resolve cases in which dissimilar shapes are aligned, even after filtering based on DTW correspondence. This is due to the inherent limitations of DTW correspondence, in that it only considers the y-axis values of datapoints and cannot effectively handle their shapes. Notably, instances where “jumping” and “walking” sequences have similar starting and ending shapes and occur separately in the template and classification sequences are not very common. Therefore, even though the classification accuracy is not as high for “walking” as it is “jumping” and “running”, it does not significantly lag behind.
In terms of time complexity, as shown in Table 1, C-DTW exhibits similar computation time to WDTW, DDTW, and softDTW, taking 0.31 s, which is only a slight increase compared to the DTW algorithm (0.7 s). It is significantly faster than shapeDTW, which takes 7.41 s to compute. According to [43], the time complexity of DTW is O ( M N ) , where M and N are the lengths of the two sequences. When the lengths of both sequences are the same, the time complexity becomes O ( N 2 ) . Considering to (14) and (15) along with Algorithm 2, the compensatory mechanism proposed in this paper involves only one loop during the calculation to traverse all DTW correspondences. Hence, the overall time complexity is O ( M N + S ) , where max { M , N } S M + N . It can be observed that the proposed method in this paper does not increase the time complexity magnitude, and the actual execution time aligns with the results shown in Table 1. Generally speaking, C-DTW achieves excellent performance for the proposed TENG-based WS-HAR system.

4.5. Compensation of Contrasted DTW

In this section, we prove that the proposed C-DTW compensatory method can elevate the performance of the contrasted DTW method with α = 0.2 in our WS-HAR system. First, 200 sequences of each action were randomly selected from preprocessed data for z-score standardization. Then, three sequences in each class were randomly selected from 600 as the template sequences of the 1-NN, simulating the situation of online data processing. For stability, the whole process from data selection to classification was repeated 40 times. The tested methods were compensatory DDTW (C-DDTW) and compensatory shapeDTW (C-shapeDTW). The reasons for not selecting WDTW and softDTW were as follows:
(1)
When WDTW calculates the warping path, the distance matrix varies. This is not consistent with DTW. Thus, if the compensatory method were imposed, the threshold based on two matched points would be meaningless.
(2)
The minimum obtained by SoftDTW is calculated according to (13) without selection, resulting in invalid warping paths between the two sequences. Thus, the concept of C-DTW is not applicable in this case.
From Figure 13, it can be seen that applying the compensatory mechanism to DDTW and shapeDTW can improve their classification accuracy. Specifically, under the condition of equal sequence lengths (Figure 13A), C-DDTW shows a 0.62% improvement in classification accuracy compared to DDTW after applying the compensatory mechanism, while C-shapeDTW achieves a 2.53% improvement compared to shapeDTW. In Figure 13B, C-DDTW exhibits a 2.28% improvement over DDTW, while C-shapeDTW shows a 3.84% improvement over shapeDTW. It is worth noting that applying the compensatory mechanism proposed in this paper results in improved classification accuracy with no increase in time complexity. This is because shapeDTW focuses on the shape relationship of sub-sequences through a sliding window approach. Thus, with better shape correspondence, the compensatory mechanism based on the selected correspondence in this paper can further emphasize the shape of the sequences. When the lengths of the template and classification sequences are different (Figure 13B), it can be observed that after applying the compensatory mechanism both DDTW and shapeDTW achieved significant improvements in classification accuracy. Additionally, it is notable that DDTW and shapeDTW demonstrate a difference in the “running” classification. This disparity arises because the classified sequences have been truncated in comparison to the template sequences, resulting in their shapes being more incomplete. However, shapeDTW, which employs sliding windows to mitigate the impact of error shape alignment caused by shape incompleteness of sub-sequences within the entire sequence, is less affected by significant shape incompleteness.

4.6. Classification of UCR

Researchers from the University of California, Riverside have created the UCR Archive [44], which contains sixteen datasets for use in time series classification. Over time, the archive has been updated and expanded to include various time series types, such as “Device”, “ECG”, “Image”, “Sensor”, “Motion”, and more. The archive now consists of 128 datasets, with several datasets being converted into time series data by different methods. For example, in the “Image” dataset, the original image data are transformed into a set of contour points that are then represented as time series data to form the dataset. Each dataset in the UCR Archive consists of 2–128 categories. For this paper, datasets with the “Sensor” and “Motion” types were selected to test the proposed method utilizing a nanogenerator as a sensor for human motion recognition. A total of 44 categories were chosen from the UCR Archive; Table 2 displays the essential information about the samples and the algorithm execution results. In this experiment, the α value for the proposed C-DTW was set to 0.01. Table 2 presents the results of C-DTW+1NN and DTW+1NN on “Sensor” and “Motion” datasets from the UCR Archive. The “length” column represents the number of datapoints in each sequence. The “vary” column indicates that the sequence lengths are not fixed for this type of dataset. The “class” column indicates the number of categories required for classification in each dataset; for example, the “Car” dataset requires classification into four categories. The last two columns indicate the error rate of classification using C-DTW+1NN and DTW+1NN. A smaller error rate indicates greater accuracy in classification.
Table 2 illustrates that in most cases the proposed C-DTW method outperforms DTW in terms of classification accuracy, even for sequences without a certain periodicity. An α value of 0.01 was used in this experiment, as the shape differences between the sequences were small. The idea behind C-DTW is that the same types of sequence have the same shapes, meaning that under DTW alignment those parts of the sequence with points that are close in distance account for a larger proportion. Conversely, the proportion of similar shapes between different data types is shorter. For the “DodgerLoopDay” dataset in Table 2, the C-DTW+1NN error rate is 0.5876 while the DTW+1NN classification error rate is 0.475.
In the case of the “DodgerLoopGame” dataset, the classification error rate of C-DTW+1NN is 0.21014, while the classification error rate of DTW+1NN is 0.14493. Although the classification performance is not very good, setting the α value of C-DTW to 0.001 results in better classification performance, with error rates of 0.475 and 0.13768 for the “DodgerLoopDay” and “DodgerLoopGame” datasets, respectively. Figure 14 displays the plotted sequences of the “DodgerLoopGame” dataset to help explain the reason for the improved classification results.

5. Conclusions

This paper provides a framework and feasibility validation for subsequent realization of TENGs. A WS-HAR system is realized by placing a TENG on the heel of the shoe mat. The TENG can realize the potential of a self-powering device. Compared with video-based HAR, the method proposed in this paper is not limited by application scenario. Moreover, compared with sensor-based HAR, the proposed method avoids the need to wear a cumbersome device. Additionally, the C-DTW method proposed as a compensatory mechanism for the WS-HAR system has high accuracy, low time complexity, and can be easily combined with other DTW versions. Our experiments show that C-DTW has stronger robustness in the case of quasi-periodic sequences. In the future, self-powering TENG devices can be used with a system such as the one proposed here to collect plantar piezoelectric data and identify complex action patterns.

Author Contributions

Conceptualization, Software, writing—review and editing, H.X. and R.F.; Validation, W.Z.; Investigation, W.Z. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Natural Science Foundation of China 62271349, State Grid Shandong electric power company science and technology project support 520601220009, the 54th Research Institute of China Electronics Technology Group Corporation (2021-JCJQ-JJ-0617).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Lai, K.; Yanushkevich, S.N.; Shmerko, V.; Hou, M. Capturing causality and bias in human action recognition. Pattern Recognit. Lett. 2021, 147, 164–171. [Google Scholar] [CrossRef]
  2. Dallel, M.; Havard, V.; Dupuis, Y.; Baudry, D. Digital twin of an industrial workstation: A novel method of an auto-labeled data generator using virtual reality for human action recognition in the context of human–robot collaboration. Eng. Appl. Artif. Intell. 2023, 118, 105655. [Google Scholar] [CrossRef]
  3. Zhang, X.; Yi, D.; Behdad, S.; Saxena, S. Unsupervised Human Activity Recognition Learning for Disassembly Tasks. IEEE Trans. Ind. Inform. 2023; early access. [Google Scholar] [CrossRef]
  4. Tasnim, N.; Baek, J.H. Dynamic Edge Convolutional Neural Network for Skeleton-Based Human Action Recognition. Sensors 2023, 23, 778. [Google Scholar] [CrossRef]
  5. Pan, X.; Ye, T.; Xia, Z.; Song, S.; Huang, G. Slide-Transformer: Hierarchical Vision Transformer with Local Self-Attention. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 18–22 June 2023; pp. 2082–2091. [Google Scholar]
  6. Ramanujam, E.; Perumal, T.; Padmavathi, S. Human activity recognition with smartphone and wearable sensors using deep learning techniques: A review. IEEE Sens. J. 2021, 21, 13029–13040. [Google Scholar] [CrossRef]
  7. Sarkar, A.; Hossain, S.S.; Sarkar, R. Human activity recognition from sensor data using spatial attention-aided CNN with genetic algorithm. Neural Comput. Appl. 2023, 35, 5165–5191. [Google Scholar] [CrossRef]
  8. Li, Y.; Yang, G.; Su, Z.; Li, S.; Wang, Y. Human activity recognition based on multienvironment sensor data. Inf. Fusion 2023, 91, 47–63. [Google Scholar] [CrossRef]
  9. Sahoo, K.K.; Ghosh, R.; Mallik, S.; Roy, A.; Singh, P.K.; Zhao, Z. Wrapper-based deep feature optimization for activity recognition in the wearable sensor networks of healthcare systems. Sci. Rep. 2023, 13, 965. [Google Scholar] [CrossRef]
  10. Zhang, Y.; Gao, B.; Yang, D.; Woo, W.L.; Wen, H. Online learning of wearable sensing for human activity recognition. IEEE Internet Things J. 2022, 9, 24315–24327. [Google Scholar] [CrossRef]
  11. Suh, S.; Rey, V.F.; Lukowicz, P. TASKED: Transformer-based Adversarial learning for human activity recognition using wearable sensors via Self-KnowledgE Distillation. Knowl.-Based Syst. 2023, 260, 110143. [Google Scholar] [CrossRef]
  12. Dong, X.; Yang, Z.; Li, J.; Jiang, W.; Ren, J.; Xu, Y.; Hu, T.S.; Li, M. Recent advances of triboelectric, piezoelectric and pyroelectric nanogenerators. Nano-Struct. Nano-Objects 2023, 35, 100990. [Google Scholar] [CrossRef]
  13. Fan, F.R.; Tian, Z.Q.; Wang, Z.L. Flexible triboelectric generator. Nano Energy 2012, 1, 328–334. [Google Scholar] [CrossRef]
  14. Zhou, Y.; Shen, M.; Cui, X.; Shao, Y.; Li, L.; Zhang, Y. Triboelectric nanogenerator based self-powered sensor for artificial intelligence. Nano Energy 2021, 84, 105887. [Google Scholar] [CrossRef]
  15. Ma, B.; Cheng, L.; Bai, S.; Jia, X.; Ma, J.; Zhao, J.; Wang, L.; Qin, Y. 3D spirally coiled piezoelectric nanogenerator for large impact energy harvesting. Nano Energy 2023, 111, 108412. [Google Scholar] [CrossRef]
  16. Lim, G.H.; Kwak, S.S.; Kwon, N.; Kim, T.; Kim, H.; Kim, S.M.; Kim, S.W.; Lim, B. Fully stretchable and highly durable triboelectric nanogenerators based on gold-nanosheet electrodes for self-powered human-motion detection. Nano Energy 2017, 42, 300–306. [Google Scholar] [CrossRef]
  17. Huang, L.B.; Han, J.C.; Chen, S.; Sun, Z.; Dai, X.; Ge, P.; Zhao, C.H.; Zheng, Q.Q.; Sun, F.C.; Hao, J. 4D-printed self-recovered triboelectric nanogenerator for energy harvesting and self-powered sensor. Nano Energy 2021, 84, 105873. [Google Scholar] [CrossRef]
  18. Li, W.; Lu, L.; Yan, F.; Palasantzas, G.; Loos, K.; Pei, Y. High-performance triboelectric nanogenerators based on TPU/mica nanofiber with enhanced tribo-positivity. Nano Energy 2023, 114, 108629. [Google Scholar] [CrossRef]
  19. Mandal, I.; Happy, S.; Behera, D.P.; Routray, A. A framework for human activity recognition based on accelerometer data. In Proceedings of the 2014 5th International Conference-Confluence The Next Generation Information Technology Summit (Confluence), Noida, India, 25–26 September 2014; pp. 600–603. [Google Scholar]
  20. Hassan, M.M.; Uddin, M.Z.; Mohamed, A.; Almogren, A. A robust human activity recognition system using smartphone sensors and deep learning. Future Gener. Comput. Syst. 2018, 81, 307–313. [Google Scholar] [CrossRef]
  21. Xu, W.; Wu, M.; Zhu, J.; Zhao, M. Multi-scale skeleton adaptive weighted GCN for skeleton-based human action recognition in IoT. Appl. Soft Comput. 2021, 104, 107236. [Google Scholar] [CrossRef]
  22. Al-Amin, M.; Tao, W.; Doell, D.; Lingard, R.; Yin, Z.; Leu, M.C.; Qin, R. Action recognition in manufacturing assembly using multimodal sensor fusion. Procedia Manuf. 2019, 39, 158–167. [Google Scholar] [CrossRef]
  23. Pienaar, S.W.; Malekian, R. Human activity recognition using LSTM-RNN deep neural network architecture. In Proceedings of the 2019 IEEE 2nd wireless africa conference (WAC), Pretoria, South Africa, 18–20 August 2019; pp. 1–5. [Google Scholar]
  24. Zhao, B.; Xing, H.; Wang, X.; Song, F.; Xiao, Z. Rethinking attention mechanism in time series classification. Inf. Sci. 2023, 627, 97–114. [Google Scholar] [CrossRef]
  25. Shen, D.S.; Chi, M. TC-DTW: Accelerating multivariate dynamic time warping through triangle inequality and point clustering. Inf. Sci. 2023, 621, 611–626. [Google Scholar] [CrossRef]
  26. Tan, C.W.; Herrmann, M.; Forestier, G.; Webb, G.I.; Petitjean, F. Efficient search of the best warping window for dynamic time warping. In Proceedings of the 2018 SIAM International Conference on Data Mining, San Diego, CA, USA, 3–5 May 2018; pp. 225–233. [Google Scholar]
  27. Jeong, Y.S.; Jeong, M.K.; Omitaomu, O.A. Weighted dynamic time warping for time series classification. Pattern Recognit. 2011, 44, 2231–2240. [Google Scholar] [CrossRef]
  28. Keogh, E.J.; Pazzani, M.J. Derivative dynamic time warping. In Proceedings of the 2001 SIAM International Conference on Data Mining, Chicago, IL, USA, 5–7 April 2001; pp. 1–11. [Google Scholar]
  29. Zhao, J.; Itti, L. shapedtw: Shape dynamic time warping. Pattern Recognit. 2018, 74, 171–184. [Google Scholar] [CrossRef]
  30. Cuturi, M.; Blondel, M. Soft-dtw: A differentiable loss function for time-series. In Proceedings of the International Conference on Machine Learning, Sydney, Australia, 6–11 August 2017; pp. 894–903. [Google Scholar]
  31. Ram, D.D.; Muthukumaran, U.; Fatima, N.S. Enhanced Human Action Recognition with Ensembled DTW Loss Function in CNN LSTM Architecture. In Proceedings of the Third International Conference on Sustainable Expert Systems: ICSES 2022; Springer: Berlin/Heidelberg, Germany, 2023; pp. 491–508. [Google Scholar]
  32. Li, H.; Khoo, S.; Yap, H.J. Implementation of sequence-based classification methods for motion assessment and recognition in a traditional chinese sport (baduanjin). Int. J. Environ. Res. Public Health 2022, 19, 1744. [Google Scholar] [CrossRef]
  33. Lerogeron, H.; Picot-Clémente, R.; Rakotomamonjy, A.; Heutte, L. Approximating dynamic time warping with a convolutional neural network on EEG data. Pattern Recognit. Lett. 2023, 171, 162–169. [Google Scholar] [CrossRef]
  34. Niu, S.; Wang, S.; Lin, L.; Liu, Y.; Zhou, Y.S.; Hu, Y.; Wang, Z.L. Theoretical study of contact-mode triboelectric nanogenerators as an effective power source. Energy Environ. Sci. 2013, 6, 3576–3583. [Google Scholar] [CrossRef]
  35. Zhang, P.; Zhang, W.; Zhang, H. A high-performance textile-based triboelectric nanogenerator manufactured by a novel brush method for self-powered human motion pattern detector. Sustain. Energy Technol. Assess. 2021, 46, 101290. [Google Scholar] [CrossRef]
  36. He, Y.; Lin, M.; Wang, X.; Liu, K.; Liu, H.; He, T.; Zhou, P. Textile-film sensors for a comfortable intelligent pressure-sensing insole. Measurement 2021, 184, 109943. [Google Scholar] [CrossRef]
  37. Li, H. Time works well: Dynamic time warping based on time weighting for time series data mining. Inf. Sci. 2021, 547, 592–608. [Google Scholar] [CrossRef]
  38. Keogh, E.; Kasetty, S. On the need for time series data mining benchmarks: A survey and empirical demonstration. Data Min. Knowl. Discov. 2003, 7, 349–371. [Google Scholar] [CrossRef]
  39. Itakura, F. Minimum prediction residual principle applied to speech recognition. IEEE Trans. Acoust. Speech Signal Process. 1975, 23, 67–72. [Google Scholar] [CrossRef]
  40. Ye, J.; Bao, W.; Liao, C.; Chen, D.; Hu, H. Corn Phenology Detection Using the Derivative Dynamic Time Warping Method and Sentinel-2 Time Series. Remote Sens. 2023, 15, 3456. [Google Scholar] [CrossRef]
  41. Tao, Z.; Xu, Q.; Liu, X.; Liu, J. An integrated approach implementing sliding window and DTW distance for time series forecasting tasks. Appl. Intell. 2023, 1–12. [Google Scholar] [CrossRef]
  42. Ma, Y.; Tang, Y.; Zeng, Y.; Ding, T.; Liu, Y. An N400 identification method based on the combination of Soft-DTW and transformer. Front. Comput. Neurosci. 2023, 17, 1120566. [Google Scholar] [CrossRef] [PubMed]
  43. Guo, F.; Zou, F.; Luo, S.; Liao, L.; Wu, J.; Yu, X.; Zhang, C. The fast detection of abnormal ETC data based on an improved DTW algorithm. Electronics 2022, 11, 1981. [Google Scholar] [CrossRef]
  44. Dau, H.A.; Keogh, E.; Kamgar, K.; Yeh, C.C.M.; Zhu, Y.; Gharghabi, S.; Ratanamahatana, C.A.; Chen, Y.; Hu, B.; Begum, N.; et al. The UCR Time Series Classification Archive, 2018. Available online: https://www.cs.ucr.edu/~eamonn/time_series_data_2018/ (accessed on 2 May 2023).
Figure 1. A TENG is placed at the heel and connected with a voltage detection device (or small voltage detection embedded device); the schematic diagram of the TENG is shown on the right.
Figure 1. A TENG is placed at the heel and connected with a voltage detection device (or small voltage detection embedded device); the schematic diagram of the TENG is shown on the right.
Sensors 23 07230 g001
Figure 2. (A) The distance matrix and warping path; each element of the distance matrix represents the Euclidean distance between corresponding points of the two sequences. (B) The alignment of the example sequences v ^ = [ 0.95 , 0.21 , 1.31 , 0.96 , 0.61 , 1.34 , 0.95 ] and v ˜ = [ 0.92 , 0.16 , 1.29 , 0.92 , 0.04 , 1.39 , 0.91 , 0.07 , 1.48 , 0.92 ] ; the numbers along the lines represent the Euclidean distances between aligned points, while the numbers inside the circles represent the indices of the example sequences.
Figure 2. (A) The distance matrix and warping path; each element of the distance matrix represents the Euclidean distance between corresponding points of the two sequences. (B) The alignment of the example sequences v ^ = [ 0.95 , 0.21 , 1.31 , 0.96 , 0.61 , 1.34 , 0.95 ] and v ˜ = [ 0.92 , 0.16 , 1.29 , 0.92 , 0.04 , 1.39 , 0.91 , 0.07 , 1.48 , 0.92 ] ; the numbers along the lines represent the Euclidean distances between aligned points, while the numbers inside the circles represent the indices of the example sequences.
Sensors 23 07230 g002
Figure 3. Unfolding the one-to-many alignment; the alignments that satisfy (14) are highlighted by the red lines.
Figure 3. Unfolding the one-to-many alignment; the alignments that satisfy (14) are highlighted by the red lines.
Sensors 23 07230 g003
Figure 4. System block diagram.
Figure 4. System block diagram.
Sensors 23 07230 g004
Figure 5. Original voltage sequence for 25 s of jumping.
Figure 5. Original voltage sequence for 25 s of jumping.
Sensors 23 07230 g005
Figure 6. Intercepted jumping sequences (a,d,g), differential sequences (b,e,h), and processed sequences (c,f,i).
Figure 6. Intercepted jumping sequences (a,d,g), differential sequences (b,e,h), and processed sequences (c,f,i).
Sensors 23 07230 g006
Figure 7. Classification accuracy when changing the value of α .
Figure 7. Classification accuracy when changing the value of α .
Sensors 23 07230 g007
Figure 8. Confusion matrix of C-DTW (a), DTW (b), WDTW (c), DDTW (d), softDTW (e), and shapeDTW (f) when the number of templates of the 1-NN is 10.
Figure 8. Confusion matrix of C-DTW (a), DTW (b), WDTW (c), DDTW (d), softDTW (e), and shapeDTW (f) when the number of templates of the 1-NN is 10.
Sensors 23 07230 g008
Figure 9. Confusion matrix of C-DTW (a), DTW (b), WDTW (c), DDTW (d), softDTW (e), and shapeDTW (f) when the number of templates of the 1-NN is 3.
Figure 9. Confusion matrix of C-DTW (a), DTW (b), WDTW (c), DDTW (d), softDTW (e), and shapeDTW (f) when the number of templates of the 1-NN is 3.
Sensors 23 07230 g009
Figure 10. Confusion matrix of C-DTW (a), DTW (b), WDTW (c), DDTW (d), softDTW (e), and shapeDTW (f) when the length of the template sequence is 2000 points and the length of the classification sequence is 1500 points, with three template sequences per class.
Figure 10. Confusion matrix of C-DTW (a), DTW (b), WDTW (c), DDTW (d), softDTW (e), and shapeDTW (f) when the length of the template sequence is 2000 points and the length of the classification sequence is 1500 points, with three template sequences per class.
Sensors 23 07230 g010
Figure 11. Original signal and marked signal. The two subfigures on the left of (A,B) show the original “jumping” and “walking” signals, while the red points marked in the two subfigures on the right of (A,B) show the points selected according to the compensatory mechanism.
Figure 11. Original signal and marked signal. The two subfigures on the left of (A,B) show the original “jumping” and “walking” signals, while the red points marked in the two subfigures on the right of (A,B) show the points selected according to the compensatory mechanism.
Sensors 23 07230 g011
Figure 12. The “jumping” and “walking” sequences have similar beginning and ending shapes. The two subfigures on the left show the original “jumping” and “walking” signals, while the red points marked in the two subfigures on the right show the points selected according to the compensatory mechanism.
Figure 12. The “jumping” and “walking” sequences have similar beginning and ending shapes. The two subfigures on the left show the original “jumping” and “walking” signals, while the red points marked in the two subfigures on the right show the points selected according to the compensatory mechanism.
Sensors 23 07230 g012
Figure 13. The compensatory mechanism proposed in this paper combined with different versions of DTW: confusion matrices of (A) C-DDTW (a), C-shapeDTW (c), DDTW (d), and shapeDTW (f) when the number of 1-NN templates is 3 and of (B) C-DDTW (a), C-shapeDTW (c), DDTW (d), and shapeDTW (f) with a template sequence length of 2000 points, classification sequence length of 1500 points, and three template sequences per class.
Figure 13. The compensatory mechanism proposed in this paper combined with different versions of DTW: confusion matrices of (A) C-DDTW (a), C-shapeDTW (c), DDTW (d), and shapeDTW (f) when the number of 1-NN templates is 3 and of (B) C-DDTW (a), C-shapeDTW (c), DDTW (d), and shapeDTW (f) with a template sequence length of 2000 points, classification sequence length of 1500 points, and three template sequences per class.
Sensors 23 07230 g013
Figure 14. The DogersLoopGame dataset in the UCR Archive contains two types of data, representing traffic data for Class 1: Normal Day and Class 2: Game Day. The vertical axis represents the number of cars in the past 5 min and the horizontal axis represents the number of five minute periods.
Figure 14. The DogersLoopGame dataset in the UCR Archive contains two types of data, representing traffic data for Class 1: Normal Day and Class 2: Game Day. The vertical axis represents the number of cars in the past 5 min and the horizontal axis represents the number of five minute periods.
Sensors 23 07230 g014
Table 1. Time required to classify each action with three template sequences in each class.
Table 1. Time required to classify each action with three template sequences in each class.
DataC-DTWDTW [39]WDTW [27]DDTW [28]softDTW [30]shapeDTW [29]
jump0.32880.23880.32820.29740.32257.4383
run0.31620.24510.31430.31330.31787.4146
walk0.31570.24740.30890.30460.30147.4297
jump_random0.32450.23220.29980.28070.30497.3968
run_random0.32670.24820.30140.28990.32017.4587
walk_random0.31170.23110.31690.30220.31387.4444
Table 2. Classification error rate results on “Sensor” and “Motion” datasets from the UCR Archive.
Table 2. Classification error rate results on “Sensor” and “Motion” datasets from the UCR Archive.
TypeNameLengthClassC-DTWDTW
SensorCar57740.233330.25
SensorChlorineConcentration16630.379170.37344
SensorCinCECGTorso163940.28330.30942
SensorDodgerLoopDay28870.5870.475
SensorDodgerLoopGame28820.137680.14493
SensorDodgerLoopWeekend28820.0289860.028986
SensorEarthquakes51220.302160.33094
SensorFordA50020.43030.42879
SensorFordB50020.395060.39383
SensorFreezerRegularTrain30120.101050.093
SensorFreezerSmallTrain30120.27860.28
SensorGesturePebbleZ1Vary60.11620.098837
SensorGesturePebbleZ2Vary60.227850.21519
SensorInsectWingbeatSound256110.566670.56919
SensorItalyPowerDemand2420.0544220.054422
SensorLightning263720.196720.19672
SensorLightning731970.0232880.023288
SensorMoteStrain8420.106230.10942
SensorPhoneme1024390.729960.7714
SensorPickupGestureWiimoteZVary100.40.38
SensorPlane144700
SensorShakeGestureWiimoteZVary100.160.16
SensorSonyAIBORobotSurface17020.29450.28785
SensorSonyAIBORobotSurface26520.156350.1574
SensorStarLightCurves102430.120650.11462
SensorTrace27540.010.01
SensorWafer15220.14760.016061
MotionCricketX390120.22810.2281
MotionCricketY390120.258970.25128
MotionCricketZ390120.217950.21282
MotionGunPoint15020.126670.12667
MotionGunPointAgeSpan31620.085440.08543
MotionGunPointMaleVersusFemale31620.00316460.0031646
MotionGunPointOldVersusYoung31520.155560.1587
MotionHaptics30850.633120.63636
MotionInlineSkate55070.623640.62545
MotionToeSegmentation122820.21930.20175
MotionToeSegmentation213020.146150.15385
MotionUWaveGestureLibraryAll358280.0795640.083752
MotionUWaveGestureLibraryX358280.268010.26912
MotionUWaveGestureLibraryY358280.352040.35539
MotionUWaveGestureLibraryZ358280.348410.35539
MotionWorms7750.467530.48052
MotionWormsTwoClass7720.363640.36364
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Xu, H.; Feng, R.; Zhang, W. C-DTW for Human Action Recognition Based on Nanogenerator. Sensors 2023, 23, 7230. https://doi.org/10.3390/s23167230

AMA Style

Xu H, Feng R, Zhang W. C-DTW for Human Action Recognition Based on Nanogenerator. Sensors. 2023; 23(16):7230. https://doi.org/10.3390/s23167230

Chicago/Turabian Style

Xu, Haifeng, Renhai Feng, and Weikang Zhang. 2023. "C-DTW for Human Action Recognition Based on Nanogenerator" Sensors 23, no. 16: 7230. https://doi.org/10.3390/s23167230

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop