# Theoretical Model and Implementation Path of Party Building Intelligent Networks in Colleges and Universities from the Perspective of Artificial Intelligence

Authors: Jiwei Wang; Man Dang
Journal: Mobile Information Systems
 (2022)

---

## Abstract

The paper aims to promote the growth of party building work in colleges and universities to improve school party organization, team management and strengthen party member ideological construction and overall party quality. We design intelligent party member business knowledge learning classrooms using deep learning to improve the quality of party members. First, we develop a convolutional neural network (CNN)-based classroom face recognition system and improve its loss function using the associated theory of the Visual Geometry Group 16 (VGG-16) model. Then, using the Single Shot Multi-Box Detector (SSD), we establish a classroom standing behavior identification system. The experimental results demonstrate that the accuracy rate of the conventional VGG-16 in the face recognition system is 93.5%, while the upgraded VGG-16 is 96.5%, with a 3.2% increase over the baseline models.


---

## Body

## 1. Introduction

Intelligent classrooms in colleges and universities can significantly aid in the education and training of party members. Smart classrooms have brought new methods and ideas to China’s party-building work as the Internet has grown. Carrying out the informatization of party building activity is an efficient method of exploring new ideas [1]. The use of information technology to educate party members at colleges and universities has facilitated grassroots party building and enhanced the quality of efficient party-building [2]. Smart Class can analyse the students’ overall learning situation and the teacher’s teaching level based on their conduct in the classroom. The rational application of artificial intelligence (AI) to analyse student behavior in the classroom has significant research value. Deep learning has made significant progress in recent years, as has AI technology. The convolutional neural network has produced excellent results in image processing [3]. In terms of class behavior identification, the combination of AI and class still has a lot of room for development and prospects.Recently, there have been various efforts toward smart education [4, 5]. Building an intelligent learning platform can master a student’s learning status using mastered student data and provide students with accurate learning suggestions and learning support [6]. It is possible to anticipate the learning results of a student. Hu et al. [7] highlighted the impact of teaching conduct in the classroom. Li et al. [8] proposed a method for recognizing faces that combines local binary patterns with an embedded Hidden Markov Model (HMM). They subject the input facial image to local binary preprocessing. The feature vector is then extracted. The derived feature observation vector is then transmitted to the embedded HMM for training or recognition [8]. Werghi et al. [9] introduced a new method for 3D face recognition based on the fusion of form and texture local binary patterns on the grid. Wen and Yang [10] investigated the use of two-dimensional and one-dimensional discriminant analysis in face recognition and developed a two-stage framework. Earlier efforts on dimensionality reduction and classification first turns the input image into a one-dimensional vector, which ignores the underlying data structure and frequently results in a small sample size problem.Sajjad et al. [11] used the Viola-Jones algorithm to detect human faces. The oriented gradient histogram feature and the support vector machine classifier for facial recognition. They also used a lightweight CNN to recognise facial expressions. Knoch et al. [12] proposed automatically detecting material picking and placement in the assembly workflow. They gathered accurate data about human behaviour and provided flexible support for the interaction of humans and processes. Liu et al. [13] introduced a novel strategy that combines artificial characteristics with deep learning. They used Yolo v4 to extract critical points from time series of the human body’s three-dimensional skeleton and the Meanshift target tracking technique. The critical points are then transformed to spatial RGB and placed in a multi-layer CNN for recognition. Shi-wei et al. [14] proposed a method for recognizing human behavior based on the Pyramid Histogram of Oriented Gradients (PHOG). The fusion of features and multi-class Adaboost classifiers is used to overcome the problem that the types of energy images are easily changed by the time and position of human motion (that is, it is difficult to represent the intricacies of human activity). Batchuluun et al. [15] proposed a fuzzy system-based behavior recognition technology. They integrate prediction and recognition of behavior. Zou and Gofuku [16] examined the running status using video analysis methods. They proposed a behavioral coding method for MCR operator feature extraction and employed timeline analysis to continually sample the operators’ gestures and motions. To identify operator behavior, the Open Pose algorithm and Spatial-Temporal Graph Convolutional Networks (ST-GCN) were utilized. ST-GCN can use body language to assess the operator’s level of consciousness and cognition. It can be used to assess mental stress as one of the performance influencing elements. Timeline analysis is used to continuously sample the operator’s gestures and movements. The Open Pose algorithm and Spatial-Temporal Graph Convolutional Networks (ST-GCN) have been used to identify operator behavior. ST-GCN can analyse the operator’s level of consciousness and cognition using body language. It can be used to assess the level of mental stress among performance shaping factors [16].The research on Smart Class is becoming more in-depth as science and technology advance. Face recognition and behavior recognition technology is also continually evolving. We propose a smart class that, when combined with CNN algorithms, can provide effective data analysis for classroom teaching activities, teaching content creation, student learning methodologies, and so on. It also offers suggestions for the advancement of intelligent education.


## 2. Materials and Methods

### 2.1. Convolutional Neural Network

