Classroom teaching comfort evaluation model training method and evaluation method
By constructing a classroom teaching comfort assessment model and utilizing technologies such as generative adversarial networks, dynamic population evolution optimization, and autoencoder neural networks, the problems of insufficient data and poor model generalization ability in classroom teaching comfort assessment are solved, thus realizing intelligent management and accurate assessment of classroom teaching.
Patent Information
- Application Number
- CN202511468049.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2026-03-10
AI Technical Summary
The lack of effective artificial intelligence models in existing technologies to assess classroom teaching comfort leads to deficiencies in smart classroom management.
Data is collected by IoT sensors, expanded using a generative adversarial network model, and then used for feature extraction and feature dimensionality reduction by a dynamic population evolution optimization neural network model. Finally, a deep neural decision tree algorithm based on local topology is used for classification to construct a classroom teaching comfort assessment model.
It has improved the level of intelligent management of classroom teaching, solved the problem of insufficient data, enhanced the generalization ability and classification accuracy of the model, and achieved effective assessment of classroom teaching comfort.
Smart Images

Figure CN121637264A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, and in particular to a training method and evaluation method for an assessment model of classroom teaching comfort. Background Technology
[0002] With the development of intelligent technologies, the concept of smart classrooms has gradually emerged and become an important application scenario in the education field. By deploying various IoT sensors in the classroom, such as temperature, light, sound, and location sensors, real-time environmental data and student behavior data can be collected, providing strong support for the monitoring, control, and management of the teaching environment.
[0003] As one application approach, artificial intelligence models are used to assess classroom teaching comfort based on real-time data collected from smart classrooms, and the assessment results are fed back to smart classroom administrators for further processing. However, in practice, it has been found that there is currently no perfect artificial intelligence model solution that can achieve good results in the above application area. Summary of the Invention
[0004] In view of this, the purpose of this disclosure is to provide a training method and an evaluation method for an assessment model of classroom teaching comfort, so as to solve the above problems.
[0005] In a first aspect, embodiments of this disclosure provide a method for training a classroom teaching comfort assessment model, including:
[0006] Data samples were collected using IoT sensors within the classroom.
[0007] The labeled data samples are augmented using a data augmentation model;
[0008] The expanded labeled data samples are input into the feature extraction model for feature extraction to obtain multidimensional feature representations; and
[0009] The multidimensional feature representation is input into the feature dimensionality reduction model to perform feature dimensionality reduction, so as to obtain a low-dimensional feature representation. The feature dimensionality reduction model is the encoder in a trained autoencoder neural network algorithm.
[0010] The low-dimensional feature representation is input into a classifier for training. The classifier is a trained deep neural decision tree algorithm based on local topology. The classifier is used to output the classroom teaching comfort level.
[0011] The training process of the local topology-based deep neural decision tree algorithm includes the following steps:
[0012] S1: Initialize the deep neural decision tree;
[0013] S2: Perform nonlinear transformation on each decision node;
[0014] S3: By simulating quantum behavior, determine the feature segmentation that maximizes information gain, and update the decision threshold accordingly. The simulation strategy is implemented through the following iterative process: (4.5) In the formula, It is the first The decision threshold for the next iteration It is the first The decision threshold for the next iteration; It is the learning rate of the deep neural decision tree; Based on quantum state The calculated quantum gradient is used to simulate the diffusion and superposition of quantum states in probability space;
[0015] S4: Dynamically adjust the tree structure based on information obtained from the neural network module and quantum search.
[0016] S5: Determine whether the preset stopping iteration condition is met. If not, jump to S3; if yes, end the training process.
[0017] In some embodiments, the data augmentation model is a generator in a pre-trained generative adversarial network model, and the loss function of the generator includes a sparse regularization term related to the weights and biases of each layer of the generator.
[0018] In some embodiments, the loss function of the generator is expressed as the following equation: (1.8) (1.9) (1.10)
[0019] in, It is the loss function of the generator. The probability that the discriminator identifies the data as real. The probability that the discriminator classifies the data as fake. For sparse regularization terms, Describing the L1 norm, This represents the L1 norm of each parameter of the generator. It is a hyperparameter of regularization strength. and They are the first L1 norm of layer weights and biases.
[0020] In some embodiments, the learning rate of the generator and the learning rate of the discriminator in the generative adversarial model are both related to the loss difference between the generator and the discriminator.
[0021] In some embodiments, the learning rate of the generator and the learning rate of the discriminator in the generative adversarial model are expressed by the following equation: (1.11) (1.12) (1.13)
[0022] in, This represents the loss of the discriminator. This represents the loss of the generator. This represents the loss difference between the discriminator and the generator. and These are the learning rate of the generator and the learning rate of the discriminator, respectively. It is the base learning rate. It is an adjustment factor.
[0023] In some embodiments, the parameter update method of the generator and the discriminator is expressed by the following equation: (1.14) (1.15) In the formula, and These are the updated learning rates for the generator and the discriminator. and These are the learning rates of the generator and discriminator before the update. and These are the gradients of the generator's loss function and the discriminator's loss function, respectively.
[0024] In some embodiments, the feature extraction model is trained using a dynamically optimized population evolutionary neural network model, the training process of which includes:
[0025] An initial population is set up based on the biomimetic algorithm initialization method;
[0026] For each individual in the population, the input data is processed using its corresponding neural network configuration, the output of the model is calculated, and its performance is evaluated according to a predetermined loss function.
[0027] Based on the individual's fitness, the best-performing individual from the current population is selected and retained as a candidate solution for the next generation;
[0028] For the candidate solutions of the next generation, new individuals are generated through crossover and mutation operations; and
[0029] Determine whether the preset stopping iteration condition is met. If not, jump to the step of processing the input data, calculating the model output, and evaluating its performance according to the predetermined loss function for each individual in the population using its corresponding neural network configuration. If yes, end the training process.
[0030] In some embodiments, the predetermined loss function is expressed as the following equation: (2.3) (2.4) (2.5)
[0031] in, For the first The loss of the neural network corresponding to each individual. This indicates the number of samples entered in the current batch; Represents the composite loss function. Represents the neural network model function. Indicates the first Features of each sample Indicates the first The label of each sample, For the first The weights of the neural network corresponding to each individual. It is the mean square error function. It is a regularization term. For regularization parameters, For the first The neural network corresponding to the nth individual Each weight.
[0032] In some embodiments, the autoencoder neural network algorithm includes an encoder, a decoder, and a feature adjustment module. The encoder employs a multi-layer nonlinear mapping structure to map high-dimensional data to a low-dimensional feature space. The feature adjustment module performs multiple rounds of recursive optimization on the low-dimensional features and adjusts the weights of each feature in each iteration based on the performance of the features in the previous round. The decoder remaps the low-dimensional features back to the high-dimensional space.
[0033] In some embodiments, performing node nonlinear transformation on each decision node includes:
[0034] Each decision node is implemented using a feedforward network, with the data features of the decision node as input and the decision signal as output.
[0035] The feature weights in each decision node are dynamically adjusted based on the adaptive feature feedback mechanism, and the feature weights are automatically adjusted based on the performance of each feature in the classification process by monitoring the feature utility of each feature.
[0036] In some embodiments, the output is represented as: (4.2)
[0037] In the formula, It is the dimension of the input features. and These are the weights and biases of the feedforward network. It is an activation function based on nonlinear components. It is the Sigmoid activation function. It is the learning rate parameter. For the first The feature utility of each feature.
[0038] In some embodiments, at each decision node, the first... The feature utility of each feature is represented as follows:
[0039] (4.3)
[0040] In the formula, It is a classification result set. It is a classification The output probability, It is the gain corresponding to classification accuracy. Representation of features For output Sensitivity.
[0041] In some embodiments, the activation function based on the nonlinear component is expressed as:
[0042] (4.4)
[0043] In the formula, It is the hyperbolic tangent function. and It refers to additional weights and biases within the same decision node.
[0044] In some embodiments, the data sample includes one or more of the following items: classroom temperature, light intensity, noise level, student density, time, student interaction frequency, classroom door and window status, and student attention index.
[0045] Secondly, embodiments of this disclosure provide a method for evaluating classroom teaching comfort, including:
[0046] Collect real-time data through IoT sensors;
[0047] Feature extraction models are used to extract features from real-time data to obtain multidimensional feature representations;
[0048] The multidimensional feature representation is input into a feature dimensionality reduction model for feature reduction to obtain a low-dimensional feature representation. The feature dimensionality reduction model is a trained encoder based on an autoencoder neural network algorithm.
[0049] The low-dimensional feature representation is input into a classifier to output the corresponding classroom teaching comfort level. The classifier is a trained local topology-based deep neural decision tree algorithm. The training process of the local topology-based deep neural decision tree algorithm includes the following steps:
[0050] S1: Initialize the deep neural decision tree;
[0051] S2: Perform nonlinear transformation on each decision node;
[0052] S3: By simulating quantum behavior, determine the feature segmentation that maximizes information gain, and update the decision threshold accordingly. The simulation strategy is implemented through the following iterative process:
[0053] (4.5)
[0054] In the formula, It is in the The decision threshold for the next iteration It is in the The decision threshold for the next iteration; It is the learning rate of the deep neural decision tree; Based on quantum state The calculated quantum gradient is used to simulate the diffusion and superposition of quantum states in probability space;
[0055] S4: Dynamically adjust the tree structure based on information obtained from the neural network module and quantum search.
[0056] S5: Determine whether the preset stopping iteration condition is met. If not, jump to S3; if yes, end the training process.
[0057] Thirdly, embodiments of this disclosure provide a computer device, including: a memory, the memory being used to store a processing program;
[0058] A processor that implements the above-described method when executing the processing program.
[0059] The classroom teaching comfort assessment model training method and classroom teaching comfort assessment method provided in this disclosure apply artificial intelligence to classroom teaching comfort assessment, which helps to improve the level of intelligent management of classroom teaching. Attached Figure Description
[0060] The above and other objects, features and advantages of the present disclosure will become clearer from the following description of embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0061] Figure 1 This is a flowchart of a classroom teaching comfort assessment model training method provided in an embodiment of this disclosure;
[0062] Figure 2 yes Figure 1 A flowchart of the training process for a generative adversarial network model in [the context of the training process].
[0063] Figure 3 yes Figure 1 A flowchart illustrating the training process of the feature extraction model (a neural network model based on dynamic population evolution optimization) in the diagram.
[0064] Figure 4 yes Figure 1 A flowchart illustrating the training process of the feature dimensionality reduction model (a neural network model based on dynamic population evolution optimization) in the image;
[0065] Figure 5 yes Figure 1 A flowchart of the training process of the classifier (local topology deep neural decision tree algorithm) in the algorithm;
[0066] Figure 6 This is a flowchart of a method for evaluating classroom teaching comfort provided in an embodiment of this disclosure. Detailed Implementation
[0067] Embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. In the various drawings, the same elements are indicated by similar reference numerals. For clarity, the various parts in the drawings are not drawn to scale. Furthermore, certain well-known parts may not be shown.
[0068] The following description of embodiments of the present disclosure is based on examples, but the embodiments of the present disclosure are not limited to these embodiments. In the detailed description of the embodiments of the present disclosure below, certain specific details are described in detail. Those skilled in the art can fully understand the embodiments of the present disclosure without these details. To avoid obscuring the essence of the embodiments of the present disclosure, well-known methods, processes, flows, elements, and circuits are not described in detail.
[0069] Unless the context explicitly requires it, the terms "comprising," "including," and similar terms throughout the specification and claims should be interpreted as encompassing rather than exclusive or exhaustive; that is, meaning "including but not limited to." Furthermore, in the description of embodiments of this disclosure, unless otherwise stated, "a plurality of" means two or more.
[0070] Figure 1 This is a flowchart illustrating a method for training a classroom teaching comfort assessment model, as provided in an embodiment of this disclosure. Figure 1 As shown, the method includes the following steps.
[0071] In step S10, data samples are collected using IoT sensors.
[0072] In step S20, the labeled data samples are augmented using a generative adversarial network model.
[0073] In step S30, the expanded labeled data samples are input into the feature extraction model for feature extraction to obtain multidimensional feature representation.
[0074] In step S40, the multidimensional feature representation is input into the feature dimensionality reduction model to perform feature dimensionality reduction in order to obtain a low-dimensional feature representation.
[0075] In step S50, the low-dimensional feature representation is input into the classifier for training.
[0076] Regarding step S10, the data collection sources in this embodiment mainly consist of various IoT sensors deployed in the smart classroom, including but not limited to temperature sensors, light sensors, sound sensors, and student location tracking sensors. Data collection is performed using a real-time wireless transmission system, and all collected data is stored in a structured format in a locally secure database. In some embodiments, the data collected by the IoT sensors includes classroom temperature (Ra), light intensity (Rb), noise level (Rc), student density (Rd), time (Re), student interaction frequency (Rh), classroom door and window status (Ri), and student attention index (Rj). In some embodiments, this data is organized in JSON (JavaScript Object Notation) format and stored in a locally secure database.
[0077] Below is an example of organizing this data in JASON format:
[0078] Sample{
[0079] {
[0080] Environmental factors:
[0081] {"Temperature": 22,"Light Intensity": 500,"Noise Level": 45,"Student Density": 0.8},
[0082] "Time and Courses":
[0083] {"Time": "2023-11-28 10:00","Course Type": "Mathematics"},
[0084] Classroom facilities:
[0085] {"Door and window status": "Closed"},
[0086] Student Status: {"Student Attention Index": 85}
[0087] }
[0088] Furthermore, the data samples are labeled with classroom teaching comfort levels, using manual labeling. For example, classroom teaching comfort levels are divided into 5 levels, with higher levels indicating greater comfort. The labels can be combined with the aforementioned JASON format data; for instance, using the above sample, a data item can be added as: {"Classroom Teaching Comfort Level": 1}.
[0089] Regarding step S20, it is understood that the collection, labeling, and preprocessing of data samples for smart classrooms are time-consuming and labor-intensive, and insufficient samples can easily lead to poor generalization ability of model training and affect the accuracy of the model. Therefore, this step uses a generative adversarial network model based on dummy variables to expand the data samples in order to solve the problem of insufficient samples in certain categories of the smart classroom dataset, and enhances the generalization ability of model training by using the powerful capabilities of the generative adversarial network model to generate high-quality and reliable data samples.
[0090] In Generative Adversarial Networks (GANs), the generator and discriminator are two key components. Through an adversarial process, they learn how to generate realistic data and how to distinguish between real and generated data. The GAN model used in this step adds a sparse regularization technique for local smoothness to the traditional GAN, optimizing the characteristics of the generated data and ensuring a more uniform distribution of generated data in the feature space while maintaining a high degree of consistency with real data. The training process of this GAN model is as follows: Figure 2 As shown, it includes the following steps:
[0091] In step S201, the network parameters of the generator and discriminator in the generative adversarial network are initialized. The generator is responsible for generating seemingly realistic data, and the discriminator's task is to distinguish between real data and fake data generated by the generator. Let the generator be... The discriminator is The method for initializing its parameters is represented by formulas (1.1) and (1.2):
[0092] (1.1)
[0093] (1.2)
[0094] In the formula, and These are the initial parameters for the generator and the discriminator, respectively; This indicates that it follows a specific distribution; This represents a normal distribution with a mean of 0 and a variance of 1.
[0095] In step S202, the generator and discriminator are adversarially trained using their respective loss functions. During the adversarial training phase, the generator and discriminator enter a dynamic training process. The generator attempts to generate increasingly realistic data, while the discriminator strives to improve its ability to identify fake data. The data generation method is represented by formulas (1.3) and (1.4):
[0096] (1.3)
[0097] (1.4)
[0098] In the formula, It is random noise generated from the standard normal distribution. These are the parameters of the generator; The generated data for the generator; This represents a generator function.
[0099] Furthermore, the discriminator The determination of real data and generated data is represented by formulas (1.5) and (1.6):
[0100] (1.5)
[0101] (1.6)
[0102] In the formula, For real data, and These are the discriminant's judgment results for the real data and the generated data, respectively. For the discriminator function; These are the parameters of the discriminator.
[0103] During adversarial training, the loss functions of the discriminator and generator are calculated using equations (1.7) and (1.8):
[0104] (1.7)
[0105] (1.8)
[0106] In the formula, It is the loss function of the discriminator, which aims to maximize the ability to distinguish between real data and generated data; It is the loss function of the generator, designed to deceive the discriminator into classifying the generated data as real data; The probability that the discriminator identifies the data as real; The probability that the discriminator classifies the data as false. This is a sparse regularization term.
[0107] In step S203, during adversarial training, a sparse regularization term is used to control the distribution of generated data. By adjusting the regularization parameter, a balance between diversity and novelty in the generated data is ensured, avoiding overfitting or generating poor-quality data. Specifically, the sparse regularization term is calculated as shown in formulas (1.9) and (1.10):
[0108] (1.9)
[0109] (1.10)
[0110] In the formula, Represents the L1 norm; The L1 norm of the generator parameters. It is a hyperparameter of regularization strength. and They are the first The L1 norm of the layer weights and biases, where i represents the layer index. The L1 norm is the sum of the absolute values of all components of the vector. Preferably, Set it to 0.3.
[0111] Therefore, by adjusting the contribution of each layer's weights and biases to regularization, the sparsity of the network can be controlled more precisely, leading to more effective data generation.
[0112] In step S204, during adversarial training, a dynamically adjusted adversarial balance mechanism is adopted. This involves adjusting the learning rates of the generator and discriminator in real time to maintain a dynamic balance between them, optimizing the training process, reducing training time, and improving the quality of generated data. The learning rate is a parameter used in optimization algorithms to adjust the step size of model parameter updates. When training a generative adversarial network model, the weights of the generator and discriminator are updated according to the gradient of the loss function, and the learning rate determines the magnitude of each update. Traditional learning rates are usually statically set, which can easily lead to the discriminator rapidly surpassing the generator or the generator over-optimizing in the early stages of training. This is addressed by calculating the loss difference and dynamically adjusting the learning rate based on it. The calculation of the loss difference is expressed as formula (1.11):
[0113] (1.11)
[0114] In the formula, This indicates the loss of the discriminator. This represents the loss of the generator. This represents the loss difference between the discriminator and the generator.
[0115] Furthermore, the learning rate adjustment method is expressed as follows:
[0116] (1.12)
[0117] (1.13)
[0118] In the formula, and These are the learning rates for the generator and discriminator, respectively. It is the base learning rate. This is an adjustment factor used to control the rapid adaptation of the learning rate. Preferably, Set to 0.3, Set to 0.01.
[0119] Furthermore, the parameter update method for the generator and discriminator is expressed as follows:
[0120] (1.14)
[0121] (1.15)
[0122] In the formula, and These are the parameters for the updated generator and discriminator. and These are the parameters of the generator and discriminator before the update. and These are the gradients of the loss functions for the generator and discriminator, respectively.
[0123] In steps S205 and S206, it is determined whether a preset stopping iteration condition is met. If not, the process jumps to step S202 to continue execution; if yes, the training process ends, indicating that the model training is complete. In one embodiment, the preset stopping iteration condition is reaching a preset maximum number of iterations. Preferably, the preset maximum number of iterations is set to 1000.
[0124] After training, the trained generator is used to increase the number of samples. In one embodiment, if the original number of collected samples is 800, and 200 samples are generated by expansion, then the expanded dataset contains 1000 samples.
[0125] Regarding step S30, this step uses a multi-layered, fully connected neural network structure based on dynamic population evolution optimization (e.g., NPDOA, a neural population dynamic optimization algorithm) as the feature extraction model. In existing technologies, using traditional neural networks for feature extraction may encounter problems such as vanishing gradients, exploding gradients, or getting trapped in local optima in certain neural network structures, affecting training stability and model performance. The neural network model based on dynamic population evolution optimization in this step utilizes a self-correction mechanism to automatically adjust the evolutionary rules according to the characteristics of the current training data, adjusting the probabilities of crossover and mutation based on the changing trend of the loss function, thereby naturally reducing the risk of overfitting. Furthermore, compared to traditional population evolution algorithms where the evolution of all individuals is based on fixed rules, automatically adjusting the evolutionary rules allows for more flexible adaptation to different data distributions, thereby improving the model's generalization ability and training efficiency. The training process of the neural network model based on dynamic population evolution optimization is as follows: Figure 3 As shown, it includes the following steps:
[0126] In step S301, an initial population is generated according to the biomimetic algorithm initialization method, with each individual representing a network weight configuration. Specifically, let the population size be... , for the first Each individual's initial weights and biases are represented as follows:
[0127] (2.1)
[0128] (2.2)
[0129] In the formula, For the first The weights of the neural network corresponding to each individual. For the first The bias of the neural network corresponding to each individual Indicates the first The weight matrix of each individual in the initial state; Indicates the first The bias of each individual in the initial state; Represents the initial variance; This indicates that the mean is 0 and the variance is 0. The normal distribution; It follows a normal distribution. Preferably, Set to 0.01.
[0130] In step S302, for each individual in the population, the input data is processed using its corresponding neural network configuration, the model output is calculated, the loss is calculated according to a predetermined loss function, and its performance is evaluated based on the loss. Specifically, for the first individual... For each individual, the loss on the training dataset is calculated using its weights and biases, and is expressed as:
[0131] (2.3)
[0132] In the formula, For the first The loss of the neural network corresponding to each individual; This indicates the number of samples entered in the current batch; Represents the composite loss function. Represents a neural network model function; Indicates the first Features of each sample; Indicates the first The label of each sample, For the first The weights of the neural network corresponding to each individual.
[0133] In one embodiment, the composite loss function includes a regularization term, which can increase the model's generalization ability. The calculation method is expressed as follows:
[0134] (2.4)
[0135] In the formula, It is the mean square error function. It is a regularization term. This is the regularization parameter.
[0136] Furthermore, the calculation method for the regularization term is expressed as follows:
[0137] (2.5)
[0138] In the formula, For the first The neural network corresponding to the nth individual Each weight.
[0139] In step S303, based on the individual's fitness, the best-performing individual is selected from the current population and retained as a candidate solution for the next generation. Specifically, selection is based on individual fitness, with superior individuals having a higher probability of being selected. The probability of an individual being selected is calculated as follows:
[0140] (2.6)
[0141] In the formula, Indicates the first The probability of an individual being selected; It is a parameter that controls the selected pressure; For the first The loss of the neural network corresponding to each individual. Preferably, Set to 2.
[0142] In step S304, using the candidate solutions output in the previous steps, new individuals are generated through crossover and mutation operations. Crossover allows two superior individuals to exchange some genes, generating new offspring; mutation randomly alters some genes in an individual to increase population diversity. Specifically, the crossover operation randomly selects two individuals for gene exchange, as shown below:
[0143] (2.7)
[0144] (2.8)
[0145] In the formula, It's the crossover rate. The weights of the neural network corresponding to the first selected individual. The bias of the neural network corresponding to the first selected individual. The weights of the neural network corresponding to the selected second individual. The bias of the neural network corresponding to the selected second individual. These are the weights of the neural network corresponding to the individuals after the crossover operation. This refers to the bias of the neural network corresponding to the individual after the crossover operation. Preferably, Set it to 0.3.
[0146] Furthermore, the mutation operation applies a small-amplitude random perturbation to the weights of the newly generated individuals, as follows:
[0147] (2.9)
[0148] (2.10)
[0149] In the formula, Variance represents the variation. These are the weights of the neural network corresponding to the individuals after the mutation operation. This refers to the bias of the neural network corresponding to the individual after the mutation operation. Preferably, Set to 0.04.
[0150] In steps S305 and S306, it is determined whether a preset stopping iteration condition is met. If not, the process jumps to step S302 to continue execution; if yes, training ends, indicating that model training is complete. In one embodiment, the preset stopping iteration condition is reaching a preset maximum number of iterations. Preferably, the preset maximum number of iterations is set to 1000.
[0151] Regarding step S40, a feature-refining-based autoencoder neural network is used as the dimensionality reduction model. This network consists of an encoder, a decoder, and a feature adjustment module. The encoder maps high-dimensional input data to a low-dimensional feature space, and the decoder reconstructs the reduced features back to the original space, ensuring the reversibility of the dimensionality reduction process. The feature adjustment module dynamically adjusts the reduced feature space through recursive feature adaptive optimization, strengthening important features and gradually weakening secondary features. This results in a dimensionality-reduced feature representation that retains data information while maintaining good simplicity.
[0152] The training process of the feature-refinement-based autoencoder neural network algorithm is as follows: Figure 4 As shown, it includes the following steps:
[0153] In step S401, let the data input to the autoencoder neural network be... The encoder employs a multi-layer nonlinear mapping structure to map high-dimensional data to an initial low-dimensional feature space, represented as:
[0154] (3.1)
[0155] In the formula, Represents the initial low-dimensional features. Here is the weight matrix of the encoder. This is the bias vector of the encoder. This is the multi-layer Sigmoid activation function for the encoder.
[0156] In step S402, after the low-dimensional features are generated, the feature adjustment module automatically generates feature weights based on the importance of features in the current feature space. This module assigns the same initial weights to all features during initialization, so that they can be gradually adjusted in subsequent steps based on feature contributions. The initial weight matrix is calculated as follows:
[0157] (3.2)
[0158] In the formula, This is the initial weight matrix; For the feature weight vector, Each element in Initializing them to the same value indicates that all features have the same importance in the initial stage; This is a function to extract the diagonal elements of a matrix.
[0159] Furthermore, the adjusted features can be represented as:
[0160] (3.3)
[0161] In the formula, This is the feature representation after feature weight adjustment.
[0162] In step S403, the feature adjustment module performs multiple rounds of recursive optimization on the initially generated low-dimensional features. In each iteration, the module adjusts the weights of each feature based on the performance of the features in the previous round, gradually strengthening those features with significant influence and gradually weakening redundant or noisy features. Let the first iteration be... During the round of iteration, the weight update rules are as follows:
[0163] (3.4)
[0164] In the formula, Indicates the first Feature weights in rounds of iteration, Indicates the first Feature weights in rounds of iteration The learning rate for the autoencoder neural network. The loss function for an autoencoder neural network, For label data, This represents the gradient of the loss function with respect to the feature weights. Preferably, the loss function of the autoencoder neural network is the reconstructed error loss function. Preferably, Set to 0.01.
[0165] In step S404, to ensure the effectiveness of the dimensionality reduction process, the decoder remaps the low-dimensional features back to the high-dimensional space to ensure that no important information is lost during the dimensionality reduction process. The decoder's reconstruction process is represented as follows:
[0166] (3.5)
[0167] In the formula, For the reconstructed high-dimensional data, Here is the weight matrix of the decoder. This is the bias vector for the decoder. This is the multi-layer Sigmoid activation function for the decoder.
[0168] In steps S405 and S406, it is determined whether a preset stopping iteration condition is met. If not, the process jumps to step S403 to continue execution; if yes, training ends, indicating that model training is complete. In one embodiment, the preset stopping iteration condition is reaching a preset maximum number of iterations. Preferably, the preset maximum number of iterations is set to 1000.
[0169] Regarding step S50, the dimensionality-reduced data is input into the classifier for training. This invention employs a Deep Neural Decision Tree (DNDT) algorithm based on local topology as the classification algorithm. It uses a quantum mechanics-based optimal solution search algorithm to optimize the decision tree construction process, effectively locating the optimal decision path in the complex feature space, thereby improving classification accuracy and efficiency. The Deep Neural Decision Tree algorithm is a machine learning model that combines the advantages of deep learning and decision trees. Each neural network layer essentially corresponds to a decision tree, progressing layer by layer to form a composite tree-like network. The characteristic of the Deep Neural Decision Tree algorithm in local topology is its ability to simulate the branching structure of a decision tree. This structure allows the model to make decisions within local regions, similar to the segmentation of a decision tree within a local region.
[0170] Specifically, the training process of the deep neural decision tree algorithm based on local topology is as follows: Figure 5 As shown, it includes the following steps:
[0171] In step S501, the deep neural decision tree is initialized. Let the deep neural decision tree be... The nodes of a deep neural decision tree are The decision threshold is The decision threshold setting method is expressed as follows:
[0172] (4.1)
[0173] In the formula, It is at the node The sample set assigned at that location, It is the feature vector input into the deep neural decision tree.
[0174] In step S502, a nonlinear transformation of the nodes is performed. A small neural network module is used for each decision node. These modules are responsible for learning how to extract effective nonlinear decision boundaries from the data features. Specifically, this is implemented through a feedforward network. The input is the data features of the current decision node, and the output is the decision signal. The network output is represented as follows:
[0175] (4.2)
[0176] In the formula, It is the dimension of the input features. and It refers to the weights and biases of the feedforward network in a small network. It is an activation function based on nonlinear components; It is the Sigmoid activation function; It is the learning rate parameter, used to control the speed and magnitude of weight updates; For the first The feature utility of each feature.
[0177] Furthermore, the allocation of feature weights in each decision node is dynamically adjusted according to the adaptive feature feedback mechanism to optimize the adaptability of the decision tree to the current training state. By monitoring the utility of each feature in the classification process and automatically adjusting the feature weights based on their performance, the robustness and accuracy of the model in the face of complex data changes are enhanced. Specifically, at each decision node, the first... The feature utility of each feature is represented as follows:
[0178] (4.3)
[0179] In the formula, It is a classification result set. It is a classification The output probability, It is the gain corresponding to classification accuracy (i.e., the value when classified correctly minus the value when classified incorrectly). Representation of features For output Sensitivity.
[0180] In one embodiment, the activation function based on nonlinear components aims to refine the output, allowing decision nodes to process input features more precisely before making classification decisions. The calculation method is expressed as follows:
[0181] (4.4)
[0182] In the formula, It is the hyperbolic tangent function; and These are additional weights and biases within the same decision node, used to improve the model's ability to respond to nonlinear input data.
[0183] In step S503, the decision rules of each node in the decision tree are optimized using the quantum optimization search principle based on quantum states. Specifically, by simulating quantum behaviors, such as quantum entanglement and quantum superposition, feature segmentation that maximizes information gain is sought, thereby updating the decision threshold. The simulation strategy is implemented through the following iterative process:
[0184] (4.5)
[0185] In the formula, It is in the The decision threshold for the next iteration It is in the The decision threshold for the next iteration; It is the learning rate of the deep neural decision tree; Based on quantum state The calculated quantum gradient simulates the diffusion and superposition of quantum states in probability space. Preferably, Set to 0.01.
[0186] In one embodiment, the quantum gradient is calculated as follows:
[0187] (4.6)
[0188] In the formula, This represents the expected energy value based on the quantum probability distribution.
[0189] Furthermore, the energy expectation value based on the quantum probability distribution enables quantum optimization to find the optimal solution more efficiently in the global search space, and the calculation method is expressed as follows:
[0190] (4.7)
[0191] In the formula, It is a quantum state The probability of occurrence In the given The loss function is as follows.
[0192] In step S504, the tree structure is dynamically adjusted based on the information obtained from the neural network module and the quantum search. This dynamic adjustment of the tree structure is based on information gain. and the nonlinear output of the node The adjustment strategy is defined as follows:
[0193] (4.8)
[0194] (4.9)
[0195] In the formula, It is a category At the node The probability distribution of the next sample; It is the information gain threshold, used to determine whether a node needs to be split or pruned; These are the nodes of the adjusted deep neural decision tree. Preferably, Set to 0.05.
[0196] As training progresses, the decision tree matures, and the decision paths become more refined. Each leaf node will possess highly specialized classification capabilities, accurately labeling data samples belonging to its assigned region. The classification ability of each leaf node is optimized by minimizing the misclassification rate. The optimization aims to adjust the decision rules of each leaf node to minimize its misclassification rate. The update rules are as follows:
[0197] (4.10)
[0198] (4.11)
[0199] In the formula, Misclassification rate, It's a real label. Based on decision threshold The classification function.
[0200] In steps S505 and S506, it is determined whether a preset stopping iteration condition is met. If not, the process jumps to step S503 to continue execution; if yes, the training process continues, indicating that the model training is complete. In one embodiment, the preset stopping iteration condition is reaching a preset maximum number of iterations. Preferably, the preset maximum number of iterations is set to 300. Accordingly, this disclosure provides a method for evaluating classroom teaching comfort levels, the flowchart of which is shown below. Figure 6 As shown, it includes the following steps.
[0201] In step S601, real-time data is collected through IoT sensors.
[0202] In step S602, a feature extraction model is used to extract features from the real-time data to obtain a multidimensional feature representation. The feature extraction model is trained using a neural network model optimized by dynamic population evolution.
[0203] In step S603, the multidimensional feature representation is input into the feature dimensionality reduction model for feature dimensionality reduction to obtain a low-dimensional feature representation. The feature dimensionality reduction model is the encoder in a trained autoencoder neural network algorithm.
[0204] In step S604, the low-dimensional feature representation is input into the classifier to output the corresponding classroom teaching comfort level. The classifier uses a trained local topology deep neural decision tree algorithm.
[0205] The training steps for each model used in this embodiment can be referred to above, and will not be repeated here.
[0206] In summary, the classroom teaching comfort assessment model training method and classroom teaching comfort assessment method provided in this disclosure apply artificial intelligence to classroom teaching comfort assessment, which helps to improve the level of intelligent management of classroom teaching. Furthermore, the training method for the classroom teaching comfort assessment model has the following advantages: First, in terms of dataset expansion, a generator in a generative adversarial model is used to expand the smart classroom dataset, solving the problem of insufficient data. Through the adversarial training mechanism, high-quality virtual data is generated, making the generated data distribution more uniform and consistent with the real data. Second, in terms of feature extraction, a dynamic population evolution optimization algorithm is used to train a multi-layer fully connected neural network, dynamically adjusting the evolution rules to improve the stability and generalization ability of the neural network model in feature extraction. Through a self-correction mechanism, the algorithm can adapt to different data distributions, avoiding problems such as gradient vanishing and exploding. Third, in terms of feature dimensionality reduction, an autoencoder neural network model based on feature refinement is used. Through a recursive feature optimization module, feature weights are dynamically adjusted to gradually weaken unimportant features, achieving simplification of low-dimensional features while maintaining information integrity. The decoder ensures the reversibility of information during the dimensionality reduction process, ensuring minimal information loss. Fourth, in terms of feature classification, a deep neural decision tree algorithm based on local topology is used, combined with quantum mechanical optimization techniques, to improve the classifier's decision-making ability in complex feature spaces. Through a quantum state search mechanism, the feature segmentation rules of the decision tree nodes are optimized to ensure maximum information gain and improve classification accuracy.
[0207] Furthermore, this disclosure also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the above methods. Additionally, this disclosure also provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the steps of the above methods.
[0208] The embodiments of this disclosure are as described above. These embodiments do not exhaustively describe all details, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made based on the above description. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the embodiments of this disclosure, thereby enabling those skilled in the art to make good use of the embodiments of this disclosure and modifications based on them. The embodiments of this disclosure are limited only by the claims and their full scope and equivalents.
Claims
1. A classroom teaching comfort evaluation model training method, comprising: collecting data samples through Internet of Things sensors in the classroom; augmenting the labeled data samples using a data augmentation model; inputting the augmented labeled data samples into a feature extraction model for feature extraction to obtain a multi-dimensional feature representation; and inputting the multi-dimensional feature representation into a feature dimension reduction model for feature dimension reduction to obtain a low-dimensional feature representation, the feature dimension reduction model being an encoder in a trained auto-encoding neural network algorithm; inputting the low-dimensional feature representation to a classifier for training, the classifier being a trained deep neural decision tree algorithm based on local topology, the classifier being used to output a classroom teaching comfort level; wherein the training process of the deep neural decision tree algorithm based on local topology comprises the following steps: S1: initializing a deep neural decision tree; S2: performing node nonlinear transformation on each decision node; S3: Determine feature partitioning that maximizes information gain by simulating quantum behavior, and update decision thresholds accordingly The simulation strategy is implemented by iterating as follows: (4.5) wherein, is the decision threshold of the first iteration, is the decision threshold of the first iteration, is the decision threshold of the first iteration, is the decision threshold of the first iteration; is the learning rate of the deep neural decision tree; is the quantum gradient calculated based on the quantum state The quantum gradient is calculated based on the quantum state S4: dynamically adjusting the structure of the tree according to information obtained from the neural network module and quantum search; S5: determining whether a preset stop iteration condition is met, and if not, jumping to S3, and if so, ending the training process.
2. The method of evaluating model training of claim 1, wherein, The calculation method of the quantum gradient is represented as: (4.6) wherein denotes the energy expectation value based on the quantum probability distribution; and The evaluation model training method further comprises: based on the energy expectation value of the quantum probability distribution, the quantum optimization finds the optimal solution in the global search space, and the calculation method is represented as: (4.7) wherein is a quantum state occurs, is a loss function given .
3. The method of evaluating model training of claim 1, wherein, The data augmentation model is a generator in a trained generative adversarial network model, and the loss function of the generator includes a sparse regularization term related to the weights and biases of each layer of the generator.
4. The evaluation model training method of claim 3, wherein the loss function of the generator is represented by the following equation: (1.8) (1.9) (1.10) wherein is a loss function of the generator, is a probability that the discriminator judges as real data, is a probability that the discriminator judges as fake data, is a sparse regularization term, denotes an L1 norm, denotes an L1 norm of each parameter of the generator, is a hyperparameter of regularization strength, and are L1 norms of the first layer weights and biases, respectively.
5. The method of evaluating model training of claim 3, wherein, The learning rate of the generator and the learning rate of the discriminator in the generative adversarial network model are both related to the loss difference between the generator and the discriminator.
6. The method of evaluating model training of claim 5, wherein, The learning rate of the generator and the learning rate of the discriminator in the generative adversarial network model are represented by the following equation: (1.11), (1.12), (1.13), wherein, denotes the loss of the discriminator, denotes the loss of the generator, denotes the difference in loss between the discriminator and the generator, and are the learning rate of the generator and the learning rate of the discriminator, respectively, is a base learning rate, is an adjustment factor.
7. The evaluation model training method of claim 5 or 6, wherein the parameter updating method of the generator and the discriminator is represented by the following equation: , , wherein, and are the parameters of the generator and the discriminator respectively after the update, and are the parameters of the generator and the discriminator respectively before the update, and are the gradients of the loss function of the generator and the discriminator respectively, and are the learning rates of the generator and the discriminator respectively.
8. The method of evaluating model training of claim 1, wherein, The feature extraction model is trained by a dynamic population evolutionary optimized neural network model, and the training process of the dynamic population evolutionary optimized neural network model comprises: setting an initial population according to the initialization method of the bionic algorithm; for each individual in the population, using its corresponding neural network configuration to process input data, calculating the output of the model, and evaluating its performance according to a predetermined loss function; selecting the best individual from the current population according to the fitness of the individual to reserve as a candidate solution for the next generation; generating new individuals from the candidate solutions of the next generation through crossover and mutation operations; and determining whether a preset stop iteration condition is met, and if not, jumping to the step of processing input data using the corresponding neural network configuration of each individual in the population, calculating the output of the model, and evaluating its performance according to a predetermined loss function, and if so, ending the training process.
9. The method of evaluating model training of claim 8, wherein, The predetermined loss function is represented by the following equation: (2.3) (2.4) (2.5) in, For the first The loss of the neural network corresponding to each individual. This indicates the number of samples entered in the current batch; Represents the composite loss function. Represents the neural network model function. Indicates the first Features of each sample Indicates the first The label of each sample, For the first The weights of the neural network corresponding to each individual. It is the mean square error function. It is a regularization term. For regularization parameters, For the first The neural network corresponding to the nth individual Each weight.
10. The method of evaluating model training of claim 1, wherein, The self-encoding neural network algorithm comprises an encoder, a decoder and a feature adjustment module, the encoder adopts a multi-layer nonlinear mapping structure to map high-dimensional data to a low-dimensional feature space; The feature adjustment module performs multi-round recursive optimization on the low-dimensional features, and in each iteration, adjusts the weight of each feature according to the performance of the previous round of features; the decoder remaps the low-dimensional features back to the high-dimensional space.
11. The evaluation model training method of claim 1, wherein the node nonlinear transformation of each decision node comprises: adopting a feedforward network implementation for each decision node, with the input being the data features of the decision node and the output being a decision signal; dynamically adjusting the feature weight in each decision node according to an adaptive feature feedback mechanism, and automatically adjusting the feature weight according to the performance of each feature in the classification process by monitoring the feature utility of each feature in the classification process.
12. The evaluation model training method of claim 11, wherein the output representation is: (4.2) In the formula, is the dimension of the input feature, and is the weight and bias of the feedforward network, is the activation function based on the nonlinear component, is the Sigmoid activation function, is the learning rate parameter, is the feature utility of the i-th feature, is the i-th feature vector of the input.
13. The method of evaluating model training of claim 11, wherein, At each decision node, the feature utility of the nth feature is defined as: (4.3) wherein, is a set of classification results, is a classification output probability, is a gain corresponding to a classification accuracy, denotes a feature sensitivity to an output .
14. The method of evaluating model training of claim 12, wherein, the activation function of the nonlinear component is represented as: (4.4) In the formula, is a hyperbolic tangent function, and are additional weights and biases within the same decision node, is the i-th feature vector of the input.
15. The method of evaluating model training of claim 1, wherein, The data samples include one or more of the following items: temperature, light intensity, noise level, student density, time, student interaction frequency, door and window status in the classroom, and student attention index.
16. An evaluation method for classroom teaching comfort, comprising: collecting real-time data through Internet of Things sensors; extracting features from the real-time data using a feature extraction model to obtain a multi-dimensional feature representation; inputting the multi-dimensional feature representation into a feature dimension reduction model to obtain a low-dimensional feature representation, the feature dimension reduction model being a trained encoder based on a self-encoding neural network algorithm; and inputting the low-dimensional feature representation into a classifier to output the corresponding classroom teaching comfort level, the classifier being a trained deep neural decision tree algorithm based on local topology, wherein the training process of the deep neural decision tree algorithm based on local topology comprises the following steps: S1: initializing a deep neural decision tree; S2: performing node nonlinear transformation on each decision node; S3: Determine feature partitioning that maximizes information gain by simulating quantum behavior, and update decision thresholds accordingly The simulation strategy is implemented by iterating as follows: (4.5) wherein, is the decision threshold at the first iteration, is the decision threshold at the first iteration, is the decision threshold at the first iteration; is the decision threshold at the first iteration; is the learning rate of the deep neural decision tree; is the quantum gradient calculated based on the quantum state , simulating the diffusion and superposition of the quantum state in the probability space. S4: dynamically adjusting the structure of the tree according to the information obtained from the neural network module and quantum search; S5: determining whether the preset stopping iteration condition is met, if not, jumping to S3, and if yes, ending the training process.
17. A computer device comprising: a memory for storing a processing program; a processor for implementing the method of any one of claims 1 to 15 when executing the processing program.