## Case Study: Product Development
### System Validation
#### 6.4.3 Behavior Classification  
In general, we distinguish three classes of behaviors: normal, suspicious and dangerous. The behaviors identified as dangerous or suspicious require further dedicated actions. The behavior classification procedure starts with the establishing of pattern database of normal, suspicious and dangerous behaviors. Timeframes of the normal behavior are chosen based on the monitoring of three elderly people, two females and one male, during their daily activities for three days. Based on the observation data, the suspicious behavior timeframes are set between 101% and 150% of the timeframes of the normal ones, whereas the timeframes of dangerous behavior exceed the timeframes of normal and suspicious behaviors. However, some activities in an unusual time or place, e.g., standing on a bed, are considered as suspicious or dangerous situations, independently of their timeframes. The behavior classification training-database consists of more than 1200 situations coded as combinations of five variables: ToD, SoA, ZoA, FoA and DoA, similarly as in Table 4, which consists of examples of normal, suspicious and dangerous behaviors from the data gathered during monitoring tests of volunteers. These examples include the morning teeth brushing, sitting on the floor in the middle of the living room and too long standing in one place during the night. Figure 14: Accelerations in the \(x\)-, \(y\)- and \(z\)-axes and SMV readings during activities: (**a**) lying down; (**b**) getting up. \begin{table}
\begin{tabular}{c c} \hline \hline
**Activity** & **Recognition Accuracy (\%)** \\ \hline Falling & 98 \\ Standing & 94 \\ Lying & 96 \\ Sitting & 92 \\ Walking & 98 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Activity recognition accuracy. The created training database was applied to six different machine learning techniques to establish patterns of normal, suspicious and dangerous behaviors. Using the behavior classification, training-database, the five-fold cross-validation method [42] was applied to evaluate and grade the machine learning techniques. The tested machine learning techniques are: the I and II decision trees, the I and II support vector machines and the I and II k-nearest neighbor classifiers. The I and II decision tree classifiers differ from each other with the maximum possible numbers of splits, which are 20 and 100, respectively. The I and II SVMs differ from each other with the kernel functions, which are linear and cubic, respectively. The difference between I and II KNNs is a distance metric, which is Euclidean and cosine, respectively. Table 5 shows the percentage of overall classification validity and classification validity including normal, suspicious and dangerous behaviors for the tested machine learning techniques. The II decision tree along with I and II KNNs show the highest classification validity; therefore, they were applied for the optimization by tuning their parameters. However, the tuning of I and II KNN classifiers did not lead to improvement of their overall classification validity. Nevertheless, increasing the number of splits up to 140, in the II decision tree classifier, enhances the overall classification validity up to 99.1%. The further increasing of the number of splits did not increase the classification validity. Table 6 shows the confusion matrix for the optimized decision tree with the maximum possible number of splits, up to 140. The behavior classification validity of normal is at a level of 99.1%, suspicious at a level of 98.4% and dangerous at a level of 99.5%. It is noteworthy that only 0.2% of tested dangerous behaviors were classified as normal, which can be treated as a critical mistake, and 0.3% of them were classified as suspicious, which is less critical since the suspicious behavior should be checked anyway. The classification validity of the proposed method can be justified as up to the mark.