Students Activity Recognition by Heart Rate Monitoring in Classroom using K-Means Classification

ISSN 2443-2555 (online) 2598-6333 (print)©2020 The Authors. Published by Universitas Airlangga. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/) doi: http://dx.doi.org/10.20473/jisebi.6.1.46-54 Students Activity Recognition by Heart Rate Monitoring in Classroom using K-Means Classification Hadi Helmi Md Zuraini, Waidah Ismail, Rimuljo Hendradi, Army Justitia


I. INTRODUCTION
Heart rate monitoring research has started a long time ago. The stethoscope was the first device that created to hear heartbeats of a person [1]. It is being used to hear the heartbeat of a person by a doctor, which still being used in clinics and hospitals. However, there are limitations to utilizing the stethoscope device which can be used in the medical field and hard to record it. In the 20th century, the first electrical device was created which is an electrocardiogram. Then, a wearable device called Heltor monitor being developed where it can record and measures the activity of hearts up to 24 hours. The monitor is small and can be placed in a pocket around the neck or waist. The monitor contains a cable that assigns to five electrodes, which are placed on the different range of the chest [2]. The Holter monitor consists of wires with electrodes attached to the chest where it detects electrical impulse from the heart. This invention has provided a graphical record of the electrical activity where can be used for measuring heart rate.
Continuous development of technologies produces wireless heart rate monitoring. Wearable and wireless devices become popular day by day [3]. The most ideal approach to exchange information from the gadget into the application remotely is by utilizing Bluetooth. Bluetooth [4] is a short-extend, low-power, and minimal effort radiorecurrence based availability standard between convenient or fixed gadgets. It works in the unlicensed 2.4-GHz range, utilizes a recurrence jumping strategy more than 79 channels to alleviate impedance and blurring, and can bolster up to 3 Mb/s in the upgraded information rate mode and the greatest transmission separation of 100 m (however commonly 10 m). Bluetooth technology is greatly related to Internet of Things (IoT) technologies. Internet of Things (IoT) can be defined as small devices that have ability to transfer data through internet or Bluetooth to the cloud or application without interaction of human [5]. Many IoT technologies have arisen in the world of technology where the main purpose is to help and ease human works in daily life. One of the popular examples of IoT technology is the Smart House technology where every electric appliance in the house can be controlled by smartphones such as door lock, refrigerator with Wi-Fi or lamp.
Each person has their own heartbeat in various situations like when happy, exercise, sleep, relaxation, and others. In monitoring the heart rate, we can see the change in the heartbeat depends on their actions. As we can see, there are many technological developments in tracking devices. We tend to check what we do and what the result. Big tech companies have provided some human-friendly devices to track our daily lives [6]. For example, Fitbit, Garmin, Hexiwear even phone company has some from their company such as Honor, Samsung, Apple, and Xiaomi. This device has a common characteristic that will track our body such as our steps, heartbeat, blood pressure, and glucose level. Originally, this kind of monitor only focuses on health and technology mostly being used in hospitals because the price is costly.
Tracking and monitoring when having activities developed devices along with the current technology which is IoT that wearable and wireless. It is convenient for a user to have a tracker that can be used during activities especially in physical activity such as workout, cycling, walking, and others. The most significant of the device is to increase the effectiveness of activity mostly in sports. Evaluating the heart rate during exercise can help to determine either pushing hard or slowing down to achieve the level of fitness that is the best Sleep tracking is an important thing likes exercise tracking to get a better sleep every night and being productive the next day. There are 3 stages of sleep [7], namely light, deep, and rapid eye movement sleep. During the light phase, the heart rate and body temperature will go down after fall asleep. Then, a deep phase occurs when our body repairs from tiredness day before. Rapid eye movement sleep is where the dream occurs, the brain is the most active during this phase. The quality of sleep for humans can examine by heart rate monitoring to ensure that people had better sleep every day.
The study of heart rate does not stop at the medical area only [8], [9]. The way of human can be identified and analyzed the data from monitoring the heartbeat. This paper highlights the anxiety of the students towards learning in the classroom. We are using K-Mean classification in finding the status of the students in the classroom. This paper divided into a problem statement, scope, literature review, methodology, result and, lastly conclusion.

