# Human Activity Recognition Based on Deep Learning Regardless of Sensor Orientation
## 3 Methodology
### Datasets
#### 3.1.1 Our Dataset  
Our dataset was collected to overcome the limitations of publicly available datasets, which lack varied angle information. Data capture was conducted using a single mobile device equipped with an accelerometer and gyroscope and securely positioned on the participant's midsection. The data were captured at a sampling rate of 1000 Hz and subsequently downsampled to 200 Hz. Our dataset was comprised of 31 college students who participated in seven daily activities (Still, Running, Jumping Upward, Upstairs, Downstairs, Cycling, and Walking 50 m). Our data collection platform is shown in Figure 2 as per our prescribed sequence, all while carrying the data-capturing devices. The distribution of our dataset is visually depicted in Figure 3.  
Figure 1: The main workflow of our HAR task.  
Figure 2: Data collection platform.  
Participants were tasked with repeatedly performing these activities while carrying the fixed device at various angle orientations (0, 45, 90, 135, 180, 225, 270, and 315 degrees, as depicted in Figure 4) to collect accurate angular information. We divided the mobile device into eight orientations and fixed it to the front of the user's thigh instead of freely placing it in the user's pocket. After the data collection phase, our dataset was categorized into five distinct groups as outlined below: (a) ACC_0, representing data with only the accelerometer readings at the 0-degree angle; (b) ACC_All, representing data with accelerometer readings from all angles; (c) ACC+GYR_ALL (6D), representing data with accelerometer and gyroscope readings from all angles; (d) Fusioned (3D), representing data with accelerometer and gyroscope readings fused for all angles; and (e) ACC+GYR_ALL_Fusioned (9D), representing data with accelerometer and gyroscope readings fused for all angles and concatenated onto ACC+GYR_ALL.  
The \"ACC+GYR_ALL_Fusioned\" feature requires further explanation. we integrated information from different sensors to provide more accurate estimates, with certain information being filtered or discarded. This information loss was typically used to address the uncertainties and noise associated with sensors. The accuracy and noise levels of the sensors directly impacts the performance of the fusion algorithm; if the accelerometer or gyroscope exhibits significant noise or inaccuracies, then the fused data may be affected by these issues as well. Combining these three types of data can help to comprehensively consider the device's position, motion, and orientation information, thereby improving  
Figure 4: The device angles from **left** to **right**, **top** to **bottom** are 315, 0, 45, 90, 135, 225, 270, 180.  
Figure 3: The zero degree angle sample distributions of our dataset.  
performance on motion recognition tasks. Such a combination offers a more holistic view of information, compensating for potential shortcomings in each sensor's data.  
After the waveform of the sensor data was analyzed, it was deduced that the cycles during participants' motion lasted approximately 0.8 to 1.2 s. Figure 5 portrays an instance of a participant's running waveform. Through careful adjustments, favorable results were obtained by employing a sliding window of 1.5 s with 50% overlapping.