It is quite easy for students to obstruct each other’s behavior in the packed environment of the classroom. Students have a limited number of activities in class, and when an obstruction occurs, it often takes a long time to clear it. Our Convolutional Neural Network (CNN)-based [17] Face recognition technology can successfully identify action behaviors particular to a specific student in response to this condition. Figure 1 depicts the specific identification flow chart for face recognition.Figure 1
Student face recognition.Convolutional layer, pooling layer, and fully connected layer are examples of general CNN hidden layers. CNN’s structure is depicted in Figure2 as a simplified schematic. The convolutional layer has three critical parameters: the size of the convolution kernel, the step size, and whether a pooling operation is used.Figure 2
CNN structure diagram.The calculation of the feature map size after convolution operation is shown in :(1)Sizeout=Sizein−F+1stride.After pooling, the size of the feature map remains unchanged, as shown in (2). The same filling means that after pooling, the size of the feature map remains unchanged after the convolution operation, and calculated as (3)(2)Sizeout=Sizein+2×padding−F+1stride.(3)padding=F−12,where Sizeout is the output size of the feature map, Sizein is the input size of the feature map, F is the size of the convolution kernel, stride is the step length and padding denote the number of circles filled in the periphery of the feature map.Following the pooling operation, the convolutional layer is connected, and the convolution kernel is shared. Local connection in this context means that the nodes of the convolutional layer only connect to some nodes of the previous layer, reducing the number of parameters, increasing calculation speed, and effectively reducing the likelihood of overfitting. When extracting the feature map, the convolution kernel uses the same convolution kernel to reduce the number of parameters and increase calculation speed. The purpose of the pooling layer is to compress data, reduce parameters and improve calculation speed. The fully connected layer is the hidden layer of the traditional neural network. Each neuron in this layer is connected to the previous neuron. In CNN, the convolutional, pooling, and fully connected layers need to add activation functions. The common activation function is a sigmoid in which the center value of the output value of the Sigmoid function is not 0, and gradient dispersion will occur when the deep neural network is propagated back. So, it is eliminated. Figure3 is a comparison chart of Sigmoid, Tanh and ReLU function curves.Figure 3
Sigmoid, tanh, and ReLU activation function.The tanh function’s output value is centered at 0 in the function. Even though its convergence rate is faster, there is still gradient dispersion. Now, the ReLU function is a popular activation function. It eliminates gradient dispersion, converges quickly, and reduces the danger of overfitting. Eq. shows the computation for the Leaky ReLU activation function, which is an enhanced version of the ReLU function (4). In general,a is 0.01 as a constant value.(4)fx=x,x≥0,ax,x0,.In CNNs and forward propagation, the input of each layer in the network is the output of the previous layer.(5)xi=fui,ui=Wixi−1+bi,where W is the weight while b denotes the bias term. The overall loss function is calculated as,(6)EN=12∑n=1N∑k=1ctkn−ykn2,where N is the total number of samples, c is the number of sample categories. tkn is the k-th dimension of the n-th sample label and ykn is the output of the n-th sample of the k dimension. Each layer of CNN uses the gradient descent method to update the weights. The weight update and offset update calculations are as follows,(7)Wni=Woi−η∂E∂Woi,bni=boi−η∂E∂boi,where Woi, boi: is the weight and bias terms before update, Wni, bni is the weight and offset after the update and η is the learning rate in the gradient descent method. In CNN, the convolutional layer propagates forward, and the output feature map of each i-layer convolution is calculated as(8)xji=f∑l∈Mjxli−1∗klji+bj,where Mj is the input feature map, klji is the convolution kernel and f is the activation function. CNN back-propagating, the pooling layer error is back-propagating, convolutional layer error direction propagation, the weight and the bias of the convolutional layer are calculated as,(9)δi−1=upsampleδi⊙σ′ui−1,δi−1=δi∂δi∂δi−1=δi∗rot180Wi⊙σ′ui−1,∂E∂Wi=∂E∂ui∂ui∂Wi=xi−1∗δi,∂E∂bi=∑u,vδiu,v,where δi is the sampling operation, ⊙ is the Hadamard product, δ is the error, i is the i-layer and E represent the loss function.


### 2.2. Improved VGG Network

VGG-16 has a simple structure, is simple to train, and performs well in image recognition [18]. The classic VGG-16 network has too many parameters because it has three fully connected layers, resulting in a slow training speed. We changed the network topology and loss function to make the VGG-16 network more suitable for face recognition. At the same time, the network structure is adjusted to the last layer, the penultimate convolutional layer is transformed to a partial convolutional layer, and a fully connected layer is reduced. The final pooling layer is replaced with an average pooling layer. It now has two fully connected layers, five pooling layers, and thirteen convolutional layers after being upgraded.


### 2.3. VGG Network Loss Function Improvement

We adopted the improved loss function for face recognition in the classroom, which improves the model’s recognition ability. The two-loss functions are mixed to improve the discrimination and generalization ability of the model [19], while softmax loss is used for image classification. Center Loss is used to increase the distance between classes and reduce the distance within classes. The overall accuracy of the model has been improved. The Center Loss function, the Softmax Loss function, and the improved mixed-function are calculated as shown in equations (10)–(12).(10)LC=12∑i=1mxi−cyi22.(11)LS=−∑i=1mlogexpwyiTxi+byi∑j=1nexpwjTxi+bj.(12)L=LS+λLC,where λ is the weight of the central loss function. After comparison test, we set λ to 0.003.


