Physical and psychological health state acquisition method, electronic equipment and computer readable medium
Through the combination of facial expression recognition model and YOLOv5 network model, the problem of incomplete data collection and lag in feedback for campus students' emotion monitoring is solved, real-time and accurate physical and mental health status monitoring is achieved, and campus management efficiency and data security are improved.
Patent Information
- Application Number
- CN202410736227.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-10-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technology has problems with incomplete data collection, lag in feedback, high labor costs, low efficiency, and privacy protection and data security risks in monitoring students' emotions on campus, making it difficult to achieve real-time and accurate monitoring of physical and mental health status.
Using a combination of facial expression recognition model and YOLOv5 network model, through multi-dimensional data collection and automated processing, it generates students' physical and mental health status information, including physiological and psychological parameters, provides real-time feedback on students' emotional status, and improves recognition through feature fusion and data compression. Precision and efficiency.
It achieves real-time and accurate monitoring of students' physical and mental health status, reduces misjudgments and missed judgments, reduces labor costs, improves the efficiency of campus management and the reliability of data processing, and at the same time enhances privacy protection and data security.
Smart Images

Figure CN118865461A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent health identification technology, and in particular to a method, system, electronic device and computer-readable medium for acquiring physical and mental health status. Background Art
[0002] Nowadays, the mental health problems of students on campus have gradually become prominent, and the mental health problems of the student group have become more and more a hot topic in the news. This group is huge, and because psychological problems are highly hidden, it is difficult for teachers with limited energy to take care of every student in a timely manner. Therefore, how to monitor students' emotional state in real time and effectively and prevent potential psychological problems has become an important challenge facing current campus management. Traditional emotion monitoring methods, such as regular psychological tests and questionnaires, have defects such as incomplete data collection, delayed feedback, and cumbersome operations, which are difficult to meet the needs of modern campus management. Although there are already some emotion monitoring platforms in the prior art, the following problems still exist:
[0003] (1) Incomplete data collection and delayed feedback: The existing solutions have obvious deficiencies in data collection and are unable to obtain students’ emotional data in a comprehensive and real-time manner. This results in managers being unable to understand students’ emotional states in a timely manner and unable to intervene in potential psychological problems in a timely manner. At the same time, due to the lag in data feedback, the existing solutions are often unable to effectively respond to sudden emotional events, increasing the risk of campus management.
[0004] (2) High labor costs and low efficiency: Traditional emotion monitoring methods require a lot of human resources, including questionnaire distribution, data collection, collation and analysis. This not only increases the school's operating costs, but may also lead to low work efficiency. In addition, due to the limitations of manual processing, existing solutions often have errors and deviations in data processing and analysis, affecting the accuracy of emotion monitoring.
[0005] (3) Privacy protection and data security risks: In existing solutions, students’ emotional data often lack effective privacy protection mechanisms. This may lead to the leakage or abuse of students’ personal information, causing unnecessary troubles and risks to students. At the same time, due to the lack of data security measures, existing solutions may also face the risk of data tampering or destruction, further affecting the reliability and effectiveness of emotion monitoring. Summary of the invention
[0006] The present invention aims to solve one of the technical problems in the related art to a certain extent. To this end, the present invention provides a method for obtaining the physical and mental health status, which realizes real-time and accurate monitoring and feedback of the physical and mental health status of students.
[0007] In order to achieve the above object, the present invention adopts the following technical solution:
[0008] A method for obtaining physical and mental health status is used to obtain the physical and mental health status of students on campus, comprising the following steps:
[0009] Determine a capture object, and obtain a calculation result of a facial expression recognition model of the capture object through a facial expression recognition model, wherein the calculation result includes physiological parameters and psychological parameters of the capture object;
[0010] Generate emotional state information of the captured object based on the calculation result of the facial expression recognition model of the captured object;
[0011] Based on the captured object's coordinate information, class participation, mental health reference score and emotional state information, the student's physical and mental health status is generated and feedback is provided.
[0012] Optionally, the captured object is determined by a YOLOv5 network model, and the formula of the YOLOv5 network model is:
[0013] Y=CSP-Darknet53(I)
[0014] Y SPP =SPP(Y)
[0015] Y PANet =PANet(Y SPP )
[0016]
[0017] class_prob,obj_score=σ(Head(Y PANet ))
[0018] Among them, Y is the extracted feature, CSP-Darknet53 is the backbone network of the YOLOv5 model, I is the input image, SPP is the spatial pyramid pooling, and Y SPP is the calculation result of spatial pyramid pooling, PANet is the path aggregation network, and Y PANet is the calculation result of the path aggregation network, bbox is the bounding box, σ is the Sigmoid activation function, (t x ,t y ,t w ,t h ) is the adjustment parameter of the YOLOv5 model, (c x ,c y ) is the upper left corner of the grid unit, (p w ,p h ) is the width and height of the predefined anchor box, e is the natural logarithm, class_prob is the probability of the head category, obj_score is the probability of belonging to the target, and Head is the predicted head.
[0019] Optionally, the YOLOv5 network model is a trained YOLOv5 network model, and the loss function for training the YOLOv5 network model is:
[0020] L1=L class +L obj +L bbox
[0021]
[0022] Where L1 is the loss function for training the YOLOv5 network model, N is the number of training samples, and L class is the classification loss function, L obj The object has a loss function, L bbox Bounding box regression loss function, The category probability of the i-th sample predicted by the YOLOv5 network model, The probability of the object existing in the i-th sample predicted by the YOLOv5 network model, is the confidence that the object exists, Adjust parameters for bounding boxes predicted by the YOLOv5 network model, are the corresponding ground-truth bounding box parameters.
[0023] Optionally, when determining the captured object, data enhancement is performed through a Mosaic model, and the formula of the Mosaic model is:
[0024]
[0025] Among them, I is the final generated Mosaic image, which is the image input to the YOLOv5 model. i is the original selected image, I i (R i ) is from image I i The area cut out in R i corresponds to image I i The cropping area, i∈{1,2,3,4}.
[0026] Optionally, the formula of the facial expression recognition model is:
[0027]
[0028] F output =MLP(Corss-Fusion(Q img ,K lm ,V lm ))
[0029]
[0030] Where P|(em|I) is the probability of one facial expression em in the input image I, W em is the weight of facial expression em, b em is the bias of facial expression em, em' is the sum of different facial expressions, F output is the feature extraction function of the POSTERV2 algorithm, MLP is a multi-layer perceptron, Cross-Fusion is a cross-fusion encoder, softmax is the normalized attention score, d is the scale factor, Q img is the query matrix of the features of image I, extracted from the backbone network of the YOLOv5 model, K lm is the key matrix of the landmark features, V lm is the value matrix of landmark features.
[0031] Optionally, when obtaining the calculation result of the facial expression recognition model of the captured object, the facial expression recognition model is compressed according to the following formula:
[0032] Params compressed =LayerReduce(Params original ,l)×DimReduce(D original ,γ)
[0033] Among them, Params original is the original number of parameters of the facial expression recognition model, LayerReduce is a function for reducing the number of layers, DimReduce is a function for reducing the feature dimension, l is the number of layers reduced, and D original is the dimension of the original feature of the facial expression recognition model, γ is the ratio of dimension reduction, Params compressed is the original number of parameters of the facial expression recognition model after compression.
[0034] Optionally, the facial expression recognition model is a trained facial expression recognition model, and the loss function for training the facial expression recognition model is:
[0035]
[0036] Wherein, L2 is the loss function for training the facial expression recognition model, em k is the true expression label of the kth sample, I k is the corresponding input image, P(em k |I k ) is the facial expression recognition model predicting expression em k The corresponding input image I k probability.
[0037] Optionally, the physiological parameters of the captured object include aggression, anxiety, balance, vitality, depression, happiness, stress, suspicion, self-confidence, self-regulation, neuroticism, and depression; the psychological parameters of the captured object include aggression, depression, stress, neuroticism, suspicion, and anxiety;
[0038] Among them, the probability of aggression 50% and neuroticism 50% correspond to anger;
[0039] Anxiety probability 50%, depression probability 50% corresponds to fear;
[0040] A probability of self-regulation of 50% and a probability of equilibrium of 50% correspond to neutrality;
[0041] The probability of depression is 33.3%, the probability of suspicion is 33.3%, and the probability of depression is 33.3%, which corresponds to sadness;
[0042] A 50% probability of happiness and a 50% probability of confidence correspond to surprises;
[0043] Probability of aggression 50%, probability of depression 50%, corresponding to disgust;
[0044] The probability of vitality is 25%, the probability of happiness is 25%, the probability of self-confidence is 25%, and the probability of self-regulation is 25%, which corresponds to happiness.
[0045] Optionally, the emotional state information of the captured object is generated according to the following model:
[0046] S=StateAnalyzer(F combined )
[0047] F combined = fusion(F face ,F voice ,F physiological ,F psychology )
[0048] F face =POSTERV2(I)
[0049] F voice =extractVoiceFeatures(audio signal)
[0050] Among them, S is the emotional state information, StateAnalyzer is the state analysis function, and F combined is the fusion feature, fusion is the feature fusion function, F face is the facial expression recognized by the POSTERV2 algorithm, F voiceis the speech feature, extractVoiceFeatures is the speech feature extraction function, audio signal is the speech signal, F physiological is the physiological parameter, F psychology For psychological parameters.
[0051] Optionally, the model for generating the emotional state information of the captured object is a trained model, and the loss function of training the model for generating the emotional state information of the captured object is:
[0052] L3=loss(S,S true )
[0053] Among them, L3 is the loss function for training the model to capture the emotional state information of the object, S true It is the real emotional state information;
[0054] At the same time, the model that generates the captured object’s emotional state information is evaluated according to the following formula:
[0055] Performance=evaluate(S,S ture )
[0056] Among them, Performance is the performance of the model that generates the emotional state information that captures the object, and evaluate is the evaluation function.
[0057] Optionally, the physical and mental health status includes:
[0058] Student Engagement Indicators:
[0059] Engagement = α·F face +(1-α)·BehaviorAnalysis
[0060] Among them, α is the weight coefficient, BehaviorAnalysis is the behavior analysis result;
[0061] Emotional state indicator EmotionState:
[0062] EmotionState=EmotionClassifier(F face )
[0063] Among them, EmotionClassifier is a classification model used to predict emotional states based on facial expressions recognized by the POSTERV2 algorithm;
[0064] Attention concentration indicator Attention:
[0065] Attention=PhysiologicalAnalyzer(F physiological )
[0066] Among them, PhysiologicalAnalyzer is the analysis model;
[0067] Learning efficiency index Efficiency:
[0068]
[0069] Among them, TaskCompletion is the task completion degree, and TimeSpent is the time spent to complete the task;
[0070] Comprehensive learning status indicator OverallLearningIndex:
[0071] OverallLearningIndex=ω1·Engagement+ω2·EmotionState+ω3·Attention+ω4·Efficiency
[0072] Among them, ω1, ω2, ω3, and ω4 are weight coefficients;
[0073] Learning Assessment:
[0074] LearningAssessment=ThresholdFunction(OverallLearningIndex)
[0075] Among them, ThresholdFunction is the threshold function.
[0076] Optionally, if the head of the captured object moves, a three-dimensional motion trajectory of the head of the captured object is obtained, and then the three-dimensional motion trajectory is converted into a vector for tracking.
[0077] Optionally, obtaining the three-dimensional motion trajectory of the head of the captured object and converting the three-dimensional motion trajectory into a vector comprises the following steps:
[0078] Feature extraction and prediction are performed according to the following model:
[0079] Feature = Backbone Feature (I)
[0080] (x',y')=Head 2D (Feature)
[0081] (Δx, Δy, Δz) = Headoffset (Feature)
[0082] (z')=Head Depth (Feature)
[0083] (S x ,S y ,S z )=Head Size (Feature)
[0084] (θ)=Head Angle (Feature)
[0085] Among them, Feature is the feature, (I) is the input image, Backbone Feature Head is the feature extraction network. 2D Used to extract the coordinates (x', y') of the center point of the predicted 2D box, Head offset Used to extract the offset (Δx, Δy, Δz) between the predicted 2D box center point and the real 3D projection coordinates; Head Depth Used to extract the depth value (z') of the predicted 2D box center point, Head Size The size of the predicted 3D box (S x ,S y ,S z ), Head Angle Used to extract the predicted observation angle (θ);
[0086] The three-dimensional features are constructed according to the following model to form a vector:
[0087]
[0088] in, is the vector formed.
[0089] Optionally, the model for constructing three-dimensional features is a trained model, and the loss function for training the model for constructing three-dimensional features is:
[0090]
[0091] Among them, L4 is the loss function of the model for training and constructing three-dimensional features. The three-dimensional motion feature vector of the i-th sample predicted by the model for constructing three-dimensional features, is the true 3D motion feature vector corresponding to the i-th sample.
[0092] Furthermore, the present invention further provides an electronic device, comprising:
[0093] one or more processors;
[0094] A memory having one or more computer programs stored thereon, wherein when the one or more computer programs are executed by the one or more processors, the one or more processors implement any one of the aforementioned methods for acquiring physical and mental health status.
[0095] At the same time, the present invention also provides a computer-readable medium on which a computer program is stored, and when the computer program is executed by a processor, it implements any of the above-mentioned methods for obtaining physical and mental health status.
[0096] These features and advantages of the present invention will be disclosed in detail in the following specific embodiments and drawings. The best embodiments or means of the present invention will be described in detail in conjunction with the drawings, but they are not intended to limit the technical solutions of the present invention. In addition, there are multiple features, elements, and components that appear in each of the following texts and drawings, and different symbols or numbers are marked for convenience, but they all represent components with the same or similar structures or functions. BRIEF DESCRIPTION OF THE DRAWINGS
[0097] The present invention will be further described below in conjunction with the accompanying drawings:
[0098] Figure 1 is a flow chart of an embodiment of the present invention.
[0099] Figure 2 A schematic diagram of an electronic device provided by the present invention;
[0100] Figure 3 A schematic diagram of a computer-readable medium provided by the present invention. DETAILED DESCRIPTION
[0101] Embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The embodiments based on the embodiments are intended to be used to explain the present invention and cannot be understood as limiting the present invention.
[0102] References in this specification to "one embodiment" or "an example" or "an example" mean that a particular feature, structure, or characteristic described in conjunction with the embodiment itself may be included in at least one embodiment of the present patent disclosure. The appearance of the phrase "in one embodiment" in various places in the specification does not necessarily refer to the same embodiment.
[0103] As a first aspect of the present invention, this embodiment provides a method for obtaining physical and mental health status, which is used to obtain the physical and mental health status of students on campus, such as Figure 1 As shown, the method for obtaining physical and mental health status provided in this embodiment includes the following steps:
[0104] S1: Determine the capture object, and obtain the calculation results of the facial expression recognition model of the capture object through the facial expression recognition model. In this step, the capture object is the student to be identified, and the calculation results include obtaining the physiological parameters and psychological parameters of the capture object. The physiological parameters include aggression, anxiety, balance, vitality, depression, happiness, pressure, suspicion, self-confidence, self-regulation, neurosis, and depression; the psychological parameters include: aggression, depression, pressure, neurosis, suspicion, and anxiety.
[0105] S2: Generate emotional state information of the captured object based on the calculation results of the facial expression recognition model of the captured object.
[0106] S3: Generate the student's physical and mental health status and provide feedback based on the coordinate information, class participation, mental health reference score and emotional state information of the captured object. In this step, the coordinate information of the captured object can reflect the location of the student to be identified. The class participation and mental health reference score are obtained by the teacher through a questionnaire or other means, which is not limited in this disclosure. Feedback on the student's physical and mental health status can be provided in real-time through a network platform in the prior art, which is not limited in this disclosure.
[0107] This embodiment has the following characteristics: real-time: through multi-dimensional data collection, real-time monitoring of students' physical and mental health status is achieved, ensuring that management personnel can understand students' physical and mental health status in a timely manner; accuracy: through the improvement of the algorithm, the accuracy of emotion recognition is improved, and misjudgment and missed judgment are reduced; high efficiency: through automated data processing and analysis, the workload of management personnel is reduced, and the efficiency and level of campus management are improved.
[0108] In the present disclosure, there is no special limitation on how to perform step S1. As an optional implementation, in step S1, the captured object is determined by the YOLOv5 network model. YOLOv5 is a real-time target detection model suitable for a variety of visual recognition tasks. It mainly includes three parts: the backbone network, the neck part and the head part, each of which has its own unique function and calculation formula. In the present disclosure, the formula of the YOLOv5 network model is:
[0109] Y=CSP-Darknet53(I)
[0110] Y SPP =SPP(Y)
[0111] Y PANet =PANet(Y SPP )
[0112]
[0113] class_prob,obj_score=σ(Head(Y PANet ))
[0114] Among them, Y is the extracted feature, I is the input image, CSP-Darknet53 is the backbone network of the YOLOv5 network model, and is the basic network for extracting deep features from the input image. CSP-Darknet53 is an efficient feature extraction network. The YOLOv5 network model uses it as its backbone network. By using the Cross Stage Partial (CSP) structure, it reduces the demand for computing resources while maintaining high performance. The CSP structure reduces redundant calculations by separating part of the feature map for independent processing.
[0115] Neck part, SPP is spatial pyramid pooling, Y SPP is the calculation result of spatial pyramid pooling, PANet is the path aggregation network, and Y PANet The main function of the neck part is to build a feature pyramid through spatial pyramid pooling (SPP) and path aggregation network (PANet) to adapt to the detection of objects of different sizes. SPP can improve the adaptability of the model to changes in input size, while PANet optimizes the information flow between feature layers and plays a role in accurately locating small targets.
[0116] bbox is the bounding box, σ is the Sigmoid activation function, (t x ,t y ,t w ,t h ) is the adjustment parameter of the YOLOv5 model, (c x ,c y ) is the upper left corner of the grid unit, (p w ,p h ) is the width and height of the predefined anchor box, e is the natural logarithm, class_prob is the probability of the head category, obj_score is the probability of belonging to the target, and Head is the prediction head. The head part is the decision-making part of the YOLOv5 network model, which is used to convert the feature information on the feature map into specific detection outputs, including bounding boxes, category probabilities, and object existence probabilities. This part uses anchor box technology and multi-scale detection strategies to achieve accurate detection of objects of different sizes and shapes.
[0117] The above formula captures the key operations of the YOLOv5 network model in feature extraction, multi-scale processing, and target detection. This enables the YOLOv5 network model to achieve fast processing speed while maintaining high detection accuracy, making it suitable for application scenarios that require real-time processing.
[0118] In the present disclosure, there is no special limitation on how to perform step S1. As an optional implementation, in step S1, the YOLOv5 network model is a trained YOLOv5 network model, and the loss function of training the YOLOv5 network model is:
[0119] L1=L class +L obj +L bbox
[0120]
[0121] Among them, L1 is the loss function for training the YOLOv5 network model, N is the number of training samples, and L class is the classification loss function, L obj The object has a loss function, L bbox Bounding box regression loss function, The category probability of the i-th sample predicted by the YOLOv5 network model, The probability of the object existing in the i-th sample predicted by the YOLOv5 network model, is the confidence that the object exists, Adjust parameters for bounding boxes predicted by the YOLOv5 network model, are the corresponding ground-truth bounding box parameters.
[0122] In the present disclosure, there is no special limitation on how to execute step S1. As an optional implementation, in step S1, when determining the captured object, data enhancement is performed through the Mosaic model. Mosaic is a data enhancement technology used to enhance the generalization ability of the model when training a deep learning model. Mosaic data enhancement increases the diversity and complexity of the data set by merging four randomly selected and cropped training images into one image. Assuming that the four training images are selected, the merged image can be generated by the following steps:
[0123] 1. Image cropping: Crop each image to obtain the area.
[0124] 2. Image fusion: Place the cropped image segments in the four quadrants of the new image.
[0125] 3. Update annotation: Update the annotation of the target according to the position of each image fragment in the new image.
[0126] The formula for the Mosaic model is:
[0127]
[0128] Among them, I is the final generated Mosaic image, which is the image input to the YOLOv5 model. i is the original selected image, I i (R i ) is from image I i The area cut out in R i corresponds to image I i The cropping area, i∈{1,2,3,4}.
[0129] Data enhancement through the Mosaic model can simulate complex scenes containing multiple objects and backgrounds, which can improve the robustness and generalization ability of the model in practical applications. And it can learn how to identify targets in a more visually rich and varied environment.
[0130] In the present disclosure, there is no particular limitation on how to perform step S1. As an optional implementation, in step S1, the formula of the facial expression recognition model is:
[0131]
[0132] F output =MLP(Corss-Fusion(Q img ,K lm ,V lm ))
[0133]
[0134] Among them, F output is the feature extraction function of the POSTER V2 algorithm. Facial expression recognition involves multiple technical fields such as image processing and machine learning. The POSTER V2 algorithm achieves advanced performance in facial expression recognition tasks by effectively combining facial landmark features and image features and using a cross-fusion transformer encoder to process these inputs. This algorithm is particularly suitable for complex visual tasks that require processing large-scale data sets, and with the help of model compression technology, the computational cost is further reduced, enhancing the practicality of the model.
[0135] P|(em|I) is the probability of one facial expression em in the input image I, W em is the weight of facial expression em, b em is the bias of facial expression em, em' is the sum of different facial expressions, MLP is a multi-layer perceptron, Cross-Fusion is a cross-fusion encoder, softmax is the normalized attention score, d is the scale factor, Q img is the query matrix of the features of image I, extracted from the backbone network of the YOLOv5 model, K lmis the key matrix of the landmark features, V lm Q is the value matrix of the landmark features, which is used to perform cross-attention calculation with the image features. img , K lm and V lm It can be directly obtained from the input image I.
[0136] In the above formula, this formula combines image and landmark features, and more effectively processes and recognizes different facial expressions by cross-fusion transformer encoders. Specifically in this embodiment:
[0137] 50% probability of aggression and 50% probability of neuroticism correspond to anger;
[0138] Anxiety probability 50%, depression probability 50% corresponds to fear;
[0139] A probability of self-regulation of 50% and a probability of equilibrium of 50% correspond to neutrality;
[0140] The probability of depression is 33.3%, the probability of suspicion is 33.3%, and the probability of depression is 33.3%, which corresponds to sadness;
[0141] A 50% probability of happiness and a 50% probability of confidence correspond to surprises;
[0142] Probability of aggression 50%, probability of depression 50%, corresponding to disgust;
[0143] The probability of vitality is 25%, the probability of happiness is 25%, the probability of self-confidence is 25%, and the probability of self-regulation is 25%, which corresponds to happiness.
[0144] In the present disclosure, there is no particular limitation on how to perform step S1. As an optional implementation, in step S1, when obtaining the calculation result of the facial expression recognition model of the captured object, the facial expression recognition model is compressed according to the following formula:
[0145] Params compressed =LayerReduce(Params original ,l)×DimReduce(D original ,γ)
[0146] Among them, Params original is the original number of parameters of the facial expression recognition model, LayerReduce is the function of reducing the number of layers, DimReduce is the function of reducing the feature dimension, l is the number of reduced layers, and D original is the original feature dimension of the facial expression recognition model, γ is the ratio of dimension reduction, Params compressed is the original number of parameters of the compressed facial expression recognition model.
[0147] By compressing the facial expression recognition model, the number of network layers and the feature dimensions of each layer are reduced, the complexity of the model is reduced, and the computational efficiency of the model is improved. In this way, while maintaining high recognition performance, the computing requirements are significantly reduced, and the number of model parameters and the computing resources required for operation can be effectively reduced, while the performance of the model is maintained as much as possible, which not only improves the practicality of the model, but also optimizes the computing efficiency, so that the method provided in this embodiment can be effectively deployed on devices with limited computing power to deploy complex models, such as mobile devices or embedded systems, effectively balancing the model performance and the use of computing resources.
[0148] In the present disclosure, there is no special limitation on how to perform step S1. As an optional implementation, in step S1, the facial expression recognition model is a trained facial expression recognition model, and the loss function of the training facial expression recognition model is:
[0149]
[0150] Among them, L2 is the loss function for training the facial expression recognition model, em k is the true expression label of the kth sample, I k is the corresponding input image, P(em k |I k ) is the facial expression recognition model predicting expression em k The corresponding input image I k probability.
[0151] In the present disclosure, there is no particular limitation on how to perform step S2. As an optional implementation, in step S2, the emotional state information of the captured object is generated according to the following model:
[0152] S=StateAnalyzer(F combined )
[0153] F combined = fusion(F face ,F voice ,F physiological ,F psychology )
[0154] F face =POSTERV2(I)
[0155] F voice =extractVoiceFeatures(audio signal)
[0156] Wherein, S is the emotional state information, StateAnalyzer is the state analysis function, which can be any machine learning model suitable for a specific task, such as a classifier, a regressor, or a clustering algorithm, which is not limited here, and those skilled in the art can flexibly select according to actual needs. combined Fusion is a feature fusion function, which can be implemented in a variety of ways, such as simple concatenation, weighted average, or more complex machine learning models to learn the optimal combination of different features. This is not limited here, and those skilled in the art can flexibly select according to actual needs. face is the facial expression recognized by the POSTERV2 algorithm, F voice is the voice feature, extractVoiceFeatures is the voice feature extraction function, audio signal is the voice signal obtained from the input video material, and F physiological is the physiological parameter, F psychology For psychological parameters.
[0157] In this disclosure, the model that generates the emotional state information of the captured object provides a comprehensive framework to analyze the psychological and physiological state of the individual by combining multiple information sources such as facial expressions, voice and physiological signals. Through feature extraction, fusion and analysis strategies, the model can adapt to a variety of different application scenarios and provide in-depth insights. It plays an important role in the analysis of psychological and physiological states.
[0158] In the present disclosure, there is no particular limitation on how to perform step S2. As an optional implementation, in step S2, the model for generating the captured object's emotional state information is a trained model, and the loss function of the model for training the captured object's emotional state information is:
[0159] L3=loss(S,S true )
[0160] Among them, L3 is the loss function for training and generating a model to capture the emotional state information of the object, which can be a mean square error, cross entropy or other loss function suitable for a specific task, which is not limited here, and those skilled in the art can flexibly select it according to actual needs. true For real emotional state information, the labels can be students’ concentration, students’ emotions, etc.
[0161] At the same time, the model that generates the captured object’s emotional state information is evaluated according to the following formula:
[0162] Performance=evaluate(S,S ture )
[0163] Among them, Performance is the performance of the model that generates information about the emotional state of the object, and evaluate is an evaluation function that returns a measure of the model performance based on the task type.
[0164] In the present disclosure, there is no particular limitation on how to perform step S3. As an optional implementation, in step S3, the physical and mental health status includes:
[0165] Student Engagement Indicators:
[0166] Engagement = α·F face +(1-α)·BehaviorAnalysis
[0167] Wherein, α is a weight coefficient, which is used to balance the contribution of facial expression analysis and behavior analysis, and can be flexibly set by technicians in this field according to actual needs. BehaviorAnalysis is the result of behavior analysis, which can be obtained by teachers or other existing methods, and is not limited here;
[0168] Emotional state indicator EmotionState:
[0169] EmotionState=EmotionClassifier(F face )
[0170] Among them, EmotionClassifier is a classification model used to predict emotional states based on facial expressions recognized by the POSTERV2 algorithm;
[0171] Attention concentration indicator Attention:
[0172] Attention=PhysiologicalAnalyzer(F physiological )
[0173] Among them, PhysiologicalAnalyzer is an analysis model used to analyze the physiological signal characteristics F physiological Predicting attention span;
[0174] Learning efficiency index Efficiency:
[0175]
[0176] Among them, TaskCompletion is the degree of task completion, and TimeSpent is the time spent on completing the task, which is obtained by the teacher through questionnaires or other methods and is not limited in this disclosure;
[0177] Comprehensive learning status indicator OverallLearningIndex:
[0178] OverallLearningIndex=ω1·Engagement+ω2·EmotionState+ω3·Attention+ω4·Efficiency
[0179] Among them, ω1, ω2, ω3, and ω4 are weight coefficients, which are adjusted by technicians in this field according to actual needs and based on the importance of each indicator;
[0180] Learning Assessment:
[0181] LearningAssessment=ThresholdFunction(OverallLearningIndex)
[0182] Among them, ThresholdFunction is a threshold function, which is used to determine the student's learning status according to the comprehensive learning status indicator, such as excellent, good, average, poor, etc.
[0183] The above model formula provides an intuitive framework for evaluating and analyzing students' comprehensive learning status. By comprehensively considering students' engagement, emotional state, concentration, and learning efficiency, educators can better understand students' learning process and take corresponding measures to optimize the learning environment and improve learning efficiency, provide support for personalized learning, and help students achieve the best learning results.
[0184] In the present disclosure, there is no special limitation on how to perform step S1, step S2, and step S3. As an optional implementation, in step S1, step S2, or step S3, if the head of the captured object moves, the three-dimensional motion trajectory of the head of the captured object is obtained, and then the three-dimensional motion trajectory is converted into a vector for tracking.
[0185] In the present disclosure, there is no special limitation on how to perform step S1, step S2, and step S3. As an optional implementation, in step S1, step S2, or step S3, if the head of the captured object moves, the three-dimensional motion trajectory of the head of the captured object is obtained, and then the three-dimensional motion trajectory is converted into a vector for tracking. Converting the three-dimensional motion trajectory into a vector specifically includes the following steps:
[0186] Feature extraction and prediction are performed according to the following model:
[0187] Feature = Backbone Feature (I)
[0188] (x',y')=Head 2D (Feature)
[0189] (Δx, Δy, Δz) = Head offset (Feature)
[0190] (z')=Head Depth (Feature)
[0191] (S x ,S y ,S z )=Head Size (Feature)
[0192] (θ)=Head Angle (Feature)
[0193] Among them, Feature is the feature, (I) is the input image, Backbone Feature Head is the feature extraction network. 2D Used to extract the coordinates (x', y') of the center point of the predicted 2D box, Head offset Used to extract the offset (Δx, Δy, Δz) between the predicted 2D box center point and the real 3D projection coordinates; Head Depth Used to extract the depth value (z') of the predicted 2D box center point, Head Size Used to extract the size of the predicted 3D box (S x ,S y ,S z ), Head Angle Used to extract the predicted observation angle (θ);
[0194] The three-dimensional features are constructed according to the following model to form a vector:
[0195]
[0196] in, is the vector formed. In the vector information formed, (S x ,S y ,S z ) and observation angle (θ) incorporate the size and orientation information of the head, and more comprehensively express the state of the head and neck in three-dimensional space.
[0197] In the present disclosure, there is no special limitation on how to perform step S1, step S2, and step S3. As an optional implementation, in step S1, step S2, or step S3, the model for constructing three-dimensional features is a trained model, and the loss function of the model for training the three-dimensional features is:
[0198]
[0199] Among them, L4 is the loss function of the model for training and constructing three-dimensional features. The three-dimensional motion feature vector of the i-th sample predicted by the model for constructing three-dimensional features, is the true 3D motion feature vector corresponding to the i-th sample.
[0200] At the same time, this embodiment also provides an electronic device, such as Figure 2 As shown, including:
[0201] One or more processors 101;
[0202] The memory 102 stores one or more computer programs. When the one or more computer programs are executed by the one or more processors 101, the one or more processors 101 implement a method for acquiring physical and mental health status according to the first aspect of the present invention.
[0203] The electronic device may further include one or more I / O interfaces 103 connected between the processor 101 and the memory 102 and configured to implement information interaction between the processor 101 and the memory 102 .
[0204] Among them, the processor 101 is a device with data processing capabilities, including but not limited to the central processing unit 101 (CPU), etc.; the first memory 102 is a device with data storage capabilities, including but not limited to random access memory 102 (RAM, more specifically such as SDRAM, DDR, etc.), read-only memory 102 (ROM), electrically erasable programmable read-only memory 102 (EEPROM), flash memory (FLASH); the I / O interface 103 (read-write interface) is connected between the processor 101 and the memory 102, and can realize information interaction between the processor 101 and the memory 102, including but not limited to the data bus 104 (Bus), etc.
[0205] In some embodiments, the processor 101 , the memory 102 , and the I / O interface 103 are connected to each other via a bus 104 , and further connected to other components of the computing device.
[0206] As a third aspect of the present invention, a computer readable medium is provided. Figure 3As shown, a computer program is stored thereon, and when the computer program is executed by a processor, a method for obtaining physical and mental health status provided by the first aspect of the present disclosure is implemented.
[0207] It can be understood by a person of ordinary skill in the art that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program. Accordingly, the computer program can be stored in a non-volatile computer-readable storage medium, and the computer program can implement the method of any of the above-mentioned embodiments when executed. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0208] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Those skilled in the art should understand that the present invention includes but is not limited to the contents described in the drawings and the above specific embodiments. Any modification that does not deviate from the functional and structural principles of the present invention will be included in the scope of the claims.
Claims
1. A method for obtaining physical and mental health status, used to obtain the physical and mental health status of students on campus, characterized in that: The method for obtaining the physical and mental health status comprises the following steps: Determine a capture object, and obtain a calculation result of a facial expression recognition model of the capture object through a facial expression recognition model, wherein the calculation result includes physiological parameters and psychological parameters of the capture object; Generate emotional state information of the captured object based on the calculation result of the facial expression recognition model of the captured object; Based on the captured object's coordinate information, class participation, mental health reference score and emotional state information, the student's physical and mental health status is generated and feedback is provided.
2. The method for obtaining physical and mental health status according to claim 1, characterized in that: The captured object is determined by the YOLOv5 network model, and the formula of the YOLOv5 network model is: Y=CSP-Darknet53(I) AND SPP =SPP(Y) AND PANet =PANet(AND SPP ) class_prob,obj_score=σ(Head(Y PANet )) Among them, Y is the extracted feature, CSP-Darknet53 is the backbone network of the YOLOv5 model, I is the input image, SPP is the spatial pyramid pooling, and Y SPP is the calculation result of spatial pyramid pooling, PANet is the path aggregation network, and Y PANet is the calculation result of the path aggregation network, bbox is the bounding box, σ is the Sigmoid activation function, (t x ,t y ,t w ,t h ) is the adjustment parameter of the YOLOv5 model, (c x ,c y ) is the upper left corner of the grid unit, (p w ,p h ) is the width and height of the predefined anchor box, e is the natural logarithm, class_prob is the probability of the head category, obj_score is the probability of belonging to the target, and Head is the predicted head.
3. The method for obtaining physical and mental health status according to claim 2, characterized in that: The YOLOv5 network model is a trained YOLOv5 network model, and the loss function for training the YOLOv5 network model is: L1=L class +L obj +L bbox Where L1 is the loss function for training the YOLOv5 network model, N is the number of training samples, and L class is the classification loss function, L obj The object has a loss function, L bbox Bounding box regression loss function, The category probability of the i-th sample predicted by the YOLOv5 network model, The probability of the object existing in the i-th sample predicted by the YOLOv5 network model, is the confidence that the object exists, Adjust parameters for bounding boxes predicted by the YOLOv5 network model, are the corresponding ground-truth bounding box parameters.
4. The method for obtaining physical and mental health status according to claim 2, characterized in that: When determining the captured object, data enhancement is performed through the Mosaic model, and the formula of the Mosaic model is: Among them, I is the final generated Mosaic image, which is the image input to the YOLOv5 model. i is the original selected image, I i (R i ) is from image I i The area cut out in R i corresponds to image I i The cropping area, i∈{1,2,3,4}.
5. The method for obtaining physical and mental health status according to claim 2, characterized in that: The formula of the facial expression recognition model is: F output =MLP(Corss-Fusion(Q img ,K lm ,V lm )) Where P(emI) is the probability of one of the facial expressions em under the input image I, W em is the weight of facial expression em, b em is the bias of facial expression em, em' is the sum of different facial expressions, F output is the feature extraction function of the POSTERV2 algorithm, MLP is a multi-layer perceptron, Cross-Fusion is a cross-fusion encoder, softmax is the normalized attention score, d is the scale factor, Q img is the query matrix of the features of image I, extracted from the backbone network of the YOLOv5 model, K lm is the key matrix of the landmark features, V lm is the value matrix of landmark features.
6. The method for obtaining physical and mental health status according to claim 5, characterized in that: When obtaining the calculation result of the facial expression recognition model of the captured object, the facial expression recognition model is compressed according to the following formula: Params compressed =LayerReduce(Params original ,l)×DimReduce(D original ,γ) Among them, Params original is the original number of parameters of the facial expression recognition model, LayerReduce is a function for reducing the number of layers, DimReduce is a function for reducing the feature dimension, l is the number of layers reduced, and D original is the dimension of the original feature of the facial expression recognition model, γ is the ratio of dimension reduction, Params compressed is the original number of parameters of the facial expression recognition model after compression.
7. The method for acquiring physical and mental health status according to claim 5, characterized in that: The facial expression recognition model is a trained facial expression recognition model, and the loss function of training the facial expression recognition model is: Wherein, L2 is the loss function for training the facial expression recognition model, em k is the true expression label of the kth sample, I k is the corresponding input image, P(em k |I k ) is the facial expression recognition model predicting expression em k The corresponding input image I k probability.
8. The method for acquiring physical and mental health status according to claim 5, characterized in that: The physiological parameters captured include aggression, anxiety, balance, vitality, depression, happiness, stress, doubt, self-confidence, self-regulation, neuroticism, and depression; The psychological parameters of the captured objects include: aggression, depression, stress, neuroticism, suspicion, anxiety; Among them, the probability of aggression 50% and neuroticism 50% correspond to anger; Anxiety probability 50%, depression probability 50% corresponds to fear; A probability of self-regulation of 50% and a probability of equilibrium of 50% correspond to neutrality; The probability of depression is 33.3%, the probability of suspicion is 33.3%, and the probability of depression is 33.3%, which corresponds to sadness; A 50% probability of happiness and a 50% probability of confidence correspond to surprises; Probability of aggression 50%, probability of depression 50%, corresponding to disgust; The probability of vitality is 25%, the probability of happiness is 25%, the probability of self-confidence is 25%, and the probability of self-regulation is 25%, which corresponds to happiness.
9. The method for obtaining physical and mental health status according to claim 8, characterized in that: The emotional state information of the captured object is generated according to the following model: S=StateAnalyzer(F combined ) F combined =fusion(F face ,F voice ,F physiological ,F psychology ) F face =POSTERV2(I) F voice =extractVoiceFeatures(audio signal) Among them, S is the emotional state information, StateAnalyzer is the state analysis function, and F combined is the fusion feature, fusion is the feature fusion function, F face is the facial expression recognized by the POSTERV2 algorithm, F voice is the speech feature, extractVoiceFeatures is the speech feature extraction function, audio signal is the speech signal, F physiological is the physiological parameter, F psychology For psychological parameters.
10. The method for obtaining physical and mental health status according to claim 9, characterized in that: The model for generating the emotional state information of the captured object is a trained model, and the loss function for training the model for generating the emotional state information of the captured object is: L3=loss(S,S true ) Among them, L3 is the loss function for training the model to capture the emotional state information of the object, S true It is the real emotional state information; At the same time, the model that generates the captured object’s emotional state information is evaluated according to the following formula: Performance=evaluate(S,S ture ) Among them, Performance is the performance of the model that generates the emotional state information that captures the object, and evaluate is the evaluation function.
11. The method for acquiring physical and mental health status according to claim 9, characterized in that: The physical and mental health status includes: Student Engagement Indicators: Commitment=α·F face +(1-α)·BehaviorAnalysis Among them, α is the weight coefficient, BehaviorAnalysis is the behavior analysis result; Emotional state indicator EmotionState: EmotionState=EmotionClassifier(F face ) Among them, EmotionClassifier is a classification model used to predict emotional states based on facial expressions recognized by the POSTERV2 algorithm; Attention concentration indicator Attention: Attention=PhysiologicalAnalyzer(F physiological ) Among them, PhysiologicalAnalyzer is the analysis model; Learning efficiency index Efficiency: Among them, TaskCompletion is the task completion degree, and TimeSpent is the time spent to complete the task; Comprehensive learning status indicator OverallLearningIndex: OverallLearningIndex=ω1·Engagement+ω2·EmotionState+ω3·Attention+ω4·Efficiency Among them, ω1, ω2, ω3, and ω4 are weight coefficients; Learning Assessment: LearningAssessment=ThresholdFunction(OverallLearningIndex) Among them, ThresholdFunction is the threshold function.
12. The method for acquiring physical and mental health status according to any one of claims 1 to 11, characterized in that: If the head of the captured object moves, the three-dimensional motion trajectory of the head of the captured object is obtained, and then the three-dimensional motion trajectory is converted into a vector for tracking.
13. The method for acquiring physical and mental health status according to claim 12, characterized in that: Obtaining the three-dimensional motion trajectory of the head of the captured object and converting the three-dimensional motion trajectory into a vector includes the following steps: Feature extraction and prediction are performed according to the following model: Feature=Backbone Feature (I) (x',y')=Head 2D (Feature) (Δx,Δy,Δz)=Head offset (Feature) (z')=Head Depth (Feature) (S x ,S y ,S z )=Head Size (Feature) (θ)=Head Angle (Feature) Among them, Feature is the feature, (I) is the input image, Backbone Feature Head is the feature extraction network. 2D Used to extract the coordinates (x', y') of the center point of the predicted 2D box, Head offset Used to extract the offset (Δx, Δy, Δz) between the predicted 2D box center point and the real 3D projection coordinates; Head Depth Used to extract the depth value (z') of the predicted 2D box center point, Head Size The size of the predicted 3D box (S x ,S y ,S z ), Head Angle Used to extract the predicted observation angle (θ); The three-dimensional features are constructed according to the following model to form a vector: in, is the vector formed.
14. The method for acquiring physical and mental health status according to claim 13, characterized in that: The model for constructing three-dimensional features is a trained model, and the loss function of training the model for constructing three-dimensional features is: Among them, L4 is the loss function of the model for training and constructing three-dimensional features. The three-dimensional motion feature vector of the i-th sample predicted by the model for constructing three-dimensional features, is the true 3D motion feature vector corresponding to the i-th sample.
15. An electronic device, characterized in that: include: one or more processors; A memory having one or more computer programs stored thereon, wherein when the one or more computer programs are executed by the one or more processors, the one or more processors implement the method for acquiring the physical and mental health status according to any one of claims 1 to 14.
16. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for obtaining the physical and mental health status described in any one of claims 1 to 14 is implemented.
