| Literature DB >> 32859035 |
Ojan Majidzadeh Gorjani1, Antonino Proto1, Jan Vanus1, Petr Bilik1.
Abstract
The work investigates the application of artificial neural networks and logistic regression for the recognition of activities performed by room occupants. KNX (Konnex) standard-based devices were selected for smart home automation and data collection. The obtained data from these devices (Humidity, CO2, temperature) were used in combination with two wearable gadgets to classify specific activities performed by the room occupant. The obtained classifications can benefit the occupant by monitoring the wellbeing of elderly residents and providing optimal air quality and temperature by utilizing heating, ventilation, and air conditioning control. The obtained results yield accurate classification.Entities:
Keywords: activity recognition; artificial neural network; classification; deep learning; intelligent buildings; logistic regression; prediction; smart homes
Mesh:
Substances:
Year: 2020 PMID: 32859035 PMCID: PMC7506661 DOI: 10.3390/s20174829
Source DB: PubMed Journal: Sensors (Basel) ISSN: 1424-8220 Impact factor: 3.576
Figure 1Block diagram of the proposed method using logistic regression.
Figure 2Block diagram of the proposed method using artificial neural networks.
Description of activity categories.
| Activity Class | Description |
|---|---|
| Class 1 | Relaxing with minimal movements |
| Class 2 | using the computer for checking emails and web surfing |
| Class 3 | Preparing tea and sandwich—eating breakfast |
| Class 4 | Cleaning the room by wiping the Tables and vacuum cleaning |
| Class 5 | Exercising using stationary bicycle |
List of measured parameters and their unit.
| Sensor | Unit | Range |
|---|---|---|
| CO2 | ppm | 300 to 9999 |
| Temperature 1 | 0 to +40 | |
| Relative humidity sensor | % | 20 to 100 |
Figure 3Inertial Measurement Unit (IMU) worn on a leg.
List of measured parameters using wearable gadgets.
| Parameter | Unit |
|---|---|
| Gyroscope X, Y, Z | deg/s |
| Accelerometer X, Y, Z | g |
| Magnetometer X, Y, Z | μT |
| Barometer | hPa |
Figure 4Example of the logistic function.
Figure 5Example of the developed multilayer perceptron artificial neural network model with 24 neurons input layer, eight neurons in the first hidden layer, four neurons in the second hidden layer, five neurons output layer.
Classification table using dataset A (19 July 2019 interval).
| Class | Observed | Predicted | Percentage Correct | Overall Accuracy | |
|---|---|---|---|---|---|
| 0 | 1 | ||||
| Class 1 | 0 | 273,204 | 2758 | 99.9% | 98.9% |
| 1 | 422 | 19,804 | 97.9% | ||
| Class 2 | 0 | 213,908 | 3764 | 98.3% | 97.4% |
| 1 | 3877 | 74,639 | 95.1% | ||
| Class 3 | 0 | 220,320 | 0 | 100.0% | 100.0% |
| 1 | 2 | 75,866 | 100.0% | ||
| Class 4 | 0 | 243,244 | 5327 | 97.9% | 95.4% |
| 1 | 8209 | 39,408 | 82.8% | ||
| Class 5 | 0 | 223,644 | 1096 | 99.5% | 99.3% |
| 1 | 869 | 70,579 | 98.8% | ||
Classification table using dataset B (26 July 2019 interval).
| Activity | Observed | Predicted | Percentage | Overall Accuracy | |
|---|---|---|---|---|---|
| 0 | 1 | ||||
| Class 1 | 0 | 270,378 | 867 | 99.7% | 99.5% |
| 1 | 640 | 18,829 | 96.7% | ||
| Class 2 | 0 | 213,182 | 3791 | 98.3% | 97.0% |
| 1 | 5068 | 68,673 | 93.1% | ||
| Class 3 | 0 | 216,883 | 95 | 100% | 99.9% |
| 1 | 51 | 73,685 | 99.9% | ||
| Class 4 | 0 | 235,594 | 9914 | 96.0% | 91.2% |
| 1 | 15,720 | 29,486 | 65.2% | ||
| Class 5 | 0 | 212,940 | 1653 | 99.2% | 98.9% |
| 1 | 1535 | 74,586 | 98.05 | ||
Odds ratio.
| Activity Class | Dataset A | Dataset B | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 1 | 2 | 3 | 4 | 5 | |||
|
| Humidity | 0.02 | 0.00 | 0.00 | 0.00 | 0.00 | 1.59 × 103 | 1.03 × 102 | 0.00 | 0.37 | 1.45 × 108 | |
| Temperature | 2.29 × 1062 | 1.40 × 1025 | 0.00 | 3.29 × 103 | 6.66 × 1036 | 1.55 × 1045 | 5.29 × 1028 | 0.00 | 4.45 × 103 | 1.03 × 1011 | ||
| CO2 | 0.94 | 0.89 | 0.31 | 0.86 | 0.71 | 0.12 | 0.99 | 0.00 | 0.96 | 1.05 | ||
|
| Gyroscope | x | 1.00 | 0.99 | 0.94 | 1.00 | 1.00 | 0.99 | 1.00 | 1.05 | 1.00 | 0.99 |
| y | 0.99 | 0.99 | 1.05 | 1.00 | 1.02 | 0.99 | 0.99 | 0.92 | 1.00 | 1.01 | ||
| z | 1.00 | 0.99 | 0.96 | 1.00 | 0.99 | 0.99 | 0.99 | 1.02 | 1.00 | 1.01 | ||
| Accelerometer | x | 4.20 | 0.55 | 7.44 | 1.57 | 0.27 | 4.98 | 0.79 | 0.00 | 1.35 | 0.34 | |
| y | 0.43 | 5.32 | 5.68 × 104 | 2.16 | 0.37 | 2.52 | 1.62 | 5.75 × 105 | 1.23 | 0.28 | ||
| z | 0.09 | 0.18 | 0.00 | 3.17 | 4.97 × 10 | 0.02 | 0.34 | 0.01 | 1.61 | 2.14 | ||
| Magnetometer | x | 0.99 | 0.99 | 1.65 | 1.01 | 0.99 | 0.99 | 0.95 | 1.17 | 1.01 | 1.04 | |
| y | 1.05 | 1.02 | 0.67 | 1.02 | 0.95 | 1.08 | 1.00 | 0.90 | 1.03 | 0.89 | ||
| z | 1.02 | 0.89 | 0.37 | 1.06 | 1.17 | 0.92 | 0.93 | 0.92 | 1.02 | 1.24 | ||
|
| Gyroscope | x | 1.00 | 1.00 | 1.03 | 1.00 | 1.00 | 1.00 | 1.00 | 1.02 | 1.00 | 1.00 |
| y | 1.00 | 1.00 | 1.07 | 1.00 | 1.00 | 1.01 | 1.00 | 1.03 | 1.00 | 1.00 | ||
| z | 0.99 | 0.99 | 1.09 | 1.00 | 1.00 | 0.99 | 1.00 | 1.03 | 1.00 | 1.00 | ||
| Accelerometer | x | 0.06 | 0.67 | 0.35 | 0.08 | 8.07 × 10 | 3.53 | 8.58 | 3.09 | 0.07 | 1.79 × 10 | |
| y | 3.30 | 1.50 × 10 | 1.67 × 10 | 0.14 | 0.14 | 0.01 | 0.19 | 8.01 × 102 | 0.68 | 1.85 | ||
| z | 9.42 | 0.04 | 0.00 | 2.78 × 10 | 1.13 | 0.87 | 3.99 × 10 | 0.08 | 0.05 | 4.28 | ||
| Magnetometer | x | 0.97 | 0.97 | 0.44 | 0.97 | 1.08 | 1.01 | 1.05 | 1.98 | 1.00 | 1.05 | |
| y | 1.08 | 1.067 | 0.235 | 0.967 | 0.939 | 1.024 | 0.969 | 0.662 | 0.987 | 1.01 | ||
| z | 1.00 | 0.96 | 0.86 | 1.01 | 1.08 | 1.11 | 1.07 | 1.66 | 0.99 | 0.95 | ||
Figure 6Training and validation stream developed in IBM SPPSS modeler.
Validation result of training using dataset A (19 July 2019 interval).
| Model | Number of Neurons | Overall Accuracy | Accuracy | |||||
|---|---|---|---|---|---|---|---|---|
| Hidden | Hidden | 1 | 2 | 3 | 4 | 5 | ||
| 1 | 8 | 4 | 99.80% | 99.05% | 99.99% | 99.85% | 99.95% | 99.96% |
| 2 | 16 | 8 | 99.90% | 99.79% | 99.99% | 99.88% | 99.96% | 99.97% |
| 3 | 16 | 32 | 99.99% | 99.81% | 99.99% | 99.91% | 99.98% | 99.98% |
| 4 | 64 | 32 | 99.90% | 99.76% | 99.97% | 99.91% | 99.93% | 99.94% |
| 5 | 64 | 128 | 99.50% | 99.22% | 99.63% | 99.67% | 99.38% | 99.26% |
| 6 | 128 | 64 | 99.60% | 98.92% | 99.83% | 99.68% | 99.74% | 99.64% |
| 7 | 128 | 256 | 96.40% | 96.02% | 96.59% | 96.89% | 97.12% | 94.97% |
| 8 | 256 | 128 | 98.50% | 98.44% | 98.93% | 98.87% | 98.85% | 97.29% |
| 9 | 256 | 512 | 76.40% | 76.48% | 77.04% | 78.08% | 76.81% | 73.26% |
| 10 | 512 | 256 | 82.80% | 83.98% | 82.30% | 83.84% | 82.94% | 80.06% |
| 11 | 512 | 512 | 73.10% | 74.52% | 71.98% | 73.63% | 71.9% | 73.4% |
Validation result of training using dataset B (26 July 2019 interval).
| Model | Number of Neurons | Overall Accuracy | Accuracy of Validation Partition | |||||
|---|---|---|---|---|---|---|---|---|
| Hidden | Hidden | 1 | 2 | 3 | 4 | 5 | ||
| 1 | 8 | 4 | 99.70 | 99.20% | 99.97% | 99.78% | 99.71% | 99.73% |
| 2 | 16 | 8 | 99.80 | 99.81% | 99.90% | 99.91% | 99.71% | 99.63% |
| 3 | 16 | 32 | 99.90 | 99.70% | 99.97% | 99.92% | 99.94% | 99.95% |
| 4 | 64 | 32 | 99.80 | 99.66% | 99.89% | 99.91% | 99.76% | 99.67% |
| 5 | 64 | 128 | 99.50 | 99.56% | 99.62% | 99.79% | 99.43% | 99.02% |
| 6 | 128 | 64 | 99.50 | 99.43% | 99.78% | 99.7% | 99.45% | 99.27% |
| 7 | 128 | 256 | 96.70 | 97.50% | 96.55% | 96.74% | 97.21% | 95.38% |
| 8 | 256 | 128 | 98.50 | 98.53% | 98.69% | 98.95% | 99.07% | 97.04% |
| 9 | 256 | 512 | 76.40 | 77.13% | 81.02% | 73.32% | 75.54% | 75.47% |
| 10 | 512 | 256 | 83.30 | 84.31% | 85.28% | 80.45% | 84.27% | 82.52% |
| 11 | 512 | 512 | 74.00 | 73.75% | 75.70% | 70.20% | 75.69% | 74.00% |
Figure 7Predictors importance for model 3 trained with dataset A (19 July 2019 interval).
Figure 8Predictors importance for model 11 trained with dataset A (19 July 2019 interval).
Figure 9Scoring stream built in IBM SPPSS modeler.
Scoring result of training dataset A (19 July 2019 interval) and evaluation dataset B (26 July 2019 interval).
| Model | Neurons | Accuracy of Each Activity Class | |||||
|---|---|---|---|---|---|---|---|
| Layer 1 | Layer 2 | 1 | 2 | 3 | 4 | 5 | |
| 1 | 8 | 4 | 93.30% | 94.26% | 73.82% | 47.23% | 84.45% |
| 2 | 16 | 8 | 93.30% | 25.36% | 73.82% | 64.37% | 84.45% |
| 3 | 16 | 32 | 93.30% | 25.36% | 73.82% | 25.37% | 84.45% |
| 4 | 64 | 32 | 93.30% | 74.64% | 73.82% | 25.53% | 84.42% |
| 5 | 64 | 128 | 93.30% | 77.17% | 75.37% | 25.47% | 84.44% |
| 6 | 128 | 64 | 93.30% | 71.41% | 73.02% | 25.37% | 84.45% |
| 7 | 128 | 256 | 6.81% | 46.69% | 73.64% | 25.58% | 30.11% |
| 8 | 256 | 128 | 93.30% | 82.13% | 41.33% | 25.39% | 84.45% |
| 9 | 256 | 512 | 89.21% | 40.60% | 50.34% | 34.60% | 40.89% |
| 10 | 512 | 256 | 92.94% | 25.42% | 68.58% | 41.13% | 84.26% |
| 11 | 512 | 512 | 30.37% | 30.83% | 74.14% | 35.67% | 63.93% |
Scoring result of training dataset B (26 July 2019 interval) and evaluation dataset A (19 July 2019 interval).
| Model | Neurons | Accuracy of Each Activity Class | |||||
|---|---|---|---|---|---|---|---|
| 1 | 2 | 1 | 2 | 3 | 4 | 5 | |
| 1 | 8 | 4 | 50.83% | 88.64% | 75.88% | 63.5% | 83.92% |
| 2 | 16 | 8 | 93.17% | 98.51% | 75.88% | 67.11% | 96.2% |
| 3 | 16 | 32 | 81.21% | 88.59% | 75.88% | 55.81% | 76.11% |
| 4 | 64 | 32 | 27.6% | 88.79% | 75.88% | 66.03% | 68.66% |
| 5 | 64 | 128 | 82.01% | 82.30% | 75.88% | 77.77% | 44.14% |
| 6 | 128 | 64 | 77.94% | 92.65% | 75.88% | 73.02% | 50.21% |
| 7 | 128 | 256 | 17.71% | 49.58% | 75.71% | 26.85% | 44.48% |
| 8 | 256 | 128 | 22.60% | 85.72% | 75.87% | 64.71% | 30.62% |
| 9 | 256 | 512 | 40.22% | 44.92% | 50.45% | 49.82% | 63.95% |
| 10 | 512 | 256 | 33.51% | 13.1% | 77.95% | 52.3% | 29.81% |
| 11 | 512 | 512 | 70.2% | 78.37% | 48.53% | 56.77% | 33.39% |