A classroom behavior recognition and classification method and system based on improved Densenet model

By adding Stem Block and channel attention modules to the Densenet model, combined with deep learning and self-attention mechanisms, the problem of complex image backgrounds and large numbers of people in classroom behavior recognition is solved, the recognition accuracy and feature extraction efficiency are improved, and the wisdom is satisfied. Classroom analysis needs in learning environments.

CN114529867BActive Publication Date: 2024-09-24ANHUI NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210035013.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-13
Publication Date
2024-09-24
Estimated Expiration
2042-01-13

AI Technical Summary

Technical Problem

The existing technology has problems in classroom behavior recognition, such as complex image backgrounds, large numbers of people, and difficulty in feature extraction, resulting in low recognition accuracy and difficulty in meeting the needs of large-scale classroom analysis in smart learning environments.

Method used

Using the improved Densenet model, by adding Stem Block module and channel attention module to the model, a classroom behavior database is constructed, deep learning is used to extract deep features of images, and a self-attention mechanism is added to the network to improve feature extraction and classification. efficiency.

Benefits of technology

It improves the accuracy and feature extraction efficiency of classroom behavior recognition, can more effectively focus on important feature areas of images, enhances the feature expression ability of the network, and meets the needs of large-scale classroom analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114529867B
    Figure CN114529867B
Patent Text Reader

Abstract

The present invention discloses a method and system for classifying classroom behaviors based on an improved Densenet model, including: collecting classroom behavior image data through a camera to construct a classroom behavior database; adding a StemBlock module to the Densenet model to obtain a first Densenet model; adding a channel attention module to the first Densenet model to obtain a second Densenet model; inputting the behavior image data in the classroom behavior database into the improved network model, i.e., the second Densenet model, to identify and classify classroom behaviors. The present invention trains existing data sets to extract deep features of images, thereby obtaining richer image information, and using the StemBlock module to improve the feature expression capability of the network without incurring too much computational time consumption. Adding a self-attention mechanism between two DenseBlocks can make the network pay more attention to important feature areas of the image, without losing important information of the sample, thereby making feature extraction more efficient and better for subsequent classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of classroom behavior recognition and classification, and in particular to a classroom behavior recognition and classification method and system based on an improved Densenet model. Background Art

[0002] In classroom teaching activities, students are the main body of learning activities, and their behavior status is a direct reflection of teaching activities. Classroom behavior recognition has always been a research focus and difficulty in the field of education. Therefore, student classroom behavior analysis is not only an important part of teaching analysis, but also an important factor affecting student learning and teacher teaching efficiency. At present, higher requirements are put forward for student classroom behavior analysis, judging students' learning status through their behavior, and then forming teaching feedback, but this method is time-consuming and labor-intensive, and cannot meet the needs of large-scale classroom analysis in today's smart learning environment. It is becoming more and more important to realize intelligent student classroom behavior recognition.

[0003] In recent years, with the development of technologies such as artificial intelligence and computer vision, as well as the use of various classroom recording and broadcasting equipment, some research on the use of computer vision and artificial intelligence technologies to realize the recognition of student classroom behavior has begun to appear in China. For example, in a classroom scene, the Kinect device is used to extract the human skeleton feature vector, and then the SVM classifier is used to classify the feature vector and recognize the student's posture and behavior. This method realizes the combination of human skeleton features and traditional machine learning, but it uses the traditional machine learning method, and it is also necessary to set up a special Kinect device in the classroom to collect data. The operation is complicated and the accuracy is not high. Although image classification and recognition in the prior art can be realized, it also has certain limitations. For classroom behavior images, the background in the image is relatively complex, there are many people, and feature extraction is relatively difficult. Therefore, it is necessary to provide a behavior recognition classification method with a high recognition rate of classroom behavior. Summary of the invention

[0004] In view of the shortcomings of the prior art mentioned above, the purpose of the present invention is to provide a classroom behavior recognition and classification method and system based on an improved Densenet model, which is used to solve the problems in the prior art that for classroom behavior images, the background in the image is relatively complex, there are many people, and feature extraction is relatively difficult.

[0005] To achieve the above objectives and other related objectives, the present invention provides a classroom behavior recognition and classification method based on an improved Densenet model, comprising:

[0006] S1, collect classroom behavior image data through cameras and build a classroom behavior database;

