Novel cerebral apoplexy image segmentation method
By using the Mamba network architecture and the NAMNet model of Gaussian error linear unit activation function in stroke image segmentation, combined with K-fold cross-validation and data enhancement technology, the problem of insufficient accuracy and generalization ability of stroke lesions is solved. Achieve more efficient and robust segmentation effect.
Patent Information
- Application Number
- CN202410780899.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-11-12
AI Technical Summary
There are challenges in the boundary segmentation of stroke lesions, and existing methods are difficult to achieve accurate segmentation in the context of large individual differences and complex lesion distribution. In particular, deep learning-based methods have shortcomings in the multi-stage decoder feature fusion and generalization capabilities.
Using the Mamba network architecture, combining the simplified spatial state model (SSM) and Gaussian error linear unit (GELU) activation function, the NAMNet model was designed to improve the accuracy and generalization of stroke image segmentation through K-fold cross-validation and data augmentation technology. ability to transform.
It improves the accuracy of stroke image segmentation and generalization ability of the model, reduces the risk of overfitting, enhances the adversariality and robustness, and ensures the reliability and stability of the segmentation results.
Smart Images

Figure CN118941785A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of image processing, and specifically designs a novel stroke image segmentation method. Background Art
[0002] Stroke is currently the third leading cause of death in the world, and is mainly divided into two categories: ischemic stroke and hemorrhagic stroke. Diagnostic analysis and timely treatment of these two conditions are the key to treatment. Especially in stroke treatment, accurate segmentation of ischemic and hemorrhagic stroke areas is crucial, because the segmentation results will directly affect treatment decisions and postoperative recovery. However, the boundary segmentation of stroke lesions still faces many challenges. Due to individual differences in stroke patients, there is significant variability in the distribution of their lesion areas. Although MRI provides high-contrast images, the complex structure of brain regions and the similar grayscale of healthy and lesion tissues make it difficult for commonly used methods to accurately segment. With the rapid development of deep learning technology, deep learning-based stroke segmentation methods have become a research hotspot.
[0003] In recent years, the model architecture for three-dimensional medical image processing with the help of the Transformer structure has been widely studied. For example, the structure ViT (Vision Transformer) used as an encoder to learn context information in the UNETR model is combined with the traditional CNN decoding structure. However, there is still the problem of fusion of multi-stage decoder features. Therefore, SwinUNETR uses SwinTransformer to perform multi-scale feature fusion, so as to achieve the fusion of features at each stage and obtain better image processing effects. In recent stages, the mamba algorithm has emerged; in many explorations, this structure has been used for multiple medical image segmentation applications. The U-Mamba algorithm integrates the mamba structure into the encoding layer of nnUNet to further enhance the segmentation effect of medical images.
[0004] Recently, the Mamba algorithm has shown its advantages in medical image segmentation. The U-Mamba algorithm integrates the Mamba structure into the encoding layer of nnUNet, further enhancing the segmentation effect of medical images. The Mamba algorithm is mainly innovative under the guidance of RNN technology, using a simplified SSM (spatial state model) architecture. Unlike the traditional SSM architecture, Mamba integrates linear attention-like blocks and multi-layer perceptron (MLP) blocks to construct Mamba blocks. This approach simplifies the SSM architecture and builds a more efficient segmentation model by integrating these two basic blocks. Summary of the invention
[0005] The present invention discloses a novel stroke image segmentation method, which aims to solve the problem that the effect of human stroke image segmentation needs to be improved, and explore the problems existing in the technical background.
[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0007] A novel stroke image segmentation method mainly includes the following three steps. Step 1, data set acquisition and preprocessing, step 2, model design and training; step 3, optimal model acquisition. The acquisition and preprocessing of the data set as the beginning of the method is to obtain the original human stroke data through image reshape, image reconstruction, data enhancement and other operations to achieve the main function of step 1, and then divide the data set into two types of data, training set and validation set, or add a test set according to a certain ratio. Take the training data set as input and input it into the designed human stroke segmentation network model in batches according to the set batch size to achieve the purpose of the training model described in step 2. According to the actual conditions, choose to perform a single training validation or multiple training validation methods, use the validation data set as input to validate the trained model, and judge the effect of the designed model by comparing the Dice value, so as to complete the main task of step 3.
[0008] The design of the human stroke segmentation model in Section 2 is particularly important. The present invention mainly relies on the Mamba network architecture, which mainly utilizes the simplified spatial state model (SSM) architecture. For the SSM block, its principle formula is as follows:
[0009] h'(t)=Ah(t)+Bx(t)
[0010] y(t)=Ch(t)
[0011]
[0012] y(t)=Ch(t)
[0013] in and The matrix represents the discrete parameters of the model, x(t) represents the input, and y(t) represents the output. For the Mamba model, its essence is equivalent to the following advantages:
[0014] 1. Explainability: The study revealed the mechanism of the Mamba model in NLP, especially the context learning and fact recall capabilities, and provided a theoretical basis for its application. However, explaining the effectiveness of Mamba in visual tasks remains challenging.
[0015] 2. Generalization and robustness: The hidden state of the Mamba model may accumulate information in a specific field, affecting its generalization performance. Its one-dimensional scanning strategy may capture domain bias and affect the processing of domain-independent information. Studies have shown that Visual Mamba (VMamba) has advantages in adversarial resilience and robustness, but has limitations in scalability. It is particularly susceptible to attacks on parameters B and C, and is particularly sensitive to the continuity of the scanning trajectory and the integrity of spatial information. Improving its generalization ability and robustness remains a challenge.
[0016] The activation function used in the model is Gaussian Error Linear Unit (GELU), which can make up for the disadvantage of ReLU activation function that it is not differentiable at some discontinuity points, so as to meet the requirement of zero mean of neural network processing data. This function has random regularity and nonlinearity to ensure the nonlinearity and generalization of the network. Its specific form is expressed as:
[0017] GELU(x)=x*p(X≤x)=x*Φ(x)
[0018]
[0019] Φ(x) represents the cumulative function of the Gaussian normal distribution of x, μ represents the mean of the normal distribution, and σ represents the standard deviation of the normal distribution. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A schematic diagram of a novel stroke image segmentation method of the present invention
[0021] Figure 2 A network diagram of a novel stroke image segmentation method of the present invention
[0022] Figure 3 Partial details of a novel stroke image segmentation method of the present invention DETAILED DESCRIPTION
[0023] The specific implementation of the present invention is described below in conjunction with the accompanying drawings and the content of the invention. A novel stroke image segmentation method mainly includes data preprocessing, model training and verification steps.
[0024] Among them, when selecting the data set, the present invention mainly uses the diffusion weighted image (DWI) of the stroke image. The designed stroke segmentation model is trained and verified with the help of 250 training data sets of the public data set ISLES2022 data set.
[0025] For the original stroke dataset obtained, according to Figure 1As shown, the data is first preprocessed according to the input requirements of the designed network structure to meet the input requirements of the segmentation network model designed by the present invention. The main steps include:
[0026] (1) Image standardization: Since the values of the acquired images in three dimensions are not exactly the same, in order to avoid problems caused by different voxel spacing (such as the model cannot recognize the image), a common method is to convert the grayscale values of the image to the same mean and variance distribution to eliminate the brightness and contrast differences between different images. The specific method is to upsample small pixels and downsample large pixels through cubic interpolation.
[0027] (2) Data augmentation: To increase the diversity of the dataset and prevent model overfitting, we use a variety of data augmentation techniques. These techniques include rotation, translation, scaling, flipping, and adding noise. Specifically, by randomly rotating the image, we can simulate different shooting angles; the translation operation helps simulate the situation of the image in different positions; the scaling operation can simulate the shooting effect at different distances; the flipping operation provides left-right or top-down mirrored images, increasing the variability of the data. In addition, adding noise can simulate the interference that may occur in the image acquisition process. These enhancement methods not only enrich the diversity of the training data, but also effectively improve the generalization ability of the model and reduce the risk of model overfitting.
[0028] (3) Dataset division: In the present invention, we adopt a method that is more conducive to verifying the stability and accuracy of the model - K-fold cross-validation. In K-fold cross-validation, we divide the data set into K subsets on average. In each training, one of the subsets is selected as the validation set, and the remaining K-1 subsets are used as training sets. This process is repeated K times, and a different subset is selected as the validation set each time. The final model performance is averaged by the results of all K validations to ensure that the evaluation results are more stable and reliable. K-fold cross-validation not only makes full use of all data, but also effectively detects the performance of the model on different data subsets, avoids overfitting of the model to a specific data set, and improves the generalization ability of the model.
[0029] Combination Figure 2 And the above invention content, based on the Mamba structure model NAMNet, in which the segmentation effect of the model is evaluated by calculating the Dice coefficient when verifying the model. Dice is a set similarity measurement function, which is usually used to calculate the similarity of two samples (the value range is [0,1]), and the calculation formula of Dice is as follows:
[0030]
[0031] Where |X∩Y| represents the intersection of X and Y, which in various segmentation tasks means the intersection between the label and the predicted result. Usually, to prevent the denominator from being 0, a value smooth is added to both the numerator and the denominator to avoid this; the model with the highest Dice value is selected as the best model.
[0032] Depend on Figure 3 The partial structure diagram of Mamba shown in the figure uses a simplified SSM (spatial state model) architecture based on the RNN structure; that is, the original two weights are replaced by two coefficients A and B, and the nonlinear activation function tanh is removed. Unlike the traditional CNN algorithm, it uses a "parallel scanning algorithm" instead of "convolution" to perform the cyclic calculation of the model; and merges the design of the SSM architecture with the MLP block of the transformer into one block to simplify the previous deep sequence model architecture, thereby obtaining an architecture design that includes a selective state space.
Claims
1. The general contents of a new stroke image segmentation method include the following parts: (1) Obtain public or private human stroke images and process them accordingly; (2) Divide the processed data into training set and test set according to the set ratio; (3) Establish a stroke segmentation model based on the mamba model; (4) The human stroke image dataset is trained and verified, and the value of the Dice loss function is used as an indicator of the segmentation effect.
2. A novel stroke image segmentation method according to claim 1, characterized in that: The specific method of obtaining a public or private human stroke image and performing corresponding processing in step (1) The following steps are involved: First, the background of the human stroke diffusion weighted imaging (DWI) image was cropped to remove the completely black area with a gray value of 0 appropriately to reduce the interference of background information on network learning, thereby improving the accuracy of the segmentation model. Secondly, in order to enhance the robustness of the network model and reduce the uncertainty in the model training process, data standardization was performed. During the normalization process, the voxel spacing in the dataset is adjusted to be consistent through interpolation. Images with lower resolutions are upsampled, while images with higher resolutions are downsampled to ensure that the spatial resolution of all images is consistent. In addition, the grayscale values of the images are converted to a distribution with the same mean and standard deviation to eliminate the brightness and contrast differences between different images, thereby reducing the impact of image deviations on model training. Then, data enhancement processing is performed to increase the diversity of training data through operations such as rotation, translation, scaling, and mirror flipping. This not only helps to improve the generalization ability of the model, but also effectively prevents the model from overfitting during training. Furthermore, in order to enhance the diversity and richness of the data, operations such as adding noise, color jittering, and random cropping can be performed to improve the quality and diversity of the data set from multiple perspectives, so that the trained model can better adapt to different practical application scenarios and complex clinical data. Ultimately, through these preprocessing steps, high-quality input data can be provided for the subsequent stroke image segmentation model, significantly improving the model's training effect and segmentation accuracy.
3. A novel stroke image segmentation method according to claim 1, characterized in that In step (2), the present invention adopts a method that is more conducive to verifying the stability and accuracy of the model - K-fold cross validation. In K-fold cross validation, we divide the data set into K subsets on average. In each training, one of the subsets is selected as the validation set, and the remaining K-1 subsets are used as training sets. This process is repeated K times, and a different subset is selected as the validation set each time. The final model performance is averaged by the results of all K verifications to ensure that the evaluation results are more stable and reliable. K-fold cross validation not only makes full use of all data, but also effectively detects the performance of the model on different data subsets, avoids overfitting of the model to a specific data set, and improves the generalization ability of the model.
4. A novel stroke image segmentation method according to claim 1, characterized in that In step (3), a model NAMNet based on the Mamba structure is established, which mainly uses a simplified spatial state model (SSM) architecture. Based on the structure of RNN, a simplified SSM (spatial state model) architecture is used; that is, the original two weights are replaced by two coefficients A and B, and the nonlinear activation function tanh is removed. Unlike the traditional CNN algorithm, it uses a parallel scanning algorithm instead of convolution to perform the model's cyclic calculations; and merges the SSM architecture design with the transformer's MLP block into one block to simplify the previous deep sequence model architecture, thereby obtaining an architecture design that includes a selective state space.
5. A novel stroke image segmentation method according to claim 1, characterized in that In step (4), the human stroke image dataset is trained and verified, and the size of the Dice loss function value is used as the segmentation effect indicator. Dice is a set similarity measurement function, which is usually used to calculate the similarity of two samples (the value range is [0,1]). Usually, in order to prevent the denominator from being 0, a numerical smooth is added to both the numerator and the denominator to avoid it; the model with the highest Dice value is selected as the best model. At the same time, the activation function used in the model is the Gaussian Error Linear Unit (GELU), which can make up for the disadvantage that the ReLU activation function is not differentiable at some discontinuity points, so as to meet the requirement of zero mean of the neural network processing data. The function has random regularity and nonlinearity to ensure the nonlinearity and generalization of the network.
Citation Information
Patent Citations
Cerebral stroke CT image segmentation method
CN113177943A
Pathological image processing method based on deep learning segmentation model, and electronic equipment
CN114581434A
Three-dimensional hydrocephalus CT image segmentation method based on deep learning
CN115409857A
Cerebral stroke focus region segmentation method based on dual Encoder-Decoder structure
CN116486081A
Visual representation method and device based on bidirectional state space model
CN117876845A
