# The Construction of Online Course Learning Model of Ideological and Political Education for College Students from the Perspective of Machine Learning

Authors: Huanhuan Wu; Lingang Ma
Journal: Security and Communication Networks
 (2022)

---

## Abstract

Student behaviour analysis in the classroom is an important part of teaching and educational innovations that can assist the institution find an effective strategy to improve students’ learning efficiency and ability to innovate. In this study, a human behavior recognition system is proposed for monitoring the learning status of students in the course of ideological and political education using the signals of smartphone embedded gravity sensors. A convolution neural network (CNN) is used to automatically extract prominent patterns from the raw signals of smartphone embedded sensors followed by the classification of the seven student activities including walking, going upstairs, downstairs, lying, sitting, standing, and running, respectively. The optimized CNN model was obtained after training on 1,500 training samples of student’s behavior data. The model is evaluated in terms of evaluation metrics such as accuracy, precision, and recall. The proposed model achieved 97.83% accuracy, 97.82% precision, and 97.83% recall, respectively, which are significantly higher than the classification performance of the other recognition models. The proposed model achieved inspiring performance compared to the existing behavior recognition systems. The model of human behavior can obtain the learning state behavior of the students from the college students’ listening equipment, to understand the learning situation of the students.


---

## Body

## 1. Introduction

Students are the driving force behind a country’s future development. With the continuous development of remote online education, the teaching management of college students’ ideological and political education has become a crucial concern for teachers’ online teaching. Changes in teaching methods may have an impact on the quality of instruction as well as the cultivation of appropriate values in students [1]. With the technological development, smartphone sensors are integrated with machine learning (ML) techniques to give a technological route for evaluating the status of students’ online learning and enhancing the quality of instructional management. Smartphone embedded sensors are now being applied in student’s behaviour recognition applications which are opening the gates to new fields of research and considerably affecting our daily life [2].Student learning behaviour recognition has been actively explored using distinct embedded, wearable, and vision-based sensors [3]. In vision-based behavior recognition, most researchers have mainly focused on video cameras as the camera can provide a rich amount of information about the surrounding environment. However, vision-based behavior recognition suffers from the problem of large memory requirements and more computational power. On the contrary, smartphone embedded and wearable sensors are light, small-sized, and can overcome this kind of memory and computational issues and deserve more focus for student behavior recognition in smartphones [4]. In smartphone-based human behavior recognition, the information is commonly collected from embedded sensor signals such as accelerometer and gravity sensors. The collected signals are then preprocessed via ML algorithms to determine the corresponding student action and behavior. Hence, such systems can be implemented in many real-life applications in smart environments such as healthcare systems and smart homes. For example, a smart human behavior recognition system can be used to constantly monitor a student’s ideological and political education learning status [5].Students are the main force in the future development of a country, and their outlook on life is formed during the campus period. With the continuous development of network remote education, the teaching management of college students’ ideological and political education (IPE) online courses has become a key issue for teachers’ online teaching [1]. Changes in teaching methods may affect the quality of teaching and the formation of correct values for students. Many additional sensor functions in smart phones use machine learning (ML) technology and deep learning technology to provide a technical route for understanding the status of students’ online learning and improving the level of teaching management.Many existing behavior recognition systems over the past used acceleration sensors to recognize human activities such as walking on the ground, standing, sitting, running, and lying [6]. Minnen et al. [7] explored the accelerometer signals to identify activities such as drilling, grinding, falling, and sanding. Sun et al. [8] explored position-independent classification schemes separately using a separate classification algorithm for predicting each position and yielded an accuracy of 93%. However, this approach requires high computational resources. The authors in [9] investigated basic daily life activities such as walking, idle, and running using mobile phone sensors with the help of back-end classifiers using accelerometer along with conversation data and reported an overall classification accuracy of 72%. In another approach, human activities such as idle, walking, and running were classified into activity levels using median thresholds which are validated by empirical experimentation [10]. Hussain et al. [11] proposed an activity recognition system using a gyroscope sensor fixed at the shank and used SVM used for activity recognition. The model yielded high accuracy of 98.7% compared to the existing activity recognition systems. Chernbumroong et al. [12] and Gupta and Dallas [13] employed single accelerometers for the recognition of basic activities with classifiers such as k-nearest neighbors (KNNs) and naive Bayes. Sharma et al. [14] used a neural network for the recognition of human activities. Zhang and Ni [15] proposed a learning behaviour recognition model using 3D CNN and achieved the training accuracy up to 83.51% and test accuracy of 69.17%. Majority of the existing systems employed many accelerometers fixed in different places. However, the existing recognition of human behavior has many problems based on multiple sensors, such as the single type of human behavior information, the feature representation of human behavior, and the classification algorithm is too traditional. These problems are mostly caused by the single sensor types and feature extraction methods.In this study, a human behavior recognition system is proposed for monitoring the learning status of students in the course of ideological and political education using a convolutional neural network (CNN) model. This model can acquire in-depth information from multiple smartphone sensor signals, thereby improving the classification accuracy of the overall algorithm. The classification performance of the designed algorithm is compared and evaluated through experiments. The proposed approach was compared with traditional behavior recognition approaches where it outperformed them.The remaining sections of the manuscript are ordered as follows: In Section2, the proposed human behavior recognition method is presented, and the details about the data collection process, ML algorithms, and the experimental setup for the data analysis are provided. The results are illustrated in Section 3, and the conclusion is given in Section 4.


