**3.6 Remainder alarm for medicine taking routine and camera/pressure mat**

There would be a remainder device. This becomes the third Component of the system. The first is fall detection, the second is activity classification and the third is alarm detection and camera. Given the apartment above, we must use the fall data and the human activity recognition. We should make these assumptions.

1.Non-serious fall is considered a fall. No alarm but warning recorded

2. Sleeping occurs in room A1 or A2. Send alarm if sleeping anywhere else.

3.Laying outside of rooms A1 and A2 should trigger a warning


**Figure 5.** *An illustration of the sample smart house floor plan design.* *Autonomous Update of a Dataset for Anomaly Detection Services in Elderly Care Smart House DOI: http://dx.doi.org/10.5772/intechopen.103953*


These six points are used as the heuristic when identified. Once it is identified then an alarm or warning is evoked. We need to conduct two tests before we send an alarm as a way of avoiding false alarms. Identify the activity and then identify the room and the applicable algorithm's location also establish that Laying is not in an inappropriate room. Furthermore, a delay in the bathroom should trigger a warning. The second algorithm verifies that a fall is not a Laying, and a Laying is not a fall. Once this is established only then can an alarm to send. This could reduce false alarms and increase confidence levels unlike having one algorithm.

#### **3.7 Description of the three algorithms**

Three algorithms are derived to execute the above procedures. Below is the description of the three algorithms pseudocode.


**Algorithm 2**: Sleeping area locator for logical heuristic missed fall prediction.

01: Retrieve sample records from the datasets #1, #2, and #3.

02: train model using standard algorithms and records of the subject person.

03: if the HAR is laying or napping find out which room is activity occurring.

04. If the room is not appropriate for Sleeping quarters, send a warning alarm.

05. If sleep is in the sleeping quarter's location, then move to the waiting stage. 06: end if.

07. Repeat the strategy starting from point 01.

**Algorithm 3**: Medical remainder algorithm, to predict skipping of medicine routine.


Based on the above algorithms, the alarm is triggered as a response. These responses will differentiate possible similar activities (such as laying and falling) before evoking the alarm. As shown in **Table 3**, when the results of the algorithm are as provided in Answer (I) then the Alarm is evoked. If the answers are as in Answer (II) then a warning is logged in a database. Three warnings in a sequence also trigger an alarm.

#### **3.8 Updating training dataset**

The data collected from the senior citizen's sensor is originally not labeled. When a detection process is completed the sensor data would then be assigned a label. Once labeled, then the system would save this information with its given label. After the label is authenticated, this record is then moved to the created dataset for extension of the original dataset. At this point, the system would save the labeled data into a new dataset which is the original dataset plus the new record. The record can then be used in training sessions. This new dataset would have an extra record that more closely represent the person involved. In this case, the training would reflect the subject senior citizen. Below is **Figure 6** showing the systems' flow chart.

In Article [3] similar research is presented. The authors make a comparison of three datasets and look at the performances of different algorithms. In this work, we have compared results from two datasets for the human activity detection algorithms. The results would be fused to reduce the probability of false positive or false negative.