A. Problem Statement
During learning session in the classroom, the focus of the student is very important for the teachers to evaluate the knowledge transfer are through perfectly. The focus can change slightly in various situations. By tradition, the teachers will evaluate in the classroom by monitoring the behavior of each student where the teachers may have biased [10]. The use of evaluation form is not accurate where there are several factors that can exploit either by students or teachers. The study of heartbeat during teaching session in classroom aims to see and observe the anxiety of the students on learning. This kind of measures is unique where every human has their own heart rate rhythms. There are many conditions of students in classroom like sleeping, focusing, inattention and dreaming. Many factors affect the student'sbehavior when learning such as the environment, teacher's teaching and emotion of students.

B. Scope
This a research focuses on studying the anxiety of the students in the classroom based on their heart rates. The wristwatch will be used in this research for measuring the activities of the heart rate of one group of students. The technique uses to monitoring the heartbeat is Photo Plethysmography (PPG) [11]. A device called Hexiwear will be Zuraini,Ismail,Hendradi& Justitia Journal of Information Systems Engineering and Business Intelligence, 2020, 6 (1), 46-54 48 used to record heartbeats of student during having some activities. The data will be collected and analyzed to identify the activity being done. The classification of student's activity is being done by the classification method, decision tree algorithm and K-nearest Neighbor (KNN).

II. LITERATURE REVIEW
In the literature review will explain technology in heart rate monitoring and classification for heart rate in knowing the anxiety of the students.
A. Technology in Heart Rate Monitoring Many technologies for heart rate monitoring have been developed. Technology companies have invested more in research for enhancing this technology. Most of this technology has combined features with connecting to smartphones via Bluetooth [12]. The data from the tracker can directly be sent into the application in our smartphones. There are various ways in monitoring heart rate in daily life. The methods of monitoring have developed years by years. The first method introduced was electrocardiograph in the 20th century [2]. Before any device developed there is a normal way to check the pulse. There are two places to check the carotid pulse at the neck and radial pulse at the wrist. To use these two methods, place the first two fingers at the neck or wrist and selfcount the number of beats. The methods to monitor heart rate are electrocardiograph, Photo Plethysmography, and pressure sensing method.
One of the example of technology is the electrocardiograph (ECG) firstly used in the hospital or medical-related. It will measure the heartbeat from the electrical impulse that generates from our heart and records the electrical activity that passes through the heart. For a doctor, they can detect a change of heartbeat activity through electrical activity behavior in a normal or irregular way. The electrode gets the electrical signs that control contraction and expansion of the heart which will be produced by the heartbeat. The transmitter is the device that detachable consists of a microprocessor that record and track heart rate from electrical signs. The device is placed on the chest where the heartbeats to get a signal [3]. Photo Plethysmography (PPG) mostly used in the new heart rate monitor technology. Photo Plethysmography (PPG) technique being used to detect blood volume change in the microvascular bed of tissue The PPG technique is using a light ray that transmitted into the tissue cell and evaluating the captured light [11]. Optical heart rate monitor known as wearable devices likes smartwatch is the most preferred device to track heart rate nowadays. This device uses PPG methods, by using the light to measure the blood flow. Genuinely, this device will have small LEDs on the below of the tracker that light green color of light to the skin on our wrist. The light radiation will be passed through a blood vessel and the receiving light signal will be periodic and vary depending on the properties of the blood [13]. Before the enhancement of technology, this method was used to measure the heart rate by our finger or earlobe.
There are three types of pressure sensors which are capacitive, piezoresistive, and piezoelectric pressure sensor [14]. The first two are commonly used in measuring blood pressure and a piezoelectric pressure sensor is a dynamic sensor that generates data when pressure is applied. When there is no pressure applied on the sensor, no data will show. The heartbeat of a person depends on the person itself. The rhythmic contraction and relaxation of the heart produce blood pressure change on the walls of the blood vessel which will be the same with the rhythm of the heartbeat. This can be measure by putting pressure or a piezo sensor at the right place of the human body like a finger and wrist.