## 2. Methods

### 2.1. Human Behavior Classification

Student’s behavior recognition is a challenging time series classification task. It is comprised of identifying the movement of a student based on sensor signals and usually involves ML methods and algorithms from signal processing to extract prominent features from the raw data to develop an ML model [16]. In general, ML refers to the process by which computers imitate humans to learn new patterns. It explores how to allow the computer to learn the current knowledge independently, then acquire new knowledge, and finally optimize the recognition ability and strengthen the learning effect in the continuous learning process. ML constructs a machine learning for the existing knowledge structure and uses it to classify and predict unknown information. The predicted result is classified, and the machine learning is strengthened [17]. Currently, ML algorithms are generally used in two areas: prediction and classification. The formation and optimization of the predictive machine learning are generally aimed at the currently known information, for example, the economic profitability of the company in a certain quarter is known. By studying and forecasting the profitability of the next quarter, the correlation between the quarter and the profitability is compared, and the current machine learning is optimized [18]. Figure 1 shows several common student’s behaviors of sitting, standing, running, and going upstairs. The student’s lecture information data are obtained using the estimation of the human body posture. The acquired feature value is defined as the classification standard, which is normalized by feature extraction and sent to the machine learning of the classification learning algorithm. Finally, the ML model for identifying student status in IPE online classrooms is constructed through continuous learning of data [7]. Teachers can grasp the learning status of students and strengthen the online management level of students from these data.Figure 1
Student’s behaviors.


### 2.2. Types of ML Algorithms

ML algorithms are artificial intelligence-based techniques that can learn from input data and improve from experience, without human interference. In the ML, several common classification methods are as follows:Decision tree (DT). It is used for solving regression and classification problems. This algorithm creates a training model that can be applied to predict the class or value of the target variable by learning simple decision rules inferred from prior training data. Figure2 shows the general architecture of DT [19].(i)
Artificial neural network (ANN): ANN is made of three layers, namely ,input layer, an output layer, and hidden layers. The input layer is connected to the nodes in the hidden layer and from each hidden layer node with the nodes of the output layer [20]. The architecture of ANN is shown in Figure 3.(ii)
Bayesian classifier: in a Bayesian classifier, the learning module develops a probabilistic model of the extracted features and uses that model to predict new samples. Figure4 is based on the Bayesian classifier [21]. If the correlation probability is denoted as E and F, the principle of the algorithm is shown in Figure 4.(iii)
Support vector machine (SVM): SVM is a binary classification model that is more commonly used. Its classification principle is that the linear classifier maximizes the interval of the data in the feature space. It can also use the kernel function to map the input into a higher-dimensional space for nonlinear classification [22]. When the information is linearly separable, the dataset D is recorded as follows:(1)D=X1,y1,X2,y2,...XD,yD,whereXi and Yi are the category labels. The related linearly separable dataset is shown in Figure 5.Figure 2
Flowchart of decision tree principle.Figure 3
The structure of the neuron.Figure 4
Theoretical diagram of a Bayesian classifier.Figure 5
Linearly separable dataset.The goal of SVM is to find the best line and hyperplane to minimize the classification error on the relevant dataset. In general, SVM uses the interval maximization method to obtain the best line and hyperplane. The linearly separable hyperplane can be expressed as(2)ω⋅X+b=0,where ω is the weight vector and b is the bias. The interval boundaries H1 and H2 defined by this hyperplane are shown in (3) and (4):(3)H1:ω0+ω1x1+ω2x≥21,yi=+1,(4)H1:ω0+ω1x1+ω2x≤2−1,yi=−1.If the training samples fall on the hyperplanesH1 and H2, they are called support vectors. Its essence is to solve the problem of convex quadratic optimization. The objective function can be expressed using the equation as follows:(5)f=min12ω2,yiωTxi+b,i=1...,n.Random forest (RF). It is a supervised learning algorithm that is used for both classification as well as regression. The RF algorithm creates decision trees on data samples and then predicts and selects the best solution employing voting. The specific steps of the RF algorithm are shown in Figure6.Figure 6
Algorithm flow of random forest.When performing classification, RF uses a relative majority voting method to output the classification results. In other words, the predicted result is the marked item with the highest number of votes. If there is a tie with the highest votes, the output will be randomly generated from multiple [23]. Combining the above-mentioned classification methods, the best classification method is used to design the model during feature extraction and classification.


