## 3 Materials and Methods
### Data Collection  
This research utilized the embedded sensors of a Samsung Galaxy A50 Android smartphone (Samsung Electronics, Suwon, South Korea)--specifically the accelerometer, gyroscope, linear accelerometer, and gravity sensor--to collect uncontrolled data from various human activities, including walking, running, and being stationary, both while using and not using the smartphone. The addition of the linear accelerometer and gravity sensor was investigated to assess whether these sensors significantly enhance classification accuracy compared to using only the accelerometer and gyroscope. The linear accelerometer and gravity sensor are derivatives of the accelerometer, providing additional information about the magnitude and direction of acceleration and gravity, respectively.  
A Graphical User Interface (GUI)-based application was employed to facilitate data collection, recording each volunteer's unique identifier and the time duration for each activity (start and stop times). Data from all activities were collected at a sampling rate of 50 Hertz (Hz), capturing measurements across the X, Y, and Z axes for each of the four sensors (accelerometer, gyroscope, linear accelerometer, and gravity sensor). The gyroscope, initially collecting data at 120 Hz, was normalized to 50 Hz to ensure consistency with the other sensors.  
The study involved eleven (11) volunteers, aged between 20 and 40 years, who were asked to perform a series of basic activities while holding the smartphone in different positions. These activities were categorized into two scenarios:  
**Scenario 1:**: Activities with the smartphone placed in the left or right side pockets (not in use).
**Scenario 2:**: Activities with the smartphone held in the chest position (in use).  
Each volunteer performed a sequence of activities over a period of 7 min. These activities were divided into six categories: walking, running, and stationary (sitting and standing), with the conditions of both using the smartphone and not using the smartphone in a bus stop station setting. Table 1 outlines the specific activities conducted in this study.  
From Table 1, the walking speed in this study is standardized to two steps per second for each window sample. This rate is based on the typical gait cycle of an average, healthy individual who takes approximately two steps per second. Additionally, running is assumed to involve a higher speed compared to walking. For activities such as standing, sitting, or any other stationary actions, these were categorized as stationary actions due to the lack of movement.  
The study evaluates the impact of different sensor configurations on HAR accuracy by analyzing two distinct setups:  
**Two-Sensor Configuration:**: Utilized only the accelerometer and gyroscope to establish a baseline for the effectiveness of these primary sensors in activity recognition.
**Four-Sensor Configuration:**: Incorporated all four sensors--accelerometer, gyroscope, linear acceleration sensor, and gravity sensor--to assess whether the inclusion of additional sensor data enhances the model's activity recognition capabilities.  
Table 2 presents a comparative overview of key smartphone sensors utilized in HAR. Each sensor type has distinct capabilities and limitations that affect its effectiveness in activity tracking. The sensors collectively capture detailed motion data, with accelerometers and gyroscopes being widely used in HAR for their ability to measure linear and angular motion. The addition of linear accelerometers and gravity sensors provides supplementary context, enhancing the system's accuracy by minimizing noise from changes in acceleration. This integration of multiple sensors contributes to more robust and precise activity recognition.