# Research on School Classroom Teaching Model Based on Clustering Algorithm and Fuzzy Control

Authors: Fujun Zhang; Aichuan Li; Jianfei Shi; Dongxin Wang
Journal: Scientific Programming
 (2021)

---

## Abstract

The method of computational intelligence to monitor and evaluate the concentration of students in the teaching process can promptly and effectively adjust the learning plan and improve the learning effect. In this article, clustering algorithm and fuzzy control methods are used to construct a research model of students’ attention in class. In addition, this article uses the existing MATLAB-based image feature recognition algorithm to detect and obtain facial features and analyze the main features of facial expressions through computational techniques to realize the judgment of attention. In addition, this article optimizes the traditional AdaBoost algorithm to save computing time and improve operating efficiency and system performance stability. Finally, this article constructs the functional modules of the research model according to actual needs and designs experiments to verify the performance of the model. Experimental research results show that the model constructed in this article has a certain effect.


---

## Body

## 1. Introduction

Attention refers to the direction and concentration of people’s psychological activities to certain objects. Concentration is the ability to pay attention, that is, the ability to point and focus one’s psychological activities (perception and thinking, etc.) on a certain thing or process [1]. Western scholar Weinberg believes that the ability to focus attention on clues related to action performance in a complex external environment is to focus on attention. Students’ attention refers to the ability of students to pay attention, that is, the ability of students to focus on specific goals without being interfered by external irrelevant stimuli in the process of learning. When students’ attention is distracted, they are often hesitant and slow in learning and examination.Attention is not an independent psychological process, it is closely connected with all psychological activities, such as feeling, perception, memory, imagination, thinking, and emotion, and it is a kind of consciousness quality (or characteristic) of these psychological processes. Attention includes four basic qualities [2]. (1) The breadth of attention, that is, the scope of attention: it refers to the number of attention objects that people can clearly understand or grasp at the same time, which is from extremely narrow to very broad. The narrow attention filters out most of the information, while the broad attention can simultaneously obtain a wide range of information. The scope of attention varies from person to person, and children’s scope of attention is usually smaller than that of adults. However, the scope of attention will be greatly improved with the growth of children and conscious training. (2) The stability of attention: it refers to the ability to focus attention on a specific object or activity in a certain period of time, that is, the ability to keep attention on a certain activity for a long time. (3) The distributivity of attention: it refers to the ability to distribute attention to different objects at the same time on the premise of skilled skills and normal excitability of the cerebral cortex. Because people’s attention is limited, the allocation of attention requires individuals to allocate two or more kinds of information in time. When the object of attention is not complex and familiar, people can notice one or more objects at the same time. (4) Transform of attention: it refers to the ability of an individual to adjust his attention from one object or activity to another according to a certain purpose. The speed of attention transfer is not only the embodiment of thinking flexibility, but also the basic guarantee of rapid information processing and judgment.There are many factors that affect attention, and it usually refers to an emotional state caused by critical or unexpected external changes, which are caused by our feelings of the external environment. When stimulated by the emergency, the body will produce obvious changes, such as heart rate, blood pressure, and muscle tension, which will make the emotion highly intensified, and then produce a sense of anxiety. When individuals feel unable to adapt to the task they are facing and cannot grasp the surrounding environment, they often have negative self-suggestion and anxiety. This will cause the excitability of the cerebral cortex to shift, cause internal inhibition, unable to concentrate, and hinder technical performance.This article mainly uses student feature recognition methods to count the number of students and their concentration in real classrooms. In the classroom monitoring environment, the faces of students at different shooting angles and distances are dense and tiny, so there are false detections and missed detections in the face detection. In a natural state, students bowing their heads, lying on their desks, and obscured by books all cause varying degrees of difficulty in face detection and concentration analysis. This article fully studies the current domestic and foreign research status of face detection and expression recognition methods, analyzes the difficulties and problems in face detection and subsequent expression recognition in the classroom, and proposes corresponding improvements.


## 2. Related Work

