A method for evaluating students' online course status based on deep neural network

Through the student online class status evaluation method based on deep neural network, students' video data are analyzed in real time, and students' distraction and learning motivation are reduced in distance education, accurate attention status assessment and multi-environment deployment are achieved, and distance education is improved teaching quality and safety.

CN118552997BActive Publication Date: 2024-11-29GUANGDONG MECHANICAL & ELECTRICAL COLLEGE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410759902.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-11-29
Estimated Expiration
2044-06-13

AI Technical Summary

Technical Problem

In the online teaching environment of distance education, students are prone to distraction and difficult to obtain immediate feedback and personalized tutoring, resulting in a decrease in learning motivation and difficult to maintain classroom discipline, and it is difficult for existing technologies to effectively evaluate students' attention status and behavior.

Method used

Using a deep neural network-based student online class status evaluation method, collecting students' face photos, establishing a facial key point extraction model, analyzing video data in real time, determining whether students are distracted and recording the distracted time, using image preprocessing and data augmentation technology Improve the robustness and generalization capabilities of the model.

Benefits of technology

It realizes real-time and accurate detection of students' attention status under multi-environment deployment, provides statistical reports on students' distraction time, improves the teaching quality and safety of distance education, and enhances students' learning motivation and classroom discipline.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118552997B_ABST
    Figure CN118552997B_ABST
Patent Text Reader

Abstract

The invention discloses a method for evaluating the online course status of students based on a deep neural network, and belongs to the technical field of distance education. The method obtains video data of students in class, and then performs attention state analysis based on biometrics to determine whether the students are in a distracted state during class, and records the distracted time of the students. The algorithm is lightweight, fast in operation, and can be deployed in multiple environments to meet the application requirements of different scenarios. The method comprises the following steps: S1, after obtaining authorization, collecting multiple student face photos, marking each student face photo, and then performing image preprocessing to obtain a marked face data set; S2, establishing an initial model for extracting key points of faces, and using the marked face data set to train the initial model for extracting key points of faces to obtain a face key point extraction model; S3, at the beginning of the online course, starting the camera of the student terminal that logs in to the online course, respectively obtaining real-time videos of the class status of the student terminal, and analyzing to obtain student class status data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of distance education, and more specifically, to a method for evaluating the status of online courses of students based on a deep neural network. Background Art

[0002] With the rise of online courses, students enjoy more flexible and diverse learning methods. However, this learning model inevitably brings some challenges. Especially in an online environment where teacher-student interaction is reduced, students are easily distracted and have difficulty obtaining instant feedback and personalized tutoring. In addition, the inherent flexibility of online courses may also weaken students' learning motivation, making it difficult for them to develop self-discipline and maintain classroom discipline. To address these issues, Face State Assessment (FSA) technology provides a set of effective solutions. This technology can use cameras to track and analyze students' facial expressions, concentration levels, and emotional fluctuations in real time to generate reliable data reports.

[0003] Facial state recognition technology has shown its wide applicability in many fields such as biometric identification, expression interpretation, age and gender estimation, and clothing appearance analysis. Thanks to its low cost and efficient information extraction capabilities, this technology has become a research focus in recent years. In online teaching scenarios, the application of facial recognition technology is particularly valuable. It can not only confirm the authenticity of students' identities and ensure the authenticity of participation, but also has a significant impact on promoting teaching interaction and monitoring students' learning attitudes and behaviors. This technology can provide quantitative data on classroom participation and student learning behavior, provide an objective basis for the evaluation of teaching effectiveness, and help improve the convenience and security of distance education. Therefore, facial state recognition technology not only improves the accuracy of teaching quality evaluation, but also enhances its credibility, indicating a broad application potential in the field of modern educational technology. Summary of the invention

[0004] The purpose of the present invention is to provide a method for evaluating the status of online students based on deep neural networks. The method obtains video data of students in class, and then performs attention state analysis based on biometrics to determine whether students are distracted during class and record the time of students' distraction. The algorithm is lightweight, fast in calculation speed, and can be deployed in multiple environments to meet the application requirements of different scenarios.

[0005] The technical solution adopted by the present invention is as follows:

[0006] A method for evaluating the status of online courses of students based on a deep neural network comprises the following steps:

[0007] S1. After obtaining authorization, collect multiple student face photos, mark each student face photo, and then perform image preprocessing to obtain a marked face dataset;

[0008] S2, establishing an initial model for extracting facial key points, and using the labeled face data set obtained in step S1 to train the initial model for extracting facial key points to obtain a facial key point extraction model;

[0009] S3. When the online class starts, the camera of the student terminal that logs in to the online class is started to obtain the real-time video of the class status of the student terminal, and the student class status data is obtained by parsing;

[0010] S4, performing image preprocessing on the real-time video data of students attending class obtained in step S3 to obtain a real-time preprocessed image of students attending class;

