Medical image segmentation model training methods, devices, servers, and storage media
By using a self-evolutionary system of student and teacher networks and optimizing the student network with differential features and composite loss functions, the problems of unstable and limited accuracy in the segmentation of complex boundaries in medical images are solved, and high-precision medical image segmentation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-29
- Publication Date
- 2026-03-31
AI Technical Summary
Existing semi-supervised learning and knowledge distillation methods are unstable and have limited accuracy in segmenting complex boundaries in medical images.
A self-evolutionary system of student and teacher networks is adopted. Coarse and refined prediction results are generated through a shared encoder and semantic refinement decoder. Combined with differential features and supervised student loss function, a composite loss function is constructed for backpropagation optimization, so as to realize the model’s active perception and reinforcement of its own prediction uncertainty.
It improves the model's accuracy and training stability in segmenting complex boundaries in medical images with limited labeled data.
Smart Images

Figure CN121600007B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of medical image segmentation, and in particular to a medical image segmentation model training method and device, a server and a storage medium. BACKGROUND
[0002] Image segmentation is a core task of computer vision, aiming to analyze and classify digital images at the pixel level, dividing images into multiple regions with semantic meaning, and realizing the identification, positioning and contouring of different objects in the scene. Image segmentation is the basis of advanced image understanding and plays a crucial role in medical image analysis and other fields.
[0003] In recent years, medical image segmentation techniques based on deep learning, especially neural network-based methods, have been widely used. However, such methods usually rely on a large amount of accurately labeled data for training, and the acquisition of high-quality labels requires a lot of professional manpower and time cost. Therefore, how to improve model performance under limited labeling conditions has become a key problem, and related technologies such as semi-supervised learning and knowledge distillation are attracting more and more research attention.
[0004] However, existing semi-supervised learning and knowledge distillation methods are still unstable for segmentation of complex boundaries in medical images, with limited accuracy. SUMMARY
[0005] The embodiments of the present application provide a medical image segmentation model training method, device, server and storage medium to solve the technical problems of instability and limited accuracy of complex boundary segmentation of medical images in the prior art under semi-supervised learning scenarios.
[0006] In a first aspect, the embodiments of the present application provide a medical image segmentation model training method, comprising:
[0007] Inputting the unlabeled training medical images into the student network and the teacher network for preliminary training, and generating rough student prediction results and teacher prediction results through the shared encoder and the semantic refinement decoder;
[0008] Inputting the labeled training medical images into the student network to obtain labeled student prediction results;
[0009] Subtracting the intermediate features generated by the auxiliary decoder and the semantic refinement decoder in the student network to form difference features;
[0010] Inputting the unlabeled training medical images and the difference features into the shared encoder and the semantic refinement decoder to generate refined student prediction results;
[0011] Calculating the labeled student prediction results and the real labels to generate a supervised student loss function;
[0012] The coarse student prediction results, teacher prediction results, refined student prediction results, and supervised student loss function are combined with variable weights to construct a composite loss function. The parameters of the student network are then optimized by backpropagation using the composite loss function.
[0013] Secondly, embodiments of the present invention also provide a model training device for medical image segmentation, comprising:
[0014] The initial training module is used to input unlabeled training medical images into the student network and the teacher network for initial training, and then generate coarse student prediction results and teacher prediction results through a shared encoder and semantic refinement decoder.
[0015] The labeled student prediction result generation module is used to input labeled training medical images into the student network to obtain labeled student prediction results;
[0016] The difference feature map generation module is used to subtract the intermediate features generated by the auxiliary decoder and the semantic refinement decoder in the student network to form difference features;
[0017] The module for generating refined student prediction results is used to input unlabeled training medical images and differential features into a shared encoder and a semantic refinement decoder to generate refined student prediction results.
[0018] The loss function generation module is used to calculate and generate a supervised student loss function from the labeled student prediction results and the real labels;
[0019] The optimization module is used to combine the coarse student prediction results, teacher prediction results, refined student prediction results, and supervised student loss function with variable weights to construct a composite loss function, and then use the composite loss function to backpropagate and optimize the parameters of the student network.
[0020] Thirdly, embodiments of the present invention also provide a server, comprising:
[0021] One or more processors;
[0022] Storage device for storing one or more programs;
[0023] When the one or more programs are executed by the one or more processors, the one or more processors implement the medical image segmentation model training method provided in the above embodiments.
[0024] Fourthly, embodiments of the present invention also provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the model training method for medical image segmentation as provided in the above embodiments.
[0025] The medical image segmentation model training method, apparatus, server, and storage medium provided in this invention involve inputting unlabeled training medical images into a student network and a teacher network for initial training, generating coarse student prediction results and teacher prediction results via a shared encoder and a semantic refinement decoder; inputting labeled training medical images into the student network to obtain labeled student prediction results; subtracting the intermediate features generated by the auxiliary decoder and the semantic refinement decoder in the student network to form difference features; inputting the unlabeled training medical images and difference features into the shared encoder and the semantic refinement decoder to generate refined student prediction results; calculating the supervised student loss function by combining the labeled student prediction results and the ground truth labels; and combining the coarse student prediction results, teacher prediction results, refined student prediction results, and supervised student loss function with variable weights to construct a composite loss function, which is then used for backpropagation to optimize the parameters of the student network. By designing student and teacher networks that include an auxiliary decoder, a target decoder, and a semantic refinement decoder, and introducing a two-stage self-correction training mechanism based on difference features, the model actively perceives and strengthens its own prediction uncertainty, effectively improving the model's accuracy and training stability for segmenting complex boundaries in medical images with limited labeled data. Attached Figure Description
[0026] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0027] Figure 1 This is a flowchart of the medical image segmentation model training method provided in Embodiment 1 of the present invention;
[0028] Figure 2 This is a flowchart of the method for generating a supervised student loss function for training a medical image segmentation model, as provided in Embodiment 1 of the present invention.
[0029] Figure 3 This is a flowchart of the construction of the composite loss function in the model training method for medical image segmentation provided in Embodiment 1 of the present invention;
[0030] Figure 4 This is a schematic diagram of the structure of the medical image segmentation model training device provided in Embodiment 2 of the present invention;
[0031] Figure 5 This is a schematic diagram of the server structure provided in Embodiment 3 of the present invention. Detailed Implementation
[0032] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.
[0033] Example 1
[0034] Figure 1 This is a flowchart of the model training method for medical image segmentation provided in Embodiment 1 of the present invention. This embodiment is applicable to high-precision, semi-supervised image segmentation of medical images when labeled data is scarce. Specifically, it includes the following steps:
[0035] Step 110: Input the unlabeled training medical images into the student network and teacher network respectively for preliminary training, and generate coarse student prediction results and teacher prediction results through a shared encoder and semantic refinement decoder.
[0036] Label-free training medical images refer to raw medical image data, such as MRI and CT scan sequences, that have not undergone pixel-level segmentation and annotation by human experts. These images are easy to acquire on a large scale but lack direct supervision signals. Their core value lies in providing the model with rich anatomical context and morphological priors.
[0037] The student network is the core model, whose parameters can be updated via gradients. For example, the student model network structure can include a shared encoder and three functionally specialized parallel decoding branches: a difference-contrast decoder, a target feature decoder, and a semantic refinement decoder. The student network is not only responsible for processing labeled data to learn basic features, but also performs two forward propagations on unlabeled data: the first generates initial predictions and extracts internal "difference features," and the second injects these features as perturbations to complete targeted self-correction learning, making it a "learner" with proactive diagnostic and evolutionary capabilities.
[0038] The teacher network is structurally identical to the student network, but its parameters are not directly updated via gradient backpropagation. To provide a smooth, reliable, and stable guide for predicting outputs, its network parameters are calculated using an exponential moving average of the student network's historical parameters. The primary responsibility of the teacher network is to generate high-quality pseudo-labels for the same unlabeled data, providing a consistent supervisory objective for students throughout their learning process.
[0039] The relationship between the student network and the teacher network constitutes a self-evolving system. The student network serves as the frontier, actively exploring and rapidly updating, while the teacher network acts as the rear, consolidating historical experience and providing stable guidance. Through exponential moving average updates, the teacher network continuously absorbs robust knowledge from the evolution of the student network, while the generated stable pseudo-labels, in turn, constrain and guide the predictions of the student network. This design enables the student network to fully utilize unlabeled data and, under the robust guidance of the teacher, efficiently perform self-diagnosis and correction, ultimately achieving steady performance improvement.
[0040] For example, a shared encoder can be used to perform multi-level feature extraction on input medical images. Specifically, the shared encoder includes multiple downsampling layers, capable of progressively extracting and outputting feature map sets at different scales. Where s represents the feature scale. After all downsampling layers have processed the data, the connection is processed by the bottleneck layer, which embeds a semantic cohesive attention module. The semantic cohesive attention module first processes the downsampling features... Pooling and flattening operations are performed to compress the feature sequence into a fixed-length feature sequence. A multi-head self-attention mechanism is used to linearly map the feature sequence into query (q), key (k), and value (v) vectors, and scaled dot-product attention is used to model the global relationships between sequence elements. Finally, the outputs of all attention heads are merged, integrated through linear projection and a non-linear activation function, and upsampled to the original downsampled features. The resolution is adjusted, and the generated global attention features are then injected back into the downsampled features via residual connections to generate an attention-enhanced bottleneck representation. Finally, the shared encoder outputs attention-enhanced encoded features for further use by the decoder.
[0041] For example, a semantic refinement decoder may include a multi-level upsampling group and a classification head, with the classification head being the last concatenation of the multi-level upsampling group to output the prediction result. Each upsampling group includes a bridging fusion module, which receives output features from each downsampling layer of the shared encoder. The bridging and fusion module first combines the output features downsampled at each layer with the output features of the target decoder at the same scale. The size of the shared encoder is adjusted to match the output features of the target decoder, resulting in the downsampled output features of each layer after size adjustment. A gated aggregation function is used to fuse the downsampled output features of each layer of the shared encoder to obtain a single feature map. Then, the single feature map is fused with the output features of the target decoder to generate aggregated features. Finally, convolutional decoding is performed on the aggregated features to generate the decoded features at the current scale, and the decoded features are fed back into the shared encoder to update the feature representation of the next layer. This multi-level upsampling group is executed level by level, outputting the intermediate features corresponding to each level. and prediction results .
[0042] For example, both the auxiliary decoder and the target decoder in the student network and teacher network can adopt a top-down U-Net-style upsampling path and an end-classifying head structure. The auxiliary decoder, as the difference comparison branch, has the core function of generating intermediate features for comparison with the semantic refinement decoder, thereby calculating "difference features" representing inconsistencies within the model to drive subsequent self-correction. The target decoder, as the target feature branch of the bridging fusion module, is dedicated to providing detailed guided features for multi-scale feature fusion. It aligns with encoder features through gated aggregation to enhance boundary information and update the encoder's feature representation. The auxiliary decoder is used to output the prediction results. and the intermediate features corresponding to each layer The target decoder is used to output the prediction result. and the intermediate features corresponding to each layer , where s represents the feature scale.
[0043] For example, in the first learning phase, unlabeled training medical images are input into the student network and the teacher network respectively, and processed by the semantic refinement decoder in each network to generate corresponding coarse student prediction results and teacher prediction results.
[0044] Step 120: Input the labeled training medical images into the student network to obtain the labeled student prediction results.
[0045] Labeled training medical images refer to medical image data that has been meticulously annotated at the pixel level by professional physicians, such as MRI images with lesion outline annotations or CT sequences with organ boundary annotations. Acquiring and annotating these images is costly and limited in quantity, but their core value lies in providing accurate and reliable supervision signals for the model, serving as the basis for learning segmentation boundaries, shape priors, and category discrimination during the training phase.
[0046] For example, in the first learning phase, labeled training medical images are simultaneously input into the student network. These images are first processed by a shared encoder to extract multi-scale features, and then processed by an auxiliary decoder, an object decoder, and a semantic refinement decoder. The auxiliary decoder outputs intermediate features. Semantic refinement decoder outputs intermediate features and the prediction results of the semantic refinement decoder The prediction results This refers to the labeled student prediction results obtained in this stage.
[0047] Step 130: Subtract the intermediate features generated by the auxiliary decoder and the semantic refinement decoder in the student network to form the difference features.
[0048] The difference feature is the core medium for the model's self-evolution in this embodiment. It is obtained by calculating the difference between the intermediate feature maps of the auxiliary decoder and the semantic refinement decoder. This difference is not a simple error, but a quantitative expression of the inconsistency in the understanding of the same data by the two independent decision paths within the model. Due to the functional differentiation between the auxiliary decoder and the semantic refinement decoder, the former focuses more on generating a comparative benchmark, while the latter is committed to fusing global and local information to output refined predictions. The difference between the two in the feature space precisely maps the bottleneck of the model in areas where complex boundaries are difficult to define.
[0049] For example, in the first learning phase, the intermediate features extracted from the labeled training medical image input student network in step 120 can be used to construct differential features for self-correction. Specifically, this involves using the feature sets output by the auxiliary decoder at various scales. Feature set corresponding to the scale of semantic refinement decoder By performing layer-by-layer, element-by-element subtraction operations, the differential features can be obtained. .
[0050] Step 140: Input the unlabeled training medical image and differential features into the shared encoder and semantic refinement decoder to generate refined student prediction results.
[0051] For example, step 140 corresponds to the second learning stage, which aims to use the differential features generated in the first learning stage as perturbation signals to drive the model to complete self-correction learning. First, unlabeled training medical images are input into the shared encoder of the student network. During the layer-by-layer feature extraction process in the encoder's multi-level downsampling layers, the differential features at the corresponding scale are fused with the input features of the current layer using a preset learnable or fixed weight as a hyperparameter. This is achieved, for example, through element-wise addition or channel concatenation, to obtain the fused features, i.e., the perturbation-enhanced encoded features. Subsequently, the enhanced features, infused with self-awareness information, are fed into the decoder for further processing. Because the encoded features are injected with attention signals to weak regions, the segmentation prediction regenerated by the decoder will focus more on overcoming inconsistencies. The final output is a refined student prediction result after self-correction and refinement, which is more accurate than the coarse prediction in the first stage.
[0052] Step 150: Calculate the supervised student loss function by combining the labeled student predictions and the true labels.
[0053] In the field of deep learning, the loss function is a core component in model training. Essentially, it is a mathematical function that measures the difference between the model's predicted output and the true target. The loss function acts as a compass in the training process, providing a clear direction and magnitude for optimization algorithms (such as gradient descent). The goal is to minimize the value of the loss function by iteratively updating the model parameters, thereby driving the model's predictions to be as close to reality as possible.
[0054] Figure 2 This is a flowchart illustrating the generation of the supervised student loss function in the model training method for medical image segmentation according to Embodiment 1 of the present invention, as shown below. Figure 2 The process of generating the supervised student loss function may include the following steps:
[0055] Step 210: Based on the labeled student prediction results and the true labels, calculate the Dice loss and cross-entropy loss.
[0056] Dice loss is a region-matching loss function widely used in image segmentation, particularly in medical image segmentation. It originates from the Sørensen-Dice coefficient, a statistic used to measure the similarity between two sample sets. In segmentation tasks, the core idea of Dice loss is to directly optimize the overlap area between the model-predicted segmented region and the ground truth labeled region. In medical images, the number of pixels in the target region (such as tumors or specific organs) is often far less than the number of pixels in the background. By focusing on the proportion of the overlapping region rather than the absolute number of pixels, Dice loss effectively guides the model to focus on learning to correctly segment the foreground target, rather than being dominated by a large background region. This makes it one of the indispensable core loss functions in medical image segmentation.
[0057] Cross-entropy loss is the most fundamental and general loss function for classification tasks in deep learning. It measures the difference between two probability distributions. In the context of image segmentation, it is typically calculated at the pixel level, treating each pixel as an independent classification task. Unlike Dice loss, which focuses on overlapping regions, cross-entropy loss emphasizes the correctness and confidence of each pixel's classification. It provides the model with very detailed and stable gradient signals, which is particularly beneficial for the model to learn clear boundaries.
[0058] For example, the labeled student predictions generated in step 120 and the true labels can be used as input to calculate the Dice loss and cross-entropy loss. The formula for calculating the Dice loss is as follows: Where X represents the true label and Y represents the predicted result for the labeled student. Let X represent the intersection of X and Y. The formula for calculating cross-entropy loss is: ,in, For real labels, To label student prediction results, The index for each category is used to iterate through the data, where n is the total number of categories.
[0059] Step 220: Combine the Dice loss with the cross-entropy loss to form a supervised student loss function.
[0060] Alternatively, a weighted summation method can be used, for example... ,in, These are the weighting coefficients. The Dice loss function, Let cross-entropy be the loss function. To supervise the student loss function, a weighted summation approach is used, aiming to allow the model to receive dual guidance from both global region matching and precise pixel classification. This combination leverages the complementary advantages of the two loss functions, making the supervision signal more comprehensive and robust, thereby more effectively driving the student model to learn accurate segmentation capabilities from limited labeled data.
[0061] Steps 210 and 220 complete the construction of the supervised student loss function.
[0062] Step 160: Combine the coarse student prediction results, teacher prediction results, refined student prediction results, and supervised student loss function with variable weights to construct a composite loss function, and use the composite loss function for backpropagation to optimize the parameters of the student network.
[0063] Figure 3 This is a flowchart illustrating the construction of the composite loss function in the model training method for medical image segmentation according to Embodiment 1 of the present invention, as shown below. Figure 3 The construction of the composite loss function may include the following steps:
[0064] Step 310: Calculate the first consistency loss based on the coarse student prediction results and teacher prediction results.
[0065] The consistency loss function is one of the core supervision mechanisms in semi-supervised learning. Its core idea is to impose consistency constraints on the model rather than directly using the true labels. It is usually based on an important assumption: for a true input, even after appropriate perturbations or changes, the model's predicted output distribution should remain stable and consistent.
[0066] For example, the coarse student predictions obtained in step 110 and the corresponding teacher predictions can be used as the basis for calculation. By measuring the difference between their probability distributions, the first consistency loss can be calculated. The loss function aims to constrain the student model's predictions in the first stage to align with the more stable and reliable teacher predictions, thereby achieving initial consistency learning and knowledge transfer on unlabeled data.
[0067] Step 320: Calculate the second consistency loss based on the refined student prediction results and teacher prediction results.
[0068] For example, the second-stage refined student predictions and teacher predictions generated in step 140 can be used as the basis for calculation. The second consistency loss is calculated by measuring the difference between their probability distributions. Optionally, the Kullback-Leibler divergence can be used as the metric function, with the teacher prediction distribution as the benchmark, to calculate the difference between the refined student predictions and the teacher predictions. The core purpose of this loss function is to constrain the student network to maintain consistency with the pseudo-labels provided by the teacher model after completing self-correction based on the difference features, thereby ensuring the correctness of the correction direction.
[0069] Step 330: Calculate the average of the first consistency loss and the second consistency loss, and combine the average value with the supervised student loss function with variable weights to construct a composite loss function.
[0070] For example, constructing a composite loss function for jointly optimizing the model is a key step. Step 330 can be achieved as follows: First, the arithmetic mean of the first consistency loss calculated in step 310 (i.e., the prediction constrained in the first stage) and the second consistency loss calculated in step 320 (i.e., the prediction after correction constrained in the second stage) is taken. The purpose is to balance the consistency constraint strength of the model at different learning stages and form a comprehensive consistency supervision signal. Subsequently, the average value and the supervised student loss calculated in step 150 based on labeled data are weighted and summed according to preset weight coefficients (such as λ and 1-λ). Finally, the final composite loss function is constructed through the formula, realizing the dynamic balance and co-optimization of supervised and unsupervised consistency signals. This allows the model to make full use of a small amount of labeled data while effectively guiding the learning of robust and consistent feature representations from a large amount of unlabeled data.
[0071] The composite loss value obtained after forward propagation comprehensively quantifies the supervision error and consistency bias present in the student model's current predictions. Subsequently, the system uses backpropagation, an automatic differentiation process based on the chain rule, to calculate the gradient of the composite loss function with respect to each trainable parameter in the student model (such as convolutional kernel weights and bias terms). These gradients clearly indicate the direction and theoretical magnitude of adjustment for each parameter, aiming to reduce the total loss in the most efficient way. Finally, the optimizer updates all parameters of the student model according to these gradients and preset rules such as the learning rate. Through this iterative process, the parameters of the student network are continuously adjusted, causing its predicted output to increasingly approximate the true labels and maintain consistency with the teacher model, thereby achieving model self-optimization and performance improvement.
[0072] This embodiment performs initial training by inputting unlabeled training medical images into a student network and a teacher network, respectively. A coarse student prediction and a teacher prediction are generated using a shared encoder and a semantic refinement decoder. Labeled training medical images are then input into the student network to obtain labeled student predictions. The intermediate features generated by the auxiliary decoder and the semantic refinement decoder in the student network are subtracted to form a difference feature. The unlabeled training medical images and the difference feature are then input into the shared encoder and the semantic refinement decoder to generate a refined student prediction. The labeled student predictions and the ground truth labels are used to calculate a supervised student loss function. The coarse student prediction, teacher prediction, refined student prediction, and supervised student loss function are combined with variable weights to construct a composite loss function. This composite loss function is then used for backpropagation to optimize the parameters of the student network. By designing student and teacher networks that include an auxiliary decoder, a target decoder, and a semantic refinement decoder, and introducing a two-stage self-correction training mechanism based on difference features, the model actively perceives and strengthens its own prediction uncertainty, effectively improving the model's accuracy and training stability for segmenting complex boundaries in medical images with limited labeled data.
[0073] Example 2
[0074] Figure 4 This is a schematic diagram of the structure of the medical image segmentation model training device provided in Embodiment 2 of the present invention, as shown below. Figure 4 As shown, the device includes:
[0075] The preliminary training module 410 is used to input unlabeled training medical images into the student network and the teacher network for preliminary training, and generate coarse student prediction results and teacher prediction results through a shared encoder and a semantic refinement decoder.
[0076] The labeled student prediction result generation module 420 is used to input labeled training medical images into the student network to obtain labeled student prediction results;
[0077] The difference feature map generation module 430 is used to subtract the intermediate features generated by the auxiliary decoder and the semantic refinement decoder in the student network to form difference features;
[0078] The refined student prediction result generation module 440 is used to input unlabeled training medical images and differential features into a shared encoder and a semantic refinement decoder to generate refined student prediction results;
[0079] The loss function generation module 450 is used to calculate and generate a supervised student loss function from the labeled student prediction results and the real labels;
[0080] The optimization module 460 is used to combine the coarse student prediction results, teacher prediction results, refined student prediction results and supervised student loss function with variable weights to construct a composite loss function, and to optimize the parameters of the student network by backpropagation using the composite loss function.
[0081] The medical image segmentation model training device provided in this embodiment initially trains the model by inputting unlabeled training medical images into a student network and a teacher network, respectively. A coarse student prediction result and a teacher prediction result are generated by a shared encoder and a semantic refinement decoder. Labeled training medical images are then input into the student network to obtain labeled student prediction results. The intermediate features generated by the auxiliary decoder and the semantic refinement decoder in the student network are subtracted to form a difference feature. The unlabeled training medical images and the difference feature are then input into the shared encoder and the semantic refinement decoder to generate a refined student prediction result. The labeled student prediction result and the ground truth labels are used to calculate a supervised student loss function. The coarse student prediction result, the teacher prediction result, the refined student prediction result, and the supervised student loss function are combined with variable weights to construct a composite loss function. This composite loss function is then used for backpropagation to optimize the parameters of the student network. By designing student and teacher networks that include an auxiliary decoder, a target decoder, and a semantic refinement decoder, and introducing a two-stage self-correction training mechanism based on difference features, the model actively perceives and strengthens its own prediction uncertainty, effectively improving the model's accuracy and training stability for segmenting complex boundaries in medical images with limited labeled data.
[0082] Based on the above embodiments, the refined student prediction result generation module 440 includes:
[0083] The feature fusion unit is used to input the labelless training medical image into the shared encoder. During the process of the shared encoder encoding the labelless training medical image layer by layer, the difference features are fused with the input features of each layer according to a preset weight to obtain the fused features.
[0084] The target decoding feature generation unit is used to generate target decoding features by passing the fused features through the target decoder.
[0085] The refined student prediction result generation unit is used to process the fused features and target decoded features through a semantic refinement decoder to generate refined student prediction results.
[0086] Based on the above embodiments, the loss function generation module 450 includes:
[0087] The loss function combination unit is used to calculate Dice loss and cross-entropy loss based on the labeled student prediction results and the true labels;
[0088] The supervised student loss function generation unit is used to combine the Dice loss with the cross-entropy loss to form the supervised student loss function.
[0089] Based on the above embodiments, the optimization module 460 includes:
[0090] The first consistency loss generation unit is used to calculate the first consistency loss based on the coarse student prediction results and the teacher prediction results;
[0091] The second consistency loss generation unit is used to calculate the second consistency loss based on the refined student prediction results and teacher prediction results.
[0092] The composite loss function generation unit is used to calculate the average of the first consistency loss and the second consistency loss, and to combine the average value with the supervised student loss function with variable weights to construct a composite loss function.
[0093] The medical image segmentation model training device provided in this embodiment of the invention can execute the medical image segmentation model training method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0094] Example 3
[0095] Figure 5 This is a schematic diagram of the structure of a server provided in Embodiment 3 of the present invention. Figure 5 A block diagram is shown of an exemplary server 12 suitable for implementing embodiments of the present invention. Figure 5 The server 12 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0096] like Figure 5As shown, server 12 is presented in the form of a general-purpose computing server. The components of server 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and bus 18 connecting different system components (including system memory 28 and processing unit 16).
[0097] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0098] Server 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by server 12, including volatile and non-volatile media, removable and non-removable media.
[0099] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache 32. Server 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (… Figure 5 Not shown; usually referred to as a "hard drive"). Although Figure 5 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0100] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of the present invention.
[0101] Server 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing server, display 24, etc.), and with one or more servers that enable users to interact with server 12, and / or with any server (e.g., network card, modem, etc.) that enables server 12 to communicate with one or more other computing servers. This communication can be performed via input / output (I / O) interface 22. Furthermore, server 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with other modules of server 12 via bus 18. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with server 12, including but not limited to: microcode, server drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0102] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the medical image segmentation model training method provided in the embodiments of the present invention.
[0103] Example 4
[0104] Embodiment 4 of the present invention also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform a model training method for medical image segmentation as described in any of the above embodiments.
[0105] The computer storage medium of this invention can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0106] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0107] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0108] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0109] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A method for training a model for medical image segmentation, characterized in that, The application relates to a medical image segmentation method and device. The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The shared encoder is used for:
2. The method of claim 1, wherein, The medical image is input into a multi-level down-sampling layer for processing to obtain down-sampling features, and the down-sampling features are input into a bottleneck layer to generate attention-enhanced encoding features, and the multi-level down-sampling layer is used for extracting multi-scale features of the medical image. The bottleneck layer comprises a semantic condensation attention module, which is used for calculating global attention features by a multi-head self-attention mechanism, and the global attention features are injected back into the down-sampling features in a residual connection mode to generate the attention-enhanced encoding features. The semantic refinement decoder comprises:
3. The method of claim 1, wherein, A multi-level up-sampling group is used for outputting a prediction result. The up-sampling group is used for receiving output features of each layer of the shared encoder and output features of a target decoder, combining the output features of each layer of the shared encoder and the output features of the target decoder through a bridging fusion module to generate aggregated features, decoding the aggregated features through convolution operation to generate decoding features, and feeding the decoding features back into the shared encoder to update the next level features. The bridging fusion module is used for:
4. The method of claim 3, wherein, The size of the output features of each layer of the shared encoder is adjusted to be consistent with the output features of the target decoder through a size adjustment operation to obtain the size-adjusted output features of each layer of the shared encoder; The size-adjusted output features of each layer of the shared encoder are fused by using a gating aggregation function to generate a single feature map; The single feature map and the output features of the target decoder are fused to generate the aggregated features. The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; 5. The method of claim 3, wherein, The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a rough student prediction result and a teacher prediction result; The unmarked training medical image is input into a student network and a teacher network respectively for preliminary training, and a shared encoder and a semantic refinement decoder are used to generate a 6. The method of claim 1, wherein, The calculating the labeled student prediction result and the real label to generate a supervised student loss function comprises: calculating a Dice loss and a cross-entropy loss based on the labeled student prediction result and the real label; combining the Dice loss and the cross-entropy loss to form the supervised student loss function.
7. The method of claim 1, wherein, The variable weight combination of the coarse student prediction result, the teacher prediction result, the refined student prediction result and the supervised student loss function forms a compound loss function, comprising: calculating a first consistency loss based on the coarse student prediction result and the teacher prediction result; calculating a second consistency loss based on the refined student prediction result and the teacher prediction result; calculating the average value of the first consistency loss and the second consistency loss, and combining the average value and the supervised student loss function with variable weights to form a compound loss function.
8. A model training apparatus for medical image segmentation, characterized by, Comprise: a preliminary training module for inputting unmarked training medical images into a student network and a teacher network for preliminary training to generate a coarse student prediction result and a teacher prediction result through a shared encoder and a semantic refinement decoder; a labeled student prediction result generation module for inputting a marked training medical image into the student network to obtain a labeled student prediction result; a difference feature map generation module for subtracting the intermediate features generated by the auxiliary decoder and the semantic refinement decoder in the student network to form a difference feature; a refined student prediction result generation module for inputting unmarked training medical images and difference features into a shared encoder and a semantic refinement decoder to generate a refined student prediction result; a loss function generation module for calculating a labeled student prediction result and a real label to generate a supervised student loss function; an optimization module for variable weight combination of the coarse student prediction result, the teacher prediction result, the refined student prediction result and the supervised student loss function to form a compound loss function, and using the compound loss function to optimize the parameters of the student network.
9. A server, characterized by The server comprises: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the medical image segmentation model training method of any one of claims 1-7.
10. A storage medium containing computer executable instructions for executing the medical image segmentation model training method of any one of claims 1-7 when executed by a computer processor.
10. A storage medium containing computer executable instructions for executing the medical image segmentation model training method of any one of claims 1-7 when executed by a computer processor.
Citation Information
Patent Citations
Semi-supervised remote sensing image semantic segmentation model training method and device
CN120047948A
Self-adaption eye fundus image processing method and device based on passive field
CN121095215A