In recent years, wearable multiphysiological parameter acquisition equipment has been one of the key research directions of many research institutions at home and abroad, and new research results have continuously emerged in this field. From the perspective of its development process, it can be seen that the first generation of wearable multiphysiological parameter collection equipment focused on fragmented physiological parameter detection, such as monitoring blood oxygen concentration, pulse rate, blood sugar, and blood pressure signal [3], and the product forms are mainly represented by rings, glasses, gloves, earphones, etc. [4]. The second-generation multiphysiological parameter collection equipment enriches the categories of collected physiological parameters, integrates EEG signals, ECG signals, EMG signals, respiration rate, body temperature, etc., and reflects the characteristics of centralized wearable products [5]. The third-generation multiphysiological signal acquisition equipment mainly relies on the development of semiconductor technology and material science and technology. It has the characteristics of flexibility and miniaturization, such as electronic skin and epidermal electronic equipment, which are still in the research stage [6]. At present, among the abovementioned three generations of wearable multiphysiological parameter collection devices, the second-generation wearable multiphysiological parameter monitoring device has the highest practicability and application prospects. For example, the world’s first wearable physiological signal monitoring system is a smart wearable motherboard (Georgia Tech Wearable Motherboard) developed by Georgia Tech, which is used in the detection of casualties of soldiers on the battlefield during combat [7]. The product uses the fabric material integrated with optical fiber and fabric as a template to monitor human body temperature signals, ECG signals, and other physiological signals, while simultaneously detecting the bullet wounds of soldiers in battle. The LifeShirt developed by the American company VivoMetrics is the world’s first monitoring system that realizes noninvasive, mobile, and continuous collection of physiological signals, and is currently widely used in more than 1,000 hospitals around the world [8]. Moreover, the sensors built into the LifeShirt can realize the simultaneous detection of more than 30 physiological parameters. The BioHarness monitoring belt produced by Zephyr in the United States realizes the combination of portable multiphysiological signal detection and a chest strap with multiple sensors distributed. Moreover, it can realize the synchronous detection of human body’s electrocardiogram signal, respiration signal, body temperature signal, movement, and posture change, and its collected data can be sent to the host computer in real time to apply Acknowledge Software for data processing and further analysis [9]. LifeMonitor developed by the British Equivita Company is a wearable system that realizes dynamic monitoring of vital signs [10]. The multiphysiological information monitoring system can realize the collection, transmission, and storage of physiological signals such as ECG signal, heart rate, respiration rate, temperature, exercise information, blood oxygen concentration, blood pressure signal, and body temperature signal, and it applies professional analysis software for data analysis and processing. Moreover, the system has Global Positioning System (GPS) positioning function and is easy to wear. Because it uses skin-friendly high-tech breathable fabrics, it weighs only 38 g while being beautiful and comfortable, making it easy to wear for a long time.The literature [11] developed an emotional learning system. The system analyzes human emotions and learning states based on Naive Bayes classification and K-nearest neighbor classification and classifies them based on α waves and θ waves to infer the subject’s mental state. The literature [12] found that the potential signals collected at the human head are related to cognitive tasks and emotions. In the research and analysis, the author applied the principal component analysis method to the power spectrum analysis of the collected EEG data and applied the data subspace characteristics to derive and predict the error rate of the subjects in a continuous attention experiment. After observing the changes in the alpha wave power spectrum of the evoked EEG signal, the author found that when the alpha wave changes at a lower frequency, it can characterize some of the characteristics of attention, such as expectation and alertness to a certain extent. The literature [13] discovered that the spectral characteristics of EEG signals can be used to predict the degree of concentration. The results of the study show that the β-band (4–7 Hz) in the EEG signal is related to the drowsiness tendency, the α-band (8–13 Hz) is related to alertness and brain activity, and the γ-band (>20 Hz) is related to visual information processing and attention information. The research institute at the University of Sydney in Australia once proposed feature extraction based on the driver’s EEG signal and classification of fatigue and concentration based on feature values, used trend measurement to analyze and evaluate the driver’s mental state, and finally achieved good experimental analysis results [14].In the study of Shanghai Jiao Tong University, the researchers asked the subjects to browse the pictures in the picture library and synchronously collect the EEG signals during the experiment [15]. The experimental results show that the collected EEG signals contain information that can effectively identify the subjects’ emotion and concentration. The results of related studies show that certain information contained in the human body’s bioelectrical signals can be used to identify emotional states and focused states. Based on the characteristics of nonlinearity and high latitude of EEG signals, the amplitude, stability, and power spectral density of EEG signals can be used to analyze and evaluate the state of concentration. In addition, some scholars combine physiological information such as ocular signals and heart rate with EEG signals to perform comprehensive analysis [16].