### 2.3. Behavior Recognition Based on Sensor Data

At present, student learning behavior and action recognition is a hot research topic in the field of artificial intelligence. Student’s learning status and behavior recognition techniques have received close attention from researchers in this field along with the rapid development of sensor technology and smart devices. The sensors-based recognition of student’s behavior can be defined by the following examples [24]. If the student’s predefined behavior is represented by the set A, then A satisfies the condition given in (6):(6)A=Aii=1m,where Ai is a specific student’s behavior and m is the type of student behavior. When students perform different behaviors, the sensor readings are different, and the patterns shown are also different. In the specified time period, the reading of the sensor can be expressed by d, d = {d1, d2, …, dt, …, dn}. dt refers to the reading of the sensor at time t. The actual types of student behavior can be expressed as(7)A∗=Aj∗j=1n,Aj∗∈A,where A∗ represents the actual student behavior. The ultimate goal of student behavior recognition is to construct a behaviour recognition model H through a learning algorithm and use model H to predict student behavior. The type of prediction behavior is represented by A’. Mathematically, the learning goal of student’s behavior recognition is to construct a learning model H by minimizing the difference between the predicted behavior type A’ and the actual behavior type A∗. In general, model H will not directly use the sensor reading d as an input item. Before that, the sensor readings are processed. The processing is represented by Φ. The learning objectives are shown as follows:(8)minHΦd,A∗.The process of the sensor-based student behavior recognition model is shown in Figure7.Figure 7
Ordinary student behaviour recognition process.Figure7 is mainly divided into three important processes: preprocessing of sensor signals, feature extraction, and model learning. Combining the mathematical description of behavior recognition with the recognition process, sample d is obtained. The characteristic process is the processing of sensor readings, that is Φd. The learning model H represents the classification algorithm [24].


### 2.4. Smart Phone Sensor Signal Acquisition and Preprocessing

In the data collection experiments, the data were recorded for several behaviors. Five college students including 3 boys and 2 girls participated in the data collection process. All the students were between the ages of 18 and 25. For data collection, the gravity sensor of smartphones was employed, as shown in Figure8. Since the waist is the position of the center of gravity of the human body, its changes can well reflect the movement information of the human body. Therefore, in the process of data collection, the smartphone was fixed at the waist of each individual.Figure 8
Smartphone gravity sensor.During the data collection process, all the students recorded data for several basic behaviors: walking, going upstairs, going downstairs, sitting, standing, lying down, and running. It should be noted that walking, going up and down, and running are performed outdoors. When going up and down the stairs with the mobile phone, the tester needs to ensure that the signal can keep changing smoothly. The time required to collect the three behaviors of sitting, standing, and lying was not less than 10 minutes. The raw sensor signal is rapidly changing between positive and negative peaks. There is also a certain probability that the behavior changes brought about by human behavior will cause the signal of the sensor to change. To improve the accuracy of the recognition model, the collected data were preprocessed, filtered, and segmented using the sliding window segmentation technique. After using appropriate data preprocessing methods, feature vectors need to be extracted. The main purpose of feature vector extraction is to transform the sensor signal into a feature vector of human behavior. In behavior recognition, the most widely used feature extraction methods are time-domain features, frequency-domain features, and time-frequency domain features. Among them, time-domain features refer to features that are related to time in the process of signal change, such as mean, variance, and standard deviation. The frequency domain is the feature extracted after the signal uses Fourier transform [19], such as the spectral density of energy. Time-frequency domain features are generally based on wavelet analysis. The traditional ML method of feature extraction relies heavily on manual feature extraction, which requires a relatively high human experience [25]. It can recognize very different behaviors such as walking and running, but it is difficult to recognize activities having similar patterns. Deep learning is a special kind of ML that can automatically learn unique features from sensor signals and can recognize complex actions. In this study, CNN is used to extract features from the signals of the gravity sensor, combined with related algorithms to complete the recognition of student’s behavior.


