## 2 Materials and Methods
### Pre-Impact Fall Detection During E-Scooter Riding  
#### 2.2.1 Threshold-Based Model  
Two sum vector magnitude (SVM) values, acceleration SVM (ASVM), and angular velocity SVM (GSVM) were calculated from the acceleration and angular velocity data measured by an IMU sensor. The \(x\)-axis represents the anterior-posterior direction, the \(y\)-axis the medial-lateral direction, and the \(z\)-axis the vertical direction.  
\[ASVM=\sqrt{{Acc_{\chi}}^{2}+{Acc_{\gamma}}^{2}+{Acc_{Z}}^{2}} \tag{1}\]  
\[GSVM=\sqrt{{Gy{ro_{\chi}}^{2}}+{Gy{ro_{\gamma}}^{2}}+{Gy{ro_{Z}}^{2}}} \tag{2}\]  
To determine the roll angle, a complementary filter was used, and quaternion operations were applied to solve the gimbal lock problem. To reduce noise, a Butterworth filter was employed with the following specifications: a 2 nd-order low-pass filter with a cutoff frequency of 5 Hz. The filter was applied to data sampled at a rate of 60 Hz.  
Figure 3 illustrates the flowchart of the threshold-based pre-impact fall-detection algorithm for e-scooters. In this context, \(A_{Th}\), \(G_{Th}\), and \(Angle_{Th}\) represent the thresholds for \(ASVM\), \(GSVM\), and roll angle, respectively. A fall was detected when both the acceleration and angular velocity thresholds were satisfied, followed by the angle threshold being met within 0.2 s. The frame satisfying the angle threshold was considered the fall-detection frame. Additional filtering on the angle helps to filter out false positives that might occur during normal riding conditions. Due to the characteristics of e-scooters, which often experience medial-lateral angle changes, the algorithm only considered the roll angle, which related to the anterior-posterior direction.  
\(A_{Th}\) was set in the range of 5 g to 20 g at 1 g intervals, \(G_{Th}\) was set in the range of 50 deg/s to 300 deg/s at 10 deg/s intervals, and \(Angle_{Th}\) was set in the range of 20 deg to 50 deg at 5 deg intervals to determine the optimal thresholds using grid search. The thresholds were determined using data from 16 out of 24 participants, while the evaluation of the algorithm was performed using data from the remaining 8 participants. Accuracy, sensitivity, precision, F1 score, and lead time were calculated as follows:  
\[Accuracy\;(\%)=\frac{TP+TN}{TP+TN+FP+FN}\times 100 \tag{3}\]  
\[Sensitivity\;(\%)=\frac{TP}{TP+FN}\times 100 \tag{4}\]  
Figure 2: The real-road e-scooter driving.  
\[Precision\ (\%)=\frac{TP}{TP+FP}\times 100 \tag{5}\]  
\[F1\ Score=2\times\frac{Precision\times Sensitivity}{Precision+Sensitivity} \tag{6}\]  
\[Lead-time\ (ms)=\frac{Impact\ frame-Detected\ frame}{Sampling\ rate}\times 1000 \tag{7}\]  
where _TP_, _FP_, _TN_, and _FN_ represent true positives, false positives, true negatives, and false negatives, respectively. _TP_ is the number of falls detected as falls, _FP_ is the number of normal driving instances detected as falls, _TN_ is the number of normal driving instances detected as normal driving, and _FN_ is the number of falls detected as normal driving. The lead time is the period between the frame when impact occurs at the ground during the fall and the frame when the fall was detected. A frame refers to a single IMU data measured at a frequency of 60 Hz.