Brain tumor CT image classification system based on neural network

By adopting an optimized convolutional neural network model and residual mixed attention mechanism in the brain tumor CT image classification system, the problem of low accuracy of brain tumor CT image classification in the prior art is solved, and high-precision automatic classification and stronger model generalization capabilities are achieved.

CN119863430APending Publication Date: 2025-04-22NANTONG UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411848237.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

The prior art has problems in the classification of brain tumor CT images with low classification accuracy and sensitive to image quality differences, and traditional methods are time-consuming and have limited accuracy.

Method used

The brain tumor CT image classification system based on neural network is adopted to build an optimized convolutional neural network model and combine the residual mixed attention mechanism to achieve high-precision automatic classification of brain tumor CT images.

Benefits of technology

It significantly improves the classification accuracy of brain tumor CT images, enhances the model's ability to identify image details and context information, and improves the generalization ability and stability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119863430A_ABST
    Figure CN119863430A_ABST
Patent Text Reader

Abstract

The invention discloses a brain tumor CT image classification system based on a neural network. The brain tumor CT image classification system comprises a data preprocessing module, a brain CT image classification neural network construction module, a brain tumor CT image classification neural network training module and a brain tumor CT image classification output module. An advanced data enhancement technology is adopted, and the advanced data enhancement technology comprises operations such as random rotation, overturning, zooming and cutting. The operations improve the adaptability of the model to image transformation by simulating different image transformation. The model optimizes the automatic classification of brain tumor CT images. By introducing residual connection, the model can effectively alleviate the gradient disappearance problem in the deep network, and the hybrid attention mechanism enhances the capturing capability of the global dependency relationship of the image. Compared with a traditional CNN model, the system provided by the invention can extract local features and global features more accurately, and significantly improves the classification accuracy of brain tumor CT images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of image classification systems, and in particular relates to a brain tumor CT image classification system based on a neural network. Background Art

[0002] Convolutional Neural Networks (CNN) is a feedforward neural network. Its core principle is mainly the hierarchical structure of convolution and pooling. It can effectively process multi-dimensional data and is also the preferred solution for classifying and detecting target objects.

[0003] With the rapid development of medical imaging technology, computed tomography (CT) plays a vital role in the diagnosis of brain tumors. CT images can provide high-resolution cross-sectional views of the brain, helping doctors to detect and evaluate brain tumors. However, traditional image classification methods that rely on manual feature extraction, such as those based on texture analysis and shape features, are not only time-consuming but also have limited accuracy. In addition, brain tumors have great diversity in appearance and overlap with normal brain tissue. The expansion of the tumor will also cause the nearby normal tissue to metastasize or deform, resulting in large individual differences in the anatomical structure of brain tumors, thereby increasing the difficulty of classification.

[0004] In recent years, deep learning, as one of the most popular research trends in artificial intelligence, has played a huge role in lesion identification and disease classification. Among different neural network architectures, convolutional neural networks have dominated medical image processing tasks for many years. Their advantage is that they can automatically label and extract lesion features in images, and accurately identify and diagnose diseases.

[0005] However, convolutional neural networks still have certain shortcomings in the field of medical imaging. For example, when using deep learning to classify brain tumor CT, a large number of data sets are required as training sets and test sets. However, there are differences in the acquisition process of brain tumor CT, and the image quality presented by images from different sources is also uneven, resulting in a deterioration in the final classification effect of the model.

[0006] In the field of deep learning, optimization algorithms play a vital role in adjusting and optimizing the parameters of neural network models. The performance of optimization algorithms directly affects the training speed, stability and accuracy of the neural network model. Summary of the invention

[0007] In view of the problems existing in the prior art, the present invention provides a brain tumor CT image classification system based on neural network. By adopting cutting-edge deep learning technology, building an optimized convolutional neural network model, and combining the residual mixed attention mechanism, it can achieve high-precision automatic classification of brain tumor CT images, thereby assisting doctors to make more accurate diagnosis and treatment planning.

[0008] To solve the above technical problems, the present invention provides the following technical solutions: a brain tumor CT image classification system based on neural network, comprising: a data preprocessing module, a brain CT image classification neural network construction module, a brain tumor CT image classification neural network training module, and a brain tumor CT image classification output module;

[0009] A brain CT image data set preprocessing module, used to construct and preprocess a brain CT image data set, wherein the data set includes a plurality of brain CT images and corresponding labels;

[0010] The data enhancement module is used to perform various transformation operations on brain CT images so that the enhanced images maintain diversity in the feature space;

[0011] The neural network building module for brain tumor CT image classification includes a sequentially connected input layer, residual block, attention mechanism layer, and output layer;

[0012] The input layer is used to receive the brain CT image data output by the data enhancement module and convert the brain CT image data into a numerical form; the residual block includes several sequentially connected convolutional layers, each of which is connected to a batch normalization layer and a ReLU activation function. The residual block directly adds the input features to the output of the residual block through a jump connection to solve the gradient vanishing problem in deep network training; the attention mechanism layer uses a self-attention mechanism to capture the global dependency of the image. Each attention head calculates the weighted sum of the query Q, key K, and value V. The output layer uses a softmax activation function to convert the final feature map into a category probability distribution;

