A method and system for brain disease classification by reparameterization and stereo coding
Patent Information
- Application Number
- CN202311562154.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-22
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2043-11-22
AI Technical Summary
然而,这些模型往往只使用CNN,只关注局部特征,难以处理全局特征
[0033](1) This invention uses the BoTNet-S1 network as a baseline. First, it uses structural reparameterization technology to replace the 3×3CNN part with Rep3×3CNN. This reduces the number of network parameters and the prediction time, giving the network multi-scale CNN characteristics and improving the classification performance of the network in the CNN part. Then, it replaces the original multi-head self-attention mechanism in the sixth module of RepBoTNet with a stereo coding multi-head self-attention mechanism, so that the network considers the data from a three-dimensional perspective and introduces the channel dimension position information into the self-attention mechanism. This further improves the classification performance of the network in the Transformer part while keeping the number of network parameters unchanged.
Smart Images

Figure CN117333723B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer medical image analysis technology, and in particular to a method and system for classifying brain diseases using reparameterization and stereo coding. Background Technology
[0002] The brain is the control center of our body. With the continuous development of brain detection technologies, more and more brain diseases are being identified. Brain diseases can cause widespread harm to an individual's physical and cognitive functions. For example, Alzheimer's disease (AD), as a chronic neurodegenerative disease, gradually worsens over time, eventually leading to coma and death from complications such as infection; Autism Spectrum Disorder (ASD) causes patients to suddenly become withdrawn, aggressive, or lose language skills they have mastered, resulting in problems with social interaction and communication skills, and exhibiting limited repetitive behaviors, interests, or activity patterns; Parkinson's disease (PD) causes patients to experience motor symptoms such as bradykinesia, rigidity, resting tremor, and postural instability, as well as non-motor symptoms such as decreased sense of smell, constipation, sleep disorders, and depression.
[0003] Using structural magnetic resonance imaging (sMRI), this invention enables precise classification of brain diseases such as Alzheimer's disease (AD), Acute Myocardial Infarction (ASD), and Parkinson's disease (PD) at different stages of disease progression. sMRI, with its non-invasive, non-surgical nature and rich image information, has become a key imaging biomarker for analyzing the prodromal stages of brain diseases. Taking AD-assisted diagnostic tasks as an example, using the characteristics of neuroimaging data such as sMRI to differentiate between normal subjects (NC), mild cognitive impairment (MCI), and AD has become a hot topic. MCI is an intermediate state between normal controls (NC) and AD, and can be further divided into early MCI (EMCI) and late MCI (LMCI).
[0004] Convolutional Neural Networks (CNNs) are the most widely used deep learning techniques, and numerous studies have utilized CNNs to assist in the diagnosis of Alzheimer's disease (AD) using sMRI images. However, these models often only use CNNs, focusing on local features and struggling to handle global features. CNN networks often require stacking multiple layers to learn certain global features and improve the model's classification performance, which significantly increases computational costs.
[0005] Therefore, proposing a reparameterized and stereo-coded brain disease classification method and system to overcome the difficulties of existing technologies is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0006] In view of this, the present invention provides a reparameterized and stereo-coded brain disease classification method and system, which utilizes the RepBoTNet network model to extract richer and more effective features, thereby effectively improving the accuracy of disease classification when performing whole-brain structure analysis.
[0007] To achieve the above objectives, the present invention adopts the following technical solution:
[0008] A reparameterized and stereo-coded method for classifying brain diseases includes the following steps:
[0009] S1. Data Acquisition Steps: Acquire MRI data of brain diseases from the Alzheimer's Disease Neuroimaging Project dataset ADNI;
[0010] S2. Data processing steps: Preprocess the nuclear magnetic resonance data and divide the preprocessed nuclear magnetic resonance data into training set data, validation set data and test set data;
[0011] S3. Establish the RepBoTNet network model: Construct a BoTNet-S1 network model containing six modules, replace the 3×3CNN part in the BoTNet-S1 network model with the restructured Rep3×3CNN, and obtain the RepBoTNet network model containing six modules.
[0012] S4. Establish the RepBoTNet-CESA network model: Replace the original multi-head self-attention mechanism in the sixth module of the established RepBoTNet network model with a stereo coding multi-head self-attention mechanism to obtain the RepBoTNet-CESA network model.
[0013] S5. Model training steps: Input the training set data into the RepBoTNet-CESA network model for iteration. After each iteration, calculate the classification accuracy of the RepBoTNet-CESA network model based on the validation set data, and retain the model parameter with the highest accuracy on the validation set data up to the current iteration. When the maximum number of iterations is reached, output the model parameter to obtain the optimal RepBoTNet-CESA network model.
[0014] S6. Classification Steps: Input the test set data to be classified into the obtained optimal RepBoTNet-CESA network model to obtain the corresponding classification results.
[0015] Optionally, the Alzheimer's disease neuroimaging project dataset ADNI in S1 includes early EMCI data and late LMCI data.
[0016] Optionally, the specific content of building the RepBoTNet network model in S3 is as follows: replace the single-branch 3×3CNN part in the BoTNet-S1 network model with a multi-branch Rep3×3CNN.
[0017] By using the parallel 3×3CNN, 1×1CNN, and Identity branch in Rep3×3CNN, the information flow is modeled as follows:
[0018] y = x + g(x) + f(x)
[0019] g(x) = W 1×1 x+b 1×1
[0020] f(x) = W 3×3 x+b 3×3
[0021] Where y represents the output feature of this layer, x represents the input feature of this layer, g(x) represents the feature learned by the 1×1 CNN branch, and W 1×1 b 1×1 These represent the adaptive weights and biases learned during the forward propagation of the CNN, respectively, f(x) represents the features learned by the 3×3 CNN branches, and W... 3×3 b 3×3 These represent the adaptive weights and biases learned during the forward propagation of the CNN, respectively.
[0022] Optionally, in the above method, the specific content of building the RepBoTNet-CESA network model in S4 is as follows: the initial multi-head self-attention mechanism in the sixth module of RepBoTNet is replaced with a stereo encoding multi-head self-attention mechanism, so that the positional encoding stage of the self-attention mechanism introduces additional positional information in the channel dimension:
[0023] PE(x)=R c x c +R h x h +R w x w
[0024] Where PE represents feature encoding, x represents input feature, and x c x h x w These represent the features of input feature x in the Channel, Height, and Width dimensions, respectively. R c R h R w These represent the adaptive positional coding weights in the channel, height, and width dimensions, respectively.
[0025] A reparameterized and stereo-coded brain disease classification system, applying any one of the above-mentioned reparameterized and stereo-coded brain disease classification methods, includes: a data acquisition module, a data processing module, a RepBoTNet network model building module, a RepBoTNet-CESA network model building module, a model training module, and a classification module;
[0026] The data acquisition module, connected to the input of the data processing module, is used to acquire MRI data of brain diseases from the Alzheimer's Disease Neuroimaging Project dataset ADNI.
[0027] The data processing module, connected to the input of the RepBoTNet network model building module, is used to preprocess the nuclear magnetic resonance data and divide the preprocessed nuclear magnetic resonance data into training set data, validation set data and test set data.
[0028] A RepBoTNet network model module is established and connected to the input of the RepBoTNet-CESA network model module to construct a BoTNet-S1 network model containing six modules. The 3×3CNN part in the BoTNet-S1 network model is replaced with the structurally reparameterized Rep3×3CNN to obtain a RepBoTNet network model containing six modules.
[0029] A RepBoTNet-CESA network model module is established and connected to the input of the model training module. This module is used to replace the original multi-head self-attention mechanism in the sixth module of the established RepBoTNet network model with a stereo coding multi-head self-attention mechanism, thus obtaining the RepBoTNet-CESA network model.
[0030] The model training module is connected to the input of the classification module. It is used to input the training set data into the RepBoTNet-CESA network model for iteration. After each iteration, the classification accuracy of the RepBoTNet-CESA network model is calculated based on the validation set data. The model parameter with the highest accuracy on the validation set data up to the current iteration is retained. When the maximum number of iterations is reached, the model parameter is output to obtain the optimal RepBoTNet-CESA network model.
[0031] The classification module, connected to the output of the model training module, is used to input the test set data to be classified into the optimal RepBoTNet-CESA network model to obtain the corresponding classification results.
[0032] As can be seen from the above technical solution, compared with the prior art, the present invention provides a reparameterized and stereo-coded brain disease classification method and system, which has the following beneficial effects:
[0033] (1) This invention uses the BoTNet-S1 network as a baseline. First, it uses structural reparameterization technology to replace the 3×3CNN part with Rep3×3CNN. This reduces the number of network parameters and the prediction time, giving the network multi-scale CNN characteristics and improving the classification performance of the network in the CNN part. Then, it replaces the original multi-head self-attention mechanism in the sixth module of RepBoTNet with a stereo coding multi-head self-attention mechanism, so that the network considers the data from a three-dimensional perspective and introduces the channel dimension position information into the self-attention mechanism. This further improves the classification performance of the network in the Transformer part while keeping the number of network parameters unchanged.
[0034] (2) The constructed RepBoTNet-CESA network model combines the advantages of CNN networks in capturing local information and Transformer networks in integrating global information, thereby reducing computational costs while achieving sufficiently good performance indicators.
[0035] (3) By constructing the RepBoTNet-CESA network model, richer and more effective features can be extracted, and the regions of interest are less likely to be lost. When analyzing the whole brain structure, the accuracy of disease classification can be effectively improved. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0037] Figure 1 A flowchart of a brain disease classification method based on reparameterization and stereo coding provided by the present invention;
[0038] Figure 2 The present invention provides different structures for Rep3×3CNN in the training and prediction phases, where a is the training phase structure and b is the prediction phase structure.
[0039] Figure 3 The schematic diagram of reparameterization provided for this invention;
[0040] Figure 4 A schematic diagram of the stereo coding multi-head self-attention mechanism provided by the present invention;
[0041] Figure 5 This is a schematic diagram of the overall structure of the RepBoTNet-CESA network model provided by the present invention. Detailed Implementation
[0042] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0043] Reference Figure 1 As shown, this invention discloses a method for classifying brain diseases using reparameterization and stereo coding, comprising the following steps:
[0044] S1. Data Acquisition Steps: Acquire MRI data of brain diseases from the Alzheimer's Disease Neuroimaging Project dataset ADNI;
[0045] S2. Data processing steps: Preprocess the nuclear magnetic resonance data and divide the preprocessed nuclear magnetic resonance data into training set data, validation set data and test set data;
[0046] S3. Establish the RepBoTNet network model: Construct a BoTNet-S1 network model containing six modules, replace the 3×3CNN part in the BoTNet-S1 network model with the restructured Rep3×3CNN, and obtain the RepBoTNet network model containing six modules.
[0047] S4. Establish the RepBoTNet-CESA network model: Replace the original multi-head self-attention mechanism in the sixth module of the established RepBoTNet network model with a stereo coding multi-head self-attention mechanism to obtain the RepBoTNet-CESA network model.
[0048] S5. Model training steps: Input the training set data into the RepBoTNet-CESA network model for iteration. After each iteration, calculate the classification accuracy of the RepBoTNet-CESA network model based on the validation set data, and retain the model parameter with the highest accuracy on the validation set data up to the current iteration. When the maximum number of iterations is reached, output the model parameter to obtain the optimal RepBoTNet-CESA network model.
[0049] S6. Classification Steps: Input the test set data to be classified into the obtained optimal RepBoTNet-CESA network model to obtain the corresponding classification results.
[0050] Furthermore, the Alzheimer's disease neuroimaging project dataset ADNI in S1 includes early EMCI data and late LMCI data.
[0051] Furthermore, the specific content of building the RepBoTNet network model in S3 is as follows: the single-branch 3×3CNN part in the BoTNet-S1 network model is replaced with a multi-branch Rep3×3CNN;
[0052] By using the parallel 3×3CNN, 1×1CNN, and Identity branch in Rep3×3CNN, the information flow is modeled as follows:
[0053] y = x + g(x) + f(x)
[0054] g(x) = W 1×1 x+b 1×1
[0055] f(x) = W 3×3 x+b 3×3
[0056] Where y represents the output feature of this layer, x represents the input feature of this layer, g(x) represents the feature learned by the 1×1 CNN branch, and W 1×1 b 1×1 These represent the adaptive weights and biases learned during the forward propagation of the CNN, respectively, f(x) represents the features learned by the 3×3 CNN branches, and W... 3×3 b 3×3 These represent the adaptive weights and biases learned during the forward propagation of the CNN, respectively.
[0057] Specifically, except for the first downsampling Rep3×3CNN layer in each module, the remaining Rep3×3CNN layers must ensure that the input and output NMR data sizes remain unchanged, resulting in feature maps of the following dimensions x. l :
[0058]
[0059] Among them, Size output Size represents the output data size of the current Rep3×3CNN layer. input represents the input data size of the previous network layer, p represents the padding of the CNN layer, and s represents the stride of the CNN layer.
[0060] To ensure that the dimensions of the input and output NMR data remain unchanged, the parallel 3×3CNN in the non-downsampled Rep3×3CNN layer is padded with 1s and has a stride of 1; the 1×1CNN is padded with 0s and has a stride of 1.
[0061] Furthermore, the specific content of establishing the RepBoTNet-CESA network model in S4 is as follows: the initial multi-head self-attention mechanism in the sixth module of RepBoTNet is replaced with a stereo encoding multi-head self-attention mechanism, so that the positional encoding stage of the self-attention mechanism introduces additional positional information in the channel dimension:
[0062] PE(x)=R c x c +R h x h +R w x w
[0063] Where PE represents feature encoding, x represents input feature, and x c x h x w These represent the features of input feature x in the Channel, Height, and Width dimensions, respectively. R c R h R w These represent the adaptive positional coding weights in the channel, height, and width dimensions, respectively.
[0064] In one specific embodiment, the following is included:
[0065] (I) S1, the specific content of the data to be obtained is as follows:
[0066] Data was collected using the Alzheimer's Disease Neuroimaging Project Dataset (ADNI). A total of 433 T1-weighted structural MRI scans were acquired from the ADNI database, from 30 AD patients, 24 EMCI patients, 25 LMCI patients, and 26 normal controls (NC). A given dataset of MRI images for each subject was provided. The dataset contained MRI images and subject labels, denoted as D = {(d...} i ,c j )|i∈[1,R],j∈L}, where d represents the magnetic resonance image, c represents the corresponding label of the subject, R represents the number of samples, i represents the sample subscript, j represents the label subscript, L=[1,4] represents the label space, which represents the four categories AD, EMCI, LMCI and NC respectively;
[0067] (II) The specific content of S2 data processing is as follows:
[0068] S2.1 First, the complete set of magnetic resonance images D obtained from S1 was converted from DICOM format image files to NII format image files using SPM12 and saved in a multi-level folder. A Python script was then written using the Nibabel toolkit to read the NII format magnetic resonance image files from the multi-level folder and save them into a single folder, ensuring that all scan data from multiple subjects were stored in the same folder.
[0069] Based on the data obtained in S2.1, S2.2 writes a MATLAB script to automatically perform AC-PC origin correction for all sMRI images in the folder.
[0070] Based on the data obtained in S2.2, S2.3 uses the CAT12 toolkit to segment the NII format magnetic resonance image data into gray matter (GM), white matter (WM), and cerebrospinal fluid (CSF) image data.
[0071] S2.4, based on S2.3, defines the grayscale image as I, with its output dimension Size. I The initial data size of I is 137×113×113. Keeping the channel dimension of I unchanged, zeros are padded in the height and width dimensions, expanding the height and width dimensions to 128. Therefore, the final data dimension of I is 137×128×128. The preprocessed dataset is then divided into training / validation and test sets D using a five-fold cross-validation method. test ={(d i ,c j )|i∈[1,N test ],j∈[1,4]}, and then the training and validation sets are divided into training set D in a 3:1 ratio. train ={(d i ,c j )|i∈[1,N train ],j∈[1,4]} and the verification set D validation ={(d i ,c j )|i∈[1,N validation ],j∈[1,4]}, where N train N represents the total number of training set data. validation N represents the total number of data points in the validation set. test This represents the total number of data points in the test set.
[0072] (III) The specific content of S3 in establishing the RepBoTNet network model is as follows:
[0073] S3.1 Construct the BoTNet-S1 network model, as shown in Table 1. The model will consist of 6 modules; among them,
[0074] The first module consists of a 7×7 CNN layer with an output channel size of 64, a stride of 2, and padding of 3.
[0075] The second module consists of a 3×3 Max Pooling with a stride of 2 and padding of 1, and three Bottleneck Blocks. Each Bottleneck Block is composed of a 1×1 CNN with 64 output channels, a 3×3 CNN with 64 output channels, a stride of 1, and padding of 1, and a 1×1 CNN with 256 output channels, in that order.
[0076] The third module contains four similar Bottleneck Blocks, consisting of a 1×1 CNN with 128 output channels, a 3×3 CNN with 128 output channels and padding of 1, and a 1×1 CNN with 512 output channels. The first Bottleneck Block is a downsampled Bottleneck Block with a stride of 2 for the 3×3 CNN, while the stride of the 3×3 CNNs in the other Bottleneck Blocks is 1.
[0077] The fourth module contains six similar Bottleneck Blocks, consisting of a 1×1 CNN with 256 output channels, a 3×3 CNN with 256 output channels and padding of 1, and a 1×1 CNN with 1024 output channels; the first Bottleneck Block is a downsampled Bottleneck Block.
[0078] The fifth module consists of a variant of the Bottleneck Block, replacing the 3×3 CNN in the Bottleneck Block with a multi-head self-attention mechanism (MHSA) layer. It consists of a 1×1 CNN with 512 output channels, a multi-head self-attention mechanism layer with 512 output channels, and a 1×1 CNN with 2048 output channels. This module does not contain a downsampling layer.
[0079] The sixth module contains one Adaptive Average Pooling layer, one Dropout layer with a probability of 0.3, and one fully connected layer whose output channels are the number of labels for the current task, reducing the data dimensionality to the label space. In the final Classification layer, the final feature vector extracted by the network is used to calculate the probability of the categories using the SoftMax function, achieving the final classification. The probability calculation formula is as follows:
[0080]
[0081] The function takes M distinct feature values as input from the fully connected layer, W represents the weight coefficients of the different features calculated by the network model, P represents the probability that the feature vector x belongs to the c-th category, and the category to which the input image belongs is the category c with the largest P value.
[0082] Table 1. Parameters of each module in the BoTNet-S1 model
[0083]
[0084] S3.2 replaces the 3×3CNN portion in all Bottleneck Blocks of the model constructed in S3.1 with Rep3×3CNN. Rep3×3CNN consists of parallel 3×3CNN, 1×1CNN, and an Identity branch, modeling the information flow as follows:
[0085] y = x + g(x) + f(x)
[0086] g(x) = W 1×1 x+b 1×1
[0087] f(x) = W 3×3 x+b 3×3
[0088] Where y represents the output feature of this layer, x represents the input feature of this layer, g(x) represents the feature learned by the 1×1 CNN branch, and W 1×1 b 1×1 These represent the adaptive weights and biases learned during the forward propagation of the CNN, respectively, f(x) represents the features learned by the 3×3 CNN branches, and W... 3×3 b 3×3 These represent the adaptive weights and biases learned during the forward propagation of the CNN, respectively.
[0089] S3.3 transforms the Rep3×3CNN model built in S3.2 into a multi-branch CNN during training, but converts it to a single-branch 3×3CNN during prediction using structural reparameterization. The differences between the training and prediction phases of Rep3×3CNN are as follows: Figure 2 As shown, a represents the training phase structure and b represents the prediction phase structure.
[0090] To achieve better visualization, each CNN layer (a flat rectangle) is called a convolutional block (a square), and C2 = C1 = 2. Therefore, a 3×3 convolutional block has four 3×3 parameter matrices, and a 1×1 convolutional block has four 1×1 parameter matrices. Also for visualization purposes, in... Figure 3The B-parameter layer only shows the intermediate parameter layer where the 1×1 and Identity parameters in the 3×3 parameter matrix are not zero. (Using...) To represent a 3×3 convolutional block with C1 input channels and C2 output channels, use Let μ represent a 1×1 convolutional block with input channel C1 and output channel C2. (3) , σ (3) γ (3) ,β (3) To express the mean, standard deviation, learnable scaling factor, and bias of the BN layer located after the 3×3 convolutional block, use μ. (1) , σ (1) γ (1) ,β (1) To express the mean, standard deviation, learnable scaling factor, and bias of the BN layer following the 1×1 convolutional block, use μ. (0) , σ (0) γ (0) ,β (0) This is used to express the mean, standard deviation, learnable scaling factor, and bias of the BN layer on the Identity branch. Simultaneously, using... To represent input, use The asterisk (*) represents the output, and the asterisk (*) represents the convolution operator. Given C1 = C2, H1 = H2, and W1 = W2, we can obtain:
[0091] M (2) =bn(M (1) *W (3) ,μ (3) ,σ (3) ,γ (3) ,β (3) )+bn(M (1) *W (1) ,μ (1) ,σ (1) ,γ (1) ,β (1) )+bn(M (1) ,μ (0) ,σ (0) ,γ (0) ,β (0) )
[0092] When the input and output dimensions do not match (i.e., when using downsampled 3D-RepVGG blocks), the Identity branch is not used; in this case, only the first two terms of the above equation hold true. The Batch Normalization (BN) layer within the prediction phase is then used. have:
[0093]
[0094] Next, each BN layer and the convolutional blocks preceding it are transformed into convolutional blocks with bias vectors, essentially "merging" the BN layers with their corresponding convolutional blocks. Let {W′, b′} represent the weights and biases of the transformed convolutional block, then:
[0095]
[0096]
[0097] Combining the above formulas, we can obtain
[0098] bn(M,μ,σ,γ,β) :,i,:,: =(M*W′) :,i,:,: +b′ i
[0099] Since the Identity branch can be viewed as a 1×1 convolutional block with the identity matrix as weights, the above formula also applies to the Identity branch. Considering the Identity branch as a 1×1 convolutional block, a Rep3×3 convolutional layer will have one 3×3 weight matrix, two 1×1 weight matrices, and three bias vectors. The three bias vectors are directly added together to obtain the final bias. To ensure the input and output dimensions match, 1×1 convolutional blocks with zero values are padded around the original 1×1 convolutional blocks, combining them into a single 3×3 convolutional block. This results in three 3×3 convolutional blocks, which can be directly added together. Finally, the three branches of the Rep3×3CNN layer are "fused" into a single 3×3CNN using the formula. The specific process is as follows: Figure 3 As shown.
[0100] (iv) The specific content of establishing the RepBoTNet-CESA network model is as follows:
[0101] To further optimize the model, the original multi-head self-attention mechanism in the fifth module of RepBoTNet was replaced with a stereo-encoded multi-head self-attention mechanism (CESA), forming the RepBoTNet-CESA network model. In the Position Embedding stage of the Transformer part, learnable variables R were set not only in the height and width dimensions... h R w Furthermore, a learnable variable R was set at the channel dimension. cThis model considers not only information in the height and width dimensions of the image, but also information in the image channel dimension. That is, when learning about lesions for AD-assisted diagnosis, the model does not determine the lesions solely from the two-dimensional direction of the sMRI image, thus severing the channel dimension information. Instead, it learns the lesions from a three-dimensional perspective, integrating the three-dimensional information of the sMRI image, which is more consistent with real-life situations. The positional encoding formula for the stereo-encoded multi-head self-attention mechanism is as follows:
[0102] PE(x)=R c x c +R h x h +R w x w
[0103] Where PE represents feature encoding, x represents input feature, and x c x h x w These represent the features of input feature x in the Channel, Height, and Width dimensions, respectively. R c R h R w These represent the adaptive positional coding weights in the channel, height, and width dimensions, respectively.
[0104] The structure of a multi-head self-attention mechanism in stereo coding is as follows: Figure 4 As shown, the Content-Cubic-Embedding operation, circled in red, represents a cubic encoding operation on the data, where R... c R h R w These represent the learnable encoding variables set in the channel, height, and width dimensions, respectively. Furthermore, it can be seen that the input and output data dimensions are consistent, both being H×W×d, where H represents height, W represents width, and d represents the channel dimension after data is divided into multiple heads. Figure 5 This is a schematic diagram of the overall structure of the RepBoTNet-CESA network model.
[0105] (V) The specific steps for training the S5 model are as follows:
[0106] The network was trained and the model parameters were adjusted through 40 iterations of backpropagation.
[0107] S5.1 is trained by backpropagation using the model optimized by S1.1 and S2.1, and the SGD optimizer is used to optimize the model training process.
[0108] S5.2 training uses the classification cross-entropy loss function to calculate the training loss Loss. The smaller the Loss, the greater the feature discrimination of the trained model, and the better the model's classification performance on the training data. The specific formula is as follows:
[0109]
[0110] Where num represents the number of categories; c represents the category label; y represents the category variable (0 or 1), which is 1 if the category is the same as the sample's category, and 0 otherwise; p represents the predicted probability that the sample belongs to category c, calculated by Softmax.
[0111] (vi) The specific details of the S6 classification steps are as follows:
[0112] Each iteration trains the model using the methods described in S5.1 and S5.2, and the optimal model is then tested on the test set to perform a classification task. The model is evaluated using the following metrics: accuracy (ACC), precision (PRE), sensitivity (SEN), F1-Score, and ROC curve, with the ROC curve compared using its area under the curve (AUC).
[0113]
[0114]
[0115]
[0116]
[0117]
[0118] TP, TN, FP, and FN represent the number of true positives, true negatives, false positives, and false negatives classified by the model for a given set of data, respectively. Precision, also known as accuracy, represents the probability that the model predicts correctly; accuracy, also known as positive predictive value (PPV), is the ratio of predicted positive cases to the actual number of positive cases; sensitivity, also known as recall, is the probability that a predicted positive case is correctly predicted, reflecting the model's sensitivity to different category features. Higher values for all three metrics indicate better model performance.
[0119] In another specific embodiment, the details are as follows:
[0120] During model training, the initial learning rate was 0.00001. In the SGD optimizer, momentum optimization was used to optimize training iterations, with an initial Gamma parameter of 0.1, a Momentum parameter of 0.9, and a weight decay coefficient of 0.0001. The model was implemented using PyTorch and trained and validated on an Intel i5 9400 CPU and NVIDIA TITAN X GPU platform, with the best model saved after 40 training iterations.
[0121] Based on the classification results of the best-performing model trained and saved, applied to the test set, RepBoTNet-CESA performed excellently on various AD auxiliary diagnostic tasks, achieving 96.58% accuracy on the AD / NC task, 92.75% accuracy on the EMCI / NC task, and 80.97% accuracy on the AD / EMCI / LMCI / NC task. Detailed classification performance parameters of the model on the test set are shown in Table 2. It can be seen that the overall performance is satisfactory. The model can effectively capture the spatial information of MRI data, perform a comprehensive analysis of changes in brain structure, and has high sensitivity to diseases, making the auxiliary diagnosis highly reliable. It can also be observed that as the difficulty of the classification task increases, there are certain differences in the results between different tasks.
[0122] Table 2 shows the evaluation results of the proposed model on the test set.
[0123]
[0124] The RepBoTNet-CESA-based method outperformed other methods in binary classification tasks (AD vs. NC, EMCI vs. NC) and quadruple classification tasks (AD / EMCI / LMCI / NC). As shown in Table 3, compared to Hu et al.'s method, RepBoTNet-CESA improved accuracy by 3.48% on the AD / NC task; compared to Rallabandi et al.'s method, it improved accuracy by 6.97% on the AD / EMCI / LMCI / NC task; compared to Jie et al.'s method, it improved accuracy by 11.28%, 11.65%, and 23.37% on the three AD-assisted diagnosis tasks, respectively; and compared to Gao et al.'s method, it improved accuracy by 3.48%, 8.15%, and 23.67% on the three AD-assisted diagnosis tasks, respectively. It can also be seen that as the difficulty of the classification task increases, the performance of the model decreases slightly, but the model proposed in this invention still maintains good results. This not only further proves the robustness of the classification of the model in this invention, but also proves the reliability of the model for disease diagnosis.
[0125] Table 3. Comparison of RepBoTNet-CESA with other existing methods in AD-assisted diagnosis tasks.
[0126] Hu et al. 93.10 -- -- Rallabandi et al. -- -- 74.00 Jie et al. 85.30 81.10 57.60 Gao et al. 95.10 84.60 57.30 RepBoTNet-CESA 96.58 92.75 80.97
[0127] The ROC curve graphically combines sensitivity and specificity, accurately reflecting the relationship between the specificity and sensitivity of an analytical method and serving as a comprehensive representation of experimental accuracy. The area under the ROC curve (AUC) is a numerical measure that directly evaluates the classifier's performance; a higher value is better. An AUC greater than 0.5 is generally considered to indicate strong recognition ability, while an AUC less than 0.5 is considered to indicate no recognition ability. The average AUC calculated using five-fold cross-validation is shown in Table 4.
[0128] Table 4 shows that the AUC for AD relative to other classes is 0.932, EMCI is 0.952, and LMCI is 0.927, indicating that the model exhibits excellent four-class classification performance and high robustness. The area under the micro-mean ROC curve is 0.944, and the macro-mean is 0.950, demonstrating the model's overall good classification performance. This is highly helpful for the auxiliary diagnosis of AD and intervention in the early stages of the disease. The experimental model was used to train two binary classification tasks, and the best model was used to classify on the test set. The classification results show that the model has good generalization ability. Comparing the AUC values of the two binary classification models in the table below shows that the model of this invention still has excellent performance in binary classification tasks.
[0129] Table 4. Area Under the ROC Curve (AUC)
[0130]
[0131] Conclusion: (1) The RepBoTNet network structure built using Rep3×3CNN in this invention can use a more complex network structure during the training phase to obtain better classification performance. During the prediction phase, the network model is equivalently converted into a smaller network structure while retaining the obtained classification results, saving computational resources and accelerating the prediction speed. This gives the network model certain multi-scale convolutional characteristics, combining the advantages of CNN networks in capturing local information and Transformer networks in integrating global information.
[0132] (2) This invention utilizes a stereo coding multi-head self-attention mechanism to optimize the network model, allowing the model to consider not only the information in the high and wide dimensions of the data, but also the information in the channel dimension, to learn the lesion from a three-dimensional perspective, integrate the three-dimensional information of the magnetic resonance image, make the model more realistic, and obtain better classification results.
[0133] (3) The method of the present invention uses preprocessed data to train the model. Data preprocessing is used to remove noise and artifacts in the data, thereby improving the quality of the image. The data through the preprocessed channel not only preserves the necessary structural features of the brain, but also eliminates unnecessary individual differences, allowing the experimental model to extract and learn more important features.
[0134] and Figure 1 Corresponding to the method described above, this embodiment of the invention also provides a reparameterized and stereo-coded brain disease classification system for classifying brain diseases. Figure 1 The specific implementation of the method includes: a data acquisition module, a data processing module, a RepBoTNet network model building module, a RepBoTNet-CESA network model building module, a model training module, and a classification module;
[0135] The data acquisition module, connected to the input of the data processing module, is used to acquire MRI data of brain diseases from the Alzheimer's Disease Neuroimaging Project dataset ADNI.
[0136] The data processing module, connected to the input of the RepBoTNet network model building module, is used to preprocess the nuclear magnetic resonance data and divide the preprocessed nuclear magnetic resonance data into training set data, validation set data and test set data.
[0137] A RepBoTNet network model module is established and connected to the input of the RepBoTNet-CESA network model module to construct a BoTNet-S1 network model containing six modules. The 3×3CNN part in the BoTNet-S1 network model is replaced with the structurally reparameterized Rep3×3CNN to obtain a RepBoTNet network model containing six modules.
[0138] A RepBoTNet-CESA network model module is established and connected to the input of the model training module. This module is used to replace the original multi-head self-attention mechanism in the sixth module of the established RepBoTNet network model with a stereo coding multi-head self-attention mechanism, thus obtaining the RepBoTNet-CESA network model.
[0139] The model training module is connected to the input of the classification module. It is used to input the training set data into the RepBoTNet-CESA network model for iteration. After each iteration, the classification accuracy of the RepBoTNet-CESA network model is calculated based on the validation set data. The model parameter with the highest accuracy on the validation set data up to the current iteration is retained. When the maximum number of iterations is reached, the model parameter is output to obtain the optimal RepBoTNet-CESA network model.
[0140] The classification module, connected to the output of the model training module, is used to input the test set data to be classified into the optimal RepBoTNet-CESA network model to obtain the corresponding classification results.
[0141] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for classifying brain diseases using reparameterization and stereo coding, characterized in that, Includes the following steps: S1. Data Acquisition Steps: Acquire MRI data of brain diseases from the Alzheimer's Disease Neuroimaging Project dataset ADNI; S2. Data processing steps: Preprocess the nuclear magnetic resonance data and divide the preprocessed nuclear magnetic resonance data into training set data, validation set data and test set data; S3. Establish the RepBoTNet network model: Construct a BoTNet-S1 network model containing six modules, replace the 3×3 CNN part in the BoTNet-S1 network model with the re-parameterized Rep3×3 CNN, and obtain the RepBoTNet network model containing six modules. S4. Establish the RepBoTNet-CESA network model: Replace the original multi-head self-attention mechanism in the fifth module of the established RepBoTNet network model with a stereo coding multi-head self-attention mechanism to obtain the RepBoTNet-CESA network model. S5. Model training steps: Input the training set data into the RepBoTNet-CESA network model for iteration. After each iteration, calculate the classification accuracy of the RepBoTNet-CESA network model based on the validation set data, and retain the model parameter with the highest accuracy on the validation set data up to the current iteration. When the maximum number of iterations is reached, output the model parameter to obtain the optimal RepBoTNet-CESA network model. S6. Classification Steps: Input the test set data to be classified into the obtained optimal RepBoTNet-CESA network model to obtain the corresponding classification results; The specific content of building the RepBoTNet-CESA network model in S4 is as follows: the initial multi-head self-attention mechanism in the sixth module of RepBoTNet is replaced with a stereo coding multi-head self-attention mechanism, so that the positional encoding stage of the self-attention mechanism introduces additional positional information in the channel dimension: in, PE Representative feature encoding, x Represents input features, x c , x h , x w Representing the input features respectively x Features in the Channel, Height, and Width dimensions. R c , R h , R w These represent the adaptive positional coding weights in the channel, height, and width dimensions, respectively.
2. The brain disease classification method based on reparameterization and stereo coding according to claim 1, characterized in that, The Alzheimer's disease neuroimaging project dataset ADNI in S1 includes early EMCI data and late LMCI data.
3. The brain disease classification method based on reparameterization and stereo coding according to claim 1, characterized in that, The specific content of building the RepBoTNet network model in S3 is as follows: the single-branch 3×3 CNN part in the BoTNet-S1 network model is replaced with a multi-branch Rep3×3 CNN; By using parallel 3×3 CNN, 1×1 CNN, and Identity branch in Rep3×3 CNN, the information flow is modeled as follows: in, y This represents the output feature of this layer. x This represents the input features of this layer. g(x) This represents the features learned by the 1×1 CNN branch. W 1×1 、b 1×1 These represent the adaptive weights and biases learned during the forward propagation of the CNN, respectively. f(x) This represents the features learned by the 3×3 CNN branches. W 3×3 、b 3×3 These represent the adaptive weights and biases learned during the forward propagation of the CNN, respectively.
4. A reparameterized and stereo-coded brain disease classification system, characterized in that, A brain disease classification method using reparameterization and stereo coding as described in any one of claims 1-3 includes: a data acquisition module, a data processing module, a RepBoTNet network model building module, a RepBoTNet-CESA network model building module, a model training module, and a classification module; The data acquisition module, connected to the input of the data processing module, is used to acquire MRI data of brain diseases from the Alzheimer's Disease Neuroimaging Project dataset ADNI. The data processing module, connected to the input of the RepBoTNet network model building module, is used to preprocess the nuclear magnetic resonance data and divide the preprocessed nuclear magnetic resonance data into training set data, validation set data and test set data. A RepBoTNet network model module is established and connected to the input of the RepBoTNet-CESA network model module to construct a BoTNet-S1 network model containing six modules. The 3×3 CNN part in the BoTNet-S1 network model is replaced with a Rep3×3 CNN with re-parameterized structure to obtain a RepBoTNet network model containing six modules. A RepBoTNet-CESA network model module is established and connected to the input of the model training module. This module is used to replace the original multi-head self-attention mechanism in the sixth module of the established RepBoTNet network model with a stereo coding multi-head self-attention mechanism, thus obtaining the RepBoTNet-CESA network model. The model training module is connected to the input of the classification module. It is used to input the training set data into the RepBoTNet-CESA network model for iteration. After each iteration, the classification accuracy of the RepBoTNet-CESA network model is calculated based on the validation set data. The model parameter with the highest accuracy on the validation set data up to the current iteration is retained. When the maximum number of iterations is reached, the model parameter is output to obtain the optimal RepBoTNet-CESA network model. The classification module, connected to the output of the model training module, is used to input the test set data to be classified into the optimal RepBoTNet-CESA network model to obtain the corresponding classification results.
Citation Information
Patent Citations
Brain disease classification system based on self-attention mechanism
CN109165667A
Alzheimer's disease classification method based on improved 3D CNN network
CN111738363A