## 3. Face Detection Module Based on the Viola–Jones Algorithm

In face detection, the Viola–Jones face detection algorithm is a very classic algorithm, it is widely used because of its fast and efficient detection effect, the algorithm includes preprocessing, feature extraction, training classifier, and other positioning algorithms, and all steps constitute a complete detection target positioning algorithm system. Because of the fast positioning and high accuracy of this method, it has quickly become the first choice for face detection and positioning. Although the Viola–Jones face detection algorithm was originally used to detect frontal face images, as the Viola–Jones algorithm has become more mature in recent years, the detection of side face images has become more and more efficient and accurate, so this article adopts the classic Viola–Jones algorithm to realize face detection. Figure1 shows a block diagram of the face recognition system. This article mainly explains the algorithm used in this article from the face detection [17].Figure 1
Block diagram of the face recognition system.This algorithm mainly includes the following important parts:(1)
It describes the common attributes of the face by the Haar-like rectangle features and then performs detection(2)
It establishes a feature called integral image, and based on the integral image, several different rectangular features can be quickly obtained(3)
It uses the optimized AdaBoost algorithm, that is, the optimized Better AdaBoost classifier for training to distinguish between human faces and nonhuman faces(4)
It establishes a cascaded hierarchical classifier with high detection rateThe common attributes of the face by Haar-like rectangular features are described as follows: generally speaking, the facial features of a person will show some basic common characteristics. For example, the nose is generally a high bright area of the face, which means that the brightness of the nose will be higher than that of the face. The surrounding cheeks are much brighter, and the human eye area is much darker than the cheek area. For a human face image, the relative positions of the eyebrows, nose, eyes, mouth, etc., are regular and followable. Among them, they are for the human face. For the midline, they are almost symmetrical [18].Therefore, the Haar-like feature considers the rectangular area adjacent to a specific position of a facial feature, and the pixels in the rectangular area at each position are added and then subtracted, and the final result is calculated. It basically corresponds to the following situations:(1)1,−1,1,−1,1,−1,1,−1,1,−1,1−1−11.To calculate the Haar-like features, all pixels in the rectangular area need to be summed. The size of the rectangular area that can be formed by an image is different. If each rectangular area uses the pixel and then summation method, this will undoubtedly increase the amount of calculation. Therefore, the Viola–Jones face detection algorithm uses a very sophisticated data structure called an integral image. The principle of the calculation of the integral image is very simple; that is, for any point in the image, the integral image value of that point is equal to the sum of all the pixels located in the upper left corner of the point. The expression is as follows [19]:(2)IX,Y=∑x′≤x∑y′≤yfx′,y′.Moreover, the integral image satisfies the relationship of the following formula:(3)Ix,y=fx,y+Ix−1,y+Ix,y−1−Ix−1,y−1.Among them,I represents the integral image, f represents the original image, and x,y,x′,y′ represent the position of the pixel. Therefore, the integral image of an image records the sum of all pixels in the upper left corner of each pixel on this image. If the upper left corner of an image is regarded as the origin of the coordinates of this image, then the above expression is the discrete sum of all pixels from the origin to the pixel, and it can also be regarded as an expression of integral. Therefore, this is also the origin of the name of the integral image. Using integral images, we can calculate the pixel sum of any point on an image or the pixel sum of a rectangular area. The calculation of the integral image pixel sum has a library function I=intergral lmageimg in MATLAB that can be called directly [20].After obtaining this integral image, the pixels of each rectangular area in the image can be quickly calculated, as shown in Figure2.Figure 2
Pixels in the rectangular area of the Haar-like feature.To obtain the pixel sum of the rectangle abcd, the integral image formula is used, and the expression formula is as follows [21]:(4)Sabcd=Ia+Id−Ib−Ic.This means that the sum of pixels in any rectangular area, that is, the sum of pixels in the upper left corner of the image, can be represented by the four points on the integral image.The training process of the classic AdaBoost classifier is as follows.The training set is given byx1,y1,…,xn,yn, where yi∈−1,1 represents the correct category label of xi, i=1,…,N. The initial distribution of samples on the training set is as follows:(5)D1i=1N.Among them,t=1,…,T. The weak classifier ht:X⟶−1,1 is calculated, and the error of the weak classifier on the distribution Dt is as follows:(6)εt=pDthtxi≠yi.The weight of the weak classifier is calculated as follows:(7)αt=12In1−εtεt.The distribution of training samples is updated as follows:(8)Dt+1i=Dtiexp−αiyihtxiZt.Among them,Zt is the normalization constant. The final strong classifier is as follows:(9)Hfinalx=sign∑t=1Tαthtx.There is no restriction on the style of the weak classifier, and it can be a decision tree based on multidimensional features, or even SVM. However, usually each weak classifier is constructed based on a certain dimension in all features, and the output results are only +1 and −1 (for binary classification). Therefore, during training, each iteration selects the weak classifier corresponding to the one-dimensional feature with the best classification effect under the current training set distribution.In the prediction, after inputting a sample, the classic AdaBoost adds weighted−1,+1 value output by all weak classifiers as the final result. To get different accuracy and recall rates, users can set different thresholds. For example, when the output is 0.334, if threshold=0 is set, the classification result is g, and if threshold=0.5 is set, the classification result is m.The Better AdaBoost classifier is an extension and improvement of the classic AdaBoost classifier. Each weak classifier of the classic AdaBoost classifier only outputs1,0 or +1,−1, so the classification ability is weak. The output of each weak classifier of Better AdaBoost is a real value (this is the reason it is called “Better”), which can be considered as a degree of confidence. Moreover, when it is combined with LUT (100k-uptable), the ability to express complex functions is stronger than the classic AdaBoost.The training process of the Better AdaBoost classifier is as follows [22].The training set is given byx1,y1,…,xn,yn, where yi∈1,−1 represents the correct category label of xi, i=1,…,N. The initial distribution of samples on the training set is as follows:(10)D1i=1N.Among them,t=1,…,T.(1)
The value spaceX of each dimension feature is divided into several disjoint subspaces X1,…,Xn.(2)
The parameter value on each subspace is calculated as follows [23]:(11)Wij=pxi∈Xj,yi=1=∑txi∈Xj,yi=1Di,1∈+1,−1.(3)
The output of each weak classifier is calculated as follows:(12)∀x∈Xj,hx=12InW+1j+εW−1j+ε.Among them,ε is a small normal quantity, which is used to smooth the output. hx is actually a piecewise linear function, which outputs a different value in each subspace.(4)
The normalized factor is calculated as follows [24]:(13)Z=Z∑jW+1jW−1j.The product of the weighted sum of positive and negative samples on each subspace is calculated and then added.(5)
The weak classifierhx that minimizes z is selected as the weak classifier selected in the iteration:(14)Zt=minZ,ht=argminZ.(6)
The sample distribution is updated as follows:(15)Dt−1i=Diexp−yihixi.The final strong classifierH is expressed as follows:(16)Hx=sign∑i=1Thtx−b.Among them,b is the threshold, and it is defaulted to 0.Face recognition and eye recognition are inseparable. Face recognition is the premise of eye recognition, and eye recognition is the premise of judging the concentration of students in class because the dynamics of human eyeballs and the speed of blinking are the most intuitive way to judge whether students are taking lessons seriously. However, there are few studies that combine the quality of teaching with human eye recognition. Most of them combine human eye research with driver fatigue to determine whether the driver is fatigued. Most of the literature uses human eye recognition to judge. For example, the literature on the method and application of eye feature recognition for fatigued drivers and the literature on driver fatigue detection based on human eye recognition all mention that when the driver is fatigued, the blinking frequency of the eyes will slow down, and the focus will not be concentrated enough, which may easily lead to a car accident.When the human eye area is detected, the next job is to judge the open and closed state of the human eye. In the human eye detection in this article, the state of the human eye is simply divided into two parts: eyes open and eyes closed. If we define the samples in one state (such as eyes open) as positive samples and the samples in the other state (such as eyes closed) as negative samples, then the AdaBoost classifier is trained by extracting their Haar-like features. Then, this process is simpler than the process of human eye positioning. This is because the negative samples of the human eye positioning process are theoretically random, so a large amount of negative sample data is needed, and a classifier with a cascade structure needs to be constructed. In the state recognition process, there is no need to construct a cascade structure of classifiers, and only one layer of classifiers is needed to maximize the distinction between positive and negative samples.This method can well recognize the eye state of the subject wearing glasses (including contact lenses and frame glasses). Here, it is necessary to distinguish the testee wearing glasses and the testee not wearing glasses into two different samples. That is to say, when the testee wears glasses, the classifier trained by the sample wearing glasses should be used. When the glasses are not worn, the classifier trained on the samples without glasses is used. Through experiments, this method can increase the average recognition accuracy of general individuals by about 8%, while the average recognition accuracy of individuals wearing glasses can be increased by 8% to 12%.First, the features involved in training are analyzed. The five typical Haar-like features are all obtained through the difference in rectangular integrals. In other words, the essence of Haar-like features can be considered as a gradient feature. Therefore, we define the amount of edge information of an image to be expressed by the following formula:(17)H=∑x∑y∑m=18Ix,y−Im.Among them,Im represents the 8 domain points corresponding to the point Ix,y in the image.According to the knowledge of biology, the human eye area has a relatively obvious grayscale change relative to the human face area. For the detection and positioning of the human eye, the first step is to determine that the human eye is not blocked, and then, the grayscale enhancement transformation on the grayscale image of this image is performed. Finally, a reasonable grayscale threshold is set, so that the human eye part of the binarized image obtained by the image enhancement transformation can be clearly distinguished.