[0013] The neural network training module for brain tumor CT image classification uses brain CT images as input and the labels corresponding to the images as output to train a brain tumor CT image classification model. During training, the cross entropy loss function is used to calculate the difference between the model output and the true label. Bayesian statistical inference is used to select the optimal hyperparameter combination. The classification performance of the model is evaluated by monitoring accuracy, recall rate, and F1 score indicators. Finally, hyperparameter optimization is performed to adjust the model parameters.

[0014] The brain tumor CT image classification output module uses the brain tumor CT image classification model and takes the collected brain CT images as input to obtain the corresponding brain tumor classification results.

[0015] Furthermore, the aforementioned brain CT image dataset preprocessing module is configured to perform denoising, contrast enhancement, standardization, and normalization operations on the brain CT image;

[0016] Denoising of brain CT images includes Gaussian filtering and median filtering; Gaussian filtering uses a Gaussian kernel for convolution operations to reduce high-frequency noise, as shown in the following formula:

[0017]

[0018] Where G(x,y) represents the value after Gaussian filtering at the coordinate (x,y); x and y represent the horizontal and vertical coordinate positions of the pixel in the image; σ is the standard deviation of the Gaussian kernel, which determines the smoothness of the filter and the ability to suppress noise;

[0019] Median filtering replaces the value of each pixel with the median value in its neighborhood, effectively removing salt and pepper noise, as shown in the following formula:

[0020] I median (x,y)=median(I(xi,yj))

[0021] Among them, I median (x,y) is the pixel value after median filtering

[0022] The specific steps of contrast enhancement are: first calculate the histogram of the image, then use the histogram equalization method to adjust the distribution of pixel values, so that the contrast of the image is enhanced and the histogram is equalized, as shown in the following formula:

[0023]

[0024] Among them, I ep (p) is the equalized pixel value, I(p) is the original pixel value, and γ is the contrast stretching parameter;

[0025] The specific standardization is to calculate the mean of the image, that is, the mean μ, and then subtract the mean from each pixel value so that the processed image pixel value has zero mean. The zero mean is as follows:

[0026] I zero-centered (x,y)=I(x,y)-μ

[0027] Among them, I zero-centered (x,y) is the pixel value after zero averaging;

[0028] Normalization is specifically: calculate the minimum and maximum values ​​of the image, and scale each pixel value to the range of [0,1]; normalization is as follows:

[0029]

[0030] Among them, x represents a pixel value in the original brain tumor CT image; xmin represents the minimum pixel value in the image data set; xmax represents the maximum pixel value in the image data set; and xnorm represents the normalized pixel value.

[0031] Furthermore, the aforementioned data enhancement module performs rotation, flipping, scaling, and cropping operations on the brain CT image;

[0032] The rotation operation is to rotate the image at a random angle, and the two-dimensional space rotation matrix Used to adjust the pixel coordinates of the image, where θ represents the rotation angle; the elements in the matrix rotate the coordinate points in two-dimensional space; for a two-dimensional coordinate point (x, y), after the rotation matrix, it becomes: (cosθ·x-sinθ·y, sinθ·x+cosθ·y);

[0033] The flip operation flips the image along the horizontal or vertical axis. Horizontal flipping swaps pixel columns, and vertical flipping swaps pixel rows.

[0034] The scaling operation is to enhance the diversity of image data by adjusting the size of the image while maintaining the original ratio;

[0035] The cropping operation is to randomly crop an area on the image to change the field of view and retain key features; the size and position of the cropped area are usually determined by a random function.

[0036] Furthermore, the aforementioned residual block is configured to perform the following actions:

[0037] F(x)=x+Δ(x)

[0038] Among them, F(x) is the output of the residual block, x is the input feature map, and Δ(x) is the output of the convolutional layer.

[0039] Furthermore, the aforementioned attention mechanism layer is configured to perform the following actions:

[0040] A(x)=σ(g(x)·x)

[0041] Where A(x) is the weighted feature map, g(x) is the attention weight, σ is the activation function, and · represents element-wise multiplication.

[0042] Furthermore, the aforementioned, output layer is configured to perform the following actions: Use the softmax activation function for multi-classification, as follows:

[0043]

[0044] Among them, x i represents the input value of a specific neuron in the output layer of the neural network, Indicates x i The result of performing an exponential operation; It represents the sum of the input values ​​of all neurons in the output layer after exponential operation; softmax(xi) represents the output probability value corresponding to the neuron after being processed by the softmax activation function.

[0045] Furthermore, the aforementioned brain tumor CT image classification neural network training module uses a cross entropy loss function to calculate the difference between the model output and the true label during training. The difference cross entropy loss function is as follows:

[0046]

[0047] Among them, L represents the cross entropy loss value; N is the number of samples; y i Represents the true label, which is 1 if the sample belongs to a certain category, otherwise it is 0. Represents the probability value predicted by the model that belongs to this class.

[0048] Furthermore, the aforementioned, a variety of performance evaluation indicators are used to evaluate the classification performance of the model, specifically: count the number of true positive examples TP, true negative examples TN, false positive examples FP and false negative examples FN, calculate the precision and recall rate, and finally, substitute the calculated precision and recall rate into the F1 score formula to calculate the value of the F1 score. By using the F1 score indicator, the performance of the model is comprehensively measured.

