AI-based mental health state assessment method and system
Through the AI-based deep learning neural network method, combining facial expression recognition and text emotion analysis, the mental health status is automatically evaluated, which solves the problems of teacher shortage and strong subjectivity in traditional evaluation methods, and achieves a more efficient, professional and flexible psychology Health assessment.
Patent Information
- Application Number
- CN202411349161.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-01-03
AI Technical Summary
The traditional mental health status assessment method has problems such as shortage of teachers, insufficient professionalism, strong subjectivity and poor flexibility, which is difficult to meet students' growing demand for mental health services.
Using AI-based deep learning neural network method, a facial expression recognition model and text sentiment analysis model are used, combined with historical evaluation questionnaire and actual data, the mental health status is automatically evaluated, and evaluation results are generated to avoid manual intervention.
It improves the efficiency, professionalism, objectivity and flexibility of mental health status assessment, reduces the influence of professionalism and subjective factors, and improves the accuracy and reliability of the assessment.
Smart Images

Figure CN119252487A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of mental health assessment, and in particular to an AI-based mental health status assessment method and system. Background Art
[0002] As students' mental health is valued, student mental health work has also been promoted. Many schools have set up mental health teachers to assess students' mental health status and then provide emotional counseling for students with poor mental health. This is the traditional method of manual mental health assessment. However, the traditional mental health assessment method has the following problems:
[0003] 1. There is a serious shortage of mental health teachers, which cannot meet the students' growing demand for mental health services; 2. Many mental health teachers are concurrently ideological and political teachers or administrative personnel, and their professional capabilities such as psychological counseling and consultation need to be improved urgently, and there are inevitably problems of insufficient professionalism and standardization; 3. Face-to-face communication and evaluation are required, which are highly subjective and easily affected by the subjective factors of mental health teachers; 4. It needs to be conducted at a specific time and place, which may have a certain impact on the normal study and life of the students.
[0004] Therefore, how to provide an AI-based mental health status assessment method and system to improve the efficiency, professionalism, objectivity and flexibility of mental health status assessment has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide an AI-based mental health status assessment method and system to improve the efficiency, professionalism, objectivity and flexibility of mental health status assessment.
[0006] In a first aspect, the present invention provides an AI-based method for assessing mental health status, comprising the following steps:
[0007] Step S1, obtaining a large number of historical assessment questionnaires for mental health status assessment and corresponding historical facial expression images and historical emotion text data, and preprocessing each of the historical facial expression images and historical emotion text data;
[0008] Step S2, creating a facial expression recognition model and a text sentiment analysis model based on a deep learning neural network, and setting the loss function, optimizer and hyperparameters of the facial expression recognition model and the text sentiment analysis model respectively;
[0009] Step S3, training a facial expression recognition model through the preprocessed historical facial expression images, and training a text emotion analysis model through the preprocessed historical emotion text data;
[0010] Step S4, obtaining an actual evaluation questionnaire to be evaluated on the mental health status and a corresponding actual facial expression image and actual emotion text data, evaluating the actual evaluation questionnaire using a preset psychological assessment scale to obtain a questionnaire evaluation score, inputting the actual facial expression image into a facial expression recognition model to obtain an expression category, and inputting the actual emotion text data into a text emotion analysis model to obtain an emotion category;
[0011] Step S5: automatically generate a mental health status assessment result based on the questionnaire assessment score, expression category, and emotion category to complete the mental health status assessment.
[0012] Furthermore, the step S1 is specifically as follows:
[0013] Obtain a large number of historical assessment questionnaires for mental health status assessment and corresponding historical facial expression images and historical emotional text data, and bind and store each of the historical assessment questionnaires, historical facial expression images and historical emotional text data;
[0014] After each of the historical facial expression images is processed by at least image cleaning, random cropping, pixel normalization, and image size unification, each of the historical facial expression images is labeled with expression categories to complete preprocessing; the expression categories at least include sadness, anger, happiness, surprise, fear, disgust, and neutrality;
[0015] After each of the historical emotional text data is processed including at least text cleaning, segmentation and word truncation, paragraph length unification, and text dictionary construction, each of the historical emotional text data is labeled with emotional categories to complete preprocessing; the emotional categories include at least positive factors, negative factors, and depression factors.
[0016] Furthermore, in step S2, the facial expression recognition model uses a ResNet network as a backbone, is provided with a plurality of residual modules and a linear layer for outputting the corresponding probability of each expression category;
[0017] After the residual modules are jump-connected, the output ends are connected to the linear layer;
[0018] The loss function of the facial expression recognition model is a multivariate cross entropy loss function, and the formula is:
[0019]
[0020] Among them, l img() represents the loss value of the multivariate cross entropy loss function; y pre_porb_img represents the probability that the historical facial expression image is predicted to be each expression category; y img represents the true label of the historical facial expression image, that is, the true label category; n represents the number of samples of the historical facial expression image; y i_img represents the true label of the i-th historical facial expression image; y i_pre_porb_img represents the probability that the i-th historical facial expression image is predicted as each expression category;
[0021] The optimizer of the facial expression recognition model adopts Adam.
[0022] Furthermore, in step S2, the text sentiment analysis model uses a Bert network pre-trained by Masked LM technology as a backbone, and is provided with a plurality of bidirectional Transformer modules and a one-dimensional convolutional layer for outputting the corresponding probability of each sentiment category;
[0023] After the bidirectional Transformer modules are connected in series in sequence, the output ends are connected to the one-dimensional convolutional layer;
[0024] The loss function of the text sentiment analysis model is the negative log-likelihood loss function, and the formula is:
[0025]
[0026] Among them, l text () represents the loss value of the negative log-likelihood loss function; y pre_porb_text represents the probability of historical sentiment text data being predicted as each sentiment category; text represents the true label of the historical sentiment text data, that is, the true sentiment category; m represents the number of samples of the historical sentiment text data; w i represents the weight of the i-th historical sentiment text data; y i_text represents the true label of the i-th historical sentiment text data; y i_pre_porb_text Represents the probability that the i-th historical sentiment text data is predicted as each sentiment category;
[0027] The optimizer of the text sentiment analysis model adopts AdamW.
[0028] Furthermore, in step S2, the hyperparameters include at least an initial learning rate, a training batch, and a number of iterations;
[0029] The step S3 is specifically as follows:
[0030] Initializing the facial expression recognition model by first model parameters trained on the large image processing data set ImageNet, converting the preprocessed historical facial expression images into training samples in JPG format to train the facial expression recognition model, and saving second model parameters that enable the facial expression recognition model to achieve the highest recognition accuracy during the training process;
[0031] Initializing the text sentiment analysis model by using the third model parameter trained on the natural language large data set IMDB, converting the preprocessed historical sentiment text data into training samples in UTF-8 encoding and TXT format to train the text sentiment analysis model, and saving the fourth model parameter that enables the facial expression recognition model to achieve the highest recognition accuracy during the training process;
[0032] In step S4, the actual facial expression image is input into a facial expression recognition model to obtain an expression category, and the actual emotion text data is input into a text emotion analysis model to obtain an emotion category, specifically:
[0033] Performing image enhancement preprocessing on the actual facial expression image and then inputting the image into a facial expression recognition model to obtain a first probability predicted as each expression category, and using a threshold method and a non-maximum suppression value method to output a final recognized expression category based on the first probability;
[0034] The actual emotional text data is preprocessed by data cleaning and then input into a text emotional analysis model to obtain a second probability predicted as each emotional category, and a threshold method and a non-maximum suppression value method are used to output a final recognized emotional category based on the second probability.
[0035] In a second aspect, the present invention provides an AI-based mental health status assessment system, comprising the following modules:
[0036] A historical data acquisition module, used to acquire a large number of historical assessment questionnaires for mental health status assessment and corresponding historical facial expression images and historical emotional text data, and pre-process each of the historical facial expression images and historical emotional text data;
[0037] An AI model creation module, for creating a facial expression recognition model and a text sentiment analysis model based on a deep learning neural network, and setting the loss function, optimizer and hyperparameters of the facial expression recognition model and the text sentiment analysis model respectively;
[0038] An AI model training module is used to train a facial expression recognition model using the preprocessed historical facial expression images, and to train a text sentiment analysis model using the preprocessed historical sentiment text data;
[0039] The recognition module is used to obtain the actual evaluation questionnaire to be evaluated on the mental health status and the corresponding actual facial expression image and actual emotion text data, evaluate the actual evaluation questionnaire through a preset psychological assessment scale to obtain a questionnaire evaluation score, input the actual facial expression image into a facial expression recognition model to obtain an expression category, and input the actual emotion text data into a text emotion analysis model to obtain an emotion category;
[0040] The health status assessment module is used to automatically generate a mental health status assessment result based on the questionnaire assessment score, expression category and emotion category to complete the mental health status assessment.
[0041] Furthermore, the historical data acquisition module is specifically used for:
[0042] Obtain a large number of historical assessment questionnaires for mental health status assessment and corresponding historical facial expression images and historical emotional text data, and bind and store each of the historical assessment questionnaires, historical facial expression images and historical emotional text data;
[0043] After each of the historical facial expression images is processed by at least image cleaning, random cropping, pixel normalization, and image size unification, each of the historical facial expression images is labeled with expression categories to complete preprocessing; the expression categories at least include sadness, anger, happiness, surprise, fear, disgust, and neutrality;
[0044] After each of the historical emotional text data is processed including at least text cleaning, segmentation and word truncation, paragraph length unification, and text dictionary construction, each of the historical emotional text data is labeled with emotional categories to complete preprocessing; the emotional categories include at least positive factors, negative factors, and depression factors.
[0045] Furthermore, in the AI model creation module, the facial expression recognition model uses a ResNet network as a backbone, and is provided with a plurality of residual modules and a linear layer for outputting the corresponding probability of each expression category;
[0046] After the residual modules are jump-connected, the output ends are connected to the linear layer;
[0047] The loss function of the facial expression recognition model is a multivariate cross entropy loss function, and the formula is:
[0048]
[0049] Among them, l img () represents the loss value of the multivariate cross entropy loss function; y pre_porb_img represents the probability that the historical facial expression image is predicted to be each expression category; y imgrepresents the true label of the historical facial expression image, that is, the true label category; n represents the number of samples of the historical facial expression image; y i_img represents the true label of the i-th historical facial expression image; y i_pre_porb_img represents the probability that the i-th historical facial expression image is predicted as each expression category;
[0050] The optimizer of the facial expression recognition model adopts Adam.
[0051] Furthermore, in the AI model creation module, the text sentiment analysis model uses a Bert network pre-trained by Masked LM technology as a backbone, and is provided with a number of bidirectional Transformer modules and a one-dimensional convolutional layer for outputting the corresponding probability of each sentiment category;
[0052] After the bidirectional Transformer modules are connected in series in sequence, the output ends are connected to the one-dimensional convolutional layer;
[0053] The loss function of the text sentiment analysis model is the negative log-likelihood loss function, and the formula is:
[0054]
[0055] Among them, l text () represents the loss value of the negative log-likelihood loss function; y pre_porb_text represents the probability of historical sentiment text data being predicted as each sentiment category; text represents the true label of the historical sentiment text data, that is, the true sentiment category; m represents the number of samples of the historical sentiment text data; w i represents the weight of the i-th historical sentiment text data; y i_text represents the true label of the i-th historical sentiment text data; y i_pre_porb_text Represents the probability that the i-th historical sentiment text data is predicted as each sentiment category;
[0056] The optimizer of the text sentiment analysis model adopts AdamW.
[0057] Furthermore, in the AI model creation module, the hyperparameters include at least an initial learning rate, a training batch, and a number of iterations;
[0058] The AI model training module is specifically used for:
[0059] Initializing the facial expression recognition model by first model parameters trained on the large image processing data set ImageNet, converting the preprocessed historical facial expression images into training samples in JPG format to train the facial expression recognition model, and saving second model parameters that enable the facial expression recognition model to achieve the highest recognition accuracy during the training process;
[0060] Initializing the text sentiment analysis model by using the third model parameter trained on the natural language large data set IMDB, converting the preprocessed historical sentiment text data into training samples in UTF-8 encoding and TXT format to train the text sentiment analysis model, and saving the fourth model parameter that enables the facial expression recognition model to achieve the highest recognition accuracy during the training process;
[0061] In the recognition module, the step of inputting the actual facial expression image into a facial expression recognition model to obtain an expression category and inputting the actual emotion text data into a text emotion analysis model to obtain an emotion category is specifically as follows:
[0062] Performing image enhancement preprocessing on the actual facial expression image and then inputting the image into a facial expression recognition model to obtain a first probability predicted as each expression category, and using a threshold method and a non-maximum suppression value method to output a final recognized expression category based on the first probability;
[0063] The actual emotional text data is preprocessed by data cleaning and then input into a text emotional analysis model to obtain a second probability predicted as each emotional category, and a threshold method and a non-maximum suppression value method are used to output a final recognized emotional category based on the second probability.
[0064] The advantages of the present invention are:
[0065] 1. By obtaining a large number of historical assessment questionnaires for mental health status assessment and the corresponding historical facial expression images and historical emotional text data, each historical facial expression image and historical emotional text data are preprocessed; then, a facial expression recognition model and a text emotion analysis model are created based on a deep learning neural network, and the loss function, optimizer and hyperparameters of the facial expression recognition model and the text emotion analysis model are set respectively; then, the facial expression recognition model is trained with the preprocessed historical facial expression images, and the text emotion analysis model is trained with the preprocessed historical emotion text data; then, the actual assessment questionnaire for mental health status assessment and the corresponding actual facial expression images and actual emotion text data are obtained, and the actual assessment questionnaire is evaluated with a preset psychological assessment scale to obtain the questionnaire evaluation score, and the actual facial expression image is input into the facial The expression recognition model obtains the expression category, and the actual emotion text data is input into the text emotion analysis model to obtain the emotion category. Finally, based on the questionnaire evaluation score, expression category and emotion category, the mental health status assessment result is automatically generated to complete the mental health status assessment; that is, the expression category in the mental health status assessment process is identified by the pre-trained facial expression recognition model, and the emotion category in the mental health status assessment process is identified by the pre-trained text emotion analysis model. The mental health status assessment result can be output in combination with the questionnaire evaluation score of the evaluation questionnaire. The entire assessment process is carried out automatically without the intervention of mental health teachers, avoiding the lack of professionalism and standardization of mental health teachers, avoiding the influence of subjective factors of mental health teachers, and the assessment time and place can be flexibly selected, which ultimately greatly improves the efficiency, professionalism, objectivity and flexibility of mental health status assessment.
[0066] 2. By performing at least image cleaning, random cropping, pixel normalization, and image size unification on each historical facial expression image, and at least text cleaning, segmentation and word truncation, paragraph length unification, and text dictionary construction on each historical emotional text data, the data quality of the data set used for training is effectively improved, and the recognition and analysis accuracy of the facial expression recognition model and the text sentiment analysis model is greatly improved, thereby greatly improving the accuracy of the mental health status assessment.
[0067] 3. The facial expression recognition model is initialized by the first model parameters trained on the large image processing dataset ImageNet, and the text sentiment analysis model is initialized by the third model parameters trained on the large natural language dataset IMDB, which effectively accelerates the convergence speed of the facial expression recognition model and the text sentiment analysis model, thereby greatly improving the training speed of the facial expression recognition model and the text sentiment analysis model. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] The present invention will be further described below in conjunction with embodiments with reference to the accompanying drawings.
[0069] Figure 1 It is a flow chart of a mental health status assessment method based on AI of the present invention.
[0070] Figure 2 It is a structural schematic diagram of an AI-based mental health status assessment system of the present invention. DETAILED DESCRIPTION
[0071] The technical solution in the embodiments of the present application has the following overall idea: using a pre-trained facial expression recognition model to identify expression categories in the process of mental health status assessment, using a pre-trained text sentiment analysis model to identify emotion categories in the process of mental health status assessment, and then combining the questionnaire assessment scores of the assessment questionnaire to output the mental health status assessment results. The entire assessment process is carried out automatically without human intervention, so as to improve the efficiency, professionalism, objectivity and flexibility of mental health status assessment.
[0072] Please refer to Figure 1 to Figure 2 As shown, a preferred embodiment of the mental health status assessment method based on AI of the present invention comprises the following steps:
[0073] Step S1, obtaining a large number of historical assessment questionnaires for mental health status assessment and corresponding historical facial expression images and historical emotion text data, and preprocessing each of the historical facial expression images and historical emotion text data;
[0074] Step S2, creating a facial expression recognition model and a text sentiment analysis model based on a deep learning neural network, and setting the loss function, optimizer and hyperparameters of the facial expression recognition model and the text sentiment analysis model respectively; the loss function is used to update the network weights of the facial expression recognition model and the text sentiment analysis model to reduce the error between the actual result and the predicted result;
[0075] Step S3, training a facial expression recognition model through the preprocessed historical facial expression images, and training a text emotion analysis model through the preprocessed historical emotion text data;
[0076] Step S4, obtaining an actual evaluation questionnaire to be evaluated on the mental health status and a corresponding actual facial expression image and actual emotion text data, evaluating the actual evaluation questionnaire using a preset psychological assessment scale to obtain a questionnaire evaluation score, inputting the actual facial expression image into a facial expression recognition model to obtain an expression category, and inputting the actual emotion text data into a text emotion analysis model to obtain an emotion category;
[0077] Step S5: automatically generate a mental health status assessment result based on the questionnaire assessment score, expression category and emotion category to complete the mental health status assessment. That is, the expression category and emotion category are used to assist in verifying the questionnaire assessment score. In specific implementation, the corresponding consultation plan can be matched based on the mental health status assessment result.
[0078] The present invention combines data from two different modalities, images (expression category) and text (emotion category), to comprehensively evaluate mental health status. Compared with traditional evaluation methods that rely solely on questionnaire data, it can provide richer and more accurate information, thereby improving the accuracy and reliability of the evaluation.
[0079] The step S1 is specifically as follows:
[0080] Obtain a large number of historical assessment questionnaires for mental health status assessment and corresponding historical facial expression images and historical emotional text data, and bind and store each of the historical assessment questionnaires, historical facial expression images and historical emotional text data;
[0081] After each of the historical facial expression images is processed by at least image cleaning, random cropping, pixel normalization, and image size unification, each of the historical facial expression images is labeled with expression categories to complete preprocessing; the expression categories at least include sadness, anger, happiness, surprise, fear, disgust, and neutrality;
[0082] After each of the historical emotional text data is processed including at least text cleaning, segmentation and word truncation, paragraph length unification, and text dictionary construction, each of the historical emotional text data is labeled with emotional categories to complete preprocessing; the emotional categories include at least positive factors, negative factors, and depression factors.
[0083] By performing at least image cleaning, random cropping, pixel normalization, and image size unification on each historical facial expression image, and at least text cleaning, segmentation and word truncation, paragraph length unification, and text dictionary construction on each historical emotional text data, the data quality of the data set used for training is effectively improved, the recognition and analysis accuracy of the facial expression recognition model and the text sentiment analysis model is greatly improved, and the accuracy of the mental health status assessment is greatly improved.
[0084] In step S2, the facial expression recognition model uses a ResNet network as a backbone, is provided with a plurality of residual modules and a linear layer for outputting the corresponding probability of each expression category;
[0085] After the residual modules are skipped, the output ends are connected to the linear layer; the skipping links facilitate free updating of the network parameters of the residual modules;
[0086] The loss function of the facial expression recognition model is a multivariate cross entropy loss function (multi-CrossEntropyLoss), and the formula is:
[0087]
[0088] Among them, l img () represents the loss value of the multivariate cross entropy loss function; y pre_porb_img represents the probability that the historical facial expression image is predicted to be each expression category; y img represents the true label of the historical facial expression image, that is, the true label category; n represents the number of samples of the historical facial expression image; y i_img represents the true label of the i-th historical facial expression image; y i_pre_porb_img represents the probability that the i-th historical facial expression image is predicted as each expression category;
[0089] The optimizer of the facial expression recognition model adopts Adam.
[0090] In step S2, the text sentiment analysis model uses a Bert network pre-trained by Masked LM technology as a backbone, is provided with a plurality of bidirectional Transformer modules and a one-dimensional convolutional layer for outputting the corresponding probability of each sentiment category; the text sentiment analysis model is also provided with a handle encoder, a segment encoder and a position encoder;
[0091] After the bidirectional Transformer modules are connected in series in sequence, the output ends are connected to the one-dimensional convolutional layer;
[0092] The loss function of the text sentiment analysis model is the negative log likelihood loss function (Negative LogLikelihood Loss), and the formula is:
[0093]
[0094] Among them, l text () represents the loss value of the negative log-likelihood loss function; y pre_porb_text represents the probability of historical sentiment text data being predicted as each sentiment category; text represents the true label of the historical sentiment text data, that is, the true sentiment category; m represents the number of samples of the historical sentiment text data; w i represents the weight of the i-th historical sentiment text data; y i_text represents the true label of the i-th historical sentiment text data; y i_pre_porb_text Represents the probability that the i-th historical sentiment text data is predicted as each sentiment category;
[0095] The optimizer of the text sentiment analysis model adopts AdamW.
[0096] In step S2, the hyperparameters include at least an initial learning rate, a training batch, and a number of iterations; the facial expression recognition model and the text sentiment analysis model are trained based on the hyperparameters;
[0097] The step S3 is specifically as follows:
[0098] Initializing the facial expression recognition model by first model parameters trained on the large image processing data set ImageNet, converting the preprocessed historical facial expression images into training samples in JPG format to train the facial expression recognition model, and saving second model parameters that enable the facial expression recognition model to achieve the highest recognition accuracy during the training process;
[0099] Initializing the text sentiment analysis model by a third model parameter trained on a large natural language data set IMDB (Internet Movie Database Dataset), converting the preprocessed historical sentiment text data into training samples in UTF-8 encoding and TXT format to train the text sentiment analysis model, and saving a fourth model parameter that enables the facial expression recognition model to achieve the highest recognition accuracy during the training process;
[0100] By initializing the facial expression recognition model with the first model parameters trained on the large image processing dataset ImageNet, and initializing the text sentiment analysis model with the third model parameters trained on the large natural language dataset IMDB, the convergence speed of the facial expression recognition model and the text sentiment analysis model is effectively accelerated, thereby greatly improving the training speed of the facial expression recognition model and the text sentiment analysis model.
[0101] In step S4, the actual facial expression image is input into a facial expression recognition model to obtain an expression category, and the actual emotion text data is input into a text emotion analysis model to obtain an emotion category, specifically:
[0102] Performing image enhancement preprocessing on the actual facial expression image and then inputting the image into a facial expression recognition model to obtain a first probability predicted as each expression category, and using a threshold method and a non-maximum suppression value method to output a final recognized expression category based on the first probability;
[0103] The actual emotional text data is preprocessed by data cleaning and then input into a text emotional analysis model to obtain a second probability predicted as each emotional category, and a threshold method and a non-maximum suppression value method are used to output a final recognized emotional category based on the second probability.
[0104] A preferred embodiment of the AI-based mental health status assessment system of the present invention includes the following modules:
[0105] A historical data acquisition module, used to acquire a large number of historical assessment questionnaires for mental health status assessment and corresponding historical facial expression images and historical emotional text data, and pre-process each of the historical facial expression images and historical emotional text data;
[0106] An AI model creation module, used to create a facial expression recognition model and a text sentiment analysis model based on a deep learning neural network, and to set the loss function, optimizer and hyperparameters of the facial expression recognition model and the text sentiment analysis model respectively; the loss function is used to update the network weights of the facial expression recognition model and the text sentiment analysis model to reduce the error between the actual result and the predicted result;
[0107] An AI model training module is used to train a facial expression recognition model using the preprocessed historical facial expression images, and to train a text sentiment analysis model using the preprocessed historical sentiment text data;
[0108] The recognition module is used to obtain the actual evaluation questionnaire to be evaluated on the mental health status and the corresponding actual facial expression image and actual emotion text data, evaluate the actual evaluation questionnaire through a preset psychological assessment scale to obtain a questionnaire evaluation score, input the actual facial expression image into a facial expression recognition model to obtain an expression category, and input the actual emotion text data into a text emotion analysis model to obtain an emotion category;
[0109] The health status assessment module is used to automatically generate a mental health status assessment result based on the questionnaire assessment score, expression category and emotion category to complete the mental health status assessment. That is, the expression category and emotion category are used to assist in verifying the questionnaire assessment score. In specific implementation, the corresponding consultation plan can be matched based on the mental health status assessment result.
[0110] The present invention combines data from two different modalities, images (expression category) and text (emotion category), to comprehensively evaluate mental health status. Compared with traditional evaluation methods that rely solely on questionnaire data, it can provide richer and more accurate information, thereby improving the accuracy and reliability of the evaluation.
[0111] The historical data acquisition module is specifically used for:
[0112] Obtain a large number of historical assessment questionnaires for mental health status assessment and corresponding historical facial expression images and historical emotional text data, and bind and store each of the historical assessment questionnaires, historical facial expression images and historical emotional text data;
[0113] After each of the historical facial expression images is processed by at least image cleaning, random cropping, pixel normalization, and image size unification, each of the historical facial expression images is labeled with expression categories to complete preprocessing; the expression categories at least include sadness, anger, happiness, surprise, fear, disgust, and neutrality;
[0114] After each of the historical emotional text data is processed including at least text cleaning, segmentation and word truncation, paragraph length unification, and text dictionary construction, each of the historical emotional text data is labeled with emotional categories to complete preprocessing; the emotional categories include at least positive factors, negative factors, and depression factors.
[0115] By performing at least image cleaning, random cropping, pixel normalization, and image size unification on each historical facial expression image, and at least text cleaning, segmentation and word truncation, paragraph length unification, and text dictionary construction on each historical emotional text data, the data quality of the data set used for training is effectively improved, the recognition and analysis accuracy of the facial expression recognition model and the text sentiment analysis model is greatly improved, and the accuracy of the mental health status assessment is greatly improved.
[0116] In the AI model creation module, the facial expression recognition model uses the ResNet network as the backbone, is provided with a plurality of residual modules and a linear layer for outputting the corresponding probability of each expression category;
[0117] After the residual modules are skipped, the output ends are connected to the linear layer; the skipping links facilitate free updating of the network parameters of the residual modules;
[0118] The loss function of the facial expression recognition model is a multivariate cross entropy loss function (multi-CrossEntropyLoss), and the formula is:
[0119]
[0120] Among them, l img () represents the loss value of the multivariate cross entropy loss function; y pre_porb_img represents the probability that the historical facial expression image is predicted to be each expression category; y img represents the true label of the historical facial expression image, that is, the true label category; n represents the number of samples of the historical facial expression image; y i_img represents the true label of the i-th historical facial expression image; y i_pre_porb_img represents the probability that the i-th historical facial expression image is predicted as each expression category;
[0121] The optimizer of the facial expression recognition model adopts Adam.
[0122] In the AI model creation module, the text sentiment analysis model uses a Bert network pre-trained by Masked LM technology as a backbone, and is provided with a plurality of bidirectional Transformer modules and a one-dimensional convolutional layer for outputting the corresponding probability of each sentiment category; the text sentiment analysis model is also provided with a handle encoder, a segment encoder and a position encoder;
[0123] After the bidirectional Transformer modules are connected in series in sequence, the output ends are connected to the one-dimensional convolutional layer;
[0124] The loss function of the text sentiment analysis model is the negative log likelihood loss function (Negative LogLikelihood Loss), and the formula is:
[0125]
[0126] Among them, l text () represents the loss value of the negative log-likelihood loss function; y pre_porb_text represents the probability of historical sentiment text data being predicted as each sentiment category; text represents the true label of the historical sentiment text data, that is, the true sentiment category; m represents the number of samples of the historical sentiment text data; w i represents the weight of the i-th historical sentiment text data; y i_text represents the true label of the i-th historical sentiment text data; y i_pre_porb_text Represents the probability that the i-th historical sentiment text data is predicted as each sentiment category;
[0127] The optimizer of the text sentiment analysis model adopts AdamW.
[0128] In the AI model creation module, the hyperparameters include at least an initial learning rate, a training batch, and a number of iterations; the facial expression recognition model and the text sentiment analysis model are trained based on the hyperparameters;
[0129] The AI model training module is specifically used for:
[0130] Initializing the facial expression recognition model by first model parameters trained on the large image processing data set ImageNet, converting the preprocessed historical facial expression images into training samples in JPG format to train the facial expression recognition model, and saving second model parameters that enable the facial expression recognition model to achieve the highest recognition accuracy during the training process;
[0131] Initializing the text sentiment analysis model by a third model parameter trained on a large natural language data set IMDB (Internet Movie Database Dataset), converting the preprocessed historical sentiment text data into training samples in UTF-8 encoding and TXT format to train the text sentiment analysis model, and saving a fourth model parameter that enables the facial expression recognition model to achieve the highest recognition accuracy during the training process;
[0132] By initializing the facial expression recognition model with the first model parameters trained on the large image processing dataset ImageNet, and initializing the text sentiment analysis model with the third model parameters trained on the large natural language dataset IMDB, the convergence speed of the facial expression recognition model and the text sentiment analysis model is effectively accelerated, thereby greatly improving the training speed of the facial expression recognition model and the text sentiment analysis model.
[0133] In the recognition module, the step of inputting the actual facial expression image into a facial expression recognition model to obtain an expression category and inputting the actual emotion text data into a text emotion analysis model to obtain an emotion category is specifically as follows:
[0134] Performing image enhancement preprocessing on the actual facial expression image and then inputting the image into a facial expression recognition model to obtain a first probability predicted as each expression category, and using a threshold method and a non-maximum suppression value method to output a final recognized expression category based on the first probability;
[0135] The actual emotional text data is preprocessed by data cleaning and then input into a text emotional analysis model to obtain a second probability predicted as each emotional category, and a threshold method and a non-maximum suppression value method are used to output a final recognized emotional category based on the second probability.
[0136] In summary, the advantages of the present invention are:
[0137] 1. By obtaining a large number of historical assessment questionnaires for mental health status assessment and the corresponding historical facial expression images and historical emotional text data, each historical facial expression image and historical emotional text data are preprocessed; then, a facial expression recognition model and a text emotion analysis model are created based on a deep learning neural network, and the loss function, optimizer and hyperparameters of the facial expression recognition model and the text emotion analysis model are set respectively; then, the facial expression recognition model is trained with the preprocessed historical facial expression images, and the text emotion analysis model is trained with the preprocessed historical emotion text data; then, the actual assessment questionnaire for mental health status assessment and the corresponding actual facial expression images and actual emotion text data are obtained, and the actual assessment questionnaire is evaluated with a preset psychological assessment scale to obtain the questionnaire evaluation score, and the actual facial expression image is input into the facial The expression recognition model obtains the expression category, and the actual emotion text data is input into the text emotion analysis model to obtain the emotion category. Finally, based on the questionnaire evaluation score, expression category and emotion category, the mental health status assessment result is automatically generated to complete the mental health status assessment; that is, the expression category in the mental health status assessment process is identified by the pre-trained facial expression recognition model, and the emotion category in the mental health status assessment process is identified by the pre-trained text emotion analysis model. The mental health status assessment result can be output in combination with the questionnaire evaluation score of the evaluation questionnaire. The entire assessment process is carried out automatically without the intervention of mental health teachers, avoiding the lack of professionalism and standardization of mental health teachers, avoiding the influence of subjective factors of mental health teachers, and the assessment time and place can be flexibly selected, which ultimately greatly improves the efficiency, professionalism, objectivity and flexibility of mental health status assessment.
[0138] 2. By performing at least image cleaning, random cropping, pixel normalization, and image size unification on each historical facial expression image, and at least text cleaning, segmentation and word truncation, paragraph length unification, and text dictionary construction on each historical emotional text data, the data quality of the data set used for training is effectively improved, and the recognition and analysis accuracy of the facial expression recognition model and the text sentiment analysis model is greatly improved, thereby greatly improving the accuracy of the mental health status assessment.
[0139] 3. The facial expression recognition model is initialized by the first model parameters trained on the large image processing dataset ImageNet, and the text sentiment analysis model is initialized by the third model parameters trained on the large natural language dataset IMDB, which effectively accelerates the convergence speed of the facial expression recognition model and the text sentiment analysis model, thereby greatly improving the training speed of the facial expression recognition model and the text sentiment analysis model.
[0140] Although the specific implementation modes of the present invention are described above, those skilled in the art should understand that the specific implementation modes described are only illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included in the scope of protection of the claims of the present invention.
Claims
1. A method for assessing mental health status based on AI, characterized by: The steps include: Step S1, obtaining a large number of historical assessment questionnaires for mental health status assessment and corresponding historical facial expression images and historical emotion text data, and preprocessing each of the historical facial expression images and historical emotion text data; Step S2, creating a facial expression recognition model and a text sentiment analysis model based on a deep learning neural network, and setting the loss function, optimizer and hyperparameters of the facial expression recognition model and the text sentiment analysis model respectively; Step S3, training a facial expression recognition model through the preprocessed historical facial expression images, and training a text emotion analysis model through the preprocessed historical emotion text data; Step S4, obtaining an actual evaluation questionnaire to be evaluated on the mental health status and a corresponding actual facial expression image and actual emotion text data, evaluating the actual evaluation questionnaire using a preset psychological assessment scale to obtain a questionnaire evaluation score, inputting the actual facial expression image into a facial expression recognition model to obtain an expression category, and inputting the actual emotion text data into a text emotion analysis model to obtain an emotion category; Step S5: automatically generate a mental health status assessment result based on the questionnaire assessment score, expression category, and emotion category to complete the mental health status assessment.
2. The AI-based mental health status assessment method according to claim 1, characterized in that: The step S1 is specifically as follows: Obtain a large number of historical assessment questionnaires for mental health status assessment and corresponding historical facial expression images and historical emotional text data, and bind and store each of the historical assessment questionnaires, historical facial expression images and historical emotional text data; After each of the historical facial expression images is processed by at least image cleaning, random cropping, pixel normalization, and image size unification, each of the historical facial expression images is labeled with expression categories to complete preprocessing; the expression categories at least include sadness, anger, happiness, surprise, fear, disgust, and neutrality; After each of the historical emotional text data is processed including at least text cleaning, segmentation and word truncation, paragraph length unification, and text dictionary construction, each of the historical emotional text data is labeled with emotional categories to complete preprocessing; the emotional categories include at least positive factors, negative factors, and depression factors.
3. The AI-based mental health status assessment method according to claim 1, characterized in that: In step S2, the facial expression recognition model uses a ResNet network as a backbone, is provided with a plurality of residual modules and a linear layer for outputting the corresponding probability of each expression category; After the residual modules are jump-connected, the output ends are connected to the linear layer; The loss function of the facial expression recognition model is a multivariate cross entropy loss function, and the formula is: Among them, l img ( ) represents the loss value of the multivariate cross entropy loss function; y pre_porb_img represents the probability that the historical facial expression image is predicted to be each expression category; y img represents the true label of the historical facial expression image, that is, the true label category; n represents the number of samples of the historical facial expression image; y i_img represents the true label of the i-th historical facial expression image; y i_pre_porb_img represents the probability that the i-th historical facial expression image is predicted as each expression category; The optimizer of the facial expression recognition model adopts Adam.
4. The AI-based mental health status assessment method according to claim 1, characterized in that: In step S2, the text sentiment analysis model uses a Bert network pre-trained by Masked LM technology as a backbone, and is provided with a plurality of bidirectional Transformer modules and a one-dimensional convolutional layer for outputting the corresponding probability of each sentiment category; After the bidirectional Transformer modules are connected in series in sequence, the output ends are connected to the one-dimensional convolutional layer; The loss function of the text sentiment analysis model is the negative log-likelihood loss function, and the formula is: Among them, l text ( ) represents the loss value of the negative log-likelihood loss function; y pre_porb_text represents the probability of historical sentiment text data being predicted as each sentiment category; text represents the true label of the historical sentiment text data, that is, the true sentiment category; m represents the number of samples of the historical sentiment text data; w i represents the weight of the i-th historical sentiment text data; y i_text represents the true label of the i-th historical sentiment text data; y i_pre_porb_text Represents the probability that the i-th historical sentiment text data is predicted as each sentiment category; The optimizer of the text sentiment analysis model adopts AdamW.
5. The AI-based mental health status assessment method according to claim 1, characterized in that: In step S2, the hyperparameters include at least an initial learning rate, a training batch, and a number of iterations; The step S3 is specifically as follows: Initializing the facial expression recognition model by first model parameters trained on the large image processing data set ImageNet, converting the preprocessed historical facial expression images into training samples in JPG format to train the facial expression recognition model, and saving second model parameters that enable the facial expression recognition model to achieve the highest recognition accuracy during the training process; Initializing the text sentiment analysis model by using the third model parameter trained on the natural language large data set IMDB, converting the preprocessed historical sentiment text data into training samples in UTF-8 encoding and TXT format to train the text sentiment analysis model, and saving the fourth model parameter that enables the facial expression recognition model to achieve the highest recognition accuracy during the training process; In step S4, the actual facial expression image is input into a facial expression recognition model to obtain an expression category, and the actual emotion text data is input into a text emotion analysis model to obtain an emotion category, specifically: Performing image enhancement preprocessing on the actual facial expression image and then inputting the image into a facial expression recognition model to obtain a first probability predicted as each expression category, and using a threshold method and a non-maximum suppression value method to output a final recognized expression category based on the first probability; The actual emotional text data is preprocessed by data cleaning and then input into a text emotional analysis model to obtain a second probability predicted as each emotional category, and a threshold method and a non-maximum suppression value method are used to output a final recognized emotional category based on the second probability.
6. A mental health status assessment system based on AI, characterized by: Includes the following modules: A historical data acquisition module, used to acquire a large number of historical assessment questionnaires for mental health status assessment and corresponding historical facial expression images and historical emotional text data, and pre-process each of the historical facial expression images and historical emotional text data; An AI model creation module, for creating a facial expression recognition model and a text sentiment analysis model based on a deep learning neural network, and setting the loss function, optimizer and hyperparameters of the facial expression recognition model and the text sentiment analysis model respectively; An AI model training module is used to train a facial expression recognition model using the preprocessed historical facial expression images, and to train a text sentiment analysis model using the preprocessed historical sentiment text data; The recognition module is used to obtain the actual evaluation questionnaire to be evaluated on the mental health status and the corresponding actual facial expression image and actual emotion text data, evaluate the actual evaluation questionnaire through a preset psychological assessment scale to obtain a questionnaire evaluation score, input the actual facial expression image into a facial expression recognition model to obtain an expression category, and input the actual emotion text data into a text emotion analysis model to obtain an emotion category; The health status assessment module is used to automatically generate a mental health status assessment result based on the questionnaire assessment score, expression category and emotion category to complete the mental health status assessment.
7. The AI-based mental health status assessment system according to claim 6, characterized in that: The historical data acquisition module is specifically used for: Obtain a large number of historical assessment questionnaires for mental health status assessment and corresponding historical facial expression images and historical emotional text data, and bind and store each of the historical assessment questionnaires, historical facial expression images and historical emotional text data; After each of the historical facial expression images is processed by at least image cleaning, random cropping, pixel normalization, and image size unification, each of the historical facial expression images is labeled with expression categories to complete preprocessing; the expression categories at least include sadness, anger, happiness, surprise, fear, disgust, and neutrality; After each of the historical emotional text data is processed including at least text cleaning, segmentation and word truncation, paragraph length unification, and text dictionary construction, each of the historical emotional text data is labeled with emotional categories to complete preprocessing; the emotional categories include at least positive factors, negative factors, and depression factors.
8. The AI-based mental health status assessment system according to claim 6, characterized in that: In the AI model creation module, the facial expression recognition model uses the ResNet network as the backbone, and is provided with a plurality of residual modules and a linear layer for outputting the corresponding probability of each expression category; After the residual modules are jump-connected, the output ends are connected to the linear layer; The loss function of the facial expression recognition model is a multivariate cross entropy loss function, and the formula is: Among them, l img ( ) represents the loss value of the multivariate cross entropy loss function; y pre_porb_img represents the probability that the historical facial expression image is predicted to be each expression category; y img represents the true label of the historical facial expression image, that is, the true label category; n represents the number of samples of the historical facial expression image; y i_img represents the true label of the i-th historical facial expression image; y i_pre_porb_img represents the probability that the i-th historical facial expression image is predicted as each expression category; The optimizer of the facial expression recognition model adopts Adam.
9. The AI-based mental health status assessment system according to claim 6, characterized in that: In the AI model creation module, the text sentiment analysis model uses a Bert network pre-trained by Masked LM technology as a backbone, and is provided with a number of bidirectional Transformer modules and a one-dimensional convolutional layer for outputting the corresponding probability of each sentiment category; After the bidirectional Transformer modules are connected in series in sequence, the output ends are connected to the one-dimensional convolutional layer; The loss function of the text sentiment analysis model is the negative log-likelihood loss function, and the formula is: Among them, l text ( ) represents the loss value of the negative log-likelihood loss function; y pre_porb_text represents the probability of historical sentiment text data being predicted as each sentiment category; text represents the true label of the historical sentiment text data, that is, the true sentiment category; m represents the number of samples of the historical sentiment text data; w i represents the weight of the i-th historical sentiment text data; y i_text represents the true label of the i-th historical sentiment text data; y i_pre_porb_text Represents the probability that the i-th historical sentiment text data is predicted as each sentiment category; The optimizer of the text sentiment analysis model adopts AdamW.
10. The AI-based mental health status assessment system according to claim 6, characterized in that: In the AI model creation module, the hyperparameters include at least an initial learning rate, a training batch, and a number of iterations; The AI model training module is specifically used for: Initializing the facial expression recognition model by first model parameters trained on the large image processing data set ImageNet, converting the preprocessed historical facial expression images into training samples in JPG format to train the facial expression recognition model, and saving second model parameters that enable the facial expression recognition model to achieve the highest recognition accuracy during the training process; Initializing the text sentiment analysis model by using the third model parameter trained on the natural language large data set IMDB, converting the preprocessed historical sentiment text data into training samples in UTF-8 encoding and TXT format to train the text sentiment analysis model, and saving the fourth model parameter that enables the facial expression recognition model to achieve the highest recognition accuracy during the training process; In the recognition module, the step of inputting the actual facial expression image into a facial expression recognition model to obtain an expression category and inputting the actual emotion text data into a text emotion analysis model to obtain an emotion category is specifically as follows: Performing image enhancement preprocessing on the actual facial expression image and then inputting the image into a facial expression recognition model to obtain a first probability predicted as each expression category, and using a threshold method and a non-maximum suppression value method to output a final recognized expression category based on the first probability; The actual emotional text data is preprocessed by data cleaning and then input into a text emotional analysis model to obtain a second probability predicted as each emotional category, and a threshold method and a non-maximum suppression value method are used to output a final recognized emotional category based on the second probability.
Citation Information
Cited By
Psychological risk early warning intervention system and method based on multi-source heterogeneous portraits and agents
CN122050816A