1. Introduction
Recent advancements in sensor technology and machine learning have highlighted the importance of sensor-based behavior analysis in various fields, including healthcare and sports science, where understanding individual behavior patterns is critical. Behavior analysis has applications ranging from daily activity monitoring to complex behavior recognition. However, traditional sensor-based analysis methods face limitations in accuracy and reliability due to the limited quantity and complexity of available data. Therefore, novel approaches to improve the quantity and quality of data are required. This study proposes K-equidistant partitioning (K-EP), a novel data augmentation method, to address the quantitative limitations of sensor data and enhance model robustness. This method is based on key findings from sensor-based activity classification research. Previous studies have demonstrated that a sampling frequency between 20 and 50 Hz provides sufficient data for behavior classification [1-6]. Therefore, the sensor minimum warranted frequency (SMWF) hypothesis is proposed, which posits that when the sampling frequency exceeds a certain optimal value, the collected behavioral features are sufficiently represented, and a further increase in frequency does not considerably affect the performance of the behavior classification model. K-EP involves dividing sensor data rows at equidistant intervals and extracting information from each row, thereby increasing the dataset size by a factor of K. This method aims to overcome the limitations of existing data analysis methods and enable accurate behavior recognition.
2. K-Equidistant Partitioning
K-EP is a data augmentation method designed to preserve the temporal and frequency characteristics of the original data to address quantitative limitations. Traditional data augmentation methods involve artificially adding, transforming, and generating data similar to the training data or approximating the data distribution using techniques such as generative adversarial networks and variational autoencoders. However, these methods can potentially alter or lose the characteristics of the data. K-EP processes data while preserving the data characteristics, thereby minimizing the loss of data characteristics and maximizing the retention of information from the original data.
The core principle of K-EP is to partition sensor data into K equidistant intervals and extract information from each segment, thereby increasing the dataset size by a factor of K. In this process, the sampling frequency is based on the minimum frequency changes detectable by the artificial intelligence model. For example, just as the human eye cannot detect rapid movements beyond approximately 60 Hz, the proposed method is based on the concept that additional information beyond a certain frequency does not substantially contribute to behavior classification. The proposed method is based on the SMWF hypothesis, as described in Section 1.
Example of data partitioning using K-EP with K = 2 and K = 3.
K-EP involves three stages: K selection, partitioning, and synchronization. First, the value of K is set to minimize the loss of sensor data characteristics during partitioning. Specifically, K is determined considering the SMWF to divide the dataset while minimizing changes in characteristics. In this study, the SMWF was set to 20 Hz based on previous behavior classification research demonstrating that classification model performance decreases at frequencies below 20 Hz. Second, in the partitioning stage, part of the original data is allocated to each equidistant interval, thereby artificially expanding the data while ensuring that the augmented dataset is generated within the range satisfying the SMWF and preserves key data characteristics (Fig. 1). Finally, the synchronization stage consists of merging and training using the original data. This involves adding K empty rows between data segments to which K-EP has been applied, followed by interpolation [7], to ensure that the divided data segments have the same size as the original data. Synchronization is a critical step for ensuring data consistency.
3. Dataset Configuration and Preprocessing Methods
3.1 Dataset
This study employed a dog behavior dataset from Kaggle, containing data collected at a sampling frequency of 100 Hz from 45 medium-to-large dogs equipped with accelerometers and gyroscopes mounted on their necks and backs [8]. The dataset was categorized into six postures and 17 behaviors. For experimental efficiency, these postures and behaviors were grouped into six primary categories: standing, sitting, lying down, walking, playing, and sniffing. Table 1 provides detailed definitions of each category.
3.2 Data Preprocessing
Data preprocessing was performed separately for each participant to account for variations in maximum movement due to size and weight differences.
Outlier removal: Sensor data may contain outliers due to sensor errors or external factors. These outliers can distort the general pattern of the data, and including them in model training can negatively affect performance. Therefore, the interquartile range (IQR) was employed to detect and remove outliers. The IQR, defined as the difference between the first quartile (Q1) and the third quartile (Q3), represents the middle range of the data (Fig. 2). Values less than 1.5 IQR below Q1 or more than 1.5 IQR above Q3 were considered outliers and removed.
Interquartile range (IQR).
Data normalization: Data normalization was performed to adjust all features to the same scale, preventing any single feature from disproportionately influencing model training. This step is particularly important when handling data with different units or ranges. In addition, data normalization can increase the convergence speed of machine learning algorithms and reduce local minima problems. In this study, MaxAbsScaler was employed for data normalization, dividing the data by the absolute maximum value of each feature and adjusting all values within the range of −1 to 1. This method is particularly effective when the data distribution is not distorted by extreme values that are far from the median. MaxAbsScaler preserves the data distribution while scaling all features to a uniform range, thereby facilitating efficient training of the deep learning model.
Data sequence generation: Data sequence generation is a critical preprocessing step for time-series data. In this study, the sensor data consisted of continuous multisensor measurements over time, which needed to be converted into a format suitable for processing by deep learning models. In the data sequence generation process, each sensor measurement was segmented based on a predefined time interval, called a window. This window determines the amount of data received by the model at once. For example, a window length of 200 signifies that the model processes 200 consecutive data points per sequence. In this study, the window length was set to 2 seconds, resulting in data sequences with a length of 200 (Fig. 3).
(a) Before and (b) after data processing.
4. Experiment and Results
4.1 Training Dataset Construction
Table 2 presents the training data employed in this experiment. For experimental and evaluation purposes, the dataset was split into training, validation, and test sets in a 6:3:1 ratio.
4.2 Experimental Environment and Methods
Performance evaluation method: The F1-score, which is the harmonic mean of precision and recall, provides a comprehensive assessment of the effectiveness of a model by considering both the number of true positives and the total number of predicted positives. It is particularly useful for binary and multiclass classification, serving as a robust indicator of overall model performance:
Experimental procedure: All experiments were conducted under identical conditions using the ResNet-18 model trained for 30 epochs.
1) Experiment 1: Determining the optimal K
This experiment evaluated the effect of different K values on the performance of K-EP. Values of K = 2, 3, 4, 5, and 10 were tested, corresponding to sampling frequencies of 50, 33, 25, 20, and 10 Hz, respectively. Examples of data for each experiment are presented in Fig. 4.
Example of K-EP with K = 3.
2) Experiment 2: Performance comparison with other augmentation methods
In Experiment 2, the performance of K-EP was compared with that of other common augmentation methods for sensor data, such as reversing, inverting, jittering, rotation, time warping, and permutation. This comparison evaluated the effectiveness of K-EP from multiple perspectives, thereby strengthening the results of this study.
3) Experiment 3: Conclusions
In Experiment 3, the performance of models trained on datasets with and without K-EP augmentation was compared and analyzed, using the same augmentation methods as in Experiment 2. This experiment aimed to assess the impact of K-EP augmentation on the generalization ability of the model. In K-EP augmentation, K was set to 5 as it yielded the best performance in Experiment 1.
4.3 Experimental Results
4.3.1 Experiment 1
The optimal value of K for K-EP was determined using two methods: using only K-EP-augmented data and combining K-EP-augmented data with the original data. Table 3 presents the results.
Best results are highlighted in bold (Kep-only and original+Kep models).
Key observations from Experiment 1 are as follows:
1) Datasets augmented with K-EP consistently achieved higher F1-scores than the original datasets, highlighting the role of K-EP in improving model performance.
2) The SMWF hypothesis was experimentally validated, demonstrating that data quality was preserved when the sampling frequency met the minimum threshold.
3) K-EP-augmented datasets resulted in improved model performance when combined with the original datasets. For example, combining the original dataset with the dataset augmented by K-EP with K = 3 considerably increased the F1-score from 0.8680 to 0.8803.
4) The dataset augmented by K-EP with K = 10 achieved a higher F1-score than the original dataset. However, the sampling frequency was reduced to 10 Hz, which did not meet the SMWF threshold. The loss graph in Fig. 5 displays a sharp increase in validation loss, indicating insufficient generalization ability of the model. Therefore, when K-EP is applied with a sampling frequency below the SMWF threshold, essential characteristics of the original sensor data may be lost.
Training and validation loss graph: (a) origin, (b) 5-EP, and (c) 10-EP.
4.3.2 Experiment 2
Most augmentation methods led to minimal improvements in model performance, with the exception of the windowing and permutation methods, which led to considerable improvements. However, compared with the augmentation methods frequently employed in artificial intelligence research utilizing sensor data, K-EP exhibited superior performance (Table 4).
Top three results are highlighted in bold (among different augmentation methods).
4.3.3 Experiment 3
The results of Experiment 3 indicated that the model trained on the dataset augmented using methods other than K-EP achieved an F1-score of 0.9307. In contrast, the model trained on the dataset augmented using K-EP achieved an F1-score of 0.9541, demonstrating considerable improvement in model performance. These results suggest that K-EP played a crucial role in enhancing the predictive performance of the model. Notably, the model trained on the K-EP-augmented dataset exhibited lower validation loss (Fig. 6), a key indicator of model robustness. A lower validation loss indicates a better ability of the model to generalize to test data, a reduced risk of overfitting, and more stable overall performance. These results indicate that K-EP can improve the generalization ability of the model.
Training and validation loss (upper) and performance graphs (lower).
5. Conclusion
Datasets augmented by K-EP consistently achieved higher F1-scores than the original datasets, demonstrating the effectiveness of K-EP in improving model performance. In addition, the SMWF hypothesis was experimentally validated, confirming that K-EP preserved essential sensor data characteristics while increasing the dataset size. Furthermore, K-EP enhanced the model’s generalization ability, indicating its potential to greatly improve performance and providing a solid foundation for future research.
Because K-EP augmentation was applied by a factor of K to all classes, the amount of data for the Walk class was, on average, twice as much as for other classes, potentially introducing data bias that may have negatively affected the model. To address this problem, additional experiments will be conducted in future studies.
Conflict of Interest
The authors declare that they have no competing interests.
Funding
This work was supported by the National Research Foundation of Korea (NRF) grant funded by the Korea government (MSIT) (No. NRF-2021R1A2C2011966).