Image segmentation model training method, device, equipment and storage medium
By correcting the pseudo-labels of unlabeled samples through a generalist segmentation model and combining the loss training model with labeled samples, the problem of insufficient number of labeled samples and heavy labeling workload in medical image segmentation is solved, and efficient training under low labeling budget is achieved. Effect.
Patent Information
- Application Number
- CN202410600152.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-15
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-05-15
AI Technical Summary
In the field of medical image segmentation, semi-supervised learning methods are prone to overfitting problems due to their dependence on the number of labeled samples, and the workload of labeling is huge, making it difficult to effectively utilize the information in unlabeled samples.
By introducing a generalist segmentation model, the prediction results of unlabeled samples are used as prompt information to correct and obtain more accurate pseudo labels. Combined with the loss of labeled samples, the image segmentation model is trained to improve the information utilization of unlabeled samples and reduce the accuracy of labeled samples. Label sample size requirements.
Under low labeling budget, a very small number of labeled samples are used to obtain satisfactory training results, which improves the performance and generalization ability of the model and reduces the risk of overfitting.
Smart Images

Figure CN118212490B
Abstract
Description
Technical Field
[0001] The present application relates to the field of semi-supervised learning, and in particular to a training method, apparatus, device and storage medium for an image segmentation model. Background Art
[0002] Image segmentation models have high practical value in the medical field. For example, image segmentation models are used to identify various organs and lesions in three-dimensional (3D) magnetic resonance imaging.
[0003] Since the workload of labeling 3D medical images is very huge, related technologies use semi-supervised learning to train image segmentation models. Semi-supervised learning means that medical experts randomly label a part of medical images to obtain a small number of labeled samples. A small number of labeled samples and a large number of unlabeled samples are used to train the image segmentation model.
[0004] Although the above semi-supervised learning method can reduce the number of labeled samples required, it still requires a certain number of labeled samples to complete the training. If the number of labeled samples is insufficient, it is easy to cause serious overfitting problems. Summary of the invention
[0005] The present application provides a training method, apparatus, device and storage medium for an image segmentation model. The technical solution is as follows:
[0006] According to one aspect of the present application, a method for training an image segmentation model is provided, the method comprising:
[0007] Obtain labeled samples and unlabeled samples, wherein the labeled samples are image samples marked with real labels;
[0008] Inputting the labeled sample into the image segmentation model to obtain a first segmentation result of the labeled sample; determining a first loss based on the first segmentation result and the true label;
[0009] Inputting the unlabeled sample into the image segmentation model to obtain a second segmentation result of the unlabeled sample; correcting the second segmentation result by a generalist segmentation model to obtain a corrected second segmentation result, wherein the generalist segmentation model has a general image segmentation capability that is not limited to a field; determining a second loss based on the corrected second segmentation result;
[0010] The image segmentation model is trained based on the first loss and the second loss.
[0011] According to another aspect of the present application, a training device for an image segmentation model is provided, the device comprising:
[0012] A sample acquisition module is used to acquire labeled samples and unlabeled samples, wherein the labeled samples are image samples marked with real labels;
[0013] A labeled segmentation module, used for inputting the labeled sample into the image segmentation model to obtain a first segmentation result of the labeled sample; and determining a first loss based on the first segmentation result and the true label;
[0014] The unlabeled segmentation module is used to input the unlabeled sample into the image segmentation model to obtain a second segmentation result of the unlabeled sample; correct the second segmentation result by a generalist segmentation model to obtain a corrected second segmentation result, wherein the generalist segmentation model has a general image segmentation capability that is not limited to a field; and determine a second loss based on the corrected second segmentation result;
[0015] A model training module is used to train the image segmentation model based on the first loss and the second loss.
[0016] According to another aspect of the present application, a computer device is provided, which includes a processor and a memory, wherein the memory stores at least one program, and the at least one program is loaded and executed by the processor to implement the image segmentation model training method as described above.
[0017] According to another aspect of the present application, a computer-readable storage medium is provided, in which at least one program is stored. The at least one program is loaded and executed by a processor to implement the image segmentation model training method as described above.
[0018] According to another aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being 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 training method of the image segmentation model provided in various optional implementations of the above aspects.
[0019] The beneficial effects of the technical solution provided by this application include at least:
[0020] Since the generalist segmentation model has a general image segmentation capability that is not limited to any field, the present application uses the second prediction result of the image segmentation model for the unlabeled sample as prompt information to prompt the generalist segmentation model to generate a corrected second segmentation result. The corrected second segmentation result is used to provide an additional supervisory signal when training the image segmentation model, which can improve the information utilization rate of the unlabeled samples, thereby effectively reducing the number of labeled samples required. The present application can obtain relatively satisfactory training results using a very small number of labeled samples with a low annotation budget. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 is a structural block diagram of an image segmentation system provided by an exemplary embodiment of the present application;
[0023] Figure 2 is a schematic diagram of the principle of a specialist-generalist collaboration process provided by an exemplary embodiment of the present application;
[0024] Figure 3 is a schematic diagram of a training method for an image segmentation model provided by an exemplary embodiment of the present application;
[0025] Figure 4 is a schematic diagram of a training method for an image segmentation model provided by another exemplary embodiment of the present application;
[0026] Figure 5 is a schematic diagram of a training method for an image segmentation model provided by yet another exemplary embodiment of the present application;
[0027] Figure 6 is a schematic diagram of the principle of the expert-model collaboration process provided by an exemplary embodiment of the present application;
[0028] Figure 7 is a schematic diagram of different labels in a pseudo-label correction process provided by an exemplary embodiment of the present application;
[0029] Figure 8 is a performance comparison chart of the image segmentation model of the present application and other image segmentation models;
[0030] Fig. 9 It is a structural schematic diagram of a training device for an image segmentation model provided by an exemplary embodiment of the present application;
[0031] Fig.10 It is a structural diagram of a computer device provided by an exemplary embodiment of the present application.
[0032] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application. DETAILED DESCRIPTION
[0033] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0034] First, the terms involved in this application are introduced.
[0035] Image segmentation: It is a technology that divides each pixel or voxel in an image into a certain semantic classification. For example, each pixel in a two-dimensional image is divided into one of two categories, including foreground category and background category; for another example, each voxel in a three-dimensional medical image is divided into one of two categories, including cardiac category and non-cardiac category. Of course, image segmentation is not limited to binary classification scenarios, but can also be multi-classification scenarios.
[0036] Generalist segmentation model: also known as universal segmentation model, universal basic large model or universal visual large model, is an image segmentation model trained with a large-scale image sample set and has no restrictions on the field of use. Generalist segmentation model is class-agnostic. Class-agnostic means that the generalist segmentation model can accurately segment each segmented part with different semantic classifications in the image without knowing the actual semantic classification of each segmented part in the image.
[0037] Specialist segmentation model: also known as expert segmentation model, is trained with a set of image samples in a specified field and is suitable for image segmentation in a specified field. Specialist segmentation model is relative to generalist segmentation model, and its application field is limited.
[0038] Paradigm: This word has different meanings in different disciplines and contexts, but generally it refers to a widely accepted theoretical framework, methodology, standard or mode of thinking in a field.
[0039] Semi-Supervised Learning (SSL): is a method in machine learning that lies between supervised learning and unsupervised learning. In supervised learning, the model learns from labeled samples, while in unsupervised learning, the model learns from unlabeled samples. Semi-supervised learning combines these two methods, using a small number of labeled samples and a large number of unlabeled samples for training.
[0040] Real Labels: Real labels refer to labels (categories or values) that are correct and accurate for each sample in the dataset. For example, labels annotated by medical experts.
[0041] Pseudo Labels: Pseudo labels are labels used when there are no real labels. They are predictions generated by trained AI models and used as real labels. In some learning scenarios, especially when a large amount of unlabeled data is available, pseudo labels can be used to improve model performance.
[0042] Semi-supervised learning has made significant progress in the field of three-dimensional (3D) medical image segmentation by effectively reducing the tedious and dense annotation requirements of radiologists. Past research on semi-supervised learning has focused on model-centric innovation, that is, developing more advanced and complex semi-supervised learning algorithms. However, with the emergence of open source generalist segmentation models, this application will shift the research on semi-supervised learning to a data-centric perspective, that is, to focus more on how to effectively and efficiently improve the quality of supervision signals through the generalist capabilities of generalist segmentation models, thereby more effectively utilizing the information in unlabeled samples.
[0043] Figure 1 1 is a structural block diagram of an image segmentation system provided by an exemplary embodiment of the present application. The image segmentation system includes: a patient device 110 , a server 120 and a doctor device 130 .
[0044] The patient device 110 has a client installed and running. The client supports uploading images to be segmented, such as 3D medical images. The client exists in the form of an application (Application, APP), a mini program (Mini Program), a web page (Web Page), a web client (Web Client), a cloud client (Cloud Client), etc. In some embodiments, the client is logged in with a user account of the first user. The device types of the patient device 110 include: a smartphone (Smartphone), a tablet computer (Tablet Computer), a virtual reality device (Virtual Reality Device, VRDevice), an augmented reality device (Augmented Reality Device, AR Device), a medical device (MedicalEquipment), an e-book reader (E-Book Reader), an MP3 player (MP3 Player), an MP4 player (MP4Player), a laptop portable computer and a desktop computer. Optionally, in a medical scenario, the patient device 110 is a device used by a patient, or a device used by a radiologist.
[0045] The patient device 110 is connected to the server 120 via a wireless network or a wired network. It should be noted that the number of the above terminals is only used as an example and is not intended to limit the computer system provided in the embodiment of the present application.
[0046] The server 120 includes at least one of a single server, a plurality of servers, a cloud computing platform, and a virtualization center. In some embodiments, the server 120 is used to provide background services for the client, and the server 120 runs the specialist segmentation model 10 after semi-supervised training provided in the present application, and the specialist segmentation model 10 has the image segmentation capability within a specified field. In the present application, the specialist segmentation model 10 is obtained by auxiliary training with the generalist segmentation model 20. Optionally, the server 120 undertakes the main computing work, and the patient device 110 undertakes the secondary computing work; or, the server 120 undertakes the secondary computing work, and the patient device 110 undertakes the main computing work; or, a distributed computing architecture is used between the server 120 and the patient device 110 for collaborative computing.
[0047] The doctor device 130 has a client installed and running. The client supports receiving the segmentation results of the image, such as the segmentation results of the 3D medical image. The client exists in the form of an APP, a mini-program, a web page, a web client, a cloud client, etc. In some embodiments, the client is logged in with a user account of a second user. The device types of the doctor device 130 include: at least one of a smart phone, a tablet computer, a VR device, an AR device, a medical device, an e-book reader, an MP3 player, an MP4 player, a laptop portable computer, and a desktop computer. Optionally, in a medical scenario, the doctor device 130 is a device used by a diagnostic doctor to view the segmentation results of the patient's medical images.
[0048] For example, the expert segmentation model 10 is an image segmentation model in the medical field. The patient uploads the medical image to the server 120 using the patient device 110. The server 120 inputs the medical image into the expert segmentation model 10 to generate a segmentation result of the medical image. The server 120 sends the segmentation result of the medical image to the doctor device 130, so that the diagnosing doctor can view the segmentation result on the doctor device 130.
[0049] It should be noted that Figure 1 The patient device 110 and the doctor device 130 are each one for illustration, but in different embodiments, the patient device 110 and the doctor device 130 can be one or more, and the embodiments of the present application are not limited to this.
[0050] This application proposes a semi-supervised learning paradigm driven by a generalist segmentation model 20, aiming to develop a customized specialist segmentation model 10 using limited annotation resources. Figure 2 , Figure 2 1 is a schematic diagram of the principle of the specialist-generalist collaboration process provided by an exemplary embodiment of the present application. The collaboration framework includes: a specialist segmentation model 10 and a generalist segmentation model 20. Among them:
[0051] The expert segmentation model 10 includes a student model 12 and a teacher model 14. In the training phase, both the student model 12 and the teacher model 14 are used; in the inference phase, only the student model 12 is used. In the related art, the training process of the student model 12 and the teacher model 14 includes the following steps.
[0052] Step 1: Input the labeled sample (x1, y1) into the student model 12 and calculate the first loss; x1 is the image in the labeled sample, y1 is the true label in the labeled sample, and the first loss is the loss between the student segmentation result of the student model 12 and the true label y1.
[0053] Step 2: Input the unlabeled sample x2 into the student model 12 to obtain label 1 (student segmentation result), and input the unlabeled sample x2 into the teacher model 14 to obtain label 2 (teacher segmentation result). Since we hope that the predicted labels of the student model 12 and the teacher model 14 are as equal as possible, the second loss can be calculated based on label 1 and label 2 (pseudo-label); before inputting the unlabeled sample x2 into the teacher model 14, data perturbation can be added to the unlabeled sample x2.
[0054] Step 3: In the current round of iteration, the network parameters of the student model 12 are updated according to the first loss and the second loss.
[0055] Step 4: In the current iteration, after updating the network parameters of the student model 12, the network parameters of the teacher model 14 are updated using the network parameters of the student model 12. For example, the average or weighted average of the network parameters of the student model 12 in at least two iterations (including the current round) is used as the network parameters of the teacher model 14. The update process of the teacher model 14 can adopt an exponential moving average (EMA) mechanism.
[0056] In the above step 4 of the related art, especially in the early stage of training, the accuracy of the label 2 predicted by the teacher model 14 for the unlabeled sample is very low. The embodiment of the present application uses the generalist segmentation model 20 to calibrate the label 2 to obtain a more accurate pseudo label (label 2). The more accurate label 2 is used to provide a more effective supervision signal for the student model 12.
[0057] The generalist segmentation model 20 has the general segmentation capability to predict the segmentation result for images in any field based on the prompt information. In the present application, the label 2 predicted by the teacher model 14 is used as the prompt information of the generalist segmentation model 20, so that the generalist segmentation model 20 can predict a more accurate label 2, that is, a corrected label 2.
[0058] Take the example that the generalist segmentation model 20 has the generalist segmentation capability of two-dimensional images and "labeled samples + unlabeled samples" are three-dimensional images. The introduction of using the generalist segmentation model 20 to correct and obtain a more accurate label 2 is as follows: Exemplarily, the generalist segmentation model 20 includes an image encoder 22, a prompt encoder 24, and a mask decoder 26. Among them, the image encoder 22 is used to perform feature extraction on the input two-dimensional image to obtain an image feature representation; the prompt encoder 24 is used to perform feature extraction on the input prompt information (label 2 before correction) to obtain a prompt feature representation; the mask decoder 26 is used to perform image segmentation on the image feature representation based on the prompt guidance of the prompt feature representation to obtain a more accurate segmentation result.
[0059] However, since the input image of the generalist segmentation model 20 is a two-dimensional image, and the unlabeled sample is a three-dimensional image. Therefore, the unlabeled sample is first sliced according to three perspectives (such as coronal, axial, and sagittal) to obtain multiple slice images corresponding to the three perspectives. Then the generalist segmentation model 20 performs image segmentation on the multiple slice images corresponding to each perspective to obtain a pseudo label at each perspective. The pseudo label at each perspective is obtained from the two-dimensional segmentation information of the multiple slice images corresponding to the perspective. In this way, each voxel in the three-dimensional image will actually obtain three pieces of segmentation information (corresponding to three perspectives respectively). In order to fuse and correct the segmentation information of each voxel at three perspectives into one accurate segmentation information. The embodiment of the present application introduces two possible correction strategies.
[0060] Correction strategy 1: Unanimous Agreement (UA); the unanimous agreement strategy means that for each voxel in the three-dimensional image, only when the three segmentation information of the voxel all believe that the voxel belongs to the first category, the voxel is determined to belong to the first category; otherwise, it belongs to the second category.
[0061] Correction strategy 2: Majority Voting (MV); the majority voting strategy means that for each voxel in the three-dimensional image, when at least two pieces of segmentation information of the voxel both believe that the voxel belongs to the first category, the voxel is determined to belong to the first category; otherwise, it belongs to the second category.
[0062] After the label correction is completed, the label 2 corrected by the generalist segmentation model 20 is obtained. The corrected label 2 is used to calculate the second loss in the above step 4, which can provide a more effective supervision signal.
[0063] Figure 3 is a schematic diagram of a training method for an image segmentation model provided by an exemplary embodiment of the present application. The method is executed by a computer device used by a developer, or Figure 1 The computer device or the server 120 is executed. An image segmentation model is running in the computer device or the server 120. The method includes at least one of the following steps.
[0064] Step 302: Obtain labeled samples and unlabeled samples;
[0065] Labeled samples are image samples labeled with true labels, and unlabeled samples are image samples not labeled with true labels. The true label is the label information used to indicate which category the pixel or voxel in the image belongs to.
[0066] In the field of image segmentation, image samples are two-dimensional images or three-dimensional images. Optionally, for two-dimensional images, the true label is represented by a mask image of the two-dimensional image. For example, when the value of a pixel in the mask image is 1, it means that the pixel at the corresponding position in the two-dimensional image belongs to the first category; when the value of a pixel in the mask image is 0, it means that the pixel at the corresponding position in the two-dimensional image belongs to the second category. For three-dimensional images, the true label can be identified by the mask of the voxels in the three-dimensional image. For example, when the mask value of the voxels in the three-dimensional image is 1, it means that it belongs to the first category; when the mask value of the voxels in the three-dimensional image is 0, it means that it belongs to the second category.
[0067] Among them, the number of labeled samples is less than the number required in related technologies under the condition of low annotation budget cost.
[0068] Step 304: input the labeled sample into the image segmentation model to obtain a first segmentation result of the labeled sample;
[0069] The first segmentation result is the segmentation result predicted by the image segmentation model. The first segmentation result is used to predict which category the pixel or voxel in the labeled sample belongs to, and can also be called a predicted segmentation result.
[0070] The image segmentation model can be implemented using any neural network architecture with image segmentation capabilities. For example, the image segmentation model can use any one of the following: convolutional neural network, V-Net, Fully Convolutional Networks for Semantic Segmentation (FCN), Convolutional Networks for Biomedical Image Segmentation (U-net), Deep Convolutional Network, Semantic Image Segmentation with Deep Convolutional Nets, Atrous Convolution, and Fully Connected CRFs, DeepLab, Densely Connected Convolutional Networks (DenseNet), and Residual Networks (ResNet).
[0071] This embodiment uses the image segmentation model V-Net as an example. The characteristic of V-Net is that it combines the ideas of 3D convolutional neural network and fully convolutional network (FCN) to achieve accurate image segmentation through encoder-decoder architecture. This design helps to capture deeper spatial relationships in the image, thereby improving the accuracy of segmentation. V-Net has shown good performance in medical image segmentation tasks and is therefore widely used in the medical field.
[0072] Step 306: Determine a first loss based on the first segmentation result and the true label;
[0073] There is an error between the first segmentation result and the true label, and a first loss is determined based on the error between the first segmentation result and the true label. That is, the first loss is used to indicate the error between the first segmentation result predicted by the image segmentation model and the true label.
[0074] Step 308: input the unlabeled sample into the image segmentation model to obtain a second segmentation result of the unlabeled sample; correct the second segmentation result by the generalist segmentation model to obtain a corrected second segmentation result;
[0075] The second segmentation result is the segmentation result predicted by the image segmentation model. The second segmentation result is used to predict which category the voxels in the unlabeled sample belong to, and can also be called a predicted segmentation result. In the early stages of training, the accuracy of the second segmentation result is poor.
[0076] A generalist segmentation model is a pre-trained (also called frozen) domain-free segmentation model in the related art. A generalist segmentation model is class-agnostic. Class-agnostic means that a generalist segmentation model can accurately segment each segmented part of an image without knowing the specific semantics of each segmented part in the image. A generalist segmentation model is usually trained using a large-scale image dataset.
[0077] The generalist segmentation model can accurately segment the image under the guidance of the prompt information. By utilizing this ability of the generalist segmentation model and taking the second segmentation result as the guiding information, the generalist segmentation model is used to perform image segmentation on the unlabeled sample, and the corrected second segmentation result can be obtained.
[0078] It should be noted that the labeled samples can also be used as unlabeled samples to perform the training process of step 308 and step 310.
[0079] Step 310: Using the corrected second segmentation result as a pseudo label of the unlabeled sample, and determining a second loss;
[0080] The corrected second segmentation result has a higher accuracy, and the second loss of the unlabeled sample is determined based on the corrected second segmentation result as a pseudo label of the unlabeled sample.
[0081] Optionally, a semi-supervised learning method is used to determine a second loss of the unlabeled sample using the corrected second segmentation result as a pseudo label. The second loss is used to indicate the error between the segmentation result predicted by the image segmentation model for the unlabeled sample and the pseudo label.
[0082] Step 312: Based on the first loss and the second loss, train an image segmentation model.
[0083] The first loss is the loss of labeled samples, and the second loss is the loss of unlabeled samples. Based on the first loss and the second loss, the image segmentation model is trained using a semi-supervised learning method.
[0084] In summary, the method provided in the embodiment of the present application, since the generalist segmentation model has a general image segmentation capability that is not limited to a field, by using the second prediction result of the image segmentation model for the unlabeled sample as prompt information, prompting the generalist segmentation model to generate a corrected second segmentation result, and using the corrected second segmentation result to provide an additional supervisory signal when training the image segmentation model, can improve the utilization rate of information in the unlabeled sample, thereby effectively reducing the number of labeled samples required. The present application can obtain relatively satisfactory training results using a very small number of labeled samples with a low annotation budget.
[0085] Correction of pseudo labels:
[0086] The image segmentation model to be trained in the embodiment of the present application is a segmentation model dedicated to a certain application field, which is called a specialist segmentation model 10. For example, the specialist segmentation model 10 is applied in the medical field. The generalist segmentation model 20 is a pre-trained segmentation model in the related art that is not limited to a field.
[0087] The embodiment of the present application adopts the collaboration of the specialist segmentation model 10 and the generalist segmentation model 20, and uses the image segmentation capability of the generalist segmentation model 20 to provide an additional supervisory signal to the specialist segmentation model 10. Since the generalist segmentation model 20 can accurately segment the image under the guidance of the prompt information. Utilizing this capability of the generalist segmentation model 20, using the unlabeled sample as the image to be segmented, and the second segmentation result as the prompt information, the generalist segmentation model 20 generates a corrected second segmentation result. Since the generalist segmentation model 20 has a general image segmentation capability that is not limited to a field, using the second segmentation result as the prompt information, the existing segmentation capability of the generalist segmentation model 20 can be used to correct a more accurate second segmentation result, thereby being able to extract more effective information of the unlabeled sample and provide an additional supervisory signal.
[0088] The generalist segmentation model 20 may be an image segmentation model that has a generalist segmentation capability for two-dimensional images, or may be an image segmentation model that has a generalist segmentation capability for three-dimensional images.
[0089] In some embodiments, the unlabeled sample is a two-dimensional image, the specialist segmentation model is a segmentation model for two-dimensional images in a specified field, and the generalist segmentation model is a segmentation model for two-dimensional images in a general field. The unlabeled sample is used as the image to be segmented, and the second segmentation result is used as the prompt information. The segmentation result predicted by the generalist segmentation model is the corrected second segmentation result.
[0090] In some embodiments, the unlabeled sample is a three-dimensional image, the specialist segmentation model is a segmentation model for three-dimensional images in a specified field, and the generalist segmentation model is a segmentation model for three-dimensional images in a general field. The unlabeled sample is used as the image to be segmented, and the second segmentation result is used as the prompt information. The segmentation result predicted by the generalist segmentation model is the corrected second segmentation result.
[0091] In some embodiments, the unlabeled sample is a three-dimensional image, the image segmentation model is a segmentation model of a three-dimensional image, and the generalist segmentation model is a segmentation model of a two-dimensional image. Figure 4 As shown, Figure 4 It is a schematic diagram of a training method of an image segmentation model provided by another exemplary embodiment of the present application. The above step of "correcting the second segmentation result by a generalist segmentation model to obtain a corrected second segmentation result" may include at least one of the following sub-steps.
[0092] Step 402: extracting multiple slice images of three viewing angles from the unlabeled sample, where the three viewing angles correspond to three coordinate planes of the three-dimensional image;
[0093] The three perspectives correspond to the three coordinate planes of the three-dimensional image. Taking the three-dimensional image as a medical three-dimensional image as an example, the three perspectives are the coronal perspective, the axial perspective, and the sagittal perspective.
[0094] The three-dimensional image is cut into multiple two-dimensional slice images according to each viewing angle. That is, the three-dimensional image is cut into multiple slice images according to the coronal viewing angle; the three-dimensional image is cut into multiple slice images according to the axial viewing angle; and the three-dimensional image is cut into multiple slice images according to the sagittal viewing angle.
[0095] Step 404: using the multiple slice images of the three perspectives as the images to be segmented and the second segmentation result as the prompt information, predicting pseudo labels on the three perspectives through the generalist segmentation model, wherein the pseudo label on each perspective includes the two-dimensional segmentation results of the multiple slice images belonging to the same perspective;
[0096] Since the generalist segmentation model is a segmentation model for two-dimensional images, the i-th slice image of each viewing angle is used as the image to be segmented, and the prediction result (two-dimensional pixel level) of the i-th slice image of the current viewing angle in the second segmentation result (three-dimensional voxel level) is used as prompt information. Among them, voxel is the basic element in three-dimensional images, and pixel is the basic element in two-dimensional images. In the embodiment of the present application, voxel and pixel can be considered to be the same concept, but with different names for three-dimensional images and two-dimensional images.
[0097] The image to be segmented and the prompt information are input into the general segmentation model to predict the pseudo label at the current view. The pseudo label at the current view is used to indicate the two-dimensional segmentation result (pixel level) of the key slice image at the current view.
[0098] In some embodiments, step 404 includes at least one of the following sub-steps.
[0099] Sub-step 1: based on the second segmentation result, determining the two-dimensional segmentation information of each slice image of three viewing angles, where the three viewing angles include a first viewing angle, a second viewing angle, and a third viewing angle;
[0100] For example, in the medical field, the three perspectives include coronal perspective, axial perspective, and sagittal perspective.
[0101] The two-dimensional segmentation information may be point prompt information, frame prompt information or mask prompt information. The two-dimensional segmentation information is pixel-level prompt information.
[0102] The second segmentation result is a 3D segmentation result, including a prediction result of which category each voxel in the 3D image belongs to. Assuming that the resolution of the 3D image is H×W×D, the three perspectives can be split into H slice images, W slice images, and D slice images, respectively.
[0103] Due to the limited supervisory signals in the early stage of training, the accuracy of the second segmentation result is not high. In some embodiments, random noise can also be added to the two-dimensional segmentation information. For example, the two-dimensional segmentation information is a frame-shaped prompt information, and a random disturbance of 0-10 pixels is added to the frame-shaped prompt information. The random disturbance refers to enlarging or reducing the segmentation frame by x pixels, where x is a random number between 0 and 10.
[0104] This embodiment adds data perturbations so that the student model can learn more data changes, thereby improving its generalization ability and reducing the risk of overfitting. At the same time, data perturbations can simulate different real situations, such as different patients, collection environments, lighting, angles, noise, etc., so that the model can better handle the diversity in practical applications.
[0105] Sub-step 2: using the plurality of slice images of the first perspective as the images to be segmented, and using the two-dimensional segmentation information of the plurality of slice images of the first perspective as the prompt information, and predicting the pseudo labels of the first perspective through the generalist segmentation model;
[0106] Exemplarily, the i-th slice image of the first perspective is used as the image to be segmented, and the two-dimensional segmentation information of the i-th slice image of the first perspective is used as the prompt information, and the two-dimensional segmentation result of the i-th slice image of the first perspective is predicted by the generalist segmentation model. Among them, the starting value of i is 1 and the maximum value is H. When i is not equal to H, i is updated to i+1, and the above steps are repeated until the two-dimensional segmentation results of the generalist segmentation model for H slice images under the first perspective are obtained, which are summarized as pseudo labels under the first perspective.
[0107] Sub-step 3: using the plurality of slice images of the second perspective as the images to be segmented, and using the two-dimensional segmentation information of the plurality of slice images of the second perspective as the prompt information, and predicting the pseudo labels under the second perspective through the generalist segmentation model;
[0108] Exemplarily, the j-th slice image of the second perspective is used as the image to be segmented, and the two-dimensional segmentation information of the j-th slice image of the second perspective is used as the prompt information, and the two-dimensional segmentation result of the j-th slice image of the second perspective is predicted by the generalist segmentation model. Among them, the starting value of j is 1 and the maximum value is W. When j is not equal to W, j is updated to j+1, and the above steps are repeated until the two-dimensional segmentation results of the W slice images under the second perspective by the generalist segmentation model are obtained, which are summarized as pseudo labels under the second perspective.
[0109] Sub-step 4: using the plurality of slice images of the third perspective as the images to be segmented, and using the two-dimensional segmentation information of the plurality of slice images of the third perspective as the prompt information, and predicting the pseudo labels of the third perspective through the generalist segmentation model;
[0110] Exemplarily, the kth slice image of the third perspective is used as the image to be segmented, and the two-dimensional segmentation information of the kth slice image of the third perspective is used as the prompt information, and the two-dimensional segmentation result of the kth slice image of the third perspective is predicted by the generalist segmentation model. Among them, the starting value of j is 1 and the maximum value is D. When k is not equal to D, k is updated to k+1, and the above steps are repeated until the two-dimensional segmentation results of the generalist segmentation model for W slice images under the third perspective are obtained, which are summarized as pseudo labels under the third perspective.
[0111] Since the generalist segmentation models in current technology are basically image segmentation models for 2D images, the above method can apply the general image segmentation capability of the generalist segmentation model that supports 2D to the pseudo-label correction process of 3D unlabeled samples, thereby realizing the utilization of capabilities across image formats.
[0112] Step 406: Adopt a correction strategy to fuse the pseudo labels at three perspectives to generate a corrected second segmentation result.
[0113] Correction strategies include, but are not limited to: any one of the unanimous agreement strategy and the majority rule strategy.
[0114] Taking the image segmentation model as a binary classification model segmentation as an example, the unanimous agreement strategy means: for any voxel in the unlabeled sample, if the pseudo labels at the three perspectives all believe that the voxel belongs to the first category, the voxel is determined to belong to the first category; if at least one of the pseudo labels at the three perspectives believes that the voxel does not belong to the first category, the voxel is determined to belong to the second category. Based on the classification results of each voxel in the unlabeled sample, a corrected second segmentation result is generated.
[0115] Taking the first category as foreground and the second category as background as an example, if for any voxel in the unlabeled sample, the pseudo-labels at three perspectives all consider that the voxel belongs to the foreground, the voxel is determined to belong to the foreground; if at least one pseudo-label at the three perspectives considers that the voxel belongs to the background, the voxel is determined to belong to the background.
[0116] In the process of correcting sample labels, the unanimous agreement strategy can ensure accuracy and reduce wrong decisions. Since all views are required to reach a consensus on the correction of the same voxel, it helps to ensure the accuracy of the correction process and avoid correction errors caused by bias or errors in a certain view.
[0117] The minority obeys majority strategy means that for any voxel in the unlabeled sample, if the pseudo labels at least two viewing angles believe that the voxel belongs to the first category, the voxel is determined to belong to the first category; if the pseudo labels at least two viewing angles believe that the voxel belongs to the second category, the voxel is determined to belong to the second category. Based on the classification results of each voxel in the unlabeled sample, a corrected second segmentation result is generated.
[0118] Taking the first category as foreground and the second category as background as an example, if for any voxel in the unlabeled sample, there are at least two pseudo-labels from both perspectives that believe that the voxel belongs to the foreground, the voxel is determined to belong to the foreground; if there are at least two pseudo-labels from both perspectives that believe that the voxel belongs to the background, the voxel is determined to belong to the background.
[0119] In the process of correcting sample labels, the minority obeys the majority strategy allows for quick decision making, that is, if two perspectives reach a consensus, there is no need to look at the pseudo labels of the third perspective. Since the number of voxels in each 3D image is very large, the minority obeys the majority strategy can significantly reduce the amount of calculation when correcting all voxels in the entire 3D image, improving the efficiency of the correction process.
[0120] Student model and teacher model:
[0121] In some embodiments, the image segmentation model includes a student model and a teacher model. In the training phase, the student model needs to be trained in conjunction with the teacher model; in the inference phase, only the student model is needed to complete image segmentation. Figure 5 is a schematic diagram of a training method for an image segmentation model provided by another exemplary embodiment of the present application. The method is executed by a computer device used by a developer, or Figure 1 The computer device or server 120 is executed. An image segmentation model is running in the computer device or server 120. The method includes:
[0122] Step 502: Obtain labeled samples and unlabeled samples;
[0123] Labeled samples are image samples labeled with true labels, and unlabeled samples are image samples not labeled with true labels. The true label is the label information used to indicate which category the pixel or voxel in the image belongs to.
[0124] In the field of image segmentation, image samples are two-dimensional images or three-dimensional images. Optionally, for two-dimensional images, the true label can be represented by a mask image of the two-dimensional image. For example, when the pixel value in the mask image is 1, it represents the first category; when the pixel value in the mask image is 0, it represents the second category. For three-dimensional images, the true label can be identified by the mask of the voxels in the three-dimensional image. For example, when the mask value of the voxels in the three-dimensional image is 1, it represents the first category; when the mask value of the voxels in the three-dimensional image is 0, it represents the second category.
[0125] Among them, the number of labeled samples is less than the number required in related technologies under the condition of low annotation budget cost.
[0126] Step 504: input the labeled sample into the student model to obtain the first segmentation result of the labeled sample;
[0127] The first segmentation result is the segmentation result predicted by the student model. The first segmentation result is used to predict which category the pixel or voxel in the labeled sample belongs to, and can also be called the predicted segmentation result.
[0128] Step 506: Determine a first loss of the student model based on the first segmentation result and the true label;
[0129] There is an error between the first segmentation result and the true label, and a first loss is determined based on the error between the first segmentation result and the true label.
[0130] The first loss is used to indicate the error between the first segmentation result predicted by the student model and the true label. The first loss provides the input data and its corresponding correct output, which is the key information for the semi-supervised learning algorithm to enable the student model to learn the most basic expert segmentation ability.
[0131] Step 508: inputting the unlabeled samples into the student model and the teacher model respectively to obtain a second segmentation result, the second segmentation result including the teacher segmentation result predicted by the teacher model and the student segmentation result predicted by the student model; correcting the teacher segmentation result by the generalist segmentation model to obtain a corrected teacher segmentation result;
[0132] The second segmentation result is a segmentation result predicted by the image segmentation model for the unlabeled sample. In the case where the image segmentation model includes a teacher model and a student model, the second segmentation result includes a teacher segmentation result predicted by the teacher model and a student segmentation result predicted by the student model.
[0133] A generalist segmentation model is a pre-trained (also called frozen) domain-free segmentation model in the related art. A generalist segmentation model is class-agnostic. Class-agnostic means that a generalist segmentation model can accurately segment each segmented part of an image without knowing the specific semantics of each segmented part in the image. A generalist segmentation model is usually trained using a large-scale image dataset.
[0134] The generalist segmentation model can accurately segment the input image under the guidance of the prompt information. By using this ability of the generalist segmentation model and taking the teacher's prediction results as the guiding information, the generalist segmentation model is used to perform image segmentation on unlabeled samples, and the corrected teacher segmentation results can be obtained.
[0135] Step 510: Determine a second loss of the student model based on the corrected teacher segmentation result and the student segmentation result;
[0136] The corrected teacher segmentation result has a higher accuracy, and the second loss of the unlabeled sample is determined based on the corrected teacher segmentation result. Optionally, the second loss of the student model is determined based on the corrected teacher segmentation result and the student prediction result. For example, the calibrated teacher segmentation result is used as a pseudo label, the difference between the student segmentation result and the corrected teacher segmentation result is calculated, and the second loss of the student model is determined.
[0137] When labeled samples are scarce, using unlabeled samples together with labeled samples can significantly improve the performance of the student model, while enhancing the diversity of training samples to improve the generalization ability of the student model.
[0138] In some embodiments, this step includes the following sub-steps:
[0139] Step (1): Calculate the pseudo-label loss based on the student segmentation result and the corrected teacher segmentation result;
[0140] Optionally, the Dice loss between the student segmentation result and the corrected teacher segmentation result is calculated as the pseudo-label loss. The Dice coefficient, named after Lee Raymond Dice, is a set similarity metric function that is usually used to calculate the similarity of two samples (value range [0, 1]).
[0141]
[0142] Among them, |X∩Y| represents the intersection of X and Y sets, |X| and |Y| represent the number of elements, and for the segmentation task, |X| and |Y| represent the corrected teacher segmentation result and student segmentation result of the segmentation. Based on the Dice coefficient, the formula of Dice Loss can be obtained:
[0143]
[0144] Optionally, an enhanced Dice loss between the student segmentation result and the corrected teacher segmentation result is calculated as the pseudo label loss. The enhanced Dice loss is a noise-tolerant Dice loss.
[0145] Step (2): Calculate the consistency loss based on the student segmentation results and the teacher segmentation results;
[0146] Step (3): The weighted sum of the pseudo-label loss and the consistency loss is determined as the second loss.
[0147] Optionally, a first product of the first weight and the pseudo-label loss, and a second product of the second weight and the consistency loss are calculated; and the sum of the first product and the second product is determined as the second loss.
[0148] The second loss is calculated using pseudo-label loss and consistency loss, which can use the additional supervision provided by pseudo-label loss, and can also use consistency loss to help the student model learn a representation consistent with the teacher model, thereby improving the generalization ability of the student model. In other words, it can provide supervision signals for unlabeled samples from two training perspectives at the same time, promoting the training effect of the student model.
[0149] Since the teacher segmentation results are not very accurate in the early stages of training, the training process relies more on pseudo-label loss, which can provide effective early supervision. However, excessive reliance on these noisy labels in the subsequent training process may mislead the student model due to memory effects. In addition, since the student model in the early stages of noisy training has difficulty perceiving objects, the stability constraint of consistency loss is relatively meaningless. Therefore, in an optional design, a weight related to training time is introduced to adjust the importance of the two losses during collaborative training, so that different stages can refer to the most effective loss to provide supervision signals for training.
[0150] Based on the current number of training times and the maximum number of training times in the training process, the first weight and the second weight are determined. Exemplarily, assuming that the ratio between the current number of training times and the maximum number of training times is the proportion of trained times, the first weight is negatively correlated with the proportion of trained times, that is, the larger the proportion of trained times, the smaller the first weight; the second weight is positively correlated with the proportion of trained times, that is, the larger the proportion of trained times, the larger the second weight.
[0151] Step 512: Based on the first loss and the second loss, update the network parameters of the student model in the i-th round of training;
[0152] The training process usually includes multiple rounds of training. With the goal of reducing the first loss and the second loss, the network parameters of the student model in the i-th round of training are updated, where i is an integer and the starting value of i is 0 or 1.
[0153] Step 514: Update the network parameters of the teacher model based on the network parameters of the student model before the i-th round of training and the network parameters of the i-th round of training.
[0154] Optionally, the teacher-student model is a standard SSL design based on consistency regularization. The student model is trained by the error back-propagation algorithm, and the teacher model is updated based on the exponential moving average (EMA) by the student model's past network parameters and the current network parameters.
[0155] The network parameters before the i-th round of training may be network parameters of at least one round of historical training. For example, the network parameters of the student model in the previous round of training and the network parameters of the current round of training are summed according to the weights to obtain the network parameters of the teacher model.
[0156] Active learning (actively selecting labeled samples):
[0157] In traditional semi-supervised learning, a portion of unlabeled samples are randomly selected and labeled by labelers to obtain labeled samples. However, the random selection method may not necessarily select the samples most needed by the image segmentation model, and it is easy to cause redundant noise annotations. In order to make better use of the precious annotation budget, active sample selection is used in the implementation example. In each round of training, each unlabeled sample is scored by the student model, and then the unlabeled samples with higher scores are selected for annotation to obtain labeled samples. This process is repeated until the annotation budget is exhausted.
[0158] Actively selecting sample labels can make more efficient use of limited annotation resources. On the one hand, by selecting the most valuable samples for annotation, learning the samples that have the greatest improvement on the current student model can improve the performance of the student model more quickly. In the case of high annotation costs, active learning can reduce the number of samples that need to be labeled, thereby saving costs.
[0159] In the embodiment using the above active learning, the above method further includes: selecting samples to be labeled from the unlabeled samples based on the second segmentation results of the unlabeled samples in the i-th round of training; obtaining the real labels labeled for the samples to be labeled, obtaining the labeled samples actively selected and generated in the i-th round of training, and adding the labeled samples to the labeled sample set used in the i+1-th round of training. The process of labeling the samples to be labeled as labeled samples can be completed manually by a person with professional skills.
[0160] Exemplarily, based on the second segmentation result of the unlabeled samples in the i-th round of training, the unlabeled samples that meet the preset conditions are selected as samples to be labeled; wherein the unlabeled samples that meet the preset conditions include at least one of the following.
[0161] (i) The first K1 unlabeled samples sorted from low to high according to the confidence of the second segmentation result;
[0162] For each unlabeled sample, the confidence of the second segmentation result of the unlabeled sample is used as the active score, and the first K1 unlabeled samples sorted from low to high are actively selected samples to be labeled. Since the samples with lower confidence are the samples that the current model cannot accurately predict, selecting these samples for learning can enable the current model to quickly improve its performance.
[0163] (ii) the first K2 unlabeled samples sorted from high to low according to the average predicted entropy of the second segmentation result, where the average predicted entropy is the average entropy of all voxels in the second segmentation result;
[0164] For each unlabeled sample, the average predicted entropy of the second segmentation result of the unlabeled sample is used as the active score, and the first K2 unlabeled samples sorted from high to low are actively selected samples to be labeled.
[0165] Each voxel has its own corresponding prediction probability, representing whether it belongs to the first category. The average prediction entropy represents the uncertainty of the second segmentation result. Selecting samples with higher average prediction entropy can select samples with higher uncertainty, so that the current model can quickly improve its performance.
[0166] (iii) the first K3 unlabeled samples sorted from high to low according to the entropy ratio of the second segmentation result, where the entropy ratio is the ratio of voxels exceeding the probability threshold to all voxels in the second segmentation result;
[0167] For each unlabeled sample, the entropy ratio of the second segmentation result of the unlabeled sample is used as the active score, and the first K3 unlabeled samples sorted from high to low are actively selected samples to be labeled. Compared with the average predicted entropy, the highest entropy ratio can more clearly reflect the distribution of high uncertainty in the image, which is conducive to selecting samples with high uncertainty distribution and then marking them as labeled samples, so that the current model can quickly improve its performance.
[0168] Among them, K1, K2 and K3 are all positive integers.
[0169] Combined with reference Figure 6 , Figure 6 This is a schematic diagram of the principle of the expert-model collaboration process provided by an exemplary embodiment of the present application. After the i-th round of training, the student prediction results based on the student model prediction. The active score of each unlabeled sample is calculated by the active learning function. The unlabeled samples with the top K active scores are selected as the samples to be labeled. Then, experts in related fields are consulted, and the experts perform labeling on the actively selected unlabeled samples.
[0170] Cross-labeling strategy:
[0171] In some embodiments, the labeled samples are three-dimensional images. When traditional annotation methods perform annotation on three-dimensional images, it is necessary to perform annotation on each voxel in the three-dimensional image, which is a very large workload. Therefore, an embodiment of the present application also provides a annotation method that reduces the annotation workload. That is, the real labels of the labeled samples in the embodiments of the present application can be annotated using a cross-labeling strategy. The cross-labeling strategy is a annotation strategy that separately marks the two-dimensional segmentation information of the key slice images of the three perspectives in the three-dimensional image; wherein the key slice image of each perspective is a slice image among multiple slice images belonging to the current perspective.
[0172] Optionally, if the multiple slice images under a viewing angle are n1 slice images, and n1 is an odd number, then the key slice image under the viewing angle is the slice image located in the middle, that is, the (n1+1) / 2th slice image; if the multiple slice images under a viewing angle are n2 slice images, and n2 is an even number, then the key slice image under the viewing angle is the slice image located in the middle, that is, the n2 / 2th slice image or the (n2 / 2)+1th slice image.
[0173] Continue to combine references Figure 6 , taking the 3D image as a medical image as an example, a coronal key slice is selected from multiple slice images of the coronal view of the 3D image; an axial key slice is selected from multiple slice images of the axial view of the 3D image; and a sagittal key slice is selected from multiple slice images of the sagittal view of the 3D image. Medical experts perform annotation for the three slice images of the coronal key slice, the axial key slice, and the sagittal key slice as the true label of the 3D image after cross-annotation.
[0174] Since the number of voxels in a 3D image is very large, reaching H×D×W. Compared with the solution of labeling all voxels, the number of voxels required to be labeled for a 3D image in this application is: H×D+H×W+D×W, which reduces the workload by 1-2 orders of magnitude, can greatly reduce the labeling workload, and make better use of the limited labeling budget to achieve a training effect similar to that of labeling all voxels.
[0175] Image segmentation is an important technology in the field of computer vision and an important part of image understanding. The training method of the above image segmentation model can be applied to image segmentation scenarios of two-dimensional images and three-dimensional images. At the same time, image segmentation can be applied in medical image analysis, security monitoring, unmanned driving systems, agricultural intelligence, face recognition, video editing, enhanced display, retail image recognition, iris recognition, machine vision and other fields. The following uses the application of image segmentation in 3D medical imaging, the medical segmentation model as a segmentation model for three-dimensional images, and the generalist segmentation model as a segmentation model for two-dimensional images as an example for exemplary explanation.
[0176] Problem definition:
[0177] Traditional SSL usually involves learning from a training dataset Randomly pre-select one A subset of unlabeled samples is densely labeled, and then the labeled subset is used ( labeled samples) and unlabeled subsets ( The superscript l represents labeled samples, and the superscript u represents unlabeled samples. This embodiment explores a new active sparse supervised learning setting, emphasizing more effective use of the limited annotation budget. Unlike traditional SSL, the active sparse supervised learning in this embodiment combines the human in the loop paradigm to select high-value samples that the model wants to annotate during training, and adopts an efficient cross-annotation strategy.
[0178] Specifically, in the In the round of active learning, this embodiment has a cross-labeled subset ,Include The labeled samples after cross-labeling, and the rest are unlabeled subsets ,Include There are unlabeled samples, cl represents cross-labeling, and u represents no labeling. Indicates high ,width and depth 3D images, express The cross labels of (this example focuses on two-class segmentation).
[0179] Before training, this embodiment randomly selects a small number of unlabeled samples to perform cross-labeling to warm up the medical segmentation model, thereby constructing As a starting point, the goal of this example is to learn an accurate medical segmentation model using actively cross-labeled labeled and unlabeled samples by optimizing the following loss function:
[0180]
[0181] in, express The supervised loss of labeled samples in (also known as the first loss), represents the auxiliary loss (i.e., the second loss) from all samples. For the first loss , this embodiment adopts the partial cross entropy loss on each voxel in the true label. This embodiment adopts the above two data center strategies: specialist-generalist collaboration and expert-model collaboration.
[0182] The training process of the medical segmentation model includes at least one of the following steps.
[0183] Step 1: Obtain a large number of unlabeled medical samples in 3D image format;
[0184] Taking radiology medical images as an example, there are a large number of computed tomography (CT) images or magnetic resonance imaging (MRI) images without real labels. The medical images are in three-dimensional image format. Each medical sample includes H×W×D voxels.
[0185] Step 2: In the first round of iteration, a small number of unlabeled medical samples are randomly selected for labeling to obtain labeled medical samples;
[0186] In the first round of iteration, a small number of unlabeled medical samples are randomly selected and annotated by medical experts to obtain labeled medical samples.
[0187] Since each medical sample includes H×W×D voxels, if each voxel is labeled with the segmentation probability (the probability of belonging to the first category, ranging from 0% to 100%), the labeling workload of medical experts will be very huge. Therefore, this embodiment adopts a cross-labeling strategy.
[0188] A three-dimensional medical image can be viewed as a stacked structure of multiple two-dimensional images. The cross-labeling strategy is a labeling strategy for marking two-dimensional segmentation information for key slice images of three perspectives in a three-dimensional image format. Among them, the key slice image of each perspective is one slice image among multiple slice images belonging to the current perspective. That is, it is only necessary to label the two-dimensional segmentation information of one slice image among multiple slice images of each perspective, and there is no need to perform labeling on each slice image. The two-dimensional segmentation information includes the segmentation probability of whether each pixel (or voxel) in the slice image belongs to the first category.
[0189] At this time, there are a small number of labeled medical samples and a large number of unlabeled medical samples.
[0190] Step 3: Input the labeled medical sample into the student model to obtain the first segmentation result of the labeled medical sample;
[0191] The first segmentation result includes a segmentation probability predicted for each voxel in the labeled medical sample, and the segmentation probability is used to indicate the probability that the current voxel belongs to the first category. Optionally, the first category is a certain medical organ or lesion, such as a heart region, a lung region, etc.
[0192] The labeled medical samples are input into the student model, and the student model predicts the first segmentation result of the labeled medical samples.
[0193] Step 4: Determine the first loss of the student model based on the first segmentation result and the true label;
[0194] Since the true labels only include the segmentation probabilities of each voxel on the key slice images of three perspectives, and the first segmentation result includes the predicted segmentation probabilities for all voxels in the labeled medical sample, when calculating the first loss, only the cross entropy loss of each voxel on the key slice images of the three perspectives can be considered, without considering all voxels.
[0195] That is, for each voxel on the key slice images of the three perspectives, the cross entropy loss between the segmentation probability of each voxel in the true label and the segmentation probability in the first segmentation result is calculated as the first loss of the student model.
[0196] Step 5: at least input the unlabeled medical sample into the student model and the teacher model respectively to obtain a second segmentation result, the second segmentation result including the teacher segmentation result predicted by the teacher model and the student segmentation result predicted by the student model; correct the teacher segmentation result by the generalist segmentation model to obtain a corrected teacher segmentation result;
[0197] When determining the second loss, at least inputting the unlabeled medical samples into the student model and the teacher model respectively means: for any one of the unlabeled medical samples, inputting the student model and the teacher model respectively, or, for any one of the unlabeled medical samples and the labeled medical samples, inputting the student model and the teacher model respectively.
[0198] Before inputting the unlabeled / labeled medical samples into the teacher model, data perturbation may be added to the medical samples, including but not limited to Gaussian noise and random contrast adjustment.
[0199] In the case where the medical segmentation model includes a teacher model and a student model, the second segmentation result includes a teacher segmentation result predicted by the teacher model and a student segmentation result predicted by the student model.
[0200] The generalist segmentation model can accurately segment the input image under the guidance of the prompt information. By using this ability of the generalist segmentation model and taking the teacher segmentation result as the guidance information, the generalist segmentation model is used to perform image segmentation on unlabeled medical samples, and the corrected teacher segmentation result can be obtained.
[0201] Exemplarily, unlabeled medical samples are fed into the teacher model to obtain the teacher segmentation results Considering the difficulty of 2D generalist segmentation models in providing accurate pseudo-labels and lack of 3D perception, this embodiment inherits the spirit of cross-labeling and uses the teacher segmentation results from three different perspectives. To generate a hint box for each 2D slice image (determined based on the segmentation probability of each voxel) to sparsely hint the frozen 2D generalist segmentation model layer by layer, thus generating three 3D pseudo labels at three viewing angles ( , and ),in Represents the crown, Indicates the axial direction, Indicates sagittal.
[0202] Considering the teacher segmentation result due to limited supervision signals To avoid inaccuracies in the example, this embodiment applies a moderate random expansion (0-10 pixels) to the prompt box. Figure 7 As shown, Figure 7 : This is a schematic diagram of different labels in the pseudo-label correction process provided by an exemplary embodiment of the present application. The gray area is the real left atrium area, the blank area is the left atrium area predicted by each label, and the pseudo-labels from three perspectives (coronal + axial + sagittal) are noisy and significantly different, but they overlap in some areas. Therefore, this embodiment combines the pseudo-labels of each perspective and introduces two label calibration strategies: unanimous agreement and minority obeys majority.
[0203] Unanimous agreement: Only when the pseudo-labels of all views reach a consensus on the segmentation classification of a voxel will it be included in the final pseudo-label, e.g. Figure 7 The correction strategy in 1 is shown.
[0204] The minority obeys the majority. When the pseudo-labels from at least two perspectives reach a consensus on the segmentation classification of a voxel, they are included in the final pseudo-label, such as Figure 7 The correction strategy in 2 is shown.
[0205] In this way, the final corrected pseudo-label is obtained in this embodiment. It should be noted that since the general segmentation model has a low reasoning efficiency for 3D images, it is not necessary to update the pseudo labels frequently. , but strategically update the pseudo-label every 1000 iterations (or other number of iterations) , balancing its practicality and computing needs.
[0206] Step 6: Based on the corrected teacher segmentation results and student segmentation results, determine the second loss of the student model;
[0207] Considering the corrected pseudo-labels Due to the unavoidable nature of noise, this embodiment further introduces a noise-tolerant Dice loss to mitigate the adverse effects of label noise. The formula is:
[0208]
[0209] in, is the student segmentation result, that is, the student model for voxels The predicted probability, the corrected pseudo label Convert to a one-hot representation. Optionally, and When , the Dice loss is more robust to label noise. Note that when When , this loss degenerates into the typical Dice loss. This noise-tolerant Dice loss can provide effective early supervision, however, over-reliance on these corrected pseudo-labels in the later training stages may mislead the student model due to memory effects.
[0210] As for the consistency loss , the student model has difficulty perceiving objects in the early stages, making this stability constraint relatively meaningless. Therefore, this embodiment introduces a first weight related to the training time and the second weight , to regulate the importance of the first and second losses during collaborative training.
[0211] Specifically, the first weight and the second weight .
[0212] in, and Represent the current iteration number and the maximum iteration number respectively. Therefore, the second loss The calculation formula is:
[0213]
[0214] Step 7: Based on the first loss and the second loss, update the network parameters of the student model trained in round i;
[0215] The training process usually includes multiple rounds of training. With the goal of reducing the first loss and the second loss, the network parameters of the student model in the i-th round of training are updated, where i is an integer and the starting value of i is 0 or 1.
[0216] Step 8: Update the network parameters of the teacher model based on the network parameters of the student model before the i-th round of training and the network parameters of the i-th round of training.
[0217] Optionally, the teacher-student model is based on the standard SSL design with consistency regularization. Specifically, the network parameters of the trainable student model are The network parameters of the teacher model are optimized by the standard error back propagation algorithm. The exponential moving average (EMA) of the student model is updated in the past and current iterations.
[0218] Will Represents the weight corresponding to the student model, is represented by the weight of the teacher model. At the iteration, The update formula is ,in, is the EMA coefficient, which is empirically set to 0.99.
[0219] This embodiment also inherits the consistency loss As the second loss Part of the formula is:
[0220] Here the mean absolute error is used as the distance function ; denotes the type of perturbation, where Gaussian noise and random contrast adjustment are used. This stability constraint is adopted because: (i) it helps to regularize the model behavior and enhance generalization ability, alleviating the overfitting problem caused by limited supervision, and (ii) it encourages the model to focus on the intrinsic data structure, reducing the bias caused by noisy pseudo-labels based on generalist segmentation models discussed later.
[0221] Step 9: Based on the second segmentation results of the unlabeled medical samples in the i-th round of training, select the medical samples to be labeled from the unlabeled medical samples;
[0222] In order to make better use of the precious annotation budget, this embodiment adopts an active sample selection strategy during training.
[0223] In each i-th round of training, each unlabeled medical sample is scored by the student model, and then the unlabeled medical samples with the highest active scores are selected for cross-labeling to increase the set of labeled medical samples (also called the cross-labeled set). This process is repeated until the annotation budget is exhausted.
[0224] The active sample selection strategy includes at least one of the following three sampling strategies.
[0225] Least Confidence (LC) sampling: Calculate the average of the prediction confidence (probability) and select K1 samples with the lowest scores;
[0226] High Entropy (HE) sampling: select the Top-K2 samples with the largest average prediction entropy;
[0227] High Entropy Ratio (HER) sampling: Calculate the proportion of predictions exceeding the threshold to the total, and select the top-K3 samples with the highest ratio. For example, K3 is set to 2.
[0228] For HE and HER, Represented as a student model in voxels The predicted probability at , its normalized entropy Calculated by the following formula:
[0229]
[0230] in, is the true label.
[0231] High entropy indicates high uncertainty to some extent. For HE, the average predicted entropy of all voxels of an unlabeled sample is calculated to determine the active score of the unlabeled sample. In HER sampling, the active score of the unlabeled sample is calculated. ( is the number of voxels that are thresholded by a Gaussian ramp function from 0.5 to 0.75, and then calculate The ratio of the number of voxels in the unlabeled sample to the total number of voxels is used to obtain the active score of the unlabeled sample. Compared with HE, HER can more clearly reflect the distribution of high uncertainty in unlabeled samples.
[0232] Step 10: Obtain the true labels for the medical samples to be labeled, obtain the labeled medical samples actively selected and generated in the i-th round of training, and add the labeled medical samples to the set of labeled medical samples used in the i+1-th round of training.
[0233] Experimental data set: This application uses the Left Atrium (LA) segmentation dataset for experiments. The Left Atrium segmentation dataset provides 100 3D magnetic resonance images with expert labels. This application cross-labels the labels of the training set to simulate the sparse supervision setting of this application. The resolution of the image is 0.625x0.625x0.625mm^3. All images are cropped to the center of the heart area and normalized to zero mean and unit variance. This application divides the 100 3D magnetic resonance images in the dataset into 2 groups: 80 for the training process and 20 for the testing process.
[0234] Implementation details and evaluation metrics: The framework uses an NVIDIA GeForce RTX 3090 GPU with 24GB of memory and is implemented in Python and PyTorch. In all experiments, this application uses the same 3D V-Net as the backbone for fair comparison. For the generalist base model, this application uses the Mobile Segment Anything Model (Mobile SAM) for mobile terminals, which is a more efficient pre-trained base model distilled from the Segment Anything Model (SAM) of Meta Company in the United States, and adopts the Tiny Vision Transformer (ViT-Tiny) architecture. This application uses the Stochastic Gradient Descent Optimizer (SGD) to train the network (weight decay = 0.0001, momentum = 0.9). In each training batch, the batch size is set to 4, including 2 cross-labeled images and 2 unlabeled images. The maximum training steps are all set to 10000. The learning rate was initialized to 0.01 and decayed by a power of 0.9 after each step. We randomly cropped 112×112×80 voxel blocks as network input. Standard data augmentation, including random cropping, flipping, and rotation, was also applied. We used a sliding window strategy with a step size of 18×18×4 voxels for the testing phase. Then, we used four indicators for comprehensive evaluation, including the Dice Coefficient (DICE), the Jaccard Index (JI), the Average Surface Distance (ASD), and the 95% Hausdorff Distance (95HD).
[0235] Comparison with baseline methods: The method of this application is compared with baseline methods that use fully supervised learning, as well as some recent medical image segmentation methods that use semi-supervised learning, including: Multi-Task Learning (MT), Uncertainty-Aware Multi-Task Learning (UA-MT), Interpolation Consistency Training (ICT), Cyclic Prototype Consistency Learning (CPCL), Cross Pseudosupervision (CPS), Correlation-Aware Mutual Learning (CAML), Adaptive Cascade Multi-Task Learning (ACMT) and DeSCO. DeSCO can be referenced from: "Orthogonal Annotation is Beneficial for Almost Unsupervised Medical Image Segmentation", by Cai Heng et al. From the 2023 Institute of Electrical and Electronics Engineers (IEEE) and Computer Vision Foundation (CVF) Conference on Computer Vision and Pattern Recognition. (Cai, Heng, et al. "Orthogonal annotation benefits barely-supervised medical image segmentation." Proceedings of the IEEE / CVF Conference on Computer Vision and Pattern Recognition. 2023.).
[0236] Experimental results: Table 1 shows the performance of the method of this application and some recent medical image segmentation methods using semi-supervised learning (hereinafter referred to as other methods) when only 60 slice images are annotated (belonging to 20 samples, each sample annotated with a key slice image from 3 perspectives). Under the same segmentation protocol, compared with other methods, the method of this application can achieve a significant improvement, which proves the superiority and robustness of the method of this application.
[0237]
[0238] Among them, * indicates (The method of this application performs the Wilcoxon signed rank test in pairs with each of the other methods.) The Wilcoxon signed rank test is a nonparametric statistical test method used to test whether the medians of two related samples are significantly different. p is the statistical indicator in the Wilcoxon signed rank test. The standard deviation is shown in parentheses.
[0239] Under the standard random sampling protocol (random), the two correction strategies (UA and MV) of the present application always outperform other methods, which proves the effectiveness of the specialist-generalist collaboration of the present application under sparse supervision. In general, the use of the minority obeys the majority (MV) to calibrate the pseudo-labels based on multi-view generalists will produce excellent results. Then, by further adopting an active learning strategy, the performance of the embodiment of the present application is further enhanced, highlighting the benefits of "expert-model" collaboration. Specifically, in the left atrium segmentation task, the present application (MV) equipped with the HER sampling strategy obtained a Dice score of 86.14%, which is 5.42% behind the Dice score of 91.56% of the supremum of the baseline method using a fully supervised learning method, but the method of the present application only labeled 0.8% of the slice images.
[0240] Combined with reference Figure 8 , Figure 8 This is a comparison chart of the segmentation performance of the image segmentation model of the present application and other image segmentation models. Figure 8 A schematic diagram showing image segmentation performed on the same left atrium image by UA-MT, CAML, CPCL and the present application is shown in a visual manner. Figure 8 The blank area in the figure represents the left atrium region segmented by each method.
[0241] It should be noted that before collecting relevant user data (such as medical images input by the user) and during the process of collecting relevant user data, this application can display a prompt interface, pop-up window or output voice prompt information. The prompt interface, pop-up window or voice prompt information is used to prompt the user that its relevant data is currently being collected, so that this application only starts to execute the relevant steps of obtaining user-related data after obtaining the user's confirmation operation on the prompt interface or pop-up window, otherwise (that is, when the user's confirmation operation on the prompt interface or pop-up window is not obtained), the relevant steps of obtaining user-related data are terminated, that is, the user's relevant data is not obtained. In other words, all user data collected by this application are collected with the user's consent and authorization, and the collection, use and processing of relevant user data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0242] It should be noted that the sequence of the method steps provided in the embodiments of the present application can be appropriately adjusted, and the steps can be increased or decreased accordingly according to the circumstances. Any technician familiar with the technical field can easily think of the changed methods within the technical scope disclosed in the present application, and they should be included in the protection scope of the present application, so they will not be repeated here.
[0243] Fig. 9 FIG. 1 is a schematic diagram of a training device for an image segmentation model provided by an exemplary embodiment of the present application. Fig. 9 As shown, the device includes at least one of the following modules.
[0244] The sample acquisition module 920 is used to acquire labeled samples and unlabeled samples, wherein the labeled samples are image samples annotated with real labels.
[0245] The labeled segmentation module 940 is used to input the labeled sample into the image segmentation model to obtain a first segmentation result of the labeled sample; and determine a first loss based on the first segmentation result and the true label.
[0246] The unlabeled segmentation module 960 is used to at least input the unlabeled sample into the image segmentation model to obtain a second segmentation result of the unlabeled sample; correct the second segmentation result through the generalist segmentation model to obtain a corrected second segmentation result; and determine a second loss based on the corrected second segmentation result.
[0247] The model training module 980 is used to train the image segmentation model based on the first loss and the second loss.
[0248] In some embodiments, the unlabeled segmentation module 960 is configured to use at least the unlabeled sample as input data and the second segmentation result as prompt information to generate a corrected second segmentation result through the generalist segmentation model.
[0249] In some embodiments, the unlabeled segmentation module 960 is used to extract multiple slice images of three perspectives from the unlabeled sample, and the three perspectives correspond to the three coordinate planes of the three-dimensional image; use the multiple slice images of the three perspectives as images to be segmented, and use the second segmentation result as prompt information, and predict pseudo labels on the three perspectives through the generalist segmentation model, the pseudo labels on each perspective include two-dimensional segmentation results of multiple slice images belonging to the same perspective; adopt a correction strategy to fuse the pseudo labels on the three perspectives to generate a corrected second segmentation result.
[0250] In some embodiments, the unlabeled segmentation module 960 is used to determine, for any voxel in the unlabeled sample, that the voxel belongs to the first category when the pseudo-labels at the three perspectives all consider the voxel to belong to the first category; determine that the voxel belongs to the second category when there is a pseudo-label at at least one perspective that considers the voxel not to belong to the first category; and generate the corrected second segmentation result based on the classification results of each voxel in the unlabeled sample.
[0251] In some embodiments, the unlabeled segmentation module 960 is used to determine, for any voxel in the unlabeled sample, that the voxel belongs to the first category when the pseudo-labels at at least two perspectives both consider the voxel to belong to the first category; to determine that the voxel belongs to the second category when the pseudo-labels at at least two perspectives consider the voxel to belong to the second category; and to generate the corrected second segmentation result based on the classification results of each voxel in the unlabeled sample.
[0252] In some embodiments, the label-free segmentation module 960 is used to determine the two-dimensional segmentation information of the multiple slice images of the three perspectives based on the second segmentation result, and the three perspectives include a first perspective, a second perspective and a third perspective; using the multiple slice images of the first perspective as images to be segmented, and using the two-dimensional segmentation information of the multiple slice images of the first perspective as prompt information, and predicting the pseudo-label on the first perspective through the generalist segmentation model; using the multiple slice images of the second perspective as images to be segmented, and using the two-dimensional segmentation information of the multiple slice images of the second perspective as prompt information, and predicting the pseudo-label on the second perspective through the generalist segmentation model; using the multiple slice images of the third perspective as images to be segmented, and using the two-dimensional segmentation information of the multiple slice images of the third perspective as prompt information, and predicting the pseudo-label on the third perspective through the generalist segmentation model.
[0253] In some embodiments, the label-free segmentation module 960 is further configured to add random noise to the two-dimensional segmentation information.
[0254] In some embodiments, the image segmentation model includes a teacher model and a student model; the first segmentation result is the segmentation result predicted by the student model; the labeled segmentation module 940 is used to determine the first loss of the student model based on the first segmentation result and the true label.
[0255] In some embodiments, the image segmentation model includes a teacher model and a student model; the second segmentation result includes the teacher segmentation result predicted by the teacher model and the student segmentation result predicted by the student model, and the corrected second segmentation result includes the corrected teacher segmentation result; the unlabeled segmentation module 960 is also used to determine the second loss of the student model based on the student segmentation result and the corrected teacher segmentation result.
[0256] In some embodiments, the unlabeled segmentation module 960 is also used to calculate the pseudo-label loss based on the student segmentation result and the corrected teacher segmentation result; calculate the consistency loss based on the student segmentation result and the teacher segmentation result; and determine the weighted sum of the pseudo-label loss and the consistency loss as the second loss.
[0257] In some embodiments, the unlabeled segmentation module 960 is also used to determine a first weight and a second weight based on a current number of training times and a maximum number of training times in a training process; calculate a first product of the first weight and the pseudo-label loss, and a second product of the second weight and the consistency loss; and determine the sum of the first product and the second product as the second loss.
[0258] In some embodiments, the training process includes multiple rounds of training, and the image segmentation model includes a teacher model and a student model; the model training module 980 is used to update the network parameters of the student model in the i-th round of training based on the first loss and the second loss; and update the network parameters of the teacher model based on the network parameters of the student model before the i-th round of training and the network parameters of the i-th round of training.
[0259] In some embodiments, the training process includes multiple rounds of training, and the sample acquisition module 920 is used to select samples to be labeled from the unlabeled samples based on the second segmentation results of the unlabeled samples in the i-th round of training; obtain the real labels labeled for the samples to be labeled, obtain the labeled samples actively selected and generated in the i-th round of training, and add the labeled samples to the labeled sample set used in the i+1-th round of training.
[0260] In some embodiments, the training process includes multiple rounds of training, and the sample acquisition module 920 is used to select unlabeled samples that meet preset conditions as the samples to be labeled based on the second segmentation results of the unlabeled samples in the i-th round of training; wherein the unlabeled samples that meet the preset conditions include at least one of the following: K1 unlabeled samples with the lowest confidence in the second segmentation results; K2 unlabeled samples with the largest average predicted entropy, and the average predicted entropy is the average entropy of all voxels in the second segmentation result; K3 unlabeled samples corresponding to the highest entropy ratio, and the highest entropy ratio is the second segmentation results that exceed the probability threshold. The proportion of all second segmentation results is the highest.
[0261] In some embodiments, the labeled sample is a three-dimensional image, and the true label of the labeled sample is annotated using a cross-labeling strategy; the cross-labeling strategy is a labeling strategy that respectively marks two-dimensional segmentation information of key slice images of three perspectives in the three-dimensional image; wherein the key slice image of each perspective is a slice image among multiple slice images belonging to the current perspective.
[0262] It should be noted that the task execution device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, 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 task execution device provided in the above embodiment and the training method embodiment of the image segmentation model belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0263] An embodiment of the present application also provides a computer device, which includes: a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor to implement the training method of the image segmentation model provided in the above-mentioned method embodiments.
[0264] For example, Fig.10 It is a structural diagram of a computer device provided by an exemplary embodiment of the present application.
[0265] The computer device 1000 includes a central processing unit (CPU) 1001, a system memory 1004 including a random access memory (RAM) 1002 and a read-only memory (ROM) 1003, and a system bus 1005 connecting the system memory 1004 and the central processing unit 1001. The computer device 1000 also includes a basic input / output system (I / O system) 1006 for facilitating information transmission between various components in the computer device, and a large-capacity storage device 1007 for storing an operating system 1013, application programs 1014, and other program modules 1015.
[0266] The basic input / output system 1006 includes a display 1008 for displaying information and an input device 1009 such as a mouse and a keyboard for user inputting information. The display 1008 and the input device 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 also include an input / output controller 1010 for receiving and processing inputs from a plurality of other devices such as a keyboard, a mouse, or an electronic stylus. Similarly, the input / output controller 1010 also provides output to a display screen, a printer, or other types of output devices.
[0267] The mass storage device 1007 is connected to the central processing unit 1001 via a mass storage controller (not shown) connected to the system bus 1005. The mass storage device 1007 and its associated computer readable storage medium provide non-volatile storage for the computer device 1000. That is, the mass storage device 1007 may include a computer readable storage medium (not shown) such as a hard disk or a compact disc read-only memory (CD-ROM) drive.
[0268] Without loss of generality, the computer-readable storage medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable storage instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, Erasable Programmable Read Only Memory (EPROM), Electronically Erasable Programmable Read-Only Memory (EEPROM), flash memory or other solid-state storage devices, CD-ROM, Digital Versatile Disc (DVD) or other optical storage, cassettes, tapes, 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. The above-mentioned system memory 1004 and mass storage device 1007 can be collectively referred to as memory.
[0269] 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 contain instructions for implementing the above-mentioned method embodiments. The central processing unit 1001 executes the one or more programs to implement the methods provided by the above-mentioned various method embodiments.
[0270] According to various embodiments of the present application, the computer device 1000 can also be connected to a remote computer device on a 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 the network interface unit 1011 can be used to connect to other types of networks or remote computer device systems (not shown).
[0271] The memory also includes one or more programs, which are stored in the memory and include steps executed by a computer device in the method provided in the embodiment of the present application.
[0272] A computer-readable storage medium is also provided in an embodiment of the present application, which stores at least one instruction, at least one program, code set or instruction set. When the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor of a computer device, the training method of the image segmentation model provided by the above-mentioned method embodiments is implemented.
[0273] The present application also provides a computer program product or a computer program, which includes computer instructions 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 training method of the image segmentation model provided in the above-mentioned method embodiments.
[0274] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned computer-readable storage medium may be a read-only memory, a disk or an optical disk, etc.
[0275] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent switching, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A training method for an image segmentation model, characterized in that: The image segmentation model includes a teacher model and a student model, and the method includes: Obtain labeled samples and unlabeled samples, wherein the labeled samples are image samples marked with real labels; Inputting the labeled sample into the student model to obtain a first segmentation result of the labeled sample; determining a first loss based on the first segmentation result and the true label; Input the unlabeled sample into the teacher model and the student model to obtain the teacher segmentation result and the student segmentation result respectively; correct the teacher segmentation result through the generalist segmentation model to obtain the corrected teacher segmentation result, and the generalist segmentation model has a general image segmentation capability that is not limited to any field; calculate the pseudo-label loss based on the student segmentation result and the corrected teacher segmentation result; and calculate the consistency loss based on the student segmentation result and the teacher segmentation result; determine the first weight and the second weight based on the current number of training times and the maximum number of training times in the training process, the first weight is negatively correlated with the proportion of the number of training times, and the second weight is positively correlated with the proportion of the number of training times, and the proportion of the number of training times is the ratio between the current number of training times and the maximum number of training times; calculate the first product of the first weight and the pseudo-label loss, and the second product of the second weight and the consistency loss; determine the sum of the first product and the second product as the second loss of the student model; Based on the first loss and the second loss, training the image segmentation model; Based on the student segmentation results of the unlabeled samples in the i-th round of training, the unlabeled samples that meet the preset conditions are selected as samples to be labeled; the real labels annotated for the samples to be labeled are obtained, and the labeled samples actively selected and generated in the i-th round of training are obtained, and the labeled samples are added to the labeled sample set used in the i+1-th round of training, where i is a positive integer; The unlabeled samples that meet the preset conditions include at least one of the following: The first K1 unlabeled samples sorted from low to high according to the confidence of the student segmentation result; The first K2 unlabeled samples are sorted from high to low according to the average predicted entropy of the student segmentation result, where the average predicted entropy is the average entropy of all voxels in the student segmentation result; The first K3 unlabeled samples are sorted from high to low according to the entropy ratio of the student segmentation result, where the entropy ratio is the ratio of voxels exceeding the probability threshold to all voxels in the student segmentation result; Among them, K1, K2 and K3 are all positive integers.
2. The method according to claim 1, characterized in that Correcting the teacher segmentation result by the generalist segmentation model to obtain a corrected teacher segmentation result includes: The unlabeled sample is used as the image to be segmented, and the teacher segmentation result is used as prompt information, and the corrected teacher segmentation result is generated through the generalist segmentation model.
3. The method according to claim 2, characterized in that The unlabeled sample is a three-dimensional image, and the unlabeled sample is used as the image to be segmented, and the teacher segmentation result is used as prompt information, and the corrected teacher segmentation result is generated by the generalist segmentation model, including: Extracting a plurality of slice images of three viewing angles from the unlabeled sample, wherein the three viewing angles correspond to three coordinate planes of the three-dimensional image; Taking the multiple slice images of the three perspectives as the images to be segmented and the teacher segmentation results as the prompt information, the generalist segmentation model is used to predict pseudo labels on the three perspectives, wherein the pseudo labels on each perspective include two-dimensional segmentation results of the multiple slice images belonging to the same perspective; A correction strategy is adopted to fuse the pseudo labels on the three perspectives to generate the corrected teacher segmentation result.
4. The method according to claim 3, characterized in that The correction strategy is adopted to fuse the pseudo labels on the three perspectives to generate the corrected teacher segmentation result, including: For any voxel in the unlabeled sample, if the pseudo labels at the three perspectives all consider that the voxel belongs to the first category, determine that the voxel belongs to the first category; if there is a pseudo label at at least one perspective that considers that the voxel does not belong to the first category, determine that the voxel belongs to the second category; Based on the classification results of each voxel in the unlabeled sample, the corrected teacher segmentation result is generated.
5. The method according to claim 3, characterized in that: The correction strategy is adopted to fuse the pseudo labels on the three perspectives to generate the corrected teacher segmentation result, including: For any voxel in the unlabeled sample, when the pseudo labels at least two of the three viewing angles consider that the voxel belongs to the first category, determining that the voxel belongs to the first category; and when the pseudo labels at least two of the three viewing angles consider that the voxel belongs to the second category, determining that the voxel belongs to the second category; Based on the classification results of each voxel in the unlabeled sample, the corrected teacher segmentation result is generated.
6. The method according to claim 3, characterized in that The method of using the plurality of slice images of the three perspectives as the images to be segmented and the teacher segmentation results as the prompt information, and predicting the pseudo labels of the three perspectives through the generalist segmentation model, comprises: Based on the teacher segmentation result, determining two-dimensional segmentation information of the plurality of slice images of the three perspectives, the three perspectives comprising a first perspective, a second perspective and a third perspective; Using the plurality of slice images of the first perspective as the images to be segmented, and using the two-dimensional segmentation information of the plurality of slice images of the first perspective as the prompt information, and predicting the pseudo labels on the first perspective through the generalist segmentation model; Using the plurality of slice images of the second perspective as the images to be segmented, and using the two-dimensional segmentation information of the plurality of slice images of the second perspective as the prompt information, and predicting the pseudo labels on the second perspective by using the generalist segmentation model; The plurality of slice images of the third perspective are used as the images to be segmented, and the two-dimensional segmentation information of the plurality of slice images of the third perspective is used as the prompt information, and the pseudo labels on the third perspective are predicted by the generalist segmentation model.
7. The method according to claim 6, characterized in that The method further comprises: Random noise is added to the two-dimensional segmentation information.
8. The method according to any one of claims 1 to 7, characterized in that: The training process includes multiple rounds of training; The step of training the image segmentation model based on the first loss and the second loss includes: Based on the first loss and the second loss, updating the network parameters of the student model in the i-th round of training, where i is a positive integer; Based on the network parameters of the student model before the i-th round of training and the network parameters of the i-th round of training, the network parameters of the teacher model are updated.
9. The method according to any one of claims 1 to 7, characterized in that: The labeled samples are three-dimensional images, and the real labels of the labeled samples are annotated using a cross-label strategy; The cross-label strategy is a labeling strategy for marking two-dimensional segmentation information of key slice images of three perspectives in the three-dimensional image respectively; The key slice image of each of the three perspectives is a slice image among multiple slice images belonging to the current perspective.
10. A training device for an image segmentation model, characterized in that: The image segmentation model includes a teacher model and a student model, and the device includes: A sample acquisition module is used to acquire labeled samples and unlabeled samples, wherein the labeled samples are image samples marked with real labels; A labeled segmentation module, used for inputting the labeled sample into the student model to obtain a first segmentation result of the labeled sample; and determining a first loss based on the first segmentation result and the true label; An unlabeled segmentation module is used to input the unlabeled samples into the teacher model and the student model to obtain a teacher segmentation result and a student segmentation result respectively; correct the teacher segmentation result through a generalist segmentation model to obtain a corrected teacher segmentation result, and the generalist segmentation model has a general image segmentation capability that is not limited to any field; calculate a pseudo-label loss based on the student segmentation result and the corrected teacher segmentation result; and calculate a consistency loss based on the student segmentation result and the teacher segmentation result; determine a first weight and a second weight based on the current number of training times and the maximum number of training times in the training process, the first weight is negatively correlated with the proportion of trained times, and the second weight is positively correlated with the proportion of trained times, and the proportion of trained times is the ratio between the current number of training times and the maximum number of training times; calculate a first product of the first weight and the pseudo-label loss, and a second product of the second weight and the consistency loss; determine the sum of the first product and the second product as the second loss of the student model; A model training module, used for training the image segmentation model based on the first loss and the second loss; The sample acquisition module is further used to select unlabeled samples that meet preset conditions as samples to be labeled based on the student segmentation results of the unlabeled samples in the i-th round of training; obtain the real labels labeled for the samples to be labeled, obtain the labeled samples actively selected and generated in the i-th round of training, and add the labeled samples to the labeled sample set used in the i+1-th round of training, where i is a positive integer; The unlabeled samples that meet the preset conditions include at least one of the following: The first K1 unlabeled samples sorted from low to high according to the confidence of the student segmentation result; The first K2 unlabeled samples are sorted from high to low according to the average predicted entropy of the student segmentation result, where the average predicted entropy is the average entropy of all voxels in the student segmentation result; The first K3 unlabeled samples are sorted from high to low according to the entropy ratio of the student segmentation result, where the entropy ratio is the ratio of voxels exceeding the probability threshold to all voxels in the student segmentation result; Among them, K1, K2 and K3 are all positive integers.
11. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one program, and the at least one program is loaded and executed by the processor to implement the training method of the image segmentation model as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one program, and the at least one program is loaded and executed by a processor to implement the training method of the image segmentation model as described in any one of claims 1 to 9.
13. A computer program product, characterized in that The computer program product includes computer instructions, which 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 training method of the image segmentation model as described in any one of claims 1 to 9.
