Mental health intervention method and device, equipment and storage medium

By obtaining multiple user data and using multiple feature extraction algorithms and machine learning models, the problem of poor universality of mental health intervention strategies in the existing technology is solved, and more accurate and personalized detection and prediction of mental health problems is achieved, and a more accurate and personalized detection and prediction of mental health problems is achieved. Customized intervention strategies.

CN119092054AInactive Publication Date: 2024-12-06RENMIN HOSPITAL OF WUHAN UNIVERSITY (HUBEI GENERAL HOSPITAL)

Patent Information

Application Number
CN202411152352.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2024-12-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

It is difficult for the existing technology to customize detection and generate mental health intervention strategies for different user situations. The self-test results and intervention suggestions of questionnaire are poor in universality, and it is difficult to accurately identify and predict mental health problems.

Method used

By obtaining multiple data of users (emotional, behavioral, physiological, sleep, psychological data), target features are extracted from user data using at least three different feature extraction algorithms (random forest, minimal absolute contraction and selection, principal component analysis) , combine machine learning models to determine whether users have or will have mental health problems, and generate customized intervention strategies.

Benefits of technology

It improves the accuracy and personalization of mental health intervention strategies, ensures that the intervention measures are more in line with the user's specific situation, and enhances the accuracy of detection and prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119092054A_ABST
    Figure CN119092054A_ABST
Patent Text Reader

Abstract

The invention discloses a mental health intervention method, device and equipment and a storage medium, and belongs to the field of data processing.The method comprises the steps that a user data set is obtained, the user data set comprises multiple kinds of user data, and the user data comprises emotion data, behavior data, physiological data, sleep data and psychological data; extracting feature data of each kind of user data from the user data set to obtain a first feature set; obtaining a target feature from the first feature set by adopting at least three different feature extraction algorithms; based on the target feature, determining whether the user has a first mental health problem or is about to have the first mental health problem; and generating a first mental health intervention strategy corresponding to the first mental health question based on the first mental health question. According to the method, the intervention strategy can be generated in a customized manner according to the condition of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing, and in particular to a mental health intervention method, device, equipment and storage medium. Background Art

[0002] Mental health problems are a common health problem. Self-diagnosis of mental health problems is usually carried out through self-testing questionnaires. In order to ensure the universality of the questionnaire, the test results and intervention suggestions generated by the self-testing questionnaire are usually broad and general, making it difficult to customize the detection and generation strategies for different user situations. Summary of the invention

[0003] The present disclosure provides a mental health intervention method, apparatus, device and storage medium, which can generate intervention strategies customized for the user's situation. The technical solution includes at least the following solutions: In a first aspect, a mental health intervention method is provided, comprising: obtaining a user data set, the user data set including multiple types of user data, including emotional data, behavioral data, physiological data, sleep data and psychological data; extracting feature data of each type of user data from the user data set to obtain a first feature set; using at least three different feature extraction algorithms to obtain target features from the first feature set; based on the target features, determining whether the user has a first mental health problem or is about to have the first mental health problem; based on the first mental health problem, generating a first mental health intervention strategy corresponding to the first mental health problem.

[0004] Optionally, at least three different feature extraction algorithms are used to obtain target features from the first feature set, including: obtaining a first target feature from the first feature set based on a random forest algorithm; obtaining a second target feature from the first feature set based on a minimum absolute shrinkage and selection algorithm; obtaining a third target feature from the first feature set based on a principal component analysis algorithm; and determining the target feature based on the first target feature, the second target feature and the third target feature.

[0005] Optionally, determining the target feature based on the first target feature, the second target feature and the third target feature includes: inputting the first target feature, the second target feature and the third target feature into a machine learning model, respectively, to obtain a first machine learning model corresponding to the first target feature, a second machine learning model corresponding to the second target feature, and a third machine learning model corresponding to the third target feature; obtaining loss function values ​​of the first machine learning model, the second machine learning model and the third machine learning model; and determining the target feature based on the sizes of the loss function values ​​of the first machine learning model, the second machine learning model and the third machine learning model.

[0006] Optionally, determining whether the user has a mental health problem or is about to have the first mental health problem based on the target feature includes: determining whether the user has a mental health problem based on at least one of the output of a machine learning model corresponding to the target feature, a mental health threshold and the size of the target feature, different feature data in the target feature corresponds to different mental health thresholds.

[0007] Optionally, determining whether the user has a mental health problem or is about to develop the first mental health problem based on the target feature includes: determining whether the user is about to develop the first mental health problem based on the output of a machine learning model corresponding to the target feature.

[0008] In the second aspect, a mental health intervention device is also provided, including: an acquisition module, used to acquire a user data set, the user data set including multiple user data, the user data including emotional data, behavioral data, physiological data, sleep data and psychological data; a first feature extraction module, used to extract feature data of each type of user data from the user data set to obtain a first feature set; a second feature extraction module, used to obtain target features from the first feature set using at least three different feature extraction algorithms; a mental health judgment module, used to determine whether the user has a first mental health problem or is about to have the first mental health problem based on the target feature; an intervention strategy generation module, used to generate a first mental health intervention strategy corresponding to the first mental health problem based on the first mental health problem.

[0009] Optionally, the second feature extraction module is also used to obtain a first target feature from the first feature set based on a random forest algorithm; to obtain a second target feature from the first feature set based on a minimum absolute shrinkage and selection algorithm; to obtain a third target feature from the first feature set based on a principal component analysis algorithm; and to determine the target feature based on the first target feature, the second target feature and the third target feature.