### 2.5. CNN Feature Extraction Model

CNNs are a specialized form of deep neural networks. The CNN is comprised of the input layer, multiple alternating convolutional and subsampling layers, and an output layer that is task dependent. The structure of CNN is shown in Figure9.Figure 9
The structure of CNN.The input layer can analyze multidimensional data. The time and frequency of the relevant data are unified when the relevant data are input into the network. The output layer is to output the results of the specific classification problem. The middle layer is divided into three layers: convolution layer, pooling layer, and fully connected layer, respectively.The most important part of the convolutional layer is the convolution kernel. The convolution kernel can also be regarded as a matrix of elements. Different elements will have corresponding weights and bias coefficients. A certain rule is used to scan the input data when a convolution operation is performed. The pooling layer deletes invalid information in the data obtained by the upper layer and reduces the size. There are different types of pooling such as average pooling, minimum pooling, overlapping pooling, and maximum pooling. The first and second types of pooling are widely used. The fully connected layer classifies the information data from the previous layers. In special cases, the average value of the entire parameter value can be used to replace the previous operation. In CNN, the convolution kernel is the most important component. The convolution kernel of the convolution layer can be regarded as an elegant mathematical operation from the input to the feature map. The convolution operation uses the convolution kernel to scan the information. When constructing the CNN feature extraction model, the sensor signals are generally represented as a grayscale image with 28∗ 28-pixel. The sensor data are converted into 2D virtual image data to match the traditional CNN model. This approach unilaterally considers the time characteristics of the data [25]. One-dimensional convolution is used in different dimensions of sensor data. In the first layer of convolution, the input is a one-dimensional sensor signal. One-dimensional signals are calculated by translational convolution, and pooling is used to reduce the spatial scale of features. Figure 10 shows the architecture of the proposed CNN model.Figure 10
CNN multichannel model.In Figure11, the collected sensor data are preprocessed into multichannel input samples. The data characteristics of student behavior are obtained after two convolution kernels and pooling. The output of the fully connected layer is used as the extracted signal feature. The correlation between the same dimensions of different sensor data is considered in the process of acquiring characteristic data of the model. After the first convolution and pooling, the data features are merged and processed. The deep data features are obtained via the second convolution and pooling. When the sample data are convolved, the rectified linear unit (ReLU) function is used as the activation function. This is used to avoid the occurrence of overfitting so that the performance of the model can be improved. The dropout layer is added after the fully connected layer to build the CNN model. The principle is to delete randomly and temporarily some of the neurons in the fully connected layer and keep the input and output neurons constant [25]. The designed model uses the CNN multichannel model as the feature extractor and then outputs the features of the fully connected layer.Figure 11
The recognition accuracy of different classification algorithms.


### 2.6. Experimental Setup

The experiment used a variety of sensor data of smartphones to recognize student behavior. The proposed system was implemented on a personal computer (PC) with 4 GB (Gigabyte) running memory with the operating system as Windows 7; the running platform was PyCharm, and the programming language used was Python. While building the CNN model, Google’s deep learning framework was used to build Tensor Flow. It can be used to build efficient and scalable deep learning models. It is a lightweight software that can run on both PCs and smartphones. The sample of the experiment included seven types of student’s behaviors including walking, going upstairs, going downstairs, lying, sitting, standing, and running. The number of training and testing samples was set to 1,500 and 500, respectively, and the learning rate of CNN was set to 0.001.


### 2.7. Evaluation Metrics

