Campus psychological health monitoring and early warning method based on face recognition and expression analysis
By using facial recognition and expression analysis technology in the campus mental health monitoring system, students' mental health status are monitored in real time and issued early warnings, solving the problems of lag, limited accuracy and lack of real-time early warning in the existing system, and achieving efficient and accurate mental health monitoring and early warning.
Patent Information
- Application Number
- CN202411735264.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-05-09
AI Technical Summary
The existing campus mental health monitoring system has lag, limited monitoring accuracy and coverage, and lack of real-time monitoring and early warning mechanisms, making it difficult to detect and respond to students' potential psychological crises in a timely manner.
Using methods based on face recognition and expression analysis, face detection is established through YOLO algorithm, small image feature extraction, facial key point detection, head posture estimation, expression recognition model analysis and Isolation Forest model abnormal detection, campus emotion baseline is established, and real-time monitoring and early warning are achieved.
It realizes efficient real-time monitoring, can accurately identify students' emotional state, timely warns, prevent and respond to mental health crises, and ensure students' physical and mental health.
Smart Images

Figure CN119964788A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of campus mental health, and in particular to a campus mental health monitoring and early warning method based on face recognition and expression analysis. Background Art
[0002] With the rapid development of society and the improvement of education level, students' mental health issues have received more and more attention. The mental health monitoring systems widely used on campus currently rely mainly on questionnaires and psychological tests. These systems usually assess students' mental health status by regularly collecting self-reported data (such as emotions, stress, sleep quality, etc.). Although this method is effective to a certain extent, it has obvious limitations, especially in terms of real-time and accuracy. Such methods cannot reflect students' psychological dynamics in real time, making it difficult to detect and respond to potential psychological crises in a timely manner. At the same time, some intelligent security systems or emotion recognition systems have begun to combine face recognition technology for emotion analysis, but these systems are usually used in fields such as retail and market research, and infer customers' emotional states by analyzing their facial expressions. However, these systems are not optimized for campus mental health monitoring, lack specific early warning mechanisms and necessary data privacy protection measures, which limits their application effect in campus environments.
[0003] In the prior art, there are the following shortcomings regarding campus detection:
[0004] 1. The mental health monitoring methods are outdated. Existing mental health monitoring mainly relies on regular psychological questionnaires and psychological interviews. These methods often have a lag and cannot reflect the students' mental state in real time, resulting in the inability to detect and intervene in time when students encounter psychological problems.
[0005] 2. Limited monitoring accuracy and coverage. Existing psychological monitoring systems often rely on self-report data, which is limited by students’ subjective willingness and filling accuracy. Self-reporting may lead to data distortion due to students’ concealment or misleading answers.
[0006] 3. Lack of real-time monitoring and early warning mechanisms. After identifying students’ psychological problems, the existing system lacks a timely early warning mechanism and cannot take prompt action. Early warnings are often based on periodic assessment results rather than real-time data analysis. Summary of the invention
[0007] In order to overcome the shortcomings of the prior art, the present invention provides a campus mental health monitoring and early warning method based on face recognition and expression analysis, which monitors the mental health status of students in real time through face recognition and expression analysis, and issues an early warning when potential problems are identified.
[0008] In order to achieve the above object, the present invention provides a campus mental health monitoring and early warning method based on face recognition and expression analysis, characterized in that the specific steps include:
[0009] Obtain face images from video sequences of campus environments, use the YOLO algorithm to detect face thumbnails in low-pixel areas, and extract features from face thumbnails; use facial key point detection technology to obtain the locations of facial key points in face thumbnails, and adjust face thumbnails based on the locations of key points; and use head posture estimation technology to align and correct faces;
[0010] Analyze facial expressions and corresponding psychological states through expression recognition models, associate expression data with psychological state data, and establish campus emotion baselines;
[0011] Based on the campus emotion baseline, the Isolation Forest model is used to identify potential emotion patterns and abnormal changes. If an emotional abnormality is detected, an alarm reminder will be issued through the preset early warning mechanism.
[0012] Preferably, the step of detecting the face thumbnail in the low-pixel area includes:
[0013] The YOLO network is used to detect the face area in the face image. If the detected image is clear, the detection result is output. If the detected image is blurred, the blurred area is marked as a low confidence area for secondary detection.
[0014] Preferably, small face Figure 2 The steps of this test include:
[0015] A super-resolution reconstruction network is used to enhance the image of the face area with low confidence.
[0016] A feature pyramid network is used to perform multi-layer feature detection on the super-resolution reconstructed face area to obtain low-level and high-level features of the face area.
[0017] Preferably, the expression recognition model uses AffectNet as a data set, and uses a masked autoencoder to train the expression recognition model to dynamically recognize expressions.
[0018] Preferably, the step of training the expression recognition model with a masked autoencoder comprises:
[0019] Partial areas are randomly blocked in the input original image, and the expression recognition model is controlled to learn and restore the complete data. The encoder is used to process the unmasked image blocks to extract the information of key features, and the decoder is used to decode the extracted information.
[0020] Preferably, the decoder decoding process includes:
[0021] The feature map generated by the encoder is restored to the size of the original image through upsampling operation, the relevant information of the upsampled feature map is fused, and finally the reconstructed complete image is output, which includes the masked part;
[0022] The decoder parameters are adjusted by minimizing the reconstruction error to generate an expression recognition model.
[0023] Preferably, the steps of the Isolation Forest model identifying potential emotion patterns and abnormal changes include:
[0024] Obtain training data containing expression features and pre-process the training data;
[0025] Use the Isolation Forest model training data set to establish the normal and abnormal modes of the Isolation Forest model;
[0026] Use the trained Isolation Forest model to perform anomaly detection on new expression data and identify potential abnormal emotions;
[0027] The abnormal analysis model is used to score abnormal expressions, determine whether there is an abnormal emotional state, and generate a corresponding detection report.
[0028] The present invention also provides a computer-readable storage medium, which stores computer instructions. When a computer executes the computer instructions, it is used to execute all steps of the campus mental health monitoring and early warning method based on face recognition and expression analysis.
[0029] The present invention also provides an electronic device, comprising: at least one processor; and
[0030] a memory communicatively connected to at least one processor; wherein,
[0031] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a campus mental health monitoring and early warning method based on face recognition and expression analysis.
[0032] The campus mental health monitoring and early warning method based on face recognition and expression analysis provided by the present invention has the following beneficial effects:
[0033] 1. The face thumbnail is initially inspected through the YOLO algorithm, and then the face thumbnail is re-detected, so that faces can be detected even in blurred and low-pixel areas. The detection accuracy is high, and efficient real-time monitoring can be achieved, ensuring that students' facial expressions can be captured and processed quickly and accurately in a campus environment, providing high-quality data support for subsequent sentiment analysis.
[0034] 2. By using the expression recognition model and MAE-DFER algorithm trained based on the AffectNet dataset, the system can accurately identify students' various emotional states (such as happiness, sadness, anxiety, etc.), and conduct dynamic evaluation based on the emotional baseline to effectively distinguish the emotional fluctuations associated with different campus scenarios.
[0035] 3. By establishing emotional baselines based on different campus scenarios (such as classroom, break, lunch break, exams, etc.), it can provide each student with a personalized mental health assessment. The system can generate a student's mental health status curve based on long-term emotional data to accurately identify abnormal emotional changes.
[0036] 4. Combined with the Isolation Forest anomaly detection model, when the system detects abnormal changes in students' emotional curves, it can quickly issue an early warning and notify relevant teachers and parents to intervene. This timely early warning mechanism can effectively prevent and respond to possible mental health crises and protect students' physical and mental health. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A flow chart of the campus mental health monitoring and early warning method based on face recognition and expression analysis provided by the present invention;
[0038] Figure 2 A flow chart of dynamic expression recognition provided by the present invention. DETAILED DESCRIPTION
[0039] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0040] like Figure 1 As shown, the present invention provides a campus mental health monitoring and early warning method based on face recognition and expression analysis, and its specific steps include:
[0041] Obtain face images from video sequences of campus environments, use the YOLO algorithm to detect face thumbnails in low-pixel areas, and extract features from face thumbnails; use facial key point detection technology to obtain the locations of facial key points in face thumbnails, and adjust face thumbnails based on the locations of key points; and use head posture estimation technology to align and correct faces;
[0042] Analyze facial expressions and corresponding psychological states through expression recognition models, associate expression data with psychological state data, and establish campus emotion baselines;
[0043] Based on the campus emotion baseline, the Isolation Forest model is used to identify potential emotion patterns and abnormal changes. If an emotional abnormality is detected, an alarm reminder will be issued through the preset early warning mechanism.
[0044] Specifically, the present invention is a method for campus mental health monitoring based on artificial intelligence and big data technology. A shooting device is used to obtain a dynamic video time-series image of a campus environment, a YOLO algorithm is used to preliminarily obtain a face image in the video image, and then a face thumbnail in a low-pixel area is selected from the obtained image. By accurately detecting and identifying the face in the low-pixel area, the accuracy of fuzzy face detection in a dynamic detection state is improved. After obtaining the face thumbnail, the face thumbnail is post-processed. That is, the key points of the face are detected, the coordinate positions corresponding to the key points are obtained, and the key parts such as the eyes, nose, and mouth are ensured to be kept in the standard position by rotating and cropping the face. At the same time, head alignment is performed in combination with head posture estimation technology to provide a basis for the accuracy of expression recognition. After the face thumbnail is detected, a deep learning model is used to extract the face features of the face thumbnail, and an expression recognition model is trained to recognize the expression of the students in the face thumbnail. The long-term psychological state of the students is analyzed based on the expression, and the two are associated to establish a campus emotional baseline. According to the campus emotional baseline, the Isolation Forest model detects the student's emotions and determines whether the student's emotions are abnormal or potentially abnormal, so that external personnel can intervene in time.
[0045] In this embodiment, the step of detecting a face thumbnail in a low-pixel area includes:
[0046] The YOLO network is used to detect the face area in the face image. If the detected image is clear, the detection result is output. If the detected image is blurred, the blurred area is marked as a low confidence area for secondary detection.
[0047] Specifically, the YOLO network detection process is the initial detection, that is, fast detection. This process uses the YOLO network to quickly detect the entire image and identify possible face areas. For some clear and close faces, the YOLO network can directly provide accurate detection results. However, for distant, blurred or small-sized faces, YOLO's detection confidence may be low. At this time, these areas will be marked as low-confidence areas and enter the secondary detection process.
[0048] YOLO's detection process is: divide the input image into SxS grids, predict B bounding boxes for each grid, each bounding box contains 5 information (x, y, w, h, confidence) and the probability distribution of the target category, and the confidence score attached to each bounding box is used to indicate the probability of detecting a face.
[0049] To suppress repeated detection, non-maximum suppression (NMS) is used to filter out low-confidence bounding boxes; and YOLO uses a customized loss function for model training, which takes into account classification error, positioning error (error in center point coordinates x, y and width and height w, h) and confidence error. The YOLO network optimizes network parameters through back propagation and gradient descent, such as Adam or SGD optimizer.
[0050] Among them, the face thumbnail refers to a small image of a face that only has the face of the face. The face image initially obtained by the YOLO algorithm is a rough image, and the range of its image frame selection includes the face and other parts of the body. When detecting the face thumbnail, the face area is cropped out from the original rough image to generate a face thumbnail. In order to improve the detection accuracy, the face thumbnail detected by the YOLO network is subjected to secondary detection, and the steps include:
[0051] Super-resolution reconstruction: A super-resolution reconstruction network is used to enhance the image of face areas marked with low confidence.
[0052] Specifically, for the face areas marked as low confidence, these areas are first enhanced through the super-resolution reconstruction network. The originally blurred and sparsely pixelated face images are reconstructed into higher-resolution images, making the detailed features (such as eyes, nose, and mouth) clearer.
[0053] Refined detection: A feature pyramid network is used to perform multi-layer feature detection on the face area reconstructed by super-resolution to obtain low-level and high-level features of the face area.
[0054] Specifically, after super-resolution reconstruction, the processed image enters the refined detection stage. At this stage, the detection model based on the feature pyramid network FPN will perform hierarchical analysis on these enhanced image areas. The system can more accurately detect small target faces that were originally difficult to identify, such as distinguishing the relative positions of the eyes, nose, and mouth, as well as subtle facial features.
[0055] Among them, the feature pyramid network FPN can fuse feature maps from different scales, and perform hierarchical detection on the input image through multiple feature layers of different scales to ensure that large, medium and small targets can be accurately detected. Among them, the extracted features include: low-level features: image key edges and texture details. For small targets (such as faces at a distance), these low-level features can help the model capture the fine contours and local texture information of the face, such as small-scale facial key points such as eyes, nose, and mouth. High-level features: reflect the global semantic information in the image, such as the category or approximate shape of the object. Preferably, the specific scales used in the present invention correspond to the feature maps generated after each downsampling at different downsampling rates (1 / 8, 1 / 16, 1 / 32) in the network. The present invention changes the scale design in FPN and adds more intermediate levels (1 / 4, 1 / 8, 1 / 16, 1 / 32) to make the feature map richer at multiple scales. This improvement can cover a wider range of target size ranges, especially in small target detection.
[0056] In the process of detecting faces using the YOLO network, an anchor box (target detection) suitable for the face size is designed based on the characteristics of face distribution in campus scenes. The target sizes in different scenes are analyzed through K-Means clustering to determine the appropriate anchor size.
[0057] In summary, when detecting small face images, the dual-stage detection mechanism (primary detection and secondary detection) is combined with the fast detection and secondary refined detection of the YOLO network to first identify most obvious face targets, and then perform secondary detection and super-resolution reconstruction specifically for the remaining low-resolution or blurred faces. This not only improves the detection accuracy of small targets, but also improves the recall rate, which has obvious advantages, especially in complex campus environments.
[0058] In this embodiment, after obtaining the face thumbnail, the face thumbnail is post-processed, and the steps include:
[0059] The facial key point detection technology is used to obtain the positions of the facial key points of the face thumbnail. By accurately rotating and cropping the face, it is ensured that the eyes, nose, mouth and other parts are kept in standardized positions. At the same time, the alignment method of head posture estimation is combined to cope with more complex scenes. Among them, traditional image alignment methods usually use simple geometric transformations to align images, such as rotation alignment based on eye positions. However, these alignment methods may ignore changes in facial expressions, head tilt or other complex situations. The present invention combines facial key point detection technology and head posture estimation technology, which can perform accurate rotation and alignment in complex scenes, ensuring that each key part (such as eyes, nose, mouth) is kept in a standardized position, thereby greatly improving the robustness of the detection.
[0060] In addition, through dynamic adjustments to facial rotation and cropping, the system can automatically adjust the orientation and cropping range of the image when processing faces in complex postures. Even when students lower their heads, raise their heads, or turn their heads, accurate expression recognition and emotion monitoring can still be performed.
[0061] In this embodiment, when the face area is detected, a 68-point labeling algorithm is used to mark 68 key points on the face. These key points are distributed according to the specific anatomical structure of the face, and the common distribution is as follows:
[0062] 1) Facial contour: from the left chin to the right chin, a total of 17 points.
[0063] 2) Eyebrows: 10 points in total for the left and right eyebrows.
[0064] 3) Eyes: Each eye has 6 points, a total of 12 points.
[0065] 4) Nose: There are 9 points on the bridge of the nose and the wings of the nose.
[0066] 5) Mouth: 20 points on the edge and inside of the lips.
[0067] Among them, 68-point annotation is usually achieved through regression models or deep learning models. These models have been trained on a large amount of facial data with key point annotations and can predict the exact position of each key point in the input face image. The output of the model is the coordinates of 68 facial key points, which represent the specific pixel position of each point in the image. By obtaining the position information of 68 key points on the face, especially the eyes and nose, faces at different angles can be aligned to ensure the accuracy of subsequent expression recognition tasks.
[0068] Based on the extracted facial features, the expression recognition model is used to recognize the student's expression, and the student's psychological state is analyzed based on the recognized expression. Among them, the expression recognition model uses AffectNet as the data set, and uses the masked autoencoder to train the expression recognition model to dynamically recognize expressions. The process of expression recognition model recognizing expressions is as follows Figure 2 shown.
[0069] Specifically, the present invention adopts a dynamic facial expression recognition model (Dynamic Facial Expression Recognition, DFER) based on the framework of Masked Autoencoder (MAE) based on the dynamic changes of human faces in time series images (usually video sequences) to recognize facial expressions. Among them, AffectNet is a large-scale emotional expression dataset, which is widely used to train and evaluate expression recognition models. The pre-trained expression recognition model based on AffectNet training selects 7 types of expressions according to the dataset, including: happiness, anger, sadness, disgust, surprise, fear, and neutral. Among them, the expression recognition model uses the architecture of Masked Autoencoder (MAE) to train the expression recognition ability of the model. The core of the expression recognition model is to use self-supervised learning to enhance the robustness and generalization ability of the dynamic expression recognition model, which has advantages when facing a large amount of unlabeled data.
[0070] The steps of training the expression recognition model with the masked autoencoder include:
[0071] Partial areas are randomly blocked in the input original image, and the expression recognition model is controlled to learn to restore the complete data. The encoder is used to process the unmasked image blocks to extract key feature information, and the decoder is used to decode the extracted information.
[0072] Specifically, the masked autoencoder randomly blocks some areas in the input data (image or video sequence). These blocked areas are usually small blocks in the image. The purpose is to force the expression recognition model to learn how to recover the complete data from the partial information by covering up some information, so as to capture more useful features and patterns. The encoder is used to extract useful key feature information from the unmasked image blocks, so that the encoder only needs to pay attention to less input information, thereby reducing the amount of calculation, while retaining the key information for the decoder. The decoder is used to reconstruct the extracted key information and the information of the masked area. That is, the decoder needs to restore the masked image blocks, thereby forcing the expression recognition model to understand and reconstruct the overall image structure. Among them, the decoder is an inverse neural network architecture, whose structure and design are usually symmetrical with the encoder, but its task is to map the features back to the original image space. Common decoder architectures include convolutional neural networks (CNN) and deconvolution (transposed convolution) networks.
[0073] In this embodiment, the decoding process of the decoder includes:
[0074] Feature upsampling: The feature map generated by the encoder is restored to the size of the original image through upsampling operations; usually completed through transposed convolution (deconvolution) layers and upsampling layer operations. Its purpose is to restore the spatial dimensions of the feature map so that subsequent operations can generate a complete image.
[0075] Feature fusion and reconstruction generation: The relevant information of the upsampled feature map is fused, where the relevant information includes: global features (the overall structure of the human body) and local features (face edges, texture information, etc.); through the fusion process, the decoder can better restore the masked area. Through multiple convolutional layers and activation functions, the final reconstructed complete image is output, and the complete image includes the masked part. Among them, each layer of convolution operation can help restore details and textures, and generate output close to the real image.
[0076] The purpose of reconstruction generation is to restore the masked image areas and learn the overall image structure by generating a reconstructed image that is as close to the original image as possible.
[0077] Optimize the expression recognition model: By minimizing the reconstruction error, adjust the decoder parameters based on the self-supervised learning objective, so that the model can learn how to recover and reconstruct the complete image from partial information, thereby improving the feature learning ability and generating the final expression recognition model.
[0078] In this embodiment, good expressions are identified based on the expression recognition model, and the corresponding psychological state is obtained by analyzing them. Emotional baselines are established according to students' activities in different scenarios on campus (such as classroom, break, lunch break, exam, etc.). For example, anxiety in class may be related to exam pressure, while anxiety between classes may be related to social problems. By analyzing the emotional baselines in different scenarios, the system can more accurately identify abnormal emotional changes.
[0079] The steps to establish a campus emotional baseline include:
[0080] Scene recognition and classification: Identify the scene that students are currently in through their schedules and geographic locations. Divide campus scenes into multiple categories, such as classroom, break, lunch break, exam, self-study, social activities, etc.
[0081] Emotional data collection: Obtain the expression data recognized by the expression recognition model, label each data point during data collection, and mark the corresponding scene.
[0082] Establishing emotional baselines: Segment the collected emotional data by scene, and establish an emotional distribution model for the corresponding scene. Use statistical analysis (such as mean, standard deviation, etc.) to establish a baseline of normal emotional range for each scene. For example, in a classroom scene, you may expect to be focused or slightly anxious, while in breaks, you may expect to be relaxed.
[0083] Long-term emotional state analysis: The emotional data collected at different time points and the corresponding psychological state data are stored and managed to form a time series database. Through statistical analysis and psychological theory, the students' short-term expression data and long-term psychological state are correlated and analyzed to identify potential emotional patterns and changes.
[0084] In this embodiment, for the anomaly detection of complex emotional patterns, traditional anomaly detection methods (such as statistical outlier detection, distance-based anomaly detection, etc.) may not be sensitive enough to complex patterns in emotional data (such as emotional fluctuations, subtle changes in expression), especially when facing high-dimensional data and dynamic changes. The present invention is based on the established campus emotional baseline and uses the Isolation Forest model to identify potential emotional models and abnormal changes. The Isolation Forest algorithm is an unsupervised machine learning method for anomaly detection, which constructs a decision tree by randomly selecting features and randomly selecting the segmentation values of the features, thereby isolating data points. Anomalies are usually more easily isolated because they are more different from other data points. The Isolation Forest model "isolates" anomalies through a tree structure, and can effectively identify unusual patterns in emotional data. This has advantages for capturing complex anomalies in expression data (such as sudden emotional fluctuations, unexpected emotional expressions). Its isolation mechanism makes it more effective to detect anomalies in high-dimensional data space. In addition, the Isolation Forest model is highly robust to high-dimensional expression features; traditional methods are susceptible to the "curse of dimensionality" in high-dimensional data (such as multi-dimensional feature vectors in expression analysis), resulting in a decrease in anomaly detection performance. In addition, Isolation Forest is relatively stable in high-dimensional data because it does not rely on distance or density calculations, but "isolates" data points through random segmentation. For high-dimensional feature data in expression analysis, this method can effectively identify anomalies without being significantly affected by the curse of dimensionality. The Isolation Forest model also provides high computational efficiency and is suitable for real-time data streams. For real-time expression analysis systems, it can quickly identify abnormal emotions or facial expressions, supporting immediate intervention and feedback. This has significant advantages in real-time monitoring and dynamic adjustment scenarios. The tree structure of the Isolation Forest model provides high interpretability and can track the isolation path and segmentation process of data points, thereby helping to analyze and interpret anomaly detection results. This helps to understand abnormal performance in emotional data and provide reasonable explanations for abnormal situations.
[0085] In this embodiment, the detection steps of the Isolation Forest model include:
[0086] Obtain training data containing expression features, which can include various quantitative descriptions of facial expressions, such as emotional intensity, frequency, and duration, and preprocess the training data; use normalization and standardization to ensure that the model can effectively learn the characteristics of the data.
[0087] Use the Isolation Forest model training data set to establish the normal and abnormal modes of the Isolation Forest model;
[0088] Use the trained Isolation Forest model to perform anomaly detection on new expression data and identify potential abnormal emotions;
[0089] The abnormal analysis model is used to score abnormal expressions, determine whether there is an abnormal emotional state, and generate a corresponding detection report.
[0090] When the anomaly analysis model analyzes abnormal expressions, each tree generates a path length for each sample, which indicates the path length from the root node to the leaf node. The shorter the path length, the easier it is for the sample to be isolated and the more likely it is to be an anomaly.
[0091] For a sample x, its path length in the i-th tree is recorded as h i (x). The average path length E(h(x)) of all trees is:
[0092]
[0093] Where T is the number of isolated trees.
[0094] Isolation Forest uses a standardized anomaly score s(x,n), defined as:
[0095]
[0096] Where c(n) is the expected value of the path length, which can be approximately calculated by the following formula:
[0097]
[0098] Among them, H(i) is the harmonic number, which can be approximated by Euler's constant and natural logarithm:
[0099] H(i)≈ln(i)+
[0100] Wherein, (γ=0.5772156649) is the Euler constant.
[0101] According to the anomaly score s(x,n), we can determine whether a sample is an outlier:
[0102] If s(x,n) is close to 1, it means that sample x is likely to be an outlier.
[0103] If s(x,n) is close to 0.5, it means that sample x is normal.
[0104] If s(x,n) is less than 0.5, it means that sample x is very normal.
[0105] In this embodiment, based on the abnormal analysis report detected by the Isolation Forest model, a risk warning mechanism is set up, and the warning information includes: students' emotional change charts, abnormal types, and recommended intervention measures. When the monitoring data shows that the probability of students' psychological crisis is high, an alarm reminder is issued to the school and psychological counselors in a timely manner.
[0106] In summary, the present invention realizes an integrated process from detection to emotional warning by closely combining steps such as face detection, thumbnail processing, feature extraction, and emotion analysis. This tight integration not only improves the efficiency of the overall system, but also enables the use of refined facial features in emotion analysis to ensure the accuracy and stability of the analysis.
[0107] The present invention also provides a computer-readable storage medium, which stores computer instructions. When a computer executes the computer instructions, it is used to execute all steps of the campus mental health monitoring and early warning method based on face recognition and expression analysis.
[0108] The present invention also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a campus mental health monitoring and early warning method based on face recognition and expression analysis.
[0109] Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
Claims
1. A campus mental health monitoring and early warning method based on face recognition and expression analysis, characterized in that: The specific steps include: Obtain face images from video sequences of campus environments, use the YOLO algorithm to detect face thumbnails in low-pixel areas, and extract features from face thumbnails; use facial key point detection technology to obtain the locations of facial key points in face thumbnails, and adjust face thumbnails based on the locations of key points; and use head posture estimation technology to align and correct faces; Analyze facial expressions and corresponding psychological states through expression recognition models, associate expression data with psychological state data, and establish campus emotion baselines; Based on the campus emotion baseline, the Isolation Forest model is used to identify potential emotion patterns and abnormal changes. If an emotional abnormality is detected, an alarm reminder will be issued through the preset early warning mechanism.
2. The campus mental health monitoring and early warning method based on face recognition and expression analysis according to claim 1 is characterized in that: The steps of detecting face thumbnails in low-pixel areas include: The YOLO network is used to detect the face area in the face image. If the detected image is clear, the detection result is output. If the detected image is blurred, the blurred area is marked as a low confidence area for secondary detection.
3. The campus mental health monitoring and early warning method based on face recognition and expression analysis according to claim 2 is characterized in that: The step of secondary detection of face thumbnails comprises: A super-resolution reconstruction network is used to enhance the image of the face area with low confidence. A feature pyramid network is used to perform multi-layer feature detection on the super-resolution reconstructed face area to obtain low-level and high-level features of the face area.
4. The campus mental health monitoring and early warning method based on face recognition and expression analysis according to claim 1 is characterized in that: The expression recognition model uses AffectNet as a data set and uses a masked autoencoder to train the expression recognition model to dynamically recognize expressions.
5. The campus mental health monitoring and early warning method based on face recognition and expression analysis according to claim 4 is characterized in that: The steps of training the expression recognition model by the masked autoencoder include: Partial areas are randomly blocked in the input original image, and the expression recognition model is controlled to learn and restore the complete data. The encoder is used to process the unmasked image blocks to extract the information of key features, and the decoder is used to decode the extracted information.
6. The campus mental health monitoring and early warning method based on face recognition and expression analysis according to claim 5 is characterized in that: The decoder decoding process includes: The feature map generated by the encoder is restored to the size of the original image through upsampling operation, the relevant information of the upsampled feature map is fused, and finally the reconstructed complete image is output, which includes the masked part; The decoder parameters are adjusted by minimizing the reconstruction error to generate an expression recognition model.
7. The campus mental health monitoring and early warning method based on face recognition and expression analysis according to claim 1 is characterized in that: The steps of the Isolation Forest model to identify potential emotion patterns and abnormal changes include: Obtain training data containing expression features and pre-process the training data; Use the Isolation Forest model training data set to establish the normal and abnormal modes of the Isolation Forest model; Use the trained Isolation Forest model to perform anomaly detection on new expression data and identify potential abnormal emotions; The abnormal analysis model is used to score abnormal expressions, determine whether there is an abnormal emotional state, and generate a corresponding detection report.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which, when executed by a computer, are used to execute all steps of the campus mental health monitoring and early warning method based on face recognition and expression analysis as described in any one of claims 1 to 7.
9. An electronic device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the campus mental health monitoring and early warning method based on face recognition and expression analysis as described in any one of claims 1 to 7.
Citation Information
Cited By
Intelligent student psychological state assessment system
CN120762923A