[0007] S2. Add the Stem Block module to the Densenet model to obtain the first Densenet model;

[0008] S3, adding a channel attention module to the first Densenet model to obtain a second Densenet model;

[0009] S4. Input the behavior image data in the classroom behavior database into the improved network model, namely the second Densenet model, to identify and classify classroom behaviors.

[0010] In one embodiment of the present invention, the classroom behavior database includes hand-raising behavior data, sleeping behavior data, and looking around behavior data.

[0011] In one embodiment of the present invention, the step S2 of adding a Stem Block module to the Densenet model to obtain a first Densenet model includes:

[0012] The Stem Block module replaces the 7×7 convolution and 3×3 maximum pooling in the Densenet model;

[0013] The convolution kernel of the Densenet model uses a two-dimensional discrete convolution on a two-dimensional image, and its calculation formula is:

[0014]

[0015] Among them, I(x, y) represents the value of the feature map at the position (x, y), k(x, y) represents the m×n dimensional convolution kernel, the input feature map size of a certain layer of convolution kernel is M×N, the convolution kernel size is k×k, the padding is t, and the step size is s;

[0016] The behavioral image data is received using a 3×3 convolution with a depth of 32 and a stride of 2 to extract features, which is then divided into two parallel operations. One of the parallel operations is to first perform a 1×1 convolution operation with a depth of 16 and a stride of 1, and then a 3×3 convolution operation with a depth of 32 and a stride of 2; the other parallel operation is to perform a maximum pooling operation of a 2×2 convolution with a stride of 2, and finally concatenate the outputs of the two parallel operations into a 1×1 convolution with a depth of 32 and a stride of 1.

[0017] In one embodiment of the present invention, adding a channel attention module to the first Densenet model in step S3 to obtain a second Densenet model includes:

[0018] To select the channel in the channel attention module, the formula is:

[0019]

[0020] Among them, σ is the sigmoid function, F represents the original feature map, Avgpool(F) is the average pooling, MaxPool(F) is the maximum pooling, and represents the average pooling feature and the maximum pooling feature, M c (F) is the generated channel attention map. MLP is a shared network consisting of a multi-layer perceptron, including one hidden layer;

[0021] The global average pooling and global maximum pooling information of each feature map are calculated separately, and then added after the fully connected layer to obtain the channel attention parameters. Both share the same fully connected network, M c (F) is element-wise multiplied with F to obtain F′, in, is the element-wise multiplication, and F′ is the calculated channel attention map.

[0022] The present invention also provides a classroom behavior recognition and classification system based on an improved Densenet model, comprising:

[0023] Camera, used to collect classroom behavior image data and build a classroom behavior database;

[0024] The Stem Block module adding unit is used to add the Stem Block module to the Densenet model to obtain the first Densenet model;

[0025] A channel attention module adding unit is used to add a channel attention module to the first Densenet model to obtain a second Densenet model;

[0026] The input unit is used to input the behavior image data in the classroom behavior database into the improved network model, namely the second Densenet model, to identify and classify classroom behaviors.

[0027] The present invention also provides an electronic device, including a processor and a memory, wherein the memory stores program instructions, and the processor runs the program instructions to implement the above-mentioned classroom behavior recognition and classification method based on the improved Densenet model.

[0028] As described above, the classroom behavior recognition and classification method and system based on the improved Densenet model of the present invention have the following beneficial effects:

[0029] The classroom behavior recognition and classification method based on the improved Densenet model of the present invention uses the deep learning model Densenet to train the existing data set, which can extract the deep features of the image, thereby obtaining richer image information, and using the Stem Block module, it can improve the feature expression ability of the network without bringing too much computational time. Adding a self-attention mechanism between two Dense Blocks can make the network pay more attention to the important feature areas of the image, and will not lose important information of the sample, thereby making feature extraction more efficient and better for classification. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 A workflow diagram of a classroom behavior recognition and classification method based on an improved Densenet model provided in an embodiment of the present application.

[0031] Figure 2 A Stem Block structure diagram of a classroom behavior recognition and classification method based on an improved Densenet model provided in an embodiment of the present application.

[0032] Figure 3 An improved Densenet network structure diagram of the classroom behavior recognition and classification method based on the improved Densenet model provided in an embodiment of the present application.

