Brain tumor classification method based on improved efficientnetv2 network
By introducing an attention mechanism and residual structure into the EfficientNetV2 network, combined with data preprocessing and feature fusion, the problem of accurate classification of brain tumor types was solved, achieving higher classification accuracy and recognition accuracy.
Patent Information
- Application Number
- CN202310552394.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-17
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2043-05-17
AI Technical Summary
Current technologies struggle to accurately classify brain tumor types, rely on human experience, and are prone to errors, leading to treatment delays.
An attention mechanism and residual structure are introduced into the EfficientNetV2 network. The classification accuracy is improved through data preprocessing and feature fusion. The training process is optimized by using the cross-entropy loss function.
It improved the classification accuracy of brain tumor images, reduced misclassifications, and enhanced the model's recognition capabilities.
Smart Images

Figure CN116503666B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application proposes a brain tumor classification algorithm based on an improved EfficientNetV2 network, which is applied to brain tumor magnetic resonance image classification. In the basic EfficientNetV2 network model, an attention mechanism and a residual structure are added. The attention mechanism focuses on key areas, enabling the model to focus on effective information and filter out useful information. The residual structure extracts and fuses shallow and deep feature information, improving classification accuracy. BACKGROUND
[0002] The brain is the most complex organ and plays a significant role in our daily activities. Uncontrolled irregular growth of tissue within the brain is called a brain tumor, which is a very serious disease. It can be a benign tumor that is least aggressive or a malignant tumor that is life-threatening. If not treated promptly, it can be fatal. Due to similar growth locations and appearance, it is difficult for radiologists and other clinicians to identify the type of brain tumor. Artificially classifying brain tumors not only requires specialized prior knowledge but also requires doctors to have extensive experience. Visual identification is time-consuming and labor-intensive, and it is also easy to make mistakes and delay treatment. Therefore, accurate classification of brain tumors is still one of the most challenging tasks in medical image analysis.
[0003] Deep learning has shown rapid development in recent years and is widely used in image classification. VGG-19, GoogleNet, and ResNet networks stack convolutional layers and pooling layers, which have achieved good results in brain tumor classification tasks. In view of the application of deep learning in brain tumor classification, this paper discusses related technologies in depth and proposes a brain tumor classification model based on an improved EfficientNetV2 network. SUMMARY
[0004] The application proposes a brain tumor image classification method based on an improved EfficientNetV2 network and attention mechanism. By improving the network structure of EfficientNetV2, the method more efficiently extracts feature information of images to improve classification accuracy.
[0005] To achieve the above purpose, the technical solutions of the application are as follows:
[0006] An improved EfficientNetV2 network and attention mechanism-based brain tumor image classification method includes the following steps:
[0007] Step 1: Data preprocessing. The data set composed of brain tumor magnetic resonance images is changed to a network trainable size according to the requirements.
[0008] Step two: build an improved EfficientNetV2 network model, improve the convolutional layer structure, and apply residual structure and attention mechanism in the model;
[0009] Step three: use the improved EfficientNetV2 network model for training to obtain brain tumor image classification results.
[0010] The specific process in step one is as follows:
[0011] (1) The brain tumor image data has three types, including glioma, pituitary tumor and meningioma, and the size of the original image is
[0012] 512x512 pixels. After processing the brain tumor data during training, the size is 300x300; and after processing the brain tumor data during testing, the size is 380x380;
[0013] (2) The brain tumor MRI image data is cropped, and the input image is adjusted to the appropriate scale by cropping. Since the background occupies a large proportion in the whole image and the background area is not the classification target area, it can be determined as an invalid area, so it is cropped and will not reduce the target area.
[0014] (3) Data augmentation, random cropping and random rotation, scaling, translation and affine transformation methods are used to enhance the brain tumor image data.
[0015] The specific situation in step two is as follows:
[0016] Build an improved EfficientNetV2 network model and introduce an ECA attention module;
[0017] Add CBAM attention mechanism in the shortcut of stage1 to stage3;
[0018] The backbone network uses EfficientNetV2 network, adds a residual structure after the stage1 module, builds three layers of 3x3 convolutional layers, and performs normalization (BatchNorm, BN) and Swish activation operation once after each convolutional layer. Then pass through the ECA attention module, focus on the more useful information for the current task among the numerous feature information, and improve the classification accuracy. After the ECA attention module, add a convolutional layer with a convolution kernel size of 1x1, also perform normalization (BatchNorm, BN) and Swish activation operation once, and add the output result to the result of the last MBConv module. While ensuring the depth of the network, better extract the feature information of the shallow and deep layers, perform feature fusion, and improve the network performance.
[0019] The specific process in the third step is as follows:
[0020] (1) In the training process, in order to reduce the influence of the class imbalance problem on the classification accuracy, the training adopts a cross entropy loss function (Cross Entropy Loss Function), and the specific process of calculating the cross entropy of binary classification is as follows:
[0021]
[0022] P is the label of the sample, 1 for correct and 0 for error, and t is the probability of correct prediction;
[0023] This paper classifies meningioma, pituitary tumor and glioma, so a multi-class cross entropy loss function is used to calculate the cross entropy of multi-classification, and the specific process is as follows:
[0024]
[0025] L is the value of the cross entropy loss function, y i is the true label, p i is the prediction probability of the model for the first i class sample;
[0026] (2) The preprocessed picture is input into the network, the network parameter weight is updated, the extracted features are subjected to softmax classification, and the optimal network classification result is obtained.
[0027] Compared with the prior art, the technical scheme of the present application has the following beneficial effects:
[0028] The present application is based on a convolutional neural network, combines an EfficientNetV2 network model and a residual module, extracts shallow and deep feature information for feature fusion, and integrates an attention mechanism into the model, so that the network can better focus attention on the target area and improve the classification accuracy. BRIEF DESCRIPTION OF DRAWINGS
[0029] Figure 1 The method flowchart of the present application.
[0030] Figure 2 The CBAM attention mechanism module of the present application.
[0031] Figure 3 The ECA attention mechanism module of the present application.
[0032] Figure 4 The improved EfficientNetV2 Fused_MBConv module.
[0033] Figure 5The network model of the improved EfficientNetV2. DETAILED DESCRIPTION
[0034] It is understandable for those skilled in the art that some well-known structures and their descriptions in the drawings can be omitted. The technical solutions of the present application will be further described below in combination with the drawings and examples.
[0035] The present application provides a brain tumor classification algorithm improved based on the EfficientNetV2 network model, which fuses shallow and deep information, makes full use of feature information, and improves the classification accuracy of brain tumor images.
[0036] Figure 1 The method flowchart of the present application first preprocesses the brain tumor magnetic resonance images, converts 3064 brain tumor images in the CE-MRI data set into the required input of the network, then constructs an improved EfficientNetV2 network model, and uses it to train the data, saves the best network weight, and realizes the classification task.
[0037] The specific implementation steps are as follows:
[0038] Step 1.1 Preprocess the input brain tumor magnetic resonance image data. During training, the input image is cropped from 512x512 to 300x300. During testing, the input image is cropped to 380x380.
[0039] Step 1.2 Data augmentation, using random cropping and random rotation, scaling, translation, and affine transformation methods such as skewing to enhance the data of brain tumor images.
[0040] Step 2.1 Apply residual modules and attention mechanisms to the EfficientNetV2 network.
[0041] Step 2.2 Add CBAM attention modules to the shortcut branch of stage1 to stage3, and perform a normalization operation (BatchNorm, BN) and a Relu activation operation at the same time, focusing on the more critical feature information for the classification task and improving the classification efficiency.
[0042] Step 2.3 Add a residual structure after the stage1 module, add three 3x3 convolution layers, each followed by a BN and Swish activation operation, pass through the ECA attention mechanism, then add a 1x1 convolution layer, and add the output result of the last MBConv module of the main network, fuse the feature information of the shallow and deep layers, better utilize the feature information of the picture, and improve the classification accuracy.
[0043] Step3.1 In the training process, in order to reduce the influence of class imbalance problem on classification accuracy, the training adopts cross entropy loss function (Cross Entropy Loss Function), and the specific process of calculating the cross entropy of binary classification is as follows:
[0044]
[0045] p is the label of the sample, 1 for correct and 0 for error, and t is the predicted probability;
[0046] This paper classifies meningioma, pituitary tumor and glioma, so the multi-class cross entropy loss function is used:
[0047] The specific process of calculating the cross entropy of multi-classification is as follows:
[0048]
[0049] L is the value of cross entropy loss function, y i is the true label, p i is the predicted probability of the model for the first i class sample;
[0050] Using the cross entropy loss function of multi-classification, the performance of the network model is improved, the error between the predicted result and the true result is reduced, and the classification accuracy is improved;
[0051] Step3.2 Use the improved EfficientNetV2 network model for training, extract the feature information of brain tumor image, and then perform softmax classification on the result to get the classification result.
Claims
1. A brain tumor image classification method based on an improved EfficientNetV2 network and an attention mechanism, characterized in that, Comprising the following steps: Step1: data preprocessing, constructing an improved EfficientNetV2 network model, improving the convolutional layer framework structure; Step2: after the network is trained, input the test set for testing, and test the network classification effect; The specific process in Step1 is as follows: Step1.1 The CE-MRI data set has 3 types, including glioma, pituitary tumor and meningioma, and the size of the original image is 512X512 pixels; Step1.2 The brain region of the MRI image is gray, and the background is black. The background information accounts for a large proportion of the whole image, and the background is not helpful for classification. Therefore, the background information needs to be removed. The brain tumor data is processed during training, and the image size after processing is 300X300. The brain tumor data is processed during testing, and the image size after processing is 380X380; Step1.3 Construct an improved EfficientNetV2 network and attention mechanism brain tumor image classification model, and introduce attention mechanism in the residual structure; Step1.3.1 The network model constructed uses the basic EfficientNetV2 network, uses the CBAM attention mechanism module in the shortcut branch of the first three Fused-MBConv modules, and then performs BN normalization and ReLu activation operation once. Among the numerous input information, focus on the information more critical to the current task, reduce the attention to other information, and improve the efficiency and accuracy of task processing; Step1.3.2 After the first layer of the above network model, a residual structure is added, three 3x3 convolution layers are constructed, and then an ECA attention mechanism is added, which prevents information loss and network degradation caused by too deep network, and then a 1x1 convolution layer is added, which changes the channel number to 256, so that the output is the same as the output of the last MBConv layer of the main network. After adding in the channel dimension, input the last convolution layer and pooling layer; Step1.
4. In the training process, in order to reduce the influence of class imbalance problem on classification accuracy, cross entropy loss function is used, and the specific process of calculating the cross entropy of binary classification is as follows: L(p,t)=[-plog(t)+(1-p)log(1-t)] P is the label of the sample, correct is 1, and error is 0. T is the probability of predicting correctly; This paper classifies meningioma, pituitary tumor and glioma, so it uses multi-class cross entropy loss function to calculate the cross entropy of multi-classification: L = -∑y i log(p i ) L is the value of the cross-entropy loss function, y i is the true label, p i is the predicted probability of the model for the i-th class sample.
2. The brain tumor image classification method based on the improved EfficientNetV2 network and attention mechanism according to claim 1, characterized in that, The specific process in Step2 is as follows: Step2.1 Use the improved EfficientNetV2 and attention mechanism brain tumor image classification model to train, extract brain tumor image feature information, input the result into the Softmax layer classification, and get the classification result.