[0049] The accuracy calculation formula is as follows:

[0050]

[0051] Among them, TP represents true positive examples, that is, the number of samples that are actually positive and predicted as positive samples; TN represents true negative examples, that is, the number of samples that are actually negative and predicted as negative samples; FP represents false positive examples, that is, the number of samples that are actually negative but predicted as positive samples; FN represents false negative examples, that is, the number of samples that are actually positive but predicted as negative samples;

[0052] The recall calculation formula is as follows:

[0053]

[0054] Among them, TP represents true positive samples, that is, the number of samples that are actually positive and predicted as positive samples; FN represents false negative samples, that is, the number of samples that are actually positive but predicted as negative samples;

[0055] The F1 score calculation formula is as follows:

[0056]

[0057] Among them, Precision is the accuracy rate, which refers to the ratio of the number of samples correctly predicted as positive to the number of all samples predicted as positive.

[0058] Furthermore, the aforementioned use of Bayesian statistical inference to select the optimal hyperparameter combination is specifically by constructing a probability model, which is used to predict performance indicators including accuracy and recall under given hyperparameter settings, and then selecting a hyperparameter combination that improves performance for evaluation.

[0059] Furthermore, the aforementioned hyperparameter optimization and adjustment of model parameters specifically include the following steps:

[0060] Step 1: Perform network search and random search. Network search is to traverse all possible combinations of hyperparameters and find the optimal hyperparameters by training the models one by one. Random search is to randomly select combinations in the parameter space with preset search times and time limits.

[0061] Step 2: Adjust hyperparameters, including learning rate adjustment, batch size adjustment, number of training rounds adjustment, and number of network layers adjustment; Step 3: Performance monitoring and optimal selection, including performance indicator recording: use the validation set to evaluate the model performance of different parameter combinations; use the early stopping mechanism to monitor model performance changes to avoid overfitting, and finally select the optimal hyperparameter combination: select the optimal hyperparameter configuration based on the performance indicators, and retrain the model to obtain the final optimal model.

[0062] Compared with the prior art, the beneficial technical effects of the above technical solutions adopted by the present invention are as follows: 1. Improved classification accuracy: The residual mixed attention convolutional neural network model adopted by the present invention can effectively capture the local and global features of brain tumor CT images, and significantly improves the classification accuracy compared with the traditional CNN model. This structural design enhances the model's ability to recognize image details and contextual information through residual connections and self-attention mechanisms, thereby improving the classification accuracy of brain tumor CT images.

[0063] 2. Enhance the generalization ability of the model: Through data enhancement techniques such as rotation, flipping, scaling and cropping, the present invention expands the training data set so that the model can adapt to more image transformations and noise interference. This multi-dimensional data enhancement method improves the generalization ability of the model for brain tumor images under different viewing angles and conditions, and enhances the stability and reliability of the model in practical applications.

[0064] 3. Optimize the hyperparameter adjustment process: The grid search and random search methods used in this paper provide a systematic search strategy for hyperparameter optimization. This method effectively finds the optimal hyperparameter combination by traversing and randomly sampling the hyperparameter space, which greatly improves the efficiency of model training and the final performance compared to traditional manual adjustment or empirical methods.

[0065] 4. Comprehensively improve model performance: In the model verification and testing phase, the present invention uses multiple performance evaluation indicators such as accuracy, recall, F1 score and AUC to comprehensively evaluate the classification performance of the model. This multi-indicator evaluation method not only improves the comprehensiveness of model evaluation, but also ensures the efficiency and reliability of the model in practical applications.

[0066] 5. Promote the formulation of personalized treatment plans: Based on the precise classification results of the present invention, doctors can more accurately determine the type and grade of brain tumors, thereby providing patients with more personalized and targeted treatment plans. This refined diagnostic method helps to improve treatment effects, reduce unnecessary treatment risks, and improve the quality of life of patients. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 It is a framework diagram of the present invention.

[0068] Figure 2 It is a flowchart of brain CT image dataset preprocessing.

[0069] Figure 3 It is a framework diagram of the neural network model of the present invention.

[0070] Figure 4 It is a data augmentation flowchart.

[0071] Figure 5 It is the Bayesian optimization flow chart of the present invention.

[0072] Figure 6 It is a model verification and testing flow chart of the present invention.

[0073] Figure 7 It is a hyperparameter optimization flow chart of the present invention. DETAILED DESCRIPTION

[0074] In order to better understand the technical content of the present invention, specific embodiments are given and described as follows in conjunction with the accompanying drawings.

[0075] Various aspects of the invention are described herein with reference to the accompanying drawings, in which many illustrative embodiments are shown. The embodiments of the invention are not limited to those described in the accompanying drawings. It should be understood that the invention is implemented by any of the various concepts and embodiments described above, as well as the concepts and embodiments described in detail below, because the concepts and embodiments disclosed in the invention are not limited to any implementation. In addition, some aspects disclosed in the invention may be used alone or in any appropriate combination with other aspects disclosed in the invention.

[0076] refer to Figure 1, the present invention discloses a brain tumor CT image classification system based on neural network, comprising: a brain CT image data set preprocessing module, a brain CT image classification neural network building module, a brain tumor CT image classification neural network training module, and a brain tumor CT image classification output module;