[0033] Figure 4 A channel attention module is added to the classroom behavior recognition and classification method based on the improved Densenet model provided in an embodiment of the present application. DETAILED DESCRIPTION

[0034] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0035] It should be noted that the illustrations provided in the following embodiments are only used to illustrate the basic concept of the present invention in a schematic manner, and thus the illustrations only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0036] See also Figure 1 , Figure 1The present invention provides a method for classifying classroom behaviors based on an improved Densenet model, comprising:

[0037] Step S1, collect classroom behavior image data through a camera to build a classroom behavior database. The classroom behavior database includes hand-raising behavior data, sleeping behavior data, and looking around behavior data.

[0038] Step S2: Add a Stem Block module to the Densenet model to obtain the first Densenet model.

[0039] See also Figure 2 , Figure 2 The Stem Block structure diagram of the classroom behavior recognition and classification method based on the improved Densenet model provided in the embodiment of the present application. Introduction to the Densenet model: DenseNet proposes a radical dense connection mechanism, that is, all layers are interconnected. Specifically, each layer will accept all previous layers as its additional input. It can be seen that each layer is connected to all previous layers in the channel dimension and serves as the input of the next layer. It mainly includes two component modules: dense block and transition layer. In each dense block, the output x of the lth layer l Satisfying formula (1), the nonlinear conversion function H between layers l (·) contains three consecutive operations: batch normalization, linear rectification function and 3×3 convolution, and defines the hyperparameter k as the growth rate. If H l (·) generates k feature maps, then the lth layer will have k0+k×(l-1) feature map inputs (k0 is the number of channels of the first input layer), which will result in too many inputs for each layer. Therefore, a convolution 1×1 (Conv1×1) is introduced as a bottle neck layer before the convolution 3×3 (Conv3×3) of each dense block to reduce the number of feature map inputs. The bottle neck layer is used to connect every two dense blocks, and the size of the feature map is changed through convolution and pooling operations:

[0040] x l =H l ([x0,x1,···,x l-1 ]) (1)

[0041] Among them, H() represents the nonlinear transformation function, l represents the number of output layers, and xl is the output of the lth layer. For a network with L layers, DenseNet contains a total of L(L+1) / 2 connections, which is a dense connection. Moreover, DenseNet directly connects feature maps from different layers, which can achieve feature reuse and improve efficiency.

[0042] See also Figure 2 , Figure 3 , Figure 2 A Stem Block structure diagram of a classroom behavior recognition and classification method based on an improved Densenet model provided in an embodiment of the present application. Figure 3 The improved Densenet network structure diagram of the classroom behavior recognition and classification method based on the improved Densenet model provided in the embodiment of the present application. In step S2, the Stem Block module is added to the Densenet model to obtain the first Densenet model, which includes:

[0043] The Stem Block module replaces the 7×7 convolution and 3×3 maximum pooling in the Densenet model;

[0044] The convolution kernel of the Densenet model uses a two-dimensional discrete convolution on a two-dimensional image, and its calculation formula is:

[0045]

[0046] Among them, I(x,y) represents the value of the feature map at the position (x,y), k(x,y) represents the m×n dimensional convolution kernel, the input feature map size of a certain layer of convolution kernel is M×N, the convolution kernel size is k×k, the padding is t, and the step size is s;

[0047] The behavioral image data is received using a 3×3 convolution with a depth of 32 and a stride of 2 to extract features, which is then divided into two parallel operations. One of the parallel operations is to first perform a 1×1 convolution operation with a depth of 16 and a stride of 1, and then a 3×3 convolution operation with a depth of 32 and a stride of 2; the other parallel operation is to perform a maximum pooling operation of a 2×2 convolution with a stride of 2, and finally concatenate the outputs of the two parallel operations into a 1×1 convolution with a depth of 32 and a stride of 1.

[0048] The improved DenseNet network structure is shown in Table 1. First, a 3x3 convolution is input, and then two steps are performed, one is 1×1 and 3×3 convolution, and the other is 2×2 maximum pooling. These two steps are then spliced ​​together and a 1×1 convolution operation is performed. Table 1 shows the parameters of the improved DenseNet network structure.

[0049] Table 1:

[0050]

