Medical Image Segmentation Method, Device, Equipment, Storage Medium and Program Product
Through the correction and confidence correction of the source domain and target domain segmentation models, the data dependence problem of the image segmentation model when adapting to different domains is solved, and the accuracy of the target domain image segmentation and the adaptive ability of model training are improved.
Patent Information
- Application Number
- CN202210486701.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-06
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2042-05-06
AI Technical Summary
The prior art cannot achieve effective domain adaptation in the absence of source domain data when the image segmentation model adapts from different domains, affecting the target domain image segmentation effect.
The sample medical images are segmented by the source domain and the target domain segmentation model, the first segmentation result is corrected using the second segmentation result, and the segmentation confidence of the target domain segmentation model is corrected, and the training of the target domain segmentation model is updated.
It realizes the accuracy of the image segmentation model to the target domain image data under passive unsupervised conditions, and enhances the confidence and adaptability of model training.
Smart Images

Figure CN115115829B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of artificial intelligence, and in particular, to a method, apparatus, device, storage medium, and program product for segmenting medical images. Background Art
[0002] Currently, image segmentation technology based on artificial intelligence can be applied to the medical field. For example, image segmentation is performed on fundus images to obtain the segmentation results of the optic cup and optic disc.
[0003] When performing image segmentation, a pre-trained image segmentation model can be used for training. When using the pre-trained image segmentation model for image segmentation, since the data used by the pre-trained image segmentation model and the image data to be segmented currently belong to different domains, such as different medical centers or from different imaging instruments, etc., it is necessary to further train the pre-trained image segmentation model to adapt it to the image data in the target domain. In related technologies, during domain adaptation, the source domain data used by the image segmentation model during pre-training is required to adapt the pre-trained image segmentation model to the target domain.
[0004] That is, in related technologies, domain adaptation depends on source domain data. In the case where the source domain data cannot be obtained, domain adaptation cannot be performed, which affects the effect of the image segmentation model on segmenting target domain images. Summary of the Invention
[0005] Embodiments of the present application provide a method, apparatus, device, storage medium, and program product for segmenting medical images, which can achieve source-free and unsupervised domain adaptation and improve the accuracy of image segmentation. The technical solutions are as follows:
[0006] On the one hand, embodiments of the present application provide a method for segmenting medical images, the method including:
[0007] Performing image segmentation on a sample medical image through a source domain segmentation model to obtain a first segmentation result, where the source domain segmentation model is trained based on medical image data in the source domain, the sample medical image is an unlabeled medical image in the target domain, and the data distribution of medical images in the target domain is different from that in the source domain;
[0008] Performing image segmentation on the sample medical image through a target domain segmentation model to obtain a second segmentation result;
[0009] Based on the second segmentation result and the segmentation confidence of the target domain segmentation model, correcting the pixel categories indicated by the first segmentation result to obtain a corrected segmentation result;
[0010] Updating and training the target domain segmentation model based on the second segmentation result and the corrected segmentation result.
[0011] On the other hand, an embodiment of the present application provides a medical image segmentation device, which includes:
[0012] An image segmentation module, configured to perform image segmentation on a sample medical image through a source domain segmentation model to obtain a first segmentation result. The source domain segmentation model is trained based on medical image data in the source domain. The sample medical image is an unlabeled medical image in the target domain, and the data distributions of medical images in the target domain and the source domain are different;
[0013] The image segmentation module is further configured to perform image segmentation on the sample medical image through a target domain segmentation model to obtain a second segmentation result;
[0014] A correction module, configured to correct the pixel categories indicated by the first segmentation result based on the second segmentation result and the segmentation confidence of the target domain segmentation model to obtain a corrected segmentation result;
[0015] A training module, configured to update and train the target domain segmentation model based on the second segmentation result and the corrected segmentation result.
[0016] On the other hand, an embodiment of the present application provides a computer device, which includes a processor and a memory. At least one instruction, at least one program, a code set or an instruction set is stored in the memory. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the medical image segmentation method as described in the above aspect.
[0017] On the other hand, a computer-readable storage medium is provided. At least one instruction, at least one program, a code set or an instruction set is stored in the readable storage medium. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the medical image segmentation method as described in the above aspect.
[0018] On the other hand, an embodiment of the present application provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the medical image segmentation method provided in the above aspect.
[0019] The beneficial effects brought by the technical solution provided by the embodiment of the present application at least include:
[0020] In the embodiments of the present application, when the sample medical images in the target domain are unlabeled, the computer device respectively performs segmentation on the sample medical images through the source domain segmentation model and the target domain segmentation model to obtain a first segmentation result and a second segmentation result. If there are differences between the second segmentation result and the first segmentation result, it indicates that there may be incorrect results in the first segmentation result. Therefore, the first segmentation result is corrected using the second segmentation result. At the same time, there may be a problem of inaccurate segmentation in the target domain segmentation model. Additionally, the first segmentation result needs to be corrected based on the segmentation confidence of the target domain segmentation model, thereby improving the confidence of the corrected first segmentation result, that is, the confidence of the segmentation result used for training, which is beneficial to improving the accuracy of model training.
[0021] Moreover, the target domain segmentation model is trained using the corrected segmentation result and the second segmentation result, enabling the trained target domain segmentation model to adapt to the image data of the target domain. It is possible to achieve unsupervised training of the target domain segmentation model without relying on the source domain data, that is, to achieve source-free unsupervised domain adaptation, thereby improving the accuracy of the target domain segmentation model in segmenting the image data of the target domain. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0023] Figure 1 FIG. shows a schematic diagram of the principle of the medical image segmentation method provided by the embodiments of the present application;
[0024] Figure 2 FIG. shows a schematic diagram of an application scenario provided by an exemplary embodiment of the present application;
[0025] Figure 3 FIG. shows a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application;
[0026] Figure 4 FIG. shows a flowchart of the medical image segmentation method provided by an exemplary embodiment of the present application;
[0027] Figure 5 FIG. shows a flowchart of the medical image segmentation method provided by another exemplary embodiment of the present application;
[0028] Figure 6 FIG. shows a flowchart of the medical image segmentation method provided by another exemplary embodiment of the present application;
[0029] Figure 7 It shows an implementation schematic diagram of the training process of the target domain segmentation model provided by an exemplary embodiment of the present application;
[0030] Figure 8 It is a schematic diagram showing the segmentation results of the target domain segmentation model trained under different technologies;
[0031] Figure 9 It is a structural block diagram of a medical image segmentation device provided by an exemplary embodiment of the present application;
[0032] Figure 10 It shows a structural schematic diagram of a computer device provided by an exemplary embodiment of the present application. Detailed implementation manners
[0033] To make the objectives, technical solutions, and advantages of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.
[0034] Artificial Intelligence (AI) is to use a digital computer or a machine controlled by a digital computer to simulate, extend, and expand human intelligence, a theory, method, technology, and application system that perceives the environment, acquires knowledge, and uses the knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science. It attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a way similar to human intelligence. Artificial intelligence also studies the design principles and implementation methods of various intelligent machines, enabling the machines to have the functions of perception, reasoning, and decision-making.
[0035] Artificial intelligence technology is an interdisciplinary subject, involving a wide range of fields, including both hardware-level technologies and software-level technologies. The basic technologies of artificial intelligence generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. The software technologies of artificial intelligence mainly include several major directions such as computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0036] Computer Vision (CV) technology is a science that studies how to enable machines to "see". More specifically, it refers to machine vision that uses cameras and computers to replace human eyes for target recognition and measurement, and further performs image processing to make the computer-processed images more suitable for human eye observation or transmission to instrument detection. As a scientific discipline, computer vision researches related theories and technologies, and attempts to establish artificial intelligence systems that can obtain information from images or multi-dimensional data. Computer vision technology usually includes technologies such as image processing, image recognition, image segmentation, image semantic understanding, image retrieval, video processing, video semantic understanding, video content / behavior recognition, 3D object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping, etc., and also includes common biometric recognition technologies such as face recognition and fingerprint recognition. The medical image segmentation method involved in the embodiments of this application is the application of computer vision technology in the field of image segmentation.
[0037] Schematically, as Figure 1 shown, first, the computer device uses the source domain segmentation model 102 to perform image segmentation on the sample medical image 101 to obtain the first segmentation result 103, and uses the target domain segmentation model 104 to perform image segmentation on the sample medical image 101 to obtain the second segmentation result 105. Then, the first segmentation result 103 is corrected using the second segmentation result 105 and the segmentation confidence 106 of the target domain segmentation model 104 to obtain the corrected segmentation result 107. Finally, the computer device uses the second segmentation result 105 and the corrected segmentation result 107 to update and train the target domain segmentation model 104 so that the target domain segmentation model is applicable to segmenting the image data of the target domain. By using the second segmentation result and the target domain segmentation model to correct the first segmentation result to obtain the corrected segmentation result, the confidence of the corrected segmentation result can be improved, and by using the corrected segmentation result and the second segmentation result to train the target domain segmentation model, an unsupervised self-training process is realized, so that the trained target domain segmentation model is applicable to the segmentation of target domain image data, thereby achieving domain adaptation and improving the accuracy of target domain image segmentation without relying on source domain data.
[0038] The medical image segmentation method provided by the embodiments of this application can be used in the training process of an image segmentation model that requires domain adaptation.
[0039] As Figure 2As shown, when applied to a medical scenario, the client and the supplier belong to different domains. For example, in different medical centers, the client can obtain the source domain segmentation model 202 trained by the supplier using the source domain image data 201, but cannot obtain the source domain image data. After that, the client can train the source domain segmentation model 202 (the initialized target domain segmentation model) to obtain the target domain segmentation model 203 after domain adaptation, and apply it to the segmentation of the unlabeled image data 204 in the target domain.
[0040] In addition to the above application scenarios, the medical image segmentation method provided in the embodiments of the present application can also be applied to other image segmentation scenarios that require domain adaptation. The embodiments of the present application do not limit the specific application scenarios.
[0041] Figure 3 FIG. shows a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application. The implementation environment includes a computer device 310 and a server 320. Among them, the computer device 310 and the server 320 perform data communication through a communication network. Optionally, the communication network can be a wired network or a wireless network, and the communication network can be at least one of a local area network, a metropolitan area network, and a wide area network.
[0042] The computer device 310 is an electronic device with an image segmentation requirement. The electronic device can be a smart phone, a tablet computer, a personal computer, etc. This embodiment does not limit this. Figure 3 In this example, the computer device 310 is a computer used by medical staff.
[0043] In some embodiments, an application program that supports the image segmentation function runs on the computer device 310. When it is necessary to segment a target image, the user inputs the target image into the application program, and the computer device 310 can upload the target image to the server 320, and the server 320 performs image segmentation and feeds back the segmentation result.
[0044] The server 320 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms.
[0045] In some embodiments, the server 320 is used to provide image segmentation services for the applications running in the computer device 310. The server 320 can be trained based on the source domain segmentation model and the sample medical images in the target domain to obtain the trained target domain segmentation model. In a possible implementation, after receiving the target image sent by the computer device 310, the server 320 uses the target domain segmentation model to perform image segmentation to obtain the target segmentation result, and returns the target segmentation result to the computer device 310 so that the computer device 310 can display the image segmentation result.
[0046] Of course, in other possible implementations, the target domain segmentation model can also be deployed on the computer device 310 side, and the computer device 310 can implement image segmentation locally without relying on the server 320. This embodiment does not limit this. And the target domain segmentation model can be trained on the server side or on the computer device side for the deployment of the target domain segmentation model. For the convenience of description, the following embodiments are described by taking the image segmentation method as being executed by the computer device as an example.
[0047] Please refer to Figure 4 , which shows a flowchart of a method for segmenting medical images provided by an exemplary embodiment of the present application. This embodiment is described by taking the method as being used in a computer device as an example. The method includes the following steps.
[0048] Step 401, perform image segmentation on the sample medical image through the source domain segmentation model to obtain a first segmentation result. The source domain segmentation model is trained based on the medical image data in the source domain. The sample medical image is an unlabeled medical image in the target domain, and the data distributions of the medical images in the target domain and the source domain are different.
[0049] Among them, the source domain is the provider of the initial image segmentation model in the target domain. Optionally, the source domain segmentation model is the initial image segmentation model in the target domain, which is an image segmentation model pre-trained using the image data in the source domain. The initial model parameters of the target domain segmentation model are the same as those of the source domain segmentation model. Among them, the source domain and the target domain are different domains, and the data distributions of the medical images in the source domain and the target domain are different. Due to the differences in images in different domains, the initialized target domain segmentation model cannot directly segment the image data in the target domain, and domain adaptation is required, that is, the initialized target domain segmentation model (source domain segmentation model) needs to be trained to adapt to the image data in the target domain, so as to perform image segmentation on the image data in the target domain. For example, for images from different medical centers, due to reasons such as device parameters and brands, the data distributions of the medical images generated are different. Therefore, when the second medical center (target domain) needs to use the source domain segmentation model provided by the first medical center (source domain), model adaptation is required.
[0050] In a possible scenario, during the training process of the target domain segmentation model, since the image data of the target domain has not been labeled or has too few labels to be used for training, and at the same time, the image data of the source domain cannot be obtained for domain adaptation, therefore, in the embodiments of the present application, the target domain segmentation model is trained through a source-free and unsupervised domain adaptation method.
[0051] In a possible implementation manner, the computer device first uses the source domain segmentation model to perform image segmentation on the sample medical image to obtain a first segmentation result. The first segmentation result refers to the marking result of the object to which each pixel in the sample medical image belongs, and has the same size as the sample medical image. Schematically, when the sample medical image is a fundus image and the segmentation objects are the optic cup and the optic disc, the first segmentation result may respectively include the segmentation results of the optic cup and the optic disc. The segmentation result of the optic cup is the result of marking the pixels belonging to the optic cup and the pixels not belonging to the optic cup in the fundus image differently.
[0052] Optionally, the model structure of the first segmentation model may be DeepLabv3+, U-Net, Dense Convolutional Network (DenseNet), Residual Network (ResNet), etc., and this embodiment does not limit this.
[0053] Step 402: Use the target domain segmentation model to perform image segmentation on the sample medical image to obtain a second segmentation result.
[0054] In a possible implementation manner, the computer device uses the classification result of the sample medical image indicated by the first segmentation result as a pseudo-label and performs self-training using the pseudo-label. Since the source domain segmentation model may not be adapted to the sample medical image belonging to the target domain, that is, its segmentation result for the sample medical image is not accurate, therefore, the first segmentation result needs to be corrected first.
[0055] During the correction process, the computer device uses the target domain segmentation model to perform image segmentation on the sample medical image to obtain a second segmentation result. The second segmentation result also includes the marking result of the object to which each pixel in the sample medical image belongs. The second segmentation result has the same segmentation object as the first segmentation result. For example, both are the segmentation results of the optic cup in the fundus image.
[0056] Step 403: Based on the second segmentation result and the segmentation confidence of the target domain segmentation model, correct the pixel category indicated by the first segmentation result to obtain a corrected segmentation result.
[0057] After the computer device obtains the second segmentation result, it can use the difference between the second segmentation result and the first segmentation result to correct the first segmentation result. The first segmentation result contains indications of the pixel categories of each pixel in the sample medical image. In one possible implementation, the computer device can use the second segmentation result to determine the segmentation results (incorrect pixel categories) that may be incorrect in the first segmentation result, so as to correct the pixel categories that may be incorrect. For example, if the category of pixel A in the sample medical image indicated by the second segmentation result is different from that of the first segmentation result, it indicates that the segmentation result corresponding to pixel A in the first segmentation result may be incorrect, and the pixel category of pixel A in the first segmentation result can be corrected.
[0058] In the embodiments of the present application, in addition to using the second segmentation result to correct the first segmentation result, at the same time, the segmentation confidence of the target domain segmentation model is introduced. The segmentation confidence of the target domain segmentation model represents the uncertainty degree of the target domain segmentation model for image segmentation, that is, the degree of confidence of the target domain segmentation model in segmenting the sample medical image. The second segmentation result is obtained by the target domain segmentation model for image segmentation, and when the target domain segmentation model performs image segmentation, there is uncertainty, that is, the second segmentation result may not be accurate either. Therefore, the segmentation confidence is introduced to correct the first segmentation result at the same time, so as to improve the confidence of the corrected segmentation result.
[0059] It should be noted that the first segmentation result is the segmentation result of the source domain segmentation model, which remains unchanged during the training process of the target domain segmentation model. However, the model parameters of the target domain segmentation model are continuously updated during the training process, and the second segmentation result is updated accordingly. Correspondingly, the segmentation confidence of the target domain segmentation model is also updated. In each process of updating the model parameters, the first segmentation result is corrected using the second segmentation result and the segmentation confidence of the target domain segmentation model under the current model parameters.
[0060] Step 404: Update and train the target domain segmentation model based on the second segmentation result and the corrected segmentation result.
[0061] After obtaining the corrected segmentation result, the computer device uses the second segmentation result and the corrected segmentation result to update and train the target domain segmentation model until the training end condition is reached.
[0062] In summary, in the embodiments of the present application, when the sample medical images in the target domain are unannotated, the computer device respectively performs segmentation on the sample medical images through the source domain segmentation model and the target domain segmentation model to obtain a first segmentation result and a second segmentation result. In the case where the second segmentation result is different from the first segmentation result, it indicates that there may be an incorrect result in the first segmentation result. Therefore, the first segmentation result is corrected using the second segmentation result. At the same time, there may be a problem of inaccurate segmentation in the target domain segmentation model, and the first segmentation result also needs to be corrected based on the segmentation confidence of the target domain segmentation model, so as to improve the confidence of the corrected first segmentation result, that is, the corrected segmentation result, which is beneficial to improving the accuracy of model training.
[0063] Moreover, the corrected segmentation result and the second segmentation result are used to train the target domain segmentation model, so that the trained target domain segmentation model adapts to the image data of the target domain. It is possible to perform unsupervised training on the target domain segmentation model without relying on the source domain data, that is, to achieve source-free unsupervised domain adaptation, thereby improving the accuracy of the target domain segmentation model in segmenting the image data of the target domain.
[0064] In a possible implementation manner, the first segmentation result includes the pixel categories of each pixel in the sample medical image. During the process of correcting the first segmentation result, first, the incorrect pixel categories in the first segmentation result are determined, and then the incorrect pixel categories are corrected. The process of determining the incorrect pixel categories will be described by way of example below.
[0065] Please refer to Figure 5 , which shows a flowchart of a method for segmenting medical images provided by another exemplary embodiment of the present application. This embodiment is described by taking this method being used in a computer device as an example. The method includes the following steps.
[0066] Step 501, perform image segmentation on the sample medical image through the source domain segmentation model to obtain a first segmentation result.
[0067] Step 502, perform image segmentation on the sample medical image through the target domain segmentation model to obtain a second segmentation result.
[0068] Among them, the implementation manners of step 501 and step 502 can refer to the above-mentioned step 401 and step 402, and will not be elaborated in this embodiment.
[0069] Step 503, based on the second segmentation result, determine a label error indication map corresponding to the first segmentation result, where the label error indication map is used to indicate whether the pixel categories of each pixel of the sample medical image in the first segmentation result are marked incorrectly.
[0070] In a possible implementation, the computer device uses the difference between the second segmentation result and the first segmentation result to determine the incorrect pixel categories, i.e., incorrect labels, in the pixel categories indicated by the first segmentation result, thereby obtaining a label error indication map. Among them, different pixel categories correspond to different label error indication maps. For example, when the sample medical image is a fundus image, the pixel categories include the optic cup, optic disc, etc., and the optic cup and optic disc can respectively correspond to different label error indication maps. And the label error indication map has the same image size as the sample medical image, and it contains indications of whether each pixel category in the sample medical image is marked incorrectly. Optionally, this step may include steps 503a - 503c (not shown in the figure):
[0071] Step 503a, based on the first segmentation result, determine the target pixels belonging to the first category.
[0072] The computer device can use the first segmentation result as a pseudo-label to train the target domain segmentation model. First, the computer device determines the probability that each pixel in the sample medical image belongs to the first category based on the first segmentation result. Since there is noise in the first segmentation result, it is necessary to filter the first segmentation result. That is, it is necessary to denoise the first segmentation result and use the denoised result as a pseudo-label. In a possible implementation, an adaptive class-aware method is used for filtering, that is, different filtering thresholds are set for different pixel categories to avoid the problem of unbalanced label filtering caused by using a threshold unrelated to the category.
[0073] When the computer device obtains the first segmentation result, it can use the first segmentation result to determine the target pixels belonging to the first category. Among them, the first segmentation result contains the probability that each pixel belongs to the first category, and the computer device can use the probability that each pixel belongs to the first category to determine whether the pixel belongs to the first category. This method may include the following steps:
[0074] Step 1, based on the first segmentation result, determine the probability that each pixel in the sample medical image belongs to the first category.
[0075] Optionally, the computer device can determine the probability that each pixel belongs to the first category based on the predicted probability indicated by the first segmentation result. Among them, the predicted probability indicated by the first segmentation result contains the probability that each pixel belongs to different categories.
[0076] Step 2, based on the probability that each pixel belongs to the first category, determine the first probability threshold corresponding to the first category.
[0077] In a possible implementation, by determining the probability that each pixel belongs to the first category, the first probability threshold of the first category is determined. Among them, the process of determining the first probability threshold may include the following steps:
[0078] Step 1, determine the maximum probability value among the probabilities that each pixel belongs to the first category.
[0079] The computer device determines the maximum probability value among the probabilities that each belongs to the first category. Schematically, when the first category is the optic cup, the computer device determines the probability that each pixel in the sample medical image belongs to the optic cup, and determines the maximum probability value among them.
[0080] Step 2, based on the maximum probability value, determine the first probability threshold.
[0081] After obtaining the maximum probability value, the computer device can use a preset probability parameter and the determined maximum probability value to determine the first probability threshold. The method is as follows:
[0082]
[0083] Among them, P c That is, it represents the probability set that the pixel belongs to the first category, and α is the probability parameter. Optionally, α is 0.75.
[0084] Step 3. In the case where the probability that the pixel belongs to the first category is greater than the first probability threshold, determine the pixel as the target pixel.
[0085] The first probability threshold is used to filter out the probabilities with low confidence in the first segmentation result. In the case where the probability that the pixel belongs to the first category is greater than the first probability threshold, it is determined that the confidence is relatively high, and the pixel can be determined as the target pixel, that is, it is determined that it belongs to the first category. That is:
[0086]
[0087] Among them, p c Is the probability that the pixel belongs to the first category, Is the indicator function, when When, Is 1, indicating that the pixel belongs to the first category; when When, Is 0, indicating that the pixel does not belong to the first category.
[0088] It should be noted that the above only gives an exemplary description of determining the target pixels belonging to the first category. Similarly, the pixels belonging to other categories in the first segmentation result can also be determined in the same way.
[0089] Step 503b, based on the second segmentation result, determine the target probability that the target pixel belongs to the second category, and the second category is a pixel category different from the first category.
[0090] In the above process, the first segmentation result is preliminarily screened through a threshold strategy, which is only a rough denoising process. By roughly denoising the first segmentation result, a pseudo-label is obtained. To improve the quality of the pseudo-label, further fine denoising is required. The following describes the fine denoising process.
[0091] First, the computer device uses the segmentation result of the target domain segmentation model as a cross-validation third party to finely correct the pseudo-label. In a possible implementation, the Classification Noise Process (CNP) assumption is used, that is, it is assumed that each pixel in the sample medical image has a correct (latent) class label, and each class label has a certain probability of being mislabeled as another class label, that is, there is a certain probability of being labeled as another class label in the pseudo-label. For example, pixel x t(w,h) ∈X t has a latent label of and each label belonging to class j may be labeled as class i in the pseudo-label with probability , where i ∈ C, j ∈ C, and C is the set of pixel classes in the sample medical image.
[0092] In a possible implementation, the target domain segmentation model can output the out-of-sample prediction probability (the second segmentation result), that is, after the target domain segmentation model segments the sample medical image, the probability that each pixel in the sample medical image belongs to different pixel classes. When the probability that the second segmentation result indicates that the pixel belongs to the target class is greater than a certain threshold, it means that the pixel may belong to that target class. For example, when the pseudo-label of x t is and the probability that the pixel x t belonging to class j indicated by the second segmentation result is greater than the probability threshold , the latent label of pixel x t may be j rather than i.
[0093] Therefore, the computer device can determine the latent label of the pixel according to the second segmentation result, so as to determine whether there is a wrong label in the pseudo-label. Optionally, for the pixels with the pseudo-label of the first category, the computer device can obtain the target probability that the target pixel belongs to the second category in the second segmentation result, where the second category is a pixel category different from the first category, so as to determine the possibility that the latent label of the pixel is the second category while the pseudo-label is the first category according to the target probability.
[0094] Schematically, when the first category is the optic cup, the computer device can obtain the probability that the target pixel belongs to a non-optic cup category (such as the optic disc) in the second segmentation result.
[0095] Step 503c: Based on the target probability, determine the label error indication map corresponding to the first category in the first segmentation result.
[0096] After obtaining the target probability, the computer device can determine the label error indication map corresponding to the first category based on the target probability. This step may include the following steps:
[0097] Step 1: Based on the probabilities that each pixel in the second segmentation result belongs to the second category, determine the second probability threshold for the second category.
[0098] When the probability that the second segmentation result indicates that a pixel belongs to the second category is greater than the corresponding second probability threshold, it can be determined that the potential label of the pixel may be the second category. The computer device first determines the second probability threshold for the second category. In one possible implementation, the average value of the probabilities that each pixel belongs to the second category can be determined as the second probability threshold. That is:
[0099]
[0100] where is the set of probabilities that each pixel in the second segmentation result belongs to the second category.
[0101] Or, in another possible implementation, the second probability threshold can be determined according to the maximum probability value among the probabilities that each pixel belongs to the second category. That is:
[0102]
[0103] where α is a probability parameter.
[0104] Step 2: Based on the target probability and the second probability threshold, determine the joint distribution matrix, which is used to indicate the probability that a pixel is labeled as the first category while the potential category is the second category.
[0105] In one possible implementation, the computer device filters using the second probability threshold to obtain the number of pixels whose potential label is the second category while the pseudo-label is the first category, and then further determines the probability that the pseudo-label of the pixel in the sample medical image is the first category while the potential category is the second category according to the number, that is, the joint distribution matrix. The process of determining the joint distribution matrix may include the following steps:
[0106] Step 1: Based on the target probability and the second probability threshold, determine the confidence joint matrix, which is used to indicate the number of target pixels whose potential category is the second category.
[0107] First, the computer device can use the target probability and the second probability threshold to construct the confidence joint matrix in the following way:
[0108]
[0109] Among them, represents the number of target pixels with a pseudo-label of the first category i and a potential label of the second category j. represents the pixels with a pseudo-label of the first category i in the sample medical image. represents the probability that the pixel x indicated by the second segmentation result belongs to the second category j. t Belonging to the second category j.
[0110] Step 2, normalize the confidence joint matrix to obtain the joint distribution matrix.
[0111] After obtaining the confidence joint matrix, the confidence joint matrix can be normalized to obtain the joint distribution matrix. However, since during the construction of the confidence joint matrix, the computer device filters the pixels, and the total number of pixels has changed. It is necessary to restore the total number of pixels represented by the matrix. Therefore, first, calibrate the confidence joint matrix in the following way:
[0112]
[0113] Among them, is the total number of pixels with a pseudo-label of i.
[0114] After that, normalize the obtained after calibration processing to obtain the joint distribution matrix in the following way:
[0115]
[0116] Step 3, based on the joint distribution matrix, determine the label error indication map corresponding to the first category.
[0117] Optionally, the joint distribution matrix represents the probability that the pseudo-label is the first category while the pixel potential category is the second category. The computer device can use the joint distribution matrix to determine the label error indication map corresponding to the first category, that is, the mislabeled pixels for the first category in the pseudo-label. This method may include the following steps:
[0118] Step 1, based on the joint distribution matrix and the total number of pixels in the sample medical image, determine the number of pixel label errors.
[0119] Among them, the non-diagonal values in the joint distribution matrix represent the possibility that the first category is mislabeled. Therefore, in one possible implementation, based on the total number of pixels and the joint distribution matrix, the possible number of pixel label errors in the first segmentation result can be determined, that is, the number of pixel label errors can be:
[0120]
[0121] Where n is the total number of pixels in the sample medical image.
[0122] Step 2: Based on the number of pixel label errors, select the pixels with label errors among the pixels of the sample medical image, where the probability that the pixels with label errors belong to the first category is lower than the probability that other pixels belong to the first category.
[0123] After that, the computer device selects the pixels with label errors among the pixels of the sample medical image based on the number of pixel label errors. In a possible implementation, the computer device sorts the probabilities that each pixel in the first segmentation result belongs to the first category from low to high, and determines the first k pixels in the sorted order as the pixels with label errors, where k is the number of pixel label errors.
[0124] Step 3: Perform a first marking on the pixels with label errors and a second marking on other pixels to obtain a label error indication map.
[0125] The label error indication map of the first category includes the accuracy of each pixel in the sample medical image being recognized as the first category or not the first category in the first segmentation result. In a possible implementation, the computer device can perform a first marking on the selected pixels with label errors to indicate the pseudo-label error of the pixel, and perform a second marking on other pixels except the pixels with label errors to indicate the correct pseudo-label of the pixel. Optionally, the first marking can be "1" and the second marking can be "0".
[0126] In the above process, the determination process of the label error indication map of the first category is described. Correspondingly, the label error indication maps of other categories can be determined in the same way, so as to correct the first segmentation result based on the label error indication maps corresponding to each category respectively.
[0127] Step 504: Based on the segmentation confidence, correct the error pixel categories indicated in the label error indication map to obtain a corrected segmentation result.
[0128] After the computer device obtains the label error indication map, it can determine whether to perform correction according to the error conditions of the pseudo-labels of each pixel indicated. When the label error indication map indicates that the pixel category is the error pixel category, correct the corresponding pseudo-label of the pixel, and when the label error indication map indicates that the pixel category is the correct pixel category, determine the pseudo-label as the label of the pixel.
[0129] For example, for the label error indication map of the first category, where the first segmentation result indicates that pixel A and pixel B belong to the first category, that is, the pseudo-labels of pixel A and pixel B are the first category, the pixel category indicating pixel A in the label error indication map is the wrong pixel category, and the pixel category of pixel B is the correct pixel category. This means that the pixel category of pixel A may not be the first category and needs to be corrected, while pixel B is of the first category and does not need to be corrected.
[0130] During the correction, since the target domain segmentation model may still have domain shift, that is, it has not adapted to the target domain data, the second segmentation result also has noise. Therefore, it is necessary to further correct based on the segmentation confidence of the target domain segmentation model. Among them, the process of correcting the wrong pixel category based on the segmentation confidence can refer to the following embodiments.
[0131] Step 505, update and train the target domain segmentation model based on the second segmentation result and the corrected segmentation result.
[0132] Among them, the implementation manner of this step can refer to step 204 above, and this embodiment will not be elaborated here.
[0133] In the embodiment of the present application, first, rough denoising is performed on the first segmentation result to obtain the pseudo-labels for training, which can improve the accuracy of the pseudo-labels. And further, based on the difference between the pixel category corresponding to the pixel in the second segmentation result and the pixel category indicated by the pseudo-labels, the wrong pseudo-labels are determined, and the wrong pseudo-labels are further corrected using the segmentation confidence of the target domain segmentation model, realizing fine correction of the pseudo-labels, further improving the accuracy of the pseudo-labels, and thus improving the accuracy of model training.
[0134] In the embodiment of the present application, during the process of correcting the first segmentation result, the segmentation confidence of the target domain segmentation model is introduced at the same time. The following will give an exemplary description of the process of determining the segmentation confidence of the target domain segmentation model and the specific correction process.
[0135] Please refer to Figure 6 , which shows the flowchart of the segmentation method of medical images provided by another exemplary embodiment of the present application. This embodiment is described by taking this method being used in a computer device as an example. The method includes the following steps.
[0136] Step 601, perform image segmentation on the sample medical image through the source domain segmentation model to obtain the first segmentation result.
[0137] Step 602, perform image segmentation on the sample medical image through the target domain segmentation model to obtain the second segmentation result.
[0138] Step 603, based on the second segmentation result, determine the label error indication map corresponding to the pixel category in the first segmentation result.
[0139] Among them, the implementation manners of steps 601 to 603 can refer to the above embodiments, and will not be elaborated in this embodiment.
[0140] Step 604, in the case of enabling random perturbation, perform n forward inferences on the sample medical image through the target domain segmentation model to obtain n groups of pixel category probabilities of the pixels in the sample medical image.
[0141] In a possible implementation manner, the computer device uses the segmentation uncertainty of the target domain segmentation model to determine the segmentation confidence. Among them, the segmentation uncertainty can be determined according to the segmentation result of the target domain segmentation model under the condition of being randomly perturbed.
[0142] Optionally, the Monte-Carlo (MC) dropout method can be used for Bayesian estimation to obtain the segmentation uncertainty. The computer device enables random perturbation for the target domain segmentation model, that is, enables random dropout. During the process of enabling random dropout, the model result of the target domain segmentation model will change randomly. At this time, perform n forward inferences on the sample medical image through the target domain segmentation model, that is, perform n image segmentations to obtain n segmentation results, where each segmentation result contains the pixel category probabilities of the pixels.
[0143] Schematically, 10 random forward inferences can be performed, and the dropout rate is 0.5.
[0144] Step 605, based on the n groups of pixel category probabilities of each pixel, determine the model uncertainty map of the target domain segmentation model.
[0145] Among them, the computer device can respectively use the n groups of pixel category probabilities of each pixel to determine the segmentation uncertainty degree corresponding to each pixel, and thus determine the model uncertainty map of the target domain segmentation model according to the segmentation uncertainty degrees of each pixel. In a possible implementation manner, the standard deviation of the n groups of pixel category probabilities is determined as the segmentation uncertainty degree corresponding to the pixel.
[0146] Optionally, different pixel categories correspond to different model uncertainty maps. Schematically, when the pixel category is the first category, the computer device can obtain the n groups of pixel category probabilities that each pixel belongs to the first category, so as to obtain the segmentation uncertainty degree corresponding to each pixel, and the segmentation uncertainty degrees of each pixel form the model uncertainty map for segmenting the first category of the target domain segmentation model.
[0147] Step 606, based on the model uncertainty map, determine the segmentation confidence of the pixels corresponding to the pixel categories with incorrect segmentation by the target domain segmentation model.
[0148] After obtaining the model uncertainty map, the computer device can determine the segmentation confidence of the pixels corresponding to the error pixel categories indicated in the model uncertainty map, that is, the segmentation uncertainty of the pixels corresponding to the error pixel categories. Among them, the pixels corresponding to the error pixel categories are the pixels marked as the first mark in the label error indication map. And in the process of determining the segmentation confidence, the model uncertainty map and the label error indication map are maps corresponding to the same category pair. For example, according to the model uncertainty map corresponding to the first category, determine the segmentation confidence of the pixels corresponding to the error pixel categories in the label error indication map corresponding to the first category segmented by the target domain segmentation model.
[0149] Step 607: Based on the segmentation confidence of the pixels corresponding to the error pixel categories, determine a correction weight, and the correction weight has a negative correlation with the segmentation confidence.
[0150] In a possible implementation, the error pixel categories, that is, the error pseudo-labels, are corrected by the correction weight. Among them, the correction weight has a negative correlation with the segmentation confidence. The lower the segmentation confidence, the greater the correction weight. Optionally, the correction weight is in the range of 0-1.
[0151] Step 608: Based on the correction weight, correct the error pixel categories to obtain a corrected segmentation result.
[0152] The method of correcting the error pixel categories using the correction weight is as follows:
[0153]
[0154] Among them, represents the first segmentation result, E c is the label error indication map, and U c is the model uncertainty map. Among them, E c is 0 or 1. When the pseudo-label corresponding to the pixel indicated by E c is incorrect, that is, it is the error pixel category, it is corrected using the correction weight (1 - U c ). During the correction process, the error pixel categories are corrected separately.
[0155] For example, the first segmentation result indicates that the pixel is the first category or not the first category. When the indicated pixel A is the first category, and E c indicates that pixel A is the error pixel category and the obtained segmentation uncertainty of pixel A in U c is 0.8, then the corrected segmentation result of pixel A is 1 - (1 - 0.8) = 0.8.
[0156] When the pseudo-label corresponding to the pixel indicated by E c is incorrect but is the correct pixel category, no correction is required, that is, the first segmentation result is the same as the corrected segmentation result.
[0157] Step 609: Determine the pixel class probability of each pixel based on the second segmentation result.
[0158] In a possible implementation, the computer device updates and trains the target domain segmentation model by using the difference between the corrected segmentation result and the second segmentation result. Optionally, the cross-entropy loss can be used to update the model parameters of the target domain segmentation model. First, the computer device obtains the pixel class probabilities of each pixel belonging to different pixel classes according to the second segmentation result.
[0159] Step 610: Determine the cross-entropy loss based on the pixel class probability and the corrected segmentation result of each pixel.
[0160] The computer device determines the cross-entropy loss by using the pixel class probability and the corrected segmentation result. Among them, for pixels segmented into different classes, there are different corrected segmentation results. When determining the cross-entropy loss, the corresponding cross-entropy loss can be obtained for different classes respectively. Optionally, when determining the cross-entropy loss of the target class, the cross-entropy loss corresponding to the target class can be determined based on the pixel class probability that the pixel belongs to the target class and the corrected segmentation result corresponding to the target class. The method for determining the cross-entropy loss is as follows:
[0161]
[0162] Among them, is the corrected segmentation result corresponding to pixel v. When the label error indication map indicates that the pixel class of pixel v is the correct pixel class, the corrected segmentation result is the pixel class of pixel v in the first segmentation result. If it is indicated as an incorrect pixel class, the corrected segmentation result is the pixel class corrected based on the segmentation confidence. p t(v) is the pixel class probability of pixel v in the second segmentation result.
[0163] Step 611: Update and train the target domain segmentation model based on the cross-entropy loss.
[0164] The computer device uses algorithms such as backpropagation or gradient update to update the model parameters of the target domain segmentation model based on the cross-entropy loss until the cross-entropy loss reaches the convergence condition.
[0165] It should be noted that, in addition to the method of updating and training using the cross-entropy loss, other losses can also be used, such as L1, L2 and other loss functions. The embodiments of the present application do not make any limitations in this regard.
[0166] In this embodiment, when random perturbation is enabled, the target domain segmentation model is used for n forward inferences, and the segmentation confidence of the target domain segmentation model is determined using the inference results. When it is perturbed, the more stable the n forward inference results are, the higher the segmentation confidence is, which indicates that the confidence of the second segmentation result is higher. When the second segmentation result indicates a pseudo-label error, it can be corrected, thereby improving the accuracy of the corrected segmentation result.
[0167] In a possible implementation manner, the overall structure for training the target domain segmentation model is as Figure 7 shown. Among them, the computer device first inputs the sample medical image 701 into the source domain segmentation model to obtain the first segmentation result 702. Then, rough denoising is performed on the first segmentation result 702 to obtain the pseudo-label 703. And an initial target domain segmentation model is initialized based on the model parameters of the source domain segmentation model. After that, the computer device inputs the sample medical image 701 into the target domain segmentation model to obtain the second segmentation result 704. Thus, the pseudo-label 703 and the second segmentation result 704 can be used for label error estimation to obtain the label error indication map 705. And it is also necessary to further perform model uncertainty estimation based on the target domain segmentation model to obtain the model uncertainty map 706. The computer device can use the model uncertainty map 706 and the label error indication map 705 to correct the pseudo-label 703 to achieve fine denoising and obtain the corrected segmentation result 707. Finally, the cross-entropy loss is determined using the corrected segmentation result 707 and the second segmentation result 704 to update and train the target domain segmentation model 704.
[0168] After the target domain segmentation model is trained, the target domain image data can be segmented. In a possible implementation manner, the target domain segmentation model is used to perform image segmentation on the target image belonging to the target domain to obtain the target segmentation result of the target image.
[0169] Using the target domain segmentation model trained by the solution provided in the above embodiment for image segmentation can improve the accuracy of the segmentation result. Taking the fundus image as the segmentation target as an example, the source domain segmentation model is a model pre-trained using the Drishti-GS dataset (D1), and the RIM-ONE-r3 dataset (D2) and the REFUGE dataset (D3) are used as the target domain data.
[0170] Table 1 shows the segmentation effects of the target domain segmentation models corresponding to the D2 dataset obtained by using the domain adaptation method in the related technology and the domain adaptation method adopted in the embodiment of the present application. Table 2 shows the segmentation effects of the target domain segmentation models corresponding to the D3 dataset obtained by using the domain adaptation method in the related technology and the domain adaptation method adopted in the embodiment of the present application.
[0171] Table 1
[0172]
[0173]
[0174] Table 2
[0175]
[0176] Among them, the upper bound refers to the segmentation result of the target domain segmentation model obtained by fully supervised training based on the labels of the target domain data. Without adaptation, it refers to the result of directly using the source domain segmentation model to segment the target domain data. Among them, BEAL and ADVENT are the segmentation results of the target domain segmentation model obtained by training based on the source data; SRDA is the segmentation result of the target domain segmentation model obtained by partially training based on the source data during the training process; both TENT and DPL are the segmentation results of the target domain segmentation model obtained without relying on the source data for training. Among them, the accuracy of the segmentation result is determined based on the Dice score and the Average Symmetric Surface Distance (ASSD) at symmetric positions. The data in parentheses in the table are the standard deviations. Among them, the Dice score is positively correlated with the segmentation result accuracy, and the ASSD is negatively correlated with the segmentation result accuracy. It can be seen that the source-free and unsupervised training method provided by this application can improve the effect of domain adaptation of the target domain segmentation model when the source data cannot be obtained and the target domain data is unlabeled, and improve the segmentation accuracy.
[0177] As Figure 8 shown, it shows the segmentation results of the target images in the D2 dataset and the D3 dataset by the target domain segmentation model obtained by the method in the related art and the method of this application. It can be seen that the segmentation result of this application has a high accuracy.
[0178] Figure 9 is the structural block diagram of the medical image segmentation device provided by an exemplary embodiment of this application. As Figure 9 shown, the device includes:
[0179] An image segmentation module 901, configured to perform image segmentation on a sample medical image through a source domain segmentation model to obtain a first segmentation result. The source domain segmentation model is trained based on the image data of the source domain. The sample medical image is an unlabeled image in the target domain, and the target domain is different from the source domain;
[0180] The image segmentation module 901 is further configured to perform image segmentation on the sample medical image through a target domain segmentation model to obtain a second segmentation result;
[0181] The correction module 902 is configured to correct the pixel categories indicated by the first segmentation result based on the second segmentation result and the segmentation confidence of the target domain segmentation model, so as to obtain a corrected segmentation result;
[0182] The training module 903 is configured to update and train the target domain segmentation model based on the second segmentation result and the corrected segmentation result.
[0183] Optionally, the correction module 902 is further configured to:
[0184] Determine a label error indication map corresponding to the first segmentation result based on the second segmentation result, where the label error indication map is used to indicate whether the pixel categories of each pixel of the sample medical image in the first segmentation result are mislabeled;
[0185] Correct the mislabeled pixel categories indicated in the label error indication map based on the segmentation confidence to obtain the corrected segmentation result.
[0186] Optionally, the correction module 902 is further configured to:
[0187] Determine target pixels belonging to a first category based on the first segmentation result;
[0188] Determine the target probability that the target pixels belong to a second category based on the second segmentation result, where the second category is a pixel category different from the first category;
[0189] Determine the label error indication map corresponding to the first category in the first segmentation result based on the target probability.
[0190] Optionally, the correction module 902 is further configured to:
[0191] Determine the probability that each pixel in the sample medical image belongs to the first category based on the first segmentation result;
[0192] Determine a first probability threshold corresponding to the first category based on the probability that each pixel belongs to the first category;
[0193] If the probability that the pixel belongs to the first category is greater than the first probability threshold, determine the pixel as the target pixel.
[0194] Optionally, the correction module 902 is further configured to:
[0195] Determine the maximum probability value among the probabilities that each pixel belongs to the first category;
[0196] Determine the first probability threshold based on the maximum probability value.
[0197] Optionally, the correction module 902 is further configured to:
[0198] Determine a second probability threshold for the second category based on the probability that each pixel in the second segmentation result belongs to the second category;
[0199] Determine a joint distribution matrix based on the target probability and the second probability threshold, where the joint distribution matrix is used to indicate the probability that a pixel is labeled as the first category while the latent category is the second category;
[0200] Determine the label error indication map corresponding to the first category based on the joint distribution matrix.
[0201] Optionally, the correction module 902 is further configured to:
[0202] Determine a confidence joint matrix based on the target probability and the second probability threshold, where the confidence joint matrix is used to indicate the number of latent categories of the target pixel that are the second category;
[0203] Perform a normalization process on the confidence joint matrix to obtain the joint distribution matrix.
[0204] Optionally, the correction module 902 is further configured to:
[0205] Determine the number of pixel label errors based on the joint distribution matrix and the total number of pixels in the sample medical image;
[0206] Select pixels with label errors among the pixels of the sample medical image based on the number of pixel label errors, where the probability that the pixels with label errors belong to the first category is lower than the probability that other pixels belong to the first category;
[0207] Perform a first marking on the pixels with label errors and a second marking on other pixels to obtain the label error indication map.
[0208] Optionally, the device further includes:
[0209] A forward inference module, configured to perform n times of forward inference on the sample medical image through the target domain segmentation model in the case of enabling random perturbation, to obtain n groups of pixel category probabilities of the pixels in the sample medical image;
[0210] An uncertainty map determination module, configured to determine a model uncertainty map of the target domain segmentation model based on the n groups of pixel category probabilities of each pixel;
[0211] A confidence determination module, configured to determine the segmentation confidence of the target domain segmentation model for segmenting the pixels corresponding to the wrong pixel category based on the model uncertainty map.
[0212] Optionally, the correction module 902 is further configured to:
[0213] Determine a correction weight based on the segmentation confidence of the pixels corresponding to the wrong pixel category, where the correction weight has a positive correlation with the segmentation confidence;
[0214] Correct the wrong pixel category based on the correction weight to obtain the corrected segmentation result.
[0215] Optionally, the training module 903 is further configured to:
[0216] Determine the pixel category probability of each pixel based on the second segmentation result;
[0217] Determine the cross-entropy loss based on the pixel category probability and the corrected segmentation result of each pixel;
[0218] Update and train the target domain segmentation model based on the cross-entropy loss.
[0219] In summary, in the embodiments of the present application, when the sample medical images in the target domain are unlabeled, the computer device respectively segments the sample medical images through the source domain segmentation model and the target domain segmentation model to obtain the first segmentation result and the second segmentation result. When there are differences between the second segmentation result and the first segmentation result, it indicates that the first segmentation result may have incorrect results. Therefore, the second segmentation result is used to correct the first segmentation result, and at the same time, the target domain segmentation model may have problems with inaccurate segmentation. At the same time, the first segmentation result also needs to be corrected based on the segmentation confidence of the target domain segmentation model, so as to improve the confidence of the corrected first segmentation result, that is, the corrected segmentation result, that is, to improve the confidence of the segmentation result used for training, which is beneficial to improving the accuracy of model training.
[0220] Moreover, the corrected segmentation result and the second segmentation result are used to train the target domain segmentation model, so that the trained target domain segmentation model adapts to the image data of the target domain, and unsupervised training of the target domain segmentation model can be realized without relying on the source domain data, that is, passive unsupervised domain adaptation is realized, thereby improving the accuracy of the target domain segmentation model for segmenting the image data of the target domain.
[0221] It should be noted that: For the device provided in the above embodiments, only the division of the above functional modules is used for illustration. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device provided in the above embodiments and the method embodiments belong to the same concept, and the implementation process is detailed in the method embodiments, which will not be elaborated here.
[0222] Please refer to Figure 10 , which shows a schematic structural diagram of a computer device provided by an exemplary embodiment of the present application. Specifically: The computer device 1000 includes a central processing unit (CPU) 1001, a system memory 1004 including a random access memory 1002 and a read-only memory 1003, and a system bus 1005 connecting the system memory 1004 and the central processing unit 1001. The computer device 1000 further includes a basic input / output system (Input / Output, I / O system) 1006 for facilitating the transfer of information between various components within the computer, and a mass storage device 1007 for storing an operating system 1013, application programs 1014, and other program modules 1015.
[0223] The basic input / output system 1006 includes a display 1008 for displaying information and input devices 1009 such as a mouse and a keyboard for user input. Among them, both the display 1008 and the input devices 1009 are connected to the central processing unit 1001 through an input / output controller 1010 connected to the system bus 1005. The basic input / output system 1006 may further include an input / output controller 1010 for receiving and processing inputs from multiple other devices such as a keyboard, a mouse, or an electronic stylus. Similarly, the input / output controller 1010 also provides outputs to a display screen, a printer, or other types of output devices.
[0224] The mass storage device 1007 is connected to the central processing unit 1001 through a mass storage controller (not shown) connected to the system bus 1005. The mass storage device 1007 and its associated computer-readable medium provide nonvolatile storage for the computer device 1000. That is to say, the mass storage device 1007 may include a computer-readable medium (not shown) such as a hard disk or a drive.
[0225] Without loss of generality, the computer-readable medium may include a computer storage medium and a communication medium. The computer storage medium includes volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. The computer storage medium includes random access memory (RAM), read-only memory (ROM), flash memory or other solid-state storage technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic tape cartridges, tapes, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will know that the computer storage medium is not limited to the above several types. The above system memory 1004 and mass storage device 1007 can be collectively referred to as memory.
[0226] The memory stores one or more programs, and the one or more programs are configured to be executed by one or more central processing units 1001. The one or more programs include instructions for implementing the above method. The central processing unit 1001 executes the one or more programs to implement the methods provided by the above various method embodiments.
[0227] According to various embodiments of the present application, the computer device 1000 can also run by connecting to a remote computer on the network through a network such as the Internet. That is, the computer device 1000 can be connected to the network 1012 through the network interface unit 1011 connected to the system bus 1005. Or rather, the network interface unit 1011 can also be used to connect to other types of networks or remote computer systems (not shown).
[0228] The memory further includes one or more programs, and the one or more programs are stored in the memory. The one or more programs include steps for the computer device to execute in the method provided by the embodiments of the present application.
[0229] The embodiments of the present application also provide a computer-readable storage medium, in which at least one instruction, at least one segment of program, code set or instruction set is stored. The at least one instruction, at least one segment of program, code set or instruction set is loaded and executed by a processor to implement the medical image segmentation method described in any of the above embodiments.
[0230] An embodiment of the present application provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the medical image segmentation method provided in the above aspects.
[0231] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by a program instructing relevant hardware. The program can be stored in a computer-readable storage medium, which can be the computer-readable storage medium included in the memory in the above embodiments; it can also exist alone and be a computer-readable storage medium not assembled into a terminal. At least one instruction, at least one program, a code set or an instruction set is stored in the computer-readable storage medium, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the medical image segmentation method described in any of the above method embodiments.
[0232] Optionally, the computer-readable storage medium may include: ROM, RAM, solid state drives (SSD) or optical discs, etc. Among them, RAM may include resistance random access memory (ReRAM) and dynamic random access memory (DRAM). The serial numbers of the above embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0233] Those of ordinary skill in the art can understand that all or part of the steps to implement the above embodiments can be completed by hardware or by a program instructing relevant hardware. The program can be stored in a computer-readable storage medium, and the storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disc, etc.
[0234] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for segmenting medical images, characterized in that, The method includes: Performing image segmentation on a sample medical image through a source domain segmentation model to obtain a first segmentation result. The source domain segmentation model is trained based on medical image data in the source domain. The sample medical image is an unlabeled medical image in the target domain, and the data distribution of medical images in the target domain is different from that in the source domain; Performing image segmentation on the sample medical image through a target domain segmentation model to obtain a second segmentation result; Based on the second segmentation result, determining a label error indication map corresponding to the first segmentation result. The label error indication map is used to indicate whether the pixel categories of each pixel in the sample medical image in the first segmentation result are mislabeled; Based on the segmentation confidence of the pixels corresponding to the mislabeled pixel categories, determining a correction weight. The correction weight has a positive correlation with the segmentation confidence, and the segmentation confidence is determined based on the model uncertainty map of the target domain segmentation model; Based on the correction weight, correcting the mislabeled pixel categories to obtain a corrected segmentation result; Based on the second segmentation result and the corrected segmentation result, updating and training the target domain segmentation model.
2. The method according to claim 1, wherein The determining the label error indication map corresponding to the first segmentation result based on the second segmentation result includes: Based on the first segmentation result, determining target pixels belonging to a first category; Based on the second segmentation result, determining the target probability that the target pixels belong to a second category, where the second category is a pixel category different from the first category; Based on the target probability, determining the label error indication map corresponding to the first category in the first segmentation result.
3. The method according to claim 2, wherein The determining the target pixels belonging to a first category based on the first segmentation result includes: Based on the first segmentation result, determining the probability that each pixel in the sample medical image belongs to the first category; Based on the probability that each pixel belongs to the first category, determining a first probability threshold corresponding to the first category; When the probability that the pixel belongs to the first category is greater than the first probability threshold, determining the pixel as the target pixel.
4. The method according to claim 3, wherein The determining the first probability threshold corresponding to the first category based on the probability that each pixel belongs to the first category includes: Determining the maximum probability value among the probabilities that each pixel belongs to the first category; Based on the maximum probability value, determining the first probability threshold.
5. The method according to claim 2, wherein The determining the label error indication map corresponding to the first category in the first segmentation result based on the target probability includes: Based on the probability that each pixel in the second segmentation result belongs to the second category, determining a second probability threshold for the second category; Based on the target probability and the second probability threshold, determining a joint distribution matrix, where the joint distribution matrix is used to indicate the probability that a pixel is labeled as the first category while the potential category is the second category; Based on the joint distribution matrix, determining the label error indication map corresponding to the first category.
6. The method according to claim 5, wherein The determining the joint distribution matrix based on the target probability and the second probability threshold includes: Based on the target probability and the second probability threshold, determine a confidence joint matrix, where the confidence joint matrix is used to indicate the number of the potential classes of the target pixel being the second class; Perform a normalization process on the confidence joint matrix to obtain the joint distribution matrix.
7. The method according to claim 5, wherein The determining of the label error indication map corresponding to the first class based on the joint distribution matrix includes: Based on the joint distribution matrix and the total number of pixels in the sample medical image, determine the number of pixel label errors; Based on the number of pixel label errors, select the pixels with label errors among the pixels of the sample medical image, where the probability that the pixels with label errors belong to the first class is lower than the probability that other pixels belong to the first class; Perform a first marking on the pixels with label errors and a second marking on other pixels to obtain the label error indication map.
8. The method according to any one of claims 1 to 7, characterized in that The method further includes: In the case of enabling random perturbation, perform n forward inferences on the sample medical image through the target domain segmentation model to obtain n groups of pixel class probabilities of each pixel in the sample medical image; Based on the n groups of pixel class probabilities of each pixel, determine the model uncertainty map of the target domain segmentation model; Based on the model uncertainty map, determine the segmentation confidence of the target domain segmentation model for segmenting the pixels corresponding to the wrong pixel classes.
9. The method according to any one of claims 1 to 7, characterized in that, The updating and training of the target domain segmentation model based on the second segmentation result and the corrected segmentation result includes: Based on the second segmentation result, determine the pixel class probabilities of each pixel; Based on the pixel class probabilities and the corrected segmentation results of each pixel, determine the cross-entropy loss; Based on the cross-entropy loss, update and train the target domain segmentation model.
10. A segmentation device for medical images, characterized in that, The device includes: An image segmentation module, configured to perform image segmentation on a sample medical image through a source domain segmentation model to obtain a first segmentation result, where the source domain segmentation model is trained based on medical image data of a source domain, the sample medical image is an unlabeled medical image in a target domain, and the data distributions of medical images in the target domain and the source domain are different; The image segmentation module is further configured to perform image segmentation on the sample medical image through a target domain segmentation model to obtain a second segmentation result; A correction module, configured to determine a label error indication map corresponding to the first segmentation result based on the second segmentation result, where the label error indication map is used to indicate whether the pixel classes of each pixel in the sample medical image in the first segmentation result are marked incorrectly; Based on the segmentation confidence of the pixels corresponding to the wrong pixel classes, determine a correction weight, where the correction weight has a positive correlation with the segmentation confidence, and the segmentation confidence is determined based on the model uncertainty map of the target domain segmentation model; Based on the correction weight, correct the wrong pixel classes to obtain a corrected segmentation result; A training module, configured to update and train the target domain segmentation model based on the second segmentation result and the corrected segmentation result.
11. A computer device, characterized in that, The computer device includes a processor and a memory. At least one program is stored in the memory, and the at least one program is loaded and executed by the processor to implement the medical image segmentation method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, At least one program is stored in the readable storage medium, and the at least one program is loaded and executed by a processor to implement the medical image segmentation method according to any one of claims 1 to 9.
13. A computer program product, characterized in that, The computer program product includes computer instructions. The computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to implement the medical image segmentation method according to any one of claims 1 to 9.