An intelligent diagnosis system for pneumonia region segmentation in medical images
By adopting ShufflenetV2-Unet network model and data enhancement technology in the medical image pneumonia area segmentation intelligent diagnostic system, the problems of slow execution speed and poor accuracy of the existing system are solved, and efficient and accurate pneumonia area segmentation are achieved.
Patent Information
- Application Number
- CN202111586633.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-21
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2041-12-21
AI Technical Summary
The existing artificial intelligence-assisted diagnostic systems have problems of slow execution speed and poor accuracy in the segmentation of medical image pneumonia.
A medical image pneumonia area segmentation intelligent diagnostic system is adopted, which includes a pretreatment module, a pneumonia area segmentation module, etc. The pneumonia area segmentation module uses a pre-trained neural network model to improve segmentation accuracy and speed by building a ShufflenetV2-Unet network model, combining data enhancement and loss function optimization.
It has achieved the significant improvement in the execution speed of the model while ensuring accuracy, and the accuracy and accuracy of pneumonia area segmentation are improved.
Smart Images

Figure CN114387283B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image segmentation, and in particular relates to an intelligent diagnosis system for medical image pneumonia area segmentation. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] The traditional film reading process generally uses medical workers to read the film manually, which is prone to errors and missed detection. The artificial intelligence-assisted diagnosis system is used to assist the traditional film reading. The reading time and detection rate of the artificial intelligence-assisted diagnosis system are higher than those of manual reading; at the same time, the false positive rate and sensitivity are also higher than those of manual reading. The comprehensive performance is significantly higher than that of manual reading, and the reading time is shorter, which is worthy of promotion and application. However, some existing artificial intelligence-assisted diagnosis systems have problems such as slow execution speed and poor accuracy. Summary of the invention
[0004] In order to solve the above problems, the present invention proposes an intelligent diagnosis system for pneumonia area segmentation in medical images, which can improve the execution speed and improve the segmentation precision and accuracy.
[0005] According to some embodiments, the present invention adopts the following technical solutions:
[0006] An intelligent diagnosis system for pneumonia region segmentation in medical images, comprising:
[0007] A preprocessing module, configured to perform format conversion on the medical image;
[0008] The pneumonia area segmentation module is configured to process the preprocessed image using a pretrained neural network model to obtain a pneumonia area segmentation result;
[0009] The pneumonia area segmentation module includes:
[0010] A neural network model building module, configured to build a preliminary neural network model;
[0011] A decoding module is configured to treat the background in the preprocessed medical image as a sample as a positive sample and the pneumonia infection area as a negative sample, and input them as a target attribute mask into the constructed neural network model for decoding operation;
[0012] An inversion module, configured to perform an inversion operation on the mask corresponding to the image;
[0013] The optimization module is configured to construct a loss function and use the loss function to optimize the parameters of the neural network model until the prediction result meets the requirements, and the neural network model at this time is regarded as a pre-trained neural network model;
[0014] The restoration module is configured to restore the mask of the prediction result and determine the pneumonia area segmentation result.
[0015] As an optional implementation, the preprocessing module is configured to convert the medical image format into PNG format.
[0016] As an optional embodiment, the pneumonia area segmentation module also includes a data enhancement module configured to perform a data enhancement operation including at least one of flipping, rotating, translating and cropping on the preprocessed hospital image.
[0017] As an optional implementation, the neural network model is a ShufflenetV2_Unet network model, including a shufflenetV2 network and a Unet network connected in sequence.
[0018] As a further feature, the decoding module is configured to first perform a decoding operation using the shufflenetV2 network, and then perform a decoding operation using the Unet network after performing a convolution operation.
[0019] As an optional implementation, the inversion module is configured to set the mask 0 corresponding to the image to 1, and 1 to 0.
[0020] As an optional implementation, the loss function is the sum of a similarity loss function and a cross entropy loss function. The similarity loss function controls the segmentation accuracy of the model from the IOU direction, and the cross entropy loss ensures the classification accuracy of the model from the pixel level.
[0021] An electronic device includes a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the following steps are completed:
[0022] Format conversion and preprocessing of medical images;
[0023] The pre-processed image is processed using a pre-trained neural network model to obtain the pneumonia area segmentation result;
[0024] The training process of the neural network model includes:
[0025] Build a preliminary neural network model;
[0026] The background of the preprocessed medical image as a sample is taken as a positive sample, and the pneumonia infection area is taken as a negative sample, which are input into the constructed neural network model for decoding operation;
[0027] Invert the mask corresponding to the image;
[0028] Construct a loss function and use the loss function to optimize the parameters of the neural network model until the prediction results meet the requirements. The neural network model at this time is regarded as a pre-trained neural network model.
[0029] The mask of the predicted result is restored to determine the pneumonia area segmentation result.
[0030] A computer-readable storage medium for storing computer instructions, wherein when the computer instructions are executed by a processor, the following steps are performed:
[0031] Format conversion and preprocessing of medical images;
[0032] The pre-processed image is processed using a pre-trained neural network model to obtain the pneumonia area segmentation result;
[0033] The training process of the neural network model includes:
[0034] Build a preliminary neural network model;
[0035] The background of the preprocessed medical image as a sample is taken as a positive sample, and the pneumonia infection area is taken as a negative sample, which are input into the constructed neural network model for decoding operation;
[0036] Invert the mask corresponding to the image;
[0037] Construct a loss function and use the loss function to optimize the parameters of the neural network model until the prediction results meet the requirements. The neural network model at this time is regarded as a pre-trained neural network model.
[0038] The mask of the predicted result is restored to determine the pneumonia area segmentation result.
[0039] Compared with the prior art, the present invention has the following beneficial effects:
[0040] The present invention uses ShufflenetV2 as the feature extraction layer to maximize the model execution speed while ensuring accuracy;
[0041] The present invention uses the background as a positive sample for prediction, which can obtain a higher dice;
[0042] The present invention takes the sum of cross entropy loss and similarity loss as the final loss function, controls the model optimization direction from both global and local perspectives, and helps to quickly carry out the model optimization process.
[0043] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0045] Figure 1 is a schematic diagram of the process of this embodiment;
[0046] Figure 2 Schematic diagram of the network model of this embodiment. DETAILED DESCRIPTION
[0047] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0048] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0049] Embodiment 1:
[0050] A medical image pneumonia region segmentation intelligent diagnosis method, comprising the following steps:
[0051] like Figure 1 As shown, the model is trained first.
[0052] Step (1): First, use a number of existing diagnostic medical images as training data, set the window value to the lung window, so that the lung area in the image is highlighted, and convert the medical image image into PNG format;
[0053] Step (2): Perform data augmentation operations such as flipping, rotating, translating and / or cropping on the existing training data, i.e., the medical images used for training. During training, the cropped images are adjusted without distortion and padded to a fixed size.
[0054] The significance of this step is that it can further enhance the robustness of the later model while expanding the amount of data.
[0055] Step (3): Construct the shufflenetV2-Unet network, such as Figure 2 shown.
[0056] This embodiment uses shufflenetV2_1.0 in the encoding stage. This embodiment directly calls and trains the model, improves it, deletes the last classification layer, and the decoding process is the same as the ordinary Unet decoding process. The only difference is that its target attribute label is changed.
[0057] In this embodiment, shufflenetV2 is used, which has a higher execution speed and does not reduce the accuracy.
[0058] The training sample images after data enhancement are sent to the shufflenetV2 network for encoding. The images are only processed by Stage 4 and the previous feature layers. The image size after Stage 4 is 16×16 and the number of layers is 704.
[0059] In this embodiment, the specific structure of the shufflenetV2 network is shown in Table 1:
[0060]
[0061]
[0062] Step (4): After step (3), a convolution operation is performed without changing the size of the feature map, and then the decoding stage of the Unet network is performed;
[0063] During the decoding operations in step (3) and step (4), the background is treated as a positive sample and the pneumonia infected area is treated as a negative sample for decoding operations.
[0064] Strictly speaking, the last convolution layer of all image segmentation is a classification mapping process. The existing technology usually uses the attention mechanism to increase the weight of the key area to be predicted, or directly manually sets the weight parameters. This method is complicated and cannot guarantee the accuracy of the prediction results. However, this embodiment predicts the background instead, and then performs an inversion operation, which simplifies the whole process and can improve the effect.
[0065] Because the last step of the decoding operation is to map the infected area and the normal area to different feature maps, which is equivalent to a binary classification problem, and the infected area is usually small in size, directly predicting the pneumonia area as a positive sample will lead to poor prediction results due to the imbalance of positive and negative samples in the data; predicting the background area as a positive sample can make the prediction result biased towards the side with more samples, thereby alleviating the problem of data imbalance. After experimental comparison, the final dice is about 3% higher than the result of directly treating the pneumonia area as a positive sample.
[0066] Step (5): Invert the mask corresponding to the medical image image (set 0 to 1, and 1 to 0).
[0067] The purpose of this step is to predict the uninfected normal area. Since the pneumonia area is small, direct prediction is not effective. After predicting the normal area, in some embodiments, a subtraction recovery operation is performed.
[0068] Step (6): Construct the loss function and start training;
[0069] The loss functions of this embodiment include two:
[0070] 1. Dice coefficient and Dice Loss
[0071] The Dice coefficient is a set similarity measurement function, usually used to calculate the similarity between two samples, with a value range of [0,1]:
[0072]
[0073] Where |X∩Y| is the intersection of X and Y, |X| and |Y| represent the number of elements of X and Y respectively. The coefficient of the numerator is 2 because the denominator repeats the calculation of common elements between X and Y, and 1 is added to prevent the denominator from being 0.
[0074] Dice Loss:
[0075] 2. Cross Entropy Loss:
[0076] L n =-(y n *log(z n )+(1-y n )*log(1-z n ))
[0077] where z n is the probability that the model predicts that the sample is a positive example, y n is the sample label. If the sample is a positive example, the value is 1, otherwise the value is 0.
[0078] The final loss function of this embodiment is:
[0079] Loss = L d +L n
[0080] Dice Loss controls the segmentation accuracy from the macro perspective of IOU, and cross entropy loss ensures classification accuracy at the pixel level.
[0081] Step (7): Train until the loss function of the model meets the set requirements, and use the shufflenetV2-Unet network model at this time as the final network model.
[0082] The newly acquired medical images that need to be diagnosed are preprocessed and segmented and recognized using the final network model.
[0083] During prediction, the mask is restored to obtain the final pneumonia area dice.
[0084] Embodiment 2:
[0085] An intelligent diagnosis system for pneumonia region segmentation in medical images, comprising:
[0086] A preprocessing module, configured to perform format conversion on the medical image;
[0087] The pneumonia area segmentation module is configured to process the preprocessed image using a pretrained neural network model to obtain a pneumonia area segmentation result;
[0088] The pneumonia area segmentation module includes:
[0089] A neural network model building module, configured to build a preliminary neural network model;
[0090] A decoding module is configured to treat the background in the preprocessed medical image as a sample as a positive sample and the pneumonia infection area as a negative sample, and input them into the constructed neural network model for decoding operation;
[0091] An inversion module, configured to perform an inversion operation on the mask corresponding to the image;
[0092] The optimization module is configured to construct a loss function and use the loss function to optimize the parameters of the neural network model until the prediction result meets the requirements, and the neural network model at this time is regarded as a pre-trained neural network model;
[0093] The restoration module is configured to restore the mask of the prediction result and determine the pneumonia area segmentation result.
[0094] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. An intelligent diagnosis system for pneumonia region segmentation in medical images, characterized by: include: A preprocessing module, configured to perform format conversion on the medical image; The pneumonia area segmentation module is configured to process the preprocessed image using a pretrained neural network model to obtain a pneumonia area segmentation result; The pneumonia area segmentation module includes: A neural network model building module, configured to build a preliminary neural network model; A decoding module is configured to treat the background in the preprocessed medical image as a sample as a positive sample and the pneumonia infection area as a negative sample, and input them into the constructed neural network model for decoding operation; An inversion module, configured to perform an inversion operation on the mask corresponding to the image; The optimization module is configured to construct a loss function and use the loss function to optimize the parameters of the neural network model until the prediction result meets the requirements, and the neural network model at this time is regarded as a pre-trained neural network model; A restoration module is configured to restore the mask of the prediction result to determine the pneumonia area segmentation result; The inversion module is configured to set the mask 0 corresponding to the image to 1, and 1 to 0; The loss function is the sum of the similarity loss function and the cross entropy loss function; The similarity loss function controls the segmentation accuracy of the model from the IOU direction, and the cross entropy loss ensures the classification accuracy of the model from the pixel level; The loss function includes two: (1) Dice coefficient and Dice loss The Dice coefficient is a set similarity measurement function used to calculate the similarity between two samples, with a value range of [0,1]: Where |X∩Y| is the intersection of X and Y, |X| and |Y| represent the number of elements of X and Y respectively. The coefficient of the numerator is 2 because the denominator repeats the calculation of the common elements between X and Y. Adding 1 prevents the denominator from being 0. Dice Loss: =1 ; (2) Cross entropy loss: =-( ) )) in is the probability that the model predicts that the sample is a positive example, is the sample label. If the sample is a positive example, the value is 1, otherwise the value is 0; The final loss function: Dice Loss controls the segmentation accuracy from the macro perspective of IOU, and cross entropy loss ensures classification accuracy at the pixel level.
2. The medical image pneumonia region segmentation intelligent diagnosis system according to claim 1, characterized in that: The preprocessing module is configured to convert the medical image format into PNG format.
3. The medical image pneumonia region segmentation intelligent diagnosis system according to claim 1, characterized in that: The pneumonia area segmentation module also includes a data enhancement module, which is configured to perform a data enhancement operation including at least one of flipping, rotating, translating and cropping on the preprocessed hospital image.
4. The medical image pneumonia region segmentation intelligent diagnosis system according to claim 1, characterized in that: The neural network model is a ShufflenetV2_Unet network model, including a shufflenetV2 network and a Unet network connected in sequence.
5. The medical image pneumonia region segmentation intelligent diagnosis system according to claim 4, characterized in that: The decoding module is configured to first perform a decoding operation using the shufflenetV2 network, and then perform a decoding operation using the Unet network after performing a convolution operation.
6. An electronic device, characterized in that: The method comprises a memory and a processor and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the medical image pneumonia region segmentation intelligent diagnosis system according to any one of claims 1 to 5 is executed to complete the following steps: Format conversion and preprocessing of medical images; The pre-processed image is processed using a pre-trained neural network model to obtain the pneumonia area segmentation result; The training process of the neural network model includes: Build a preliminary neural network model; The background of the preprocessed medical image as a sample is taken as a positive sample, and the pneumonia infection area is taken as a negative sample, which are input into the constructed neural network model for decoding operation; Invert the mask corresponding to the image; Construct a loss function and use the loss function to optimize the parameters of the neural network model until the prediction results meet the requirements. The neural network model at this time is regarded as a pre-trained neural network model. The mask of the predicted result is restored to determine the pneumonia area segmentation result.
7. A computer-readable storage medium, characterized in that: Used to store computer instructions, when the computer instructions are executed by the processor, the medical image pneumonia area segmentation intelligent diagnosis system according to any one of claims 1 to 5 is executed to complete the following steps: Format conversion and preprocessing of medical images; The pre-processed image is processed using a pre-trained neural network model to obtain the pneumonia area segmentation result; The training process of the neural network model includes: Build a preliminary neural network model; The background of the preprocessed medical image as a sample is taken as a positive sample, and the pneumonia infection area is taken as a negative sample, which are input into the constructed neural network model for decoding operation; Invert the mask corresponding to the image; Construct a loss function and use the loss function to optimize the parameters of the neural network model until the prediction results meet the requirements. The neural network model at this time is regarded as a pre-trained neural network model. The mask of the predicted result is restored to determine the pneumonia area segmentation result.
Citation Information
Patent Citations
Semi-supervised industrial image defect segmentation method based on adversarial generative network
CN110880176A
Image processing method and device, electronic equipment and storage medium
CN113223023A
Method for extracting blind fault according to Bouguer gravity anomaly image
CN113421194A