Depression diagnosis and treatment intelligent system based on non-inductive measurement and state tracking
By designing an intelligent depression diagnosis and treatment system based on sensorless measurement and status tracking, using a combination of strategy unit, symptom unit and interactive unit, the problem that existing depression detection methods cannot achieve active, sensorless and empathetic diagnosis. Efficient and economical detection and intervention for depression symptoms have been achieved.
Patent Information
- Application Number
- CN202411480803.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-02-11
AI Technical Summary
The existing depression detection methods have the limitations of not being able to achieve active, insensitive and empathetic diagnosis. They rely on the active participation of users and data, making it difficult to identify depressive symptoms in a timely and accurate manner. At the same time, the equipment cost is high, the data privacy risk is high, and the lack of empathy is lacking. interaction method.
Design an intelligent system for depression diagnosis and treatment based on sensorless measurement and status tracking, including policy units, symptom units and interactive units. The strategy unit uses sensorless exploration, empathy response and dialogue process management components to use hierarchical classification algorithms for policy selection. The Symptom Unit uses dialogue status tracking technology to identify nine core symptoms of depression through the diagnostic module and the symptom exploration module. The interaction unit uses a large language model to perform natural language interaction to realize human-computer dialogue.
It realizes active, unsensical and empathetic dialogue with users without causing user resistance, monitor and evaluate users' psychological state in real time, detect and intervene in early depression symptoms, reduce equipment costs and data privacy risks, and provides a Low-cost, experience-friendly depression detection and intervention methods.
Smart Images