The performance of the student’s behaviour recognition model was evaluated using three evaluation metrics including accuracy, precision, and recall. Classification accuracy is an indicator to measure the overall performance of an algorithm. Precision is the capability of a classifier not to label an instance negative that is positive. Recall rate is an indicator to measure the correct true positive rate. These evaluation metrics are computed as follows:(9)Accuracy=TpnTpn+Fpn,where Tpn = Tp + Tn and Fpn = Fp + Fn.(10)Precision=TpTp+Fp,(11)Recall=TpTp+Fn,where Tp represents the true positive rate, Tn is the number of true negative samples correctly predicted, Fp is the number of negative samples predicted as positive samples, and Fn is the number of positive samples predicted as negative samples.


## 2.1. Human Behavior Classification

Student’s behavior recognition is a challenging time series classification task. It is comprised of identifying the movement of a student based on sensor signals and usually involves ML methods and algorithms from signal processing to extract prominent features from the raw data to develop an ML model [16]. In general, ML refers to the process by which computers imitate humans to learn new patterns. It explores how to allow the computer to learn the current knowledge independently, then acquire new knowledge, and finally optimize the recognition ability and strengthen the learning effect in the continuous learning process. ML constructs a machine learning for the existing knowledge structure and uses it to classify and predict unknown information. The predicted result is classified, and the machine learning is strengthened [17]. Currently, ML algorithms are generally used in two areas: prediction and classification. The formation and optimization of the predictive machine learning are generally aimed at the currently known information, for example, the economic profitability of the company in a certain quarter is known. By studying and forecasting the profitability of the next quarter, the correlation between the quarter and the profitability is compared, and the current machine learning is optimized [18]. Figure 1 shows several common student’s behaviors of sitting, standing, running, and going upstairs. The student’s lecture information data are obtained using the estimation of the human body posture. The acquired feature value is defined as the classification standard, which is normalized by feature extraction and sent to the machine learning of the classification learning algorithm. Finally, the ML model for identifying student status in IPE online classrooms is constructed through continuous learning of data [7]. Teachers can grasp the learning status of students and strengthen the online management level of students from these data.Figure 1
Student’s behaviors.


## 2.2. Types of ML Algorithms

ML algorithms are artificial intelligence-based techniques that can learn from input data and improve from experience, without human interference. In the ML, several common classification methods are as follows:Decision tree (DT). It is used for solving regression and classification problems. This algorithm creates a training model that can be applied to predict the class or value of the target variable by learning simple decision rules inferred from prior training data. Figure2 shows the general architecture of DT [19].(i)
Artificial neural network (ANN): ANN is made of three layers, namely ,input layer, an output layer, and hidden layers. The input layer is connected to the nodes in the hidden layer and from each hidden layer node with the nodes of the output layer [20]. The architecture of ANN is shown in Figure 3.(ii)
Bayesian classifier: in a Bayesian classifier, the learning module develops a probabilistic model of the extracted features and uses that model to predict new samples. Figure4 is based on the Bayesian classifier [21]. If the correlation probability is denoted as E and F, the principle of the algorithm is shown in Figure 4.(iii)
Support vector machine (SVM): SVM is a binary classification model that is more commonly used. Its classification principle is that the linear classifier maximizes the interval of the data in the feature space. It can also use the kernel function to map the input into a higher-dimensional space for nonlinear classification [22]. When the information is linearly separable, the dataset D is recorded as follows:(1)D=X1,y1,X2,y2,...XD,yD,whereXi and Yi are the category labels. The related linearly separable dataset is shown in Figure 5.Figure 2
Flowchart of decision tree principle.Figure 3
The structure of the neuron.Figure 4
Theoretical diagram of a Bayesian classifier.Figure 5
Linearly separable dataset.The goal of SVM is to find the best line and hyperplane to minimize the classification error on the relevant dataset. In general, SVM uses the interval maximization method to obtain the best line and hyperplane. The linearly separable hyperplane can be expressed as(2)ω⋅X+b=0,where ω is the weight vector and b is the bias. The interval boundaries H1 and H2 defined by this hyperplane are shown in (3) and (4):(3)H1:ω0+ω1x1+ω2x≥21,yi=+1,(4)H1:ω0+ω1x1+ω2x≤2−1,yi=−1.If the training samples fall on the hyperplanesH1 and H2, they are called support vectors. Its essence is to solve the problem of convex quadratic optimization. The objective function can be expressed using the equation as follows:(5)f=min12ω2,yiωTxi+b,i=1...,n.Random forest (RF). It is a supervised learning algorithm that is used for both classification as well as regression. The RF algorithm creates decision trees on data samples and then predicts and selects the best solution employing voting. The specific steps of the RF algorithm are shown in Figure6.Figure 6
Algorithm flow of random forest.When performing classification, RF uses a relative majority voting method to output the classification results. In other words, the predicted result is the marked item with the highest number of votes. If there is a tie with the highest votes, the output will be randomly generated from multiple [23]. Combining the above-mentioned classification methods, the best classification method is used to design the model during feature extraction and classification.