## 4. Research Model of College Students’ Classroom Concentration Based on Computer Statistical Analysis and Fuzzy Control

The AdaBoost algorithm is a very effective sample learning algorithm, and it also has a good classification effect for training the human eye classifier and can quickly determine the state of eyes open and eyes closed through the human eye cascade classifier. This method can be combined with the process of detecting and judging the state to realize the effect to be tested. The process of using the AdaBoost algorithm to achieve human eyes open and closed classifier training can be described as shown in Figure3.Figure 3
Diagram of the location and classification of eye status.This article analyzes the main features of facial expressions to realize the judgment of the degree of concentration. Because the most obvious changes in facial expressions during the learning process are the eye and mouth features, this article uses the eye height of the extracted picture under the same pixel background, eye width, mouth height, and mouth width. Four sets of data information methods are the four sets of facial expression parameters (d1, d2, d3, and d4) in the following schematic diagram. We find the degree of concentration by analyzing the changes in the extracted model parameters. At high moments, the eye height data are generally larger, or the eye height changes positively in the original normal state, and the mouth is usually closed or slightly opened at this time; when the concentration is low, the eyes are usually smaller or closed, or the eyes were originally opened or normal, but the height of the eyes showed a significant negative change; that is, the eyes have a tendency to become smaller or closed, and the mouth usually has a more obvious tendency to open. Figure4 shows a schematic diagram of the characteristic parameters that have changed significantly during the extracted learning process.Figure 4
Schematic diagram of facial expression parameters.In this article, the AdaBoost algorithm is used to detect and locate the face, eyes, and mouth, and then, the fuzzy inference method is used to determine the student’s learning status. The design framework of the concentration recognition system is shown in Figure5.Figure 5
System design framework.The test samples used in this experiment are all pictures of the emotional state of online distance education learners in the learning process collected by computers. According to the data analysis mentioned in the previous article, we set to capture facial expression pictures every 1 s and then analyze the detected pictures.As shown in the main flowchart of the algorithm in Figure6, the main research of this article is to use MATLAB as a processing tool to perform face detection, so as to determine the realization process of students’ concentration in class. The system is mainly divided into a picture acquisition module, a digital image processing module, a face detection module, and a face feature recognition module. The first is to intercept the picture we want to judge the focus of the target from each frame of video and then preprocess the picture to remove the complex background or irrelevant information of the picture.Figure 6
Main flowchart of the algorithm.


