## Case Study: Product Development
### Modeling
#### 6.2.3 Person's Behavior Recognition  
Beside the auxiliary activity recognition, the core function of the designed system is the classification of normal, suspicious and dangerous behaviors of the subject. To make it possible, we propose to create a fingerprint of ordinary behaviors in a given temporal and spatial environment of a subject's life. Following the stakeholder's constraint, Figure 4 illustrates a layout of the possible living environment, which consists of five rooms, including the bathroom, bedroom, corridor, kitchen and living room. Furthermore, each room could be divided into two or three zones dedicated to specific activities. For example, the bedroom could be divided into two zones; one zone around the bed, where sitting and lying activities are considered as normal behaviors, but longer walking or standing should be considered as suspicious and even dangerous when prolonged. The second zone is located near the entrance to the bedroom and around the closet, where standing and walking activities are normal, but sitting and lying should be indicated as suspicious or dangerous.  
The flowchart of the behavior classification as normal, suspicious or dangerous is presented in Figure 5. Data obtained from the sensors are combined with information about the occurrence, such as the time of day, section of apartment and its zone, then how the current activity is defined and placed in the current activity map. Next, the map is compared with the pattern map of normal behaviors and by means of the machine learning method, and the occurrence is classified.  
The behavior classification method can make use of the advantages of different machine learning algorithms like decision trees, Support Vector Machines (SVM), k-Nearest Neighbor (KNN) and the Behavior Vector, (BV). The authors propose to base the behavior classification on the six-component BV consisting of five components based on collected data, such as Time of Day (ToD), Section of Apartment (SoA), Zone of Activity (ZoA), Form of Activity (FoA), Duration of Activity (DoA), and the sixth component is Class of Behavior (CoB), based on the previous observations of the monitored person.  
The ToD component is measured using the microcontroller's timer and configurable timeframes, which can be adjusted to personal habits and even changes due to seasons. The SoA and ZoA components are determined from the predefined layout of the apartment and estimates of the PDR  
Figure 4: Sketch of an exemplary five-room apartment.  
indoor localization method. The FoA component results from the proposed activity recognition method, and the DoA component is calculated from timings of recognized activity. The timeframe patterns of normal behaviors of CoB components will be adjusted based on observations of three different elderly persons, two females and one male, during their daily activities.  
The behavior is considered as suspicious if its duration exceeds the timeframe of normal behavior up to the 150%. The dangerous behaviors are those that cannot be recognized either as normal or as suspicious behaviors. Table 2 presents the possible states of each component of BV.  
According to the requirements, in the case of suspicious and dangerous behaviors, additional information about the monitored person's heart rate, \(H_{r}\) is required.