[0011] S5, inputting the real-time pre-processed image of the students in class obtained in step S4 into the facial key point extraction model obtained in step S2 for recognition, and then outputting the information of the relationship between the students' facial key points;

[0012] S6. Determine whether the student is distracted based on the relationship information between the key points of the student's face obtained in step S5, and accumulate the distraction time of the student during the online class.

[0013] Furthermore, the step S1 comprises the following steps:

[0014] S1.1. After obtaining authorization, collect multiple student face photos in different scenes, and perform data cleaning on the collected multiple student face photos to obtain multiple student face screening image data;

[0015] S1.2, annotating the face frames and key points of the multiple student face screening image data obtained in step S1.1 to obtain a student face annotated image data set;

[0016] S1.3. Perform image cropping, resizing, and color space conversion operations on the image data in the student face annotated image dataset obtained in step S1.2 to obtain a labeled face dataset.

[0017] Furthermore, in the step S1.3, after the image data in the student face annotated image dataset is subjected to a color space conversion operation, a data enhancement operation is also performed, and the data enhancement operation includes one or more of random image rotation, flipping, and scaling operations.

[0018] Furthermore, the step S2 comprises the following steps:

[0019] S2.1. Establish and initialize an initial model for extracting key points of a face. The initial model for extracting key points of a face is a MobileNetV2 network model. A variable convolution kernel is used for convolution in the backbone network and the feature pyramid network in the initial model for extracting key points of a face.

[0020] S2.2, dividing the data in the labeled face dataset obtained in step S1 into a labeled face training dataset and a labeled face training verification set in a ratio of 80%:20%;

[0021] S2.3. Use the labeled face training data set and the labeled face training verification set obtained in step S2.2 to train the initial model for face key point extraction, construct face frame position regression, binary classification, detection frame coordinates and overall loss function, and finally obtain the face key point extraction model by iterating the initial model for face key point extraction.

[0022] Furthermore, in the step S2.1, initializing the initial model for extracting facial key points includes weight initialization and preprocessing of input data, and the weight initialization step is: training on the ImageNet data set to obtain pre-trained weights, and the preprocessing of input data includes Xavier initialization, He initialization, and initialization using a normal distribution with a deviation of 0.02;

[0023] The backbone network and the feature pyramid network use variable convolution kernels for convolution, and the operation includes the following steps:

[0024] (1) Determine the basic integers to define the coordinates according to the input parameters;

[0025] (2) Obtain the sampling coordinates of the conventional convolution kernel;

[0026] (3) Obtain the sampling coordinates of the irregular convolution kernel, merge the sampling coordinates of the irregular convolution kernel into the sampling coordinates of the regular convolution kernel, and obtain the complete sampling coordinates;

[0027] (4) Convert the obtained complete sampling coordinates into a tensor and return it.

[0028] Furthermore, in the step S2.3, when training the initial model for extracting facial key points, anchor boxes of different scales and aspect ratios are generated on labeled face images of different scales in the labeled face dataset to cover faces of different sizes and shapes, and then the position offset between each anchor box and the real face box is predicted;

[0029] The loss function formula for constructing the face frame key point positioning is:

[0030]

[0031] Among them, p j is the key point position predicted by the initial model for face key point extraction, is the actual key point position, L pts It is the loss function value between the key point position predicted by the initial model for face key point extraction and the actual key point position;

[0032] The loss function formula for the constructed binary classification is:

[0033]

[0034] Among them, p i is the probability of predicting a face, y i is the true category label of the anchor box, L cls The loss function value for the binary classification of the face key point extraction initial model prediction as a face or not a face;

[0035] The loss function formula of the constructed detection box coordinates is:

[0036] L bbox =1-DIoU Loss(Target,Propose);

[0037]

[0038] IoU(Target,Propose)=(Target∩Propose) / (Target∪Propose);

[0039] Among them, d is the Euclidean distance between the center points of the predicted box (Propose) and the real box (Target); c is the length of the minimum closure diagonal surrounding the entire predicted box (Propose) and the real box (Target); IoU (Target, Propose) is the intersection over union ratio of the predicted box (Propose) and the real box (Target); L bbox The loss function value of the detection box coordinates predicted by the initial model for facial key point extraction;

[0040] The overall loss function formula constructed is:

[0041] L=λ1·L cls +λ2·L bbox +λ3·L pts ;

[0042] Among them, λ1, λ2, and λ3 are hyperparameters.

[0043] Furthermore, in the step S4, the real-time video data of students attending class obtained in step S3 is subjected to image preprocessing including image cropping, resizing, and color space conversion operations.

[0044] Furthermore, the step S6 comprises the following steps:

[0045] S6.1, according to the relationship information between the key points of the student's face obtained in step S5, calculate the intersection of the straight line formed by the left eye and the right corner of the mouth coordinates and the straight line formed by the right eye coordinates and the left corner of the mouth coordinates to obtain the predicted intersection coordinates;