## 2.3. Behavior Recognition Based on Sensor Data

At present, student learning behavior and action recognition is a hot research topic in the field of artificial intelligence. Student’s learning status and behavior recognition techniques have received close attention from researchers in this field along with the rapid development of sensor technology and smart devices. The sensors-based recognition of student’s behavior can be defined by the following examples [24]. If the student’s predefined behavior is represented by the set A, then A satisfies the condition given in (6):(6)A=Aii=1m,where Ai is a specific student’s behavior and m is the type of student behavior. When students perform different behaviors, the sensor readings are different, and the patterns shown are also different. In the specified time period, the reading of the sensor can be expressed by d, d = {d1, d2, …, dt, …, dn}. dt refers to the reading of the sensor at time t. The actual types of student behavior can be expressed as(7)A∗=Aj∗j=1n,Aj∗∈A,where A∗ represents the actual student behavior. The ultimate goal of student behavior recognition is to construct a behaviour recognition model H through a learning algorithm and use model H to predict student behavior. The type of prediction behavior is represented by A’. Mathematically, the learning goal of student’s behavior recognition is to construct a learning model H by minimizing the difference between the predicted behavior type A’ and the actual behavior type A∗. In general, model H will not directly use the sensor reading d as an input item. Before that, the sensor readings are processed. The processing is represented by Φ. The learning objectives are shown as follows:(8)minHΦd,A∗.The process of the sensor-based student behavior recognition model is shown in Figure7.Figure 7
Ordinary student behaviour recognition process.Figure7 is mainly divided into three important processes: preprocessing of sensor signals, feature extraction, and model learning. Combining the mathematical description of behavior recognition with the recognition process, sample d is obtained. The characteristic process is the processing of sensor readings, that is Φd. The learning model H represents the classification algorithm [24].


## 2.4. Smart Phone Sensor Signal Acquisition and Preprocessing

In the data collection experiments, the data were recorded for several behaviors. Five college students including 3 boys and 2 girls participated in the data collection process. All the students were between the ages of 18 and 25. For data collection, the gravity sensor of smartphones was employed, as shown in Figure8. Since the waist is the position of the center of gravity of the human body, its changes can well reflect the movement information of the human body. Therefore, in the process of data collection, the smartphone was fixed at the waist of each individual.Figure 8
Smartphone gravity sensor.During the data collection process, all the students recorded data for several basic behaviors: walking, going upstairs, going downstairs, sitting, standing, lying down, and running. It should be noted that walking, going up and down, and running are performed outdoors. When going up and down the stairs with the mobile phone, the tester needs to ensure that the signal can keep changing smoothly. The time required to collect the three behaviors of sitting, standing, and lying was not less than 10 minutes. The raw sensor signal is rapidly changing between positive and negative peaks. There is also a certain probability that the behavior changes brought about by human behavior will cause the signal of the sensor to change. To improve the accuracy of the recognition model, the collected data were preprocessed, filtered, and segmented using the sliding window segmentation technique. After using appropriate data preprocessing methods, feature vectors need to be extracted. The main purpose of feature vector extraction is to transform the sensor signal into a feature vector of human behavior. In behavior recognition, the most widely used feature extraction methods are time-domain features, frequency-domain features, and time-frequency domain features. Among them, time-domain features refer to features that are related to time in the process of signal change, such as mean, variance, and standard deviation. The frequency domain is the feature extracted after the signal uses Fourier transform [19], such as the spectral density of energy. Time-frequency domain features are generally based on wavelet analysis. The traditional ML method of feature extraction relies heavily on manual feature extraction, which requires a relatively high human experience [25]. It can recognize very different behaviors such as walking and running, but it is difficult to recognize activities having similar patterns. Deep learning is a special kind of ML that can automatically learn unique features from sensor signals and can recognize complex actions. In this study, CNN is used to extract features from the signals of the gravity sensor, combined with related algorithms to complete the recognition of student’s behavior.