[0077] The brain CT image dataset preprocessing module is used to construct and preprocess a brain CT image dataset, wherein the dataset includes a plurality of brain CT images and corresponding labels. Figure 2 , the brain CT image dataset preprocessing module is configured to perform denoising, contrast enhancement, standardization, and normalization operations on the brain CT images;

[0078] Denoising of brain CT images includes Gaussian filtering and median filtering; Gaussian filtering uses a Gaussian kernel for convolution operations to reduce high-frequency noise, as shown in the following formula:

[0079]

[0080] Where G(x,y) represents the value after Gaussian filtering at the coordinate (x,y); x and y represent the horizontal and vertical coordinate positions of the pixel in the image; σ is the standard deviation of the Gaussian kernel, which determines the smoothness of the filter and its ability to suppress noise.

[0081] First, determine the standard deviation σ value of the Gaussian kernel and adjust it according to the noise situation of the image and the desired smoothing effect. For each pixel in the CT image, a neighborhood of a certain size (such as 3x3, 5x5, etc.) is selected with the pixel as the center. Then, the Gaussian kernel is convolved with the pixel value in the neighborhood. In the specific calculation, each element in the Gaussian kernel is multiplied by the neighborhood pixel value at the corresponding position, and then all the products are added to obtain the new value of the pixel after Gaussian filtering. Repeat the above steps to process all pixels in the image, thereby achieving denoising of the entire brain tumor CT image. By reducing high-frequency noise, the image is clearer, the interference of noise on subsequent image classification is reduced, the accuracy and reliability of classification are improved, and a better data basis is provided for subsequent brain tumor CT image classification work.

[0082] Median filtering replaces the value of each pixel with the median value in its neighborhood, effectively removing salt and pepper noise, as shown in the following formula:

[0083] I median (x,y)=median(I(xi,yj))

[0084] Among them, I median (x,y) is the pixel value after median filtering;

[0085] Here are the steps:

[0086] 1. Choose a suitable neighborhood window size, usually an odd size such as 3x3, 5x5, etc., to ensure that there are intermediate values.

[0087] 2. Align the center of the window with each pixel in the image and read all pixel values ​​within the window.

[0088] 3. Sort the pixel values ​​in the window and find the middle value.

[0089] 4. Assign the intermediate value to the pixel at the center of the window, replacing its original value. Move the window to the next pixel and repeat steps 2-4 until the entire image is processed.

[0090] The specific steps of contrast enhancement are: first calculate the histogram of the image, then use the histogram equalization method to adjust the distribution of pixel values, so that the contrast of the image is enhanced and the histogram is equalized, as shown in the following formula:

[0091]

[0092] Among them, I ep (p) is the equalized pixel value, I(p) is the original pixel value, and γ is the contrast stretching parameter.

[0093] In this embodiment, the histogram of the image is calculated, that is, the frequency distribution of each pixel value, and a cumulative distribution function (CDF) is generated based on the histogram. The CDF describes the cumulative probability of pixel values ​​in the image. Each pixel value of the original image is mapped to a new pixel value so that the histogram distribution of the new pixel value is more uniform, thereby enhancing the contrast of the image.

[0094] The specific standardization is to calculate the mean of the image, that is, the mean μ, and then subtract the mean from each pixel value so that the processed image pixel value has zero mean. The zero mean is as follows:

[0095] I zero-centered (x,y)=I(x,y)-μ

[0096] Among them, I zero-centered (x,y) is the pixel value after zero-averaging.

[0097] Normalization is to calculate the minimum and maximum values ​​of the image and scale each pixel value to the range of [0,1] as follows:

[0098]

[0099] Among them, x represents a pixel value in the original brain tumor CT image; xmin represents the minimum pixel value in the image data set; xmax represents the maximum pixel value in the image data set; and xnorm represents the normalized pixel value.

[0100] The normalization steps are as follows: First, determine the brain tumor CT image data set to be normalized. Then calculate the minimum pixel value and the maximum pixel value in the data set. The minimum and maximum values ​​can be found by traversing the entire data set. For each pixel value in the data set, calculate according to the formula. Subtract the minimum pixel value from each pixel value, and then divide it by the difference between the maximum pixel value and the minimum pixel value to obtain the normalized pixel value. After the above steps, the pixel values ​​in the image are scaled to the range of [0,1]. In this patent, the role of maximum and minimum normalization is mainly to further standardize the preprocessed brain tumor CT images so that different image data have the same numerical range and improve the comparability and stability of the data.

[0101] The data enhancement module is used to perform various transformation operations on brain CT images so that the enhanced images maintain diversity in the feature space. Figure 4 As shown, the data enhancement module performs rotation, flipping, scaling, and cropping operations on the brain CT image;

[0102] The rotation operation is to rotate the image at a random angle, and the two-dimensional space rotation matrix Used to adjust the pixel coordinates of the image, where θ represents the rotation angle; the elements in the matrix rotate the coordinate points in two-dimensional space; for a two-dimensional coordinate point (x, y), after the rotation matrix, it becomes:

[0103] (cosθ·x-sinθ·y,sinθ·x+cosθ·y).

