Raja Omman Zafar, Yves Rybarczyk (2025). Toward Intelligent Homecare for Older Adults: Deep Learning-Based Activity and Routine Deviation Detection Using SDHAR-HOME Data. In: Human Systems Engineering and Design (IHSED2025): Future Trends and Applications. AHFE Open Access, vol. 198, pp. 485–492. https://doi.org/10.54941/ahfe1006802
The global growth of the older adult’s population highlights the urgent need for intelligent privacy-preserving homecare systems that can monitor daily activities and detect behavioral deviations. We propose a comprehensive framework that combines a Transformer-based deep learning model for human activity recognition with a rule-based, interpretable routine deviation detection system. Leveraging the SDHAR-HOME dataset, which contains multi-sensor time series data from two users, the framework first classifies daily activities using a transformer encoder and then constructs a personalized behavioral baseline to identify deviations such as missed meals, sleep disturbances, and unusual hygiene habits. Results demonstrate high classification accuracy (up to 98.5%) and validate the effectiveness of conventional monitoring methods through detailed visualization and semantic deviation labeling. This dual-strategy framework is particularly suitable for assistive monitoring applications in homecare settings.
The global demographic shift toward an aging population has created pressing demands for advanced homecare solution designed to promote independent living, safety and well-being for older adults (Hu, 2020). As older adults increasingly prefer to live at home, continuous monitoring of their daily activities has become a crucial component of modern assistive technology. However, traditional health monitoring systems require constant human supervision or rely on intrusive technologies such as cameras, raising serious concerns about privacy and acceptability in homecare environments. Therefore, there is a need for an advanced, non-intrusive systems that can passively observe and understand behavior in the home (Canali, 2024) (Wang, 2019).
Human activity recognition (HAR) has emerged as a key technology in this field. By leveraging sensors embedded in smart homes, such as motion detectors, switches, ambient sensors and wearable devices, HAR can infer daily activities such as sleeping, eating, cooking, or taking medication in
real time (Stavropoulos, 2020) (Al-khafajiy, 2019). These activities not only reflect an individual’s lifestyle but are also key indicators of their cognitive and physical health. Therefore, accurate HAR systems have great potential in detecting routine deviation and changes in daily activities that may indicate health deterioration (Li, 2020).
Although deep learning models such as long short-term memory (LSTM) and convolutional neural networks (CNN) have shown excellent performance in the field of HAR, they generally require a large amount of training data and lack interpretability, especially when applied to routine deviation detection (Zafar, 2024; Nikpour, 2025). In addition, many publicly available HAR datasets are limited in scope: they either focus on short- term physical movements (e.g., walking, running) or lack the complexity of real-world multi-user home environments. The SDHAR-HOME dataset addresses these shortcomings by providing two months of labeled activity data (including environmental data and wearable device data) from two users living in a sensor-rich home (Ramos, 2022).
In this paper, we propose a dual-framework solution for smart home care: (1) a Transformer-based deep learning model for accurate and scalable activity recognition; and (2) a transparent, rule-based system for detecting deviations from an individual’s daily activities. The Transformer model processes 30-second windows of multi-sensor time series data and leverages a self-attention mechanism to model temporal dependencies between activities (Luptáková et al., 2022). For daily activity tracking, we employ a lightweight, frequency-aware approach to construct personalized daily activity profiles and flag deviations based on missing or interrupted activity patterns. These deviations were then categorized into semantically meaningful categories (e.g., “missed meals,” “lack of sleep”) to facilitate interpretation.
METHODOLOGY
This study uses the publicly available SDHAR-HOME dataset, collected over two consecutive months in a real-world residential environment shared by two people, a pet and occasional visitors (Ramos, 2022). The dataset integrates three complementary subsystems: a network of non- intrusive environmental sensors (e.g., PIR motion detectors, contact sensors, vibration sensors, temperature and humidity sensors, and a light sensor) a Bluetooth beacon-based indoor positioning system (which estimates each user’s location via an attached wristband) and an activity tracker (which records physiological and motion data, such as heart rate, step count, and gyroscope measurements). The environment incorporates a total of 35 environmental sensors and 7 location beacons, enabling high-resolution multimodal monitoring. Residents self-tag their activities using NFC tags placed at relevant locations covering 18 different daily activities, such as cooking, eating, dressing, showering, sleeping and taking medication. All activities are timestamped and stored in an InfluxDB time series database. The dataset design ensures realistic variability in the data, including visitor noise and pet activity, making it ideal for developing robust HAR and general deviation detection systems.
Toward Intelligent Homecare for Older Adults: Deep Learning-Based Activity 487
Figure 1: Proposed architecture for activity recognition and deviation detection.
For HAR, we propose a Transformer-based deep learning architecture for multi-sensor time series classification (see Figure 1). Each 30-second time window is sampled into 30-time steps, each containing 14 input features. These features include the binary states of environmental sensors, normalized analog measurements and a temporal encoding constructed from sine and cosine transforms. First, a linear projection layer maps the input features to a fixed embedding dimension. The resulting sequence is fed into a stack of multi-head self-attention layers, which capture temporal dependencies between time steps without any distance constraints. Unlike recurrent architectures like LSTM or GRU, the Transformer architecture consists of only a single encoder, enabling parallel computation and improving scalability (Ahmadian, 2024) (Shi, 2024). The final token embeddings are then used to perform a softmax classification on the data, ultimately categorizing it into 19 activity categories.
Daily deviation detection uses an unsupervised, rule-based approach designed for optimal interpretability. Each user’s activity log is chronologically divided into a training set (70%) and a test set (30%). During the training phase, a baseline daily behavior profile is established. This profile records each user’s most common activities, representing their normative behavior. During the testing phase, daily activities are compared against the user’s daily behavior profile to calculate a deviation score, defined as follows:
Matched Routine Activities
Equation reproduced from the original PDF.
(Total Expected Routine)
488 Zafar and Rybarczyk
Higher scores indicate greater deviations from expected behavior. To improve interpretability, missing activities were semantically grouped into human-readable anomaly types, such as “missed meals” (cooking, eating, or preparing simple meals), “not sleeping,” or “poor hygiene” (missed showering, using the toilet, getting dressed). This allows caregivers to understand not only when the deviation occurred, but also what type of behavior was disrupted. Visualizations were generated using Matplotlib and Plotly, highlighting the days with larger deviations and annotating them with the deviation category.
RESULT
This section demonstrates the performance of the proposed system in two parts: a Transformer-based activity recognition model and a rule-based framework for detecting daily deviations. Evaluations are conducted on two users using a custom dataset from the SDHAR-HOME environment. Training showed strong convergence within 10 epochs for both users. For user 1 training accuracy increased from 35.3% in the first epoch to 92.1% in the tenth epoch, with validation accuracy peaking at 94.6%. The validation loss significantly decreased from its initial value of 0.7336 to 0.0750, demonstrating both rapid convergence and excellent generalization (see Figure 2). Similarly, user 2 showed consistent improvement, with training accuracy increasing from 34.5% to 94.2%, and validation accuracy reaching an astonishing 98.8% in the final epoch (see Table 1). The corresponding validation loss decreased from 0.7783 to 0.0256, demonstrating that the model effectively captures the dynamics of user behavior without overfitting.
Figure 2: Accuracy and loss for both user 1 and user 2 over epochs.
Toward Intelligent Homecare for Older Adults: Deep Learning-Based Activity 489
Visual analysis using a normalized confusion matrix illustrates these results. For user 1, most misclassifications occurred in categories with similar environmental triggers: for example, bathroom activities were sometimes confused with showering, and cooking overlapped slightly with eating. However, these off-diagonal values were small and did not significantly impact overall classification accuracy (see Figure 3). For user 2, the confusion matrix exhibited a very clear diagonal structure, indicating very high category fidelity. Categories such as reading, working, meditating, leaving home and entering home all demonstrated perfect precision and recall, highlighting the model’s ability to identify even rare or subtle behavioral events.
Table 1: Sample human systems integration test parameters (Folds et al., 2008).
Table available in the original PDF paper.
F1-Score
No. Training Loss
Validation Loss
Training Accuracy
Validation Accuracy User 1 0.1176 0.0750 0.9208 0.9458 95 User 2 0.1087 0.0256 .09422 0.9877 99
Figure 3: Normalized confusion matrix for both user 1 and user 2.
In addition to accurate activity classification, the system also demonstrated high efficiency in detecting deviations from daily routines. To illustrate the interpretability, we examined the “Missed Meals” category for User 2. This category is triggered when any of the following activities (cooking, eating, simple food preparation) are missing from the day’s activity log. During testing, the variance score was approximately 0.33 across several days, indicating consistent instances of missed meal preparation. This detailed view by category demonstrates how the system facilitates targeted interventions. For user 1 one day had a deviation score as high as 1.0, indicating a complete disruption of daily routines (see Figure 4). On that day, all planned daily activities were not recorded, which may indicate illness, travel, or prolonged sleep. The remaining four were partial deviations, typically involving the omission of one or two key activities, such as taking medication or eating.
490 Zafar and Rybarczyk
These patterns may reflect minor behavioral inconsistencies or changes in daily activities, such as skipping breakfast or staying up late.
Figure 4: Routine deviation by day and types with semantic information.
DISCUSSION AND FUTURE DIRECTION The proposed framework demonstrates the effectiveness of combining Transformer-based deep learning with interpretable, rule-based symbols for human activity recognition and detecting everyday deviations. Unlike classic recurrent neural networks like LSTM and GRU, the Transformer architecture offers a parallelized, attention-driven approach that excels at modeling long-term temporal dependencies in multivariate time series data (Ashish, 2023). The use of a 30-second sliding window and sinusoidal temporal encoding further enhances the model’s ability to capture the precise contextual patterns inherent in daily habits. This design enables the system to learn rich representations from environmental, locational, and wearable sensor inputs without requiring custom features or complex preprocessing.
Results from two users validate the robustness of the proposed approach. For User 1, validation accuracy reached 94.6%, with F1 scores exceeding 0.95 for most activity categories, demonstrating the model’s effectiveness even in complex environments with overlapping activities. For User 2, performance was even better, with near-perfect classification achieved for all activities, demonstrating the model’s adaptability to each user’s specific behavior. The confusion matrix corroborated these results, showing minimal misclassification and clear class separability, especially for transitional actions such as entering and exiting the home. Furthermore, the daily deviation module is effective in identifying both severe and subtle behavioral deviation. Its semantic tagging capabilities (e.g., “missed meal” or “poor hygiene”) make it highly interpretable to caregivers, unlike traditional unsupervised anomaly detectors that lack contextual clarity.
Toward Intelligent Homecare for Older Adults: Deep Learning-Based Activity 491
This system has important practical implications for homecare. Many older adults prefer to age in their homes, but to do so safely, they need systems that can passively monitor their health without invading their privacy (Nordin, 2024). Our approach relies on non-invasive sensors (without cameras or microphones) while still tracking daily habits in detail and accurately. Detecting daily deviations, such as missed meals, forgotten medications, or extended periods of inactivity, can provide opportunities for rapid intervention to prevent health deterioration or emergencies. The explainable nature of the routine monitoring module ensures that alerts can be trusted and acted upon, a critical factor in healthcare and assistive environments (Raja, 2024).
Several improvements are possible in the future. First, expanding the system to accommodate more users and different home configurations will allow us to test its scalability. Second, integrating physiological signals such as heart rate or sleep quality from wearable devices can enrich anomaly detection and provide early indicators of illness or stress (Hosseinzadeh, 2023). One important direction is to integrate this daily deviation detection into digital twin platforms for older adult’s care. In this context, the digital twin serves as a real-time virtual replica of a resident’s daily life, continuously updated by sensor data streams. The HAR module provides activity data, while the deviation detection module monitors adherence to daily habits. Finally, conducting a real-time deployment and usability study involving older adults and caregivers will provide valuable insights into real-world application, user satisfaction and long-term behavioral impact (Raja, 2024).
CONCLUSION
In this study, we proposed a homecare framework that combines a Transformer-based activity recognition model with a rule-based daily deviation detection approach, specifically designed for non-intrusive behavior monitoring in smart home environments. Using the SDHAR- HOME dataset, we achieved high classification accuracy across 19 activity categories, with an F1 score exceeding 0.95 for user 1 and 0.99 for user 2. The Transformer architecture effectively captures complex daily activity patterns by leveraging temporal encoding and multi-sensor input. Furthermore, the deviation detection module provides interpretable summaries of daily activity interruptions, semantically labeled to facilitate caregiver intervention. The framework’s explainability and personalized modeling make it highly adaptable for real-world deployment in assistive living environments. Future work will explore integrating physiological data, expanding to larger populations, and deploying in homecare settings to assess long-term utility.
REFERENCES
Ahmadian S., R. M. F. V. O. M., 2024. A novel physical activity recognition approach using deep ensemble optimized transformers and reinforcement learning. Neural Netw., Volume 173.
492 Zafar and Rybarczyk
Al-khafajiy, M. &. B. T. &. C. C. &. A. M. &. K. H. &. F. M. &. W. A., 2019.
Remote health monitoring of elderly through wearable sensors. Multimedia Tools and Applications, pp. 1–26. Ashish, V. e. a., 2023. Attention Is All You Need. arXiv. B. Nikpour, D. S. a. N. A., 2025. Deep Reinforcement Learning in Human Activity Recognition: A Survey and Outlook. IEEE Transactions on Neural Networks and Learning Systems, 36(3), pp. 4267–4278. Canali S., F. A. S. V. B. A., 2024. Wearable Technologies for Healthy Ageing:
Prospects, Challenges, and Ethical Considerations. J Frailty Aging., 13(2), pp. 149–156. Dirgová Luptáková, I., Kubovˇcík, M. & Pospíchal, J., 2022. Wearable Sensor-Based Human Activity Recognition with Transformer Model. Sensors, Volume 22. Hosseinzadeh, M. K. J. G. M. e. a., 2023. An elderly health monitoring system based
on biological and behavioral indicators in internet of things. J Ambient Intell Human Comput, Volume 14. Hu, R. L. T. T. J. e. a., 2020. Developing a Smart Home Solution Based on Personalized Intelligent Interior Units to Promote Activity and Customized Healthcare for Aging Society. Population Ageing, Volume 13, pp. 257–280. Jindong Wang, Y. C. S. H. X. P. L. H., 2019. Deep learning for sensor-based activity
recognition: A survey. Pattern Recognition Letters, Volume 119, pp. 3–11. Nordin, S. S. S. M. K. E. M. a. B. J., 2024. Digital homecare twin expectations among Swedish social service professionals—A qualitative study. s.l., 13th European Conference for Social Work Research. Qimeng Li, R. G. Y. L. S. H. A. F. S. G. F., 2020. Multi-user activity recognition:
Challenges and opportunities. Information Fusion, Volume 63, pp. 121–135. Raja, O. Z. Y. R. a. J. B., 2024. A Systematic Review of Digital Twin Technology for Home Care. ACM Trans. Comput. Healthcare, 5(4), p. 24. Ramos, R. G. D. J. D. Z. E. G.-G.-B. J. &. L. J., 2022. SDHAR-HOME: A Sensor
Dataset for Human Activity Recognition at Home. Sensors, 22(21). Shi C., L. S., 2024. Human action recognition with transformer based on convolutional features. Intelligent Decision Technologies, 18(2), pp. 881–896. Stavropoulos TG, P. A. M. L. N. S. K. I., 2020. IoT Wearable Sensors and Devices in
Elderly Care: A Literature Review. Sensors (Basel), Volume 20, p. 10. Zafar, R. L. I., 2024. Exploring Advanced Deep Learning Architectures for Older Adults Activity Recognition. Linz, Austria, Springer, Cham, pp. 320–327.
LISTED IN THE AHFE DIGITAL BOOKSTORE CATALOGUE
Explore the complete digital volume
Human Systems Engineering and Design (IHSED2025): Future Trends and Applications
Read this individual research paper free through the original publisher, or explore the full digital proceedings book.
ISBN 978-1-964867-74-8
Explore this ISBN in the AHFE Bookstore ↗Listed in the July 2026 bookstore catalogue; search by ISBN to confirm current availability · Digital book purchase optional