### 2.4. Classroom Behavior Recognition Data Preprocessing

We proposed a face recognition target inspection approach using video frame pictures for image discrimination. When students were standing up or performing other typical behaviors in the classroom, we used the designated box to intercept the target. The intercepted target’s face is identified [20]. Figure 4 depicts the overall flow chart of the face recognition algorithm.Figure 4
Flow chart of face recognition.We set up the monitoring system so that the video output frame rate is 25 frames per second (frames per second). The resolution of the output is 1080p. These things are done to ensure the video’s clarity and smoothness. Standing up video has 120 frames in 5 seconds and standing up motion has roughly 60 frames. Frame 12 is utilized to capture the student’s behavioral condition. The 6 randomly chosen classroom behavior movies are broken into frames, and the optimum sampling rate is established by comparing the number of frames required to identify the behavior status. The behavioral state sampling condition is depicted in Figure5.Figure 5
Sampling of behavior status.The average sampling rate is 0.1, 4 seconds of standing video, according to a comparison of 6 sets of samples. Sampling roughly 10 frames of images for processing can result in better sampling results, fewer calculations, and faster system performance. Before performing face recognition, image noise reduction processing is needed, and thus we employed a median filter for noise reduction processing.


### 2.5. Classroom Student Face Recognition

Face detection uses the Histogram of Oriented Gradient (HOG) feature of the image [21] and extracts the HOG feature frame diagram as shown in Figure 6.Figure 6
HOG frame diagram.To normalize the image pixels, we use gamma and calculate the image gradient, gradient magnitude, and gradient direction of the pixels in the image, as shown in equations (13)–(17).(13)Ix,y=Ix,yγ.(14)Gxx,y=Ix+1,y−Ix−1,y.(15)Gyx,y=Ix,y+1−Ix,y−1.(16)Gx,y=Gxx,y2+Gyx,y2.(17)αx,y=tan−1Gyx,yGxx,y.Face correction is mostly concerned with facial alignment. Face correction must be applied when students’ faces seem out of alignment in the classroom setting. First, our suggested algorithm identifies the essential facial points, such as the eyes and nose. The face is then aligned using an affine transformation. Because the upgraded VGG-16 network requires a specific image size to be input into the neural network, the image must be increased or lowered. By decreasing and filling the black boundaries, the image is filled. Enlargement employs two-way single linear interpolation. The equations for single linear interpolation,x-direction linear interpolation, and y-direction linear interpolation are as follows: (23)- (27).(18)y−y0x−x0=y1−y0x1−x0,y=y0x1−xx1−x0+y1x−x0x1−x0,fN1≈fM1x2−xx2−x1+fM2x−x1x2−x1,N1=x,y1,fN2≈fM3x2−xx2−x1+fM4x−x1x2−x1,N2=x,y2,fA≈fN1y2−yy2−y1+y−y1y2−y1fN2y−y1y2−y1.Face feature extraction: The aligned face image is fed into the upgraded VGG-16, which extracts features. The image is transformed into a feature vector, which is then compared to the database data. For face recognition, the distance between the feature values is calculated, and the defined threshold is employed.


### 2.6. Facial Recognition Evaluation Index for Classroom Students

For the classification problems, we use the performance metrics, including recall rate, precision rate, and accuracy rate [22]. Among them, TP: is Ture Positive, TN: is Ture Negative, FP: is False Positive, and FN: is False Negative. Figure 7 is a framework diagram of the confusion matrix.(19)Recall=TPTP+FN,Precision=TPTP+FP,Accuracy=TP+TNTP+FN+FP+TN.Figure 7
Confusion matrix frame diagram.


### 2.7. Classroom Upright Detection Using SSD Algorithm

In the classroom, the standing behavior of students is different from the sitting behavior of most of their classmates. The standing posture of the student is taken as the cut-in. As shown in Figure8, the standing posture is very different from the sitting posture. Our improved Single Shot MultiBox Detector (SSD) algorithm extracts standing students [23].Figure 8
Student standing up scene in the classroom.
(a)(b)(c)The SSD algorithm is a detection algorithm of the first order. It can locate and categories items at the same time and has a better balance of detection rate and accuracy. The standard SSD technique primarily employs two convolutional layers to replace the classification function’s two fully connected layers in VGG-16, followed by four convolutional layers of varying sizes. The SSD algorithm has three features: detection using multi-scale feature maps, detection using convolution, and detection using a priori boxes.The detection accuracy and detection speed in the classroom are both required. Although the two-stage detection approach is accurate, it is slow speed. The SSD algorithm has great detection accuracy and speed, making it ideal for real-time classroom scenarios. On the VOC data set, however, the SSD method performs well in terms of detection. However, when applied directly to actual classroom behaviour detection, the detection system’s accuracy and resistance to transformation are diminished. We enhance the SSD algorithm loss by improving the model’s surface extraction capability, which also improves the model’s overall performance.


### 2.8. Improved SSD Basic Network

