5.3.1. Definition

We propose two definitions to depict the accuracy of step counting algorithms and choose the strict definition in our evaluation.

Loose definition: The most intuitive way to evaluate step counting algorithms is to compare the estimated step counts to real step counts. This accuracy was presented by Brajdic in [4] and similar definitions are in [27,44,51]:

$$\frac{\mathcal{C}\_{\text{est}} - \mathcal{C}\_{\text{gt}}}{\mathcal{C}\_{\text{gt}}} \times 100\%$$

where *Cest* and *Cgt* are the counts of the estimated steps and ground truth steps, respectively. However, this criterion does not consider the false positives during step counting, so it is necessary to introduce a strict definition.

Strict definition: In a walking activity with uniform velocity, we manually mark each gait cycle in the sensor data. Normally, the algorithm could only count one step in one gait cycle, but this may not be true. Suppose that *n* steps are counted within one gait cycle, and if *n* > 0, then there is one true positive step and *n* − 1 false positive steps. Considering this situation, we introduce an ROC curve that includes both the false positive rate and true positive rate to evaluate the step counting algorithms.

$$\text{TPR} = \frac{\text{C}\_{tp}}{\text{C}\_{\text{3}^\text{t}}} \tag{4}$$

$$\text{FPR} = \frac{\mathcal{C}\_{fp}}{\mathcal{C}\_{\mathcal{S}^t}} \tag{5}$$

where *Ctp* and *Cf p* are the true positive and false positive counts, respectively; TPR and FPR are the true positive rate and false positive rate, respectively. Note that FPR might be larger than one since *Cf p* > *Ctp* is possible.

Comparison: All SC algorithms in our paper result in finding the local peaks of a signal, and one step is detected if the peaks are larger than the threshold. Figure 8 shows two examples that have four gait cycles. Compared to the ideal case in Figure 8a that each gait cycle only has one peak, Figure 8b still counts four steps, although one step is lost in the third gait cycle. Thus, our strict definition is more comprehensive to evaluate the step counting algorithms.

**Figure 8.** (**a**) Ideal Case of SC Loose definition; (**b**) Bad Case Needs SC Strict definition.

We find that the pattern of the step signal has two different groups, which depends on the placements of the sensor. When the sensor is placed at Foot, FrontPocket, BackPocket and Hand, we could observe one period in one gait cycle of one leg. When the sensor is placed at UpPocket or Hand, we could observe two periods in one gait cycle of one leg because the movement of the other leg also has a period. Based on these observations, we separate the placements into two groups: Group I and Group II.
