# An Unsupervised Behavioral Modeling and Alerting System Based on Passive Sensing for Elderly Care
## 8 Behavioral Anomaly and Change Detection
### Anomaly Post-Processing  
Long-term behavioral changes could indicate positive or negative health-status changes, or could be caused by other non-health-related reasons, e.g., a patient being away from home. Therefore, it is necessary to prune the detection results, so that the system only reports health-related negative behavior changes, to mitigate the distraction of caregivers.  
Specifically, we overlap outing detection results with'sleep absence' changes, and could identify one long-term anomaly (the fifth at the top and the fourth at the bottom of Figure 14) to be caused by an outing (family vacation). Thus, it did not need to be reported. Additionally, to distinguish positive and negative changes, we compare the average sleep scores (Section 6.4.2) within a window of 5 days before and after the detected beginning of the change. The long-term anomaly (the second at the top and the third at the bottom of Figure 14) is therefore a positive improvement, but not an issue to be reported. Thanks to the pruning strategy, 4 and 3 instead of 6 changes were reported as alerts in an observation period of 16 months of this patient with each algorithm.  
On the other hand, the first long-term anomaly was detected to begin on 18 May 2019 and 21 May 2019 by each algorithm, and reported 5 days later, which is 5 and 2 days before the hospitalization of the patient (28 May 2019). The second and third long-term anomaly in Figure 14 (top), and the third long-term anomaly in Figure 14 (bottom) illustrate increased sleep duration during the recovery phase after hospitalization. Interestingly, the last long-term anomaly was detected on 17 March 2020 by both algorithms, when the patient started to take naps during the day, meanwhile the night sleep efficiency decreased. After submitting the alert, we received feedback from the user through the care manager that in this case the patient was not experiencing any health issue, the prolonged sleeping was due to the COVID-19 lockdown situation.  
Across the cohort, there were 4 recorded hospitalizations, and 9 recorded hospital visits. Our system using the TCN-based detection algorithm reported 17 long-term change anomalies, among which 1 was confirmed as a sensor failure; 3 alerts were able to predict hospitalization sessions, 2, 5 and 11 days in advance; 2 alerts were detected prior to hospital visits; and 5 were related to negative behavior changes due to the COVID lockdown. For the remaining 6 alerts, we were not able to get confirmation from the users. Although the Isolation Forest-based algorithm reported 12 long-term change anomalies, among which 8 were relevant with either health-condition decline or sensor failure. Overall, using the extracted sleep profile alone, both the TCN and the Isolation Forest-based systems were able to detect 3 out of the 4 hospitalization sessions in advance. Although the Isolation Forest-based algorithm achieved a slightly higher precision (67%) than the TCN-based detection (65%), the latter had shown to be more sensitive to subtle behavior change and thus led to a higher recall (11 relevant alerts). Additionally, the detection rate can be improved by incorporating additional sensors that could provide complementary information of daily activities, e.g., sensors installed in the kitchen (digital power meter, fridge door sensor, presence sensor etc.) for inferring nutrition intake.