The VGG-16 feature detection accuracy and detection speed in the classroom are both reique. When there are a lot of individuals in the classroom, the feature extraction ability of VGG-16 is insufficient [24]. One option is to increase the number of neural network layers, train a more intricate neural network, and add more parameters to deal with this difficulty. To a certain extent, these can improve extraction capacity. On the other hand, deepening the neural network causes gradient dispersion and performance reduction. As a result, we use the ResNet-34 network with a dust depth to address the problem of gradient dispersion and performance loss. It can increase the model’s performance and lessen the difficulty of training as the SSD algorithm’s principal network. Figure 9 depicts the structure of the improved SSD.Figure 9
Improved ResNet structure of SDD.


### 2.9. Improved SSD Loss Function

When the classic SSD algorithm handles the problem of the ratio of positive and negative samples in the classroom, the hard-to-separate sample with the highest confidence is chosen as the negative sample to calculate the loss function [25]. This means that not all samples are chosen, and some negative samples’ contributions are lost. We overcome the problem of positive and negative sample ratios by optimizing the SSD loss function. The loss and objective functions of the standard SSD algorithm are illustrated in equations (20)–(25).(20)Lx,c,l,g=1NLconfx,c+αLlocx,l,g.(21)Llocx,l,g=∑i∈PosN∑m∈cx,cy,w,hxijksmoothL1lim−g∧jm.(22)g∧jcx=gjcx−dicxdiw.(23)g∧jcy=gjcy−dicydih.(24)g∧jw=loggjwdiw.(25)g∧jh=loggjhdih,where c is the confidence of each category, l is the prior box, g is the true box, N is the number of a priori boxes that match the real target, Lconf is the confidence loss and Lloc is a loss of location. We use smoothL1 loss for position return as,(26)L1x=xdL1xdx=1ifx≥0−1otherwise,L2x=x2,dL2xdx=2x,smoothL1x=0.5x2ifx1x−0.5otherwise,dsmoothL1dx=xifx1±1otherwise.The anticipated value of the L1 loss approaches the genuine value in the later phases of training. Higher accuracy is not possible since the loss function varies around a stable value. The discrepancy between anticipated and true values is too big in the early stages of L2 loss training, the loss function gradient is too large, and the training is unstable. Asx decreases in size, the gradient of x decreases as well. When x is large, the gradient’s absolute value reaches 1, which cannot have a major influence on the network parameters. With smoothL1 loss, the gradient of x decreases as x decreases. When x is large, the gradient’s absolute value reaches 1, which cannot have a significant influence on the network parameters. smoothL1 loss has the upper hand. Some negative samples that were not chosen are absent in the basic SSD algorithm. As a result, we incorporated the focal loss function in the SSD algorithm to replace the classification network loss function in order to tackle the problem of the positive/negative sample ratio. (27) depicts the Focal Loss function.(27)Losspt=−αt1−ptγlogpt,where pt is the probability of different classification categories γ is a value greater than zero and αt it is [0, 1] decimal to balance the proportion of positive samples. Figure 10 depicts the changing curve of the loss function value with the expected probability when γ takes different values.Figure 10
Loss function vs. pre-probability curve.When the prediction probabilitypt is high for positive samples, the value of 1−ptγ is modest, and the loss function value of easy-to-divide samples is small. When the expected probability is 0.1 for negative samples, the loss function value is substantially smaller than when the predicted probability is 0.8, suggesting that the function prioritizes problematic samples.


### 2.10. Classroom Behavior Recognition

The data set utilized was created by combining the contents of the PASCAL VOC data collection. The data collection contains three types of scales for the number of students in teachers, as well as five classroom scenes of student standing behaviors. A data set is created in five steps: data collection, video preprocessing, image screening, and image annotation. Finally, the data set is split up. As seen in Figure11, a represents the number of small-scale students, b represents the number of middle-scale students, and c represents the number of large-scale students.Figure 11
Part of the image data of the dataset. (a) Number of small-scale students. (b) The number of medium-sized students. (c) Number of large-scale students. (d) Data set data. (e) Data set data. (f) Data set data.
(a)(b)SSD necessitates a substantial amount of training data. Because there is no publicly available data set for class behaviour state recognition, different data sets are chosen for preliminary training. The settings are then fine-tuned in conjunction with the produced student standing state data set. The process is divided into three steps: network model preliminary training, pre-training model parameter adjustment, and testing and evaluation.


## 2.1. Convolutional Neural Network