[0010] Optionally, the second feature extraction module is also used to input the first target feature, the second target feature and the third target feature into the machine learning model respectively to obtain a first machine learning model corresponding to the first target feature, a second machine learning model corresponding to the second target feature and a third machine learning model corresponding to the third target feature; obtain the loss function values ​​of the first machine learning model, the second machine learning model and the third machine learning model; determine the target feature based on the size of the loss function values ​​of the first machine learning model, the second machine learning model and the third machine learning model.

[0011] Optionally, the mental health judgment module is also used to determine whether the user has mental health problems based on the output of the machine learning model corresponding to the target feature, the mental health threshold and at least one of the size of the target feature, and different feature data in the target feature corresponds to different mental health thresholds.

[0012] Optionally, the mental health judgment module is also used to determine whether the user is about to develop a first mental health problem based on the output of the machine learning model corresponding to the target feature.

[0013] In a third aspect, a computer device is also provided, comprising: a memory and a processor, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor, thereby executing the mental health intervention method described in the above embodiment.

[0014] In a fourth aspect, a computer-readable storage medium is also provided, wherein at least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by a processor to execute the mental health intervention method described in the above embodiment.

[0015] In a fifth aspect, a computer program product is provided, comprising a computer program / instruction, wherein when the computer program / instruction is executed by a processor, the method described in the first aspect is implemented.

[0016] The beneficial effects brought by the technical solution provided by the embodiments of the present disclosure include at least: In the disclosed embodiment, by acquiring a user data set, extracting a first feature set based on the user data set, and then using at least three different feature extraction algorithms to extract target features from the first feature set, the accuracy of the extracted target features can be ensured. Since the target features are extracted from the user data set, when the user is subsequently judged based on the target features whether the user has a first mental health problem or is about to have a first mental health problem, and when a first mental health intervention strategy corresponding to the first mental health problem is generated, it is equivalent to generating an intervention strategy customized for the user's data, which effectively improves the accuracy of the generated intervention strategy. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0018] Figure 1 A flowchart showing a mental health intervention method provided by an exemplary embodiment of the present disclosure is shown; Figure 2 A flowchart showing a mental health intervention method provided by another exemplary embodiment of the present disclosure is shown; Figure 3 A schematic diagram of the structure of a mental health intervention device provided by an exemplary embodiment of the present disclosure is shown; Figure 4 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0019] Unless otherwise defined, the technical or scientific terms used herein shall have the usual meanings understood by persons of ordinary skill in the field to which the present disclosure belongs. The words "first", "second", "third" and similar words used in the patent application specification and claims of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, words such as "one" or "one" do not indicate a quantitative limitation, but rather indicate the presence of at least one. Words such as "include" or "comprise" and similar words mean that the elements or objects appearing before "include" or "comprises" cover the elements or objects listed after "include" or "comprises" and their equivalents, and do not exclude other elements or objects.

[0020] In order to make the objectives, technical solutions and advantages of the present disclosure more clear, the embodiments of the present disclosure will be further described in detail below with reference to the accompanying drawings.

[0021] Figure 1 A flowchart of a mental health intervention method provided by an exemplary embodiment of the present disclosure is shown, and the method can be executed by a computer device. Figure 1 , the method comprising: In step 101, a user data set is obtained.

[0022] The user data set includes a variety of user data, including emotional data, behavioral data, physiological data, sleep data and psychological data. Optionally, the user data set can be an example data set, where the example data set includes a training set and a test set for training a model; or, the data in the user data set is data collected from the user within a certain period of time.

[0023] In the disclosed embodiment, the emotion data includes text input by the user.

[0024] The text input by the user may be text input by the user in social media, chat records or emotional logs.

[0025] The mood log records the user's daily mood, and the user can enter mood information in the mood log every day.

[0026] For example, the mood log may be obtained through an application, and the user may record his or her mood in the application every day, such as "I feel very happy today" or "I feel anxious today".

[0027] Behavioral data includes users’ daily activity data and mobile phone sensor data.

[0028] Among them, the user's daily activity data includes the number of steps, exercise time, social media activity data, etc. The number of steps, exercise time, etc. can be obtained through wearable devices that monitor the user's exercise status, such as sports bracelets. For example, when obtaining the user's steps, the user's daily steps can be obtained through a sports bracelet; when obtaining the user's exercise time, the user's daily exercise time can be obtained through a sports bracelet. The user's average daily steps, maximum steps, minimum steps, etc. can be extracted from the number of steps; the user's average daily exercise time, maximum exercise time, minimum exercise time, etc. can be extracted from the exercise time; the user's travel frequency (such as the number of trips, travel distance, travel time, etc.) can be determined from the data in the GPS; the user's activity level (such as the proportion of time spent stationary, light activity, moderate activity, and high-intensity activity) can be determined from the data in the accelerometer.

[0029] Social media activity data is used to indicate users’ usage of social media, such as the daily time users spend on social media, the number of posts, the number of likes, etc.

[0030] The mobile phone sensor data is the data in the GPS (Global Positioning System) and the data in the accelerometer in the user's mobile phone.

[0031] Physiological data includes the user's heart rate, blood pressure, body temperature and other physiological indicators. Physiological data can be obtained through devices that monitor the user's physiological state, such as a heart rate monitor, a blood pressure monitor, a thermometer, etc.

[0032] Sleep data includes sleep time, deep sleep time, number of sleep interruptions, etc. Sleep data can be obtained through wearable devices (such as sports bracelets) or mobile phone applications (such as sleep monitoring software).

[0033] Psychological data includes multiple psychological questionnaires filled out by users and psychological interviews conducted with users. Psychological questionnaires include depression self-rating scale, anxiety self-rating scale, etc.

[0034] Optionally, after obtaining the user data set, it is necessary to preprocess the various user data in the user data set, including but not limited to data cleaning and data normalization. Data cleaning is used to process missing values ​​and outliers in the data, and data normalization is used to scale the data to the same scale. There are many implementation methods for preprocessing in the related art, and detailed description is omitted here.

