Brain tumor classification detection method and system based on feature pyramid network structure and channel attention mechanism
Through the feature pyramid network structure and channel attention mechanism, the brain tumor classification and detection method is optimized, which solves the problem that brain tumor diagnosis in existing technologies is time-consuming and error-prone, and achieves more efficient and accurate brain tumor classification and detection.
Patent Information
- Application Number
- CN202210861479.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-22
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-07-22
AI Technical Summary
Existing brain tumor diagnosis relies on the experience of radiologists, which is time-consuming and error-prone. Existing technologies make it difficult to achieve efficient and accurate brain tumor classification and detection.
The feature pyramid network structure and channel attention mechanism are adopted. The neural network structure is optimized through image preprocessing, improved attention mechanism module, fusion residual block and efficient channel attention module. The optimal model is selected using K-fold cross validation and F1 score evaluation.
It improves the accuracy and authenticity of brain tumor imaging classification detection, reduces diagnostic risks, and provides medical experts with more accurate judgments on brain tumor types.
Smart Images

Figure CN115170885B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer vision image processing, and in particular to a brain tumor classification and detection method and system based on a feature pyramid network structure and a channel attention mechanism. Background Art
[0002] Brain tumors are one of the deadliest cancers worldwide. Data shows that the average five-year survival rate for brain tumor patients is almost 36%, and the average 10-year survival rate is close to 31%. Survival rates decrease with age. The five-year survival rate for people under 15 years old exceeds 74%, and for those aged 15-39, it is approximately 71%. The five-year survival rate for people aged 40 and older is approximately 21%. Therefore, brain tumor survival rates vary widely, depending on a variety of factors, including the type of brain tumor and the diagnosis. Therefore, being able to more accurately diagnose the type of brain tumor is essential for providing better treatment for patients.
[0003] Considering the evolution of a patient's disease, diagnosing brain tumors is a challenging task. Classification and detection rely heavily on the radiologist's experience. Examining large amounts of data can be time-consuming and can even lead to significant errors. Improving the accuracy and efficiency of diagnosis has become a pressing issue. Currently, brain tumor diagnosis relies on computer processing technology, employing visual image processing techniques for classification and detection. Prior art patent CN113903022A discloses a text detection method and system based on a feature pyramid and attention fusion. The method begins by acquiring an image to be detected. The image is then fed into a text detection model to determine the location of text within the image. The text detection model comprises a feature extraction network and a feature fusion network. The backbone of the feature extraction network consists of multiple layers of sequentially connected convolutional networks with different structures, and a position attention network is added to the output of the second convolutional layer. The feature fusion network fuses the output features of the convolutional and position attention networks to obtain the final features. However, brain tumor detection differs from conventional text detection methods in that it requires the use of a neural network. A neural network model, constructed using a feature pyramid network structure and an improved attention mechanism module, performs classification and selection. Therefore, a method is needed to achieve brain tumor classification and detection. Summary of the Invention
[0004] To solve the above problems, the present invention provides a brain tumor classification and detection method based on a feature pyramid network structure and a channel attention mechanism, comprising the following steps:
[0005] First, a smoothing method is used to enhance the quality of brain tumor images and reduce noise interference and distortion. Then, the channel attention mechanism is improved, and a feature pyramid network structure is used to replace average pooling and maximum pooling, and the first-stage neural network model is formed with a residual block. Then, the neural network structure is optimized, and an efficient channel attention module is used to replace the SE module and a global average pooling layer and a fully connected layer sequence with a PFLU activation function are added to form the second-stage neural network model. Finally, the model is trained using K-fold cross-validation and the optimal model is selected using the F1 score evaluation method.
[0006] A further improvement is to include the following steps:
[0007] Step 1: First, image preprocessing is performed: Gaussian filtering is used to smooth the original image to suppress noise in the functional image, improve the signal-to-noise ratio, and reduce noise interference and distortion in each image; digital image transformation methods such as cropping and flipping are used to spatially transform the processed image so that the receptive field can better capture features;
[0008] Step 2: Build an improved attention mechanism (CBAM) module. Replace the maximum pooling layer and average pooling layer of the spatial attention module with convolutional layers with a feature pyramid structure. Convolution kernels of different sizes are used to obtain digital image features with receptive fields of different sizes.
[0009] Step 3: Integrate the improved attention mechanism module and residual block from Step 2 to form the first-stage neural network model. This model is trained to extract data features from brain tumor images. A hypercolumn approach is used to combine the activation values of the convolutional network units at all corresponding positions following the extracted feature pixel into a column vector for feature fusion to obtain the combined features.
[0010] Step 4: Replace the SE channel attention module of the EfficientNet neural network structure with a local cross-channel interaction strategy without dimensionality reduction and an efficient channel attention mechanism that adaptively selects the size of the one-dimensional convolution kernel. Optimize the model's weight layer and add a global average pooling layer, two fully connected layers with PFLU activation functions, and a dropout layer sequence to form the second-stage neural network model.
[0011] In step 5, the combined features obtained in step 3 are used as the input of the neural network model in step 4. The model is trained and verified through K-fold cross validation, and the F1 score evaluation method is used to select the optimal model weight parameters.
[0012] A further improvement is that in step 2, an improved attention mechanism module is constructed according to the following steps:
[0013] Step 2.1: The spatial attention module compresses the channel attention feature map in the spatial dimension to obtain a one-dimensional vector and then performs average pooling or maximum pooling operations. Average pooling and maximum pooling can be used to aggregate the spatial information of the feature map. The calculation formula is as follows:
[0014] ,
[0015] in yes activation function, It is a two-layer neural network. is the input, is average pooling, is the maximum pooling;
[0016] Step 2.2: Use the convolution layer of the feature pyramid structure to replace the maximum pooling layer and the average pooling layer of the spatial attention module. The features of receptive fields of different sizes are obtained through convolution kernels of different sizes. The larger the convolution kernel, the more global features are extracted, and the smaller the convolution kernel, the more local features are extracted. The calculation formula of the feature pyramid spatial attention module is shown as follows:
[0017] ,
[0018] in yes activation function, yes Convolutional neural network, F is the input.
[0019] A further improvement is that, in step S3, feature combination is performed using a hypercolumn method according to the following method:
[0020] Since the features will gradually weaken, the feature maps at different stages show large feature differences. The hypercolumn technology is used to associate the feature maps. For a certain input pixel point i, the corresponding positions of this pixel in each feature map during the feature extraction process are connected in series to form a feature vector f. This feature vector is the hypercolumn feature corresponding to a certain input pixel point position i. Its formation formula is as follows:
[0021] ,
[0022] in: Indicates the accumulation operation of k feature maps; is a factor based on pixel and feature map position; represents the kth feature map.
[0023] A further improvement is that in step S4, the SE channel attention module is replaced by a local cross-channel interaction strategy without dimensionality reduction and an efficient channel attention mechanism that adaptively selects the one-dimensional convolution kernel size according to the following steps:
[0024] Step 4.1: The local cross-channel interaction strategy without dimensionality reduction and the efficient channel attention mechanism with adaptive selection of one-dimensional convolution kernel size consists of two parts. The first part is to perform cross-channel information interaction without reducing the channel dimension. The calculation formula is as follows:
[0025] ,
[0026] in yes activation function, is the weight, is the weight The formula avoids the complete independence of different groups and allows all channels to share weight information.
[0027] Step 4.2: The second part of the efficient channel attention mechanism is to enable the module to realize information interaction between channels by adaptively selecting one-dimensional convolution with a convolution kernel size of K. The implementation formula is as follows:
[0028] ,
[0029] in yes The activation function, C1D, represents one-dimensional convolution, and K represents the convolution kernel size. Since the ECA module only involves K parameters and when k = 3, it can achieve the same effect as SE-Var3 with lower model complexity; therefore, using ECA instead of SE improves model efficiency.
[0030] A further improvement is that the neural network model of the second stage optimized in step S4 includes a global average pooling layer C1, a fully connected layer sequence D2, a fully connected layer sequence D3, a fully connected layer sequence D4, a fully connected layer sequence D5 and an output layer;
[0031] The global average pooling layer C1 has a structure parameter of 2048, which replaces the fully connected layer and reduces the dimension of the feature map, reducing the number of parameters and the amount of calculation to prevent overfitting;
[0032] The fully connected layer sequence D2 has a structure parameter reduced from 2048 to 1000, which is connected to the C1 layer features. It includes a normalization layer and a dropout layer, and the dropout rate of the dropout layer is set to 0.3.
[0033] The fully connected layer sequence D3 has a structure parameter reduced from 1000 to 512, which is connected to the neurons in the D2 layer. It includes a normalization layer, a dropout layer, and a PFLU activation function. The dropout rate of the dropout layer is set to 0.3.
[0034] The fully connected layer sequence D4 has a structure parameter reduced from 512 to 128, connected to the neurons of the D3 layer, including a normalization layer, a dropout layer, and a PFLU activation function. The dropout rate of the dropout layer is set to 0.3;
[0035] The fully connected layer sequence D5 has a structure parameter reduced from 128 to 4, connecting neurons in layer D4;
[0036] The output layer has 4 neurons connected to the fully connected layer D5 to perform four classifications on the results.
[0037] A brain tumor classification and detection system based on a feature pyramid network structure and an efficient channel attention mechanism includes a terminal device, which is an Internet terminal device and includes a processor and a computer-readable storage medium. The processor is used to implement various instructions; the computer-readable storage medium is used to store multiple instructions.
[0038] A further improvement is that the computer-readable storage medium is used to store multiple instructions, and the instructions are suitable for being loaded and executed by the processor of the terminal device to carry out the brain tumor classification and detection method based on the feature pyramid network structure and channel attention mechanism as described above.
[0039] Beneficial effects of the present invention: The present invention is a brain tumor classification detection method and system based on a feature pyramid network structure and a channel attention mechanism with comprehensive data features and accurate classification results.
[0040] The present invention fuses a feature pyramid network structure and adopts convolution kernels of different sizes to obtain digital image features with receptive fields of different sizes, so that global features and local features can more realistically reflect the differences between brain tumor images under the combination of hypercolumn methods.
[0041] This paper effectively classifies and detects brain tumor images by optimizing the channel attention mechanism and improving the EfficientNet neural network, further improving the authenticity and accuracy of brain tumor image classification detection data. Furthermore, the F1 score evaluation method is used to select the optimal model weight parameters, further optimizing the model, improving resource utilization, and reducing risk, providing a new reference for medical experts to accurately determine brain tumor types.
[0042] The present invention first preprocesses the image to better obtain features; then improves the attention mechanism module and the residual block to form a first-stage neural network model, and then improves the EfficientNet neural network to form a second-stage neural network model, which is suitable for brain tumor impact classification detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 Flowchart of an embodiment of the present invention.
[0044] Figure 2 A diagram of the spatial attention mechanism structure provided for the embodiment.
[0045] Figure 3 This is a K-fold confusion matrix diagram of the simulation test of the embodiment.
[0046] Figure 4 It is the ACC curve diagram of the simulation test of the embodiment.
[0047] Figure 5 The figure is a Loss curve diagram of the simulation test of the embodiment.
[0048] Figure 6 The confusion matrix diagram of the classification detection of the simulation test of the embodiment. DETAILED DESCRIPTION
[0049] In order to deepen the understanding of the present invention, the present invention will be further described in detail below with reference to the examples. The examples are only used to explain the present invention and do not constitute a limitation on the scope of protection of the present invention.
[0050] like Figure 1 As shown, this embodiment provides a brain tumor classification and detection method based on a feature pyramid network structure and a channel attention mechanism, and the steps are as follows:
[0051] S1: Image preprocessing: Use Gaussian filtering to smooth the original image to suppress the noise of the functional image, improve the signal-to-noise ratio, and reduce the noise interference and distortion of each image; use methods such as cropping and flipping to perform spatial transformation on the transformed image so that the receptive field can better acquire features.
[0052] S2: Construct an improved attention mechanism (CBAM) module, and use convolutional layers with a feature pyramid structure to replace the maximum pooling layer and average pooling layer of the spatial attention module. The convolution kernels of different sizes are used to obtain digital image features with receptive fields of different sizes.
[0053] The improved attention mechanism module is as follows:
[0054] S2.1: The spatial attention module compresses the channel attention feature map in the spatial dimension to obtain a one-dimensional vector and then performs average pooling or maximum pooling operations. Average pooling and maximum pooling can be used to aggregate the spatial information of the feature map. The calculation formula is as follows:
[0055]
[0056] in yes activation function, It is a two-layer neural network. is the input, is average pooling, is the maximum pooling;
[0057] S2.2: If Figure 2 As shown in the figure, the structure of the spatial attention mechanism is as follows: the convolution layer with a feature pyramid structure replaces the maximum pooling layer and the average pooling layer of the spatial attention module. The features of receptive fields of different sizes are obtained through convolution kernels of different sizes. The larger the convolution kernel, the more global features are extracted, and the smaller the convolution kernel, the more local features are extracted. The calculation formula of the feature pyramid spatial attention module is shown as follows:
[0058]
[0059] in yes activation function, yes Convolutional neural network, F is the input.
[0060] S3: The improved attention module and residual block in S2 are integrated to form the first-stage neural network model. The model is trained to extract the data features of brain tumor images. The hypercolumn method is used to combine the activation values of the convolutional network units at all corresponding positions after the extracted feature pixel into a column vector for feature fusion.
[0061] Feature combination is performed using the hypercolumn method according to the following method:
[0062] Since the features will gradually weaken, the feature maps at different stages will show large feature differences. The hypercolumn technology is used to associate the feature maps. For a certain input pixel point i, the corresponding positions of this pixel in each feature map during the feature extraction process are connected in series to form a feature vector f. This feature vector is the hypercolumn feature corresponding to a certain input pixel point position i. Its formation formula is as follows:
[0063] ;
[0064] in: Indicates the accumulation operation of k feature maps; is a factor based on pixel and feature map position; represents the kth feature map;
[0065] S4: Replace the SE channel attention module of the EfficientNet neural network architecture with a local cross-channel interaction strategy without dimensionality reduction and an efficient channel attention mechanism with adaptive selection of one-dimensional convolution kernel size. Optimize the model's weight layers and add a global average pooling layer, two fully connected layers with PFLU activation functions, and a dropout layer sequence to form the second-stage neural network model.
[0066] Follow the steps below to replace the SE channel attention module with a local cross-channel interaction strategy without dimensionality reduction and an efficient channel attention mechanism that adaptively selects the size of the one-dimensional convolution kernel:
[0067] S4.1: The local cross-channel interaction strategy without dimensionality reduction and the efficient channel attention mechanism with adaptive selection of one-dimensional convolution kernel size consists of two parts. The first part is to perform cross-channel information interaction without reducing the channel dimension. Its calculation formula is as follows:
[0068]
[0069] in yes activation function, is the weight, is the weight The formula avoids the complete independence of different groups and allows all channels to share weight information.
[0070] S4.2: The second part of the efficient channel attention mechanism is to enable the module to realize information interaction between channels by adaptively selecting one-dimensional convolution with a convolution kernel size of K. Its implementation formula is as follows:
[0071] ,
[0072] in yes The activation function, C1D, represents one-dimensional convolution, and K represents the convolution kernel size. Since the ECA module only involves K parameters and when k = 3, it can achieve the same effect as SE-Var3 with lower model complexity. Therefore, using ECA instead of SE improves model efficiency.
[0073] At the same time, in this step, the optimized second-stage neural network model includes a global average pooling layer C1, a fully connected layer sequence D2, a fully connected layer sequence D3, a fully connected layer sequence D4, a fully connected layer sequence D5, and an output layer:
[0074] The global average pooling layer C1 has a structural parameter of 2048, which replaces the fully connected layer and reduces the dimension of the feature map, reducing the number of parameters and computational complexity to prevent overfitting.
[0075] The fully connected layer sequence D2 has a structure parameter reduced from 2048 to 1000, which is connected to the C1 layer features. It includes a normalization layer and a dropout layer, and the dropout rate of the dropout layer is set to 0.3.
[0076] The fully connected layer sequence D3 has a structure parameter reduced from 1000 to 512, which is connected to the neurons in the D2 layer. It includes a normalization layer, a dropout layer, and a PFLU activation function. The dropout rate of the dropout layer is set to 0.3.
[0077] The fully connected layer sequence D4 has a structure parameter reduced from 512 to 128, which is connected to the neurons in the D3 layer. It includes a normalization layer, a dropout layer, and a PFLU activation function. The dropout rate of the dropout layer is set to 0.3.
[0078] In the fully connected layer sequence D5, the structural parameters are reduced from 128 to 4, connecting the neurons in the D4 layer.
[0079] The output layer has 4 neurons connected to the fully connected layer D5 to perform four classifications on the results.
[0080] S5: The combined features obtained in step S3 are used as the input of the neural network model in step S4. The model is trained and verified through K-fold cross validation, and the F1 score evaluation method is used to select the optimal model weight parameters.
[0081] A brain tumor classification and detection system based on a feature pyramid network structure and an efficient channel attention mechanism includes a terminal device, which is an Internet terminal device and includes a processor and a computer-readable storage medium. The processor is used to implement various instructions; the computer-readable storage medium is used to store multiple instructions, which are suitable for being loaded and executed by the processor of the terminal device. A brain tumor classification and detection method based on a feature pyramid network structure and a channel attention mechanism.
[0082] This embodiment utilizes a smoothing method to enhance the quality of brain tumor images and reduce noise interference and distortion. It also improves the channel attention mechanism, replacing average and maximum pooling with a feature pyramid network structure, which forms the first-stage neural network model with a residual block. It optimizes the EfficientNet neural network structure, replacing the SE module with an efficient channel attention module, and adding a global average pooling layer and a sequence of fully connected layers with a PFLU activation function to the weight layer to form the second-stage neural network model. K-fold cross-validation is used for model training, and the optimal model parameters are selected using the F1 score evaluation method. This invention improves the accuracy of brain tumor classification and detection, reduces the risk of medical diagnosis, and provides a new reference for medical experts to accurately determine the type of brain tumor.
[0083] Simulation test
[0084] In order to measure the effectiveness of the brain tumor classification and detection method based on the feature pyramid network structure and channel attention mechanism proposed in this embodiment, this paper trains on a mixed brain tumor dataset. The mixed brain tumor dataset consists of the Figshare dataset and the Brain Tumor Classification (KBT) dataset of Kaggle. The mixed brain tumor dataset contains 1,321 glioma images, 1,339 meningioma images, 1,595 normal person images, and 1,475 pituitary tumor images. All simulation experiments were conducted on the same device equipped with an AMD Ryzen 7 5800H with RadeonGraphics@3.20 GHz processor. The running environment of the simulation experiment also includes 16G of running memory and a graphics card of the NVIDIA GeForce RTX 3050 Ti Laptop GPU. The software platform for running the algorithm is PyCharm.
[0085] This example uses the same data for training and testing, performing a 10-fold cross-validation on the model. Accuracy, recall, precision, and F1 score for the separated classes are calculated using a confusion matrix. All evaluation metrics range from 0 to 100%, with higher values indicating better model performance.
[0086]
[0087]
[0088]
[0089]
[0090] TP represents the number of cases where the true value is correct but the model believes it is correct, FN represents the number of cases where the true value is correct but the model believes it is wrong, FP represents the number of cases where the true value is wrong but the model believes it is correct, TN represents the number of cases where the true value is wrong but the model believes it is wrong, P represents precision, and R represents recall.
[0091] In step S4, the first-stage model, consisting of a channel attention module, a spatial attention module fused with a feature pyramid, and a residual block, extracts features and combines them using hypercolumn technology as input to the second-stage model. This second-stage model is based on EfficientNet-B4, replacing B4's SE blocks with ECA blocks and modifying the weight and classification layers to reduce the number of training parameters, increase training speed, and prevent overfitting. This experiment also compared the improved model with other network models using this data sample. Table 1 shows the experimental results of the model proposed in this embodiment and the experimental results of other network models using this data sample.
[0092] Table 1 Experimental results of the improved model and other network models on this data sample
[0093]
[0094] As shown in the table, among the individual models used in the experiment, Resnet50 performed best, with an F1 score of 99.1%. The model proposed in this experiment was second, with an F1 score of 97.2%. Compared to these individual models, the model proposed in this study achieved higher accuracy, with an F1 score of 99.3% and an accuracy of 99%. The K-fold confusion matrix corresponding to this evaluation result is shown in the figure below. Figure 3 shown.
[0095] The corresponding ACC curve and Loss curve are as follows: Figure 4 、 5 As shown in the figure, it can be seen that the training effect of the model is very good and the classification results are highly accurate.
[0096] In step S5, this embodiment also uses another data sample consisting of 1311 brain tumor MRI images. The best model parameters obtained by the score evaluation method in step F1 are used for classification detection. The final results show that the accuracy of brain tumor classification detection is 99.24% under this data sample. The classification detection results show that the classification and detection effect of the model used in this experiment on this data sample is significant. The confusion matrix of the classification detection is shown in Figure 1. Figure 6 shown.
[0097] In addition, considering that the differences in the datasets used and the parameters of the deep learning methods lead to large differences in the experimental results, this example compares the proposed model with the models and conclusions in the relevant literature. The comparison results show that the average classification accuracy of the model is about 0.5% to 2% higher than that of the related methods. The comparison results are shown in Table 2.
[0098] Table 2 Comparison results example
[0099]
[0100] In summary, on the two datasets used in this example, the brain tumor classification and detection method based on the feature pyramid network structure and channel attention mechanism achieved excellent results in brain tumor classification. The optimal multi-classification accuracy during the model training phase was 99.3%, and the accuracy during the classification detection phase was 99.24%. The experimental results show that the classification accuracy of all four categories exceeded 0.99, demonstrating the significant classification effect of the proposed method.
[0101] The basic principles, main features, and advantages of the present invention are shown and described above. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are merely illustrative of the principles of the present invention. Various changes and modifications may be made to the present invention without departing from the spirit and scope of the present invention. Such changes and modifications are intended to fall within the scope of the present invention. The scope of protection claimed in the present invention is defined by the appended claims and their equivalents.
Claims
1. A brain tumor classification and detection method based on a feature pyramid network structure and a channel attention mechanism, characterized in that: The following steps are involved: First, a smoothing method is used to enhance the quality of brain tumor images and reduce noise interference and distortion. Then, an improved channel attention mechanism is used, replacing average pooling and maximum pooling with a feature pyramid network structure, and forming the first-stage neural network model with a residual block. Next, the neural network structure is optimized, replacing the SE module with an efficient channel attention module and adding a global average pooling layer and a fully connected layer sequence with a PFLU activation function to form the second-stage neural network model. Finally, the model is trained using K-fold cross-validation, and the optimal model is selected using the F1 score evaluation method. The specific steps are as follows: Step 1: First, image preprocessing is performed: Gaussian filtering is used to smooth the original image to suppress noise in the functional image, improve the signal-to-noise ratio, and reduce noise interference and distortion in each image; digital image transformation methods such as cropping and flipping are used to spatially transform the processed image so that the receptive field can better capture features; Step 2: Build an improved attention mechanism (CBAM) module. Replace the maximum pooling layer and average pooling layer of the spatial attention module with convolutional layers of a feature pyramid structure. Convolution kernels of different sizes are used to obtain digital image features with receptive fields of different sizes. Step 3: Integrate the improved attention mechanism module and residual block from Step 2 to form the first-stage neural network model. This model is trained to extract data features from brain tumor images. A hypercolumn approach is used to combine the activation values of the convolutional network units at all corresponding positions following the extracted feature pixel into a column vector for feature fusion to obtain the combined features. Step 4: Replace the SE channel attention module of the EfficientNet neural network structure with a local cross-channel interaction strategy without dimensionality reduction and an efficient channel attention mechanism that adaptively selects the size of the one-dimensional convolution kernel. Optimize the model's weight layer and add a global average pooling layer, two fully connected layers with PFLU activation functions, and a dropout layer sequence to form the second-stage neural network model. In step 5, the combined features obtained in step 3 are used as the input of the neural network model in step 4. The model is trained and verified through K-fold cross validation, and the F1 score evaluation method is used to select the optimal model weight parameters.
2. The brain tumor classification and detection method based on the feature pyramid network structure and channel attention mechanism according to claim 1 is characterized in that: In step 2, an improved attention mechanism module is constructed according to the following steps: Step 2.1: The spatial attention module compresses the channel attention feature map in the spatial dimension to obtain a one-dimensional vector and then performs average pooling or maximum pooling operations. Average pooling and maximum pooling can be used to aggregate the spatial information of the feature map. The calculation formula is as follows: Mc(F)=σ(MLP(AvgPool(F))+MLP(MaxPool(F))), Where σ is the sigmoid activation function, MLP is a two-layer neural network, F is the input, AvgPool is the average pooling, and MaxPool is the maximum pooling; Step 2.2: Use the convolution layer of the feature pyramid structure to replace the maximum pooling layer and the average pooling layer of the spatial attention module. The features of receptive fields of different sizes are obtained through convolution kernels of different sizes. The larger the convolution kernel, the more global features are extracted, and the smaller the convolution kernel, the more local features are extracted. The calculation formula of the feature pyramid spatial attention module is as follows: Ms(F) = σ(f^kxk([f^1x1(F); f^3x3(F); f^5x5(F)])) Where σ is the sigmoid activation function, f^kxk is the kxk convolutional neural network, and F is the input.
3. The brain tumor classification and detection method based on feature pyramid network structure and channel attention mechanism according to claim 1 is characterized in that: In step S3, feature combination is performed using a hypercolumn method according to the following method: Since the features will gradually weaken, the feature maps at different stages show large feature differences. The hypercolumn technology is used to associate the feature maps. For a certain input pixel point i, the corresponding positions of this pixel in each feature map during the feature extraction process are connected in series to form a feature vector f. This feature vector is the hypercolumn feature corresponding to a certain input pixel point position i. Its formation formula is as follows: in: represents the accumulation operation of k feature maps; α_ik is a factor based on the pixel point and feature map position; F_k represents the kth feature map.
4. The brain tumor classification and detection method based on feature pyramid network structure and channel attention mechanism according to claim 1 is characterized in that: In step S4, the SE channel attention module is replaced by a local cross-channel interaction strategy without dimensionality reduction and an efficient channel attention mechanism for adaptively selecting the one-dimensional convolution kernel size according to the following steps: Step 4.1: The local cross-channel interaction strategy without dimensionality reduction and the efficient channel attention mechanism with adaptive selection of one-dimensional convolution kernel size consists of two parts. The first part is to perform cross-channel information interaction without reducing the channel dimension. The calculation formula is as follows: Where σ is the sigmoid activation function, y_i^j is the weight, and Ω_i^k is the set of k adjacent channels of weight y_i^j; this formula avoids the complete independence of different groups and allows all channels to share weight information; Step 4.2: The second part of the efficient channel attention mechanism is to enable the module to realize information interaction between channels by adaptively selecting one-dimensional convolution with a convolution kernel size of K. The implementation formula is as follows: ω=σ(CID_k(y)), Where σ is the sigmoid activation function, C1D represents one-dimensional convolution, and K is the convolution kernel size. Since the ECA module only involves K parameter information and when k = 3, it can achieve the same effect as SE-Var3 but with lower model complexity; therefore, using ECA instead of the original SE improves model efficiency.
5. The brain tumor classification and detection method based on feature pyramid network structure and channel attention mechanism according to claim 1 is characterized in that: The neural network model of the second stage optimized in step S4 includes a global average pooling layer C1, a fully connected layer sequence D2, a fully connected layer sequence D3, a fully connected layer sequence D4, a fully connected layer sequence D5 and an output layer; the global average pooling layer C1 has a structural parameter of 2048, replaces the fully connected layer and reduces the dimension of the feature map, reduces the number of parameters and the amount of calculation, and prevents overfitting; The fully connected layer sequence D2 has a structure parameter reduced from 2048 to 1000, which is connected to the C1 layer features. It includes a normalization layer and a dropout layer, and the dropout rate of the dropout layer is set to 0.
3. The fully connected layer sequence D3 has a structure parameter reduced from 1000 to 512, connected to the neurons in the D2 layer, including a normalization layer, a dropout layer, and a PFLU activation function, with a dropout rate of 0.3 set for the dropout layer; the fully connected layer sequence D4 has a structure parameter reduced from 512 to 128, connected to the neurons in the D3 layer, including a normalization layer, a dropout layer, and a PFLU activation function, with a dropout rate of 0.3 set for the dropout layer; the fully connected layer sequence D5 has a structure parameter reduced from 128 to 4, connected to the neurons in the D4 layer; The output layer has 4 neurons connected to the fully connected layer D5 to perform four classifications on the results.
6. A brain tumor classification and detection system based on a feature pyramid network structure and an efficient channel attention mechanism, characterized in that: The terminal device includes an Internet terminal device, a processor and a computer-readable storage medium, wherein the processor is used to implement various instructions; and the computer-readable storage medium is used to store multiple instructions. The computer-readable storage medium is used to store a plurality of instructions, and the instructions are suitable for being loaded by a processor of a terminal device and executed as claimed in any one of claims 1 to 5, a brain tumor classification and detection method based on a feature pyramid network structure and a channel attention mechanism.
Citation Information
Patent Citations
Text detection method and system based on feature pyramid and attention fusion
CN113903022A
Pneumonia image detection system and method based on channel attention residual network
CN113592809A
Electromyography gesture recognition method of feature pyramid network fused with double-attention mechanism
CN113627401A