It is quite easy for students to obstruct each other’s behavior in the packed environment of the classroom. Students have a limited number of activities in class, and when an obstruction occurs, it often takes a long time to clear it. Our Convolutional Neural Network (CNN)-based [17] Face recognition technology can successfully identify action behaviors particular to a specific student in response to this condition. Figure 1 depicts the specific identification flow chart for face recognition.Figure 1
Student face recognition.Convolutional layer, pooling layer, and fully connected layer are examples of general CNN hidden layers. CNN’s structure is depicted in Figure2 as a simplified schematic. The convolutional layer has three critical parameters: the size of the convolution kernel, the step size, and whether a pooling operation is used.Figure 2
CNN structure diagram.The calculation of the feature map size after convolution operation is shown in :(1)Sizeout=Sizein−F+1stride.After pooling, the size of the feature map remains unchanged, as shown in (2). The same filling means that after pooling, the size of the feature map remains unchanged after the convolution operation, and calculated as (3)(2)Sizeout=Sizein+2×padding−F+1stride.(3)padding=F−12,where Sizeout is the output size of the feature map, Sizein is the input size of the feature map, F is the size of the convolution kernel, stride is the step length and padding denote the number of circles filled in the periphery of the feature map.Following the pooling operation, the convolutional layer is connected, and the convolution kernel is shared. Local connection in this context means that the nodes of the convolutional layer only connect to some nodes of the previous layer, reducing the number of parameters, increasing calculation speed, and effectively reducing the likelihood of overfitting. When extracting the feature map, the convolution kernel uses the same convolution kernel to reduce the number of parameters and increase calculation speed. The purpose of the pooling layer is to compress data, reduce parameters and improve calculation speed. The fully connected layer is the hidden layer of the traditional neural network. Each neuron in this layer is connected to the previous neuron. In CNN, the convolutional, pooling, and fully connected layers need to add activation functions. The common activation function is a sigmoid in which the center value of the output value of the Sigmoid function is not 0, and gradient dispersion will occur when the deep neural network is propagated back. So, it is eliminated. Figure3 is a comparison chart of Sigmoid, Tanh and ReLU function curves.Figure 3
Sigmoid, tanh, and ReLU activation function.The tanh function’s output value is centered at 0 in the function. Even though its convergence rate is faster, there is still gradient dispersion. Now, the ReLU function is a popular activation function. It eliminates gradient dispersion, converges quickly, and reduces the danger of overfitting. Eq. shows the computation for the Leaky ReLU activation function, which is an enhanced version of the ReLU function (4). In general,a is 0.01 as a constant value.(4)fx=x,x≥0,ax,x0,.In CNNs and forward propagation, the input of each layer in the network is the output of the previous layer.(5)xi=fui,ui=Wixi−1+bi,where W is the weight while b denotes the bias term. The overall loss function is calculated as,(6)EN=12∑n=1N∑k=1ctkn−ykn2,where N is the total number of samples, c is the number of sample categories. tkn is the k-th dimension of the n-th sample label and ykn is the output of the n-th sample of the k dimension. Each layer of CNN uses the gradient descent method to update the weights. The weight update and offset update calculations are as follows,(7)Wni=Woi−η∂E∂Woi,bni=boi−η∂E∂boi,where Woi, boi: is the weight and bias terms before update, Wni, bni is the weight and offset after the update and η is the learning rate in the gradient descent method. In CNN, the convolutional layer propagates forward, and the output feature map of each i-layer convolution is calculated as(8)xji=f∑l∈Mjxli−1∗klji+bj,where Mj is the input feature map, klji is the convolution kernel and f is the activation function. CNN back-propagating, the pooling layer error is back-propagating, convolutional layer error direction propagation, the weight and the bias of the convolutional layer are calculated as,(9)δi−1=upsampleδi⊙σ′ui−1,δi−1=δi∂δi∂δi−1=δi∗rot180Wi⊙σ′ui−1,∂E∂Wi=∂E∂ui∂ui∂Wi=xi−1∗δi,∂E∂bi=∑u,vδiu,v,where δi is the sampling operation, ⊙ is the Hadamard product, δ is the error, i is the i-layer and E represent the loss function.


## 2.2. Improved VGG Network

VGG-16 has a simple structure, is simple to train, and performs well in image recognition [18]. The classic VGG-16 network has too many parameters because it has three fully connected layers, resulting in a slow training speed. We changed the network topology and loss function to make the VGG-16 network more suitable for face recognition. At the same time, the network structure is adjusted to the last layer, the penultimate convolutional layer is transformed to a partial convolutional layer, and a fully connected layer is reduced. The final pooling layer is replaced with an average pooling layer. It now has two fully connected layers, five pooling layers, and thirteen convolutional layers after being upgraded.


## 2.3. VGG Network Loss Function Improvement

We adopted the improved loss function for face recognition in the classroom, which improves the model’s recognition ability. The two-loss functions are mixed to improve the discrimination and generalization ability of the model [19], while softmax loss is used for image classification. Center Loss is used to increase the distance between classes and reduce the distance within classes. The overall accuracy of the model has been improved. The Center Loss function, the Softmax Loss function, and the improved mixed-function are calculated as shown in equations (10)–(12).(10)LC=12∑i=1mxi−cyi22.(11)LS=−∑i=1mlogexpwyiTxi+byi∑j=1nexpwjTxi+bj.(12)L=LS+λLC,where λ is the weight of the central loss function. After comparison test, we set λ to 0.003.


## 2.4. Classroom Behavior Recognition Data Preprocessing