[0035] Exemplarily, data preprocessing is described below in the form of Python code.

[0036] import numpy as np import pandas as pd from sklearn.linear_model import Lasso from sklearn.ensemble import RandomForestRegressor from sklearn.decomposition import PCA from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split #Use a random number generator to create an example data set containing 100 samples and 20 features. This example data set is the user data set. np.random.seed(42) X = pd.DataFrame(np.random.randn(100, 20), columns=[f'feature_{i}'for i in range(20)]) y = pd.Series(np.random.randn(100), name='target') # Use StandardScaler to standardize the feature data to achieve data preprocessing; scaler = StandardScaler() X_scaled = scaler.fit_transform(X) In step 102, feature data of each type of user data is extracted from the user data set to obtain a first feature set.

[0037] In the disclosed embodiment, the characteristic data of the emotion data includes the emotion state and the emotion characteristics.

[0038] Emotional state can be divided into narrow and broad senses. The former mainly refers to the state of mind, which is a psychological state of emotion, and is persistent, explicit, situational, and personalized. The latter refers to the form of existence of emotion itself, which is mainly divided into mood, passion, and stress. Emotional state can be obtained through the emotion log in the emotion data. By analyzing the emotion log, the user's emotional state can be obtained, such as the emotional fluctuations within a week.

[0039] Emotional features include emotion recognition, emotion score, emotion fluctuation, situational relevance, emotion adaptability, and emotion expression.

[0040] Emotion recognition refers to identifying an individual's current emotions, such as happiness, sadness, anger, fear, etc., through facial expressions, voice intonation, text input, or emotional logs. Emotion score is an indicator that measures the degree of experience of an individual when he or she has emotions about things or events, as well as the identification and expression of the emotion. It usually uses a rating scale from 1 to 10, with 10 representing the strongest emotional experience. Emotional fluctuations refer to short-term unstable changes in an individual's emotions, psychology, and physiology. By using natural language processing (NLP) technology to analyze the user's text input in emotional data, emotional features can be obtained. Contextual relevance is to analyze the emotional response of an individual in a specific situation, such as whether it is easier to show anxiety or anger when under high work pressure. Emotional adaptability is used to evaluate how an individual copes with different emotions, including emotion regulation skills and coping mechanisms. Emotional expression is the way an individual expresses emotions, including speech, body language, and social interaction.

[0041] Behavioral data refers to a series of behaviors that an individual performs repeatedly in a specific situation. The characteristic data of behavioral data can reflect the user's habits, tendencies, and lifestyle.

[0042] The characteristic data of behavioral data include: behavior frequency, behavior consistency, behavior triggers, behavior consequences, behavior adaptability, behavior intrinsic motivation, cognitive basis of behavior, emotional component of behavior, physiological response of behavior, behavior self-regulation ability, long-term impact of behavior, and willingness to change behavior.

[0043] Among them, behavior frequency refers to the frequency of behavior, such as the number of times a person brushes his teeth every day, the frequency of weekly exercise, etc. Behavioral consistency refers to whether a certain behavior is consistent at different time points, such as whether the same set of coping strategies are always used when under great pressure. Behavioral triggers refer to situations or events that trigger specific behaviors, such as eating when hungry, or buying products after seeing advertisements. Behavioral consequences refer to the results of behaviors, whether positive (such as satisfaction after completing a task) or negative (such as fatigue caused by overwork). Behavioral adaptability refers to the effectiveness of behaviors in achieving personal goals or coping with environmental changes. Adaptive behavioral patterns contribute to personal growth and development. The intrinsic motivation of behavior refers to the internal needs or desires that drive the behavior, such as the pursuit of a sense of achievement, security, or belonging. The social impact of behavior refers to the impact of individual behavior on others, including positive effects (such as encouraging others) and negative effects (such as causing conflicts). The cognitive basis of behavior refers to the way of thinking that forms a certain behavior pattern, including beliefs, attitudes, and values. The emotional component of behavior refers to the emotional state that accompanies the behavior, such as feeling anxious or excited when performing a task. The physiological response of behavior refers to the body's response to the action, such as an accelerated heartbeat, sweating, or relaxation. The environmental dependence of behavior refers to whether the behavior is affected by the physical or social environment, such as studying more efficiently in a quiet library. The self-regulation ability of behavior refers to an individual's ability to control his or her own behavior, including self-control and willpower. The long-term impact of behavior refers to the long-term effects of certain behavioral patterns on health, such as the role of a healthy diet and regular exercise in reducing the risk of chronic diseases. The willingness to change behavior refers to whether an individual intends to change certain behavioral patterns, and how easy it is to change.

[0044] The characteristic data of physiological data include the changing trends of various physiological data and the abnormal values ​​in the physiological data.

[0045] The characteristic data of the sleep data includes characteristics related to the sleep quality of the user, and the characteristics related to the sleep quality of the user can be determined through the sleep data of the user.

[0046] Sleep quality-related characteristics mainly include sleep latency, sleep efficiency, number and duration of awakenings, deep sleep time, REM sleep time, regularity of sleep cycles, morning awakening time and signs of sleep disorders.

[0047] Among them, sleep latency is the time required from lying down to prepare for sleep to actually falling asleep. A longer sleep latency may indicate difficulty falling asleep. Sleep efficiency is the ratio of sleep time to time lying in bed. A higher sleep efficiency indicates that sleep is more continuous and sufficient. The number and time of awakenings are the number of times you wake up during sleep at night and the length of each awakening. Frequent awakenings and long awakenings may indicate sleep interruption. Deep sleep time is the time in the deep sleep stage, which is essential for physical recovery. REM sleep time is the rapid eye movement sleep stage, which is related to dreams and is important for emotional regulation and memory consolidation. The regularity of the sleep cycle is the consistency and stability of the sleep cycle, including the time to fall asleep and wake up. Morning awakening time is the time to wake up naturally in the morning, and whether it is easy to feel awake and energetic. Signs of sleep disorders include snoring, sleep apnea, night terrors or sleepwalking.

