Brain tumor MRI image segmentation method, system, electronic device and storage medium
Preprocessing and segmenting of brain tumor MRI images through a hybrid model based on U-Net and CNN models, the problem of time-consuming and labor-consuming manual segmentation in the prior art is solved, automated segmentation is realized, and diagnostic and treatment efficiency is improved.
Patent Information
- Application Number
- CN202310758898.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-26
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2043-06-26
AI Technical Summary
The existing brain tumor MRI image segmentation methods mainly rely on manual operations, consume a lot of manpower and material resources, and are inefficient, making it difficult to achieve automated segmentation.
The mixed model based on U-Net model and CNN model is used to pre-process and segment the brain tumor MRI image, including image size and grayscale normalization, random flip and translation, and histogram equalization, combined with Dropout layer and level combined The convolutional layer structure is classified using the cross entropy loss function.
Automatic segmentation of brain tumor MRI images has been achieved, which significantly reduces manpower and material consumption and improves the efficiency of diagnosis and treatment.
Smart Images

Figure CN116645381B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of medical image segmentation, and in particular relates to a brain tumor MRI image segmentation method, system, electronic equipment and storage medium. Background Art
[0002] With the rapid development of computer technology, medical imaging technology is also developing in the direction of digitalization. Currently, the widely used medical imaging methods are mainly divided into four categories: X-ray imaging (X-CT), magnetic resonance imaging (MRI), nuclear medicine imaging (NMI) and ultrasound imaging (UI). Magnetic resonance imaging (MRI) is a non-invasive brain tumor imaging technology that can produce high-resolution, non-invasive brain images, providing accurate information for doctors' clinical diagnosis, and is an important tool for the diagnosis and treatment of brain tumors. At the same time, brain tumor medical image segmentation technology is a key technology in brain tumor medical image processing and analysis.
[0003] Brain tumor medical image segmentation is a process of separating related structures in an image based on the similarities within the region and the differences between regions. Early image segmentation was done entirely manually, where medical experts manually depicted the boundaries on hundreds of slice images, and based on the depiction results, assumed the three-dimensional structure and spatial relationship with the surrounding tissues, and used this as the basis for formulating a treatment plan. The manual segmentation method of brain tumors consumes a lot of manpower and material resources, and is also subject to many limitations. Therefore, studying an automatic segmentation method for brain tumor MRI images is of great significance for the early diagnosis and treatment of brain tumor patients. Summary of the invention
[0004] In order to overcome the defects and shortcomings of the prior art, the present invention provides a brain tumor MRI image segmentation method, system, electronic device and storage medium.
[0005] The technical solution of the present invention is as follows:
[0006] A brain tumor MRI image segmentation method comprises the following steps:
[0007] S1 obtains the original data set and preprocesses the original data set;
[0008] S2 inputs the processed data into a hybrid U-Net model for processing to obtain a classification result; the hybrid U-Net model is constructed based on the U-Net model and the CNN model.
[0009] Furthermore, the preprocessing includes: image size normalization and grayscale normalization.
[0010] Furthermore, the image size normalization and grayscale normalization are specifically as follows: reducing the original image size of 512*512 to 128*128; removing the black background area that does not participate in the segmentation operation to obtain a brain tumor image with a size of 128*128; randomly flipping the image in the left-right and front-back directions with a probability of 50%, and translating the image in the X direction or the Y direction, dividing the image into multiple non-overlapping areas of similar size, and applying histogram equalization to each part of the image.
[0011] Furthermore, the S2 is specifically:
[0012] Use the U-Net model to segment the preprocessed data;
[0013] Use the CNN model to classify the segmented data and obtain the classification results.
[0014] Furthermore, when using the improved U-Net model to segment the preprocessed data, the number of channels of the convolutional layer in the U-Net model is increased by a power of 2, starting from 64 in the first layer and ending at 1024 in the top layer; a Dropout layer is added after each maximum pooling layer to prevent overfitting; a convolutional layer is added to the top layer of the U-Net model; when upsampling, the kernel size of the transposed convolutional layer is set to (2, 2) with a stride of 2; when merging feature maps, the upsampling and downsampling paths are merged in a cascade manner; and the final output layer is set to a 1x1 kernel size convolutional layer for classification.
[0015] Furthermore, the CNN model includes three convolution blocks, each of which includes a convolution layer and a maximum pooling layer, and adopts a standard stride.
[0016] The present invention also provides a brain tumor MRI image segmentation system, comprising:
[0017] Data processing module, used to obtain the original data set and preprocess the original data set;
[0018] The segmentation module is used to segment the preprocessed data using the improved U-Net model;
[0019] The classification module is used to classify the segmented data using the MRI classification model to obtain classification results.
[0020] Loss function, cross-entropy loss is used as the loss function.
[0021] The present invention also provides an electronic device, comprising a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the above-mentioned brain tumor MRI image segmentation method.
[0022] The present invention also provides a computer-readable storage medium, characterized in that it stores a computer program, and when the computer program is executed by a processor, the above-mentioned brain tumor MRI image segmentation method is implemented.
[0023] Technical effects of the present invention:
[0024] The present invention provides a brain tumor MRI image segmentation method, system, electronic device and storage medium, the method comprising obtaining an original data set, and preprocessing the original data set; inputting the processed data into a hybrid U-Net model for processing to obtain a classification result; the hybrid U-Net model is constructed based on a U-Net model and a CNN model. Brain tumor segmentation of MRI images is achieved, freeing up a lot of manpower and material resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings generally illustrate various embodiments by way of example and not limitation, and together with the description and claims, serve to illustrate the embodiments of the invention. Where appropriate, the same reference numerals are used throughout the drawings to refer to the same or similar parts. Such embodiments are illustrative and are not intended to be exhaustive or exclusive embodiments of the present apparatus or method.
[0026] Figure 1 The overall process schematic diagram of the present invention is shown;
[0027] Figure 2 A schematic diagram of the process flow of the MRI image segmentation preprocessing steps of the present invention is shown;
[0028] Figure 3 A schematic diagram of the structure of the hybrid U-Net of the present invention is shown. DETAILED DESCRIPTION
[0029] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0030] Example
[0031] like Figure 1 As shown, this embodiment provides an improved hybrid-Unet brain tumor MRI image segmentation method based on UNET combined with CNN, comprising the following steps:
[0032] S1: First, preprocess the raw data;
[0033] like Figure 2As shown in the figure, the original images in the dataset are normalized, including image size normalization and grayscale normalization, and the image resolution is uniformly adjusted to 128*128, and the three channels of the image are changed to one channel to enhance the contrast of the image color. The black background area that does not participate in the segmentation operation is removed to obtain a brain tumor image with a size of 128*128, and the proportion of the tumor area in the image is increased; the image is randomly flipped in the left and right and front and back directions with a probability of 50%, and the image is translated in the X or Y direction (or both); next, the contrast-limited adaptive histogram equalization (CLAHE) divides the given image into multiple non-overlapping regions of similar size, and histogram equalization (HE) is applied to each part of the image, so that the uniform grayscale distribution makes the hidden features in the image more clearly visible. The advantages of CLACHE are less noise, simple calculation, good output response in the local area of the image, preventing the occurrence of brightness saturation, and helping to compare different areas of the image.
[0034] S2: segmentation using the improved U-Net model;
[0035] like Figure 1 and Figure 3 As shown, after preprocessing, the improved U-Net network of the present invention is used for segmentation, and the input image is converted to (128, 128, 1), that is, a grayscale image of size 128x128 is used as input. The number of channels of the convolution layer increases in powers of 2, starting from 64 (26) in the first layer and ending at 1024 (210) in the bottleneck layer. A Dropout layer is added after each maximum pooling layer to prevent overfitting; the top layer is set to two convolution layers, each with 1024 convolution kernels; the kernel size of the transposed convolution layer used for upsampling is (2, 2) and the stride is 2; the feature maps of the upsampling and downsampling paths are merged in a cascade manner; the final output layer has only one convolution layer with a kernel size of 1x1.
[0036] S3: Image post-processing using CNN network;
[0037] The segmented images from the first stage of the fusion model were used in the CNN-based MRI classification model proposed in the second stage of the model. In order to improve the classification accuracy of the proposed CNN model, the segmented images from the previous stage were taken as input.
[0038] Layout of the convolutional layers and max pooling layers of the proposed CNN model, each layer uses a unique convolutional block with a standard stride. By default, the stride is set to (1,1), which means that for every pixel the convolution kernel moves to the right, it also moves down by one pixel. The output image produced by the first stage is 1922563, which is then scaled down to 28283. The proposed CNN model takes the resized image as input to the first convolutional block. The first convolutional block consists of one convolutional layer and one max pooling layer. The first convolutional layer has 32 3*3 filters, and the max pooling layer is 2*2. The second convolutional block consists of two convolutional layers and one max pooling layer. Both convolutional layers have 16 filters in a 3*3 configuration, while the max pooling layer has 32 filters in a 2*2 configuration. Similarly, two convolutional layers and one max pooling layer form the third convolutional block. The filter size of the max pooling layer is 2*2, while the filter size of the third convolutional layer is 3*3, with a total of 16 filters. A fully connected layer is applied after the third convolutional block to “flatten” the features by collapsing the feature space into a single feature vector. Finally, a hybrid layer consisting of three upsampling layers and a convolutional layer is used to classify the feature vector into seven MRI disease classes.
[0039] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A brain tumor MRI image segmentation method, characterized in that: The following steps are involved: S1 obtains the original data set and preprocesses the original data set; S2 inputs the preprocessed data into the hybrid U-Net model for processing to obtain the classification result; The hybrid U-Net model is constructed based on the U-Net model and the CNN model; The preprocessing includes: image size normalization and grayscale normalization; The S2 is specifically: Use the U-Net model to segment the preprocessed data; Use the CNN model to classify the segmented data and obtain the classification results; When using the U-Net model to segment the preprocessed data, the number of channels of the convolutional layer in the U-Net model is increased by a power of 2, starting from 64 in the first layer and ending at 1024 in the top layer; a Dropout layer is added after each maximum pooling layer to prevent overfitting; a convolutional layer is added to the top layer of the U-Net model; when upsampling, the kernel size of the transposed convolutional layer is set to (2, 2) with a stride of 2; when merging feature maps, the upsampling and downsampling paths are merged in a cascade manner; the final output layer is set to a 1x1 kernel size convolutional layer for classification; The CNN model includes three convolution blocks, each of which includes a convolution layer and a maximum pooling layer, and adopts a standard stride, specifically; The first convolution block consists of a convolution layer and a maximum pooling layer. The first convolution layer has 32 3*3 filters and the maximum pooling layer is 2*2. The second convolutional block consists of two convolutional layers and a maximum pooling layer. The two convolutional layers have 16 3*3 filters, and the maximum pooling layer is 2*2. Two convolutional layers and one maximum pooling layer constitute the third convolutional block. The maximum pooling layer is 2*2, and the filter size of the third convolutional block is 3*3, with a total of 16 filters. A fully connected layer is applied after the third convolutional block to “flatten” the features by collapsing the feature space into a single feature vector; finally, a hybrid layer consisting of three upsampling layers and a convolutional layer is used to classify the feature vector into seven MRI disease classes.
2. The brain tumor MRI image segmentation method according to claim 1, characterized in that: The image size normalization and grayscale normalization are specifically as follows: reducing the original image size of 512*512 to 128*128; removing the black background area that does not participate in the segmentation operation to obtain a brain tumor image with a size of 128*128; randomly flipping the image in the left-right and front-back directions with a probability of 50%, and translating the image in the X direction or the Y direction to divide the image into multiple non-overlapping areas of similar size, and applying histogram equalization to each part of the image.
3. A brain tumor MRI image segmentation system, characterized in that: include: Data processing module, used to obtain the original data set and preprocess the original data set; A segmentation module, used to segment the preprocessed data using a hybrid U-Net model; the hybrid U-Net model is constructed based on the U-Net model and the CNN model; A classification module is used to classify the segmented data using the MRI classification model to obtain classification results; The preprocessing includes: image size normalization and grayscale normalization; When using the U-Net model to segment the preprocessed data, the number of channels of the convolutional layer in the U-Net model is increased by a power of 2, starting from 64 in the first layer and ending at 1024 in the top layer; a Dropout layer is added after each maximum pooling layer to prevent overfitting; a convolutional layer is added to the top layer of the U-Net model; when upsampling, the kernel size of the transposed convolutional layer is set to (2, 2) with a stride of 2; when merging feature maps, the upsampling and downsampling paths are merged in a cascade manner; the final output layer is set to a 1x1 kernel size convolutional layer for classification; The CNN model includes three convolution blocks, each of which includes a convolution layer and a maximum pooling layer, and adopts a standard stride, specifically; The first convolution block consists of a convolution layer and a maximum pooling layer. The first convolution layer has 32 3*3 filters and the maximum pooling layer is 2*2. The second convolutional block consists of two convolutional layers and a maximum pooling layer. The two convolutional layers have 16 3*3 filters, and the maximum pooling layer is 2*2. Two convolutional layers and one maximum pooling layer constitute the third convolutional block. The maximum pooling layer is 2*2, and the filter size of the third convolutional block is 3*3, with a total of 16 filters. A fully connected layer is applied after the third convolutional block to “flatten” the features by collapsing the feature space into a single feature vector; finally, a hybrid layer consisting of three upsampling layers and a convolutional layer is used to classify the feature vector into seven MRI disease classes.
4. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the brain tumor MRI image segmentation method according to claims 1-2.
5. A computer-readable storage medium, characterized in that: The computer program is stored therein, and when the computer program is executed by a processor, the brain tumor MRI image segmentation method as described in claims 1-2 is implemented.