We proposed a face recognition target inspection approach using video frame pictures for image discrimination. When students were standing up or performing other typical behaviors in the classroom, we used the designated box to intercept the target. The intercepted target’s face is identified [20]. Figure 4 depicts the overall flow chart of the face recognition algorithm.Figure 4
Flow chart of face recognition.We set up the monitoring system so that the video output frame rate is 25 frames per second (frames per second). The resolution of the output is 1080p. These things are done to ensure the video’s clarity and smoothness. Standing up video has 120 frames in 5 seconds and standing up motion has roughly 60 frames. Frame 12 is utilized to capture the student’s behavioral condition. The 6 randomly chosen classroom behavior movies are broken into frames, and the optimum sampling rate is established by comparing the number of frames required to identify the behavior status. The behavioral state sampling condition is depicted in Figure5.Figure 5
Sampling of behavior status.The average sampling rate is 0.1, 4 seconds of standing video, according to a comparison of 6 sets of samples. Sampling roughly 10 frames of images for processing can result in better sampling results, fewer calculations, and faster system performance. Before performing face recognition, image noise reduction processing is needed, and thus we employed a median filter for noise reduction processing.


## 2.5. Classroom Student Face Recognition

Face detection uses the Histogram of Oriented Gradient (HOG) feature of the image [21] and extracts the HOG feature frame diagram as shown in Figure 6.Figure 6
HOG frame diagram.To normalize the image pixels, we use gamma and calculate the image gradient, gradient magnitude, and gradient direction of the pixels in the image, as shown in equations (13)–(17).(13)Ix,y=Ix,yγ.(14)Gxx,y=Ix+1,y−Ix−1,y.(15)Gyx,y=Ix,y+1−Ix,y−1.(16)Gx,y=Gxx,y2+Gyx,y2.(17)αx,y=tan−1Gyx,yGxx,y.Face correction is mostly concerned with facial alignment. Face correction must be applied when students’ faces seem out of alignment in the classroom setting. First, our suggested algorithm identifies the essential facial points, such as the eyes and nose. The face is then aligned using an affine transformation. Because the upgraded VGG-16 network requires a specific image size to be input into the neural network, the image must be increased or lowered. By decreasing and filling the black boundaries, the image is filled. Enlargement employs two-way single linear interpolation. The equations for single linear interpolation,x-direction linear interpolation, and y-direction linear interpolation are as follows: (23)- (27).(18)y−y0x−x0=y1−y0x1−x0,y=y0x1−xx1−x0+y1x−x0x1−x0,fN1≈fM1x2−xx2−x1+fM2x−x1x2−x1,N1=x,y1,fN2≈fM3x2−xx2−x1+fM4x−x1x2−x1,N2=x,y2,fA≈fN1y2−yy2−y1+y−y1y2−y1fN2y−y1y2−y1.Face feature extraction: The aligned face image is fed into the upgraded VGG-16, which extracts features. The image is transformed into a feature vector, which is then compared to the database data. For face recognition, the distance between the feature values is calculated, and the defined threshold is employed.


## 2.6. Facial Recognition Evaluation Index for Classroom Students

For the classification problems, we use the performance metrics, including recall rate, precision rate, and accuracy rate [22]. Among them, TP: is Ture Positive, TN: is Ture Negative, FP: is False Positive, and FN: is False Negative. Figure 7 is a framework diagram of the confusion matrix.(19)Recall=TPTP+FN,Precision=TPTP+FP,Accuracy=TP+TNTP+FN+FP+TN.Figure 7
Confusion matrix frame diagram.


## 2.7. Classroom Upright Detection Using SSD Algorithm

In the classroom, the standing behavior of students is different from the sitting behavior of most of their classmates. The standing posture of the student is taken as the cut-in. As shown in Figure8, the standing posture is very different from the sitting posture. Our improved Single Shot MultiBox Detector (SSD) algorithm extracts standing students [23].Figure 8
Student standing up scene in the classroom.
(a)(b)(c)The SSD algorithm is a detection algorithm of the first order. It can locate and categories items at the same time and has a better balance of detection rate and accuracy. The standard SSD technique primarily employs two convolutional layers to replace the classification function’s two fully connected layers in VGG-16, followed by four convolutional layers of varying sizes. The SSD algorithm has three features: detection using multi-scale feature maps, detection using convolution, and detection using a priori boxes.The detection accuracy and detection speed in the classroom are both required. Although the two-stage detection approach is accurate, it is slow speed. The SSD algorithm has great detection accuracy and speed, making it ideal for real-time classroom scenarios. On the VOC data set, however, the SSD method performs well in terms of detection. However, when applied directly to actual classroom behaviour detection, the detection system’s accuracy and resistance to transformation are diminished. We enhance the SSD algorithm loss by improving the model’s surface extraction capability, which also improves the model’s overall performance.


## 2.8. Improved SSD Basic Network

The VGG-16 feature detection accuracy and detection speed in the classroom are both reique. When there are a lot of individuals in the classroom, the feature extraction ability of VGG-16 is insufficient [24]. One option is to increase the number of neural network layers, train a more intricate neural network, and add more parameters to deal with this difficulty. To a certain extent, these can improve extraction capacity. On the other hand, deepening the neural network causes gradient dispersion and performance reduction. As a result, we use the ResNet-34 network with a dust depth to address the problem of gradient dispersion and performance loss. It can increase the model’s performance and lessen the difficulty of training as the SSD algorithm’s principal network. Figure 9 depicts the structure of the improved SSD.Figure 9
Improved ResNet structure of SDD.


## 2.9. Improved SSD Loss Function