## 2.5. CNN Feature Extraction Model

CNNs are a specialized form of deep neural networks. The CNN is comprised of the input layer, multiple alternating convolutional and subsampling layers, and an output layer that is task dependent. The structure of CNN is shown in Figure9.Figure 9
The structure of CNN.The input layer can analyze multidimensional data. The time and frequency of the relevant data are unified when the relevant data are input into the network. The output layer is to output the results of the specific classification problem. The middle layer is divided into three layers: convolution layer, pooling layer, and fully connected layer, respectively.The most important part of the convolutional layer is the convolution kernel. The convolution kernel can also be regarded as a matrix of elements. Different elements will have corresponding weights and bias coefficients. A certain rule is used to scan the input data when a convolution operation is performed. The pooling layer deletes invalid information in the data obtained by the upper layer and reduces the size. There are different types of pooling such as average pooling, minimum pooling, overlapping pooling, and maximum pooling. The first and second types of pooling are widely used. The fully connected layer classifies the information data from the previous layers. In special cases, the average value of the entire parameter value can be used to replace the previous operation. In CNN, the convolution kernel is the most important component. The convolution kernel of the convolution layer can be regarded as an elegant mathematical operation from the input to the feature map. The convolution operation uses the convolution kernel to scan the information. When constructing the CNN feature extraction model, the sensor signals are generally represented as a grayscale image with 28∗ 28-pixel. The sensor data are converted into 2D virtual image data to match the traditional CNN model. This approach unilaterally considers the time characteristics of the data [25]. One-dimensional convolution is used in different dimensions of sensor data. In the first layer of convolution, the input is a one-dimensional sensor signal. One-dimensional signals are calculated by translational convolution, and pooling is used to reduce the spatial scale of features. Figure 10 shows the architecture of the proposed CNN model.Figure 10
CNN multichannel model.In Figure11, the collected sensor data are preprocessed into multichannel input samples. The data characteristics of student behavior are obtained after two convolution kernels and pooling. The output of the fully connected layer is used as the extracted signal feature. The correlation between the same dimensions of different sensor data is considered in the process of acquiring characteristic data of the model. After the first convolution and pooling, the data features are merged and processed. The deep data features are obtained via the second convolution and pooling. When the sample data are convolved, the rectified linear unit (ReLU) function is used as the activation function. This is used to avoid the occurrence of overfitting so that the performance of the model can be improved. The dropout layer is added after the fully connected layer to build the CNN model. The principle is to delete randomly and temporarily some of the neurons in the fully connected layer and keep the input and output neurons constant [25]. The designed model uses the CNN multichannel model as the feature extractor and then outputs the features of the fully connected layer.Figure 11
The recognition accuracy of different classification algorithms.


## 2.6. Experimental Setup

The experiment used a variety of sensor data of smartphones to recognize student behavior. The proposed system was implemented on a personal computer (PC) with 4 GB (Gigabyte) running memory with the operating system as Windows 7; the running platform was PyCharm, and the programming language used was Python. While building the CNN model, Google’s deep learning framework was used to build Tensor Flow. It can be used to build efficient and scalable deep learning models. It is a lightweight software that can run on both PCs and smartphones. The sample of the experiment included seven types of student’s behaviors including walking, going upstairs, going downstairs, lying, sitting, standing, and running. The number of training and testing samples was set to 1,500 and 500, respectively, and the learning rate of CNN was set to 0.001.


## 2.7. Evaluation Metrics

The performance of the student’s behaviour recognition model was evaluated using three evaluation metrics including accuracy, precision, and recall. Classification accuracy is an indicator to measure the overall performance of an algorithm. Precision is the capability of a classifier not to label an instance negative that is positive. Recall rate is an indicator to measure the correct true positive rate. These evaluation metrics are computed as follows:(9)Accuracy=TpnTpn+Fpn,where Tpn = Tp + Tn and Fpn = Fp + Fn.(10)Precision=TpTp+Fp,(11)Recall=TpTp+Fn,where Tp represents the true positive rate, Tn is the number of true negative samples correctly predicted, Fp is the number of negative samples predicted as positive samples, and Fn is the number of positive samples predicted as negative samples.