[0048] The characteristic data of psychological data include the user's mental health status, scores of psychological questionnaires, specific answers to psychological questionnaires, cognitive functions, coping mechanisms, social functions and quality of life.

[0049] The user's mental health status can be assessed through the psychological questionnaire filled out by the user. After the user completes the psychological questionnaire, the psychological questionnaire score can be obtained. The psychological questionnaire score can quantify the user's mental health status, including depression, anxiety, stress level, etc. The specific answers to the psychological questionnaire are the text filled in by the user in the psychological questionnaire. Cognitive functions include attention, memory, executive function, etc., which can be assessed through specific cognitive tests. Coping mechanism refers to the strategy adopted by the user when facing stress and challenges, which can be inferred from daily behavior and psychological interviews. Social function includes interpersonal relationships, social skills and occupational function. Social function can assess the user's adaptability and participation in the social environment. Quality of life includes subjective well-being and life satisfaction, which reflects the user's overall evaluation of life.

[0050] The above feature data together constitute a first feature set.

[0051] In some embodiments, some user data may be missing, and in this case, feature data corresponding to the missing user data in the first feature set also does not exist.

[0052] In step 103, at least three different feature extraction algorithms are used to obtain target features from the first feature set.

[0053] In step 104 , based on the target feature, it is determined whether the user has a first mental health problem or is about to have the first mental health problem.

[0054] In step 105, based on the first mental health problem, a first mental health intervention strategy corresponding to the first mental health problem is generated.

[0055] In the disclosed embodiment, by acquiring a user data set, extracting a first feature set based on the user data set, and then using at least three different feature extraction algorithms to extract target features from the first feature set, the accuracy of the extracted target features can be ensured. Since the target features are extracted from the user data set, when the user is subsequently judged based on the target features whether the user has a first mental health problem or is about to have a first mental health problem, and when a first mental health intervention strategy corresponding to the first mental health problem is generated, it is equivalent to generating an intervention strategy customized for the user's data, which effectively improves the accuracy of the generated intervention strategy.

[0056] Figure 2 A flowchart of a mental health intervention method provided by another exemplary embodiment of the present disclosure is shown, and the method can be executed by a computer device. Figure 2 , the method comprising: In step 201, a user data set is obtained.

[0057] In step 202, feature data of each type of user data is extracted from the user data set to obtain a first feature set.

[0058] The relevant contents of steps 201-202 refer to the aforementioned steps 101-102, and detailed description is omitted here.

[0059] In step 203, at least three different feature extraction algorithms are used to obtain target features from the first feature set.

[0060] Optionally, step 203 includes steps ad.

[0061] Step a: obtaining a first target feature from a first feature set based on a random forest algorithm.

[0062] The random forest algorithm constructs multiple decision trees and votes or averages the prediction results of each tree to obtain the final prediction result. Since the random forest is composed of multiple decision trees, it has good anti-overfitting ability.

[0063] The random forest algorithm includes: randomly extracting multiple samples from the original data set and constructing multiple decision trees; randomly selecting a part of the features for splitting when each tree node splits; integrating the prediction results of all decision trees to obtain the final prediction result.

[0064] The random forest algorithm can calculate the importance of each feature. A high importance of a feature indicates that the feature contributes greatly to the prediction performance of the model. Therefore, the importance of each feature in the first feature set can be calculated based on the random forest algorithm, and then the first target feature can be determined based on the importance of each feature.

[0065] In implementation, the importance of each feature in the first feature set may be arranged from high to low, and the first N features may be used as the first target features, where N is an integer, and the value range of N is 8-12, for example, 8, 10 or 12.

[0066] Exemplarily, step a is described below in the form of Python code.

[0067] # Use the random forest algorithm to obtain the importance of each feature; rf = RandomForestRegressor(n_estimators=100, random_state=42) rf.fit(X_train, y_train) rf_importances = rf.feature_importances_ # Select the top 10 features, which are the first target features, where N is 10; rf_features = X.columns[np.argsort(rf_importances)[-10:]] print("Features selected by random forest:", rf_features) Step b: obtaining a second target feature from the first feature set based on a minimum absolute shrinkage and selection algorithm.

[0068] When performing regression analysis using the least absolute shrinkage and selection operator (LASSO), features are automatically selected using L1 regularization. Features with zero coefficients are excluded, leaving only the most important features.

[0069] LASSO regression adds an L1 regularization term to the loss function to constrain the absolute value and sum of feature coefficients. This constraint causes the coefficients of some features to be compressed to zero, thereby achieving feature selection. By reducing the coefficients of some features to zero, LASSO regression can automatically select the features that have the greatest impact on the model. The L1 regularization term can reduce the complexity of the model, thereby reducing the risk of overfitting.

[0070] After the feature data in the first feature set is processed using LASSO regression, the second target feature is a feature with a non-zero coefficient.

[0071] Exemplarily, step b is described below in the form of Python code.

[0072] # LASSO regression performs feature selection, that is, determines the coefficient of each feature; lasso = Lasso(alpha=0.01) lasso.fit(X_train, y_train) lasso_coef = lasso.coef_ # Select the feature with non-zero coefficient, which is the second target feature; lasso_features = X.columns[lasso_coef != 0] print("LASSO selected features:", lasso_features) Step c: obtaining the third target feature from the first feature set based on the principal component analysis algorithm.