[0046] S6.2. The intersection distance value is obtained based on the distance between the predicted intersection coordinates obtained in step S6.1 and the nose tip coordinates. The calculation formula for the intersection distance value is:

[0047]

[0048] Among them, (x nose ,y nose ) is the nose tip coordinate, (x inter ,y inter ) is the predicted intersection coordinate, and distance is the intersection distance value;

[0049] S6.3, according to the intersection distance value obtained in step S6.2 and the length and width of the face detection frame, a distance threshold is calculated, and the calculation formula of the distance threshold is:

[0050]

[0051] Where dis is the intersection distance value, w is the length of the face detection frame, h is the height of the face detection frame, softmax() is the normalization function, and r is the distance threshold;

[0052] S6.4. Compare the intersection distance value with the distance threshold. If the intersection distance value is greater than the distance threshold, the student is determined to be distracted, and the student’s distraction time during the online class is accumulated.

[0053] Furthermore, in step S6.4, when it is determined that the student is distracted, a prompt is issued to warn the student of distraction.

[0054] Furthermore, the method further includes step S7, counting the distraction time of the student, and generating a statistical report of the distraction time of each student after the online class is over.

[0055] Compared with the prior art, the present invention has the following beneficial effects:

[0056] The present invention discloses a method for evaluating the online course status of students based on a deep neural network. The method comprises the following steps: collecting a plurality of student face photos, marking each student face photo, and then performing image preprocessing to obtain a marked face data set; establishing an initial model for extracting face key points, and using the marked face data set to train the initial model for extracting face key points to obtain a face key point extraction model; at the beginning of the online course, starting the camera of the student terminal that logs in to the online course, and respectively obtaining real-time videos of the class status of the student terminal; performing image preprocessing on the real-time video data of the student class; inputting the real-time preprocessed image set of the student class into the face key point extraction model for recognition, and then outputting information on the relationship between the student face key points; and then using the relationship information between the student face key points to determine whether the student is distracted, and accumulating the distraction time of the student during the online course. The trained face key point extraction model can realize the accurate detection of faces in classroom scenes, extract the position information of face key points, and realize the attention state analysis method based on biometrics, and can analyze the distraction state and distraction time of students according to video data. The algorithm of the facial key point extraction model is lightweight and can run in real time. The facial key point extraction model uses AK convolution to improve the model structure, which improves the computing speed. The model can run on domestic embedded systems and be deployed in multiple environments to meet the application requirements of different scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0058] Figure 1 It is the implementation flow chart of the online course in this method;

[0059] Figure 2 This is a schematic diagram of the output results of using this method to run the status of students taking online classes;

[0060] Figure 3 This is the result of running the facial key point extraction model in this method on the K210 embedded device. DETAILED DESCRIPTION

[0061] The technical solution of the present invention is further described in detail below in conjunction with specific implementation methods, but does not constitute any limitation to the present invention.

[0062] Reference Figure 1 and 2 As shown, a method for evaluating the status of online courses of students based on a deep neural network of the present invention comprises the following steps:

[0063] S1. After obtaining authorization, collect multiple student face photos, mark the face of each student face photo, and then perform image preprocessing to obtain a marked face dataset.

[0064] Further, the following steps are included:

[0065] S1.1. After obtaining authorization, collect multiple student face photos in different scenes, and clean the collected multiple student face photos to obtain multiple student face screening image data. The collected multiple student face photos include scenes such as indoor, outdoor, and faces under different lighting conditions, so that the trained model has better robustness. The data sources of the collected student face photos include the WIDER Face dataset, the CelebA dataset, etc. Before collecting the data source information, you need to obtain the student's permission, and the student's face photo data source must be kept confidential during use, and its information cannot be disclosed or used for other purposes at will.

[0066] When performing data cleaning on the collected multiple student face photos, photos with poor quality or unnecessary photos are deleted to ensure the quality of the data set.

[0067] S1.2. The multiple student face screening image data obtained in step S1.1 are respectively annotated with face annotation frames and key points to obtain a student face annotated image dataset.

[0068] S1.3. The image data in the student face annotated image dataset obtained in step S1.2 is subjected to image cropping, resizing, and color space conversion operations to obtain a labeled face dataset. After completing these operations, the image data can meet the input requirements of the model.

[0069] Furthermore, after the image data in the student face annotated image dataset is subjected to a color space conversion operation, a data enhancement operation is also performed. The data enhancement operation includes one or more of random image rotation, flipping, and scaling operations to increase data diversity and improve the generalization ability of the model.

[0070] S2. Establish an initial model for extracting facial key points. Use the labeled face data set obtained in step S1 to train the initial model for extracting facial key points to obtain a facial key point extraction model.

[0071] Further, the following steps are included:

[0072] S2.1. Establish an initial model for facial key point extraction and initialize it. The initial model for facial key point extraction is a MobileNetV2 network model. The backbone network in the initial model for facial key point extraction and the feature pyramid network use variable convolution kernels for convolution.

