An Evaluation of SVM in Hand Gesture Detection Using IMU-Based Smartwatches for Smart Lighting Control

— Hand gesture detection with a smartwatch can be used as a smart lighting control on the internet of things (IoT) environment using machine learning techniques such as support vector machine (SVM). However, several parameters affect the SVM model's performance and need to be evaluated. This study evaluates the parameters in building an SVM model for hand gesture detection in intelligent lighting control. In this study, eight gestures were defined to turn on and off four different lights, and then the data were collected through a smartwatch with an Inertial Measurement Unit (IMU) sensor. Feature selection using Pearson Correlation is then carried out on 36 features extracted from each gesture data. Finally, two sets of gestures were compared to evaluate the effect of gesture selection on model performance. The first set of gestures show that the accuracy of 10 features compared to the accuracy of 36 features is 94% compared to 71%, respectively. Furthermore, the second set of gestures has an accuracy lower than the first set of gestures, which is 64%. Results show that the lower the number of features, the better the accuracy. Then, the set of gestures that are not too distinctive show lower accuracy than the highly distinctive gesture sets. The conclusion is, in implementing gesture detection with SVM, low data dimensions need to be maintained through feature selection methods, and a distinctive set of gesture selection is required for a model with good performance.


INTRODUCTION
A lighting control system for a smart home [1] allows users to control and monitor lights using a smartphone application remotely. The Internet of Things (IoT) application in smart homes has become a disruptive technology and helps automate activities at home. A smart home allows home devices to be connected and controlled by a device or application, usually using wireless technology such as Wi-Fi, Zigbee [2], Bluetooth, or visible light communication (VLC) [3]. A survey on the summary of research on smart home conducted in [4] states that the IoT application on smart homes is the most developed product. The ease of controlling the smart home affects the user experience in interacting with the system.
Many IoT devices are used to control various home devices. Smart devices such as smartphones, smartwatches, smart band, and other wearable devices [5] are in demand by many users. These smart devices can be a solution for smart home control because they already have sensors such as an accelerometer [6] and a gyroscope , often used for smart home control. Research [8] proposes a smart home device control using a smartphone in one application. Useful platforms, such as Blink, are beneficial for developers to create IoT applications [9]. Besides applications, other technologies embedded in smartphones, such as the camera, can also be used [10]. However, currently, smartphones have the highest price among other technology products [11]. The introduction of instructions using speech recognition, such as Google Assistant [12], has interference with noise and speech that are not recognized as words [13]. Based on the shortcomings of the mentioned system, the smart home device control system, especially in smart lighting [1] [3] [9], can still be improved. Based on the above problems, a system is needed to overcome some of the smart lighting control system deficiencies. Wearable devices such as smartwatches are simple and easy to use so that they can be a solution to the above problems, such as in [14] and [15] who succeeded in building a smartwatch to control smart home using hand gestures using an Inertial Measuring Unit (IMU) sensor. Besides IMU sensors, [16] is research that uses an electromyography sensor for hand gesture detection. Besides hand gestures, other technologies can also be embedded in the Smartwatch for smart home control, such as near field communication (NFC) [17]. Support vector machine (SVM) is a method in machine learning that has been widely used for classification. One of the applications of SVM is the classification of signal data such as data obtained from sensors such as accelerometers and gyroscopes.For example,VM has been used to recognize hand gesture by processing data obtained from the accelerometer sensor on a smartphone, which affects the hand gesturewhich is the axis of motion [18]. Research [19] applied SVM to IMU wearables to recognize a hand gesture. Research [20] also used the IMU sensor on a smartphone to obtain gesture data and classified it into a human activity using SVMFinally, rearch [21] used SVM to classify human routine gestures. The four studies used the multi-class SVM. Review comparison can be seen in Table 1.
The solution proposed in this research is to build a smartwatch that can detect gesture and turn it into control commands for smart lighting. This research aims to evaluate the SVM Method in hand gesture detection using IMU-based smartwatches for smart lighting control.
The evaluation created in this research is based on the capability of SVM in classifying different gestures in smart lighting control. Evaluation is also made in The selection of the 36 features extracted from the IMU sensor. Pearson Correlation is used as the feature selection method.

A. System Design
The system built on this research is a smartwatch that can detect hand gestures and classify these gestures into a command to turn on or turn off the lights on the smart home. The system consists of a smartwatch, Wi-Fi, NodeMCU, and lights. The microcontroller used to build this Smartwatch is Wemos D1 Mini. Hand gesture data detected by the IMU sensor is then classified into a command using SVM. Next, Smartwatch and light are connected using Wi-Fi. NodeMCU will receive data from the Smartwatch then turn it into smart lighting control for the smart home. The overall system built is described in Fig. 1. The flow of the system can be seen in Fig. 2. The system works starts from the user wearing the Smartwatch and then making gestures based on the predetermined gestures. The IMU sensor on the Smartwatch will detect this gesture and convert it into digital data used for the classification process. The system will perform data preparation on gesture data to eliminate unnecessary data. The results of data preparation are classified using the SVM model. Then a checking procedure is carried out on the

Control Device
LG G Watch model W100  If the data matches the hand gesture for smart lighting control, the light will turn on, if it does not match, the user will have to make another gesture.

