Semi-supervised classification and clustering method for predicting categories of mental diseases
By using semi-supervised classification and clustering methods in brain image data processing, using deep neural networks and gradient descent methods to optimize the loss function and generate high-quality pseudo-labeled data, the problems of small sample size and high-dimensional characteristics in brain image data processing in the prior art are solved, and the accuracy of mental illness category prediction is significantly improved.
Patent Information
- Application Number
- CN202510057658.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-04-25
AI Technical Summary
The prior art faces the problems of small sample size and high feature dimensions in the diagnosis of mental illness based on brain imaging data. The traditional unsupervised clustering method relies on preset features, making it difficult to mine the deep structure of the data, and the effect of deep clustering method is limited when labeling data is scarce.
A semi-supervised classification and clustering method is adopted to simultaneously realize semi-supervised classification and clustering in a unified model through deep neural networks. Feature selection and feature extraction methods are used to extract features from brain image data, and iteratively optimize classification loss and clustering loss in combination with gradient descent method to generate high-quality pseudo-labeled data to improve the model's learning efficiency for labelless data.
It effectively overcomes the problem of low classification accuracy caused by small sample size in mental illness diagnosis, solves the problem that traditional clustering algorithms rely on preset features to explore the deep structure of data, significantly improves the clustering effect, and improves the accuracy of mental illness category prediction.
Smart Images

