Medical image segmentation method, device and equipment and readable storage medium
By employing a knowledge distillation method involving teacher and student networks and utilizing the mean image to transmit prior shape information, the problem of low efficiency and unreasonable results in existing medical image segmentation is solved, achieving efficient and accurate medical image segmentation.
Patent Information
- Application Number
- CN202310022455.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-07
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2043-01-07
AI Technical Summary
Existing medical image segmentation methods treat medical images as separate pixel-level classification tasks, ignoring the specific shape of medical objects, resulting in low segmentation efficiency and unreasonable results.
By employing a knowledge distillation method involving both teacher and student networks, and utilizing the mean image to transmit shape prior information, the student network is trained to explicitly fuse shape prior information, thereby improving segmentation efficiency and accuracy.
Without increasing time and computational costs, explicit fusion of shape prior information improves the efficiency and accuracy of medical image segmentation and enhances the generalization ability of the segmentation network.
Smart Images

Figure CN116188487B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and particularly relates to a medical image segmentation method, device and equipment and a readable storage medium. BACKGROUND
[0002] With the development of deep convolutional neural network (CNN), great progress has been made in medical image segmentation. However, most of the existing methods regard the medical image segmentation problem as a separate pixel-level classification task, and ignore the fact that medical objects usually have some specific shapes, resulting in low segmentation efficiency and unreasonable segmentation results. SUMMARY
[0003] The main purpose of the present application is to provide a medical image segmentation method, device, equipment and readable storage medium, which aims to improve the efficiency and accuracy of medical image segmentation.
[0004] In a first aspect, the present application provides a medical image segmentation method, which comprises the following steps:
[0005] Obtaining a plurality of medical images from a training sample set;
[0006] According to the pixel values of the pixel points corresponding to the labels of the plurality of medical images, a plurality of mean value images corresponding to the plurality of medical images are calculated;
[0007] Training the teacher network according to the plurality of mean value images to update the network parameters of the teacher network, and obtaining a new teacher network;
[0008] Taking the new teacher network as the teacher network, obtaining a plurality of medical images from the training sample set which have not been obtained before, and returning to execute the step of calculating a plurality of mean value images corresponding to the plurality of medical images according to the pixel values of the pixel points corresponding to the labels of the plurality of medical images until the number of cycles reaches a first preset number, and obtaining a trained teacher network;
[0009] Inputting the plurality of medical images into the student network, inputting the plurality of mean value images corresponding to the plurality of medical images into the trained teacher network, and training the student network by aligning the penultimate layer features of the trained teacher network and the student network through the method of knowledge distillation, updating the network parameters of the student network, and obtaining a new student network;
[0010] Take the new student network as the student network, obtain a plurality of medical images not obtained from the training sample set, return to execute the step of inputting the plurality of medical images into the student network, inputting the plurality of medical images corresponding mean value images into the trained teacher network, and aligning the last second layer features of the trained teacher network and the student network through the method of knowledge distillation, training the student network to update the network parameters of the student network, obtaining the new student network, until the cycle number reaches the second preset number, and taking the new student network as the segmentation network;
[0011] Segment the to-be-segmented medical image based on the segmentation network.
[0012] Optionally, the step of calculating a plurality of mean value images according to the pixel values of the pixel points corresponding to the labels of the plurality of medical images comprises:
[0013] The average pixel value corresponding to each medical image is calculated based on the pixel values of the pixel points corresponding to the labels of the plurality of medical images.
[0014] Each medical image corresponding mean value image containing only shape priori information is obtained by replacing the pixel values of the pixel points corresponding to the labels of each medical image with the average pixel values corresponding to each medical image.
[0015] Optionally, the step of training the teacher network according to the plurality of mean value images to update the network parameters of the teacher network to obtain a new teacher network comprises:
[0016] The first loss mean value between the pixel points corresponding to the plurality of segmentation images output by the teacher network and the pixel points corresponding to the labels of the plurality of medical images is calculated.
[0017] The network parameters of the teacher network are updated based on the first loss mean value to obtain a new teacher network.
[0018] Optionally, the step of inputting the plurality of medical images into the student network, inputting the plurality of medical images corresponding mean value images into the trained teacher network, and aligning the last second layer features of the trained teacher network and the student network through the method of knowledge distillation, training the student network to update the network parameters of the student network to obtain a new student network comprises:
[0019] The plurality of medical images are input into the student network to obtain a plurality of segmentation images output by the student network.
[0020] The second loss mean value between the pixel points corresponding to the plurality of segmentation images output by the student network and the pixel points corresponding to the labels of the plurality of medical images is calculated.
[0021] Input the mean images corresponding to the medical images into the trained teacher network to obtain the encoded shape prior information of the last-but-one layer features of the trained teacher network;
[0022] Transmit the encoded shape prior information of the last-but-one layer features of the trained teacher network to the student network, and calculate the third loss mean value between the last-but-one layer features of the trained teacher network and the last-but-one layer features of the student network through a distillation loss function;
[0023] Update the network parameters of the student network based on the sum of the second loss mean value and the third loss mean value to obtain a new student network.
[0024] Optionally, the teacher network and the student network are convolutional neural networks with the same structure.
[0025] In a second aspect, the present application further provides a medical image segmentation device, which comprises:
[0026] A first acquisition module is configured to acquire a plurality of medical images from a training sample set;
[0027] A calculation module is configured to calculate mean images corresponding to the plurality of medical images according to the pixel values of the pixel points corresponding to the labels of the plurality of medical images, respectively;
[0028] A first training module is configured to train a teacher network according to the plurality of mean images to update the network parameters of the teacher network and obtain a new teacher network;
[0029] A first loop module is configured to take the new teacher network as the teacher network, acquire a plurality of medical images that have not been acquired from the training sample set, and return to execute the step of calculating the mean images corresponding to the plurality of medical images according to the pixel values of the pixel points corresponding to the labels of the plurality of medical images until the number of loops reaches a first preset number, and obtain a trained teacher network.
[0030] A second training module is configured to input the plurality of medical images into a student network, input the mean images corresponding to the plurality of medical images into the trained teacher network, and align the last-but-one layer features of the trained teacher network and the student network through a knowledge distillation method, train the student network to update the network parameters of the student network, and obtain a new student network.
[0031] The second training module is configured to: input the plurality of medical images into the student network to obtain a plurality of segmentation images output by the student network; calculate a second loss mean value between pixel points corresponding to the plurality of segmentation images and pixel points corresponding to the labels of the plurality of medical images; and update network parameters of the student network based on a sum of the second loss mean value and a third loss mean value to obtain a new student network.
[0032] The segmentation module is configured to segment the medical image to be segmented based on the segmentation network.
[0033] Optionally, the calculation module is specifically configured to:
[0034] The average pixel value corresponding to each medical image is calculated based on pixel values of pixel points corresponding to labels of the plurality of medical images.
[0035] The average pixel value corresponding to each medical image is calculated based on pixel values of pixel points corresponding to labels of the plurality of medical images.
[0036] Optionally, the second training module is specifically configured to:
[0037] The plurality of medical images are input into the student network to obtain a plurality of segmentation images output by the student network.
[0038] The second loss mean value between pixel points corresponding to the plurality of segmentation images and pixel points corresponding to the labels of the plurality of medical images is calculated.
[0039] The plurality of medical images are input into the student network to obtain a plurality of segmentation images output by the student network.
[0040] The plurality of medical images are input into the student network to obtain a plurality of segmentation images output by the student network.
[0041] The plurality of medical images are input into the student network to obtain a plurality of segmentation images output by the student network.
[0042] In a third aspect, the present application provides a medical image segmentation device, comprising a processor, a memory, and a medical image segmentation program stored in the memory and executable by the processor, wherein the medical image segmentation program, when executed by the processor, implements the steps of the medical image segmentation method as described above.
[0043] In a fourth aspect, the present application provides a readable storage medium having a medical image segmentation program stored thereon, wherein the medical image segmentation program, when executed by a processor, implements the steps of the medical image segmentation method as described above.
[0044] In this invention, several medical images are obtained from the training sample group; the mean images corresponding to the several medical images are calculated based on the pixel values of the pixels corresponding to the labels of the several medical images; the teacher network is trained based on the several mean images to update the network parameters of the teacher network, resulting in a new teacher network; using the new teacher network as the teacher network, several previously unobtained medical images are obtained from the training sample group, and the process of calculating the mean images corresponding to the several medical images based on the pixel values of the pixels corresponding to the labels of the several medical images is repeated until the number of iterations reaches a first preset number, resulting in a trained teacher network; the several medical images are input into the student network, and the mean images corresponding to the several medical images are input into the trained teacher network, and then... The penultimate layer features of the trained teacher and student networks are aligned using knowledge distillation. The student network is then trained to update its parameters, resulting in a new student network. Using this new student network, several previously uncollected medical images are extracted from the training sample set. The process continues, inputting these medical images into the student network and the corresponding mean images into the trained teacher network. The penultimate layer features of both networks are then aligned using knowledge distillation to train the student network and update its parameters, resulting in a new student network. This process is repeated until a second preset number of iterations is reached. The new student network is then used as the segmentation network. The medical images to be segmented are then segmented based on this new network. This invention trains a teacher network based on a mean image containing only shape prior information, resulting in a trained teacher network that effectively encodes shape prior information. Several medical images are then input into a student network, along with their corresponding mean images. Knowledge distillation aligns the penultimate feature layers of both the teacher and student networks, effectively transferring shape prior information. This allows the student network to explicitly fuse shape prior information at the feature level. The student network is then trained based on the medical images and shape prior information. After training, the resulting segmentation network, explicitly incorporating shape prior information, segments the medical images to be segmented. The entire segmentation process does not increase time or computational cost, improving the efficiency and accuracy of medical image segmentation. Attached Figure Description
[0045] Figure 1 This is a flowchart illustrating an embodiment of the medical image segmentation method of the present invention;
[0046] Figure 2 This is a schematic diagram of the network structure of the medical image segmentation method of the present invention;
[0047] Figure 3 forFigure 1 Detailed flowchart of step S50;
[0048] Figure 4 Function module schematic diagram of an embodiment of the medical image segmentation device of the present application;
[0049] Figure 5 Hardware structure schematic diagram of the medical image segmentation device involved in the embodiment of the present application.
[0050] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0051] It should be understood that the specific embodiments described herein are merely intended to explain the present application and not to limit the present application.
[0052] In a first aspect, the embodiments of the present application provide a medical image segmentation method.
[0053] In an embodiment, the medical image segmentation method comprises the following steps: Figure 1 Figure 1 Flowchart of an embodiment of the medical image segmentation method of the present application. As shown in the figure, the medical image segmentation method comprises the following steps: Figure 1
[0054] Step S10, obtaining a plurality of medical images from a training sample group;
[0055] In the embodiment, the training sample group contains a plurality of medical images (Image), and a plurality of medical images are obtained from the training sample group containing a plurality of medical images according to batchsize, wherein the medical image is the image of the internal tissue of the human body, and batchsize represents the number of data (samples) transmitted to the program for training at a time. For example, if the training sample group has 1000 medical images and batch_size = 100, the program will first obtain any 100 medical images in the training sample group.
[0056] Step S20, calculating a plurality of mean images corresponding to the plurality of medical images according to the pixel values of the pixel points corresponding to the labels of the plurality of medical images respectively;
[0057] In the embodiment, the medical image segmentation method comprises the following steps: Figure 2 Figure 2 Network structure schematic diagram of the medical image segmentation method of the present application. As shown in the figure, the network structure of the medical image segmentation method comprises the following steps: Figure 2 As shown, the mean image (Mean image) corresponding to each medical image containing only shape prior information is calculated according to the pixel values of the pixel points corresponding to the label of each medical image. The labels of the several medical images are the same. The mean image containing only shape prior information obtained by this processing has a small difference in appearance with the corresponding medical image.
[0058] Specifically, if three medical images are obtained from the training sample set, the mean image_1 containing only shape prior information corresponding to the medical image_1 is calculated according to the pixel values of the pixel points corresponding to the label of the medical image_1; the mean image_2 containing only shape prior information corresponding to the medical image_2 is calculated according to the pixel values of the pixel points corresponding to the label of the medical image_2; and the mean image_3 containing only shape prior information corresponding to the medical image_3 is calculated according to the pixel values of the pixel points corresponding to the label of the medical image_3. That is, the medical image and the mean image containing only shape prior information are one-to-one corresponding.
[0059] Further, in an embodiment, step S20 comprises:
[0060] The average pixel value corresponding to each medical image is calculated based on the pixel values of the pixel points corresponding to the label of the several medical images.
[0061] The average pixel value corresponding to each medical image is calculated based on the pixel values of the pixel points corresponding to the label of the several medical images.
[0062] In this embodiment, if the pixel points corresponding to the labels of the three medical images obtained from the training sample set are the pixel points in the lung region, the average pixel value (class-wise average) of the lung region is calculated based on the pixel values of all the pixel points in the lung region in the medical image_1, and the average pixel value (class-wise average) of the lung region is the average pixel value corresponding to the medical image_1, or the average pixel value corresponding to the medical image_1 is calculated based on the pixel values of part of the pixel points in the lung region in the medical image_1.
[0063] The average pixel value corresponding to the medical image_1 is used to replace the pixel value of the pixel point in the lung region to obtain the mean image_1 corresponding to the medical image_1, that is, the information other than the shape prior information in the medical image_1 is removed. It is easy to think that if the label of the medical image corresponds to the pixel point in the lung region, the average pixel value of the pixel point in the lung region is calculated, and the average pixel value of the pixel point in the lung region is used to replace the pixel value of the pixel point in the lung region. If the label of the medical image corresponds to the pixel point in the heart region, the average pixel value of the pixel point in the heart region is calculated, and the average pixel value of the pixel point in the heart region is used to replace the pixel value of the pixel point in the heart region.
[0064] By analogy, according to the pixel value of the pixel point corresponding to the label of the medical image_2, the mean image_2 corresponding to the medical image_2 is calculated; according to the pixel value of the pixel point corresponding to the label of the medical image_3, the mean image_3 corresponding to the medical image_3 is calculated.
[0065] In step S30, the teacher network is trained according to the plurality of mean images to update the network parameters of the teacher network, and a new teacher network is obtained.
[0066] In this embodiment, the teacher network is trained according to the plurality of mean images to update the network parameters of the teacher network, and the teacher network after updating the network parameters is recorded as a new teacher network.
[0067] Further, in an embodiment, step S30 comprises:
[0068] The first loss mean value between the pixel points corresponding to the plurality of segmentation images output by the teacher network and the pixel points corresponding to the labels of the plurality of medical images is calculated.
[0069] The network parameters of the teacher network are updated based on the first loss mean value to obtain a new teacher network.
[0070] In this embodiment, continue to refer to Figure 2 The mean images corresponding to the plurality of medical images are input into the teacher network to obtain a plurality of segmentation images output by the teacher network. The first loss mean value between the pixel points corresponding to the plurality of segmentation images output by the teacher network and the pixel points corresponding to the labels of the plurality of medical images is calculated by a loss function, and the network parameters of the teacher network are updated based on the first loss mean value. The teacher network after updating the network parameters is recorded as a new teacher network.
[0071] Step S40, taking the new teacher network as the teacher network, obtaining a plurality of medical images not obtained from the training sample set, returning to execute the step of calculating the mean image corresponding to the plurality of medical images according to the pixel values of the pixel points corresponding to the labels of the plurality of medical images, until the number of cycles reaches the first preset number, obtaining the trained teacher network;
[0072] In this embodiment, after obtaining the new teacher network, the new teacher network is taken as the teacher network, a plurality of medical images not obtained are obtained from the training sample set, and the step of calculating the mean image corresponding to the plurality of medical images according to the pixel values of the pixel points corresponding to the labels of the plurality of medical images is executed, that is, steps S20 to S40 are executed cyclically, until the number of cycles reaches the first preset number, and the trained teacher network is obtained. It should be noted that if the first preset number is 25, the training sample set has 1000 medical images, and batch_size=100, then after one cycle, 100 medical images are randomly selected from the 900 medical images not obtained, after 10 cycles, the 1000 medical images have been obtained, then in the 11th cycle, 100 medical images are randomly selected from the 1000 medical images, in the 12th cycle, 100 medical images are randomly selected from the remaining 900 medical images, and so on, until the number of cycles reaches 25, and the trained teacher network is obtained.
[0073] Step S50, inputting the plurality of medical images into the student network, inputting the mean image corresponding to the plurality of medical images into the trained teacher network, and aligning the second-to-last layer features of the trained teacher network and the student network by the method of knowledge distillation, training the student network to update the network parameters of the student network, and obtaining a new student network;
[0074] In this embodiment, the plurality of medical images are input into the student network, and the mean image corresponding to the plurality of medical images is input into the trained teacher network, to obtain a plurality of encoded shape priori information of the second-to-last layer features of the trained teacher network. The second-to-last layer features of the trained teacher network and the student network are aligned by the method of knowledge distillation, that is, the plurality of encoded shape priori information of the second-to-last layer features of the trained teacher network is transmitted to the student network by the method of knowledge distillation, and the student network is trained based on the plurality of encoded shape priori information and the plurality of medical images to update the network parameters of the student network, and a new student network is obtained.
[0075] Further, in an embodiment, referring to Figure 3 ,Figure 3 For Figure 1 The detailed flowchart of step S50 is shown. As shown in the figure, step S50 includes: Figure 3
[0076] Step S501, input the medical images into the student network to obtain a plurality of segmentation images output by the student network;
[0077] Step S502, calculate the second loss mean value between the pixel points corresponding to the plurality of segmentation images output by the student network and the pixel points corresponding to the labels of the plurality of medical images;
[0078] Step S503, input the mean image corresponding to the plurality of medical images into the trained teacher network to obtain a plurality of encoded shape priori information of the penultimate layer features of the trained teacher network;
[0079] Step S504, pass the plurality of encoded shape priori information of the penultimate layer features of the trained teacher network to the student network, and calculate the third loss mean value between the penultimate layer features of the trained teacher network and the penultimate layer features of the student network through the distillation loss function;
[0080] Step S505, update the network parameters of the student network based on the sum of the second loss mean value and the third loss mean value to obtain a new student network.
[0081] In this embodiment, continue to refer to Figure 2 input the medical images into the student network to obtain a plurality of segmentation images output by the student network.
[0082] Calculate the loss function mean value between the predicted image and the real image through the segmentation loss function (Segmentationloss), that is, the second loss mean value between the pixel points corresponding to the plurality of segmentation images output by the student network and the pixel points corresponding to the labels of the plurality of medical images, wherein the segmentation loss function includes Crossentropy segmentation loss function and Diceloss segmentation loss function.
[0083] The mean image corresponding to each of the medical images is input into the trained teacher network to obtain several encoded shape prior information of the penultimate layer features of the trained teacher network. Specifically, the mean image_1 is input into the trained teacher network to obtain the encoded shape prior information_1 of the penultimate layer features of the trained teacher network; the mean image_2 is input into the trained teacher network to obtain the encoded shape prior information_2 of the penultimate layer features of the trained teacher network; and the mean image_3 is input into the trained teacher network to obtain the encoded shape prior information_3 of the penultimate layer features of the trained teacher network. Because the mean image and the corresponding medical image have small differences in appearance, the trained teacher network can effectively encode the shape prior information.
[0084] The several encoded shape prior information of the penultimate layer features of the trained teacher network is transmitted to the student network, and the third loss mean value between the penultimate layer features of the trained teacher network and the penultimate layer features of the student network is calculated through a distillation loss function.
[0085] The network parameters of the student network are updated based on the sum of the second loss mean value and the third loss mean value, and the student network after updating the network parameters is recorded as a new student network.
[0086] In step S60, the new student network is used as the student network, and several medical images that have not been obtained from the training sample group are obtained, and the step of inputting the several medical images into the student network, inputting the mean image corresponding to the several medical images into the trained teacher network, and aligning the penultimate layer features of the trained teacher network and the student network through the method of knowledge distillation is returned to be executed. The student network is trained to update the network parameters of the student network to obtain a new student network, until the number of cycles reaches the second preset number, and the new student network is used as the segmentation network.
[0087] In this embodiment, after obtaining the new student network, the new student network is used as the student network, and several medical images that have not been obtained from the training sample group are obtained, and the step of inputting the several medical images into the student network, inputting the mean image corresponding to the several medical images into the trained teacher network, and aligning the penultimate layer features of the trained teacher network and the student network through the method of knowledge distillation is returned to be executed. The student network is trained to update the network parameters of the student network to obtain a new student network.
[0088] Specifically, 100 medical images are obtained from the training sample group, and the mean image corresponding to the 100 medical images is input into the trained teacher network, and the penultimate layer features of the trained teacher network and the student network are aligned by the knowledge distillation method, the student network is trained to update the network parameters of the student network, and a new student network is obtained. After that, the new student network is used as the student network, and 100 medical images are randomly obtained again from the 900 medical images that have not been obtained from the training sample group. The mean image corresponding to the 100 medical images is calculated according to the pixel value of the pixel corresponding to the label of the 100 medical images. The 100 medical images are input into the student network, and the mean image corresponding to the 100 medical images is input into the trained teacher network. The penultimate layer features of the trained teacher network and the student network are aligned by the knowledge distillation method, the student network is trained to update the network parameters of the student network, and a new student network is obtained.
[0089] By analogy, until the number of cycles reaches the second preset number, the new student network is used as the segmentation network. It should be noted that the second preset number is 26, the training sample group has 1000 medical images, and batch_size=100. After one cycle, 100 medical images are randomly obtained again from the 900 medical images that have not been obtained. After 10 cycles, the 1000 medical images have been obtained, so in the 11th cycle, 100 medical images are randomly obtained from the 1000 medical images, and in the 12th cycle, 100 medical images are randomly obtained from the remaining 900 medical images. By analogy, until the number of cycles reaches 26, the new student network obtained is used as the segmentation network.
[0090] Step S70, segmenting the medical image to be segmented based on the segmentation network.
[0091] In this embodiment, after obtaining the segmentation network, the segmentation network that explicitly fuses shape prior information from the feature layer is used for semantic segmentation task, i.e. segmenting the medical image to be segmented to obtain the lesion region or organ region. The whole segmentation process does not increase any time overhead and calculation cost, and can better assist the clinician in diagnosis.
[0092] Further, the segmentation result of the segmentation network is evaluated. Specifically, the Dice coefficient commonly used in medical image segmentation is selected as the evaluation index, and verification is performed on 6 medical segmentation tasks with different modalities. On the 6 medical segmentation tasks, the Dice coefficient of the embodiment is higher than that of the basic convolutional network, proving that the application effectively improves the segmentation effect of the basic convolutional network. At the same time, in order to verify the generalization effect of the segmentation network, for each segmentation task, one or more cross-center datasets not seen in training are used for testing, and the Dice coefficient of the application is higher than that of the basic convolutional network, proving that the application significantly improves the generalization of the basic convolutional network. The Dice coefficient is a measure function for evaluating the similarity of two samples, which is usually used to calculate the similarity of two samples, and the value range is between 0 and 1, and the larger the value is, the more similar it is.
[0093] In the embodiment, a plurality of medical images are obtained from the training sample set; a plurality of mean value images corresponding to the plurality of medical images are calculated according to pixel values of pixel points corresponding to labels of the plurality of medical images; the teacher network is trained according to the plurality of mean value images to update network parameters of the teacher network, and a new teacher network is obtained; the new teacher network is taken as the teacher network, a plurality of medical images not obtained are obtained from the training sample set, and the step of calculating a plurality of mean value images corresponding to the plurality of medical images according to pixel values of pixel points corresponding to labels of the plurality of medical images is executed until a cycle number reaches a first preset number, and a trained teacher network is obtained; the plurality of medical images are input into the student network, the plurality of mean value images corresponding to the plurality of medical images are input into the trained teacher network, and the last-but-one layer features of the trained teacher network and the student network are aligned by a knowledge distillation method, the student network is trained to update network parameters of the student network, and a new student network is obtained; the new student network is taken as the student network, the step of inputting the plurality of medical images into the student network, inputting the plurality of mean value images corresponding to the plurality of medical images into the trained teacher network, and aligning the last-but-one layer features of the trained teacher network and the student network by the knowledge distillation method to train the student network to update network parameters of the student network to obtain the new student network is executed until the cycle number reaches a second preset number, and the new student network is taken as a segmentation network; and the segmentation network is used to segment a medical image to be segmented. According to the embodiment, the teacher network is trained based on the mean value images containing only shape prior information, a trained teacher network capable of effectively encoding shape prior information is obtained, the plurality of medical images are input into the student network, the plurality of mean value images corresponding to the plurality of medical images are input into the trained teacher network, and the last-but-one layer features of the trained teacher network and the student network are aligned by the knowledge distillation method, that is, the transmission of shape prior information is completed, so that the student network can effectively and explicitly fuse shape prior information from the feature layer, the student network is trained based on the medical images and the shape prior information, after the training, the segmentation network obtained by explicitly fusing the shape prior information is used to segment the medical image to be segmented, and the entire segmentation process does not increase any time and calculation cost, and the medical image segmentation efficiency and the accuracy of the result are improved.
[0094] Further, in an embodiment, the teacher network and the student network are convolutional neural networks with the same structure.
[0095] In the embodiment, the teacher network and the student network are convolutional neural networks with the same structure, so that the features of the last-but-one layer of the student network and the features of the last-but-one layer of the teacher network are constantly close to each other in the network iterative training process, that is, the transmission of shape prior information learned by the teacher network to the student network is completed.
[0096] In a second aspect, the embodiments of the present application further provide a medical image segmentation device.
[0097] In an embodiment, the medical image segmentation device comprises: Figure 4 Figure 4 FIG. 1 is a schematic diagram of functional modules of an embodiment of the medical image segmentation device of the present application. As shown in FIG. 1, the medical image segmentation device comprises: Figure 4
[0098] The first obtaining module 10 is configured to obtain a plurality of medical images from a training sample set;
[0099] The calculating module 20 is configured to calculate a plurality of mean images corresponding to the plurality of medical images respectively according to pixel values of pixel points corresponding to labels of the plurality of medical images;
[0100] The first training module 30 is configured to train the teacher network according to the plurality of mean images to update network parameters of the teacher network, and obtain a new teacher network;
[0101] The first loop module 40 is configured to obtain a plurality of medical images that have not been obtained from the training sample set with the new teacher network as the teacher network, and return to execute the step of calculating a plurality of mean images corresponding to the plurality of medical images according to pixel values of pixel points corresponding to labels of the plurality of medical images until the number of loops reaches a first preset number, and obtain a trained teacher network;
[0102] The second training module 50 is configured to input the plurality of medical images into the student network, input the plurality of mean images corresponding to the plurality of medical images into the trained teacher network, and train the student network by aligning the second-to-last layer features of the trained teacher network and the student network through the method of knowledge distillation to update network parameters of the student network, and obtain a new student network;
[0103] The second loop module 60 is configured to obtain a plurality of medical images that have not been obtained from the training sample set with the new student network as the student network, and return to execute the step of inputting the plurality of medical images into the student network, inputting the plurality of mean images corresponding to the plurality of medical images into the trained teacher network, and training the student network by aligning the second-to-last layer features of the trained teacher network and the student network through the method of knowledge distillation to update network parameters of the student network, and obtain a new student network until the number of loops reaches a second preset number, and then take the new student network as a segmentation network;
[0104] The segmentation module 70 is configured to segment a to-be-segmented medical image based on the segmentation network.
[0105] Further, in an embodiment, the calculating module 20 is configured to:
[0106] respectively based on the pixel values of the pixel points corresponding to the labels of the medical images, to obtain average pixel values corresponding to each of the medical images;
[0107] respectively replace the pixel values of the pixel points corresponding to the labels of each of the medical images with the average pixel values corresponding thereto, to obtain mean images corresponding to each of the medical images and containing only shape prior information.
[0108] Further, in an embodiment, the first training module 30 is configured to
[0109] calculate a first loss mean value between the pixel points corresponding to the segmentation images output by the teacher network and the pixel points corresponding to the labels of the medical images;
[0110] update the network parameters of the teacher network based on the first loss mean value, to obtain a new teacher network.
[0111] Further, in an embodiment, the second training module 50 is configured to:
[0112] input the medical images into the student network, to obtain segmentation images output by the student network;
[0113] calculate a second loss mean value between the pixel points corresponding to the segmentation images output by the student network and the pixel points corresponding to the labels of the medical images;
[0114] input the mean images corresponding to the medical images into the trained teacher network, to obtain several encoded shape prior information of the penultimate layer features of the trained teacher network;
[0115] pass the several encoded shape prior information of the penultimate layer features of the trained teacher network to the student network, and calculate a third loss mean value between the penultimate layer features of the trained teacher network and the penultimate layer features of the student network through a distillation loss function;
[0116] update the network parameters of the student network based on the sum of the second loss mean value and the third loss mean value, to obtain a new student network.
[0117] Further, in an embodiment, the teacher network and the student network are convolutional neural networks with the same structure.
[0118] The functions of the modules in the medical image segmentation apparatus correspond to the steps in the medical image segmentation method, and thus the functions and implementation processes of the modules will not be described here.
[0119] In a third aspect, an embodiment of the present application provides a medical image segmentation device, which can be a personal computer (PC), a notebook computer, a server, or the like device having a data processing function.
[0120] With reference to Figure 5 , Figure 5 Fig. 1 is a schematic diagram of a hardware structure of a medical image segmentation device according to an embodiment of the present application. In the embodiment of the present application, the medical image segmentation device can include a processor 1001 (for example, a central processing unit (CPU)), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to realize the connection and communication among the components; the user interface 1003 can include a display screen and an input unit such as a keyboard; the network interface 1004 can optionally include a standard wired interface and a wireless interface (for example, a wireless fidelity (WI-FI) interface); the memory 1005 can be a high-speed random access memory (RAM) or a stable memory (for example, a disk memory), and the memory 1005 can optionally be a storage device independent of the processor 1001. Those skilled in the art can understand that the hardware structure shown in Fig. 1 does not constitute a limitation on the present application, and can include more or fewer components than those shown in the figure, or combine certain components, or arrange different components. Figure 5 The hardware structure shown in Fig. 1 does not constitute a limitation on the present application, and can include more or fewer components than those shown in the figure, or combine certain components, or arrange different components.
[0121] With reference to Figure 5 , Figure 5 The memory 1005 as a computer storage medium in the embodiment of the present application can include an operating system, a network communication module, a user interface module, and a medical image segmentation program. The processor 1001 can call the medical image segmentation program stored in the memory 1005 and execute the medical image segmentation method provided by the embodiment of the present application.
[0122] In a fourth aspect, an embodiment of the present application further provides a readable storage medium.
[0123] The readable storage medium of the present application stores a medical image segmentation program, wherein the medical image segmentation program is executed by a processor to realize the steps of the medical image segmentation method as described above.
[0124] The method realized by the medical image segmentation program when executed can refer to each embodiment of the medical image segmentation method of the present application, and will not be described here again.
[0125] It should be noted that, in this document, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element preceded by "comprises... a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that comprises the recited element.
[0126] The above-mentioned embodiment numbers of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0127] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be realized by means of software and the necessary general hardware platform, of course, they can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk) as described above, and includes a number of instructions for causing a terminal device to execute the methods described in the various embodiments of the present application.
[0128] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent flow transformation made by using the content of the specification and drawings, or directly or indirectly applied to other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A medical image segmentation method characterized by, The medical image segmentation method comprises: Obtaining a plurality of medical images from a training sample set; According to the pixel values of the pixel points corresponding to the labels of the plurality of medical images, a plurality of mean value images corresponding to the plurality of medical images are calculated; The teacher network is trained according to the plurality of mean value images to update the network parameters of the teacher network, and a new teacher network is obtained; With the new teacher network as the teacher network, a plurality of medical images not obtained from the training sample set are obtained, and the step of calculating the plurality of mean value images corresponding to the plurality of medical images according to the pixel values of the pixel points corresponding to the labels of the plurality of medical images is returned to be executed until the number of cycles reaches a first preset number, and a trained teacher network is obtained; The plurality of medical images are input into the student network, the plurality of mean value images corresponding to the plurality of medical images are input into the trained teacher network, and the last second layer features of the trained teacher network and the student network are aligned by the method of knowledge distillation, the student network is trained to update the network parameters of the student network, and a new student network is obtained; With the new student network as the student network, a plurality of medical images not obtained from the training sample set are obtained, and the step of inputting the plurality of medical images into the student network, inputting the plurality of mean value images corresponding to the plurality of medical images into the trained teacher network, and aligning the last second layer features of the trained teacher network and the student network by the method of knowledge distillation to train the student network to update the network parameters of the student network to obtain a new student network is returned to be executed until the number of cycles reaches a second preset number, and the new student network is taken as a segmentation network; Segmenting a to-be-segmented medical image based on the segmentation network; The step of calculating the plurality of mean value images according to the pixel values of the pixel points corresponding to the labels of the plurality of medical images comprises: The average pixel value of each medical image is calculated based on the pixel values of the pixel points corresponding to the labels of the plurality of medical images; The average pixel value corresponding to each medical image is replaced with the pixel value of the pixel point corresponding to the label of each medical image to obtain a mean value image containing only shape prior information corresponding to each medical image; The step of inputting the plurality of medical images into the student network, inputting the plurality of mean value images corresponding to the plurality of medical images into the trained teacher network, and aligning the last second layer features of the trained teacher network and the student network by the method of knowledge distillation to train the student network to update the network parameters of the student network to obtain a new student network comprises: The plurality of medical images are input into the student network to obtain a plurality of segmentation images output by the student network; A second loss mean value between the pixel points corresponding to the plurality of segmentation images output by the student network and the pixel points corresponding to the labels of the plurality of medical images is calculated; The plurality of mean value images corresponding to the plurality of medical images are input into the trained teacher network to obtain a plurality of encoded shape prior information of the last second layer features of the trained teacher network; The shape prior information of the last-but-one layer features of the trained teacher network is transmitted to the student network, and a third loss mean value between the last-but-one layer features of the trained teacher network and the last-but-one layer features of the student network is calculated through a distillation loss function; The network parameters of the student network are updated based on the sum of the second loss mean value and the third loss mean value to obtain a new student network.
2. The medical image segmentation method of claim 1, wherein, The step of training the teacher network according to the plurality of mean value images to update the network parameters of the teacher network to obtain a new teacher network comprises: calculating a first loss mean value between pixel points of a plurality of segmentation images output by the teacher network and pixel points corresponding to labels of the plurality of medical images; updating the network parameters of the teacher network based on the first loss mean value to obtain a new teacher network.
3. The medical image segmentation method of any one of claims 1 to 2, wherein, The teacher network and the student network are convolutional neural networks with the same structure.
4. A medical image segmentation apparatus characterized by comprising: The medical image segmentation device comprises: a first acquisition module configured to acquire a plurality of medical images from a training sample set; a calculation module configured to calculate a plurality of mean value images corresponding to the plurality of medical images according to pixel values of pixel points corresponding to labels of the plurality of medical images, respectively; a first training module configured to train the teacher network according to the plurality of mean value images to update the network parameters of the teacher network to obtain a new teacher network; a first loop module configured to, with the new teacher network as the teacher network, acquire a plurality of medical images that have not been acquired from the training sample set, and return to execute the step of calculating a plurality of mean value images corresponding to the plurality of medical images according to pixel values of pixel points corresponding to labels of the plurality of medical images until a first preset number of times of looping is reached to obtain a trained teacher network; a second training module configured to input the plurality of medical images into the student network, input the plurality of mean value images corresponding to the plurality of medical images into the trained teacher network, and train the student network by aligning the last-but-one layer features of the trained teacher network and the student network through a knowledge distillation method to update the network parameters of the student network to obtain a new student network; a second loop module configured to, with the new student network as the student network, acquire a plurality of medical images that have not been acquired from the training sample set, and return to execute the step of inputting the plurality of medical images into the student network, inputting the plurality of mean value images corresponding to the plurality of medical images into the trained teacher network, and training the student network by aligning the last-but-one layer features of the trained teacher network and the student network through the knowledge distillation method to update the network parameters of the student network until a second preset number of times of looping is reached, and then taking the new student network as a segmentation network; a segmentation module configured to segment a medical image to be segmented based on the segmentation network. The calculation module is specifically configured to: calculate an average pixel value corresponding to each medical image based on pixel values of pixel points corresponding to labels of the plurality of medical images, respectively; replace the pixel values of the pixel points corresponding to the labels of each medical image with the average pixel value corresponding to the medical image to obtain a mean value image of each medical image containing only shape prior information. Input a plurality of medical images into the student network to obtain a plurality of segmentation images output by the student network; The second training module is specifically configured to: Calculate a second loss mean value between pixel points corresponding to the plurality of segmentation images output by the student network and pixel points corresponding to labels of the plurality of medical images; Input the mean value images corresponding to the plurality of medical images into the trained teacher network to obtain a plurality of encoded shape priori information of the penultimate layer features of the trained teacher network; Transmit the plurality of encoded shape priori information of the penultimate layer features of the trained teacher network to the student network, and calculate a third loss mean value between the penultimate layer features of the trained teacher network and the penultimate layer features of the student network through a distillation loss function; Update the network parameters of the student network based on the sum of the second loss mean value and the third loss mean value to obtain a new student network.
5. A medical image segmentation apparatus characterized by comprising: The medical image segmentation device includes a processor, a memory, and a medical image segmentation program stored on the memory and executable by the processor, wherein when the medical image segmentation program is executed by the processor, the steps of the medical image segmentation method according to any one of claims 1 to 2 are implemented.
6. A readable storage medium, characterized by, The readable storage medium stores a medical image segmentation program, wherein when the medical image segmentation program is executed by the processor, the steps of the medical image segmentation method according to any one of claims 1 to 2 are implemented.
Citation Information
Patent Citations
Neural network training method, image processing method and device
CN111489365A
Real-time colonoscopy image segmentation method and device based on ensemble and knowledge distillation
WO2022057078A1