[0073] Principal Component Analysis (PCA) is a dimensionality reduction technique that projects the original features into a new coordinate system and selects the first k principal components. The first k principal components can retain the variance information of the original data to the greatest extent while significantly reducing the number of features.

[0074] The PCA algorithm can compress high-dimensional data into a low-dimensional space, reducing computational complexity. Moreover, by removing highly correlated features, PCA can reduce redundant information in the data and improve the efficiency of model training.

[0075] The PCA algorithm includes: subtracting the mean of each feature to centralize the data; calculating the covariance matrix of the centralized data, which is used to describe the correlation between features; performing eigenvalue decomposition on the covariance matrix to obtain eigenvalues ​​and eigenvectors; selecting the eigenvectors corresponding to the first k largest eigenvalues ​​as principal components to construct a new coordinate system; projecting the original data into the new coordinate system to obtain the reduced-dimensional data. When the PCA algorithm is used to process the feature data in the first feature set, the data can be reduced to M principal components, which are the third target features. Where M is an integer, and the value range of M is 8-12, for example, 8, 10 or 12.

[0076] Exemplarily, step c is described below in the form of Python code.

[0077] # PCA algorithm is used for dimensionality reduction, where M is equal to 10; pca = PCA(n_components=10) X_train_pca = pca.fit_transform(X_train) X_test_pca = pca.transform(X_test) print("Feature shape after PCA dimensionality reduction:", X_train_pca.shape) # Output the explained variance ratio of the principal component; print("Explained variance ratio of principal components:", pca.explained_variance_ratio_) Step d: determining the target feature based on the first target feature, the second target feature and the third target feature.

[0078] Optionally, step d includes the following three steps: In the first step, the first target feature, the second target feature and the third target feature are respectively input into the machine learning model to obtain a first machine learning model corresponding to the first target feature, a second machine learning model corresponding to the second target feature and a third machine learning model corresponding to the third target feature.

[0079] Optionally, the machine learning model may be a random forest model, a support vector machine, a decision tree, or a neural network, etc., and the first machine learning model, the second machine learning model, and the third machine learning model need to be of the same type, for example, all random forest models or all decision tree models.

[0080] When executing step d, the user data set is a sample data set, in which the ratio of the training set to the test set is 6:4, and the first step is implemented based on the data in the training set.

[0081] That is, in the first step, the first machine learning model, the second machine learning model and the third machine learning model need to be trained separately through the training set.

[0082] The second step is to obtain the loss function values ​​of the first machine learning model, the second machine learning model, and the third machine learning model.

[0083] After the first machine learning model, the second machine learning model and the third machine learning model are trained through the first step, in the second step, the loss function is calculated according to the difference between the predicted results and the actual values ​​of the three machine learning models on the test set. For example, the mean squared error (MSE) and the mean absolute error (MAE) are used as loss functions to evaluate the performance of the model.

[0084] There are many implementation methods of MSE and MAE in the related technologies, so the detailed description is omitted here.

[0085] The third step is to determine the target features based on the loss function values ​​of the first machine learning model, the second machine learning model, and the third machine learning model.

[0086] In the disclosed embodiment, the input feature of the machine learning model with the smallest loss function value is used as the target feature. For example, if the loss function value of the second machine learning model is the smallest, the target feature is the second target feature.

[0087] Selecting the feature with the smallest loss (i.e., the best predictive performance) as the target feature is essentially looking for the feature combination that best helps the model make accurate predictions.

[0088] Through steps ad, we can not only find the optimal feature subset, but also understand which feature selection methods perform best on specific data sets and models, which is helpful for subsequent model optimization and parameter adjustment.

[0089] After determining the machine learning model with the smallest loss function value, when the user data set is data collected from users, it is only necessary to use the feature extraction algorithm corresponding to the machine learning model with the smallest loss function value to determine the target feature. For example, if the loss function value of the second machine learning model is the smallest and its corresponding feature extraction algorithm is the LASSO algorithm, then it is only necessary to use the LASSO algorithm on the data in the first feature set, and the second target feature obtained is the target feature.

[0090] Optionally, user data may be collected periodically, and a machine learning model with the smallest loss function value may be retrained based on the collected user data, so that the machine learning model with the smallest loss function value may accurately reflect the user's latest situation.

[0091] In some embodiments, user data may be collected periodically, and then step 203 may be re-executed based on the collected user data. In this way, it is possible to better judge whether the user has mental health problems or is about to have mental health problems according to the user's actual condition.

[0092] Exemplarily, step d is described below in the form of Python code when the loss function is MSE.

[0093] # Evaluate the model performance after each method from sklearn.metrics import mean_squared_error # Feature model selected by LASSO X_train_lasso = X_train[:, lasso_coef != 0] X_test_lasso = X_test[:, lasso_coef != 0] rf_lasso = RandomForestRegressor(n_estimators=100, random_state=42) rf_lasso.fit(X_train_lasso, y_train) y_pred_lasso = rf_lasso.predict(X_test_lasso) mse_lasso = mean_squared_error(y_test, y_pred_lasso) print(f"Mean square error of the test set after LASSO feature selection: {mse_lasso}") # Feature model selected by random forest X_train_rf = X_train[:, np.argsort(rf_importances)[-10:]] X_test_rf = X_test[:, np.argsort(rf_importances)[-10:]] rf_rf = RandomForestRegressor(n_estimators=100, random_state=42) rf_rf.fit(X_train_rf, y_train) y_pred_rf = rf_rf.predict(X_test_rf) mse_rf = mean_squared_error(y_test, y_pred_rf) print(f"Mean square error of the test set after random forest feature selection: {mse_rf}") # Model after PCA dimensionality reduction rf_pca = RandomForestRegressor(n_estimators=100, random_state=42) rf_pca.fit(X_train_pca, y_train) y_pred_pca = rf_pca.predict(X_test_pca) mse_pca = mean_squared_error(y_test, y_pred_pca) print(f"Mean square error of the test set after PCA dimensionality reduction: {mse_pca}") Through the above step 203, it is possible to obtain the target features, so that it is possible to remove redundant or irrelevant features while identifying and retaining the features that have the greatest contribution to the model's prediction ability in the first feature set. The target features can maximize the model's prediction ability and efficiency while minimizing the model's complexity and overfitting risk.

