A method for training a depression disorder detection model
Through the dynamic learning class, the threshold and domain alignment loss function are customized, the catastrophic forgetting problem of the depression disorder detection model when learning new data is solved, achieving higher detection accuracy and efficiency.
Patent Information
- Application Number
- CN202411048884.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-20
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-03-20
AI Technical Summary
The prior art is difficult to effectively solve the catastrophic forgetting problem of models when learning new data in depression disorder detection, especially when old data is inaccessible.
By using JS divergence and dynamic learning thresholds for dynamic learning of class information in the training dataset, samples with domain similarity and domain dissimilarity are selected, and domain incremental learning is performed through domain alignment loss function to alleviate the forgetting problem.
Effectively retain the previous knowledge of the model when learning new data, alleviates catastrophic forgetting, and improves the accuracy and efficiency of detection of depression disorders.
Smart Images

Figure CN118866260B_ABST
Abstract
Description
[0001] This application is a divisional application. The application number of the original application is 202410316692.4, the application date is March 20, 2024, and the name of the invention is "Depression disorder detection model training method and electronic device based on domain incremental learning". Technical Field
[0002] The present invention relates to the technical field of data processing, and more particularly to a method for training a depression disorder detection model. Background Art
[0003] Major depressive disorder (MDD) is a common mental health disorder that affects the quality of life of millions of people. Accurate and early diagnosis of depression is essential for timely intervention and effective treatment. In recent years, the application of deep learning technology in the medical field has made remarkable progress, providing new possibilities for the diagnosis and monitoring of depression. Although current deep neural networks have shown promising performance in MDD detection tasks, these models require access to all available data at the same time. In the real world, different institutions usually collect clinical data at different times, making it unavailable to access all data in the initial training phase. Therefore, domain incremental learning (DIL) has been turned to handle continuous data streams, which aims to adapt the model to new data without affecting its performance on historical tasks. Although this may seem easy for humans, well-trained models often suffer from "catastrophic forgetting", that is, they forget previously learned knowledge when they acquire new information. Existing mainstream DIL methods assume that old data can be easily accessed during model training, which either retains a small portion of historical data or uses generative replay techniques through statistical properties. However, the reality is that "accessibility to old data may be limited" for reasons including privacy issues (such as biometric datasets) or unexpected data loss (such as data corruption), so usually only well-trained models can be accessed. This makes it impractical to use the original training data for reference or fine-tuning.
[0004] Domain Incremental Learning (DIL) is a method in the field of machine learning that is used to handle tasks of continuous learning in a constantly changing data domain. In the detection of depressive disorders, domain incremental learning becomes particularly important because depressive disorder data usually appears in the form of continuous data streams, which may come from different time points, sources or environments, so a method is needed to adapt to this constantly changing data. When the model learns a new data domain, it tends to forget the previously learned information. This is because when traditional machine learning models receive new data, they completely adjust themselves to adapt to the feature distribution of the new data, resulting in the forgetting of the knowledge of the old data. In order to alleviate the problem of catastrophic forgetting, it first learns a threshold for each category based on the difference in probability distribution, and based on this selection determines the samples that are similar to the previous domain and the samples that are not similar. These similar samples are used to retain historical knowledge, further forcing dissimilar samples to be close to the samples, thereby alleviating the gap between these samples. In order to meet these challenges, domain incremental learning methods become crucial in the detection of depressive disorders. The present invention allows the model to retain previously learned information when learning new data, thereby alleviating the problem of catastrophic forgetting. In addition, some innovative methods, such as using dynamically adjusted thresholds and intra-domain alignment, help to better handle class imbalance and preserve privacy.
[0005] In order to bridge the gap between practical needs and domain incremental learning frameworks, data-free domain incremental learning (DF-DIL) can be utilized. Mainstream DF-DIL methods usually utilize generative models to synthesize samples to adapt to new tasks while maintaining performance on previous tasks. However, in practical settings, there is usually only the availability of a well-trained previous model, so historical information cannot be utilized in practical applications. It becomes crucial to adapt and incrementally learn without relying on historical information. Another issue of concern is "class imbalance", which often occurs in major depression MDD data. In fact, synthetic data inherits the imbalanced characteristics of historical data. Synthetic data may have a category distribution similar to previous data, where the samples of the minority class are limited and the samples of the majority class are abundant. This cyclic effect further exacerbates the class imbalance problem, causing these methods to perform poorly in the major depression MDD detection task.
[0006] Therefore, how to provide a depressive disorder detection model training method is an urgent problem that technicians in this field need to solve. Summary of the invention
[0007] In view of this, the present invention provides a depressive disorder detection model training method to solve the problems existing in the above-mentioned prior art.
[0008] In order to achieve the above object, the present invention provides the following technical solutions:
[0009] In one aspect, the present invention provides a method for training a depression disorder detection model, comprising the following steps:
[0010] Get the training dataset;
[0011] The acquired training data set is trained to obtain a feature extraction network model;
[0012] Obtaining label prediction results on samples of different categories in the training data set through the feature extraction network model;
[0013] Use JS divergence to compare the differences between prediction results;
[0014] Dynamically learn class-customized thresholds using JS divergence and category information in the training dataset;
[0015] Sample selection is performed using a threshold customized for each class in the training dataset;
[0016] Align the sample selection results within the domain to distinguish sample similarities;
[0017] A domain alignment loss function is obtained according to sample similarity, and domain incremental learning is performed through the domain alignment loss function, thereby obtaining a trained depression disorder detection model.
[0018] Optionally, the training data set includes information about users with depression and users without depression collected from a social platform.
[0019] Optionally, the acquired training data set is trained to obtain a feature extraction network model as follows:
[0020]
[0021] in, and is through the nth domain D n Trained feature extraction networks and classification models; represents the extracted features; represents label prediction; CE(·) represents the standard cross entropy loss.
[0022] Optionally, obtaining label prediction results on samples of different categories in the training data set through the feature extraction network model includes:
[0023] Predict the true label Decomposed into major depressive disorder and health categories, the expression is:
[0024]
[0025] in, It is indicated as a major depressive disorder category; Indicated as health category;
[0026] Retrain dataset X using feature extraction network model n The features extracted from the expression are:
[0027]
[0028] in, It means that by taking the feature extractor Apply to D n The resulting embedding is is a classifier Label prediction results on samples of different categories.
[0029] Optionally, comparing the differences between the prediction results using JS divergence includes:
[0030]
[0031] Among them, D KL (·) represents KL divergence, and Represent the predicted differences between major depressive disorder samples and healthy samples, respectively.
[0032] Optionally, the dynamically learning a class-customized threshold using JS divergence and category information in a training data set includes:
[0033]
[0034] Among them, μ(·) and σ(·) represent the mean and standard deviation, α m and α h Represents a hyperparameter for tuning the class customization threshold.
[0035] Optionally, the sample selection using a threshold customized for each class in the training data set includes:
[0036]
[0037] in, Represents a domain-similar sample set of severe depressive disorders, Indicates domain dissimilar severe depressive disorder sample set, Represents a domain-similar health class sample set, represents the domain-dissimilar health class sample set, represents the samples predicted to be depressive disorders in the nth domain, represents the samples predicted to be healthy subjects in the nth domain, represents the i-th depression disorder sample, represents the i-th healthy subject sample.
[0038] Optionally, the step of aligning the sample selection results within a domain to distinguish sample similarities includes:
[0039]
[0040] in, Represented as a sample similar to the previous domain, Denoted as samples that are dissimilar to the previous domain.
[0041] Optionally, the domain alignment loss function obtained according to sample similarity is:
[0042]
[0043] Where MMD(·) represents the maximum mean difference loss, It is expressed as the distance between similar samples and dissimilar samples.
[0044] MMD: Maximum Mean Discrepancy.
[0045] On the other hand, the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of a method for training a depressive disorder detection model based on domain incremental learning are implemented.
[0046] It can be seen from the above technical solution that compared with the prior art, the present invention discloses a method for training a depressive disorder detection model. The present invention first uses a feature extraction network model trained on new data and a previous model to derive their respective feature representations, which are then input into a classifier to generate corresponding predictions. By calculating the prediction difference between major depressive disorder class samples and healthy class samples, the category-customized threshold is adaptively learned to distinguish between samples with domain similarity and samples with dissimilar domains. In addition, these determined domain-similar samples are used to simulate the data of the previous domain to retain previous knowledge, thereby effectively narrowing the gap between these domains. This alignment process is conducive to making the features extracted from each domain more compact, thereby significantly enhancing the adaptability to new data and alleviating the problem of catastrophic forgetting, which is conducive to improving the accuracy and efficiency of depressive disorder detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0048] Figure 1 It is a schematic diagram of the method flow of the present invention;
[0049] Figure 2 It is a schematic diagram of the overall framework of the training process of the present invention. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] The purpose of the present invention is to provide a method for training a depression disorder detection model, including obtaining a training data set, inputting a current domain and a previous domain, performing feature extraction and prediction, dynamically learning a class-customized threshold using JS divergence and category information in the training data set, selecting samples for each class in the training data set using the threshold customized for the corresponding class, aligning the sample selection results within the domain, distinguishing sample similarities, and effectively narrowing the gap between these domains. Such an alignment process encourages the features extracted from each domain to become more compact, thereby significantly improving the adaptability to new data, reducing catastrophic forgetting, and being conducive to improving the accuracy and efficiency of depression disorder detection.
[0052] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0053] See also Figure 1 The embodiment of the present invention discloses a method for training a depression disorder detection model, comprising the following steps:
[0054] Get the training dataset;
[0055] The acquired training data set is trained to obtain a feature extraction network model;
[0056] The label prediction results of samples of different categories in the training data set are obtained through the feature extraction network model;
[0057] Use JS divergence to compare the differences between prediction results;
[0058] Dynamically learn class-customized thresholds using JS divergence and category information in the training dataset;
[0059] Sample selection is performed using a threshold customized for each class in the training dataset;
[0060] Distinguish sample similarities based on sample selection results;
[0061] The domain alignment loss function is obtained according to the sample similarity, and domain incremental learning is performed through the domain alignment loss function to obtain a trained depression disorder detection model.
[0062] In a specific embodiment, the training data set includes information of users with depression and users without depression collected from a social platform.
[0063] Specifically, many deep learning tasks use thresholds to distinguish whether samples meet specific criteria. Traditional methods usually design a fixed manual threshold, which has proven its effectiveness in specific scenarios. This fixed threshold learning paradigm can be established based on prior knowledge or domain expertise. In scenarios where the distribution and characteristics of depression data are relatively stable, these fixed thresholds can serve as reliable indicators for classification or decision-making processes. However, in dynamic and changing data environments, the underlying data distribution may change over time, and fixed thresholds may not be sufficient to adapt to dynamic data patterns. Therefore, an adaptive threshold learning paradigm is used to reduce human interference and adaptively optimize according to the loss function during training. This method can adapt to changing data dynamics and changing task requirements. In addition, in specific depressive disorder detection tasks, the class imbalance problem may lead to the situation where samples of minority classes fail to meet the threshold criteria and are subsequently ignored. This dilemma may lead to the exclusion of samples of minority classes in subsequent steps, resulting in the retained data being mainly composed of samples of majority classes. In addition, this phenomenon exacerbates the class imbalance problem in the data set. To this end, the present invention provides an adaptive class customized threshold learning strategy, which individually customizes the threshold according to the unique attributes inherent in the corresponding class. This approach establishes a more sophisticated and effective sample selection mechanism that meets the specific requirements of each category in a specific task. Therefore, it mitigates the inherent bias caused by class imbalance. In this way, an effective sample identification strategy is successfully established. Such a strategy not only helps to address the challenges brought by class imbalance, but also ensures that the subsequent modeling process remains robust across all categories without being biased towards any specific category.
[0064] Specifically, feature extraction is first performed. In order to complete the adaptive threshold learning, the input data D in the nth domain is first used. n Train to obtain its feature extraction network:
[0065]
[0066] in, and is through the nth domain D n Trained feature extraction network and classification model. To simplify the discussion, we use the symbol express. Indicates its label prediction, and the abbreviation symbol will be used below CE(·) represents the standard cross entropy loss. To facilitate class-customized threshold learning, we transform Decomposition into major depressive disorder and healthy people As for historical information, since the previous data D (n-1) Completely unavailable, only previously trained models can be accessed Then, the feature extraction network is used to retrain the data X n Extract features from the Further generate its label probability distribution. The details are as follows:
[0067]
[0068] in, It means that by taking the feature extractor Apply to D n The resulting embedding is denoted as X′ n . is a classifier Label predictions on samples of different categories. Next, JS divergence is used to compare the difference between the two predictions.
[0069]
[0070] Among them, D KL (·) represents KL divergence, and Represent the predicted differences between major depressive disorder samples and healthy samples, respectively.
[0071] Specifically, HC was a healthy control sample, and MDD was a major depressive disorder sample.
[0072] Next, the JS divergence and category information are used to dynamically learn a class-customized threshold, which is used to determine whether the sample is similar to the previous domain. Its specific definition is as follows.
[0073]
[0074] Among them, μ(·) and σ(·) represent the mean and standard deviation, αm and α h Represents a hyperparameter for tuning the class customization threshold.
[0075] In a specific embodiment, the intra-domain alignment includes the following:
[0076] Continuous data streams are a common phenomenon in real-world scenarios. When a model is exposed to incoming training data, it adjusts its parameters to adapt to the new information. When trained on a new task, the model tends to forget previously acquired knowledge. This phenomenon is known as catastrophic forgetting, which severely hinders the model's ability to retain previous domain information when it focuses on learning the current task. This challenge becomes particularly acute when dealing with domains characterized by changing data distributions and dynamically changing tasks. Therefore, addressing this issue is critical to developing models that can continuously learn and adapt over time while maintaining stable performance on historical tasks. The model is restricted to access only a trained model and cannot access any other information. This poses a significant challenge to addressing the forgetting problem. To address this issue, an intra-domain alignment module is further developed, which utilizes the trained model to identify sets of similar and dissimilar samples in new training data. Subsequently, the information in these similar samples is explored to build an approximation of the feature distribution in the historical data. This approach attempts to narrow the domain gap between the existing available data and the inaccessible historical information, thereby mitigating the harmful effects of forgetting. The details of the intra-domain alignment are as follows.
[0077] Sample identification identifies data points by predefined criteria or attributes, revealing relevant patterns, relationships or features according to a specific learning goal. Traditional selection methods usually use a uniform threshold across all classes. However, the present invention attempts to learn a class-customized threshold in the task, as shown in formula (4). Therefore, in the subsequent stages of the method, the model uses the corresponding custom threshold for each class for sample selection, which is defined as follows:
[0078]
[0079] In this way, domain-similar MDD sample sets are effectively distinguished. Domain-dissimilar MDD sample set Domain similar HC sample set The HC sample set is not similar to the domain represents the samples predicted to be depressive disorders in the nth domain, represents the samples predicted to be healthy subjects in the nth domain, represents the i-th depression disorder sample, represents the i-th healthy subject sample.
[0080]
[0081] The symbol ∪ is the union operation. Represented as a sample similar to the previous domain, Denoted as samples that are dissimilar to the previous domain.
[0082] In the above manner, the present invention effectively distinguishes samples that show similarities and dissimilarities with the previous domain.
[0083] Traditional domain incremental learning methods usually follow a unified technical route, either replaying historical samples or synthesizing new samples based on statistical information. This strategy aims to preserve previously acquired knowledge and alleviate the challenge of catastrophic forgetting. However, the availability of such information is limited within the scope of the task, and thus faces challenges in effectively addressing the specific challenges at hand. Therefore, the present invention solves an alternative solution to this dilemma when access to historical data is limited. Specifically, using Simulate the characteristic distribution of historical data. More specifically, use existing data to approximate the characteristic distribution of historical samples.
[0084] In fact, It is used to retain prior knowledge and design an intra-domain alignment module based on it to encourage Samples are closer in feature space Thus bridging the gap between the historical data stream and the incoming data stream. Such a domain alignment loss is defined as follows:
[0085]
[0086] Among them, MMD(·) represents the Maximum Mean Discrepancy maximum average difference loss, It is expressed as the distance between similar samples and dissimilar samples.
[0087] In this way, the present invention adopts a unique alignment mechanism to enable the model to adapt to scenarios where historical data is inaccessible and achieve excellent results.
[0088] On the other hand, an embodiment of the present invention discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of a method for training a depressive disorder detection model based on domain incremental learning are implemented.
[0089] As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0090] Through the above technical solution, see Figure 2The present invention first inputs the current domain and the previous domain, performs feature extraction and prediction, and uses the feature extraction network trained on the newly arrived data and previous model to derive their respective representations, and then generate corresponding predictions using the two classifiers learned from the nth domain. Next, in order to retain previous information and promote class balance, the category customization threshold is adaptively learned by calculating the difference between the two predictions. Therefore, samples that show similarity to the (n-1)th domain and samples that show different similarities are distinguished by the learned threshold within their category. In addition, these determined domain similarity samples are used to simulate the distribution of data features in the (n-1)th domain to retain previous knowledge and effectively narrow the gap between these domains. Such an alignment process encourages the features extracted from each domain to become more compact, thereby significantly improving the adaptability to new data, reducing catastrophic forgetting, and is conducive to improving the accuracy and efficiency of depressive disorder detection. Among them, the present invention also has an accessible state, and specifically a lock symbol can be used to represent the accessibility state of data or models. When the lock is in a closed state, it indicates that the corresponding data or model is currently unavailable or unavailable. When the lock is in an open state, it means that the relevant data or model is available and can be accessed or obtained by the user.
[0091] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0092] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for training a depression disorder detection model, characterized in that: The following steps are involved: Acquire a training data set and a training model of a previous domain; wherein the training data set includes information of users with depression and users without depression collected from a social platform; The acquired training data set is trained to obtain a feature extraction network model; The model trained in the current domain and the model trained in the previous domain are respectively inputted into the feature extraction network model, and the predicted values are compared to obtain the label prediction results on samples of different categories in the training data set; Use JS divergence to compare the differences between prediction results; Dynamically learn class-customized thresholds using JS divergence and category information in the training dataset; For each class in the training dataset, sample selection is performed using a threshold customized for the corresponding class; specifically, an intra-domain comparison module is developed to use the trained model to identify similar and dissimilar sample sets in new training data, and then the information in similar samples is explored to build an approximation to the feature distribution of historical data; Align the sample selection results within the domain; specifically, based on samples similar to the previous domain Design an intra-domain alignment module to encourage samples that are dissimilar to the previous domain Closer in feature space A domain alignment loss function is obtained according to sample similarity, and domain incremental learning is performed through the domain alignment loss function, thereby obtaining a trained depression disorder detection model; The sample selection results are aligned within the domain to distinguish sample similarities, including: in, Represented as a sample similar to the previous domain, Represented as samples that are dissimilar to the previous domain; The domain alignment loss function obtained according to sample similarity is: Where MMD(·) represents the maximum mean difference loss, It is expressed as the distance between similar samples and dissimilar samples.
2. A method for training a depression disorder detection model according to claim 1, characterized in that: The obtained training data set is trained to obtain a feature extraction network model: in, and is through the nth domain D n Trained feature extraction networks and classification models; represents the extracted features; represents label prediction; CE(·) represents the standard cross entropy loss.
3. A method for training a depression disorder detection model according to claim 1, characterized in that: The label prediction results on samples of different categories in the training data set are obtained through the feature extraction network model, including: Predict the label According to the category, it is decomposed into major depressive disorder and health, and the expression is: in, It is indicated as a major depressive disorder category; Indicated as health category; Retrain dataset X using feature extraction network model n The features extracted from the expression are: in, It means that by taking the feature extractor Apply to D n The resulting embedding is is a classifier Label prediction results on samples of different categories.
4. A method for training a depression disorder detection model according to claim 1, characterized in that: The use of JS divergence to compare the differences between the prediction results includes: Among them, D KL (·) represents KL divergence, and Represent the predicted differences between major depressive disorder samples and healthy samples, respectively.
5. A method for training a depression disorder detection model according to claim 1, characterized in that: The method of dynamically learning a class-customized threshold using JS divergence and category information in a training data set includes: Among them, μ(·) and σ(·) represent the mean and standard deviation, α m and α h Represents a hyperparameter for tuning the class customization threshold.
6. A method for training a depression disorder detection model according to claim 1, characterized in that: The sample selection is performed using a threshold customized for each class in the training data set, including: in, Represents a domain-similar sample set of severe depressive disorders, Indicates domain dissimilar severe depressive disorder sample set, Represents a domain-similar health class sample set, represents the domain-dissimilar health class sample set, represents the number of samples predicted to be depressive disorders in the nth domain, represents the number of samples predicted to be healthy subjects in the nth domain, represents the i-th depression disorder sample, represents the i-th healthy subject sample.
Citation Information
Patent Citations
Depressive disorder detection model training method based on domain incremental learning and electronic equipment
CN117912640A