[0051] Step S3, add a channel attention module to the first Densenet model to obtain a second Densenet model. The attention mechanism originates from the study of human visual attention. Humans can quickly scan the global image to obtain the target area that needs to be focused on, and then pay more attention to this area to obtain more detailed information about the target that needs to be focused on, while suppressing other useless information. This is a means for humans to quickly filter out high-value information from a large amount of information using limited attention resources. Inspired by human visual attention, the field of deep learning introduces attention to allow machines to pay more attention to the focal information in the image. Learn or extract the weight distribution from the features, and then apply this weight distribution to the original features to change the distribution of the original features, enhance the effective features, and suppress invalid features or noise.

[0052] See also Figure 4 , Figure 4 The added channel attention module of the classroom behavior recognition and classification method based on the improved Densenet model provided in the embodiment of the present application. In the present invention, the channel attention module attention mechanism is added between Dense Block1 and Dense Block2 of the improved Densenet network, and the discriminator network is focused on the important features of the image through the attention mechanism, thereby stimulating the generator network to generate more "realistic" images.

[0053] In step S3, a channel attention module is added to the first Densenet model to obtain a second Densenet model, including:

[0054] To select the channel in the channel attention module, the formula is:

[0055]

[0056] Among them, σ is the sigmoid function, F represents the original feature map, Avgpool(F) is the average pooling, MaxPool(F) is the maximum pooling, and represents the average pooling feature and the maximum pooling feature, M c (F) is the generated channel attention map. MLP is a shared network consisting of a multi-layer perceptron, including one hidden layer;

[0057] The global average pooling and global maximum pooling information of each feature map are calculated separately, and then added after the fully connected layer to obtain the channel attention parameters. Both share the same fully connected network, Mc (F) is multiplied element-wise by F to obtain

[0058] F′, in, is element-wise multiplication, and F′ is the calculated channel attention map. In order to effectively calculate channel attention, the spatial dimension of the input feature map needs to be compressed. For the aggregation of spatial information, the commonly used method is average pooling. Maximum pooling collects another important clue about unique object features, which can infer attention on finer channels. Therefore, the features of average pooling and maximum pooling are used at the same time.

[0059] Step S4: input the behavior image data in the classroom behavior database into the improved network model, namely the second Densenet model, to identify and classify classroom behaviors.

[0060] The present invention also provides a classroom behavior recognition and classification system based on an improved Densenet model, comprising:

[0061] Camera, used to collect classroom behavior image data and build a classroom behavior database;

[0062] The Stem Block module adding unit is used to add the Stem Block module to the Densenet model to obtain the first Densenet model;

[0063] A channel attention module adding unit is used to add a channel attention module to the first Densenet model to obtain a second Densenet model;

[0064] The input unit is used to input the behavior image data in the classroom behavior database into the improved network model, namely the second Densenet model, to identify and classify classroom behaviors.

[0065] The present invention also proposes an electronic device, which includes a processor and a memory, wherein the memory stores program instructions, and the processor runs the program instructions to implement the above-mentioned classroom behavior recognition and classification method based on the improved Densenet model. The processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components; the memory may include a random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The memory can also be an internal memory of the random access memory (RAM) type, and the processor and memory can be integrated into one or more independent circuits or hardware, such as an application-specific integrated circuit (ASIC). It should be noted that the computer program in the above-mentioned memory can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, an electronic device, or a network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention.

[0066] In summary, the classroom behavior recognition and classification method based on the improved Densenet model of the present invention uses the deep learning model Densenet to train the existing data set, which can extract the deep features of the image, thereby obtaining richer image information, and using the Stem Block module, it is possible to improve the feature expression ability of the network without bringing too much computational time. Adding a self-attention mechanism between two Dense Blocks can make the network pay more attention to the important feature areas of the image, without losing important information of the sample, thereby making feature extraction more efficient and better for classification afterwards.

