Model training method and device for medical image segmentation, server and storage medium

By designing a self-calibrating training method that includes a shared encoder, a semantic refinement decoder, and a teacher network, the problems of instability and limited accuracy in complex boundary segmentation of medical images were solved, and high-precision medical image segmentation was achieved.

CN121600007AActive Publication Date: 2026-03-03TIANJIN POLYTECHNIC UNIV
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202610121318.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-29
Publication Date
2026-03-03
Estimated Expiration
2046-01-29

AI Technical Summary

Technical Problem

Existing semi-supervised learning and knowledge distillation methods are unstable and have limited accuracy in segmenting complex boundaries in medical images.

Method used

A model training method incorporating a shared encoder, a semantic refinement decoder, and a teacher network is employed. Coarse prediction results and teacher prediction results are generated through label-free training. Discrepancy features are calculated, and optimization is achieved by combining supervised student loss function and composite loss function, thus realizing self-correcting training.

Benefits of technology

This improved the model's accuracy and training stability for segmenting complex boundaries on limited labeled data, achieving high-precision segmentation of complex boundaries in medical images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121600007A_ABST
    Figure CN121600007A_ABST
Patent Text Reader

Abstract

The invention discloses a medical image segmentation model training method and device, a server and a storage medium, and belongs to the technical field of medical image segmentation. Comprising the following steps: respectively inputting unmarked training medical images into a student network and a teacher network for preliminary training, and generating a rough student prediction result and a teacher prediction result; inputting the marked training medical image into a student network to obtain a marked student prediction result; subtracting the intermediate features generated by the auxiliary decoder and the semantic refinement decoder to form difference features; inputting the unmarked training medical image and the difference features into a shared encoder and a semantic refinement decoder to generate a refined student prediction result; and constructing a composite loss function, and performing back propagation optimization on parameters of the student network by using the composite loss function. By designing a multi-decoder network and a double-stage self-correction mechanism, the model can actively sense and optimize the uncertainty in prediction, and the segmentation precision and the training stability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical image segmentation technology, and in particular to a model training method, apparatus, server, and storage medium for medical image segmentation. Background Technology

[0002] Image segmentation is a core task in computer vision, aiming to perform pixel-level analysis and classification of digital images, dividing them into multiple semantically meaningful regions to enable the identification, localization, and contour delineation of different objects within a scene. Image segmentation is fundamental to advanced image understanding and plays a crucial role in fields such as medical image analysis.

[0003] In recent years, deep learning-based medical image segmentation techniques, especially neural network-based methods, have been widely applied. However, these methods typically rely on large amounts of precisely labeled data for training, and obtaining high-quality annotations requires significant professional manpower and time. Therefore, improving model performance under limited annotation conditions has become a key issue, and related techniques such as semi-supervised learning and knowledge distillation are receiving increasing research attention.

[0004] However, existing semi-supervised learning and knowledge distillation methods are still unstable and have limited accuracy in segmenting complex boundaries in medical images. Summary of the Invention

[0005] This invention provides a model training method, apparatus, server, and storage medium for medical image segmentation, to solve the technical problems of instability and limited accuracy in the segmentation of complex boundaries of medical images in semi-supervised learning scenarios in the prior art.

[0006] In a first aspect, embodiments of the present invention provide a model training method for medical image segmentation, comprising: Unlabeled training medical images are input into the student network and teacher network respectively for initial training. Coarse student prediction results and teacher prediction results are generated by a shared encoder and a semantic refinement decoder. Labeled training medical images are input into the student network to obtain labeled student prediction results; Subtract the intermediate features generated by the auxiliary decoder and the semantic refinement decoder in the student network to form the difference features; Label-free training medical images and differential features are input into a shared encoder and a semantic refinement decoder to generate refined student predictions. The supervised student loss function is generated by calculating the predicted results and the true labels of the labeled students. 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.

[0007] Secondly, embodiments of the present invention also provide a model training device for medical image segmentation, comprising: 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. 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; 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; 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. 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; 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.

[0008] Thirdly, embodiments of the present invention also provide a server, comprising: One or more processors; 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 provided in the above embodiments.

[0009] 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.

[0010] 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

[0011] 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.

[0012] Figure 1 This is a flowchart of the medical image segmentation model training method provided in Embodiment 1 of the present invention; 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. 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; 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; Figure 5 This is a schematic diagram of the server structure provided in Embodiment 3 of the present invention. Detailed Implementation

[0013] 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.

[0014] Example 1 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: 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.

[0015] 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.

[0016] 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.

[0017] 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.

[0018] 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.

[0019] 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.

[0020] 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 .

[0021] 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.

[0022] 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.

[0023] Step 120: Input the labeled training medical images into the student network to obtain the labeled student prediction results.

[0024] 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.

[0025] 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.

[0026] 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.

[0027] 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.

[0028] 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. .

[0029] 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.

[0030] 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.

[0031] Step 150: Calculate the supervised student loss function by combining the labeled student predictions and the true labels.

[0032] 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.

[0033] 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. Figure 2 The process of generating the supervised student loss function may include the following steps: Step 210: Based on the labeled student prediction results and the true labels, calculate the Dice loss and cross-entropy loss.