[0073] The initial model for extracting key points of human faces includes the number of network layers, convolution kernel size, number of feature pyramid layers, etc. It mainly includes parts such as depthwise separable convolution, linear bottleneck module, downsampling and feature fusion. Through the stacking and combination of these parts, the MobileNetV2 network model can achieve efficient image feature extraction while maintaining a small model volume and amount of calculation. In addition, the evaluation method of the present invention replaces all convolution operations in the model with variable convolution kernel convolution (AKConv, arbitrary parameter convolution kernel convolution), thereby improving the perception of facial features.

[0074] The initial model for extracting key points of faces uses the MobileNetV2 network model as the feature extraction network of the model, and its backbone network structure involves a series of depth-separable convolutional layers and linear bottleneck modules. The backbone network architecture of the initial model for extracting key points of faces includes the following parts:

[0075] (1) Depthwise Separable Convolution

[0076] In the MobileNetV2 network model, the depth-wise separable convolution layer contains depth-wise convolution and point-wise convolution operations. For input features (x) and output features (y), the depth-wise separable convolution can be expressed as:

[0077] y = PW(BN(ReLU(DW(x))));

[0078] Among them, DW represents the depthwise convolution operation, BN represents the batch normalization operation, ReLU represents the activation function, which is generally a linear rectifier unit, and PW represents the pointwise convolution operation.

[0079] (2) Linear Bottleneck

[0080] The linear bottleneck module in the MobileNetV2 network model can be expressed as:

[0081] y=F(x,W)+x;

[0082] Among them, F(x,W) represents the operation of the linear bottleneck module, x represents the input feature, and W represents the parameters of the module (parameters refer to the weight parameters obtained through training, and different W can be obtained according to the data).

[0083] (3) Downsampling and feature fusion

[0084] The MobileNetV2 network model downsamples through the convolutional layer in the backbone network structure to obtain feature maps of different scales, and uses feature fusion to integrate feature representations at different levels.

[0085] In the model, the depthwise separable convolutional layers and linear bottleneck modules are stacked and combined according to the specific design to form a complete backbone network structure. Specifically, the tensor changes in each module block are as follows:

[0086] Input tensor: (H in ×W in ×C in );

[0087] After the expansion layer: the tensor size is expanded to (H in ×W in ×C mid );

[0088] After the depthwise separable convolutional layer: the tensor size remains unchanged (H in ×W in ×C mid );

[0089] After the projection layer: the tensor size is reduced to (H out ×W out ×C out );

[0090] Among them, H out , W out , C mid and C out Represents the height, width, number of intermediate channels and final number of channels of the output tensor respectively. in , W in and C in Represent the height, width, and final number of channels of the input tensor respectively.

[0091] Furthermore, the initial model for extracting facial key points is initialized, including weight initialization and input data preprocessing. The weight initialization steps are: training on the ImageNet dataset to obtain pre-trained weights, and input data preprocessing includes Xavier initialization, He initialization, and initialization using a normal distribution with a deviation of 0.02. The details are as follows:

[0092] Set N in is the number of input neurons, N out is the number of output neurons, then the weight W can be initialized using the following formula:

[0093] W~N(0,0.02 2);

[0094] Here, N(μ,σ 2 ) represents a normal distribution with mean μ and standard deviation σ.

[0095] If ordinary convolution kernels are used in the original backbone network and feature pyramid network, the sensitivity of such convolution kernels to facial features requires more data training to obtain robust feature representation. Therefore, the evaluation method of the present invention integrates variable convolution kernel convolution (AKConv) into the model, replacing all ordinary convolutions to improve the sensitivity of the model to facial features.

[0096] The backbone network and the feature pyramid network use variable convolution kernels for convolution, and the operation includes the following steps:

[0097] (1) Determine the basic integers based on the input parameters to define the coordinates.

[0098] For a given parameter 'num_param' (kernel size for AKConv), calculate the base integer that approximates the square root as 'base_int'.

[0099] Calculate the number of rows 'row_number' = 'num_param' / / 'base_int', and take the modulus 'mod_numer' = 'num_param' % 'base_int'.

[0100] (2) Obtain the sampling coordinates of the conventional convolution kernel.

[0101] Use the 'meshgrid' function to generate a coordinate grid of '(p_n_x,p_n_y)', where the range of x and y is (0,'row_number') and (0,'base_int'). Expand the generated coordinates into a two-dimensional grid to obtain 'p_n_x' and 'p_n_y'.

[0102] (3) Obtain the sampling coordinates of the irregular convolution kernel, merge the sampling coordinates of the irregular convolution kernel into the sampling coordinates of the regular convolution kernel, and obtain the complete sampling coordinates.

[0103] If 'mod_numer' is greater than 0, it means that there is an irregular convolution kernel and additional processing is required.