B. Methods in Classification Data
Data mining can be defined as a method that explores a large volume of information to discover new and unseen information [15]. It is an important part of discovery where new knowledge can be found for the future. Therefore, it needs more time in analyzing data retrieve were using this method it utilizes the techniques and discovers the pattern of the datasets. When getting human data, everyone has different types of data that no specific method being developed to study human data [16]. There are few techniques of classification, namely Decision Tree algorithm and K-Nearest Neighbor algorithm.

C. Decision Tree Algorithm
Decision Tree resolves problems arise from machine learning by changing the data into tree illustration. The nodes will act as a branch of the tree and it will have specific attributes at every node. Decision Tree algorithm is easy to understand despite many nodes that will be created in the algorithm. The creation of nodes will consume more time to execute, even though there will be data normalization and scaling of data does not require [17]. This research examines the emerging role of sensor technology and machine learning in the context of detecting human movements. Recently, simpler and more rapid tests of decision tree algorithm called random forest algorithms have been developed. This method is one of the classification methods where it uses a huge amount of tree structure as an alternative on a single tree structure [18]. Random forest algorithm can also be defined as the improvement of the classification machine learning algorithm [19]. The advantage of using this method is it can be used in solving classification and regression problems but it will consume a lot of time to create the big structure of trees to create the random forest tree algorithm.
D. K-Nearest Neighbour K-Nearest Neighbor (KNN) classification is a method used in clustering or grouping a variable into a certain group. It will use their similarity of a variable to classify them in a group. To use this method, k value has to be specified and the result of the calculation will group the number into the nearest k value. Sensor technology is most beneficial when using the KNN. This is because the type of data from the motion sensor has different characteristics and scattered. In general, after receiving the data from the sensor it can group or identify the activity of the user, images, or audio and mostly can be used in identify groups during health monitoring especially heart disease. The limitation of using KNN algorithm is to set the initial value or benchmark to groups the data into the same characteristic. Moreover, this algorithm is easy to implement but it only can sort numerical data only. Prediction of heart rate disease commonly used K-mean classification in assessing the patient by reading the heart rate of the patient [20]. Using the KNN classification will determine the value of K for the disease to happen at the patient.

III. METHODS
The student's heart rate will be tracked and recorded by the Internet of Things (IoT) device during learning sessions in the classroom. The proposed methodology used K-Nearest Neighbor in the classification of student's anxiety in the classroom. In this research, the devices used in tracking the heart rate is called Hexiwear. Hexiwear is a new wearable device in the IoT era. It is a low-power device packed with sensors that were connected both to devices and to cloud servers far. After the heart rate recorded it will undergo classification to review the anxiety of students in classroom. K-Means classification will be performed at the results of the heart rate study. This research methodology follows the flowchart that can be seen in Fig. 1.
A. Data sets Randomly five students are selected to know to study their anxiety during learning by student's heart rate. The students will wear the device during 3 learning sessions. Participants will wear a heart rate tracker 10 minutes before learning sessions to set their benchmark of normal heart rate. Participants were initiated in wearing the tracker device and setting up the mobile phone apps according to the manufacturer's specifications. The characteristic of each person play big roles in the heart rate measurement. The data were collected and performed the K-Means classification for data analyst of the students' anxiety.

B. Study Procedures and Data Collection
Step 1: Recording the benchmark of normal heart rate The students wear the device to get their normal heart rate. For each student, the result of the normal heart rate will be different depends on the student itself. Since the range of heart rate every person is different, the range of data for every student has to initialize first. A normal heart rate depends on the body, size, heart conditions, and individual. The students will be wearing the heart rate and staying normal to gain their normal heart rate.
Step 2: Monitoring heart rate in learning session The students wear the tracker in the classroom and the monitoring started. All the heart rate data will be sent to the application and recorded in the cloud. Then, the data will be downloaded and put into the system. Hexiwear devices that will be used, is an IoT devices that have an application and cloud to collect and store data.
Step 3: Classification using K-Nearest Neighbor The data will be input into KNN algorithm to find their nearest k which in this case the benchmark heart rate for every student. The benchmark heart rate of every student will be used in classifying student anxiety. The KNN algorithm is shown in equation (1). In this paper, the objective value will classify the anxiety of students during learning sessions into three groups, Table 1, where the following group is created by the benchmark of heart rate by each student.