## 5. System Performance Verification

After constructing the college students’ classroom concentration analysis system based on computer statistical analysis and fuzzy control methods, the next step is to study the effect of the college students’ classroom concentration analysis system based on computer statistical analysis and fuzzy control methods. Moreover, this article combines statistical methods to verify system performance. This article uses the system to monitor the class of 75 students of a certain major in a university and calculate the result of feature recognition, as shown in Table1 and Figure 7.Table 1
Statistical table of the accuracy of feature recognition of system.
NumberFeature extraction accuracy (%)173.51274.79384.20482.44584.42676.65774.54880.74988.761076.151172.471279.961373.031483.731589.011684.731778.551886.601987.982085.592175.072273.702374.752484.912579.332684.982787.692885.732976.923085.653177.583288.533389.903481.383588.613678.803788.963872.343978.874076.014183.744288.454376.574487.434582.414674.914773.764874.014983.035085.285174.195281.555379.405477.295572.145675.875789.615873.055978.646079.846175.496275.676387.916474.886583.336675.946775.336872.566981.327087.057187.887284.737389.737482.977590.85Figure 7
Statistical diagram of the accuracy of feature recognition of system.From the above analysis, it can be seen that the college students’ classroom concentration analysis system based on computer statistical analysis and fuzzy control methods constructed in this article has a certain accuracy in the recognition of students’ classroom features. On this basis, this article uses the system to identify students’ class concentration, and the results are shown in Table2 and Figure 8.Table 2
Statistical table of the accuracy of concentration recognition of system.
NumberAccuracy of concentration recognition (%)164.09278.06364.14467.19564.85671.73772.16883.99977.431065.061164.901269.831372.391483.161577.251674.731771.601878.721972.032082.762168.732273.322372.372465.642583.872664.252775.602879.282973.453073.713170.113266.213384.533484.413570.013684.243781.763880.383965.024078.674177.424267.384368.104471.124575.594683.594778.344876.794965.405064.615166.095271.835366.705464.935570.395665.195778.995868.665970.136077.066176.396282.176364.456473.056582.836681.366781.466867.376975.637077.187165.587273.977364.927472.807583.39Figure 8
Statistical diagram of the accuracy of concentration recognition of system.From the above analysis results, the college students’ classroom concentration analysis system based on computer statistical analysis and fuzzy control methods constructed in this article performs well in student concentration recognition and can be used as an auxiliary system for college teachers’ teaching.


## 6. Conclusion

With the rapid development of hybrid artificial intelligence technology, the intelligent education model of human-computer collaboration makes education a traceable and visible process. Creating an intelligent and technological learning environment to conduct personalized, humanized, and intelligent concentration state evaluation during the process of autonomous learning and to achieve self-feedback and evaluation of their learning effects is of great significance to optimizing the teaching process and promoting learners’ deep learning. This article combines computer statistical analysis and fuzzy control methods to construct a classroom concentration research model for college students, builds the functional modules of the concentration research model based on actual needs, and designs experiments to verify the system performance. The experimental research results show that the system constructed in this article has a certain effect.



---

*Source: 7435202-2021-11-22.xml*