[0104] Determine the angle that needs to be rotated. This angle can be determined based on specific needs and experimental results. For example, in order to increase the diversity of data, some specific angles may be selected for rotation. For each pixel point coordinate in the image, substitute it into the rotation matrix formula to calculate the new coordinate after rotation.

[0105] The flip operation flips the image along the horizontal or vertical axis. Horizontal flipping swaps pixel columns, and vertical flipping swaps pixel rows.

[0106] The scaling operation is to enhance the diversity of image data by adjusting the size of the image while maintaining the original ratio;

[0107] The cropping operation is to randomly crop an area on the image to change the field of view and retain key features; the size and position of the cropped area are usually determined by a random function.

[0108] All data augmentation operations are performed at the pixel level without changing the image annotation information (such as category and location labels). Each operation generates different image variants, improving the model's generalization ability for various image transformations. Each augmentation transformation is performed based on preset parameters, such as the rotation angle range, scaling range, and cropping area size, so that the augmented image maintains diversity in the feature space.

[0109] Finally, the preprocessed image dataset is randomly divided into training set, validation set and test set, usually with a ratio of 70%, 15% and 15%. The training set is used for model training, the validation set is used for model hyperparameter adjustment and model selection, and the test set is used for the final evaluation of model performance.

[0110] like Figure 3 As shown, the neural network building module for brain tumor CT image classification includes a sequentially connected input layer, a residual block, an attention mechanism layer, and an output layer.

[0111] The input layer is used to receive the brain CT image data output by the data enhancement module and convert the brain CT image data into a numerical form that can be processed by the model; the residual block includes several sequentially connected convolutional layers, each of which is connected to a batch normalization layer and a ReLU activation function. The residual block directly adds the input features to the output of the residual block through a jump connection to solve the gradient vanishing problem in deep network training; the attention mechanism layer uses a self-attention mechanism to capture the global dependency of the image. Each attention head calculates the weighted sum of the query Q, key K, and value V. The output layer uses a softmax activation function to convert the final feature map into a category probability distribution;

[0112] The residual block is configured to perform the following actions:

[0113] F(x)=x+Δ(x)

[0114] Among them, F(x) is the output of the residual block, x is the input feature map, and Δ(x) is the output of the convolutional layer.

[0115] The attention layer is configured to perform the following actions:

[0116] A(x)=σ(g(x)·x)

[0117] Where A(x) is the weighted feature map, g(x) is the attention weight, σ is the activation function, and · represents element-wise multiplication.

[0118] The output layer is configured to perform the following actions: Use the softmax activation function for multi-classification, as follows:

[0119]

[0120] Among them, xi represents the input value of a specific neuron in the output layer of the neural network, Indicates x i The result of performing an exponential operation; represents the sum of the input values ​​of all neurons in the output layer after exponential operation; softmax(xi) represents the output probability value corresponding to the neuron after being processed by the softmax activation function. The function of the softmax activation function is to convert the final feature map of the neural network into a category probability distribution. By calculating the probability value corresponding to each category, the model can perform multi-classification of brain tumor CT images.

[0121] The neural network training module for brain tumor CT image classification uses brain CT images as input and the labels corresponding to the images as output to train a brain tumor CT image classification model. During training, the cross entropy loss function is used to calculate the difference between the model output and the true label. At the same time, Bayesian statistical inference is used to select the optimal hyperparameter combination. The classification performance of the model is evaluated by monitoring accuracy, recall rate, and F1 score indicators. Finally, hyperparameter optimization is performed to adjust the model parameters.

[0122] The present invention uses brain tumor CT images in the BraTS (Brain Tumor Segmentation) and TCIA (The Cancer Imaging Archive) databases as training data. After the data is preprocessed and enhanced, it is ensured that the model can generalize to different types of brain tumors. Specifically: First, the preprocessed CT image data (including the preprocessed and enhanced brain tumor CT images and the corresponding true labels) are passed as input to the residual block. After the input feature map enters the residual block, it undergoes a processing process consisting of multiple convolutional layers, each of which is followed by a batch normalization layer and a ReLU activation function to obtain the output of the convolutional layer. Finally, the input feature map is added to the output of the convolutional layer to obtain the output of the residual block. In this patent, the role of the residual block is mainly to extract local features of the image. By adding the input directly to the output of the block through a jump connection, the gradient vanishing problem in deep network training is solved, so that the network can better learn and extract local detail features in brain tumor CT images. During the training process, for each sample, according to its true label and predicted probability value, it is substituted into the cross entropy loss function formula for calculation. The loss values ​​of all samples are summed and averaged to obtain the total cross entropy loss value. By using the cross entropy loss function, the model learning can be effectively guided, the accuracy of brain tumor CT image classification can be improved, and doctors can be assisted in more accurate diagnosis and treatment planning.

[0123] The training parameters are set as follows:

[0124] Epochs: Defines the number of times the data is fully traversed through the model. (Generally, as the number of training epochs increases, the model performance gradually improves, but overfitting should be avoided.)

[0125] Batch Size: The number of samples used each time the model parameters are updated. (A larger batch size can speed up training but requires higher computing resources.)

[0126] Learning Rate: Controls the step size of model parameter updates. (Learning rate decay strategy is usually used to improve convergence.)

[0127] The neural network training module for brain tumor CT image classification uses a cross entropy loss function to calculate the difference between the model output and the true label during training. The difference cross entropy loss function is as follows:

[0128]

[0129] Among them, L represents the cross entropy loss value; N is the number of samples; y i Represents the true label, which is 1 if the sample belongs to a certain category, otherwise it is 0; Represents the probability value predicted by the model that belongs to this class.

[0130] The detailed process of model verification and testing is as follows Figure 6 As shown, performance evaluation and parameter adjustment on the validation set:

[0131] 1. Loss function and optimizer: The model’s prediction performance on the validation set is evaluated by calculating the cross entropy loss. The loss function measures the difference between the true label and the predicted output. The optimization algorithm Adam is used to update the model parameters according to the loss function value.

[0132] 2. Parameter adjustment: Adjust hyperparameters and use Bayesian statistical inference to select the optimal hyperparameter combination. By building a probabilistic model that can predict performance indicators (such as accuracy, recall, etc.) under given hyperparameter settings, and then select the hyperparameter combination that is most likely to improve performance for evaluation, such as Figure 5 shown.

[0133] 3. Performance indicators: Monitor indicators such as accuracy, recall, and F1 score during the validation phase to measure the generalization ability of the model. (Accuracy indicates the proportion of correctly predicted samples, recall indicates the ability to correctly identify positive samples, and F1 score is the harmonic average of accuracy and recall.)

[0134] Model Evaluation on the Test Set After training and validation are complete, the test set is used to independently evaluate the model performance.

[0135] A variety of performance evaluation indicators are used to evaluate the classification performance of the model, specifically: count the number of true positives TP, true negatives TN, false positives FP, and false negatives FN, calculate the accuracy and recall, and finally substitute the calculated precision and recall into the F1 score formula to calculate the value of the F1 score. By using the F1 score indicator, the performance of the model is comprehensively measured to provide a basis for selecting the optimal model parameter combination and model structure. By using the accuracy indicator, you can intuitively understand the accuracy of the model in classifying brain tumor CT images.

[0136] The accuracy calculation formula is as follows:

[0137]

[0138] Among them, TP represents true positive examples, that is, the number of samples that are actually positive and predicted as positive samples; TN represents true negative examples, that is, the number of samples that are actually negative and predicted as negative samples; FP represents false positive examples, that is, the number of samples that are actually negative but predicted as positive samples; FN represents false negative examples, that is, the number of samples that are actually positive but predicted as negative samples;

[0139] After the model predicts the test set, the number of true positives (TP) and false negatives (FN) is counted. These values ​​are substituted into the recall formula to calculate the recall value. By using the recall metric, the model's ability to identify positive brain tumor samples can be better measured, providing an important basis for improving the practicality and accuracy of the model.

[0140] The recall calculation formula is as follows:

[0141]

[0142] Among them, TP represents true positive samples, that is, the number of samples that are actually positive and predicted as positive samples; FN represents false negative samples, that is, the number of samples that are actually positive but predicted as negative samples;

[0143] The F1 score calculation formula is as follows:

[0144]

[0145] Among them, Precision is the accuracy rate, which refers to the ratio of the number of samples correctly predicted as positive to the number of all samples predicted as positive.

[0146] In addition, a confusion matrix is ​​constructed to visualize the prediction results of the model on the test set, including the number distribution of TP, TN, FP, and FN.

[0147] Recording and analysis

[0148] 1. Record indicators: Record performance indicators such as accuracy, recall, F1 score, AUC (Area Under Curve) in detail. Categorize and analyze the prediction performance of different types of models.

[0149] 2. Model visualization: Use visualization tools such as ROC curves and PrecisionRecall curves to deeply analyze model performance, and use confusion matrices to understand the classification effects of the model on different categories.

[0150] 3. Performance optimization: If the model performs poorly on the test set, you can optimize the model by adjusting the model structure, further tuning hyperparameters, increasing training data, or using different feature extraction methods.

[0151] The brain tumor CT image classification output module uses the brain tumor CT image classification model and takes the collected brain CT images as input to obtain the corresponding brain tumor classification results.

[0152] Hyperparameter optimization such as Figure 7 As shown, the steps are as follows:

[0153] Step 1: Perform network search and random search. Network search is to traverse all possible combinations of hyperparameters and find the optimal hyperparameters by training the models one by one. Random search is to randomly select combinations in the parameter space with preset search times and time limits, traverse all possible combinations of hyperparameters, and find the optimal hyperparameters by training the models one by one. This method is suitable for situations where the parameter range is small and discrete. A parameter list is set during implementation, for example: the learning rate α is selected in [0.001, 0.01, 0.1], and the batch size is selected in [32, 64, 128]. Train each combination and verify the performance. Random search is more efficient, especially for situations where the parameter range is large and uneven. The waste of computing resources can be avoided by setting the number of searches or time limits.

[0154] Step 2: Adjust hyperparameters, including learning rate, batch size, number of training rounds, and number of network layers.

[0155] Learning Rate: determines the step size of each update of the gradient descent algorithm, affecting the convergence speed and stability of the model. The adjustment range is usually [10 -6,1], using exponential scaling. Batch Size: affects the training stability and memory consumption of the model. Small batches can provide faster updates, but the computation is more demanding; large batches are more stable but require more memory. Number of training epochs: sets the number of times the model fully trains the data. Too few epochs can lead to underfitting, and too many epochs can lead to overfitting. Monitor the training and validation set losses through cross-validation and select the appropriate number of epochs. Number of Network Layers: adjust the depth, width, convolution kernel size and other structural parameters of the network layer to explore the optimal network architecture.