## 3. Results

### 3.1. Classification Performance

To verify the performance of the proposed student behavior recognition model, a comparative study was conducted to validate the recognition of seven types of activities. The optimized CNN model was obtained after training on 1,500 training samples of the activities data. The recognition accuracy of the designed CNN model, CNN-SVM, and CNN-BP algorithms for seven actions in 500 test sets is shown in Figure11.The classification accuracies for each student’s behavior were 98.59%, 98.99%, 99.21%, 100%, 97.10%, 95.60%, 100% recognition accuracy rates for walking, going upstairs, downstairs, lying, sitting, standing, and running, respectively. The recognition accuracy of the three algorithms has reached more than 95%. Therefore, the designed CNN model has better recognition accuracy.


### 3.2. Comparison of Different Algorithm Indicators

To analyze the classification performance of the designed algorithm more objectively, the three different types of models: CNN, CNN-SVM (convolutional neural network-support vector machine), and CNN-BP (convolutional neural network-back propagation) were compared in terms of accuracy, precision, and recall, respectively. The comparative results are shown in Figure12.Figure 12
Comparison of algorithm performance indicators.The proposed model achieved 97.83% accuracy, 97.82% precision, and 97.83% recall, respectively. The highest value of accuracy, precision, and recall achieved by the CNN-SVM model is 96.83%, 96.84%, and 96.83%, respectively, which are lower than the classification performance of the proposed CNN model. As a general feature extraction model, the constructed CNN model is suitable for offline training and online recognition.


## 3.1. Classification Performance

To verify the performance of the proposed student behavior recognition model, a comparative study was conducted to validate the recognition of seven types of activities. The optimized CNN model was obtained after training on 1,500 training samples of the activities data. The recognition accuracy of the designed CNN model, CNN-SVM, and CNN-BP algorithms for seven actions in 500 test sets is shown in Figure11.The classification accuracies for each student’s behavior were 98.59%, 98.99%, 99.21%, 100%, 97.10%, 95.60%, 100% recognition accuracy rates for walking, going upstairs, downstairs, lying, sitting, standing, and running, respectively. The recognition accuracy of the three algorithms has reached more than 95%. Therefore, the designed CNN model has better recognition accuracy.


## 3.2. Comparison of Different Algorithm Indicators

To analyze the classification performance of the designed algorithm more objectively, the three different types of models: CNN, CNN-SVM (convolutional neural network-support vector machine), and CNN-BP (convolutional neural network-back propagation) were compared in terms of accuracy, precision, and recall, respectively. The comparative results are shown in Figure12.Figure 12
Comparison of algorithm performance indicators.The proposed model achieved 97.83% accuracy, 97.82% precision, and 97.83% recall, respectively. The highest value of accuracy, precision, and recall achieved by the CNN-SVM model is 96.83%, 96.84%, and 96.83%, respectively, which are lower than the classification performance of the proposed CNN model. As a general feature extraction model, the constructed CNN model is suitable for offline training and online recognition.


## 4. Conclusions

Recently, there has been an increasing awareness in the research community about using smartphone embedded sensors for student behavior recognition since modern smartphones are prepared with several sensors such as accelerometers, magnetic sensors, and gravity sensors. In this study, a system is proposed for student behavior recognition in learning the course of ideological and political education using the signals of smartphone embedded gravity sensors. Machine learning (ML) techniques such as the CNN model are designed for implicit feature extraction followed by the classification of the seven types of human behavior. The CNN model was fine tuned with hyperparameters, and the optimized CNN model was obtained after training on 1,500 training samples of human behavior data. The performance of the model was evaluated using evaluation metrics such as accuracy, precision, and recall. The proposed model achieved average values of 97.83% accuracy, 97.82% precision, and 97.83% recall, respectively, which are significantly higher than the classification performance of the other recognition models. The proposed model summarized the shortcomings of traditional ML feature extraction and improved the classification accuracy of student behavior recognition and the learning status in the course of ideological and political education.



---

*Source: 4674468-2022-04-08.xml*