When the classic SSD algorithm handles the problem of the ratio of positive and negative samples in the classroom, the hard-to-separate sample with the highest confidence is chosen as the negative sample to calculate the loss function [25]. This means that not all samples are chosen, and some negative samples’ contributions are lost. We overcome the problem of positive and negative sample ratios by optimizing the SSD loss function. The loss and objective functions of the standard SSD algorithm are illustrated in equations (20)–(25).(20)Lx,c,l,g=1NLconfx,c+αLlocx,l,g.(21)Llocx,l,g=∑i∈PosN∑m∈cx,cy,w,hxijksmoothL1lim−g∧jm.(22)g∧jcx=gjcx−dicxdiw.(23)g∧jcy=gjcy−dicydih.(24)g∧jw=loggjwdiw.(25)g∧jh=loggjhdih,where c is the confidence of each category, l is the prior box, g is the true box, N is the number of a priori boxes that match the real target, Lconf is the confidence loss and Lloc is a loss of location. We use smoothL1 loss for position return as,(26)L1x=xdL1xdx=1ifx≥0−1otherwise,L2x=x2,dL2xdx=2x,smoothL1x=0.5x2ifx1x−0.5otherwise,dsmoothL1dx=xifx1±1otherwise.The anticipated value of the L1 loss approaches the genuine value in the later phases of training. Higher accuracy is not possible since the loss function varies around a stable value. The discrepancy between anticipated and true values is too big in the early stages of L2 loss training, the loss function gradient is too large, and the training is unstable. Asx decreases in size, the gradient of x decreases as well. When x is large, the gradient’s absolute value reaches 1, which cannot have a major influence on the network parameters. With smoothL1 loss, the gradient of x decreases as x decreases. When x is large, the gradient’s absolute value reaches 1, which cannot have a significant influence on the network parameters. smoothL1 loss has the upper hand. Some negative samples that were not chosen are absent in the basic SSD algorithm. As a result, we incorporated the focal loss function in the SSD algorithm to replace the classification network loss function in order to tackle the problem of the positive/negative sample ratio. (27) depicts the Focal Loss function.(27)Losspt=−αt1−ptγlogpt,where pt is the probability of different classification categories γ is a value greater than zero and αt it is [0, 1] decimal to balance the proportion of positive samples. Figure 10 depicts the changing curve of the loss function value with the expected probability when γ takes different values.Figure 10
Loss function vs. pre-probability curve.When the prediction probabilitypt is high for positive samples, the value of 1−ptγ is modest, and the loss function value of easy-to-divide samples is small. When the expected probability is 0.1 for negative samples, the loss function value is substantially smaller than when the predicted probability is 0.8, suggesting that the function prioritizes problematic samples.


## 2.10. Classroom Behavior Recognition

The data set utilized was created by combining the contents of the PASCAL VOC data collection. The data collection contains three types of scales for the number of students in teachers, as well as five classroom scenes of student standing behaviors. A data set is created in five steps: data collection, video preprocessing, image screening, and image annotation. Finally, the data set is split up. As seen in Figure11, a represents the number of small-scale students, b represents the number of middle-scale students, and c represents the number of large-scale students.Figure 11
Part of the image data of the dataset. (a) Number of small-scale students. (b) The number of medium-sized students. (c) Number of large-scale students. (d) Data set data. (e) Data set data. (f) Data set data.
(a)(b)SSD necessitates a substantial amount of training data. Because there is no publicly available data set for class behaviour state recognition, different data sets are chosen for preliminary training. The settings are then fine-tuned in conjunction with the produced student standing state data set. The process is divided into three steps: network model preliminary training, pre-training model parameter adjustment, and testing and evaluation.


## 3. Analysis of the Experimental Results of Facial Recognition and Class Standing Behaviour Recognition Model Using Neural Network

### 3.1. Experimental Results and Analysis of Face Recognition Model Using Neural Network

When using the upgraded VGG-16 network’s face recognition effect in the classroom, certain students’ heads down and side faces in class cannot be recognized by the system. When the students rise up or modify their posture with their heads down, the algorithm successfully distinguishes the relevant database information. The detection system has an issue in that the matching degree for the students in the back row is insufficient. When there are a high number of students in the classroom, they will obstruct each other. Currently, the enhanced VGG-16 network provides poor detection results. When pupils stand up, this condition does not exist, and the recognition effect is positive. Figure12 depicts the outcome of facial recognition in the classroom. Figure 13 compress the test results of the classic VGG-16 and the enhanced VGG-16.Figure 12
The effect of face recognition in classroom.Figure 13
Comparison of face recognition results in classroom.In comparison to the classic VGG-16, the improved VGG-16 has a 2.5% accuracy rate, a 2.6% recall rate, and a 4.7% accuracy rate. The facial recognition system is primarily utilized in the classroom to check student information. The accuracy rate for confirming pupils’ standing states reaches 96.5%, satisfying the facial recognition effect in the classroom. In conclusion, the revised VGG-16 face recognition algorithm had the desired impact of boosting detection system performance and discrimination accuracy. It can achieve the purpose of identifying students.


### 3.2. The Experimental Results and Analysis of the Classroom Standing Behavior Discrimination Model Using Neural Network