Figure CN119418960A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of natural language processing and dialogue systems, and in particular to an intelligent depression diagnosis and treatment system based on non-sensing measurement and state tracking. Background Art
[0002] Depression is a common mental health disorder. If not identified and treated in time, it may have a serious impact on a person's quality of life and social function, and even lead to extreme consequences such as suicide. Traditional depression detection methods mainly rely on professional psychological assessments and questionnaires, which require the subject to actively seek help, and the process is time-consuming and costly.
[0003] In recent years, with the development of science and technology, depression detection methods based on wearable devices and social media data have emerged. Wearable device-based methods infer users' psychological states by monitoring their physiological signals, such as heart rate, sleep patterns, activity levels, etc. However, this method requires users to wear specific hardware devices, which increases the cost and inconvenience of use. In addition, the accuracy of the data may be affected by device performance and user cooperation. At the same time, social media-based depression detection uses natural language processing and machine learning techniques to analyze users' posts, comments, and interactions on social platforms to identify depressive symptoms. Although this method does not require additional hardware, it relies on the user's activity and sharing level on social media. If the user rarely uses social media or is reluctant to share personal emotions, the effectiveness of this method will be greatly reduced. In addition, the privacy and security of the data are also issues that need to be considered.
[0004] Furthermore, considering the psychological state of people with depression, traditional methods often lack a non-sensitive and empathetic way of interaction. Many detection methods may make users feel monitored or judged, which increases the psychological burden and is not conducive to accurate identification and intervention. Existing technologies cannot effectively detect depressive symptoms by having a natural and empathetic conversation with users without causing resistance from the users.
[0005] The above methods all have the limitation of being unable to achieve active, non-sensing and empathic diagnosis. They mainly rely on existing data and active participation of users, and it is difficult to identify depression symptoms in a timely and accurate manner. At the same time, problems such as high equipment costs, high data privacy risks, and lack of empathetic interaction methods also limit their widespread application. Therefore, there is an urgent need for a depression detection method that is lower in cost and can actively and non-sensingly communicate with users, so as to help detect and intervene in depression symptoms early. Summary of the invention
[0006] In order to overcome the shortcomings and deficiencies of the prior art, the present invention provides an intelligent depression diagnosis and treatment system based on non-contact measurement and state tracking.
[0007] A depression diagnosis and treatment intelligent system based on insensitivity measurement and state tracking, the system comprises: a strategy unit, a symptom unit and an interaction unit, the strategy unit comprises a strategy design module and a hierarchical strategy selection module, the strategy design module is used for insensitivity, empathy and dialogue process management; the hierarchical strategy selection module adopts a hierarchical classification algorithm to train the corresponding classification module; the symptom unit is composed of a diagnosis module and a symptom exploration module, the diagnosis module is used for dialogue state tracking, and the symptom exploration module uses a classification model and a dynamically adjusted classifier to prevent the symptoms that have been concluded from appearing in the classification results; the interaction unit uses the natural language understanding and generation capabilities of a large language model, combines dialogue scenes and states for role-playing, and completes human-computer interaction in the form of natural dialogue.
[0008] Furthermore, the strategy design module includes a senseless detection component, an empathetic response component, and a dialogue process management component;
[0009] The unconscious exploration component includes: preset questions: design open-ended questions related to daily life, guide through natural dialogue, avoid directly touching on sensitive topics, and obtain valuable information without alerting users; referential questions: use indirect methods to ask questions, through third-person or hypothetical situations, to guide users to spontaneously share their feelings and ideas; tolerant questions: ask questions in an inclusive and understanding tone to reduce users' psychological defenses and encourage users to express themselves frankly; request clarification: when users provide vague or ambiguous information, politely request clarification to obtain information about users' emotions and psychological states.
[0010] The empathic response components include: Guidance: guiding users to explore their inner world through appropriate language and tone, helping them understand and express their emotions; Connection: establishing emotional connection, expressing understanding and resonance with users' feelings, and enhancing trust and security; Feedback: providing positive and supportive feedback in a timely manner, responding to users' emotional changes, and helping users relieve negative emotions;
[0011] The dialogue process management components include: post-comment transfer: after commenting on the user's expression, guide the topic to other areas to avoid staying on topics that may cause discomfort for a long time; bridging: use transitional language and techniques to establish natural connections between different topics to ensure the coherence and fluency of the dialogue.
[0012] Furthermore, the hierarchical strategy selection module adopts a hierarchical classification algorithm to construct a two-stage strategy selection module; the module takes the user's conversation history as input and outputs the selected fine-grained strategy, which specifically includes two stages: coarse-grained strategy selection and fine-grained strategy selection. Its model input is expressed as D = u 1 ,u 2 ,…,u T , where ut represents the tth round of dialogue, T represents the number of dialogue rounds; its output can be expressed as a fine-grained strategy f * .
[0013] Furthermore, the symptom unit consists of a diagnosis module and a symptom exploration module, which work together to evaluate and identify the nine core symptoms of depression through dialogue interaction with the user; the diagnosis module uses dialogue state tracking technology to fill the slots for these nine symptoms until all symptom states are determined. It should be noted that in addition to True (existence) and False (non-existence), the symptom state also needs to consider the situation where it cannot be diagnosed, that is, the symptom state is unknown, and no slot update is performed at this time.
[0014] Furthermore, the diagnosis module uses the dialogue state tracking technology to track the nine symptoms of depression, setting the symptom set S = {s 1 ,s 2 , ..., s 9}, corresponding to the nine symptoms of depression: depressive mood (s 1 ), loss of interest 2 ), loss of energy (s 3 ), self-guilt (s 4 ), suicidal tendencies 5 ), lack of concentration (s 6 ), sleep problems(s 7 ), appetite or weight changes (s 8 ), psychomotor agitation or retardation (s 9 ). Each symptom state v i It can take the value True, False, or Unknown, indicating that the symptom exists, the symptom does not exist, and the symptom status is unknown, respectively;
[0015] The input is the conversation history D = {u 1 ,u 2 , ..., u T} and the previous round's condition status The output is the symptom status after the current round of update In order to handle long sequence problems, Longformer-zh is used as the base model to encode long dialogue history.
[0016] Serialize the conversation history into text input X = Concat(u 1 ,u 2 , ..., u T ), and then convert the text into a word vector sequence {x 1 , x2 , ..., x N}, where N is the total number of words in the text; Longformer-zh uses sparse attention mechanism, including local window attention and global attention, to efficiently encode long sequences and obtain the hidden state sequence {h 1 ,h 2 , ..., h N}; In order to capture the global semantic information of the dialogue, a global attention mechanism is used to convert the hidden state h at the [CLS] position CLS As a representation of the entire conversation. For each symptom s i , design a three-classifier to predict symptom status The input of the symptom classifier is h CLS and the symptom status of the previous round are embedded Combine the two to get a comprehensive representation
[0017] The output of the symptom classifier is calculated by the following formula:
[0018]
[0019] Among them, W i is the weight matrix of the classifier, with a dimension of d×3, where d is the comprehensive representation z i The dimension of b i is the bias vector, and the probability distribution of each symptom state is calculated by the Softmax function:
[0020] P i =Softmax(o i ),
[0021] in, Based on the predicted probability, select the category with the highest probability as the symptom status:
[0022]
[0023] If the model cannot make a clear judgment on a symptom (i.e., the highest probability corresponds to Unknown), the status of the symptom remains unknown and the slot is not updated.
[0024] During training, the loss function for symptom state prediction is multi-class cross-classification loss:
[0025]
[0026] in, Symptoms i The one-hot encoding of the true label.
[0027] Furthermore, the symptom exploration module selects the next symptom to be explored based on the current conversation history and symptom status. j Since the symptoms that have been concluded (True or False) will no longer appear in the classification results, the symptom exploration module needs to find the symptoms in the Unknown state. Use Longformer-zh to encode the dialogue history and get the global representation h CLS . Change the current symptom status to V (t) Map h to vector v through the embedding layer CLS Combined with v, we get the comprehensive representation z = [h CLS ; v] 0
[0028] The symptom exploration module is modeled as a multi-classification problem on |S′| categories, and the output of the classifier is:
[0029]
[0030] Among them, W s is the weight matrix with dimension d×|S′|, b s is the bias vector. The probability of each symptom is calculated by the Softmax function:
[0031]
[0032] Select the symptoms with the highest probability j As the next symptom to explore:
[0033]
[0034] The loss function of the symptom search module is multi-class cross entropy loss:
[0035]
[0036] Among them, y j is the one-hot encoding of the true next symptom.
[0037] During model training, the diagnosis module and symptom exploration module can be jointly trained, and the total loss function is:
[0038]
[0039] Among them, λ is the trade-off coefficient, which is used to balance the losses of the two modules. During the optimization process, the Adam optimizer is used to update the model parameters. To prevent overfitting, regularization techniques such as Dropout or weight decay can be used during the training process.
[0040] Furthermore, the interaction unit uses a large language model Qwen2-72b-Instruct to interact with the user in natural language. The input of the unit includes the symptoms to be explored. j , the fine-grained strategy f * And the conversation history D = {u 1 ,u 2 ,…,u T The output is the natural language response r generated based on these inputs. t , used to interact with users.
[0041] Beneficial effects:
[0042] The present invention proposes an intelligent depression diagnosis and treatment system based on non-sensing measurement and state tracking. The system actively communicates with users in a non-sensing and empathetic manner, monitors and evaluates the user's psychological state in real time, and thus realizes early detection and intervention of depressive symptoms. By integrating technologies such as natural language processing, dialogue strategy and state tracking, the intelligent agent can capture the user's relevant symptoms of depression in the dialogue and conduct a further psychological state assessment. The intelligent agent adopts an empathetic interaction method and uses a carefully designed strategy to reduce interference and pressure on the user and avoid causing resistance. The state tracking function enables the system to continuously monitor the user's emotional changes, identify potential depressive symptoms in a timely manner, and provide appropriate support or suggestions. The present invention solves the technical problem that the prior art cannot actively, non-sensingly and empathetically detect depressive symptoms, and provides users with a low-cost, experience-friendly depression detection and intervention method, which has broad application prospects. The modular design and technical method of the present invention can be applied to the detection of a variety of diseases, not only limited to depression, and provide reference and possibility for application in other mental health fields. The present invention integrates security filtering and ethical review mechanisms to avoid the generation of inappropriate content and improve the reliability of the system and user trust. The present invention realizes active, non-sensitive and empathetic depression detection: through the design of strategy, symptom and dialogue modules, the intelligent agent interacts with the user in a natural way, reduces the psychological burden, and improves the timeliness and effectiveness of detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 is a system block diagram of the present invention;
[0044] Figure 2 is a schematic diagram of a strategy unit of the present invention;
[0045] Figure 3 It is a schematic diagram of the symptom unit of the present invention;
[0046] Figure 4 It is a schematic diagram of the interaction unit of the present invention. DETAILED DESCRIPTION
[0047] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application may be combined with each other. The present application is further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0048] like Figure 1 As shown, an intelligent depression diagnosis and treatment system based on insensitivity measurement and state tracking includes: a strategy unit, a symptom unit and an interaction unit. The strategy unit includes a strategy design module and a hierarchical strategy selection module. The strategy design module is used to manage insensitivity, empathy and dialogue process; the hierarchical strategy selection module adopts a hierarchical classification algorithm to train the corresponding classification module; the symptom unit is composed of a diagnosis module and a symptom exploration module. The diagnosis module is used to track the dialogue state. The symptom exploration module uses a classification model and a dynamically adjusted classifier to prevent the symptoms that have been concluded from appearing in the classification results; the interaction unit uses the natural language understanding and generation capabilities of the large language model, combines the dialogue scene and state for role-playing, and completes human-computer interaction in the form of natural dialogue.
[0049] The following is a detailed introduction to the depression diagnosis and treatment agent based on unconscious measurement and state tracking. In all training stages, the data is generated by a large language model and then obtained by manual screening.
[0050] like Figure 2 As shown in the figure, the policy unit includes a policy design module. The large language model has shown strong capabilities in the field of dialogue, but is limited by its versatility. In specific fields such as depression detection, it cannot fully consider the user's feelings and often makes direct and potentially uncomfortable inquiries. In the field of psychology, depression detection needs to be treated with caution, which requires the large language model to consider the user's psychological state and the sensitivity of depression detection during the interaction process.
[0051] Based on this, the present invention combines existing psychological theories and dialogue technology routes to design three types of coarse-grained strategies: insensitivity detection component, empathy response component, and dialogue process management component. In order to better consider the psychological condition and sensitivity of depression detection in the process of interaction with users, we designed corresponding fine-grained strategies for these three types of coarse-grained strategies. The fine-grained strategies are as follows:
[0052] Unconscious probing component, preset questions: Design a series of open-ended questions related to daily life, guide through natural conversations, avoid directly touching on sensitive topics, and obtain valuable information without alerting users. Referential questions: Use indirect methods to ask questions, such as through third-person or hypothetical situations, to guide users to spontaneously share their feelings and thoughts. Tolerant questions: Ask questions in an inclusive and understanding tone to lower users' psychological defenses and encourage them to express themselves frankly. Request clarification: When users provide vague or ambiguous information, politely request clarification to obtain more accurate information about their emotions and psychological states.
[0053] Empathy response component, Guidance: Through appropriate language and tone, guide users to explore their inner world in depth, help them better understand and express their emotions. Connection: Establish emotional connection, express understanding and resonance of users' feelings, enhance trust and sense of security. Feedback: Provide positive and supportive feedback in a timely manner, respond to users' emotional changes, and help them relieve negative emotions.
[0054] Dialogue flow management component, post-comment transfer: After making appropriate comments on the user's expression, skillfully guide the topic to other areas to avoid staying on topics that may cause discomfort for a long time. Bridging: Use transitional language and techniques to establish natural connections between different topics to ensure the coherence and fluency of the conversation.
[0055] Through the application of the above fine-grained strategies, the agent can technically consider the user's psychological condition and the sensitivity of depression detection during the interaction with the user. The unconscious exploration strategy makes the information collection process more covert and natural; the empathetic response strategy enhances the user's participation and trust; and the dialogue process management strategy ensures the overall effect of the dialogue and user experience. By combining these strategies, the agent can realize the unconscious measurement and state tracking of the user's psychological state, and effectively detect and intervene in depressive symptoms.
[0056] Hierarchical strategy selection module, in order to achieve the precise selection of strategies by the intelligent agent during the dialogue process, the present invention uses the hierarchical text classification algorithm to construct a two-stage strategy selection module. This module takes the user's dialogue history as input and outputs the selected fine-grained strategy, which specifically includes two stages: coarse-grained strategy selection and fine-grained strategy selection. Its model input can be expressed as D = u 1 ,u 2 ,…,u T , where u t represents the tth round of dialogue, T represents the number of dialogue rounds; its output can be expressed as a fine-grained strategy f * .
[0057] In order to process long sequences of dialogue history, the model is built based on Longformer-zh (a pre-trained model for long Chinese text) to effectively deal with the modeling problem of long text sequences. Longformer-zh is a Transformer model optimized for long Chinese text sequences. Its core is the use of a sparse attention mechanism, which can reduce computational complexity while maintaining model performance. Local Window Attention (Sliding Window Attention): Attention is calculated only within a local window with a window size of w. Global Attention: Global attention is calculated for a specific position (such as the sentence start tag [CLS]) to capture global information.
[0058] In the feature extraction part, Longformer-zh converts the dialogue history D into a word embedding sequence E = e 1 ,e 2 ,…,e L , where L is the sequence length. At the same time, position encoding is added to the embedded sequence to retain the position information. After completing the data processing, Longformer-zh models the embedded sequence through a multi-layer Transformer encoder to obtain a representation sequence H = h 1 ,h 2 ,…,h L .
[0059] In the coarse-grained strategy selection phase, the coarse-grained strategy set is defined as The classification process is as follows: Using the hidden state h of the global attention position CLS As a representation of the entire conversation history. CLS Input into the coarse-grained strategy classifier and obtain the output vector through linear transformation:
[0060] o coarse =W coarse h CLS +b coarse
[0061] in, N is the number of coarse-grained strategies, d is the hidden layer dimension, Next, the Softmax function is used to calculate the probability distribution of the coarse-grained strategy:
[0062] P coarse =Softmax(o coarse )
[0063] Finally, the strategy category with the highest probability is selected:
[0064]
[0065] In the fine-grained strategy selection phase, for each coarse-grained strategy Each has a corresponding set of fine-grained strategies For example, fine-grained strategies for insensitive probing include pre-set questions, reference questions, tolerant questions, and requests for clarification. The classification process is similar to the coarse-grained strategy selection, and h is also used. CLS As input, it is fed into the fine-grained classifier corresponding to the coarse-grained policy:
[0066]
[0067] in, is the number of fine-grained strategies under the corresponding coarse-grained strategy, Then, the Softmax function is used to calculate the probability distribution of fine-grained strategies:
[0068] P fine =Softmax(o fine ).
[0069] Finally, the fine-grained strategy with the highest probability is selected:
[0070]
[0071] In terms of model training, in order to ensure the effectiveness of the model, it is necessary to jointly train the coarse-grained and fine-grained classifiers. The loss function is defined as follows. The coarse-grained strategy loss is:
[0072]
[0073] in, is the one-hot encoding of the true label of the coarse-grained strategy. The fine-grained strategy loss is:
[0074]
[0075] in, is the one-hot encoding of the true label of the fine-grained strategy. The total loss function is:
[0076]
[0077] Among them, λ is a trade-off coefficient used to balance the coarse-grained and fine-grained strategy losses.
[0078] During the optimization process, the Adam optimizer is used with a learning rate of η to perform gradient backpropagation and update on all parameters of the model.
[0079] The details of the intermediate process are as follows. Since the dialogue history may be very long, the global self-attention mechanism of the traditional Transformer will lead to high computational complexity. Longformer-zh uses a sparse self-attention mechanism to calculate attention only within the local window and the global position, reducing the computational complexity from O(L 2 ) to O(L·w), and by using no-feeling probing, empathic responses, and conversation flow management in specific locations (such as [CLS]) in addition to using h CLS , you can also consider fusing hidden states at other locations to obtain more fine-grained information. For example, you can perform average pooling or max pooling on the hidden state sequence to get a global representation, or add another layer of multi-head attention mechanism before the classifier to further fuse information.
[0080] In order to deal with the uncertainty in the strategy selection process and improve the robustness of the model, the temperature coefficient T can be introduced to adjust the Softmax function:
[0081]
[0082] By adjusting T, the smoothness of the probability distribution can be controlled.
[0083] During the model deployment and reasoning stage, in order to improve the reasoning speed and efficiency of the model, model pruning and quantization can be performed to reduce the number of parameters and calculations; for multi-user requests, batch processing is used to improve GPU utilization.
[0084] like Figure 3 As shown in the figure, the symptom unit consists of a diagnosis module and a symptom exploration module, which work together to evaluate and identify the nine core symptoms of depression through dialogue interaction with the user. The diagnosis module uses dialogue state tracking technology to fill the slots for these nine symptoms until all symptom states are determined. It should be noted that in addition to True (existence) and False (non-existence), the symptom state also needs to consider the situation where it cannot be diagnosed, that is, the symptom state is unknown, and no slot update is performed at this time.
[0085] Diagnosis module: In the diagnosis module, the Dialogue State Tracking (DST) technology is used to track the status of the nine symptoms of depression. Set the symptom set S = {s 1 ,s 2 , ..., s 9}, corresponding to the nine symptoms of depression: Depressed mood (s 1 ), loss of interest 2 ), loss of energy (s 3 ), self-guilt (s 4 ), suicidal tendencies5 ), lack of concentration (s 6 ), sleep problems(s 7 ), appetite or weight changes (s 8 ), psychomotor agitation or retardation (s 9 ). Each symptom state v i The value can be True, False, or Unknown, indicating that the symptom exists, the symptom does not exist, and the symptom status is unknown, respectively.
[0086] The input is the conversation history D = {u 1 ,u 2 , ..., u T} and the previous round's condition status The output is the symptom status after the current round of update In order to handle long sequence problems, Longformer-zh is used as the base model to encode long dialogue history.
[0087] Serialize the conversation history into text input X = Concat(u 1 ,u 2 , ..., u T ), and then convert the text into a word vector sequence {x 1 , x 2 , ..., X N}, where N is the total number of words in the text. Longformer-zh uses sparse attention mechanism, including local window attention and global attention, to efficiently encode long sequences and obtain the hidden state sequence {h 1 ,h 2 , ..., h N}. In order to capture the global semantic information of the dialogue, a global attention mechanism is used to convert the hidden state h at the [CLS] position CLS As a representation of the entire conversation. For each symptom s i , design a three-classifier to predict symptom status The input of the symptom classifier is h CLS and the symptom status of the previous round are embedded Combine the two to get a comprehensive representation
[0088] The output of the symptom classifier is calculated by the following formula:
[0089]
[0090] Among them, W iis the weight matrix of the classifier, with a dimension of d×3, where d is the comprehensive representation z i The dimension of b i is the bias vector. The probability distribution of each symptom state is calculated by the Softmax function:
[0091] P i =Softmax(o i ),
[0092] in, Based on the predicted probability, select the category with the highest probability as the symptom status:
[0093]
[0094] If the model cannot make a clear judgment on a symptom (i.e., the highest probability corresponds to Unknown), the status of the symptom remains unknown and the slot is not updated.
[0095] During training, the loss function for symptom state prediction is multi-class cross-classification loss:
[0096]
[0097] in Symptoms i The one-hot encoding of the true label.
[0098] The goal of the symptom exploration module is to select the next symptom to explore based on the current conversation history and symptom status. j Since the symptoms that have been concluded (True or False) will no longer appear in the classification results, the symptom exploration module needs to find the symptoms in the Unknown state. Use Longformer-zh to encode the dialogue history and get the global representation h CLS . Change the current symptom status to V (t) Map h to vector v through the embedding layer CLS Combined with v, we get the comprehensive representation z = [h CLS ; v] 0 The symptom exploration module is modeled as a multi-classification problem on |S′| categories, and the output of the classifier is:
[0099]
[0100] Among them, W s is the weight matrix with dimension d×|S′|, b s is the bias vector. The probability of each symptom is calculated by the Softmax function:
[0101]
[0102] Select the symptoms with the highest probability j As the next symptom to explore:
[0103]
[0104] The loss function of the symptom search module is multi-class cross entropy loss:
[0105]
[0106] Among them, y j is the one-hot encoding of the true next symptom.
[0107] During model training, the diagnosis module and symptom exploration module can be jointly trained, and the total loss function is:
[0108]
[0109] Among them, λ is the trade-off coefficient, which is used to balance the losses of the two modules. During the optimization process, the Adam optimizer is used to update the model parameters. To prevent overfitting, regularization techniques such as Dropout or weight decay can be used during the training process.
[0110] In the inference phase, the model receives the user's dialogue input, updates the symptom status, and selects the next symptom to be discussed. If the status of a symptom is predicted to be Unknown, the symptom slot is not updated and remains unknown. By working in synergy with the policy module and the dialogue module, the agent can conduct a natural dialogue with the user in a non-sensical and empathetic way to complete the assessment of depression symptoms.
[0111] like Figure 4 As shown in Figure 2, in the interactive unit, a large language model Qwen2-72b-Instruct is used to interact with the user in natural language. The input of this module includes the symptoms to be explored. j , the fine-grained strategy f * And the conversation history D = {u 1 ,u 2 ,…,u T The output is the natural language response r generated based on these inputs. t , used to interact with users.
[0112] First, the input information needs to be integrated to construct the prompt word P of the model. The design of the prompt word is crucial, and it needs to include system prompts, strategy guidance, conversation history, and implicit symptom information. System prompts are used to set the role and behavior norms of the model. For example, guide the model to communicate with users in an empathetic and supportive manner and avoid directly asking for sensitive information. Strategy guidance is based on the selected fine-grained strategy f * , providing specific guidance to the model. For example, if the strategy is "ask for clarification", the prompt word instructs the model to ask the user to clarify a question in a polite manner. The dialogue history D is formatted into a form that the model can understand, usually presented in the form of alternating speeches by both parties. Symptoms to be explored j The information is implicitly embedded in the prompt words to guide the model to focus on related topics, but avoid direct mention to prevent users from resisting.
[0113] The construction of the prompt word P can be expressed as: P = Format (System Prompt, Strategy Guidance, D, Implicit Symptom Informatid, where Format (·) means combining the various parts of the content into the input of the model according to a predetermined format.
[0114] After getting the prompt word P, it is input into the large language model Qwen2-72b-Instruct. The model is based on the conditional probability P(r t |P) to generate the next response r t The generation process can be viewed as a sequence prediction problem, where the model generates each word w in the response in turn. k , at each step the conditional probability of the next word is calculated:
[0115] P(W k |w 1 , w 2 , ..., w k-1 , P)
[0116] Among them, w 1 , w 2 , ..., w k-1 is the generated word sequence.
[0117] To ensure that the responses generated by the model conform to the selected fine-grained strategy f *The model needs to be guided in the prompt words to generate the behavior of the model. The strategy guidance part explicitly provides the instructions that the model should follow. For example, for the "guidance" strategy, the model is prompted to guide the user to express his inner feelings through open-ended questions. Implicit symptom information is used to prompt the model to focus on s j Related topics, but avoid directly mentioning the symptoms themselves.
[0118] After generating the response, the model's output r t Post-processing. First, conduct a content review to ensure that the response does not contain inappropriate or sensitive content and meets ethical and safety requirements. Second, adjust the tone and wording of the response to ensure that it meets the expected interaction style and strategy requirements. Finally, check the length and coherence of the response to ensure that it is consistent with the context.
[0119] The entire interaction process can be formalized as an optimization problem, that is, to satisfy the strategic and ethical constraints C(r t ), maximize the conditional probability of reply:
[0120]
[0121] Among them, the constraint condition C(r t ) including policy compliance, ethical standards and content appropriateness.
[0122] In terms of model parameter configuration, Qwen2-72b-lnstruct is a pre-trained language model with 72 billion parameters. After fine-tuning the instructions, it can generate responses that meet the requirements according to the prompt words. During the generation process, the temperature coefficient τ and the maximum generation length L can be adjusted. max Hyperparameters such as τ and τ are used to control the diversity and coherence of the generated text. The temperature coefficient τ controls the randomness of the generation. A lower temperature will make the model generate more deterministic responses, while a higher temperature will increase the diversity of the generation.
[0123] In terms of safety and ethics, special attention should be paid to the special requirements in the field of mental health. In the design and post-processing of prompt words, the present invention adds a safety filtering and ethical review mechanism. In the model generation stage, the prompt words are used to guide the model to comply with ethical standards and avoid generating inappropriate content. After generating natural language replies, the pre-trained text classification model is used to perform security checks on the generated replies to filter out replies that may contain sensitive or inappropriate content. Through this multi-level review mechanism, the present invention ensures the safety and appropriateness of the reply content and avoids potential psychological harm or discomfort to users. Ensure that the model's replies do not cause psychological burden or harm to users.
[0124] Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various equivalent changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. An intelligent depression diagnosis and treatment system based on non-sensing measurement and state tracking, characterized by The system includes: a strategy unit, a symptom unit and an interaction unit. The strategy unit includes a strategy design module and a hierarchical strategy selection module. The strategy design module is used to manage indifference, empathy and dialogue process; the hierarchical strategy selection module adopts a hierarchical classification algorithm to train the corresponding classification module; the symptom unit is composed of a diagnosis module and a symptom exploration module. The diagnosis module is used to track the dialogue state. The symptom exploration module uses a classification model and a dynamically adjusted classifier to prevent the symptoms that have been concluded from appearing in the classification results; the interaction unit uses the natural language understanding and generation capabilities of the large language model, combines the dialogue scene and state for role-playing, and completes human-computer interaction in the form of natural dialogue.
2. The depression diagnosis and treatment intelligent system based on non-sensing measurement and state tracking as claimed in claim 1, characterized in that: The strategy design module includes a non-sensing detection component, an empathic response component, and a dialogue process management component; The non-sensing exploration component includes: preset questions: designing open-ended questions related to daily life, guiding through natural conversations, avoiding directly touching on sensitive topics, and obtaining valuable information without alerting users; Referential questions: Ask questions in an indirect way, using third-person or hypothetical situations to guide users to spontaneously share their feelings and ideas; Tolerant questions: Ask questions in an inclusive and understanding tone to lower users' psychological defenses and encourage them to express themselves candidly; Request clarification: When users provide vague or ambiguous information, politely ask for clarification to obtain information about their emotions and psychological state; The empathic response component includes, guidance: guiding users to explore their inner world through appropriate language and tone, helping users understand and express their emotions; Connection: Establish emotional connection, express understanding and empathy for users’ feelings, and enhance trust and sense of security; Feedback: Provide positive and supportive feedback in a timely manner, respond to users' emotional changes, and help users alleviate negative emotions; The dialogue flow management component includes,post-comment transfer: after commenting on the user's expression, direct the topic to other areas to avoid staying on topics that may cause discomfort for a long time; Bridging: Use transitional language and techniques to establish natural connections between different topics and ensure the coherence and fluency of the conversation.
3. The depression diagnosis and treatment intelligent system based on non-sensing measurement and state tracking as claimed in claim 1, characterized in that: The hierarchical strategy selection module adopts a hierarchical classification algorithm to construct a two-stage strategy selection module; the module takes the user's conversation history as input and outputs the selected fine-grained strategy, which specifically includes two stages: coarse-grained strategy selection and fine-grained strategy selection. Its model input is expressed as D = u1, u2, ..., u T , where u t represents the tth round of dialogue, T represents the number of dialogue rounds; Its output can be expressed as a fine-grained strategy f * .
4. The depression diagnosis and treatment intelligent system based on non-sensing measurement and state tracking as claimed in claim 1, characterized in that: The symptom unit consists of a diagnosis module and a symptom exploration module, which work together to evaluate and identify the nine core symptoms of depression through dialogue interaction with the user; The diagnosis module uses the dialog state tracking technique to fill the slots of these nine symptoms until all symptom states are determined.
5. The depression diagnosis and treatment intelligent system based on non-sensing measurement and state tracking as claimed in claim 1, characterized in that: The diagnostic module uses the dialogue state tracking technology to track the nine symptoms of depression. The symptom set S = {s1, s2, ..., s9} is set to correspond to the nine symptoms of depression: depressed mood (s1), loss of interest (s2), loss of energy (s3), self-guilt (s4), suicidal tendency (s5), inattention (s6), sleep problems (s7), appetite or weight changes (s8), psychomotor agitation or retardation (s9); each symptom state v i The value is True, False, or Unknown, indicating that the symptom exists, the symptom does not exist, and the symptom status is unknown, respectively; The input is the conversation history D = {u1,u2,…,u T } and the previous round's condition status The output is the symptom status after the current round of update Longformer-zh is used as the base model to encode long conversation histories; Serialize the conversation history into text input X = Concat(u1,u2,…,u T ), and then convert the text into a word vector sequence {x1,x2,…,x N }, where N is the total number of words in the text; Longformer-zh uses sparse attention mechanism, including local window attention and global attention, to efficiently encode long sequences and obtain the hidden state sequence {h1,h2,…,h N }; In order to capture the global semantic information of the dialogue, a global attention mechanism is used to convert the hidden state h at the [CLS] position CLS As a representation of the entire conversation; for each symptom s i , design a three-classifier to predict symptom status The input of the symptom classifier is h CLS and the symptom status of the previous round are embedded Combine the two to get a comprehensive representation The output of the symptom classifier is expressed as: Among them, W i is the weight matrix of the classifier, with a dimension of d×3, where d is the comprehensive representation z i The dimension of b i is the bias vector, T is the transpose of the matrix, and the probability distribution of each symptom state is calculated by the Softmax function: P i =Softmax(o i ) in, Based on the predicted probability, select the category with the highest probability as the symptom status: When the model cannot make a clear judgment on a symptom, the status of the symptom remains unknown and the slot is not updated; During the training process, the loss function for symptom state prediction is multi-class cross-extraction loss It is expressed as: in, Symptoms i The one-hot encoding of the true label.
6. The depression diagnosis and treatment intelligent system based on non-sensing measurement and state tracking as claimed in claim 1, characterized in that: The symptom exploration module selects the next symptom to be explored based on the current conversation history and symptom status. j Since the concluded symptoms will no longer appear in the classification results, the symptom exploration module needs to find the symptom set in the Unknown state. Use Longformer-zh to encode the dialogue history and get the global representation h XLS , change the current symptom status V (t) Map h to vector v through the embedding layer cLs Combined with v, we get the comprehensive representation z = [h CLS ;v]0; The symptom exploration module is modeled as |S ′ | multi-classification problem on categories, the output expression of the classifier is: Among them, W s is the weight matrix, with dimension d×|S ′ |, b s is the bias vector, and the probability of each symptom is calculated by the Softmax function, which is expressed as: Select the symptoms with the highest probability j As the next symptom, the expression is: The loss function of the symptom search module is multi-class cross entropy loss, expressed as: Among them, y j One-hot encoding for the true next symptom; During model training, the diagnosis module and symptom exploration module are jointly trained, and the total loss function is expressed as: Among them, λ is the trade-off coefficient, which is used to balance the losses of the two modules. During the optimization process, the Adam optimizer is used to update the model parameters.
7. The depression diagnosis and treatment intelligent system based on non-sensing measurement and state tracking as claimed in claim 1, characterized in that: The interaction unit uses a large language model Qwen2-72b-Instruct to interact with the user in natural language. The input of the unit includes the symptoms to be explored. j , the fine-grained strategy f * And the conversation history D = {u1,u2,…,u T }, and the output is the natural language response r generated based on these inputs t , used to interact with users.