TABLE1 BENCHMARK OF HEART RATE OF THE STUDENTS
Heart Rate Groups If the heart rate lower than benchmark Sleepy Benchmark Normal If the heart rate higher than benchmark Excited

IV. RESULTS
The heart rate of humans can change slightly to the activity done. The measurement of heart will be taken in the three types of activity in the classroom where the heart rate of sleeping, relaxing, and normal. The heart rate measurement is being taken by the sensor technology. The data will be sent to the application via Bluetooth to the smartphone. The data can be display in the Hexiwear application and ClickCloud cloud, where the data in the cloud is synchronized with the data taken in the application. The data then will be put in the system for lecturers to check their student's anxiety during class time. Simple logins start the system and user can choose their subject.
Zuraini,Ismail,Hendradi& Justitia Journal of Information Systems Engineering and Business Intelligence, 2020, 6 (1), 46-54 51 Student #1 Then the system will illustrate the graph-based on the heart rate measurement taken during the learning session. Fig. 2 show that student anxiety increases in the middle of the learning session. It increases 3 times during the learning session, most of the time the heart rate stays normal. This heart rate measurement was taken during normal learning sessions where the teachers teaching in the front. The heart rate has risen during the end of the class. The student is behaving normally in the class as most of the time the heart rate shown is on normal heart rate.

Student #2
Then the system will be illustrated by the graph, Fig.3, based on the heart rate measurement taken during learning session.  This graph shows that the student anxiety increases in the middle and towards the end of the class. On this day, the class was having a midterm exam, which the student heart rate increases 4 times during the exam session. The heart rate of the student shows he may be not energetic early in the exam then getting nervous in the middle till the end. This rise of heart rate may show that the student struggling or excited in finishing the midterm exam. Student #3 Then the system will be illustrated by the graph, Fig. 4 based on the heart rate measurement taken during learning session. This graph shows that the student anxiety increases on the start of learning session. It increases once during the learning session and maintain it for 20 minutes, towards the middle of learning, the students may feel sleepy so that the heart goes back to normal before slowly getting lower towards the end of learning session. As Fig. 4, shows that the students may feel uninterested during the learning session. Fig. 4 Student #3 heart rate measurement during Class B class at 11.00 am Student #4 Then the system will illustrated by the graph, Fig.5, based on the heart rate measurement taken during learning session.as shown in the graph, the students heart rate normal in the beginning of class before it slightly increase then slowly decreasing. During this class, every student had to present their project in front of the class. He / she may nervous while waiting his turn and during his turn his heart rate increase. After he/she has done the presentation, the heart rate goes downward. He / she may feel tired or sleepy towards the end of the class.

Student #5
Then the system will be illustrated by the graph, Fig. 6, based on the heart rate measurement taken during learning session. The measurement of this heart rate was taken during the seminar in Council Hall. The student heart rate normal, does not have rapidly increasing heart rate. The lowest heart rate taken is 46 which is only once and the highest was 55. In the beginning she may not feel interested, then she gains interest with the topic of the seminar, the heart rate rises, and it's become normal heart rate. This method can improve the evaluation of teaching in the classroom. The student level of interest in learning has a strong relationship in the condition of learning. From the heart rate study, the activity being done in the classroom can be resemblance as a student's interest. Since heart rate is something that natural and no human can control how the heart rate movement. The important factors affecting the measurement of heart rate are the type of activity done and the emotion of the person. This unique measurement may obtain the perfect accuracy on studying the student's interest in the classroom.
Heart rate study in the classroom can change the education world in improving the efficiency of knowledge transfer between student and teacher. This research may act as a basic way of monitoring student behavior in the classroom. The method proposed may only group the student into 3 phases which is relax, normal and active heart rate. Every student has a different heart rate, therefore to classify their heart rate, this method takes an average per 10 minutes to identify students' behavior by using the Hexiwear watch during the classroom. From the heart rate, teachers may be planning their teaching plan to gain interest or more attention of their students. The study also may show the best of teaching plan for students.
This research may play a big role in providing better education in the future. The heart rate studies always focuses on the physical activity, which has become common for every human wearing heart rate tracker during the activity. The study of heart rate also may provide better assist in monitoring students in the classroom.