[0094] In step 204 , based on the target feature, it is determined whether the user has a first mental health problem or is about to have the first mental health problem.

[0095] Optionally, step 204 includes: determining whether the user has a first mental health problem based on at least one of an output of the machine learning model corresponding to the target feature, a mental health threshold, and a size of the first data; and determining whether the user is about to have the first mental health problem based on the output of the machine learning model corresponding to the target feature.

[0096] The first data is user data corresponding to the target feature. The mental health threshold corresponds to the target feature, and different feature data in the target feature corresponds to different mental health thresholds. For example, the target feature includes two features, sleep quality and emotional state, and these two features correspond to different mental health thresholds.

[0097] The output of the machine learning model corresponding to the target feature is whether the user has mental health problems and whether the user is about to have mental health problems. For example, when the machine learning model corresponding to the target feature is the second machine learning model, its output is whether the user has mental health problems. If the user has mental health problems, the second machine learning model will also output the specific type of mental health problems of the user. Therefore, it is possible to identify whether the user has mental health problems and predict whether the user is about to have mental health problems based on the output of the machine learning model corresponding to the target feature.

[0098] The mental health threshold is a threshold set artificially and can be set based on experience. When the target feature is greater than the mental health threshold corresponding to the target feature, it means that the user has mental health problems.

[0099] When judging whether a user has mental health problems, if at least one of the above two judgment methods indicates that the user has mental health problems, it can be determined that the user has mental health problems.

[0100] During implementation, when a user uses the service for the first time, the mental health threshold can be used to quickly identify whether the user has obvious abnormalities. If there are obvious abnormalities, it means that the user has mental health problems; if there are no obvious abnormalities, a more detailed assessment will be performed through the machine learning model.

[0101] When continuously monitoring a user’s health, mental health thresholds can be used to trigger immediate alerts, while machine learning models are used for periodic comprehensive assessments.

[0102] Of the two judgment methods mentioned above, machine learning models are suitable for scenarios that require high accuracy, while threshold judgment is suitable for situations that require a quick response.

[0103] In addition, since the target feature is not a single feature data, but is composed of N feature data, it is possible that some feature data indicates that the user has mental health problem A, and some special data indicates that the user has mental health problem B. In this case, two sets of intervention strategies will be generated simultaneously in step 205, one set of intervention strategies is for mental health problem A, and the other set of intervention strategies is for mental health problem B. The same is true for the case where more mental health problems are identified, and detailed description is omitted here.

[0104] Since machine learning models can capture complex nonlinear relationships and interactions and provide more comprehensive and accurate prediction results, when predicting whether a user will have the first mental health problem, it can only be determined through the output of the machine learning model.

[0105] In step 205, based on the first mental health problem, a first mental health intervention strategy corresponding to the first mental health problem is generated.

[0106] Based on the type of user data, the first mental health problems that users may have can be divided into the following five categories: mental health problems corresponding to emotional data, mental health problems corresponding to behavioral data, mental health problems corresponding to physiological data, mental health problems corresponding to sleep data, and mental health problems corresponding to psychological data.

[0107] The intervention strategies corresponding to these five types of mental health problems are explained below.

[0108] Emotional data on mental health issues Mental health issues corresponding to emotional data include insufficient social support. In this case, intervention strategies include: Regular contact with friends and family: It is recommended that users regularly contact friends and family to maintain good social relationships. Join support groups or social clubs: It is recommended that users join support groups or social clubs to meet new friends and get emotional support. Participate in community volunteer activities: It is recommended that users participate in community volunteer activities, which can not only help others but also enhance their own social support network.

[0109] Behavioral data on mental health issues Mental health issues corresponding to behavioral data include low activity levels. In this case, intervention strategies include: Perform at least 30 minutes of physical activity every day: It is recommended that users perform at least 30 minutes of physical activity every day, such as walking, yoga, or cycling. Try new types of activities: It is recommended that users try new types of activities, such as fitness classes, dance classes, etc., to increase the fun and diversity of activities. Find a workout partner: It is recommended that users find a workout partner and exercise together to increase motivation to stick to exercise.

[0110] Mental health issues corresponding to physiological data Mental health issues corresponding to physiological data are categorized according to heart rate, blood pressure, and body temperature.

[0111] For heart rate, if the user's heart rate continues to increase, it may mean that the user is in a state of high stress or lack of exercise. If the user's heart rate suddenly increases or decreases abnormally, it may indicate physical or mental health problems. Intervention strategies at this time include: Stress management: It is recommended that users perform relaxation training, such as deep breathing, meditation, or yoga, to reduce stress levels. Exercise recommendations: It is recommended that users perform moderate aerobic exercise every day, such as walking, running, or cycling, to enhance cardiovascular health. Monitoring and consultation: If the heart rate is abnormal, it is recommended that the user consult a doctor for further examination and monitoring.

[0112] For blood pressure If the user's blood pressure continues to rise, it may mean that the user has unhealthy living habits or is in a state of long-term stress. If the user's blood pressure suddenly rises or falls, it may indicate potential health risks. Intervention strategies at this time include: Dietary adjustment: It is recommended that users reduce salt intake and eat more potassium-rich foods, such as fruits and vegetables, to help control blood pressure. Stress relief techniques: It is recommended that users engage in stress relief activities such as deep breathing, meditation, relaxation training, etc. to help lower blood pressure. Regular monitoring: It is recommended that users measure blood pressure regularly, record and monitor changes. If there is any abnormality, seek medical attention in time.