Figure14 depicts a comparison of the discriminating results of the conventional SSD algorithm and the modified SSD algorithm. When there are a lot of people, the conventional SSD algorithm cannot tell the difference between the pupils in the rear row, but the upgraded SSD algorithm can. When a large number of students rise up in a classroom, the traditional SSD algorithm can only detect one individual, however the upgraded SSD algorithm can distinguish all students rising up. Furthermore, the enhanced SSD algorithm has a wider discrimination range than the conventional SSD algorithm. Even when there are a big number of pupils, students at the periphery of the classroom can be accurately differentiated.Figure 14
Discrimination effect diagram between classic SSD algorithm and improved SSD algorithm. (a) Classic SSD algorithm detection (b) Improved SSD algorithm detection (c) Classic SSD algorithm detection. (d) Improve SSD algorithm detection.Figure15 depicts a comparison between the detection results of the traditional SSD method and the upgraded SSD algorithm. According to the comparison chart between the classic algorithm and the improved algorithm, the size of the classroom population has an impact on the detection effect. The detection impact diminishes as the classroom population grows higher. The improved SSD algorithm is compared to the classic SSD algorithm. On the three scales of large, medium, and small, the improved SSD algorithm’s average detection accuracy is higher than that of the classic SSD method, and the improved SSD algorithm’s average detection accuracy is 4.8% higher than that of the classic SSD algorithm. However, the number of primary network layers in the improved SSD algorithm increases, and the amount of processing increases, resulting in a slower detection performance when compared to the classic SSD method.Figure 15
Comparison of the detection accuracy of the standing discrimination algorithm.


## 3.1. Experimental Results and Analysis of Face Recognition Model Using Neural Network

When using the upgraded VGG-16 network’s face recognition effect in the classroom, certain students’ heads down and side faces in class cannot be recognized by the system. When the students rise up or modify their posture with their heads down, the algorithm successfully distinguishes the relevant database information. The detection system has an issue in that the matching degree for the students in the back row is insufficient. When there are a high number of students in the classroom, they will obstruct each other. Currently, the enhanced VGG-16 network provides poor detection results. When pupils stand up, this condition does not exist, and the recognition effect is positive. Figure12 depicts the outcome of facial recognition in the classroom. Figure 13 compress the test results of the classic VGG-16 and the enhanced VGG-16.Figure 12
The effect of face recognition in classroom.Figure 13
Comparison of face recognition results in classroom.In comparison to the classic VGG-16, the improved VGG-16 has a 2.5% accuracy rate, a 2.6% recall rate, and a 4.7% accuracy rate. The facial recognition system is primarily utilized in the classroom to check student information. The accuracy rate for confirming pupils’ standing states reaches 96.5%, satisfying the facial recognition effect in the classroom. In conclusion, the revised VGG-16 face recognition algorithm had the desired impact of boosting detection system performance and discrimination accuracy. It can achieve the purpose of identifying students.


## 3.2. The Experimental Results and Analysis of the Classroom Standing Behavior Discrimination Model Using Neural Network

Figure14 depicts a comparison of the discriminating results of the conventional SSD algorithm and the modified SSD algorithm. When there are a lot of people, the conventional SSD algorithm cannot tell the difference between the pupils in the rear row, but the upgraded SSD algorithm can. When a large number of students rise up in a classroom, the traditional SSD algorithm can only detect one individual, however the upgraded SSD algorithm can distinguish all students rising up. Furthermore, the enhanced SSD algorithm has a wider discrimination range than the conventional SSD algorithm. Even when there are a big number of pupils, students at the periphery of the classroom can be accurately differentiated.Figure 14
Discrimination effect diagram between classic SSD algorithm and improved SSD algorithm. (a) Classic SSD algorithm detection (b) Improved SSD algorithm detection (c) Classic SSD algorithm detection. (d) Improve SSD algorithm detection.Figure15 depicts a comparison between the detection results of the traditional SSD method and the upgraded SSD algorithm. According to the comparison chart between the classic algorithm and the improved algorithm, the size of the classroom population has an impact on the detection effect. The detection impact diminishes as the classroom population grows higher. The improved SSD algorithm is compared to the classic SSD algorithm. On the three scales of large, medium, and small, the improved SSD algorithm’s average detection accuracy is higher than that of the classic SSD method, and the improved SSD algorithm’s average detection accuracy is 4.8% higher than that of the classic SSD algorithm. However, the number of primary network layers in the improved SSD algorithm increases, and the amount of processing increases, resulting in a slower detection performance when compared to the classic SSD method.Figure 15
Comparison of the detection accuracy of the standing discrimination algorithm.


## 4. Conclusion

The creation of smart learning classrooms for party member business knowledge may improve the teaching quality of party member education, improve the overall quality of party members, and boost party building in colleges and universities. To identify whether pupils stand up in class, we developed a classroom facial recognition and behavior state detection system that uses CNN. Face recognition is also utilized to confirm the identification of the current learner. The input data is first preprocessed, including video framing and noise reduction processing. The improved VGG-16 network may minimize the number of parameters, increase computation speed, and successfully discriminate students’ behavioral states in the classroom. The proposed method outperforms the standard SSD algorithm in average detection accuracy by 4.8%.



---

*Source: 3926970-2022-05-16.xml*