B. Hand Gestures
Hand gestures on a smartwatch are carried out based on the X, Y, and Z axes as illustrated in Fig. 3. The X-axis shows the direction of gesture of the Smartwatch back and forth. The Y axis is the axis parallel to the Smartwatch and shows the direction of gesture of the Smartwatch to the left and right.
Meanwhile, the Z axis shows the direction of gesture of the Smartwatch up and down.
The proposed hand gesture can be seen in Fig. 4. The gestures on the Smartwatch are used for device control on the smart home. The control that is carried out is the command to turn on and off the four lights on the smart home, so that there are eight gestures on the Smartwatch. The Smartwatch will not recognize gestures other than the proposed gesture, or users who do not make gestures according to the proposed gesture cannot interact with smart lighting.

C. SVM Classification
The recognition of hand gestures on smartwatches uses a method called the multi-class SVM. In SVM, a hyperplanes used to separate the data set into several classes [22]. The optimum hyperplane will result in better classification. The optimum hyperplane is a hyperplane that has a maximum margin value. The kernel function used in this research is a polynomial kernel with the following equation.
The SVM classification equation is defined as follows.
Where x, and xi are training data, ai is Lagrange Multipliers. Then in a multi-class SVM, the number of classes is defined as follows.
= arg max ( ) The data is divided into two at this stage of classification, namely the training set and the test set. The training set is used to train the SVM model that is built. Meanwhile, the test set is used to observe the performance of the SVM model being built. The many classes used in this system are the same as the hand gestures defined above, which is eight. The SVM algorithm can be seen as follows.

D. Evaluation Parameters
The evaluation consists of two stages, namely data collection by smartwatches and data training using SVM. The data collection stage was done by inviting volunteers to use smartwatches so that 160 gestures data were obtained. Each data obtained is the volunteer hand gesture data as much as six axes from the IMU sensors. Then the training stage consists of data preparation and evaluation of the SVM algorithm.
Data preparation begins by dividing gestures data into 60% for the training set and 40% for the test set. Then we perform feature extraction based on Pearson correlation. Pearson Correlation (r) is the result obtained by dividing the covariance value by the standard deviation of two variables (x and y). The Pearson correlation equation is defined as follows. obtained. Data normalization is done by standardizing the dataset by eliminating the mean and scaling it to the variance. We use Principal Component Analysis (PCA) to reduce data dimensions. PCA reduces data dimensions to two-dimensional data. This is done for the evaluation process to make it easier.
Evaluation of the SVM algorithm is done by calculating accuracy, precision, and recall values. The calculation of the three evaluation sizes are based on the SVM's confusion matrix. Some of the variables used for evaluation are true positive (TP) represents that positive data is correctly identified; true negative (TN) represents negative data is correctly identified, false positive (FP) represents that negative data is incorrectly identified, false negative (FN) represents that positive data is incorrectly identified.
The accuracy equation is defined as follows.
The precision equation is defined as follows.
The recall equation is defined as follows.
III. RESULTS After successfully collecting 160 gesture data, the next step is to evaluate the SVM classification model that has been built. The confusion matrix is used to obtain the measurement of the performance evaluation of the SVM model such as accuracy, precision, and recall. Feature selection is carried out to determine which features are used to produce high accuracy.   Figure 6 shows the heatmap for the feature selection process. Figure 7 shows the confusion matrix of 10 features and is the result after feature selection is made. The accuracy obtained is 94%. This result is the result of the SVM model that has been built. Then the comparison of accuracy before and after feature selection can be seen in Fig. 8.  Figure 9 shows the results of the SVM classification model training process that has been built. By utilizing the MQTT protocol, the Smartwatch which acts as a server successfully sends commands to turn on or turn off lights to NodeMCU who acts as a client.  Figure 10 shows a list of gestures that can decrease the accuracy of the SVM model that is built so that it is not used even though the user easily memorizes them.  Figure 11 shows a comparison of the SVM classification results based on the type of gesture. Gesture 9-12 in Fig. 10 is a gesture that can reduce accuracy, so it is replaced by gesture 5-8. Gestures 1-8 which provides 94% accuracy, is the highest accuracy and is the final result of this research. This study refers to research [14] regarding smart home control using the IMU sensor on a smartwatch coupled with the SVM classification method. However, apart from that the research mentioned is about the smart home while this research is about smart lighting, this research also tries to emphasize the effect of the feature selection process and the selection of a set of gestures in system performance.
In this study, there are 36 features extracted from the accelerometer and gyroscope data on the IMU sensor. However, t number of these features can cause high dimensional data problems [23]. Therefore, feature selection is applied using the Pearson Correlation method. Based  performance is obtained, namely, the accuracy increases from 71% to 94%.
Research [14] also did not discuss the effect oselecting a set of gestures to the system's performance. Whereas in this study, it appears that the choice of a specific set of gestures can have worse performance than the selection of other sets of gestures. In this study, the choice of a set of gestures that is not optimum has an accuracy value of 64%, which is lower than the accuracy of the gesture selection previously mentioned. This concludes that the choice of the set of gestures affects the performance of the system.
In the study, gesture 3, gesture 5, and gesture 7 have perfect precision and recall values. This is because these gestures have little in common with other gestures. Then gesture 4, and gesture 8 has the lowest precision and recall values. Again, this is because these gestures have a lot in common with other gestures.

V. CONCLUSION
This research succeeded in building a smartwatch that can detect gesture with the IMU sensor and SVM algorithm and convert it into control commands for smart lighting. The evaluation shows that feature selection with the Pearson Correlation method used in this study can improve the performance of SVM in hand gesture detection, increasing the accuracy from 71% to 94%. However, the set of gesture selection has also been shown to affect the gesture detection performance by showing that the choice of other gestures has a lower performance than the stated results.