Neural image analysis model training method and device, equipment and storage medium
A neural imaging analysis model with contrastive and domain adversarial training enhances NSSI subtype classification accuracy, addressing the challenge of identifying high-risk individuals before NSSI behavior occurs.
Patent Information
- Application Number
- CN202510796703.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-16
- Publication Date
- 2025-07-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art cannot accurately identify brain activity patterns related to non-suicide self-harm behavior, resulting in low accuracy in classification of NSSI subtypes and difficulty in achieving early intervention.
A neural image analysis model is constructed, and a comparison learning module, domain adversarial module and classification module are used. Through comparison learning, domain adversarial training and NSSI subtype classification training, a multi-objective joint loss function is generated, and the model parameters are updated until the training termination condition is met.
It improves the accuracy of identification of brain activity patterns related to NSSI behavior, enhances the accuracy of NSSI subtype classification, and provides a scientific basis for early intervention.
Smart Images

Figure CN120318601A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of neuroimaging data analysis, and particularly relates to a training method, device, equipment and storage medium of a neuroimaging analysis model. Background Art
[0002] The existing system for evaluating non-suicidal self-injury (NSSI) behavior in adolescents with depression mainly conducts retrospective analysis on the occurred self-injury behavior, lacking the ability to prospectively capture potential risk signals, and it is difficult to identify high-risk individuals and implement early intervention before the self-injury behavior appears, making the formulation of preventive diagnosis and treatment strategies face technical bottlenecks.
[0003] In recent years, functional magnetic resonance imaging (fMRI), as a non-invasive neuroimaging technique, has provided an efficient means for studying brain functions. fMRI captures the dynamic interactions between different brain regions through blood oxygenation level-dependent (BOLD) signals, and can reveal the functional state and potential abnormalities of the brain. Especially resting-state fMRI (rs-fMRI), even without a specific task, can reveal the dynamic activity patterns of the brain by analyzing the functional connectivity (FC) between brain regions. Existing studies have shown that there are significant abnormalities in the brain functional connectivity of adolescents with depression NSSI, especially in the brain regions closely related to emotion regulation and impulse control such as the prefrontal cortex and amygdala. However, most existing studies mainly rely on statistical methods to analyze functional connectivity, failing to deeply mine the deep features in the data, and often ignoring the time dynamic information of the data, resulting in limited generalization ability and insufficient feature extraction ability of the model when processing high-dimensional and non-linearly distributed data, and lacking an effective domain adaptation mechanism when dealing with the distribution differences between the source domain and the target domain, resulting in poor generalization ability of the model in the target domain, thus making the diagnosis result of NSSI behavior inaccurate and making it difficult to conduct early intervention on NSSI behavior. Summary of the Invention
[0004] The purpose of the present invention is to provide a training method, device, equipment and storage medium of a neuroimaging analysis model, aiming to solve the problem that the low accuracy of NSSI subtype classification is caused by the inability of the existing technology to accurately identify the brain activity patterns related to NSSI behavior.
[0005] In the first aspect, the present invention provides a training method of a neuroimaging analysis model, and the method includes the following steps: Construct a training model for training a neuroimaging analysis model. The training model includes a contrastive learning module, a domain adversarial module, and a classification module. The contrastive learning module is used to perform contrastive learning training on the neuroimaging analysis model. The domain adversarial module is used to perform domain adversarial training on the neuroimaging analysis model. The classification module is used to perform NSSI subtype classification training on the neuroimaging analysis model; Preprocess the source domain training samples and target domain training samples for training the neuroimaging analysis model respectively to obtain the corresponding source domain dFC matrix and target domain dFC matrix; Based on the source domain dFC matrix and the target domain dFC matrix, generate corresponding contrastive loss, domain classification loss, and NSSI subtype classification loss through the contrastive learning module, the domain adversarial module, and the classification module respectively; Construct a multi-objective joint loss function based on the contrastive loss, the domain classification loss, and the NSSI subtype classification loss; Update the model parameters of the training model according to the total loss of the multi-objective joint loss function until the training termination condition of the training model is satisfied, and complete the training of the neuroimaging analysis model.
[0006] In some embodiments, the contrastive learning module includes a projection head for mapping high-dimensional features to a low-dimensional contrastive learning space. The domain adversarial module includes a domain classifier for predicting domain labels and a gradient reversal layer for reversing the gradient direction of the domain classification loss during backpropagation. The contrastive learning module and the domain adversarial module share the feature extractor in the neuroimaging analysis model. The gradient reversal layer is located between the feature extractor and the domain classifier. The classification module shares the classifier in the neuroimaging analysis model, and the classifier is used to predict NSSI subtype categories.
[0007] In some embodiments, the step of generating corresponding contrastive loss, domain classification loss, and NSSI subtype classification loss through the contrastive learning module, the domain adversarial module, and the classification module respectively based on the source domain dFC matrix and the target domain dFC matrix includes: Input the source domain dFC matrix into the contrastive learning module; Perform data augmentation on the source domain dFC matrix using a preset data augmentation strategy to obtain a first data augmentation matrix and a second data augmentation matrix; Perform feature extraction on the first data augmentation matrix and the second data augmentation matrix respectively through the feature extractor to obtain corresponding first feature vectors and second feature vectors; The first eigenvector and the second eigenvector are respectively subjected to feature projection through the projection head to obtain a first projection vector and a second projection vector; The contrast loss is calculated based on the similarity between the first projection vector and the second projection vector.
[0008] In some embodiments, the steps of respectively generating corresponding contrast loss, domain classification loss, and NSSI subtype classification loss through the contrast learning module, the domain adversarial module, and the classification module based on the source domain dFC matrix and the target domain dFC matrix further include: Input the first eigenvector and the target domain dFC matrix into the domain adversarial module; The target domain dFC matrix is subjected to feature extraction through the feature extractor to obtain a target domain eigenvector; The domain classifier performs domain label prediction on the first eigenvector and the target domain eigenvector, and calculates the domain classification loss according to the domain label prediction result.
[0009] In some embodiments, the steps of respectively generating corresponding contrast loss, domain classification loss, and NSSI subtype classification loss through the contrast learning module, the domain adversarial module, and the classification module based on the source domain dFC matrix and the target domain dFC matrix further include: Input the first eigenvector into the classification module; The classifier performs NSSI subtype classification prediction on the first eigenvector, and calculates the NSSI subtype classification loss according to the classification prediction result.
[0010] In some embodiments, the feature extractor includes a preprocessing layer, a self-attention encoder based on the Transformer architecture, and a pooling layer. The preprocessing layer is used for linear transformation, the self-attention encoder is used to capture long-term dependencies of brain region connections, the pooling layer is used to compress the time dimension. The self-attention encoder includes 6 layers of Transformer encoder layers, and each layer of the Transformer encoder layer adopts an 8-head self-attention mechanism. The classifier is composed of a single-layer linear layer and a LogSoftmax function. The single-layer linear layer is used to map the high-dimensional eigenvector output by the feature extractor to a two-dimensional category space, and the LogSoftmax function is used to convert the output of the single-layer linear layer into a probability distribution.
[0011] In a second aspect, the present invention provides a training device for a neuroimaging analysis model, and the device includes: A training model construction unit for constructing a training model for training a neuroimaging analysis model. The training model includes a contrastive learning module, a domain adversarial module, and a classification module. The contrastive learning module is used to perform contrastive learning training on the neuroimaging analysis model. The domain adversarial module is used to perform domain adversarial training on the neuroimaging analysis model. The classification module is used to perform NSSI subtype classification training on the neuroimaging analysis model; A training sample preprocessing unit for preprocessing source domain training samples and target domain training samples used for training the neuroimaging analysis model respectively, to obtain corresponding source domain dFC matrices and target domain dFC matrices; A multi-objective loss generation unit for generating corresponding contrastive losses, domain classification losses, and NSSI subtype classification losses respectively through the contrastive learning module, the domain adversarial module, and the classification module based on the source domain dFC matrix and the target domain dFC matrix; A loss function construction unit for constructing a multi-objective joint loss function based on the contrastive loss, the domain classification loss, and the NSSI subtype classification loss; A model parameter update unit for updating the model parameters of the training model according to the total loss of the multi-objective joint loss function until the training termination condition of the training model is satisfied, and completing the training of the neuroimaging analysis model.
[0012] In some embodiments, the contrastive learning module includes a projection head for mapping high-dimensional features to a low-dimensional contrastive learning space. The domain adversarial module includes a domain classifier for predicting domain labels and a gradient reversal layer for reversing the gradient direction of the domain classification loss during backpropagation. And the contrastive learning module and the domain adversarial module share the feature extractor in the neuroimaging analysis model. The gradient reversal layer is located between the feature extractor and the domain classifier. The classification module shares the classifier in the neuroimaging analysis model. The classifier is used to predict NSSI subtype categories. The multi-objective loss generation unit includes: A source domain matrix input unit for inputting the source domain dFC matrix into the contrastive learning module; A source domain matrix enhancement unit for enhancing the source domain dFC matrix using a preset data enhancement strategy to obtain a first data enhancement matrix and a second data enhancement matrix; A matrix feature extraction unit for respectively extracting features of the first data enhancement matrix and the second data enhancement matrix through the feature extractor to obtain corresponding first feature vectors and second feature vectors; A vector feature projection unit, configured to perform feature projection on the first feature vector and the second feature vector respectively through the projection head to obtain a first projection vector and a second projection vector; A contrast loss calculation unit, configured to calculate the contrast loss based on the similarity between the first projection vector and the second projection vector.
[0013] In a third aspect, the present invention further provides a computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method described above are implemented.
[0014] In a fourth aspect, the present invention further provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps of the method described above are implemented.
[0015] The embodiment of the present invention is a model for constructing and training a neuroimaging analysis model. The training model includes a contrast learning module for contrast learning training, a domain adversarial module for domain adversarial training, and a classification module for NSSI subtype classification training. The source domain / target domain training samples for training are preprocessed respectively to obtain the source domain / target domain dFC matrix. Based on the source domain / target domain dFC matrix, the contrast learning module, the domain adversarial module, and the classification module are used to generate corresponding contrast loss, domain classification loss, and NSSI subtype classification loss respectively. A multi-objective joint loss function is constructed based on each loss, and the model parameters of the training model are updated according to the total loss until the training termination condition is met, completing the training of the neuroimaging analysis model, thereby improving the training effect of the model, enabling the neuroimaging analysis model to accurately identify the brain activity patterns related to NSSI behavior, improving the accuracy of NSSI subtype classification, and providing a scientific basis for early intervention. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 is a schematic flowchart of a method for training a neuroimaging analysis model provided in Embodiment 1 of the present invention; Figure 2 is a schematic structural diagram of a device for training a neuroimaging analysis model provided in Embodiment 2 of the present invention; Figure 3 is a schematic structural diagram of a computing device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0017] In order to make the objectives, technical solutions, and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0018] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or their groups. And the terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are intended to include the plural forms. The terms "first", "second", and similar terms do not denote any order, quantity, or importance, but are only used to distinguish different components. "Connection" or "coupling" and similar terms are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Upper", "lower", "left", "right", etc. are only used to represent relative positional relationships, and when the absolute position of the object being described changes, the relative positional relationship may also change accordingly. The term "plurality" refers to two or more, and other quantifiers are similar.
[0019] To keep the following description of the embodiments of the present invention clear and concise, the detailed descriptions of some known functions and known components are omitted in this specification.
[0020] The following describes in detail the specific implementation of the present invention in conjunction with specific embodiments: Embodiment 1: Figure 1 The implementation process of a training method for a neuroimaging analysis model provided in Embodiment 1 of the present invention is shown. For the sake of convenience of description, only the parts related to the embodiments of the present invention are shown and are described in detail as follows: In step S101, a training model for training the neuroimaging analysis model is constructed. The training model includes a contrast learning module, a domain adversarial module, and a classification module. The contrast learning module is used to perform contrast learning training on the neuroimaging analysis model, the domain adversarial module is used to perform domain adversarial training on the neuroimaging analysis model, and the classification module is used to perform NSSI subtype classification training on the neuroimaging analysis model.
[0021] Embodiments of the present invention are applicable to computing devices, such as personal computers, servers, etc. In embodiments of the present invention, a training model for training a neuroimaging analysis model is constructed, wherein the neuroimaging analysis model is used to analyze neuroimaging data to achieve NSSI subtype classification. The training model includes a contrastive learning module, a domain adversarial module, and a classification module. The contrastive learning module is used to perform contrastive learning training on the neuroimaging analysis model to force the neuroimaging analysis model to learn discriminative features that are more sensitive to NSSI-related neural patterns, enhance the robustness of the neuroimaging analysis model to noise and heterogeneous data. The domain adversarial module is used to perform domain adversarial training on the neuroimaging analysis model so that the neuroimaging analysis model learns general features that are useful for the task and have generalization ability across domains, improving the cross-domain classification accuracy of the neuroimaging analysis model. The classification module is used to perform NSSI subtype classification training on the neuroimaging analysis model to improve the accuracy of the neuroimaging analysis model in NSSI subtype classification. Among them, the NSSI subtype refers to the classification of non-suicidal self-injury behavior based on different dimensions such as behavioral motivation, manifestation form, psychological characteristics, or comorbidity. For example, the subtype classification based on motivation includes emotion regulation subtype, self-punishment subtype, social influence subtype, etc., and the subtype classification based on manifestation form includes cutting / scratching subtype, hitting / impact subtype, burning / substance abuse subtype, etc. These subtypes help to understand the psychological mechanisms behind the self-injury behaviors of different individuals and guide personalized intervention.
[0022] In a feasible embodiment, the contrastive learning module includes a projection head for mapping high-dimensional features to a low-dimensional contrastive learning space. The domain adversarial module includes a domain classifier for predicting domain labels and a gradient reversal layer for reversing the gradient direction of the domain classification loss during backpropagation. The contrastive learning module and the domain adversarial module share the feature extractor in the neuroimaging analysis model. The gradient reversal layer is located between the feature extractor and the domain classifier. The classification module shares the classifier in the neuroimaging analysis model, and the classifier is used to predict the NSSI subtype category.
[0023] In the embodiments of the present invention, the contrastive learning module and the domain adversarial module share the parameters of the feature extractor to force the feature extractor to learn a feature representation that is both discriminative (contrastive learning objective) and domain-invariant (domain adversarial objective). The output dimension of the feature extractor is 1024. The projection head in the contrastive learning module is a two-layer multi-layer perceptron (MLP) network. Its input dimension is the output dimension of the feature extractor, the hidden layer dimension is 512, and the output layer dimension is 128. The projection head receives the 1024-dimensional feature vector output by the feature extractor, reduces it to 512 dimensions through the hidden layer, and finally maps it to the 128-dimensional contrastive learning space. The design of the projection head enables the compression and reconstruction of high-dimensional features during the contrastive learning process, improving the discriminative ability and generalization of the feature space, thus having a positive impact on the subsequent classification task. The domain classifier in the domain adversarial module uses a 2-layer MLP (with an input dimension of the output dimension of the feature extractor, a hidden layer dimension of 64, and an output layer dimension of 2) to classify the features output by the feature extractor into the source domain / target domain, ensuring that the features have generalization ability across domains. A gradient reversal layer (GRL) is added between the feature extractor and the domain classifier. Through this gradient reversal layer, the gradient of the domain classifier is backpropagated to the feature extractor, making it difficult for the features learned by the feature extractor to distinguish the source domain and the target domain on the domain classifier, thereby generating domain-invariant general features. During domain adversarial training, the gradient is reversed by adaptively and dynamically adjusting the α coefficient used to control the intensity of the gradient reversal layer, forcing the feature extractor to learn domain-invariant features and bridging the data distribution differences between the source domain and the target domain (such as device noise and population heterogeneity) to achieve cross-domain feature alignment. The classification module shares the classifier in the neuroimaging analysis model. The classifier maps the feature vector input by the feature extractor to specific categories to classify the NSSI subtype to which the subject belongs.
[0024] In another feasible embodiment, the feature extractor includes a preprocessing layer, a self-attention encoder based on the Transformer architecture, and a pooling layer. The preprocessing layer is used for linear transformation, the self-attention encoder is used to capture the long-term dependencies of brain region connections, and the pooling layer is used to compress the time dimension. The self-attention encoder contains 6 layers of Transformer encoder layers, and each layer of Transformer encoder layer uses an 8-head self-attention mechanism. The classifier consists of a single-layer linear layer and a LogSoftmax function. The single-layer linear layer is used to map the high-dimensional feature vector output by the feature extractor to a two-dimensional category space, and the LogSoftmax function is used to convert the output of the single-layer linear layer into a probability distribution.
[0025] In an embodiment of the present invention, the feature extractor includes a preprocessing layer, a self-attention encoder based on the Transformer architecture, and a pooling layer. Among them, the preprocessing layer is used to reduce the 26,796-dimensional input data to 1,024 dimensions through linear transformation, and extract basic features while reducing the dimension. The self-attention encoder (i.e., the Transformer encoder) contains 6 layers of Transformer encoder layers (i.e., Transformer Encoder Layer), and each layer of Transformer encoder layer adopts an 8-head self-attention mechanism. The Transformer encoder is used to process time series data, capture the long-range dependencies of brain region connections, and solve the defect that traditional static features ignore time dynamics. The pooling layer adopts adaptive average pooling to compress the time dimension of the data and output a feature vector suitable for subsequent tasks; the classifier is composed of a single-layer linear layer and a LogSoftmax function. The 1,024-dimensional feature vector output by the feature extractor is mapped to a two-dimensional category space through the single-layer linear layer, and is converted into a probability distribution of NSSI subtype categories through the LogSoftmax function.
[0026] In step S102, the source domain training samples and target domain training samples for training the neuroimaging analysis model are preprocessed respectively to obtain the corresponding source domain dFC matrix and target domain dFC matrix.
[0027] In an embodiment of the present invention, a number of adolescent depression participants are divided into three groups: the first group is suicide with self-harm (NSSI+, SB+); the second group is non-suicide with self-harm (NSSI+, SB-); the third group is non-suicide without self-harm (NSSI-, SB-). Resting-State Functional Magnetic Resonance Imaging (rs-fMRI) data of these different groups of adolescent depression participants are collected, and these rs-fMRI data are divided into source domain training samples and target domain training samples for training the neuroimaging analysis model. That is, the source domain training samples and target domain training samples are respectively composed of rs-fMRI data of different adolescent depression participants. The source domain training samples and target domain training samples are preprocessed respectively, including but not limited to data cleaning, spatial normalization, denoising, and dynamic feature extraction processing, to generate corresponding 206 time points × 26,796-dimensional dynamic functional connectivity (dFC) matrices for each rs-fMRI data in the source / target domain training samples. Among them, the dFC matrices corresponding to all rs-fMRI data in the source domain training samples constitute the source domain dFC matrix, and the dFC matrices corresponding to all rs-fMRI data in the target domain training samples constitute the target domain dFC matrix.
[0028] In a feasible embodiment, the generation of the dFC matrix is achieved through the following steps: ① Collect data from a number of adolescent participants with depression. Specifically, first, screen a number of initial (e.g., 226) adolescent participants with depression to exclude those with incomplete fMRI acquisition and screening metric (FASM) evaluations, bipolar disorder (BD), significant head movement, or psychotic symptoms. Then, conduct a medical evaluation of all (e.g., 167) screened adolescent participants with depression (hereinafter referred to as participants), and divide these adolescent participants with depression into three groups: the first group is those with suicide and self-harm (NSSI+, SB+); the second group is those without suicide but with self-harm (NSSI+, SB-); the third group is those without suicide and without self-harm (NSSI-, SB-). After that, use a 3.0-Tesla MRI scanner to collect the rs-fMRI data of these adolescent participants with depression. Among them, the acquisition parameters include repetition time (TR) / echo time (TE) = 2000 / 30 ms, flip angle of 90°, slice thickness of 2.5 mm, number of slices of 58, matrix size of 88×88, and number of time points of 240; ② Clean and correct each rs-fMRI data. Specifically, remove the first 5 volumes (i.e., time points) to balance the signal, and perform slice-timing correction and head motion correction, excluding participants with excessive head motion (average framewise displacement (FD) Jenkinson > 0.2 mm); ③ Perform spatial normalization on the cleaned data. Specifically, normalize the data to the Montreal Neurological Institute (MNI) space with a voxel size of 3×3×3 mm³; ④ Denoise the normalized data. Specifically, use the Friston-24 model regression to remove the influence of noise signals (including but not limited to white matter signals and cerebrospinal fluid signals) and head motion parameters, and perform spatial smoothing using a Gaussian kernel with a full width at half maximum (FWHM) of 4 mm; ⑤ Calculate the dFC matrix based on the denoised data. Specifically, according to the Schaefer 2018 atlas, the brain is segmented into 232 regions of interest (ROIs), and then the sliding window technique (window size set to 30 TRs, sliding step set to 1 TR) is used to extract the functional connectivity matrix of 206 non-overlapping time windows for each participant. After Fisher Z transformation, a functional connectivity matrix with dimensions (206, 232, 232) is obtained. To reduce the feature dimension, the upper triangular elements (excluding the diagonal) of each functional connectivity matrix are extracted and unfolded into a one-dimensional vector, and finally a dFC matrix with dimensions (206, 26796) is obtained.
[0029] Through the preprocessing scheme of the above steps ① to ⑤, the original blood oxygenation level dependent (BOLD) signal is converted into high-dimensional features that fully reflect the time-varying connection information of the brain, so that the dynamic interaction information between different brain regions can be captured more carefully. The extraction of dynamic functional connectivity enhances the sensitivity of the model to time series data and improves the discriminative ability of features.
[0030] In step S103, based on the source domain dFC matrix and the target domain dFC matrix, the corresponding contrast loss, domain classification loss, and NSSI subtype classification loss are generated through the contrast learning module, the domain adversarial module, and the classification module respectively.
[0031] In the embodiment of the present invention, the source domain dFC matrix and the target domain dFC matrix are input into the training model. During the forward propagation process, the corresponding contrast loss, domain classification loss, and NSSI subtype classification loss are generated through the contrast learning module, the domain adversarial module, and the classification module respectively. Among them, the contrast loss is used to enhance the feature discriminability, the domain classification loss is used to reduce the domain difference, and the NSSI subtype classification loss is used to measure the difference between the NSSI subtype category predicted by the model and the true label.
[0032] In a feasible embodiment, the generation of the contrast loss is achieved through the following steps: (S103.1.1) Input the source domain dFC matrix into the contrast learning module; (S103.1.2) Perform data augmentation on the source domain dFC matrix using a preset data augmentation strategy to obtain a first data augmentation matrix and a second data augmentation matrix; In the embodiments of the present invention, for each dFC matrix in the source domain dFC matrix, part of the data is randomly set to 0 with a masking probability of 40% to generate two different data augmentation matrices, namely the first data augmentation matrix and the second data augmentation matrix, thereby enhancing the robustness of the model through data augmentation. Specifically, a binary masking matrix M with the same dimension as the dFC matrix in the source domain dFC matrix is created. Each element in M is set to 1 with a probability of 40% (indicating retention) and 0 with a probability of 60% (indicating masking). The masking matrix is multiplied element-wise with each dFC matrix D in the source domain dFC matrix to generate the corresponding augmented matrix D aug , denoted as D aug = D ⊙ M. The augmented matrices corresponding to all dFC matrices form the data augmentation matrix, where ⊙ represents element-wise multiplication.
[0033] (S103.1.3) Feature extraction is performed on the first data augmentation matrix and the second data augmentation matrix respectively through a feature extractor to obtain the corresponding first feature vector and second feature vector; (S103.1.4) Feature projection is performed on the first feature vector and the second feature vector respectively through a projection head to obtain the first projection vector and the second projection vector; (S103.1.5) The contrastive loss is calculated based on the similarity between the first projection vector and the second projection vector.
[0034] In the embodiments of the present invention, during the forward propagation process in the training phase, the source domain dFC matrix is input into the contrastive learning module for contrastive learning training. Specifically, positive / negative sample pairs are constructed. The positive sample pairs are the projection vector pairs from the same sample among the first projection vector and the second projection vector, and the negative sample pairs are the projection vector pairs from different samples among the first projection vector and the second projection vector. The cosine similarity between the vectors in the positive sample pairs and the cosine similarity between the vectors in the negative sample pairs are calculated. The contrastive loss is calculated based on the cosine similarity. By maximizing the feature similarity of two different data augmentation matrices of the same sample in the source domain and minimizing the similarity with other samples, the problems of noise and data heterogeneity are effectively alleviated, enabling the model to capture more discriminative features during the contrastive learning process, enhancing the sensitivity to NSSI-related neural patterns, and improving the robustness of the model.
[0035] In another feasible embodiment, the generation of the domain classification loss is achieved through the following steps: (S103.2.1) Input the first feature vector and the target domain dFC matrix into the domain adversarial module; (S103.2.2) Feature extraction is performed on the target domain dFC matrix through a feature extractor to obtain the target domain feature vector; (S103.2.3) Use the domain classifier to perform domain label prediction on the first feature vector and the target domain feature vector, and calculate the domain classification loss according to the domain label prediction result.
[0036] In the embodiment of the present invention, during the forward propagation process in the training stage, the first feature vector and the target domain dFC matrix are input into the domain adversarial module for domain adaptation alignment processing to obtain domain-invariant general features. Specifically, use the feature extractor to extract deep features from the target domain dFC matrix to obtain the target domain feature vector. Input the first feature vector from the source domain and the target domain feature vector from the target domain into the domain classifier. The domain classifier attempts to determine whether the feature vector comes from the source domain or the target domain, predict their domain labels, and calculate the domain classification loss according to the domain label prediction result. In domain adversarial training, the training objective of the feature extractor is to make the domain classifier unable to accurately judge, that is, to confuse the features of the source domain and the target domain. Here, the loss is backpropagated to the feature extractor through GRL, so that the feature extractor learns domain-invariant feature representations, reduces the difference in feature distributions between the source domain and the target domain. Thus, through domain adversarial training, the distribution differences between different data domains are effectively reduced, improving the generalization ability of the model under different source data (such as different scanning devices, sample populations), making the extracted features more robust for cross-domain applications, and ensuring the stability and consistency during cross-domain analysis.
[0037] In another feasible embodiment, the generation of the NSSI subtype classification loss is achieved through the following steps: (S103.3.1) Input the first feature vector into the classification module; (S103.3.2) Use the classifier to perform NSSI subtype classification prediction on the first feature vector, and calculate the NSSI subtype classification loss according to the classification prediction result.
[0038] In the embodiment of the present invention, during the forward propagation process in the training stage, the first feature vector is input into the classifier module for NSSI subtype classification training. Specifically, use the classifier to perform NSSI subtype classification processing on the first feature vector to obtain the predicted probability distribution of the NSSI subtype. According to the predicted probability distribution, use the cross-entropy loss function to calculate the NSSI subtype classification loss, and the formula is expressed as , where represents the number of samples in the source domain training samples, represents the th sample's true NSSI subtype label (after one-hot encoding), represents the classifier for the The probability of a sample being predicted to belong to this subtype. By minimizing this loss function, the parameters of the classifier are continuously adjusted so that the classifier can accurately predict the NSSI subtype. At the same time, the feature extractor will also update its parameters according to the NSSI subtype classification loss to extract dFC matrix features that are more conducive to NSSI subtype classification.
[0039] In step S104, a multi-objective joint loss function is constructed based on the contrast loss, domain classification loss, and NSSI subtype classification loss.
[0040] In the embodiment of the present invention, when a forward propagation is completed, the contrast loss, domain classification loss, and NSSI subtype classification loss are weighted and summed to construct a multi-objective joint loss function. This joint training strategy avoids the overfitting problem that may occur in single-task training, ensuring a good balance among feature expression, domain adaptation, and classification accuracy. Among them, represents the contrast loss, represents the domain classification loss, represents the NSSI subtype classification loss, respectively represent 、 and the loss weights of.
[0041] In step S105, the model parameters of the training model are updated according to the total loss of the multi-objective joint loss function until the training termination condition of the training model is satisfied, and the training of the neuroimaging analysis model is completed.
[0042] In the embodiment of the present invention, according to the total loss of the multi-objective joint loss function, the parameters of the feature extractor, contrast learning module, domain adversarial module, and classifier module are globally updated through the backpropagation algorithm, and the loss weights are dynamically adjusted to coordinate the contradictions between the target tasks, realizing the collaborative optimization of feature extraction, domain adaptation, and classification performance. Then, it is judged whether the training termination condition is satisfied (such as loss convergence or reaching the preset maximum number of training rounds). If so, the training of the neuroimaging analysis model is completed. Here, the trained neuroimaging analysis model includes a feature extractor and a classifier. When the training termination condition is not satisfied, it jumps to step S103 to continue execution.
[0043] In a feasible embodiment, during the model inference stage, the target rs-fMRI data of the target individual to be diagnosed with NSSI behavior is preprocessed to obtain a target dFC matrix. The target dFC matrix is input into the trained neuroimaging analysis model. The feature extractor in the neuroimaging analysis model extracts features from the target dFC matrix to obtain a target feature vector. The classifier in the neuroimaging analysis model performs NSSI subtype classification prediction on the target feature vector to obtain the NSSI subtype category of the target individual, thereby achieving the accurate identification of brain nerve patterns related to NSSI behavior based on objective data of brain activities, and significantly improving the accuracy of diagnosis.
[0044] In the embodiment of the present invention, a training model is constructed for the neuroimaging analysis model. The training model includes a contrast learning module for contrast learning training, a domain adversarial module for domain adversarial training, and a classification module for NSSI subtype classification training. The source domain / target domain training samples for training are preprocessed respectively to obtain the source domain / target domain dFC matrices. Based on the source domain / target domain dFC matrices, the contrast learning module, the domain adversarial module, and the classification module generate corresponding contrast loss, domain classification loss, and NSSI subtype classification loss respectively. A multi-objective joint loss function is constructed based on each loss, and the model parameters of the training model are updated according to the total loss until the training termination condition is met, completing the training of the neuroimaging analysis model, thereby improving the training effect of the model, enabling the neuroimaging analysis model to accurately identify brain activity patterns related to NSSI behavior, improving the accuracy of NSSI subtype classification, and providing a scientific basis for early intervention.
[0045] Embodiment 2: Figure 2 The structure of a training device for a neuroimaging analysis model provided in Embodiment 2 of the present invention is shown. For the sake of convenience, only the parts related to Embodiment 2 of the present invention are shown, including: A training model construction unit 21, configured to construct a training model for training the neuroimaging analysis model. The training model includes a contrast learning module, a domain adversarial module, and a classification module. The contrast learning module is used to perform contrast learning training on the neuroimaging analysis model. The domain adversarial module is used to perform domain adversarial training on the neuroimaging analysis model. The classification module is used to perform NSSI subtype classification training on the neuroimaging analysis model; A training sample preprocessing unit 22, configured to preprocess the source domain training sample and the target domain training sample for training the neuroimaging analysis model respectively to obtain the corresponding source domain dFC matrix and target domain dFC matrix; The multi-objective loss generation unit 23 is used to generate corresponding contrast loss, domain classification loss, and NSSI subtype classification loss through a contrast learning module, a domain adversarial module, and a classification module based on the source domain dFC matrix and the target domain dFC matrix; The loss function construction unit 24 is used to construct a multi-objective joint loss function based on the contrast loss, the domain classification loss, and the NSSI subtype classification loss; The model parameter update unit 25 is used to update the model parameters of the training model according to the total loss of the multi-objective joint loss function until the training termination condition of the training model is satisfied, and complete the training of the neuroimaging analysis model.
[0046] Preferably, the contrast learning module includes a projection head for mapping high-dimensional features to a low-dimensional contrast learning space, the domain adversarial module includes a domain classifier for predicting domain labels and a gradient reversal layer for reversing the gradient direction of the domain classification loss during backpropagation, and the contrast learning module and the domain adversarial module share the feature extractor in the neuroimaging analysis model. The gradient reversal layer is located between the feature extractor and the domain classifier, and the classification module shares the classifier in the neuroimaging analysis model. The classifier is used to predict the NSSI subtype category.
[0047] Another preferably, the multi-objective loss generation unit 23 includes: The source domain matrix input unit is used to input the source domain dFC matrix into the contrast learning module; The source domain matrix enhancement unit is used to perform data enhancement on the source domain dFC matrix by using a preset data enhancement strategy to obtain a first data enhancement matrix and a second data enhancement matrix; The matrix feature extraction unit is used to respectively perform feature extraction on the first data enhancement matrix and the second data enhancement matrix through the feature extractor to obtain corresponding first feature vectors and second feature vectors; The vector feature projection unit is used to respectively perform feature projection on the first feature vector and the second feature vector through the projection head to obtain a first projection vector and a second projection vector; The contrast loss calculation unit is used to calculate the contrast loss based on the similarity between the first projection vector and the second projection vector.
[0048] In the embodiments of the present invention, for the convenience and conciseness of description, only the above-mentioned division of each functional unit and module is used as an example. In practical applications, the above functions can be allocated to different functional units and modules as needed, that is, the internal structure of the device is divided into different functional units or modules to implement all or part of the functions described above. Each unit and module of the device can be implemented by corresponding hardware or software units. Each unit and module can be an independent software or hardware unit, or integrated into a software or hardware unit, which is not used to limit the present invention. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of the present application. The specific working process of the units and modules in the device can refer to the corresponding description in the foregoing method embodiments and will not be elaborated herein.
[0049] Embodiment Three: Figure 3 The structure of the computing device provided in Embodiment Three of the present invention is shown. For the convenience of description, only the parts related to the embodiments of the present invention are shown.
[0050] The computing device 3 in the embodiments of the present invention includes a processor 30, a memory 31, and a computer program 32 stored in the memory 31 and executable on the processor 30. When the processor 30 executes the computer program 32, it implements the steps in the foregoing method embodiments of training a neural image analysis model, such as Figure 1 the steps S101 to S105 shown. Alternatively, when the processor 30 executes the computer program 32, it implements the functions of each unit in the foregoing device embodiments, such as Figure 2 the functions of the units shown.
[0051] In the embodiments of the present invention, a training model is constructed for the neural image analysis model. The training model includes a contrast learning module for contrast learning training, a domain adversarial module for domain adversarial training, and a classification module for NSSI subtype classification training. The source domain / target domain training samples for training are preprocessed respectively to obtain the source domain / target domain dFC matrix. Based on the source domain / target domain dFC matrix, the contrast loss, domain classification loss, and NSSI subtype classification loss are generated respectively through the contrast learning module, domain adversarial module, and classification module. A multi-objective joint loss function is constructed based on each loss, and the model parameters of the training model are updated according to the total loss until the training termination condition is met, completing the training of the neural image analysis model, thereby improving the training effect of the model, enabling the neural image analysis model to accurately identify the brain activity patterns related to NSSI behavior, improving the accuracy of NSSI subtype classification, and providing a scientific basis for early intervention.
[0052] The computing device in the embodiments of the present invention may be a personal computer. When the processor 30 in the computing device 3 executes the computer program 32 to implement the steps of a method for training a neuroimaging analysis model, reference may be made to the description of the foregoing method embodiments, which will not be elaborated herein.
[0053] Embodiment 4: In the embodiments of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the steps in the foregoing embodiments of the method for training a neuroimaging analysis model. For example, Figure 1 the steps S101 to S105 shown. Alternatively, when the computer program is executed by a processor, it implements the functions of each unit in the foregoing device embodiments. For example, Figure 2 the functions of the units shown.
[0054] In the embodiments of the present invention, a training model is constructed for the neuroimaging analysis model. The training model includes a contrast learning module for contrastive learning training, a domain adversarial module for domain adversarial training, and a classification module for NSSI subtype classification training. The source domain / target domain training samples for training are preprocessed respectively to obtain the source domain / target domain dFC matrix. Based on the source domain / target domain dFC matrix, the corresponding contrast loss, domain classification loss, and NSSI subtype classification loss are generated respectively through the contrast learning module, the domain adversarial module, and the classification module. A multi-objective joint loss function is constructed based on each loss, and the model parameters of the training model are updated according to the total loss until the training termination condition is met, completing the training of the neuroimaging analysis model, thereby improving the training effect of the model, enabling the neuroimaging analysis model to accurately identify the brain activity patterns related to NSSI behavior, improving the accuracy of NSSI subtype classification, and providing a scientific basis for early intervention.
[0055] The computer-readable storage medium in the embodiments of the present invention may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EEPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the embodiments of the present invention, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, apparatus, or device.
[0056] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the disclosed scope in the above embodiments is not limited to the technical solutions formed by the specific combination of the above technical features. At the same time, it should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
[0057] In addition, although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present invention. Certain features described in the context of separate embodiments may also be implemented combinatorially in a single embodiment. Conversely, the various features described in the context of a single embodiment may also be implemented separately or in any suitable sub-combination in multiple embodiments.
Claims
1. A training method for a neuroimaging analysis model, characterized in that, The method includes the following steps: Construct a training model for training a neuroimaging analysis model. The training model includes a contrastive learning module, a domain adversarial module, and a classification module. The contrastive learning module is used to perform contrastive learning training on the neuroimaging analysis model. The domain adversarial module is used to perform domain adversarial training on the neuroimaging analysis model. The classification module is used to perform NSSI subtype classification training on the neuroimaging analysis model; Preprocess the source domain training samples and target domain training samples for training the neuroimaging analysis model respectively to obtain corresponding source domain dFC matrices and target domain dFC matrices; Based on the source domain dFC matrix and the target domain dFC matrix, generate corresponding contrastive losses, domain classification losses, and NSSI subtype classification losses through the contrastive learning module, the domain adversarial module, and the classification module respectively; Construct a multi-objective joint loss function based on the contrastive loss, the domain classification loss, and the NSSI subtype classification loss; Update the model parameters of the training model according to the total loss of the multi-objective joint loss function until the training termination condition of the training model is satisfied, and complete the training of the neuroimaging analysis model.
2. The method according to claim 1, wherein The contrastive learning module includes a projection head for mapping high-dimensional features to a low-dimensional contrastive learning space. The domain adversarial module includes a domain classifier for predicting domain labels and a gradient reversal layer for reversing the gradient direction of the domain classification loss during backpropagation. The contrastive learning module and the domain adversarial module share the feature extractor in the neuroimaging analysis model. The gradient reversal layer is located between the feature extractor and the domain classifier. The classification module shares the classifier in the neuroimaging analysis model, and the classifier is used to predict NSSI subtype categories.
3. The method according to claim 2, wherein The step of generating corresponding contrastive losses, domain classification losses, and NSSI subtype classification losses through the contrastive learning module, the domain adversarial module, and the classification module respectively based on the source domain dFC matrix and the target domain dFC matrix includes: Input the source domain dFC matrix into the contrastive learning module; Perform data augmentation on the source domain dFC matrix using a preset data augmentation strategy to obtain a first data augmentation matrix and a second data augmentation matrix; Extract features from the first data augmentation matrix and the second data augmentation matrix respectively through the feature extractor to obtain corresponding first feature vectors and second feature vectors; Perform feature projection on the first feature vector and the second feature vector respectively through the projection head to obtain a first projection vector and a second projection vector; Calculate the contrastive loss based on the similarity between the first projection vector and the second projection vector.
4. The method according to claim 3, characterized in that The step of generating corresponding contrastive losses, domain classification losses, and NSSI subtype classification losses through the contrastive learning module, the domain adversarial module, and the classification module respectively based on the source domain dFC matrix and the target domain dFC matrix further includes: Input the first feature vector and the target domain dFC matrix into the domain adversarial module; The feature extractor extracts features from the target domain dFC matrix to obtain a target domain feature vector; The domain classifier predicts domain labels for the first feature vector and the target domain feature vector, and calculates the domain classification loss according to the domain label prediction result.
5. The method according to claim 3, wherein The steps of generating corresponding contrast loss, domain classification loss, and NSSI subtype classification loss through the contrast learning module, the domain adversarial module, and the classification module based on the source domain dFC matrix and the target domain dFC matrix further include: Input the first feature vector into the classification module; The classifier performs NSSI subtype classification prediction on the first feature vector, and calculates the NSSI subtype classification loss according to the classification prediction result.
6. The method according to claim 2, wherein The feature extractor includes a preprocessing layer, a self-attention encoder based on the Transformer architecture, and a pooling layer. The preprocessing layer is used for linear transformation, the self-attention encoder is used to capture long-term dependencies of brain region connections, the pooling layer is used to compress the time dimension. The self-attention encoder contains 6 layers of Transformer encoder layers, and each layer of the Transformer encoder layer uses an 8-head self-attention mechanism. The classifier consists of a single-layer linear layer and a LogSoftmax function. The single-layer linear layer is used to map the high-dimensional feature vector output by the feature extractor to a two-dimensional category space, and the LogSoftmax function is used to convert the output of the single-layer linear layer into a probability distribution.
7. A training device for a neuroimaging analysis model, characterized in that, The device includes: A training model construction unit for constructing a training model for training a neuroimaging analysis model. The training model includes a contrast learning module, a domain adversarial module, and a classification module. The contrast learning module is used to perform contrast learning training on the neuroimaging analysis model, the domain adversarial module is used to perform domain adversarial training on the neuroimaging analysis model, and the classification module is used to perform NSSI subtype classification training on the neuroimaging analysis model; A training sample preprocessing unit for preprocessing the source domain training sample and the target domain training sample for training the neuroimaging analysis model respectively to obtain corresponding source domain dFC matrix and target domain dFC matrix; A multi-objective loss generation unit for generating corresponding contrast loss, domain classification loss, and NSSI subtype classification loss through the contrast learning module, the domain adversarial module, and the classification module based on the source domain dFC matrix and the target domain dFC matrix; A loss function construction unit for constructing a multi-objective joint loss function based on the contrast loss, the domain classification loss, and the NSSI subtype classification loss; A model parameter update unit for updating the model parameters of the training model according to the total loss of the multi-objective joint loss function until the training termination condition of the training model is satisfied, and completing the training of the neuroimaging analysis model.
8. The device according to claim 7, wherein The contrastive learning module includes a projection head for mapping high-dimensional features to a low-dimensional contrastive learning space. The domain adversarial module includes a domain classifier for predicting domain labels and a gradient reversal layer for reversing the gradient direction of the domain classification loss during backpropagation. The contrastive learning module and the domain adversarial module share the feature extractor in the neuroimaging analysis model. The gradient reversal layer is located between the feature extractor and the domain classifier. The classification module shares the classifier in the neuroimaging analysis model, and the classifier is used to predict the NSSI subtype category. The multi-objective loss generation unit includes: A source domain matrix input unit for inputting the source domain dFC matrix into the contrastive learning module; A source domain matrix enhancement unit for enhancing the source domain dFC matrix using a preset data enhancement strategy to obtain a first data-enhanced matrix and a second data-enhanced matrix; A matrix feature extraction unit for respectively extracting features from the first data-enhanced matrix and the second data-enhanced matrix through the feature extractor to obtain corresponding first feature vectors and second feature vectors; A vector feature projection unit for respectively projecting the features of the first feature vector and the second feature vector through the projection head to obtain a first projection vector and a second projection vector; A contrastive loss calculation unit for calculating the contrastive loss based on the similarity between the first projection vector and the second projection vector.
9. A computing device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Cross-domain sentiment classification method based on comparative learning
CN116049406A
Environmental noise identification method, system, equipment and medium
CN117476036A
NSSI prediction method and system based on resting state fMRI signal, and computer equipment
CN118779754A
Contrast learning-based unsupervised field adaptive time sequence classification method and system
CN119903376A