[0156] Step 3: Performance monitoring and optimal selection, including performance indicator recording: Use the validation set to evaluate the model performance of different parameter combinations. Common indicators include accuracy, F1score, AUC, etc.

[0157] Use early stopping mechanism to monitor the performance changes of the model and avoid overfitting. By setting the threshold and waiting steps, stop training early when the performance no longer improves. Select the optimal hyperparameter combination: According to the performance indicators, select the optimal hyperparameter configuration and retrain the model to obtain the final optimal model performance.

[0158] Through the above steps, the present invention provides a brain tumor CT image classification system based on neural network, which can effectively assist doctors in diagnosing and planning treatment of brain tumors.

[0159] 1. Use convolutional neural network (CNN) as the core feature extractor and integrate residual mixed attention mechanism to enhance the model's recognition and classification capabilities for brain tumor CT images.

[0160] 2. By collecting and preprocessing CT image data of brain tumor patients, a residual mixed attention convolutional neural network model is constructed and optimized, which can extract local and global features of the image, thereby improving the classification accuracy.

[0161] 3. Use data augmentation techniques to expand the training data set and improve the generalization ability of the model.

[0162] 4. The efficiency and reliability of the model are ensured by using the cross entropy loss function and Adam optimizer during the training process, as well as performance evaluation indicators such as accuracy, recall rate and F1 score during the model verification and testing stages.

[0163] 5. Hyperparameter optimization was performed through grid search and random search methods, which further improved the classification performance of the model.

[0164] Although the present invention has been described above with preferred embodiments, it is not intended to limit the present invention. A person skilled in the art of the present invention may make various modifications and improvements without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be determined by the definition of the claims.

Claims

1. A brain tumor CT image classification system based on neural network, characterized in that: include: A data preprocessing module, a brain CT image classification neural network construction module, a brain tumor CT image classification neural network training module, and a brain tumor CT image classification output module; A brain CT image data set preprocessing module, used to construct and preprocess a brain CT image data set, wherein the data set includes a plurality of brain CT images and corresponding labels; The data enhancement module is used to perform various transformation operations on brain CT images so that the enhanced images maintain diversity in the feature space; The neural network building module for brain tumor CT image classification includes a sequentially connected input layer, residual block, attention mechanism layer, and output layer; The input layer is used to receive the brain CT image data output by the data enhancement module and convert the brain CT image data into a numerical form; the residual block includes several sequentially connected convolutional layers, each of which is connected to a batch normalization layer and a ReLU activation function. The residual block directly adds the input features to the output of the residual block through a skip connection to solve the gradient vanishing problem in deep network training; The attention mechanism layer uses the self-attention mechanism to capture the global dependencies of the image. Each attention head calculates the weighted sum of the query Q, key K, and value V. The output layer uses the softmax activation function to convert the final feature map into a category probability distribution. The neural network training module for brain tumor CT image classification uses brain CT images as input and the labels corresponding to the images as output to train a brain tumor CT image classification model. During training, the cross entropy loss function is used to calculate the difference between the model output and the true label. Bayesian statistical inference is used to select the optimal hyperparameter combination. The classification performance of the model is evaluated by monitoring accuracy, recall rate, and F1 score indicators. Finally, hyperparameter optimization is performed to adjust the model parameters. The brain tumor CT image classification output module uses the brain tumor CT image classification model and takes the collected brain CT images as input to obtain the corresponding brain tumor classification results.

2. The neural network-based brain tumor CT image classification system according to claim 1, characterized in that: The brain CT image dataset preprocessing module is configured to perform denoising, contrast enhancement, standardization, and normalization operations on the brain CT image; Denoising of brain CT images includes Gaussian filtering and median filtering; Gaussian filtering uses a Gaussian kernel for convolution operations to reduce high-frequency noise, as shown in the following formula: Where G(x,y) represents the value after Gaussian filtering at the coordinate (x,y); x and y represent the horizontal and vertical coordinate positions of the pixel in the image; σ is the standard deviation of the Gaussian kernel, which determines the smoothness of the filter and the ability to suppress noise; Median filtering replaces the value of each pixel with the median value in its neighborhood, effectively removing salt and pepper noise, as shown in the following formula: I median (x,y)=median(I(x-i,y-j)) Among them, I median (x,y) is the pixel value after median filtering The specific steps of contrast enhancement are: first calculate the histogram of the image, then use the histogram equalization method to adjust the distribution of pixel values, so that the contrast of the image is enhanced and the histogram is equalized, as shown in the following formula: Among them, I ep (p) is the equalized pixel value, I(p) is the original pixel value, and γ is the contrast stretching parameter; The specific standardization is to calculate the mean of the image, that is, the mean μ, and then subtract the mean from each pixel value so that the processed image pixel value has zero mean. The zero mean is as follows: I zero-centered (x,y)=I(x,y)-μ Among them, I zero-centered (x,y) is the pixel value after zero averaging; Normalization is specifically: calculating the minimum and maximum values ​​of the image and scaling each pixel value to the range of [0,1]; Normalized as follows: Among them, x represents a pixel value in the original brain tumor CT image; xmin represents the minimum pixel value in the image data set; xmax represents the maximum pixel value in the image data set; and xnorm represents the normalized pixel value.