[0104] Use the 'meshgrid' function to get a coordinate grid of '(mod_p_n_x,mod_p_n_y)' where the range of x is (row_number,row_number+1) and the range of y is (0,'mod_numer').

[0105] Expand the resulting coordinates into a one-dimensional array to get 'mod_p_n_x' and 'mod_p_n_y'.

[0106] The coordinates of the irregular convolution kernel are merged into the coordinates of the regular convolution kernel to obtain the complete sampling coordinates.

[0107] (4) Convert the obtained complete sampling coordinates into a tensor and return it.

[0108] Use 'concat' to connect the merged coordinates into a tensor 'p_n'.

[0109] Reshape the tensor 'p_n' into shape (1,2*'num_param',1,1) and convert it to the specified data type 'dtype'. Finally, return the resulting full coordinate tensor 'p_n'.

[0110] The model uses a feature pyramid network (FPN) to extract features at different scales to adapt to faces of different sizes and to perform face detection and positioning well. The feature pyramid network mainly takes over the feature maps of different stages of the backbone network for processing to strengthen the fusion of high-level semantic information and underlying detail information. The feature pyramid network mainly includes two processes: a bottom-up path and a top-down path combined with lateral connections. Among them, (1) Top-down path: It is a typical convolutional network in which the size of the layer gradually decreases. Usually, the feature size is halved after each maximum pooling layer; (2) Lateral connections: The top high-level feature map is merged with the bottom low-level but high-resolution feature map through upsampling. The details are as follows:

[0111] For feature graphs C2, C3, C4, C5, (where C i Refers to the feature tensors at different stages in different neural networks) The output of the normal convolutional network layer is sorted by the layer depth. Define the operation of merging through lateral connections:

[0112] P l =UpSample(P l+1 )+Conv(C l );

[0113] Among them, Conv(C l ) represents the feature map C l Apply a 1×1 convolution kernel to reduce the channel dimension. UpSample(P l+1 ) represents the feature map P of the previous high level l+1 Upsample to C l The sum of the two is the feature map P after the combined conversion result. lFor the top-level feature map C5, a 1×1 convolution is applied to generate P5:

[0114] P5 = Conv(C5);

[0115] According to the above formula, the feature maps are merged and generated sequentially from the top layer to the bottom layer:

[0116] P4 = UpSample(P5) + Conv(C5);

[0117] P3 = UpSample(P4) + Conv(C3);

[0118] P2 = UpSample(P3) + Conv(C2);

[0119] In this model, a 3×3 convolution is used after the UpSample operation to eliminate the aliasing problem that may be caused by upsampling. That is:

[0120] P l =Conv(UpSample(P l+1 )+Conv(C l ));

[0121] The feature pyramid network uses this hierarchical feature map to allow the neural network to use both high-level semantic information and high-resolution information, which is very useful for detecting objects of different sizes. Through the above expansion, the feature pyramid network can effectively combine deep features with shallow features without significantly increasing the amount of computation.

[0122] S2.2. Divide the data in the labeled face dataset obtained in step S1 into a labeled face training dataset and a labeled face training verification set in a ratio of 80%:20%.

[0123] The main purpose of constructing a labeled face training dataset and a labeled face training validation set is to provide a reliable data foundation for training and evaluating the initial model for facial key point extraction. The labeled face training dataset is used to train the parameters of the deep learning model, and the labeled face training validation set is used to evaluate the generalization ability and performance of the model. The construction of an effective labeled face training dataset and a labeled face training validation set helps ensure that the facial key point extraction model performs well on a wider range of datasets and can more accurately evaluate the performance of the model.

[0124] S2.3, using the labeled face training data set and the labeled face training verification set obtained in step S2.2 to train the initial model for face key point extraction, construct face frame position regression, binary classification, detection frame coordinates and overall loss function, and finally obtain the face key point extraction model by iterating the initial model for face key point extraction. Furthermore, after completing the training of the face key point extraction model, it is necessary to delete the previously collected student face photo data source information to ensure the security of the data source information.

[0125] Furthermore, when training the initial model for facial key point extraction, anchor boxes of different scales and aspect ratios are generated on labeled face images of different scales in the labeled face dataset to cover faces of different sizes and shapes, and then the position offset between each anchor box and the real face box is predicted.

[0126] Anchor boxes of different scales and aspect ratios can be created according to different feature maps of the network. The specific scales and aspect ratios of the anchor box are as follows:

[0127] Set a set of scales to S k and a set of aspect ratios R k , and then generate anchor boxes of different scales and aspect ratios for each pixel on the feature map. Centered on a pixel in the feature map, the formula for generating anchor boxes with different scales and aspect ratios is as follows:

[0128]

[0129] Among them, (x, y) is a pixel coordinate on the feature map, s is the scale, and r is the aspect ratio. It can be obtained that anchor boxes of different scales and aspect ratios are generated at each position on the feature map.

[0130] When training the model, for each anchor box, it is necessary to predict the position offset between it and the real face box (usually predicted using bounding box regression). The formula for position regression is as follows:

[0131] Set the center coordinates of the anchor box to (x a ,y a ), the width and height are (w a ,h a ), the center coordinate of the real face frame is (x g ,y g ), the width and height are (w g ,h g), the goal of position regression is to convert the predicted values ​​(Δx, Δy, Δw, Δh) output by the model into real coordinates.

[0132]

[0133] in, They represent the center coordinates, width, and height of the prediction box obtained through regression. The predicted values ​​(Δx, Δy, Δw, Δh) are values ​​between 0 and 1 and must be scaled for analysis.

[0134] Through the above anchor generation and regression process, the algorithm can effectively use anchor boxes for face detection and positioning. The training process of these anchor boxes and their position regression will help the model to accurately locate and predict the face box.

[0135] The loss function formula for constructing the face frame key point positioning is:

[0136]

[0137] Among them, p j is the key point position predicted by the initial model for face key point extraction, is the actual key point position, L pts It is the loss function value between the key point position predicted by the initial model for face key point extraction and the actual key point position;

[0138] The loss function formula of the constructed face frame position regression SmoothL1 is:

[0139]

[0140] Wherein, beta is the smooth transition threshold, and the empirical value is beta=1.0.

[0141] For the key point localization task, the mean square error (MSE) loss function can be used, and its mathematical expression is:

[0142]

[0143] Among them, y is the actual key point position, is the key point position predicted by the initial model for face key point extraction, n is the number of key points, It is the loss function value between the key point position predicted by the initial model of face key point extraction and the actual key point position.

[0144] Each anchor box is classified into two categories (face / not face) and optimized using Cross-Entropy Loss. The loss function formula for the constructed two-category classification is:

[0145]

[0146] Among them, p i is the probability of predicting a face, y i is the true category label of the anchor box, L cls The binary classification loss function value for extracting facial key points and predicting whether the initial model is a face or not a face.

[0147] The loss function formula of the constructed detection box coordinates is:

[0148] L bbox =1-DIoU Loss(Target,Propose);

[0149]

[0150] IoU(Target,Propose)=(Target∩Propose) / (Target∪Propose);

[0151] Among them, d is the Euclidean distance between the center points of the predicted box (Propose) and the real box (Target); c is the length of the minimum closure diagonal surrounding the entire predicted box (Propose) and the real box (Target); IoU (Target, Propose) is the intersection over union ratio of the predicted box (Propose) and the real box (Target); L bbox The loss function value of the detection box coordinates predicted by the initial model for facial key point extraction;

[0152] The overall loss function formula constructed is:

[0153] L=λ1·L cls +λ2·L bbox +λ3·L pts ;

[0154] Among them, λ1, λ2, and λ3 are hyperparameters, which are manually set parameters.

[0155] S3. When the online class starts, the camera of the student terminal that logs in to the online class is started to obtain the real-time video of the class status of the student terminal, and the student class status data is obtained by parsing.

[0156] S4. Perform image preprocessing on the real-time video data of students in class obtained in step S3 to obtain a real-time preprocessed image of students in class.

[0157] Furthermore, the real-time video data of students attending classes obtained in step S3 is subjected to image preprocessing including image cropping, resizing, and color space conversion operations.

[0158] S5. Input the real-time pre-processed image of the students in class obtained in step S4 into the facial key point extraction model obtained in step S2 for recognition, and then output the information on the relationship between the students' facial key points.

[0159] S6. Determine whether the student is distracted based on the relationship information between the key points of the student's face obtained in step S5, and accumulate the distraction time of the student during the online class.

[0160] Further, the following steps are included:

[0161] S6.1. According to the relationship information between the key points of the student's face obtained in step S5, the intersection between the straight line formed by the left eye and the right corner of the mouth coordinates and the straight line formed by the right eye coordinates and the left corner of the mouth coordinates is calculated to obtain the predicted intersection coordinates.

[0162] According to the biological information of East Asians, the facial features coordinates output by the model are calculated, which is divided into the following steps:

[0163] 1) Calculate the intersection of line segments

[0164] Given the coordinates of the left eye, right eye, left corner of mouth and right corner of mouth in the image, they are respectively expressed as: left eye (x1, y1), right eye (x2, y2), left corner of mouth (x3, y3), right corner of mouth (x4, y4). First, express each pair of coordinates in the form of slope-intercept, and obtain the corresponding m, b according to the coordinates to represent the line segment, in the following form:

[0165] Line 1:

[0166] y1=m1x1+b1;

[0167] Line 2:

[0168] y2=m2x2+b2;

[0169] Then, by calculating the intersection point (x in t er ,y inter ). The calculation formula of the intersection point can be expressed by the following formula:

[0170]

[0171] y inter =m1×x inter +b1;

[0172] S6.2. The intersection distance value is obtained based on the distance between the predicted intersection coordinates obtained in step S6.1 and the nose tip coordinates. The calculation formula for the intersection distance value is:

[0173]

[0174] Among them, (x nose ,y nose ) is the nose tip coordinate, (x inter ,y inter ) is the predicted intersection coordinate, and distance is the intersection distance value. Calculate the intersection of the intersection line and the nose tip coordinate (x nose and nose The distance obtained through the model output) is used to determine whether the face is biased towards other areas or whether the eyes are looking at non-set areas.

[0175] S6.3, according to the intersection distance value obtained in step S6.2 and the length and width of the face detection frame, a distance threshold is calculated, and the calculation formula of the distance threshold is:

[0176]

[0177] dis = distance;

[0178] Among them, dis is the intersection distance value, w is the length of the face detection box, h is the height of the face detection box, softmax() is the normalization function, and r is the distance threshold.

[0179] S6.4, compare the intersection distance value with the distance threshold, if the intersection distance value is greater than the distance threshold, such as Figure 2 (a) and Figure 2 (c) The student status displayed is used to determine that the student is distracted, and the duration of the student’s distraction during the online class is accumulated. Figure 2 (b) The student status displayed indicates that the student is listening carefully to the class and no warning prompt will be issued.

[0180] Furthermore, in step S6.4, when it is determined that the student is distracted, a warning prompt is issued to remind the student to refocus. Figure 2 (a) and Figure 2 (c) The student status displayed indicates that the student is distracted, and a warning is issued in the display box, prompting the student to pay attention.

[0181] Furthermore, the method further includes step S7, counting the distraction time of the student, and generating a statistical report of the distraction time of each student after the online class is over.

[0182] The present invention provides a method for evaluating the online class status of students based on a deep neural network. The method comprises the following steps: after collecting a plurality of student face photos and marking the faces, the images are preprocessed; an initial model for extracting facial key points is established, and the initial model for extracting facial key points is trained on the preprocessed images to obtain a facial key point extraction model; during the online class, a real-time video of the class status of the student terminal is obtained; the real-time video data of the student in class is preprocessed and then input into the facial key point extraction model for recognition, and then the information on the relationship between the student's facial key points is output; the relationship information between the student's facial key points is then used to determine whether the student is distracted, and the distraction time of the student during the online class is accumulated. The trained facial key point extraction model can realize the accurate detection of faces in classroom scenes, extract the location information of facial key points, and realize the attention state analysis method based on biometrics, and can analyze the distraction state and distraction time of students according to video data. The algorithm of the facial key point extraction model is lightweight and can run in real time. The facial key point extraction model adopts AK convolution to improve the model structure, which improves the operation speed. The model can be run on domestic embedded systems, such as Figure 3 As shown in the figure, the facial key point extraction model can be deployed and run on the K210 embedded device. The ability to deploy in multiple environments can meet the application requirements of different scenarios.

[0183] The above description is only a preferred embodiment of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for evaluating student online course status based on deep neural network, characterized in that: The following steps are involved: S1. After obtaining authorization, collect multiple student face photos, mark each student face photo, and then perform image preprocessing to obtain a marked face dataset; S2, establishing an initial model for extracting facial key points, and using the labeled face data set obtained in step S1 to train the initial model for extracting facial key points to obtain a facial key point extraction model; S3. When the online class starts, the camera of the student terminal that logs in to the online class is started to obtain the real-time video of the class status of the student terminal, and the student class status data is obtained by parsing; S4, performing image preprocessing on the real-time video data of students attending class obtained in step S3 to obtain a real-time preprocessed image of students attending class; S5, inputting the real-time pre-processed image of the students in class obtained in step S4 into the facial key point extraction model obtained in step S2 for recognition, and then outputting the information of the relationship between the students' facial key points; S6, judging whether the student is distracted based on the relationship information between the key points of the student's face obtained in step S5, and accumulating the distraction time of the student during the online class; The step S6 comprises the following steps: S6.1, according to the relationship information between the key points of the student's face obtained in step S5, calculate the intersection of the straight line formed by the left eye and the right corner of the mouth coordinates and the straight line formed by the right eye coordinates and the left corner of the mouth coordinates to obtain the predicted intersection coordinates; S6.

2. The intersection distance value is obtained based on the distance between the predicted intersection coordinates obtained in step S6.1 and the nose tip coordinates. The calculation formula for the intersection distance value is: Among them, (x nose ,y nose ) is the nose tip coordinate, (x inter ,y inter ) is the predicted intersection coordinate, and distance is the intersection distance value; S6.3, according to the intersection distance value obtained in step S6.2 and the length and width of the face detection frame, a distance threshold is calculated, and the calculation formula of the distance threshold is: Where dis is the intersection distance value, w is the length of the face detection frame, h is the height of the face detection frame, softmax() is the normalization function, and r is the distance threshold; S6.

4. Compare the intersection distance value with the distance threshold. If the intersection distance value is greater than the distance threshold, the student is determined to be distracted, and the student’s distraction time during the online class is accumulated.