[0113] For body temperature, if the user's body temperature is persistently high or low, it may indicate physical health problems, such as infection or metabolic abnormalities. If the user's body temperature suddenly rises or drops abnormally, immediate attention and treatment may be required. The intervention strategies at this time include: Health monitoring: It is recommended that users take a rest, drink plenty of water, and observe other physical symptoms when abnormal body temperature occurs. If the abnormality persists, seek medical attention in time. Environmental adjustment: It is recommended that users adjust their living environment, such as maintaining a suitable room temperature and avoiding an overly cold or overheated environment. Preventive measures: It is recommended that users get vaccinated during the flu season and maintain good hygiene habits, such as washing hands frequently and avoiding close contact with patients.

[0114] Sleep data and mental health issues Mental health issues that correlate with sleep data include poor sleep quality, in which case intervention strategies include: Improve the sleep environment: Keep it quiet, dark, and at a comfortable temperature. Establish a regular sleep routine: Go to bed and wake up at the same time every day. Relax before bed: Avoid using electronic devices and meditate or do deep breathing exercises. Avoid caffeine and alcohol: Especially in the hours before bedtime. Daytime activity: Maintain a moderate amount of daytime activity and light exposure.

[0115] Mental health issues corresponding to psychological data Mental health issues corresponding to psychological data include emotional instability. In this case, intervention strategies include: Mindfulness meditation: Mindfulness meditation can reduce stress and anxiety, help users focus on the present, and improve emotional regulation. Emotional diary: Encourage users to record their emotions and triggers, which helps to identify emotional patterns and take corresponding actions. Professional consultation: Recommend users to seek help from a psychologist or mental health expert to improve their mental state through professional interventions such as talk therapy and cognitive behavioral therapy. Social activities: Encourage participation in social activities, communicate with relatives and friends, or join interest groups to enhance emotions and social support. Lifestyle adjustments: Including regular physical exercise, healthy eating habits and adequate sleep, all of which have a positive effect on emotional stability.

[0116] Exemplarily, step 205 is described below in the form of Python code.

[0117] import pandas as pd def generate_intervention_strategy(user_analysis): """ Generate personalized intervention strategies based on the user's analysis results.

[0118] parameter: user_analysis (dict): Dictionary containing user analysis results.

[0119] return: strategies (dict): A dictionary containing personalized intervention strategies.

[0120] """ strategies = {} # Sample user analysis results emotional_state = user_analysis.get('emotional_state', 'stable') sleep_quality = user_analysis.get('sleep_quality', 'good') social_support = user_analysis.get('social_support', 'adequate') activity_level = user_analysis.get('activity_level', 'active') # Lifestyle Adjustment Strategies if sleep_quality == 'poor': strategies['sleep'] = [ 'Maintain a regular schedule', 'Create a relaxing bedtime routine', 'Avoid consuming caffeinated beverages or using electronic devices before bed' ] if activity_level == 'inactive': strategies['activity'] = [ 'At least 30 minutes of physical activity every day', 'Try new types of activities, such as walking, yoga or cycling', 'Find a workout partner' ] # Mental Health Education Strategy if emotional_state == 'unstable': strategies['emotional_health'] = [ 'Practice mindfulness meditation', 'Keep a journal to record your thoughts and feelings', 'Seek professional psychological counseling or treatment' ] # Social Support Strategies if social_support == 'inadequate': strategies['social_support'] = [ 'Regularly connect with friends and family', 'Join a support group or social club', 'Volunteer in the community' ] # Return the generated intervention strategy return strategies # Sample user analysis results user_analysis = { 'emotional_state': 'unstable', 'sleep_quality': 'poor', 'social_support': 'inadequate', 'activity_level': 'inactive' } # Generate intervention strategy strategies = generate_intervention_strategy(user_analysis) # Output intervention strategy for category, recommendations in strategies.items(): print(f"{category.capitalize()} Strategies:") for recommendations in recommendations: print(f"- {recommendation}") print() The following are device embodiments of the present application. For details not described in detail in the device embodiments, reference may be made to the above method embodiments.

[0121] Figure 3 A schematic diagram of a mental health intervention device provided by an exemplary embodiment of the present disclosure is shown. Figure 3 The mental health intervention device 300 includes: an acquisition module 301, a first feature extraction module 302, a second feature extraction module 303, a mental health judgment module 304 and an intervention strategy generation module 305.

[0122] The acquisition module 301 is used to acquire a user data set, which includes a variety of user data, including emotional data, behavioral data, physiological data, sleep data and psychological data.

[0123] The first feature extraction module 302 is used to extract feature data of each type of user data from the user data set to obtain a first feature set.

[0124] The second feature extraction module 303 is used to obtain target features from the first feature set by using at least three different feature extraction algorithms.

[0125] The mental health determination module 304 is used to determine whether the user has a first mental health problem or is about to have a first mental health problem based on the target feature.

[0126] The intervention strategy generation module 305 is used to generate a first mental health intervention strategy corresponding to the first mental health problem based on the first mental health problem.

[0127] Optionally, the second feature extraction module 303 is also used to obtain a first target feature from the first feature set based on a random forest algorithm; to obtain a second target feature from the first feature set based on a minimum absolute shrinkage and selection algorithm; to obtain a third target feature from the first feature set based on a principal component analysis algorithm; and to determine the target feature based on the first target feature, the second target feature and the third target feature.