3. The neural network-based brain tumor CT image classification system according to claim 1, characterized in that: The data enhancement module rotates, flips, scales, and crops the brain CT images; The rotation operation is to rotate the image at a random angle, and the two-dimensional space rotation matrix Used to adjust the pixel coordinates of the image, where θ represents the rotation angle; the elements in the matrix rotate the coordinate points in two-dimensional space; for a two-dimensional coordinate point (x, y), after the rotation matrix, it becomes: (cosθ·x-sinθ·y, sinθ·x+cosθ·y); The flip operation flips the image along the horizontal or vertical axis. Horizontal flipping swaps pixel columns, and vertical flipping swaps pixel rows. The scaling operation is to enhance the diversity of image data by adjusting the size of the image while maintaining the original ratio; The cropping operation is to randomly crop an area on the image to change the field of view and retain key features; the size and position of the cropped area are usually determined by a random function.

4. The neural network-based brain tumor CT image classification system according to claim 1, characterized in that: The residual block is configured to perform the following actions: F(x)=x+Δ(x) Among them, F(x) is the output of the residual block, x is the input feature map, and Δ(x) is the output of the convolutional layer.

5. The neural network-based brain tumor CT image classification system according to claim 1, characterized in that: The attention layer is configured to perform the following actions: A(x)=σ(g(x)·x) Among them, A(x) is the weighted feature map, g(x) is the attention weight, σ is the activation function, and · represents element-wise multiplication.

6. The neural network-based brain tumor CT image classification system according to claim 1, characterized in that: The output layer is configured to perform the following actions: Use the softmax activation function for multi-classification, as follows: Among them, x i represents the input value of a specific neuron in the output layer of the neural network, Indicates x i The result of performing an exponential operation; It represents the sum of the input values ​​of all neurons in the output layer after exponential operation; softmax(xi) represents the output probability value corresponding to the neuron after being processed by the softmax activation function.

7. The neural network-based brain tumor CT image classification system according to claim 1, characterized in that: The neural network training module for brain tumor CT image classification uses a cross entropy loss function to calculate the difference between the model output and the true label during training. The difference cross entropy loss function is as follows: Among them, L represents the cross entropy loss value; N is the number of samples; y i Represents the true label, which is 1 if the sample belongs to a certain category, otherwise it is 0. Represents the probability value predicted by the model that belongs to this class.

8. The neural network-based brain tumor CT image classification system according to claim 1, characterized in that: A variety of performance evaluation indicators are used to evaluate the classification performance of the model. Specifically, the number of true positives TP, true negatives TN, false positives FP, and false negatives FN is counted, and the precision and recall are calculated. Finally, the calculated precision and recall are substituted into the F1 score formula to calculate the F1 score value. By using the F1 score indicator, the performance of the model is comprehensively measured. The accuracy calculation formula is as follows: Among them, TP represents true positive examples, that is, the number of samples that are actually positive and predicted as positive samples; TN represents true negative examples, that is, the number of samples that are actually negative and predicted as negative samples; FP represents false positive examples, that is, the number of samples that are actually negative but predicted as positive samples; FN represents false negative examples, that is, the number of samples that are actually positive but predicted as negative samples; The recall calculation formula is as follows: Among them, TP represents true positive samples, that is, the number of samples that are actually positive and predicted as positive samples; FN represents false negative samples, that is, the number of samples that are actually positive but predicted as negative samples; The F1 score calculation formula is as follows: Among them, Precision is the accuracy rate, which refers to the ratio of the number of samples correctly predicted as positive to the number of all samples predicted as positive.

9. The neural network-based brain tumor CT image classification system according to claim 1, characterized in that: Bayesian statistical inference is used to select the optimal hyperparameter combination. Specifically, a probability model is constructed to predict performance indicators including accuracy and recall under given hyperparameter settings, and then the hyperparameter combination that improves performance is selected for evaluation.

10. The neural network-based brain tumor CT image classification system according to claim 1, characterized in that: Perform hyperparameter optimization to adjust model parameters, including the following steps: Step 1: Perform network search and random search. Network search is to traverse all possible combinations of hyperparameters and find the optimal hyperparameters by training the models one by one. Random search is to randomly select combinations in the parameter space with preset search times and time limits. Step 2: Adjust hyperparameters, including learning rate, batch size, number of training rounds, and number of network layers. Step 3: Performance monitoring and optimal selection, including performance indicator recording: use the validation set to evaluate the model performance of different parameter combinations; use the early stopping mechanism to monitor the changes in model performance to avoid overfitting, and finally select the optimal hyperparameter combination: select the optimal hyperparameter configuration based on the performance indicators, and retrain the model to obtain the final optimal model.

Citation Information

Patent Citations

  • Brain tumor classification detection method and system based on feature pyramid network structure and channel attention mechanism

    CN115170885A

  • Brain magnetic resonance image classification system based on attention guidance 3D neural network

    CN115908923A

  • Tumor image classification method and device based on residual CBAM attention mechanism

    CN117611872A