Figure CN119888359A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of medical image processing, and in particular relates to a semi-supervised classification and clustering method for predicting mental illness categories. Background Art
[0002] The diagnosis of mental illness has traditionally relied on clinical assessment, so the diagnosis is highly subjective and difficult to accurately reveal the underlying pathological mechanisms. For example, the key symptoms of schizophrenia (such as hallucinations, delusions, and disordered thinking) mainly rely on the subjective description of patients and the subjective assessment of clinicians, highlighting the importance of developing more objective diagnostic methods. In recent years, researchers have gradually explored artificial intelligence technologies based on brain imaging data to identify biological markers and distinguish patients from healthy people. However, classification methods based on brain imaging data, especially deep learning methods, face the challenges of small sample size and high-dimensional features. Judging the disease category of patients based on traditional unsupervised clustering often relies on preset features, which makes it difficult to mine the deep structure of the data. Although existing deep clustering methods can automatically learn features, their effectiveness is limited when labeled data is scarce. Given the difficulty of obtaining a large number of high-quality brain imaging samples and accurate clinical diagnosis, it is particularly important to develop semi-supervised learning methods suitable for small samples and high-dimensional data.
[0003] Existing diagnostic methods for mental illness are highly subjective, so it is particularly important to combine brain imaging data and artificial intelligence technology for auxiliary diagnosis of mental illness and imaging marker mining. When training classifiers based on brain imaging data to distinguish different groups, we often face the problems of limited sample size and high feature dimensions. Traditional unsupervised clustering methods usually require features to be defined in advance, which limits the comprehensive mining and understanding of the deep structure of the data. Although deep clustering techniques can automatically learn features, they often find it difficult to achieve optimal clustering effects in the absence of labeled data. Summary of the invention
[0004] In view of these problems, the present invention provides a semi-supervised classification and clustering method for predicting the type of mental illness. The method realizes semi-supervised classification and clustering in a unified model, and can effectively identify the type of mental illness of the patient based on the brain imaging data.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] A semi-supervised classification and clustering method for predicting mental illness categories, comprising the following steps:
[0007] Step 1, preprocessing the brain image data of the subjects to extract the brain image measurement of each subject, extracting features from the brain image measurement using feature selection or feature extraction methods, and constructing a training data set;
[0008] Training dataset D tr Includes an initial labeled dataset and an unlabeled dataset Among them, the sample size m of unlabeled data is much larger than the sample size n of labeled data;
[0009] Initial labeled dataset D l middle and Represent the features of sample i and the corresponding category labels respectively;
[0010] Unlabeled dataset D u middle Represents the feature data of unlabeled sample j; unlabeled dataset D u Contains only feature data for each unlabeled sample, without associated category labels;
[0011] Step 2: training semi-supervised classification and clustering models;
[0012] Step 2.1, design the structure of the deep neural network θ according to the characteristics of the feature data;
[0013] Step 2.2, train the deep neural network θ by iteratively optimizing the classification loss and clustering loss combined with the gradient descent method;
[0014] Step 2.2.1, use the classification loss function L1 to train the deep neural network θ on the labeled dataset;
[0015] The labeled dataset is composed of the initial labeled dataset D l With the newly generated high-quality pseudo-labeled dataset Together, they constitute represents the high-quality pseudo-label assigned to the unlabeled sample k, and g represents the total number of high-quality pseudo-label samples; initially, the high-quality pseudo-label dataset D p Empty; with the iteration of the model, a high-quality pseudo-labeled dataset will be gradually generated;
[0016] The classification loss function L1 is expressed as:
[0017] L1(D l ,D p )=L ce (D l )+L reg (D l )+β p *[L ce (D p )+L reg (D p )]
[0018] Among them, L ce (D l ) represents the initial labeled dataset D l The cross entropy loss on L is used to measure the difference between the model's prediction of the initial labeled data and the actual label; reg (D l ) represents the initial labeled dataset D l The class balance loss on L is designed to promote the model to achieve a balanced classification effect between different categories. By adjusting the model's prediction, it reduces the preference for the majority class, thereby improving the recognition ability of the minority class. ce (D p ) represents a high-quality pseudo-labeled dataset D p The cross entropy loss on L reg (D p ) represents a high-quality pseudo-labeled dataset D p The class balance loss on p Dynamic weights for high-quality pseudo-labeled data;
[0019]
[0020] Among them, N * Indicates the number of samples in the labeled dataset; is a binary indicator variable that indicates whether sample i is labeled as category c. It indicates the classification probability that the model predicts that sample i belongs to category c, where C is the total number of categories;
[0021]
[0022] Among them, π c =1 / C;
[0023] Step 2.2.2, retrain the deep neural network θ trained with the classification loss function L1 using the clustering loss function L2 on the unlabeled data set and the labeled data set;
[0024] The unlabeled data and the labeled data are input into the deep neural network θ trained by L1 to generate the embedded features of these samples; the embedded features of the unlabeled samples will be used as the input features in the clustering analysis, while the embedded features of the labeled samples are used to generate the initialization centers of the clusters to guide the clustering process;
[0025] Based on the constrained seed K-means clustering algorithm, clustering is performed by combining the initialization center of the cluster and the embedded features of the unlabeled samples; finally, the clustering loss L2 is calculated based on the clustering results, and the loss is used to further train the deep neural network θ;
[0026] The clustering loss function L2 is expressed as:
[0027] L2(u all ,D u )=KL(P||Q)+L reg_u (D u )
[0028] Among them, KL(P||Q) means using KL divergence to measure the difference between the target distribution P and the soft assigned distribution Q; u all Represents the cluster center of all categories; L reg_u (D u ) represents the unlabeled dataset D u Class balancing loss;
[0029] KL(P||Q) is defined as follows:
[0030]
[0031] In the unlabeled dataset D u In the above example, Q is the soft distribution, which indicates the probability distribution predicted by the model based on the embedding features of unlabeled samples; for D u Unlabeled samples j,p jc represents the probability that the unlabeled sample j belongs to category c; q jc Specifically represents the centroid u of the unlabeled sample j and the category c c The similarity between them is measured by the Student's t distribution kernel and is calculated as follows:
[0032]
[0033] in, represents the embedded features of the unlabeled sample j using the output of the second-to-last layer of the deep neural network θ;
[0034] P is the target distribution, which represents the adjusted expected distribution and is used to guide model optimization to make its prediction more accurate. Its calculation formula is:
[0035]
[0036] in, is the soft clustering frequency of category c, which represents the cumulative soft assignment probability of samples in this category;
[0037]
[0038] in, Represents the feature representation of the unlabeled sample j by calculating and the cluster center u of category c c The Pearson correlation between them is used to determine the probability that the unlabeled sample j belongs to category c;
[0039] When calculating the initial cluster centers When , use the initial labeled samples and high-quality pseudo-labeled samples as seeds and assign different weights; calculate the initial centroid The formula is:
[0040]
[0041] in, and Represents the initial labeled data of category c and high-quality pseudo-labeled data The number of samples; weight β c Dynamically adjust as the iterative process progresses to ensure more efficient use of high-quality pseudo-labeled data;
[0042] Step 2.2.3, use the L2 trained deep neural network θ to train the unlabeled dataset D u All unlabeled samples in are classified and clustered, and then the classification-clustering consistency measure M is used c Evaluate classification predictions and clustering predictions to filter out samples with high-quality pseudo-labels;
[0043] Setting the adaptive threshold classification threshold and clustering threshold To evaluate the classification and clustering confidence of high-quality pseudo-labeling when unlabeled samples are classified as category c; is the classification threshold determined based on the average of the classification prediction values of category c, is the clustering threshold determined based on the average of the cluster prediction values of category c; if the classification prediction result and cluster prediction result of an unlabeled sample are the same and have high confidence in both predictions, the predicted label category of the sample is considered to be a high-quality pseudo label;
[0044] When M of an unlabeled sample j c When the value is equal to 1, the unlabeled sample j is given a high-quality pseudo label c.
[0045]
[0046] in, Represents the classification prediction probability distribution of unlabeled sample j; Represents the global cluster prediction probability distribution of unlabeled sample j; this probability distribution is obtained by calculating the feature representation of unlabeled sample j With all cluster centers u all The Pearson correlation between
[0047]
[0048] in, represents an indicator function; Express satisfaction The number of unlabeled samples; Express satisfaction The number of unlabeled samples;
[0049] Step 2.2.4, using the newly generated high-quality pseudo-labeled dataset, continue to perform step 2.2.1 until the classification loss function L1 and the clustering loss function L2 converge;
[0050] Step 3: Preprocess the brain image data of the new subject and extract brain image features; then input it into the trained semi-supervised classification and clustering model for analysis, and output the predicted results of its mental illness category.
[0051] Furthermore, the preprocessing includes inter-layer correction, head motion correction, spatial normalization and spatial smoothing.
[0052] Compared with the prior art, the present invention has the following advantages:
[0053] The present invention uses an innovative semi-supervised learning method to fully combine limited labeled data and a large amount of unlabeled data. It not only effectively overcomes the problem of low classification accuracy in the diagnosis of mental illness due to the small sample size, but also solves the problem that traditional clustering algorithms rely on preset features and are difficult to mine the deep structure of data. In addition, the present invention also effectively alleviates the problem of limited performance of deep clustering methods when labeled data is scarce, thereby significantly improving the clustering effect.
[0054] The present invention adopts an innovative dual optimization strategy, firstly improving the learning efficiency of the model for labeled data by optimizing the classification loss, and then further enhancing the model's clustering ability for unlabeled data by optimizing the clustering loss. Through this iterative optimization process, the model can be continuously adjusted and improved at each step, thereby achieving more accurate prediction of mental illness categories, making full use of the advantages of labeled and unlabeled data, and improving overall diagnostic accuracy.
[0055] The present invention uses an innovative method to identify and utilize high-quality pseudo-labeled samples, and effectively avoids the interference of low-quality pseudo-labels by screening pseudo-labels with high prediction confidence in unlabeled samples. This strategy not only improves the learning efficiency of the model for unlabeled data, but also enhances the model's ability to identify types of mental illness, thereby providing more accurate diagnostic support for doctors and professionals. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 is a flow chart of a semi-supervised classification and clustering method for predicting mental illness categories of the present invention;
[0057] Figure 2 It is a schematic diagram of the T value results of the two-sample t-test between different categories of functional connectivity data;
[0058] Figure 3 Schematic diagram of the individual average connection strength of different categories of functional connections. DETAILED DESCRIPTION
[0059] In order to gain a deeper understanding of the present invention, we will provide a comprehensive and detailed description of the present invention. However, the present invention has multiple implementations and is not limited to the specific examples listed herein. The presentation of these examples is intended to deepen the comprehensive understanding of the disclosure of the present invention.
[0060] A semi-supervised classification and clustering method for predicting mental illness categories, comprising the following steps:
[0061] Step 1: Brain imaging data from patients with different mental illnesses were collected from the sites, and preprocessing operations including inter-layer correction, head motion correction, spatial normalization and spatial smoothing were performed on the data to extract the brain functional connectivity features of each subject and construct a training dataset;
[0062] Training dataset D tr Includes an initial labeled dataset and an unlabeled dataset Among them, the sample size m of unlabeled data is much larger than the sample size n of labeled data;
[0063] Initial labeled dataset D l middle and Represent the features of sample i and the corresponding category labels respectively;
[0064] Unlabeled dataset D u middle Represents the feature data of unlabeled sample j; unlabeled dataset D u Contains only feature data for each unlabeled sample, without associated category labels;
[0065] Step 2: training semi-supervised classification and clustering models;
[0066] Step 2.1, design the structure of the deep neural network θ according to the characteristics of the feature data;
[0067] Step 2.2, train the deep neural network θ by iteratively optimizing the classification loss and clustering loss combined with the gradient descent method;
[0068] Step 2.2.1, use the classification loss function L1 to train the deep neural network θ on the labeled dataset;
[0069] The labeled dataset is composed of the initial labeled dataset D l With the newly generated high-quality pseudo-labeled dataset Together, they constitute represents the high-quality pseudo-label assigned to the unlabeled sample k, and g represents the total number of high-quality pseudo-label samples; initially, the high-quality pseudo-label dataset D p Empty; with the iteration of the model, a high-quality pseudo-labeled dataset will be gradually generated;
[0070] The classification loss function L1 is expressed as:
[0071] L1(D l ,D p )=L ce (D l )+L reg (D l )+β p *[L ce (D p )+L reg (D p )]
[0072] Among them, L ce (D l ) represents the initial labeled dataset D l The cross entropy loss on L is used to measure the difference between the model's prediction of the initial labeled data and the actual label; reg (D l ) represents the initial labeled dataset D l The class balance loss on L is designed to promote the model to achieve a balanced classification effect between different categories. By adjusting the model's prediction, it reduces the preference for the majority class, thereby improving the recognition ability of the minority class. ce (D p ) represents a high-quality pseudo-labeled dataset D p The cross entropy loss on L reg (D p ) represents a high-quality pseudo-labeled dataset D p The class balance loss on p Dynamic weights for high-quality pseudo-labeled data;
[0073]
[0074] Among them, N * Indicates the number of samples in the labeled dataset; is a binary indicator variable that indicates whether sample i is labeled as category c. It indicates the classification probability that the model predicts that sample i belongs to category c, where C is the total number of categories;
[0075]
[0076] Among them, π c =1 / C;
[0077] Step 2.2.2, retrain the deep neural network θ trained with the classification loss function L1 using the clustering loss function L2 on the unlabeled data set and the labeled data set;
[0078] The unlabeled data and the labeled data are input into the deep neural network θ trained by L1 to generate the embedded features of these samples; the embedded features of the unlabeled samples will be used as the input features in the clustering analysis, while the embedded features of the labeled samples are used to generate the initialization centers of the clusters to guide the clustering process;
[0079] Based on the constrained seed K-means clustering algorithm, clustering is performed by combining the initialization center of the cluster and the embedded features of the unlabeled samples; finally, the clustering loss L2 is calculated based on the clustering results, and the loss is used to further train the deep neural network θ;
[0080] The clustering loss function L2 is expressed as:
[0081] L2(u all ,D u )=KL(P||Q)+L reg_u (D u )
[0082] Among them, KL(P||Q) means using KL divergence to measure the difference between the target distribution P and the soft assigned distribution Q; u all Represents the cluster center of all categories; L reg_u (D u ) represents the unlabeled dataset D u Class balancing loss;
[0083] KL(P||Q) is defined as follows:
[0084]
[0085] In the unlabeled dataset D u In the above example, Q is the soft distribution, which indicates the probability distribution predicted by the model based on the embedding features of unlabeled samples; for D u Unlabeled samples j,p jc represents the probability that the unlabeled sample j belongs to category c; q jc Specifically represents the centroid u of the unlabeled sample j and the category c c The similarity between them is measured by the Student's t distribution kernel and is calculated as follows:
[0086]
[0087] in, represents the embedded features of the unlabeled sample j using the output of the second-to-last layer of the deep neural network θ;
[0088] P is the target distribution, which represents the adjusted expected distribution and is used to guide model optimization to make its prediction more accurate. Its calculation formula is:
[0089]
[0090] in, is the soft clustering frequency of category c, which represents the cumulative soft assignment probability of samples in this category;
[0091]
[0092] in, Represents the feature representation of the unlabeled sample j by calculating and the cluster center u of category c c The Pearson correlation between them is used to determine the probability that the unlabeled sample j belongs to category c;
[0093] When calculating the initial cluster centers When , use the initial labeled samples and high-quality pseudo-labeled samples as seeds and assign different weights; calculate the initial centroid The formula is:
[0094]
[0095] in, and Represents the initial labeled data of category c and high-quality pseudo-labeled data The number of samples; weight β c Dynamically adjust as the iterative process progresses to ensure more efficient use of high-quality pseudo-labeled data;
[0096] Step 2.2.3, use the L2 trained deep neural network θ to train the unlabeled dataset D u All unlabeled samples in are classified and clustered, and then the classification-clustering consistency measure M is used c Evaluate classification predictions and clustering predictions to filter out samples with high-quality pseudo-labels;
[0097] Setting the adaptive threshold classification threshold and clustering threshold To evaluate the classification and clustering confidence of high-quality pseudo-labeling when unlabeled samples are classified as category c; is the classification threshold determined based on the average of the classification prediction values of category c, is the clustering threshold determined based on the average of the cluster prediction values of category c; if the classification prediction result and cluster prediction result of an unlabeled sample are the same and have high confidence in both predictions, the predicted label category of the sample is considered to be a high-quality pseudo label;
[0098] When M of an unlabeled sample j c When the value is equal to 1, the unlabeled sample j is given a high-quality pseudo label c.
[0099]
[0100] in, Represents the classification prediction probability distribution of unlabeled sample j; Represents the global cluster prediction probability distribution of unlabeled sample j; this probability distribution is obtained by calculating the feature representation of unlabeled sample j With all cluster centers u all The Pearson correlation between
[0101]
[0102] in, represents an indicator function; Express satisfaction The number of unlabeled samples; Express satisfaction The number of unlabeled samples;
[0103] Step 2.2.4, using the newly generated high-quality pseudo-labeled dataset, continue to perform step 2.2.1 until the classification loss function L1 and the clustering loss function L2 converge;
[0104] Step 3: Preprocess the brain image data of the new subject and extract brain image features; then input it into the trained semi-supervised classification and clustering model for analysis, and output the predicted results of its mental illness category.
[0105] In order to verify the effectiveness of the method in the classification of mental illnesses based on brain functional imaging, the method of the present invention was experimented on large-scale resting-state functional magnetic resonance imaging data of four data sets, including 237 healthy controls (HC) and 182 schizophrenia (SZ) patients from the Bipolar-Schizophrenia Network on Intermediate Phenotypes (B-SNIP), 89 HC and 68 SZ patients from the Center of Biomedical Research Excellence (COBRE) study, 144 HC and 137 SZ patients from the Functional Biomedical Informatics Research Network (FBIRN) project, and 238 HC and 150 SZ patients from the Maryland Psychiatric Research Center (MPRC). In this experiment, a leave-one-out data set cross-validation strategy was adopted. Specifically, each of the four datasets (B-SNIP, COBRE, FBIRN, MPRC) was retained as an independent test dataset in turn, while the other three datasets were combined as training datasets. For example, when B-SNIP was retained as a test set (denoted as B-SNIP-test) to verify the classification performance, the training set formed by merging the COBRE, FBIRN and MPRC datasets (denoted as No-B-SNIP-train) was used to train the model.
[0106] 120 and 180 samples were selected as labeled data, and the rest were used as unlabeled data to participate in the experiment, and the performance of the method of the present invention under different amounts of labeled data was evaluated. For comparison, a traditional deep neural network classification model with the same neural network architecture and parameter settings as the method of the present invention was adopted. The model was trained using 120 samples, 180 samples and a complete training set, respectively. Subsequently, the classification results of the model on an independent test set were compared with the semi-supervised classification prediction results of the method of the present invention. The evaluation indicators are accuracy and precision. To ensure the reliability of the experimental results, each group of cross-validation experiments was repeated five times, and different samples were randomly selected as labeled data each time. The final results are presented in the form of the mean and standard deviation of the repeated experiments. The specific experimental results are shown in Table 1.
[0107] Table 1 Experimental results of the traditional deep neural network classification model and the method of the present invention when using B-SNIP, COBRE, FBIRN and MPRC datasets as test data
[0108]
[0109] Note: The row of "Traditional Deep Neural Network Classification Model" shows the classification performance of the model under different amounts of labeled data, including using 120 labeled samples, 180 labeled samples, and the complete training data set (for example, when the B-SNIP data set is used as test data, the complete training set is recorded as |No-B-SNIP-train|). The row of "Method of the Invention" shows the results of the method of the invention using the remaining training data as unlabeled data for training under the same amount of labeled data.
[0110] The results in Table 1 show that even with only 120 labeled samples, the classification performance of the method of the present invention is better than that of the traditional classification algorithm that relies on the same amount of labeled data. When the number of labeled samples increases to 180, the performance of the method of the present invention is further improved and approaches the traditional deep neural network classification model that uses the complete training set as labeled data. In general, the method of the present invention demonstrates the ability to efficiently learn and deeply mine the potential information of unlabeled data under limited labeled data conditions, indicating its significant advantage in improving the classification performance of brain function imaging.
[0111] To verify the effectiveness of the proposed method in cross-diagnostic biotype recognition, we conducted experiments on brain imaging data of 107 HC, 107 bipolar disorder (BP) subjects, and 107 SZ subjects in the B-SNIP dataset. The effectiveness of the proposed method was evaluated by comparing the following aspects: the inter-group differences between the original diagnosis groups and the inter-group differences after re-clustering using the proposed method; the inter-group differences between the original diagnosis groups and the healthy control group; the inter-group differences between the re-predicted groups and the healthy control group; and the differences in the number of significant functional connections in these comparison groups.
[0112] The method of the present invention was experimented on brain imaging data of BP and SZ subjects. Figure 2 The results showed that the differences between the re-predicted groups Biotype A and Biotype B, and between HC and each Biotype, were more significant than those between the original diagnosis groups BP and SZ, HC and BP, and HC and SZ.
[0113] Figure 2(af) show the inter-group differences between different categories of functional connectivity data, using the T value of the two-sample t-test as the measure of the difference. These functional connections were divided into 53 functional networks and further classified into seven functional domains: subcortical (SC), auditory ( , AU), Sensorimotor , SM), Visual , VI) Cognitive-Control , The CC), Default-Mode (DM), and Cerebellar (CB) domains. (a) shows the group differences between BP and SZ; (b) shows the group differences between HC and BP; (c) shows the group differences between HC and SZ; (d) shows the group differences between the re-prediction group BiotypeA and Biotype B; (e) shows the group differences between BiotypeA and HC; (f) shows the group differences between Biotype B and HC.
[0114] Figure 3 It further shows that the number of significant functional connections between Biotype A and Biotype B in the re-prediction group is significantly greater than the number of significant functional connections between BP and SZ in the original diagnosis group. In addition: (ac) show the average connection strength of functional connections between BP and SZ, based on the p-value <0.005 obtained by the two-sample t-test (no correction for multiple comparisons); (df) shows the average connection strength of functional connections between BiotypeA and Biotype B, based on the p-value <0.005 obtained by the two-sample t-test, and Bonferroni correction was performed.
[0115] The contents not described in detail in the specification of the present invention belong to the prior art known to the professional and technical personnel in the field. Although the illustrative specific embodiments of the present invention are described above to facilitate the understanding of the present invention by the technical personnel in the field, it should be clear that the present invention is not limited to the scope of the specific embodiments. For the ordinary technical personnel in the field, as long as various changes are within the spirit and scope of the present invention defined and determined by the attached claims, these changes are obvious, and all inventions and creations using the concept of the present invention are protected.
Claims
1. A semi-supervised classification and clustering method for predicting mental illness categories, characterized by: The following steps are involved: Step 1, preprocessing the brain image data of the subjects to extract the brain image measurement of each subject, extracting features from the brain image measurement using feature selection or feature extraction methods, and constructing a training data set; Training dataset D tr Includes an initial labeled dataset and an unlabeled dataset Among them, the sample size m of unlabeled data is much larger than the sample size n of labeled data; Initial labeled dataset D l middle and Represent the features of sample i and the corresponding category labels respectively; Unlabeled dataset D u middle Represents the feature data of unlabeled sample j; unlabeled dataset D u Contains only feature data for each unlabeled sample, without associated category labels; Step 2: training semi-supervised classification and clustering models; Step 2.1, design the structure of the deep neural network θ according to the characteristics of the feature data; Step 2.2, train the deep neural network θ by iteratively optimizing the classification loss and clustering loss combined with the gradient descent method; Step 2.2.1, use the classification loss function L1 to train the deep neural network θ on the labeled dataset; The labeled dataset is composed of the initial labeled dataset D l With the newly generated high-quality pseudo-labeled dataset Together, they constitute represents the high-quality pseudo-label assigned to the unlabeled sample k, and g represents the total number of high-quality pseudo-label samples; initially, the high-quality pseudo-label dataset D p Empty; with the iteration of the model, a high-quality pseudo-labeled dataset will be gradually generated; The classification loss function L1 is expressed as: L1(D l ,D p )=L ce (D l )+L reg (D l )+β p *[L ce (D p )+L reg (D p )] Among them, L ce (D l ) represents the initial labeled dataset D l The cross entropy loss on L is used to measure the difference between the model's prediction of the initial labeled data and the actual label; reg (D l ) represents the initial labeled dataset D l The class balance loss on L is designed to promote the model to achieve a balanced classification effect between different categories. By adjusting the model's prediction, it reduces the preference for the majority class, thereby improving the recognition ability of the minority class. ce (D p ) represents a high-quality pseudo-labeled dataset D p The cross entropy loss on L reg (D p ) represents a high-quality pseudo-labeled dataset D p The class balance loss on p Dynamic weights for high-quality pseudo-labeled data; Among them, N * Indicates the number of samples in the labeled dataset; is a binary indicator variable that indicates whether sample i is labeled as category c. It indicates the classification probability that the model predicts that sample i belongs to category c, where C is the total number of categories; Among them, π c =1 / C; Step 2.2.2, retrain the deep neural network θ trained with the classification loss function L1 using the clustering loss function L2 on the unlabeled data set and the labeled data set; The unlabeled data and the labeled data are input into the deep neural network θ trained by L1 to generate the embedded features of these samples; the embedded features of the unlabeled samples will be used as the input features in the clustering analysis, while the embedded features of the labeled samples are used to generate the initialization centers of the clusters to guide the clustering process; Based on the constrained seed K-means clustering algorithm, clustering is performed by combining the initialization center of the cluster and the embedded features of the unlabeled samples; finally, the clustering loss L2 is calculated based on the clustering results, and the loss is used to further train the deep neural network θ; The clustering loss function L2 is expressed as: L2(u all ,D u )=KL(P||Q)+L reg_u (D u ) Among them, KL(P||Q means using KL divergence to measure the difference between the target distribution P and the soft distribution Q; u all Represents the cluster center of all categories; L reg_u (D u ) represents the unlabeled dataset D u Class balancing loss; KL(P||Q) is defined as follows: In the unlabeled dataset D u In the above example, Q is the soft distribution, which indicates the probability distribution predicted by the model based on the embedding features of unlabeled samples; for D u Unlabeled samples j,p jc represents the probability that the unlabeled sample j belongs to category c; q jc Specifically represents the centroid u of the unlabeled sample j and the category c c The similarity between them is measured by the Student's t distribution kernel and is calculated as follows: in, represents the embedded features of the unlabeled sample j using the output of the second-to-last layer of the deep neural network θ; P is the target distribution, which represents the adjusted expected distribution and is used to guide model optimization to make its prediction more accurate. Its calculation formula is: in, is the soft clustering frequency of category c, which represents the cumulative soft assignment probability of samples in this category; in, Represents the feature representation of the unlabeled sample j by calculating and the cluster center u of category c c The Pearson correlation between them is used to determine the probability that the unlabeled sample j belongs to category c; When calculating the initial cluster centers When , use the initial labeled samples and high-quality pseudo-labeled samples as seeds and assign different weights; calculate the initial centroid The formula is: in, and Represents the initial labeled data of category c and high-quality pseudo-labeled data The number of samples; weight β c Dynamically adjust as the iterative process progresses to ensure more efficient use of high-quality pseudo-labeled data; Step 2.2.3, use the L2 trained deep neural network θ to train the unlabeled dataset D u All unlabeled samples in are classified and clustered, and then the classification-clustering consistency measure M is used c Evaluate classification predictions and clustering predictions to filter out samples with high-quality pseudo-labels; Setting the adaptive threshold classification threshold and clustering threshold To evaluate the classification and clustering confidence of high-quality pseudo-labeling when unlabeled samples are classified as category c; is the classification threshold determined based on the average of the classification prediction values of category c, is the clustering threshold determined based on the average of the cluster prediction values of category c; if the classification prediction result and cluster prediction result of an unlabeled sample are the same and have high confidence in both predictions, the predicted label category of the sample is considered to be a high-quality pseudo label; When M of an unlabeled sample j c When the value is equal to 1, the unlabeled sample j is given a high-quality pseudo label c. in, Represents the classification prediction probability distribution of unlabeled sample j; Represents the global cluster prediction probability distribution of unlabeled sample j; this probability distribution is obtained by calculating the feature representation of unlabeled sample j With all cluster centers u all The Pearson correlation between in, represents an indicator function; Express satisfaction The number of unlabeled samples; Express satisfaction The number of unlabeled samples; Step 2.2.4, using the newly generated high-quality pseudo-labeled dataset, continue to perform step 2.2.1 until the classification loss function L1 and the clustering loss function L2 converge; Step 3: Preprocess the brain image data of the new subject and extract brain image features; then input it into the trained semi-supervised classification and clustering model for analysis, and output the predicted results of its mental illness category.
2. A semi-supervised classification and clustering method for predicting mental illness categories according to claim 1, characterized in that: The preprocessing includes inter-layer correction, head motion correction, spatial normalization and spatial smoothing.