2. According to the method for evaluating the student online course status based on deep neural network in claim 1, it is characterized in that: The step S1 comprises the following steps: S1.

1. After obtaining authorization, collect multiple student face photos in different scenes, and perform data cleaning on the collected multiple student face photos to obtain multiple student face screening image data; S1.2, annotating the face frames and key points of the multiple student face screening image data obtained in step S1.1 to obtain a student face annotated image data set; S1.

3. Perform image cropping, resizing, and color space conversion operations on the image data in the student face annotated image dataset obtained in step S1.2 to obtain a labeled face dataset.

3. A method for evaluating student online course status based on deep neural network according to claim 2, characterized in that: In the step S1.3, after the image data in the student face annotated image data set is subjected to a color space conversion operation, a data enhancement operation is also performed, and the data enhancement operation includes one or more of random image rotation, flipping, and scaling operations.

4. According to the method for evaluating the student online course status based on deep neural network in claim 1, it is characterized in that: The step S2 comprises the following steps: S2.

1. Establish and initialize an initial model for extracting key points of a face. The initial model for extracting key points of a face is a MobileNetV2 network model. A variable convolution kernel is used for convolution in the backbone network and the feature pyramid network in the initial model for extracting key points of a face. S2.2, dividing the data in the labeled face dataset obtained in step S1 into a labeled face training dataset and a labeled face training verification set in a ratio of 80%:20%; S2.

3. Use the labeled face training data set and the labeled face training verification set obtained in step S2.2 to train the initial model for face key point extraction, construct face frame position regression, binary classification, detection frame coordinates and overall loss function, and finally obtain the face key point extraction model by iterating the initial model for face key point extraction.

5. The method for evaluating student online course status based on deep neural network according to claim 4 is characterized in that: In the step S2.1, initializing the initial model for extracting facial key points includes weight initialization and preprocessing of input data, wherein the weight initialization step is: training on the ImageNet dataset to obtain pre-trained weights, and the preprocessing of input data includes Xavier initialization, He initialization, and initialization using a normal distribution with a deviation of 0.02; The backbone network and the feature pyramid network use variable convolution kernels for convolution, and the operation includes the following steps: (1) Determine the basic integers to define the coordinates according to the input parameters; (2) Obtain the sampling coordinates of the conventional convolution kernel; (3) Obtain the sampling coordinates of the irregular convolution kernel, merge the sampling coordinates of the irregular convolution kernel into the sampling coordinates of the regular convolution kernel, and obtain the complete sampling coordinates; (4) Convert the obtained complete sampling coordinates into a tensor and return it.

6. A method for evaluating student online course status based on deep neural network according to claim 4, characterized in that: In the step S2.3, when training the initial model for extracting facial key points, anchor boxes of different scales and aspect ratios are generated on labeled face images of different scales in the labeled face dataset to cover faces of different sizes and shapes, and then the position offset between each anchor box and the real face box is predicted; The loss function formula for constructing the face frame key point positioning is: Among them, p j is the key point position predicted by the initial model for face key point extraction, is the actual key point position, L pts It is the loss function value between the key point position predicted by the initial model for face key point extraction and the actual key point position; The loss function formula for the constructed binary classification is: Among them, p i is the probability of predicting a face, y i is the true category label of the anchor box, L cls The loss function value for the binary classification of the face key point extraction initial model prediction as a face or not a face; The loss function formula of the constructed detection box coordinates is: L bbox =1-DIoU Loss(Target,Propose); IoU(Target,Propose)=(Target∩Propose) / (Target∪Propose); Among them, d is the Euclidean distance between the center points of the predicted box (Propose) and the real box (Target); c is the length of the minimum closure diagonal surrounding the entire predicted box (Propose) and the real box (Target); IoU (Target, Propose) is the intersection over union ratio of the predicted box (Propose) and the real box (Target); L bbox The loss function value of the detection box coordinates predicted by the initial model for facial key point extraction; The overall loss function formula constructed is: L=λ1·L cls +λ2·L bbox +λ3·L pts ; Among them, λ1, λ2, and λ3 are hyperparameters.

7. The method for evaluating student online course status based on deep neural network according to claim 1, characterized in that: In the step S4, the real-time video data of students in class obtained in step S3 is subjected to image preprocessing including image cropping, resizing, and color space conversion operations.

8. The method for evaluating student online course status based on deep neural network according to claim 1, characterized in that: In the step S6.4, when it is determined that the student is distracted, a prompt is issued to warn the student of distraction.

9. The method for evaluating student online course status based on deep neural network according to claim 1, characterized in that: The step S7 is also included, where the distraction time of the student is counted, and after the online class is over, a statistical report is generated on the distraction time of each student.

Citation Information

Patent Citations

  • Character attention judgment method, device and system, equipment and storage medium

    CN109886246A

  • Method and device for determining human face deflection angle, computer equipment and medium

    CN111914783A