[0034] 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.

[0035] 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.

[0036] 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.

[0037] Step 220: Combine the Dice loss with the cross-entropy loss to form a supervised student loss function.

[0038] 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.

[0039] Steps 210 and 220 complete the construction of the supervised student loss function.

[0040] 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.

[0041] 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: Step 310: Calculate the first consistency loss based on the coarse student prediction results and teacher prediction results.

[0042] 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.

[0043] 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.

[0044] Step 320: Calculate the second consistency loss based on the refined student prediction results and teacher prediction results.

[0045] 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.

[0046] 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.

[0047] 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.

[0048] 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.

[0049] 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.

[0050] Example 2 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: 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. 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; 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; 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; 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; 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.

[0051] 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.

[0052] Based on the above embodiments, the refined student prediction result generation module 440 includes: 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. The target decoding feature generation unit is used to generate target decoding features by passing the fused features through the target decoder. 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.

[0053] Based on the above embodiments, the loss function generation module 450 includes: 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; 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.

[0054] Based on the above embodiments, the optimization module 460 includes: 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; 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. 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.

[0055] 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.

[0056] Example 3 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.

[0057] like Figure 5 As 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).

[0058] 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.

[0059] 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.

[0060] 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 5Not 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.

[0061] 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.

[0062] 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.

[0063] 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.

[0064] Example 4 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.

[0065] 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.

[0066] 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.

[0067] 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.

[0068] 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).

[0069] 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 medical image segmentation model, characterized in that, include: Unlabeled training medical images are input into the student network and teacher network respectively for initial training. Coarse student prediction results and teacher prediction results are generated by a shared encoder and a semantic refinement decoder. Labeled training medical images are input into the student network to obtain labeled student prediction results; Subtract the intermediate features generated by the auxiliary decoder and the semantic refinement decoder in the student network to form the difference features; Label-free training medical images and differential features are input into a shared encoder and a semantic refinement decoder to generate refined student prediction results; The supervised student loss function is generated by calculating the predicted results of labeled students and the true labels; 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.

2. The method according to claim 1, characterized in that, The shared encoder is used for: The medical image is processed by a multi-level downsampling layer to obtain downsampling features. The downsampling features are then input into a bottleneck layer to generate attention-enhanced coding features. The multi-level downsampling layer is used to extract multi-scale features from the medical image. The bottleneck layer includes a semantic cohesive attention module, which is used to calculate global attention features from the downsampled features through a multi-head self-attention mechanism, and inject the global attention features back into the downsampled features in a residual connection manner to generate the attention-enhanced coding features.

3. The method according to claim 1, characterized in that, The semantic refinement decoder includes: Multi-level upsampling groups are used to output prediction results; The upsampling group is used to receive the downsampled output features of each layer of the shared encoder and the output features of the target decoder. The downsampled output features of each layer of the shared encoder and the output features of the target decoder are combined through a bridging and fusion module to generate aggregate features. The aggregate features are then decoded through a convolution operation to generate decoded features. The decoded features are then sent back to the shared encoder to update the features of the next layer.

4. The method according to claim 3, characterized in that, The bridging and fusion module is used for: By adjusting the size, the output feature size of each downsampled layer of the shared encoder is adjusted to be consistent with the output feature of the target decoder, thus obtaining the output feature of each downsampled layer of the shared encoder after size adjustment. Using a gated aggregation function, the downsampled output features of each layer of the size-adjusted shared encoder are fused to generate a single feature map; The aggregated feature is generated by fusing the single feature map and the output feature of the target decoder.

5. The method according to claim 3, characterized in that, The process of inputting unlabeled training medical images and differential features into a shared encoder and a semantic refinement decoder to generate refined student prediction results includes: The labelless training medical image is input into a 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 preset weights to obtain the fused features. The fused features are then processed by the target decoder to generate target decoding features. The fused features and target decoded features are processed by a semantic refinement decoder to generate refined student prediction results.

6. The method according to claim 1, characterized in that, The step of calculating the supervised student loss function by combining the labeled student prediction results and the true labels includes: Based on the labeled student prediction results and the true labels, calculate the Dice loss and cross-entropy loss; The Dice loss is combined with the cross-entropy loss to form the supervised student loss function.

7. The method according to claim 1, characterized in that, A composite loss function is constructed by combining coarse student predictions, teacher predictions, refined student predictions, and supervised student loss functions with variable weights, including: Based on the rough student prediction results and teacher prediction results, the first consistency loss is calculated; Based on the refined student prediction results and teacher prediction results, the second consistency loss is calculated; 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.

8. A model training device for medical image segmentation, characterized in that, include: 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. 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; 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; 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. 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; 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.

9. A server, characterized in that, The server includes: One or more processors; 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 model training method for medical image segmentation as described in any one of claims 1-7.

10. 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 one of claims 1-7.

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

  • Multitask remote sensing semantic segmentation method based on omnidirectional scanning state space model

    CN121121408A

  • Medical image segmentation method fusing random region cutting enhancement and pseudo label semi-supervised mechanism

    CN121170292A

  • Self-supervised contrastive learning using random feature corruption

    US20220383120A1