[0128] Optionally, the second feature extraction module 303 is also used to input the first target feature, the second target feature and the third target feature into the machine learning model respectively to obtain a first machine learning model corresponding to the first target feature, a second machine learning model corresponding to the second target feature and a third machine learning model corresponding to the third target feature; obtain the loss function values ​​of the first machine learning model, the second machine learning model and the third machine learning model; and determine the target feature based on the size of the loss function values ​​of the first machine learning model, the second machine learning model and the third machine learning model.

[0129] Optionally, the mental health judgment module 304 is also used to determine whether the user has mental health problems based on the output of the machine learning model corresponding to the target feature, the mental health threshold and at least one of the size of the target feature, and different feature data in the target feature corresponds to different mental health thresholds.

[0130] Optionally, the mental health judgment module 304 is also used to determine whether the user is about to develop a first mental health problem based on the output of the machine learning model corresponding to the target feature.

[0131] It should be noted that when the mental health intervention device provided in the above embodiment generates an intervention strategy, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the mental health intervention device provided in the above embodiment and the mental health intervention method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0132] The division of modules in the embodiments of the present disclosure is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional module in each embodiment of the present disclosure may be integrated into a processor, or may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.

[0133] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a terminal device (which can be a personal computer, mobile phone, or communication device, etc.) or a processor (processor) to execute all or part of the steps of the method of each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.

[0134] Figure 4 Schematic diagram of the structure of the computer device provided by the embodiment of the present disclosure. Figure 4 As shown, the computer device 400 includes: a processor 401 and a memory 402 .

[0135] The processor 401 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 401 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 401 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 401 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 401 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0136] The memory 402 may include one or more computer-readable storage media, which may be non-transitory. The memory 402 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 402 is used to store at least one instruction, which is used to be executed by the processor 401 to implement the mental health intervention method provided in the embodiment of the present disclosure.

[0137] Those skilled in the art will understand that Figure 4 The structure shown in the figure does not constitute a limitation on the computer device 400, and the computer device 400 may include more or less components than those shown in the figure, or combine some components, or adopt a different arrangement of components.

[0138] The embodiments of the present disclosure also provide a non-transitory computer-readable storage medium. When the instructions in the storage medium are executed by a processor of a computer device, the computer device is enabled to execute the mental health intervention method provided in the embodiments of the present disclosure.

[0139] The present disclosure also provides a computer program product, including a computer program / instruction, which implements the mental health intervention method provided in the present disclosure when the computer program / instruction is executed by a processor.

[0140] The above description is only an optional embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A mental health intervention approach, It is characterized in that The method comprises: Acquire a user data set, wherein the user data set includes multiple types of user data, and the user data includes emotional data, behavioral data, physiological data, sleep data, and psychological data; Extracting feature data of each type of user data from the user data set to obtain a first feature set; Using at least three different feature extraction algorithms to obtain target features from the first feature set; Based on the target feature, determining whether the user has a first mental health problem or is about to have the first mental health problem; Based on the first mental health problem, a first mental health intervention strategy corresponding to the first mental health problem is generated.

2. The method according to claim 1, It is characterized in that The adopting at least three different feature extraction algorithms to obtain target features from the first feature set includes: Based on a random forest algorithm, obtaining a first target feature from the first feature set; Obtaining a second target feature from the first feature set based on a least absolute shrinkage and selection algorithm; Based on a principal component analysis algorithm, obtaining a third target feature from the first feature set; The target feature is determined based on the first target feature, the second target feature, and the third target feature.

3. The method according to claim 2, It is characterized in that The determining the target feature based on the first target feature, the second target feature and the third target feature comprises: Inputting the first target feature, the second target feature, and the third target feature into machine learning models respectively, to obtain a first machine learning model corresponding to the first target feature, a second machine learning model corresponding to the second target feature, and a third machine learning model corresponding to the third target feature; Obtain loss function values ​​of the first machine learning model, the second machine learning model, and the third machine learning model; The target feature is determined based on the size of the loss function values ​​of the first machine learning model, the second machine learning model, and the third machine learning model.

4. The method according to claim 3, It is characterized in that The determining, based on the target feature, whether the user has a mental health problem or is about to have the first mental health problem comprises: Based on the output of the machine learning model corresponding to the target feature, the mental health threshold and at least one of the size of the target feature, it is determined whether the user has a mental health problem, and different feature data in the target feature corresponds to different mental health thresholds.

5. The method according to claim 3, It is characterized in that The determining, based on the target feature, whether the user has a mental health problem or is about to have the first mental health problem comprises: Based on the output of the machine learning model corresponding to the target feature, determine whether the user is about to develop a first mental health problem.

6. A mental health intervention device, It is characterized in that The device comprises: An acquisition module, used to acquire a user data set, wherein the user data set includes multiple types of user data, including emotional data, behavioral data, physiological data, sleep data, and psychological data; A first feature extraction module, used to extract feature data of each type of user data from the user data set to obtain a first feature set; A second feature extraction module, configured to obtain target features from the first feature set by using at least three different feature extraction algorithms; a mental health judgment module, used to determine whether the user has a first mental health problem or is about to have the first mental health problem based on the target feature; An intervention strategy generation module is used to generate a first mental health intervention strategy corresponding to the first mental health problem based on the first mental health problem.

7. A computer device, It is characterized in that The computer device comprises: a memory and a processor, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by a processor to implement the method according to any one of claims 1 to 5.

9. A computer program product comprising a computer program / instructions, It is characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Feature selection method and device, electronic equipment and storage medium

    CN116796164A

  • Information prediction method and device, equipment, storage medium and program product

    CN116976491A

  • Equipment health analysis method based on multi-source data driving

    CN117421582A

  • Neural network-based power grid load prediction method

    CN117578440A

  • Mental health assessment method and system based on user behavior data

    CN118486431A

Cited By

  • Evaluation system for patients with exercise fear

    CN120432169A

  • Systems, methods, and programs for mental healthcare

    JP7830750B1