Image detection methods, apparatus, computer equipment and storage media
By combining a first classification model and a detection model to segment and classify medical images, and using a second classification model to remove false positives, the false positive problem in existing lung nodule detection algorithms is solved, improving detection accuracy and reliability.
Patent Information
- Application Number
- CN202210199037.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-01
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2042-03-01
AI Technical Summary
Existing lung nodule detection algorithms are prone to false positives, leading to identification errors and affecting detection accuracy.
A method combining the results of the first classification and the detection results is adopted. Medical images are segmented and classified using the first classification model and the detection model, and the second classification model is used to remove false positives, thereby improving the detection accuracy.
By integrating classification and detection results, false positives are effectively removed, the accuracy of target detection results is improved, the waste of computing resources is reduced, and the reliability of detection results is guaranteed.
Smart Images

Figure CN114612710B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to an image detection method, apparatus, computer device, and storage medium. Background Technology
[0002] With the development of modern medical technology, artificial intelligence is being used more and more in medicine.
[0003] Existing technology proposes a lung nodule detection algorithm, which includes identifying suspected nodules in lung images and classifying each nodule to achieve the goal of accurately identifying all nodules in lung images.
[0004] However, this detection algorithm only judges and identifies each nodule from the nodule level of lung images, which is prone to identification errors, leading to false positives for real nodules. Summary of the Invention
[0005] Therefore, it is necessary to provide an image detection method, apparatus, computer equipment, and storage medium that can improve accuracy in addressing the aforementioned technical problems.
[0006] In a first aspect, this application provides an image detection method, the method comprising:
[0007] The medical image to be processed is input into a preset first classification model to obtain the first classification result of the medical image; the first classification result is used to indicate whether there is a first lesion in the medical image.
[0008] The medical image is input into a preset detection model to obtain the detection result of the medical image; the detection result is used to indicate whether there is a second lesion in the medical image;
[0009] The target detection results of the medical image are determined based on the first classification results and the detection results.
[0010] In one embodiment, the first classification model includes a first region classification model and a second region classification model. The medical image to be processed is input into the preset first classification model to obtain a first classification result of the medical image, including:
[0011] Image segmentation is performed on a medical image to obtain a first image corresponding to a first region in the medical image and a second image corresponding to a second region in the medical image;
[0012] The first image is input into the first region classification model to obtain the first classification result corresponding to the first image output by the first region classification model.
[0013] The second image is input into the second region classification model to obtain the first classification result corresponding to the second image output by the second region classification model.
[0014] Correspondingly, the medical image is input into a preset detection model to obtain the detection results of the medical image, including:
[0015] The medical image is input into a preset detection model to obtain the detection result of the medical image. Based on the detection result, the detection result corresponding to the first image and the detection result corresponding to the second image are determined.
[0016] In one embodiment, determining the target detection result of the medical image based on the first classification result and the detection result includes:
[0017] If the first classification result indicates that there is no first lesion in the medical image, then the detection result is taken as the target detection result.
[0018] In one embodiment, determining the target detection result of the medical image based on the first classification result and the detection result includes:
[0019] If the first classification result indicates that the first lesion exists in both the first and second regions of the medical image, the detection result is input into the preset second classification model to obtain the second classification result output by the second classification model.
[0020] The target detection result is determined based on the second classification result.
[0021] In one embodiment, determining the target detection result of the medical image based on the first classification result and the detection result includes:
[0022] If the first classification result indicates that a first lesion exists in the first or second region of the medical image, the detection result of the medical image is input into the preset second classification model to obtain the second classification result output by the second classification model.
[0023] The target detection result is determined based on the second classification result and the detection result.
[0024] In one embodiment, determining the target detection result based on the second classification result and the detection result includes:
[0025] If the first classification result indicates that the first lesion exists in the first region and the first lesion does not exist in the second region, then the detection result corresponding to the first image is input into the second classification model to obtain the second classification result output by the second classification model.
[0026] The target detection result is determined based on the second classification result and the detection result corresponding to the second image.
[0027] In one embodiment, determining the target detection result based on the second classification result and the detection result includes:
[0028] If the first classification result indicates that the first lesion exists in the second region, and the first lesion does not exist in the first region, then the detection result corresponding to the second image is input into the second classification model to obtain the second classification result output by the second classification model.
[0029] The target detection result is determined based on the second classification result and the detection result corresponding to the first image.
[0030] Secondly, this application also provides an image detection apparatus, which includes:
[0031] The classification module is used to input the medical image to be processed into a preset first classification model to obtain the first classification result of the medical image; the first classification result is used to indicate whether there is a first lesion in the medical image.
[0032] The detection module is used to input medical images into a preset detection model and obtain detection results for the medical images; the detection results are used to indicate whether there is a second lesion in the medical images.
[0033] The determination module is used to determine the target detection result of the medical image based on the first classification result and the detection result.
[0034] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0035] The medical image to be processed is input into a preset first classification model to obtain the first classification result of the medical image; the first classification result is used to indicate whether there is a first lesion in the medical image.
[0036] The medical image is input into a preset detection model to obtain the detection result of the medical image; the detection result is used to indicate whether there is a second lesion in the medical image;
[0037] The target detection results of the medical image are determined based on the first classification results and the detection results.
[0038] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0039] The medical image to be processed is input into a preset first classification model to obtain the first classification result of the medical image; the first classification result is used to indicate whether there is a first lesion in the medical image.
[0040] The medical image is input into a preset detection model to obtain the detection result of the medical image; the detection result is used to indicate whether there is a second lesion in the medical image;
[0041] The target detection results of the medical image are determined based on the first classification results and the detection results.
[0042] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0043] The medical image to be processed is input into a preset first classification model to obtain the first classification result of the medical image; the first classification result is used to indicate whether there is a first lesion in the medical image.
[0044] The medical image is input into a preset detection model to obtain the detection result of the medical image; the detection result is used to indicate whether there is a second lesion in the medical image;
[0045] The target detection results of the medical image are determined based on the first classification results and the detection results.
[0046] The aforementioned image detection method, apparatus, computer equipment, and storage medium input a medical image to be processed into a preset first classification model to obtain a first classification result of the medical image; the first classification result is used to indicate whether a first lesion exists in the medical image; the medical image is then input into a preset detection model to obtain a detection result of the medical image; the detection result is used to indicate whether a second lesion exists in the medical image; and a target detection result of the medical image is determined based on the first classification result and the detection result. This application simultaneously detects multiple lesions when determining the target detection result, thereby filtering out lesions that may affect the target detection result and improving the accuracy of the target detection result. Attached Figure Description
[0047] Figure 1 This is a flowchart illustrating an image detection method in one embodiment;
[0048] Figure 2 This is a flowchart illustrating the image detection method in another embodiment;
[0049] Figure 3 This is a flowchart illustrating a method for a terminal to determine the target detection result of a medical image based on a first classification result and a detection result, as shown in one embodiment.
[0050] Figure 4 Here is a flowchart of a false positive removal algorithm in one embodiment;
[0051] Figure 5 A schematic diagram illustrating false positives for lung nodules;
[0052] Figure 6 A schematic diagram showing the extraction of samples from the left and right lungs;
[0053] Figure 7 This is a schematic diagram illustrating the application of the pneumonia classification model;
[0054] Figure 8 A schematic diagram of lung nodule extraction;
[0055] Figure 9 This is a structural block diagram of an image detection device in one embodiment;
[0056] Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0058] In existing technologies, image processing-based lesion detection algorithms generally detect lesions based on the features of the lesions to be identified. However, existing lesion detection algorithms often produce a large number of false positives. For example, lung nodule detection algorithms are highly sensitive to inflammatory data, especially tuberculosis, emphysema, and other types of pneumonia, leading to a large number of false positives. This is because different types of lesions in the same location are correlated, so detecting one type of lesion is easily affected by other types, resulting in false positives. A large number of false positives can be confusing for users.
[0059] This application proposes an image detection method that combines a first classification result and a detection result to determine a target detection result. The first classification result indicates whether a first lesion exists in the medical image, and the detection result indicates whether a second lesion exists in the medical image. When determining the target detection result, this application removes false positives of the first lesion that may affect the detection of the second lesion, thereby improving the accuracy of the target detection result.
[0060] In one embodiment, such as Figure 1 As shown, an image detection method is provided. This embodiment illustrates the method applied to a terminal. It is understood that this method can also be applied to a server, and further to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0061] Step 101: Input the medical image to be processed into the preset first classification model to obtain the first classification result of the medical image.
[0062] The medical images to be processed can be, for example, CT scan images or images acquired through other means. These medical images can include, for example, images of the lungs, brain, liver, uterus and its appendages, etc., without limitation.
[0063] The preset first classification model can be a pre-trained neural network model, machine learning model, etc. This first classification model is used to classify the presence of a first lesion in a medical image. The first classification result indicates whether a first lesion exists in the medical image.
[0064] Optionally, the training process for the first classification model includes the following:
[0065] Images containing the first lesion are collected as positive classification samples, and images not containing the first lesion are collected as negative classification samples. The initial network model for the first classification model is 3D ResidualNet, using Focal Loss as the loss function. The positive and negative classification samples are input into the initial network model for training, resulting in the final first classification model.
[0066] Optionally, the first lesion is the lesion that affects the detection of the second lesion. The first lesion can be of various types and in various ways. Taking the lungs as an example, the first lesion can be, for example, pneumonia, emphysema, pneumothorax, etc.
[0067] Optionally, when the primary lesion comprises multiple lesions, a corresponding primary classification model can be set for each lesion. Alternatively, the same primary classification model can be used to classify the multiple lesions.
[0068] Step 102: Input the medical image into the preset detection model to obtain the detection result of the medical image.
[0069] The detection results are used to indicate whether a second lesion exists in the medical image.
[0070] In this embodiment of the application, the detection model is used to detect whether there is a second lesion in the medical image. The second lesion is the lesion that needs to be detected in this application. The first lesion and the second lesion correspond to the same organ.
[0071] Optionally, the training process for the detection model includes the following:
[0072] Images containing the second lesion were collected as training samples. The initial network model for the detection model was selected as 3DFPN (Feature Pyramid Network). The training samples were input into the initial network model for training to obtain the final detection model.
[0073] Step 103: Determine the target detection result of the medical image based on the first classification result and the detection result.
[0074] In this embodiment, the first classification result and the detection result can be fused to obtain the target detection result. The method for fusing the first classification result and the detection result can be: removing false positives from the detection result based on the first classification result.
[0075] In this application's technical solution, the first classification model is used to classify the presence of a first lesion in a medical image. Therefore, factors that may adversely affect the detection of a second lesion can be screened based on the first classification result. By fusing the first classification result and the detection result, it can be determined whether the detection result is adversely affected. Furthermore, by fusing the first classification result and the detection result, factors that adversely affect the detection of the second lesion can be removed, thereby improving the accuracy of the target detection result.
[0076] Based on the above embodiments, the first classification model includes a first region classification model and a second region classification model. This application also provides another image detection method, such as... Figure 2 As shown:
[0077] Step 201: Perform image segmentation on the medical image to obtain a first image corresponding to a first region in the medical image and a second image corresponding to a second region in the medical image. Process the first image and the second image respectively to obtain a first classification result corresponding to the first image and a first classification result corresponding to the second image.
[0078] In this embodiment of the application, when the medical image is a lung image, the first region is the region where the left lung is located, the first image is the left lung image, the second region is the region where the right lung is located, and the second image is the right lung image.
[0079] When a medical image is a brain image, the first region is the area where the left brain is located, and the first image is an image of the left brain. The second region is the area where the right brain is located, and the second image is an image of the right brain.
[0080] When the medical image is an abdominal image, the first region can be, for example, the region where the spleen is located, and the first image is the image corresponding to the spleen. The second region is the region where the liver is located, and the second image is the image corresponding to the liver.
[0081] It should be noted that the first and second regions in medical images can be manually designated based on the user's actual needs, and are not limited to the examples described above.
[0082] The process of processing the first image and the second image respectively to obtain the first classification result corresponding to the first image and the first classification result corresponding to the second image includes the following:
[0083] The first image is input into the first region classification model to obtain the first classification result corresponding to the first image output by the first region classification model; the second image is input into the second region classification model to obtain the first classification result corresponding to the second image output by the second region classification model.
[0084] The first region classification model is trained based on sample images corresponding to the first region, and the second region classification model is trained based on sample images corresponding to the second region. This application does not limit the training process of the first and second region classification models.
[0085] Optionally, the first region classification model and the second region classification model can be the same model or two different models. When they are the same model, the number of models is reduced, which saves GPU memory and reduces model loading time.
[0086] In one alternative implementation, before inputting the medical image into the first classification model, the medical image is segmented by the image segmentation model to obtain a first image and a second image. Then, the first image and the second image are respectively input into the first classification model for classification to obtain the first classification result corresponding to the first image and the first classification result corresponding to the second image.
[0087] Step 202: Input the medical image into the preset detection model to obtain the detection result of the medical image, and determine the detection result corresponding to the first image and the detection result corresponding to the second image based on the detection result.
[0088] In this embodiment of the application, after the detection model detects the medical image, it can output the detection result. Then, the medical image can be segmented by the image segmentation model to obtain the segmentation results of the first image and the second image. The detection model determines the detection result corresponding to the first image by comparing the segmentation result and the detection result of the first image, and obtains the detection result corresponding to the second image by comparing the segmentation result and the detection result of the second image.
[0089] The detection result corresponding to the first image is used to indicate whether there is a second lesion in the first image, and the detection result corresponding to the second image is used to indicate whether there is a second lesion in the second image.
[0090] Step 203: Determine the target detection result of the medical image based on the first classification result and the detection result.
[0091] In this embodiment, the first classification result includes the first classification result corresponding to the first image and the first classification result corresponding to the second image, and the detection result includes the detection result corresponding to the first image and the detection result corresponding to the second image. In this embodiment, the target detection result is determined based on the first classification result corresponding to the first image, the first classification result corresponding to the second image, the detection result corresponding to the first image, and the detection result corresponding to the second image.
[0092] In this embodiment of the application, by segmenting the medical image, a first image corresponding to a first region in the medical image and a second image corresponding to a second region in the medical image are obtained. Then, a first classification result corresponding to the first image, a detection result corresponding to the first image, and a first classification result corresponding to the second image and a detection result corresponding to the second image are obtained respectively. By subdividing the medical image, the information contained in the first classification result and the detection result is more specific and detailed, thereby improving the accuracy of the target detection result.
[0093] In one embodiment of this application, if the first classification result indicates that there is no first lesion in the medical image, the detection result is determined as the target detection result.
[0094] Optionally, the first classification result indicating the absence of a first lesion in the medical image means: the first classification result corresponding to the first image indicates the absence of a first lesion in the first image, and the first classification result corresponding to the second image indicates the absence of a first lesion in the second image. In this case, the detection result corresponding to the first image and the detection result corresponding to the second image are determined as the target detection result.
[0095] The following example uses medical images of the lungs, with the first region representing the left lung and the second region representing the right lung. The first lesion is pneumonia, and the second lesion is a pulmonary nodule.
[0096] If the first classification result indicates that there is no primary lesion in the medical image, meaning that there is no pneumonia in either the left or right lung, then the lung nodules in the left or right lungs in the detection results can be used as target detection results. This ensures that the algorithm only removes false positives for detection results indicating pneumonia infection. On the one hand, if there are no pneumonia lesions, false positive removal is not performed, saving computational resources. On the other hand, it avoids "falsely affecting" detection results without pneumonia, ensuring high accuracy.
[0097] Since the primary lesion is not present in the medical image, the detection results are not affected by the primary lesion. Therefore, the detection results can be considered reliable. In this case, the detection results are determined as the target detection results to ensure the accuracy of the detection results.
[0098] In one embodiment of this application, if the first classification result indicates that a first lesion exists in both the first region and the second region in the medical image, the detection result is input into a preset second classification model to obtain the second classification result output by the second classification model, and the target detection result is determined based on the second classification result.
[0099] The statement that the first classification result indicates the presence of a first lesion in both the first and second regions of the medical image can mean that the first classification result corresponding to the first image indicates the presence of a first lesion in the first image, and the first classification result corresponding to the second image indicates the presence of a first lesion in the second image.
[0100] The second classification model can be a false positive removal model. The second classification model can reclassify the input detection results. By classifying the attributes of the second lesion in the detection results through the second classification model, the attribute information of the second lesion can be determined. The attribute information of the second lesion can be used to indicate whether the second lesion is affected by the first lesion. Finally, the second classification result is determined by judging the attributes of each second lesion, and the target detection result is determined based on the second classification result.
[0101] Optionally, in this embodiment, if the first classification result indicates that both the first region and the second region in the medical image have a first lesion, the detection result is input into a preset second classification model to obtain the second classification result output by the second classification model. The detection result can be, for example, the detection result corresponding to the first image and the detection result corresponding to the second image. The target detection result is then determined based on the second classification result. Optionally, the second classification result can be directly determined as the target monitoring result.
[0102] The following explanation will still use medical images of the lungs, with the first region representing the left lung and the second region representing the right lung. The first lesion will be pneumonia, and the second lesion will be a pulmonary nodule.
[0103] If pneumonia lesions are present in both the left and right lungs, the detection results for the left and right lungs are input into the second classification model separately. The second classification model then determines the attribute of each nodule in the detection results, specifically whether each nodule is a pneumonia area. If it is a pneumonia area, it indicates that the detection result is a false positive due to the influence of pneumonia (the primary lesion). In this case, the nodule is classified as a false positive and removed, yielding the final target detection result. This ensures that the algorithm only removes false positives from detection results indicating pneumonia infection, without mistakenly affecting detection results without pneumonia infection, thus guaranteeing high accuracy.
[0104] Based on the above embodiments, such as Figure 3As shown, the method for determining the target detection result of a medical image based on the first classification result and the detection result further includes the following steps:
[0105] Step 301: If the first classification result indicates that a first lesion exists in the first or second region of the medical image, the detection result of the medical image is input into the preset second classification model to obtain the second classification result output by the second classification model.
[0106] Step 302: Determine the target detection result based on the second classification result and the detection result.
[0107] The second classification model can be a false positive removal model, which is used to reclassify the detection results of medical images.
[0108] In this embodiment of the application, the first classification result indicating the presence of a first lesion in a first or second region of a medical image may include the following situations:
[0109] The first type: The first classification result indicates that the first lesion exists in the first region, and the first lesion does not exist in the second region.
[0110] The second type: The first classification result indicates that the first lesion exists in the second region, and the first lesion does not exist in the first region.
[0111] In the first scenario, the presence of a first lesion in the first region and the absence of a first lesion in the second region indicates that the detection result of the first image corresponding to the first region will be adversely affected by the first lesion, thus necessitating false positive removal. However, the detection result of the second image corresponding to the second region will not be affected by the first lesion, therefore false positive removal is unnecessary. In this case, inputting the detection result of the medical image into the preset second classification model means inputting the detection result corresponding to the first image into the second classification model to obtain the second classification result output by the second classification model; and determining the target detection result based on the second classification result and the detection result corresponding to the second image.
[0112] The following explanation will still use medical images of the lungs, with the first region representing the left lung and the second region representing the right lung. The first lesion will be pneumonia, and the second lesion will be a pulmonary nodule.
[0113] If pneumonia is present in the left lung but not in the right lung, the detection result for the left lung needs to be input into the second classification model. The second classification model will then determine the attribute information of each nodule to identify whether it is a pneumonia area. If it is a pneumonia area, it indicates that the nodule is a false positive. The detection result for the right lung (the detection result corresponding to the second image) and the detection result for the left lung (excluding the nodules identified as false positives) will be used as the target detection result.
[0114] In the second scenario, the first lesion is present in the second region, but not in the first region. The detection result of the second image corresponding to the second region will be adversely affected by the first lesion, so it is necessary to remove false positives from the detection result. However, the detection result of the first image corresponding to the first region will not be affected by the first lesion, so there is no need to remove false positives. In this case, inputting the detection result of the medical image into the preset second classification model means inputting the detection result corresponding to the second image into the second classification model to obtain the second classification result output by the second classification model; and determining the target detection result based on the second classification result and the detection result corresponding to the first image.
[0115] In this embodiment of the application, when the first classification result indicates the presence of a first lesion in a first or second region of the medical image during detection, a second classification model is used to process the medical image for false positives, resulting in a second classification result. This second classification result represents the detection result for the extracted false positive nodules. Finally, the target detection result is determined based on the second classification result and the detection results corresponding to the regions where false positives do not need to be removed. This ensures that the target detection result is not affected by the first lesion and thus does not produce false positives, thereby improving the accuracy of the target detection result.
[0116] The following explanation will still use medical images of the lungs, with the first region representing the left lung and the second region representing the right lung. The first lesion will be pneumonia, and the second lesion will be a pulmonary nodule.
[0117] If pneumonia is present in the right lung but not in the left lung, the detection results for the right lung need to be input into the second classification model. The second classification model then determines the attribute of each nodule in the detection results, i.e., whether each nodule is a pneumonia area. If it is a pneumonia area, it means that the detection result is a false positive result caused by the pneumonia (first lesion). In this case, the nodule is judged as a false positive, and the nodule judged as a false positive is removed. The detection results corresponding to the left lung (the detection results corresponding to the first image) and the detection results corresponding to the right lung after removing the nodule judged as a false positive are used as the target detection results.
[0118] In this embodiment of the application, the target detection result is determined by combining the detection results of the left lung and the detection results of the right lung (which were identified as false positive nodules) after removing the detection results of the left lung. This ensures that the target detection result is not affected by the first lesion and thus does not produce false positives, thereby improving the accuracy of the target detection result.
[0119] The technical solution of this application will be described below with reference to specific embodiments, such as... Figure 4 As shown, a flowchart of a method for removing false positives is illustrated, which specifically includes the following steps:
[0120] Step 401: Acquire medical images.
[0121] Medical images can be chest CT images.
[0122] Step 402: Perform lung segmentation on the medical image to obtain a first image (left lung) and a second image (right lung).
[0123] Step 403: Input the medical image into the pneumonia classification model to obtain the pneumonia classification results, which include the classification results of pneumonia in the left lung and pneumonia in the right lung.
[0124] Step 404: Input the medical image into the lung nodule detection model to obtain the initial lung nodule detection result. Combine the initial lung nodule detection result with the first image corresponding to the left lung to obtain the initial left lung nodule detection result. Combine the initial lung nodule detection result with the second image corresponding to the right lung to obtain the initial right lung nodule detection result.
[0125] Step 405: Combine the pneumonia classification results and the lung nodule detection results to obtain the target detection results.
[0126] If there is no pneumonia in either lung, the lung nodule detection results in both lungs will be determined as the target detection results.
[0127] If pneumonia is only present in the right lung, the initial right lung nodule detection results are input into the false positive removal model to determine the attributes of each nodule. These attributes indicate whether the nodule is a pneumonia region. If it is a pneumonia region, the nodule is determined to be a false positive, resulting in the false positive removal result. Figure 5 As shown, Figure 5 The area covered by the midline box represents false-positive nodules. The results of the right lung nodule detection (after removing false positives) and the initial left lung nodule detection are used as the target detection results.
[0128] If pneumonia is present only in the left lung, the initial left lung nodule detection result is input into the false positive removal model to determine the attributes of each nodule. The attributes can be used to indicate whether the nodule is a pneumonia area. If it is a pneumonia area, the nodule is determined to be a false positive, and the false positive removal result is obtained. The false positive removal left lung nodule detection result and the initial right lung nodule detection result are used as the target detection result.
[0129] If pneumonia is present in both lungs, the lung nodule detection results for both lungs must be input into a false positive removal model to determine the attributes of each nodule. The lung nodules identified as pneumonia areas are then removed to obtain the target detection result.
[0130] The algorithm provided in this application only removes false positives from lung test results for pneumonia infection, without "mistakenly" affecting test results for non-pneumonia infection, thus ensuring high accuracy.
[0131] The pneumonia classification model is explained below:
[0132] Images of infected and inflamed lungs were collected as positive samples for classification, and images of normal lungs were collected as negative samples for classification. A 3D ResidualNet (deep three-dimensional residual neural network) was used as the initial network model, and Focal Loss was used as the loss function to train the initial network model to obtain a pneumonia classification model.
[0133] The process of obtaining positive and negative classification samples includes the following:
[0134] Obtain a whole-lung image, perform image recognition on the whole-lung image, and obtain the three-dimensional bounding boxes of the left and right lungs, such as... Figure 6 The wireframe is shown in the image.
[0135] Then, the lung region is extracted based on the 3D bounding box of the lung. Specifically, the bounding box is expanded proportionally, for example, by a factor of 0.1 along the x, y, and z directions (ensuring the entire left or right lung region is included). The lung structure is then cropped and resampled to a fixed size, such as 96×96×96. Figure 6 As shown, Figure 6 A schematic diagram showing the extraction of samples from the left and right lungs is provided.
[0136] For the left and right lung samples, the cropped images of infected and inflamed lungs are used as positive classification samples, and the cropped images of normal lungs are used as negative classification samples. Optionally, this application can also perform data augmentation on the positive and negative classification samples by means of translation, scaling, rotation, inversion, etc., which can improve the generality of the trained pneumonia classification model.
[0137] Optionally, positive classification samples can be used on a single lung basis. Specifically, a cropped image of the infected and inflamed left lung can be used as a positive classification sample to train the left lung pneumonia classification model, and a cropped image of the infected and inflamed right lung can be used as a positive classification sample to train the right lung pneumonia classification model. Alternatively, samples cropped from both the left and right lungs can be used simultaneously to train both left and right lung pneumonia classification models.
[0138] like Figure 7 As shown, the medical image is segmented, and the bounding boxes of the left and right lungs are extracted based on the segmentation results. This results in a first image corresponding to the left lung and a second image corresponding to the right lung. The first and second images are then input into a trained pneumonia classification model to determine whether the left and right lungs are infected with pneumonia, and the determination result is obtained. The determination result can be represented by 0 or 1. Figure 7 The input image is the left and right lungs. The output 1 and 0 indicate that there is pneumonia in the left lung and no pneumonia in the right lung.
[0139] The following explains the false positive classification model:
[0140] The input to the false positive classification model is the nodule detection results. Training samples include positive and negative samples. Positive samples are those containing the first lesion, while negative samples are those not containing the first lesion. Inflammatory nodules are extracted as positive samples using the fixed-box method, and non-pneumonia nodules are used as negative samples. This data is then used to train the initial network model, resulting in the lung nodule false positive classification model. For example... Figure 8 As shown, when extracting the nodule region, the nodule region can be clipped outward by 2.5 times based on the nodule's bounding box.
[0141] In this embodiment, a pneumonia classification model is used to identify whether there is pneumonia (first lesion) in a medical image. Then, the lung nodule detection results are processed to remove false positives based on the pneumonia classification results, so that the nodules in the final target detection results do not contain inflammatory nodules caused by the first lesion, thereby improving the accuracy of the target detection results.
[0142] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0143] Based on the same inventive concept, this application also provides an image detection apparatus for implementing the image detection method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more image detection apparatus embodiments provided below can be found in the limitations of the image detection method described above, and will not be repeated here.
[0144] In one embodiment, such as Figure 9 As shown, an image detection device is provided, including: a classification module 901, a detection module 902, and a determination module 903, wherein:
[0145] The classification module 901 is used to input the medical image to be processed into a preset first classification model to obtain a first classification result of the medical image; the first classification result is used to indicate whether there is a first lesion in the medical image.
[0146] The detection module 902 is used to input medical images into a preset detection model to obtain detection results of the medical images; the detection results are used to indicate whether there is a second lesion in the medical images.
[0147] The determination module 903 is used to determine the target detection result of the medical image based on the first classification result and the detection result.
[0148] In one embodiment, the first classification model includes a first region classification model and a second region classification model, and the classification module 901 is specifically used for:
[0149] Image segmentation is performed on a medical image to obtain a first image corresponding to a first region in the medical image and a second image corresponding to a second region in the medical image;
[0150] The first image is input into the first region classification model to obtain the first classification result corresponding to the first image output by the first region classification model.
[0151] The second image is input into the second region classification model to obtain the first classification result corresponding to the second image output by the second region classification model.
[0152] Correspondingly, the medical image is input into a preset detection model to obtain the detection results of the medical image, including:
[0153] The medical image is input into a preset detection model to obtain the detection result of the medical image. Based on the detection result, the detection result corresponding to the first image and the detection result corresponding to the second image are determined.
[0154] In one embodiment, the classification module 901 is specifically used for:
[0155] If the first classification result indicates that there is no first lesion in the medical image, then the detection result is taken as the target detection result.
[0156] In one embodiment, the classification module 901 is specifically used for:
[0157] If the first classification result indicates that the first lesion exists in both the first and second regions of the medical image, the detection result is input into the preset second classification model to obtain the second classification result output by the second classification model.
[0158] The target detection result is determined based on the second classification result.
[0159] In one embodiment, the determining module 903 is specifically used for:
[0160] If the first classification result indicates that a first lesion exists in the first or second region of the medical image, the detection result of the medical image is input into the preset second classification model to obtain the second classification result output by the second classification model.
[0161] The target detection result is determined based on the second classification result and the detection result.
[0162] In one embodiment, the determining module 903 is specifically used for:
[0163] If the first classification result indicates that the first lesion exists in the first region and the first lesion does not exist in the second region, then the detection result corresponding to the first image is input into the second classification model to obtain the second classification result output by the second classification model.
[0164] The target detection result is determined based on the second classification result and the detection result corresponding to the second image.
[0165] In one embodiment, the determining module 903 is specifically used for:
[0166] If the first classification result indicates that the first lesion exists in the second region, and the first lesion does not exist in the first region, then the detection result corresponding to the second image is input into the second classification model to obtain the second classification result output by the second classification model.
[0167] The target detection result is determined based on the second classification result and the detection result corresponding to the first image.
[0168] Each module in the aforementioned image detection device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0169] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores trained data such as first-classification models, second-classification models, and image segmentation models. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements an image detection method.
[0170] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0171] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0172] The medical image to be processed is input into a preset first classification model to obtain the first classification result of the medical image; the first classification result is used to indicate whether there is a first lesion in the medical image.
[0173] The medical image is input into a preset detection model to obtain the detection result of the medical image; the detection result is used to indicate whether there is a second lesion in the medical image;
[0174] The target detection results of the medical image are determined based on the first classification results and the detection results.
[0175] In one embodiment, the first classification model includes a first region classification model and a second region classification model, and the processor, when executing the computer program, further implements the following steps:
[0176] Image segmentation is performed on a medical image to obtain a first image corresponding to a first region in the medical image and a second image corresponding to a second region in the medical image;
[0177] The first image is input into the first region classification model to obtain the first classification result corresponding to the first image output by the first region classification model.
[0178] The second image is input into the second region classification model to obtain the first classification result corresponding to the second image output by the second region classification model.
[0179] Correspondingly, the medical image is input into a preset detection model to obtain the detection results of the medical image, including:
[0180] The medical image is input into a preset detection model to obtain the detection result of the medical image. Based on the detection result, the detection result corresponding to the first image and the detection result corresponding to the second image are determined.
[0181] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0182] If the first classification result indicates that there is no first lesion in the medical image, then the detection result is taken as the target detection result.
[0183] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0184] If the first classification result indicates that the first lesion exists in both the first and second regions of the medical image, the detection result is input into the preset second classification model to obtain the second classification result output by the second classification model.
[0185] The target detection result is determined based on the second classification result.
[0186] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0187] If the first classification result indicates that a first lesion exists in the first or second region of the medical image, the detection result of the medical image is input into the preset second classification model to obtain the second classification result output by the second classification model.
[0188] The target detection result is determined based on the second classification result and the detection result.
[0189] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0190] If the first classification result indicates that the first lesion exists in the first region and the first lesion does not exist in the second region, then the detection result corresponding to the first image is input into the second classification model to obtain the second classification result output by the second classification model.
[0191] The target detection result is determined based on the second classification result and the detection result corresponding to the second image.
[0192] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0193] If the first classification result indicates that the first lesion exists in the second region, and the first lesion does not exist in the first region, then the detection result corresponding to the second image is input into the second classification model to obtain the second classification result output by the second classification model.
[0194] The target detection result is determined based on the second classification result and the detection result corresponding to the first image.
[0195] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0196] The medical image to be processed is input into a preset first classification model to obtain the first classification result of the medical image; the first classification result is used to indicate whether there is a first lesion in the medical image.
[0197] The medical image is input into a preset detection model to obtain the detection result of the medical image; the detection result is used to indicate whether there is a second lesion in the medical image;
[0198] The target detection results of the medical image are determined based on the first classification results and the detection results.
[0199] In one embodiment, the first classification model includes a first region classification model and a second region classification model, and the computer program, when executed by a processor, further implements the following steps:
[0200] Image segmentation is performed on a medical image to obtain a first image corresponding to a first region in the medical image and a second image corresponding to a second region in the medical image;
[0201] The first image is input into the first region classification model to obtain the first classification result corresponding to the first image output by the first region classification model.
[0202] The second image is input into the second region classification model to obtain the first classification result corresponding to the second image output by the second region classification model.
[0203] Correspondingly, the medical image is input into a preset detection model to obtain the detection results of the medical image, including:
[0204] The medical image is input into a preset detection model to obtain the detection result of the medical image. Based on the detection result, the detection result corresponding to the first image and the detection result corresponding to the second image are determined.
[0205] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0206] If the first classification result indicates that there is no first lesion in the medical image, then the detection result is taken as the target detection result.
[0207] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0208] If the first classification result indicates that the first lesion exists in both the first and second regions of the medical image, the detection result is input into the preset second classification model to obtain the second classification result output by the second classification model.
[0209] The target detection result is determined based on the second classification result.
[0210] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0211] If the first classification result indicates that a first lesion exists in the first or second region of the medical image, the detection result of the medical image is input into the preset second classification model to obtain the second classification result output by the second classification model.
[0212] The target detection result is determined based on the second classification result and the detection result.
[0213] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0214] If the first classification result indicates that the first lesion exists in the first region and the first lesion does not exist in the second region, then the detection result corresponding to the first image is input into the second classification model to obtain the second classification result output by the second classification model.
[0215] The target detection result is determined based on the second classification result and the detection result corresponding to the second image.
[0216] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0217] If the first classification result indicates that the first lesion exists in the second region, and the first lesion does not exist in the first region, then the detection result corresponding to the second image is input into the second classification model to obtain the second classification result output by the second classification model.
[0218] The target detection result is determined based on the second classification result and the detection result corresponding to the first image.
[0219] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0220] The medical image to be processed is input into a preset first classification model to obtain the first classification result of the medical image; the first classification result is used to indicate whether there is a first lesion in the medical image.
[0221] The medical image is input into a preset detection model to obtain the detection result of the medical image; the detection result is used to indicate whether there is a second lesion in the medical image;
[0222] The target detection results of the medical image are determined based on the first classification results and the detection results.
[0223] In one embodiment, the first classification model includes a first region classification model and a second region classification model, and the computer program, when executed by a processor, further implements the following steps:
[0224] Image segmentation is performed on a medical image to obtain a first image corresponding to a first region in the medical image and a second image corresponding to a second region in the medical image;
[0225] The first image is input into the first region classification model to obtain the first classification result corresponding to the first image output by the first region classification model.
[0226] The second image is input into the second region classification model to obtain the first classification result corresponding to the second image output by the second region classification model.
[0227] Correspondingly, the medical image is input into a preset detection model to obtain the detection results of the medical image, including:
[0228] The medical image is input into a preset detection model to obtain the detection result of the medical image. Based on the detection result, the detection result corresponding to the first image and the detection result corresponding to the second image are determined.
[0229] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0230] If the first classification result indicates that there is no first lesion in the medical image, then the detection result is taken as the target detection result.
[0231] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0232] If the first classification result indicates that the first lesion exists in both the first and second regions of the medical image, the detection result is input into the preset second classification model to obtain the second classification result output by the second classification model.
[0233] The target detection result is determined based on the second classification result.
[0234] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0235] If the first classification result indicates that a first lesion exists in the first or second region of the medical image, the detection result of the medical image is input into the preset second classification model to obtain the second classification result output by the second classification model.
[0236] The target detection result is determined based on the second classification result and the detection result.
[0237] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0238] If the first classification result indicates that the first lesion exists in the first region and the first lesion does not exist in the second region, then the detection result corresponding to the first image is input into the second classification model to obtain the second classification result output by the second classification model.
[0239] The target detection result is determined based on the second classification result and the detection result corresponding to the second image.
[0240] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0241] If the first classification result indicates that the first lesion exists in the second region, and the first lesion does not exist in the first region, then the detection result corresponding to the second image is input into the second classification model to obtain the second classification result output by the second classification model.
[0242] The target detection result is determined based on the second classification result and the detection result corresponding to the first image.
[0243] It should be noted that all medical images involved in this application are images authorized by the user or fully authorized by all parties.
[0244] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0245] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0246] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. An image detection method, characterized in that, The method includes: The medical image to be processed is input into a preset first classification model to obtain a first classification result of the medical image; the first classification result is used to indicate whether a first lesion exists in the medical image. The medical image is input into a preset detection model to obtain the detection result of the medical image; the detection result is used to indicate whether there is a second lesion in the medical image; the first lesion is the lesion that affects the detection of the second lesion, and the second lesion is the lesion to be detected in the medical image; If the first classification result indicates that the first lesion does not exist in the medical image, then the detection result is taken as the target detection result of the medical image; If the first classification result indicates that the first lesion exists in the medical image, the detection result is input into a preset second classification model to obtain the second classification result output by the second classification model, and the target detection result is determined based on the second classification result.
2. The method according to claim 1, characterized in that, The first classification model includes a first region classification model and a second region classification model. The step of inputting the medical image to be processed into the preset first classification model to obtain the first classification result of the medical image includes: The medical image is segmented to obtain a first image corresponding to a first region in the medical image and a second image corresponding to a second region in the medical image; The first image is input into the first region classification model to obtain the first classification result corresponding to the first image output by the first region classification model; The second image is input into the second region classification model to obtain the first classification result corresponding to the second image output by the second region classification model; Correspondingly, the medical image is input into a preset detection model to obtain the detection result of the medical image, including: The medical image is input into a preset detection model to obtain the detection result of the medical image, and the detection result corresponding to the first image and the detection result corresponding to the second image are determined based on the detection result.
3. The method according to claim 1, characterized in that, If the first classification result indicates the presence of the first lesion in the medical image, the detection result is input into a preset second classification model to obtain a second classification result output by the second classification model, including: If the first classification result indicates that the first lesion exists in both the first and second regions of the medical image, the detection result is input into a preset second classification model to obtain the second classification result output by the second classification model.
4. The method according to claim 2, characterized in that, If the first classification result indicates the presence of the first lesion in the medical image, the detection result is input into a preset second classification model to obtain a second classification result output by the second classification model, including: If the first classification result indicates that the first lesion exists in the first or second region of the medical image, the detection result of the medical image is input into the preset second classification model to obtain the second classification result output by the second classification model.
5. The method according to claim 4, characterized in that, Determining the target detection result based on the second classification result and the detection result includes: If the first classification result indicates that the first lesion exists in the first region and the first lesion does not exist in the second region, then the detection result corresponding to the first image is input into the second classification model to obtain the second classification result output by the second classification model; The target detection result is determined based on the second classification result and the detection result corresponding to the second image.
6. The method according to claim 4, characterized in that, Determining the target detection result based on the second classification result and the detection result includes: If the first classification result indicates that the first lesion exists in the second region, and the first lesion does not exist in the first region, then the detection result corresponding to the second image is input into the second classification model to obtain the second classification result output by the second classification model; The target detection result is determined based on the second classification result and the detection result corresponding to the first image.
7. The method according to claim 1, characterized in that, The second classification result is the attribute information of the second lesion, wherein the attribute information of the second lesion is used to indicate whether the second lesion is affected by the first lesion.
8. An image detection device, characterized in that, The device includes: The classification module is used to input the medical image to be processed into a preset first classification model to obtain a first classification result of the medical image; the first classification result is used to indicate whether a first lesion exists in the medical image. The detection module is used to input the medical image into a preset detection model to obtain the detection result of the medical image; the detection result is used to indicate whether there is a second lesion in the medical image; the first lesion is a lesion that affects the detection of the second lesion, and the second lesion is the lesion to be detected in the medical image; The determination module is used to take the detection result as the target detection result of the medical image if the first classification result indicates that the first lesion does not exist in the medical image; If the first classification result indicates that the first lesion exists in the medical image, the detection result is input into a preset second classification model to obtain the second classification result output by the second classification model, and the target detection result is determined based on the second classification result.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Image recognition method and device, electronic equipment and storage medium
CN113177928A