[0067] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. A classroom behavior recognition and classification method based on an improved Densenet model, characterized in that: include: S1, collect classroom behavior image data through cameras and build a classroom behavior database; S2. Add the Stem Block module to the Densenet model to obtain the first Densenet model; S3, adding a channel attention module to the first Densenet model to obtain a second Densenet model; S4, inputting the behavior image data in the classroom behavior database into the improved network model, namely the second Densenet model, to identify and classify classroom behaviors; In step S2, the Stem Block module is added to the Densenet model to obtain the first Densenet model, which includes: The Stem Block module replaces the 7×7 convolution and 3×3 maximum pooling in the Densenet model; The convolution kernel of the Densenet model uses a two-dimensional discrete convolution on a two-dimensional image, and its calculation formula is: Among them, I(x,y) represents the value of the feature map at the position (x,y), k(x,y) represents the m×n dimensional convolution kernel, the input feature map size of a certain layer of convolution kernel is M×N, the convolution kernel size is k×k, the padding is t, and the step size is s; The behavioral image data is received using a 3×3 convolution with a depth of 32 and a stride of 2 to extract features, which is then divided into two parallel operations. One of the parallel operations is to first perform a 1×1 convolution operation with a depth of 16 and a stride of 1, and then perform a 3×3 convolution operation with a depth of 32 and a stride of 2; the other parallel operation is to perform a maximum pooling operation of a 2×2 convolution with a stride of 2, and finally concatenate the outputs of the two parallel operations and input them into a 1×1 convolution with a depth of 32 and a stride of 1; In step S3, a channel attention module is added to the first Densenet model to obtain a second Densenet model, including: To select the channel in the channel attention module, the formula is: Among them, σ is the sigmoid function, F represents the original feature map, Avgpool(F) is the average pooling, MaxPool(F) is the maximum pooling, and represents the average pooling feature and the maximum pooling feature, M c (F) is the generated channel attention map. MLP is a shared network consisting of a multi-layer perceptron, including one hidden layer; The global average pooling and global maximum pooling information of each feature map are calculated separately, and then added after the fully connected layer to obtain the channel attention parameters. Both share the same fully connected network, M c (F) is element-wise multiplied with F to obtain F′, in, is the element-wise multiplication, and F′ is the calculated channel attention map.

2. According to claim 1, a classroom behavior recognition and classification method based on an improved Densenet model is characterized by: The classroom behavior database includes hand-raising behavior data, sleeping behavior data, and looking around behavior data.

3. A classroom behavior recognition and classification system based on an improved Densenet model, characterized in that: include: Camera, used to collect classroom behavior image data and build a classroom behavior database; The Stem Block module adding unit is used to add the Stem Block module to the Densenet model to obtain the first Densenet model; A channel attention module adding unit is used to add a channel attention module to the first Densenet model to obtain a second Densenet model; An input unit, used to input the behavior image data in the classroom behavior database into the improved network model, namely the second Densenet model, to identify and classify the classroom behavior; The Stem Block module adds units and is also used for: The Stem Block module replaces the 7×7 convolution and 3×3 maximum pooling in the Densenet model; The convolution kernel of the Densenet model uses a two-dimensional discrete convolution on a two-dimensional image, and its calculation formula is: Among them, I(x,y) represents the value of the feature map at the position (x,y), k(x,y) represents the m×n dimensional convolution kernel, the input feature map size of a certain layer of convolution kernel is M×N, the convolution kernel size is k×k, the padding is t, and the step size is s; The behavioral image data is received using a 3×3 convolution with a depth of 32 and a stride of 2 to extract features, which is then divided into two parallel operations. One of the parallel operations is to first perform a 1×1 convolution operation with a depth of 16 and a stride of 1, and then perform a 3×3 convolution operation with a depth of 32 and a stride of 2; the other parallel operation is to perform a maximum pooling operation of a 2×2 convolution with a stride of 2, and finally concatenate the outputs of the two parallel operations and input them into a 1×1 convolution with a depth of 32 and a stride of 1; The channel attention module adds a unit, further used for: To select the channel in the channel attention module, the formula is: Among them, σ is the sigmoid function, F represents the original feature map, Avgpool(F) is the average pooling, MaxPool(F) is the maximum pooling, and represents the average pooling feature and the maximum pooling feature, M c (F) is the generated channel attention map. MLP is a shared network consisting of a multi-layer perceptron, including one hidden layer; The global average pooling and global maximum pooling information of each feature map are calculated separately, and then added after the fully connected layer to obtain the channel attention parameters. Both share the same fully connected network, M c (F) is element-wise multiplied with F to obtain F′, in, is the element-wise multiplication, and F′ is the calculated channel attention map.

4. An electronic device, comprising a processor and a memory, wherein the memory stores program instructions, characterized in that: The processor runs program instructions to implement the classroom behavior recognition and classification method based on the improved Densenet model as described in claim 1 or 2.