There is a large class of routine physical exercises that are per- formed on the ground, often on dedicated ”mats” (e.g. push- ups, crunches, bridge). Such exercises involve coordinated motions of different body parts and are difﬁcult to recognize with a single body worn motion sensors (like a step counter). Instead a network of sensors on different body parts would be needed, which is not always practicable. As an alternative we describe a cheap, simple textile pressure sensor matrix, that can be unobtrusively integrated into exercise mats to recog- nize and count such exercises. We evaluate the system on a set of 10 standard exercises. In an experiment with 7 subjects, each repeating each exercise 20 times, we achieve a user in- dependent recognition rate of 82.5% and a user independent counting accuracy of 89.9%. The paper describes the sensor system, the recognition methods and the experimental results. Author Keywords Sport tracking; activity recognition; pressure sensors; health ACM Classiﬁcation Keywords I.2.1. Artiﬁcial Intelligence: Applications and Expert Sys- tems Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for proﬁt or commercial advantage and that copies bear this notice and the full citation on the ﬁrst page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior speciﬁc permission and/or a fee. Request permissions from Permissions@acm.org. Copyright is held by the owner/author(s). Publication rights licensed to ACM. UbiComp’14 , September 13–17, 2014, Seattle, WA, US. ACM 978-1-4503-2968-2/14/09... $ 15.00. http://dx.doi.org/10.1145/2632048.2636088INTRODUCTION Motivating people to exercise and helping them monitor their personal progress is a popular and well researched application of ubiquitous computing. However the majority of systems (including many commercial offerings) developed to date are designed for tracking aerobic training such as running and cy- cling. Such exercises are mostly deﬁned by speed, distance and terrain which can be reliably monitored using a single unobtrusive on-body motion sensor and a GPS receiver con- tained for example in a smart phone. Much less work, par- ticularly in terms of broadly usable unobtrusive systems, ex- ists in the area of strength and muscular endurance training. Such training increases bone strength and muscular ﬁtness, and reduces risk for injuries [ 1]. We distinguish two types of strength oriented exercises. The ﬁrst is based on special ma- chines typically found in ﬁtness studios. The second involves exercises such as push-ups, crunches or free lifting weights which can be performed anywhere. In this paper we focus on monitoring the latter. Since the exercises are deﬁned by often complex motion patterns of different body parts they, in general, require more elaborate sensor systems than a single body mounted motion sensor. This paper is motivated by the observation that many strength related exercises involve contact between different body parts and the ground. For each exercise a characteristic spatio tem- poral contact and pressure pattern can be identiﬁed. We thus propose to use a resistive, textile pressure sensor matrix for tracking exercises such as push-ups, abdominal crunches and squats. Such a matrix can be easily integrated into standard gym-mats often used in this context. This means that the monitoring can be performed without the need to wear any additional sensors by merely exchanging a normal gym-mat for a smart one. The main contributions of this paper are: •We introduce a resistive pressure mat as a new sensing modality for ubiquitously recognizing and counting exer- cises. The mat is thin, soft and low-cost and can easily replace traditional gym mats. •We show that our pressure sensor mat successfully distin- guishes 10 common gym exercises. Using a kNN-classiﬁer we achieve an overall accuracy of 88.7% for 7 subjects in- dividually and an 82.5% person independent recognition rate. By majority voting we can classify a set of exercises with 86.5% accuracy, and with the correct class being in the top 2 of the classiﬁer output 94.3% of the time. •We demonstrate that the system can robustly count the number of performed exercises within real-life data. By utilizing dynamic time warping and a method for selecting the best matching template from a training set collected from several users performing the exercises at different speeds we achieve an overall 89.9% person independent detection rate for 10 activities, and 7 subjects. •We investigate in detail the impact of variation in the exe- cution speed of exercises, and the inﬂuence of testing and training the system on different users. The article starts by presenting the state of the art in sport tracking and activity recognition. We then present our pres- sure sensor platform used in the experiments. We describe the experiment and the taxonomy of exercises. The evalu- ation is split into two main parts. In the ﬁrst part we eval- uate how exercises are distinguished by calculating rotation and translation invariant features from the pressure data and using a kNN-classifer for classiﬁcation. In the second part we describe how the exercises can be robustly detected and counted by utilizing dynamic time warping. Finally we state our conclusions and future work. RELATED WORK As a method for motivating people to exercise regularly, dif- ferent kinds of sport tracking systems have been proposed. A study shows that, users who get computer feedback during their exercise sessions have signiﬁcantly higher attendance and adherence and also fewer drop-outs compared to users without any feedback [ 7]. Sport tracking systems for tracking aerobic exercises are both common and commercially available [ 5,2]. These systems use GPS, heart-rate monitors and/or pedometer to track the distance a person is walking, running or cycling, and to esti- mate the burned calories. Systems for tracking strength train- ing is far less common. FitLinxx proposes a strength training tracking system that is mounted to weight-lifting machines in the gym [ 3]. The user can log on to their personal training proﬁles using touch screens. The system tracks the amount of weight the user is using, the number repetitions performed, and give users direct feedback of their progress. The system requires the gym to be equipped with special exercise machines and infrastructure, which is very expensive and not suitable for average user.A different approach to track strength training has been to use on-body sensors. Chang et al. uses accelerometers positioned on users hands and waist to track free-weight training [ 8]. The system is able to recognize different gym exercises and also to count the number of repetitions. Seeger et al. improves on this work by recognizing exercises in real-time through out the day, using a heart-rate monitor and accelerometers attached to upper arm and leg [ 16]. Other systems exploit only the inertial sensors in smartphones to detect and count sport exercises. The smartphone has gained a lot of attention in activity recognition, since it can through its sensors capture user’s motion, analyse it in real- time, provide instant user feedback, and log data for long- term analysis. Muehlbauer et al. investigated how a holster worn smartphone can recognize different upper body exer- cises and count repetitions [ 13]. Pernek et al. build upon this work by supporting a broader range of exercises including some gym machines [ 14]. Compared to previous work we introduce an entirely different approach to ubiquitously recognize and count exercises, by using a pressure sensor mat. In our approach the user do not have to wear any sensors or devices that might be distracting while performing exercises. The user can perform exercises in the same way as on a traditional gym mat, and the system can automatically detect what exercises are performed and how many repetitions are done. BASIC IDEAS Hardware Platform The core of the gym mat is a resistive pressure sensor matrix. The matrix is built out of a thin layer of conductive polymer ﬁber sheet. The conductive sheet is positioned between 80 parallel stripes of conductive foil on each side, spaced 1 cm between each other, resulting in a 80 cm ⇥80 cm sensor mat. The volume resistance of the ﬁber sheet/ﬁlm reduces locally when the material is pressed, which can be measured by the crossing foil electrodes. The sampling electronics is a custom printed circuit board, which follows our study on the multi- channel parallel architecture [ 17]. It has one FPGA to control the system, and one FPGA and ultra-fast analog switches to sweep through every column. Three dedicated 24-bit ADCs with analog routing circuitry samples one column of the ma- trix at a time, creating a 80 ⇥80 pixel frame every 1/40 sec- ond. The data is sent to the computer through 3 serial ports (UART-USB) by a dedicated bridge chip through one physi- cal USB cable. The result is a thin, soft and low-cost sensor mat, that in the future could replace traditional gym mats. Pictures of our current prototype can be seen in Figure 1. Preprocessing of Frames The data frames produced by the sensor mat are calibrated by removing DC and noise. The DC component for each sensor element in the matrix is calculated as the average value during the time the sport mat is not occupied by a person. When a force is applied on the mat the voltage in that position is increasing. However due to electrical properties of the sensor Figure 2: Frame before and after preprocessing. the entire row is affected and slightly pulled down as can be seen in Figure 2(a). To compensate for this, a compensation term is calculated for every row of the frame as the minimum value of the row. For robustness the frame is ﬁltered by a 3 ⇥ 3 median ﬁlter before calculating the minimum. The resulting preprocessed frame after calibration and row compensation is shown in Figure 2(b). Signals and Recognition Approach Examples of signals for different types of exercises are shown in Figure 3. With the spatial resolution of around 1 cm, the mat can distinguish the body parts that are in contact with the ground. We can also see changes in weight distribution both between body parts and within a body part. With a sampling rate of 40 Hz we are also able to observe the temporal evolu- tion of the weight distribution. Thus the information that we can use for monitoring the exercises is based on (1) the body parts that are on the mat (hand, leg, knee, buttock, back), (2) the relative position and orientation of those body parts, (3) the sequence of the (1) and (2), (4) the weight distribution within and between body parts and (5) the temporal evolution of this sequence. The weight distribution contains important information, not only about the body parts which have contact with the mat, but also about other parts of the body. Thus, for example in Figure 3II the weight distribution between (and within) the hand and the knee which are on the mat is strongly inﬂuenced by the motion of the leg and the hand which are in the air. Similarly balance changes related weights being lifted in Figure 3IX translate into balance changes in the feet which are registered by the mat. From the above considerations, our approach consist of (1) signal conditioning, (2) detecting areas on which there is body part contact, (3) computing a set of features that rep- resent the information sketched above in a compact, abstract way and (4) performing a classiﬁcation on those features. Building on the classiﬁcation we then perform the counting of the number of repetitions of each exercise. IDENTIFICATION OF ACTIVITIES Some activities cause changes in the weight and pressure while some activities cause changes in the shape and size of the contact area. Therefore we calculate features that describe the change in weight distribution and the contact area.The classiﬁcation process can be summarized by the follow- ing steps: 1.Calculate area A, weight W, pressure pand Hu’s Seven Moments 17for each frame in the recording. All activi- ties on the carpet are described by these 10 time series. 2.For each labelled activity, statistical features are calculated for describing the variation of the 10 time series during the exercises. 3.Classiﬁcation is performed using a kNN-classiﬁer. Calculation of Invariant Features While the user is performing exercises on the mat the weight distribution, contact area and shape of the contact area is changing. To calculate the size of the contact area for an in- dividual frame in the recording we threshold the pressure im- age. The area Ais the the sum of all pixels above the thresh- old. Before thresholding we upsample the image to 160 ⇥ 160 pixels; intermediate pixels are interpolated using bi-cubic interpolation scheme. This creates a higher resolution frame that is advantageous when calculating the area, the weight of the frame. The weight Wis calculated as the sum of all pixels within the area. We also deﬁne pressure as p=W A. Pressure gives information of how concentrated the force is. For example when the user is standing the area is small and the pressure is large. When the user is lying the pressure is lower because of the larger contact area. To compactly describe the shape of the contact area and weight distribution of the image we use image moments. Im- age moments are scalar quantities that statistically describe the intensity distribution of the image and have been since long used in the pattern recognition community for image and shape recognition [ 10][12]. Hu introduced seven image mo- ments that are invariant to translation, scale and rotation [ 10]. While Hu’s moments are most often used to classify shapes of binary images they are not limited to only binary images. To describe pressure distribution we calculate Hu’s seven mo- ments 17for each pressure frame of the recording. Before calculating the moments the image is normalized so that the total weight is 1, which removes the weight information al- ready included in W. By calculating these features for each frame we reduce the dimensionality of our original data to a set of 10 time series F={A(t),W(t),p(t),17(t)}denoted as feature domain. Because each of these features are translation and rotation in- variant it does not matter where the user stands/lies on the sensor mat or in which direction he/she is facing while per- forming the exercises. The classiﬁcation and counting of ex- ercises is done in feature domain F. Experimental Setup To evaluate our approach, 7 healthy test subjects (age 23-27) are asked to perform 10 predeﬁned sport exercises on the sen- sor carpet. The exercises are grouped into sets. Each exercise is repeated 10 times per set and each set is performed 2 times (total 10 exercises ⇥10 repeats ⇥2 sets). To also evaluate how well our system is able to detect exercises performed at Figure 1: (a) Top view of our 80 ⇥80 cm sensor matrix prototype. (b) The core of the sensor is a conductive textile positioned between stripes of electrodes. different tempo we ask the subjects to perform the ﬁrst set fast and the second set in a more relaxed tempo. As a result our test subjects performed the ﬁrst set 1.5 times faster com- pared to the second set on average. The exercises are video recorded and the starting point and end point of each exercise is labelled manually based on the recorded video. The chosen sport activities are standard exercises that can be performed on a normal gym mat and selected from a pool of exercises that are recommended by experts at Mayo Clinic [4]. Since we are interested in investigating whether the sen- sor carpet is able to also count the exercises, all the selected exercises are activities that are performed in repeats. For chest press and biceps curl we used 2.5–5.0 kg dumbbells. The exercises performed are shown in Figure 3. Classiﬁcation and Results To classify the exercises we rely on the temporal variation of time-series in feature domain Fduring the exercise. The following features are calculated for each time-series in F: •mean and standard deviation •maximum, minimum, and maximum - minimum •maximum and minimum of the approximate 1st derivative Each feature is normalized by the standard deviation of the corresponding feature in the training set before classiﬁcation. When we classify the exercises of each user using 10-fold cross validation with an kNN-classiﬁer we reach almost 95- 100 % classiﬁcation rate for each subject. Average confusion matrix shown in Figure 4(a). This result might however be too optimistic. The exercises within one set are fairly similar, while there are larger variation (in speed, position) between exercises performed in different sets. Therefore we instead perform a repeated hold out where the exercises is split so that the one set of exercises is used for training and the other for testing. Using this method we reach 88.7 % average accuracy for 7 subjects. The confusion matrix is shown in Figure 4(b).To evaluate the impact of person independent training we per- form a leave-one-out cross validation, where one subject is left out for testing while the other subjects are used for train- ing. We reach an average accuracy of 82.5% for person inde- pendent classiﬁcation across 7 subjects. The confusion ma- trix is shown in Figure 4(c). This suggests that our system works well across different users. The most missclassiﬁca- tion happens between calf raise and squats. Both of these exercises are performed standing. It also appears that some users are lifting their heels while performing squats, making the change of contact area similar to calf-raise. There is also some confusion between segmental rotation, bridge and chest press. In all of these exercises the user is lying on the back making the shape of the contact area similar. These exercises there are also subject to style differences between different users. Some users spread their arms more than others when performing bridge; some rotate more than others when per- forming segmental rotation; and some touch with the arms in the ﬂoor while doing chest presses while others move the arms in the air only. The results presented so far are all are achieved by classifying exercises as individual, pre-segmented instances. However, usually exercises are grouped into sets where one set contains many of the same exercises without any segmentation. For further processing (counting as described in the next section) we need to be able to recognize which exercise such an un- segmented set belongs to. To this end we move a window over the complete exercises set. We choose a window size of 100 samples which is large enough to cover complete exer- cises. The window step is 10. For every step we classify the segment within the window. We then select the majority class as the class of the complete set. The evaluation was done as user independent study where the test subject was left out of the training data. Using this approach we reach 86.4% aver- age accuracy for person independent classiﬁcation of exercise sets. The correct class is occurring within the two majority classes 94.3% of the time. Figure 3: Exercises performed in the experiment: I. push-up, II. quadruped, III. abdominal crunch, IV. chest press with dumbbell, V. bridge, VI. segmental rotation, VII. calf raise, VIII. squat, IX. biceps curl with dumbbell, X. lunge. The pictures on the right are typical frames corresponding to the exercise. In the next section we are investigating how exercises can be detected and counted within a set of exercises once the class to which they belong is known. COUNTING REPETITIONS In the previous section, it is shown that different exercises have distinguishable characteristics when looking at how the contact area and weight distribution varies over time. Ulti- mately, we would like to not only distinguish activities from each other, but also detect when they are performed, and to count how many the subject has performed within a set. This is achieved by calculating templates for each exercises and then match the data stream with the template. To make the system robust against variation in exercises speed we use dy- namic time warping (DTW) when calculating the distance to the template. The following steps are performed: 1.Calculate area A, weight W, pressure pand Hu’s Seven Moments 17for each frame in the recording. 2.Create exercise templates using training data. 3.Move the template over the test data and calculate a match at every step using dynamic time warping. A high peak in the match corresponds to good match of the template. 4.Detect and count peaks in the match to determine when and how many instances of an exercise have been performed in a set.Template Calculation As the initial step feature time-series F = {A(t),W(t),p(t),17(t)}are calculated for each frame in the recording. This step is the same as described in the previous section. To describe how the template for an exercises is calculated, letXi(t)={X1(t),X2(t),X3(t)...Xk(t)}be an arbitrary set of time-series representing instances of a speciﬁc exercise; kis the total number of instances of an exercise in the training data. The template length lis calculated as the median length of time series in Xi(t). All exercises in Xi(t)are then scaled by ﬁrst upsampling and then downsampling so that they have the same length as the template. During upsampling interme- diate pixels are calculated using linear interpolation. Before downsampling the signal is ﬁltered to suppress aliasing. The initial template T(t)is then calculated as the mean of all ex- ercises in Xi(t), T(t)=Pk i=1Xi(t) k. (1) Labelled exercises might not only have different length but they might also be shifted in time. Therefore each exercise in Xi(t)is shifted to yield the best alignment to the initial tem- plate T(t). Cross-correlation between T(t)and each exercise Figure 4: Classiﬁcation results: (a) person dependent, (b) person dependent, trained and tested with different exercise sets, (c) person independent leave-one-out cross-validation, (d) person independent classiﬁcation of a complete set of exercises using majority voting. inXi(t)is used to determine how much an exercise should be shifted. The position where cross-correlation is the maximum is where Xi(t)matches T(t)the most. Shifted exercises are padded with the border values. After the exercises have been correctly aligned the template is recalculated using Eq. 1. To further improve the template, each exercise in Xiis compared to the template, and a resid- ual"iis calculated for each instance ias the sum of squared differences between each point in the time series and the tem- plate divided by 2, "i=vuutlX t=1(Xi(t)T(t))2/2(2) where is the standard deviation of the template. Weights wi are calculated as the inverse of the residuals "iand normal- ized to yield a total sum of 1, wi=1 "iPk i=11 "i. (3) Exercises that are better aligned with the template will get a higher weight, and exercises that badly represent the template will get a lower weight. The template is recalculated as a weighted average of all exercises in Xi(t), T(t)=Pk i=1wi⇥Xi(t) k. (4) A template weight wis saved along with the template and calculated as w=1 Pk i=1"i. (5)Template weight is a value representing how good the tem- plate T(t)is. When all exercises are lining up well, the resid- uals are small and the weight is large. A large weight means that the template is a good representation of the exercises. Templates and weights are calculated for each time series in F. Different templates will have different weights depending on how well they represent the exercises. For example push- ups will cause large variation in pressure due to the up-down movement, while the area is the same during the whole ex- ercise. Abdominal crunches on the other hand causes a large change in the area while the change in weight is not as domi- nant. The weights are normalized to 1. A complete template Tof an exercise class is composed of: 1.10 template time-series Ts(t),s2[1,10], one for each time series in F. 2.10 template weights ws,s2[1,10], one for each template time-series. Dynamic Time Warping To detect when a user performs an exercises we compare the incoming data stream with the template exercise. When calculating the distance between two time-series point-wise Euclidean distance is sensitive to both linear and non-linear temporal variation of the time-series. For example if two subjects perform exercises at different tempo matching data points will be temporally misaligned causing a large distance even though the exercises are the same. To overcome this problem we utilize dynamic time warping. Dynamic time warping (DTW) is an algorithm that utilizes dynamic programming to ﬁnd the optimum distance between time series [ 15]. DTW was ﬁrst introduced by the speech recognition community, but it has later also proven to work well in other domains involving human motion [ 6,9,11]. In its simplest form DTW searches for the optimal distance be- tween two time series AandBby constructing a distance matrix D(i, j)=||aibj|| (6) where aiisith element of time series A,i2[1,m], and bj is the jth element of time-series B,j2[1,n]. The optimal warping distance is that shortest accumulated distance path through the distance matrix D(i, j)such that following con- ditions are met: 1.Boundary condition: the path starts at D(1,1)and ends at D(m, n). 2.Monotonic condition: the path will not turn back, i and j indexes never decrease. 3.Continuity condition: the path advances one step at a time, i and j increases by maximum 1 at each step. 4.Warping window condition: the path must stay within a window size rfrom the diagonal. Other constraints has been proposed to further restrict the warping path and to narrow down the search space, but for simplicity we are only using these four. The optimal path can be found using dynamic programming [ 15]. Matching Using Dynamic Time Warping We perform the DTW matching in feature domain F. A win- dow with the same length as the template is moved over the time series of the test subject with 1 sample window step. At each step ⌧, the DTW distance between the time series seg- ment within the window Y(⌧)and the template T(t)is calcu- lated. Since Fhas 10 time-series the DTW is distance calcu- lation is performed in 10 dimensions by using the Euclidean distance norm. Thus the DTW distance matrix becomes, D(i, j)=vuut10X s=1(Ts(i)Ys(j))2. (7) To emphasise the dimensions that contains more relevant in- formation we incorporate the template weights wsin the DTW distance calculations, D(i, j)=vuut10X s=11 ws⇥(Ts(i)Ys(j))2. (8) Before the comparison, both the T(t)andY(⌧)are normal- ized so that the mean is zero and standard deviation is one. The DTW distance depends on the both the template size and the length of the warping length of the distance matrix. To compensate the distance is normalized with the length of the warping path K. By calculating the DTW distance to the tem- plate at every window step we get the distance as a function of time step ⌧. The match µ(⌧)is inverse to the normalized DTW distance, µ(⌧)=dtw(T(t),Y(⌧)) K1 . (9)Counting of Exercises The time series µ(⌧)calculated in the previous section rep- resents how well the test data matches the template at each time step ⌧. Peaks in µ(⌧)represent a good match to the template at that position. To count the exercises we deﬁne a static threshold. Every peak that is crossing the threshold is counted as an exercises. The peak detection algorithm can be described as following: 1.When the signal value is higher than threshold + tolerance, the signal enters a peak area. 2.When the signal value is lower than threshold - tolerance, the signal leaves the peak area. 3.The returned peak position is the highest peak inside the peak area. The tolerance is used to avoid false peaks caused by a noisy signal. A low threshold will lead to higher detection rates but might also introduce false identiﬁcations, while a higher threshold will only detect exercises that are performed ac- cording to the template. In order to be able to compare the results we used the same threshold for every test subject and exercises. To validate that the detection of an exercise is correct, the detected position is compared with the labelled start and end positions of an exercises. If the detected exercises is within the start and end position of the label it is considered as a match. To separate repeated exercises from each other we reduce the label size by 10%. Exercises that are detected in the border between exercises are not counted as match. Two detected exercises cannot be matched with the same label or vice versa. Detected exercises that match a label is consid- ered true positive . Detected exercises that do not match any labels are considered false positives . Labelled exercises that are not detected are considered false negatives . Using this information the precision andrecall can be calculated as, precision =true positives true positives +false positives(10) recall =true positives true positives +false negatives(11) TheF1–score is calculated as the harmonic mean between precision and recall, F1=2⇥precision ⇥recall precision +recall. (12) F1–score is selected as the performance measure for our ap- plication since having few false positives and few false nega- tives are equally important. Template Selection As a ﬁnal step we consider a situation where we have data from many users, each possibly doing the exercise in a Figure 5: Detection rate of exercise counting for each subject and activity using different templates. slightly different way. The question is how to best leverage the variability in the data to facilitate user independent recog- nition that is robust against strong variations in the way test users perform the exercises. We propose to construct differ- ent templates each well suited for a different user type. Given a new user to whom the system should be applied the system should automatically recognize which template is best suited and use it for counting. To this end we calculate the match (the same as used for counting) using all possible templates. We then select the template that has the highest match value during the whole set. Results and Discussion To evaluate the counting algorithm we calculate templates for each exercise and each subject. We then use the templates of one subject to detect exercises performed by the rest of the subjects. We repeated this using every subjects as the tem- plate. F1-score is calculated for each exercise combination of subjects and templates. The results are presented in Figure 7. The x-axis represents different exercises and the y-axis rep- resents the detection score measured in F1-score. Each dot is the resulting detection rate for each combination of sub- jects and templates. Different colors represent score for dif- ferent users with different templates. The core for each user is slightly shifted horizontally for better visibility. The aver- age for each exercises is marked as a white diamond. One can see that most dots are in the top quartile for all exercises. Lunges has an almost perfect detection score for all combina- tion of subjects. This is explainable since the the variation in both speed and style between subjects is very low for this ex- ercise. Biceps curl has lowest recognition score on average. This exercises is performed standing and pressure change is only caused by subtle change in the center of weight while the user moves his hands. The average F1-score for all ex-ercises is 82.8%. With respect to the practicability of user independent training we would like to note two points: 1.A few combinations of templates and subjects have a recognition score under 0.5. This illustrates the fact that there can indeed be strong differences in the way some ex- ercises are performed by different user. Obviously, when the training and testing data come from such user pairs the performance is poor. However, such cases are rare with less than 5% of the points falling into this category. 2.The best case performance for each user is above 90% for most exercises. In other words, for every user there ex- ists at least one other user whose exercise style is similar enough to facilitate good recognition. This suggests that inter user variability is a matter users belonging to a lim- ited number of distinct ”types” rather then each user doing the exercises in a different way. Thus, with a training set that contains all (most) types of user we can achieve good user independent performance and there is no need for user speciﬁc training. Results with Template Selection Achieving good results by having many different user types in the training set requires the ability to pick the best match- ing template for a given test user. The results of applying our template selection method are shown in Figure 6, which con- tains only scores produced using a training template from a user selected by our method. Comparison to Figure 5shows that the average for all exercises improves signiﬁcantly and is over or close to 0.9 in most cases. There are no results be- low 0.5, only 2 results below 0.6 and 3 more below 0.7. Of the 5 results below 0.7, 3 are from the same user who seems to have no well matching user type within the training set (which is quite small with just 7 test subjects). Overall the results are a strong indication that the general approach of us- ing many training users and an automated template selection Figure 6: Detection rate of exercise counting for each subject and activity when using template selection. Figure 7: How ratio between exercise length and template length affects detection performance. is a promising way for building a reliable user independent system. Sensitivity to Speed Variations To investigate if the inﬂuence of different exercise speeds on the accuracy of our system we plot in Figure 7the detection score against the time ratio between template and the average exercise in the set. Different points indicate different com- binations of users used for training and testing, and different colors indicate different exercise classes. We draw regression lines for each exercises class (colored lines), and a second order polynomial regression for all data points (black). We can see that when the ratio increases the performance is go- ing down. However even with a scaling factor if 1.5–2 the detection score for most combinations of subjects and tem- plates lies in the section of 0.7 and above. This is much less than the performance differences that can appear when theusers belong to different ”types” as discussed above. From the graph we can infer that when using a medium speed tem- plate (where the speed difference is less then 1.5 to any other template) scores are hardly affected by the speed. In order to cover an even larger range of different exercise speeds, mul- tiple templates could be used. CONCLUSION The main conclusion of the work presented in this paper is that a textile pressure sensor matrix integrated in a gym-mat is a promising approach for monitoring strength related exer- cises that are performed on the ground. The accuracies that we have achieved (just under 90%) are well within the range typically seen in for example pedometers and could already be a useful practical tool. With respect to practical appli- cations it is particularly important that we have achieved an 89.9% detection accuracy in a fully user independent way by leveraging a combination of DTW template matching and our template selection method. ACKNOWLEDGEMENT This work was partially supported by the collaborative project SimpleSkin under contract with the European Commission (#323849) in the FP7 FET Open framework. The support is gratefully acknowledged. The authors would also like thank all students and colleagues who volunteered as test subjects in our experiments.