A semi-supervised medical image segmentation method based on contrast manifold regularization and related devices
By contrasting the manifold regularized semi-supervised learning framework and integrating contrastive learning and manifold regularization, the problems of data scarcity and feature inconsistency in semi-supervised medical image segmentation are solved, the segmentation accuracy and robustness are improved, and it is suitable for medical image scenarios where labeled data is scarce.
Patent Information
- Application Number
- CN202510866998.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2045-06-26
AI Technical Summary
Existing semi-supervised medical image segmentation methods face the problems of data scarcity and feature representation inconsistency in small target lesion segmentation scenarios, resulting in insufficient segmentation accuracy and real-time performance that cannot meet clinical needs.
A semi-supervised learning framework based on contrastive manifold regularization is adopted. The positive and negative sample pairs are defined through the contrastive learning module and the model is trained using the contrastive loss function. At the same time, manifold regularization constraints are imposed in the reproducing kernel Hilbert space, and the labeled and unlabeled data are integrated for model training.
It significantly improves the accuracy and robustness of medical image segmentation, is suitable for scenarios where labeled data is scarce, and meets the segmentation needs in clinical practice.
Smart Images

Figure CN120374636B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of medical image processing, and in particular to a semi-supervised medical image segmentation method based on contrast manifold regularization and related devices. Background Art
[0002] In the field of medical image analysis, deep learning technology has been widely used in image segmentation tasks, providing important support for clinical diagnosis and treatment planning. However, existing technical solutions still face significant challenges in semi-supervised medical image segmentation scenarios.
[0003] Currently, deep learning-based medical image segmentation methods rely heavily on large-scale annotated data. In real-world clinical scenarios, accurate annotation of medical images requires radiologists to spend a significant amount of time delineating each layer, resulting in extremely high costs for acquiring annotated data. This data scarcity directly limits the performance of supervised learning frameworks, particularly in segmenting rare cases and specialized diseases.
[0004] To alleviate data dependency, semi-supervised learning methods have become a research hotspot. Existing technologies typically employ a combination of self-supervised learning and contrastive learning, improving model generalization capabilities by learning features from unlabeled data. However, these methods suffer from inherent flaws in feature representation: when the proportion of labeled data falls below a certain threshold, model performance significantly degrades, making them difficult to meet clinical application requirements.
[0005] In terms of feature constraint mechanisms, traditional manifold regularization methods improve model generalization by maintaining the intrinsic geometric structure of the data. However, their effectiveness is highly dependent on the accuracy of the manifold assumption. Existing solutions often introduce manifold constraints as a separate module into the training process, failing to effectively synergize with contrastive learning. This leads to inconsistencies in the feature space, manifested as high feature dispersion among similar samples and overlapping features among heterogeneous samples.
[0006] For small target lesion segmentation scenarios, existing semi-supervised methods face dual challenges: on the one hand, limited labeled data makes it difficult to support effective learning of small target features; on the other hand, traditional data augmentation strategies have limited applicability in three-dimensional medical imaging scenarios, resulting in generally low sensitivity in small target detection.
[0007] At the clinical deployment level, the real-time performance of existing semi-supervised segmentation frameworks is insufficient to meet the rigid requirements of surgical navigation. Most solutions are time-consuming and lack specific optimization for intraoperative scenarios, limiting the practical application value of the technology in clinical practice. Summary of the Invention
[0008] In order to solve the above technical problems, the present invention provides a semi-supervised medical image segmentation method and related devices based on contrast manifold regularization.
[0009] A first aspect provides a semi-supervised medical image segmentation method based on contrast manifold regularization, the method comprising:
[0010] 1. Import and preprocess a medical image dataset, wherein the medical image dataset includes labeled data and unlabeled data;
[0011] 2. Initializing a teacher model and a student model, training the teacher model using the labeled data to obtain a teacher weight; filtering the unlabeled data to obtain filtered unlabeled data; and generating pseudo labels for the filtered unlabeled data using the teacher model based on the teacher weight to obtain pseudo-labeled data;
[0012] 3. Calculating the similarity between the labeled data and the pseudo-labeled data to obtain a reproducing kernel Hilbert space manifold regularization term;
[0013] 4. Based on the labeled data and the pseudo-labeled data, randomly cropping is performed to construct positive and negative sample pairs; wherein the positive sample pair is two different randomly cropped images of the same medical image; and the negative sample pair is a different medical image; using the positive sample pair and the negative sample pair to calculate a contrastive loss function to obtain a contrastive loss term;
[0014] 5. Performing a weighted summation on the reproducing kernel Hilbert space manifold regularization term and the contrastive loss term to obtain a contrastive manifold regularization term;
[0015] 6. Obtaining a supervision loss based on the labeled data, and then taking a weighted sum of the contrast manifold regularization term and the supervision loss as the loss function of the student model;
[0016] 7. Based on the labeled data and the pseudo-label data, use the loss function to iteratively train the student model to obtain student weights; based on the student weights, use the student model to perform an image segmentation task to obtain a segmentation result.
[0017] In combination with any embodiment of the present application, the filtering of the unlabeled data to obtain the filtered unlabeled data includes:
[0018] The screening is performed based on data quality, which includes image clarity and contrast; and the screening is performed based on the similarity between the unlabeled data and the labeled data, which is measured by calculating the feature distance between the unlabeled data and the labeled data.
[0019] In combination with any embodiment of the present application, the calculating the similarity between the labeled data and the pseudo-labeled data to obtain the reproducing kernel Hilbert space manifold regularization term includes:
[0020] A kernel function is selected; a similarity matrix is calculated, wherein the similarity matrix includes similarity values between the labeled data and the pseudo-labeled data; and the reproducing kernel Hilbert space manifold regularization term is constructed based on the similarity matrix.
[0021] In combination with any embodiment of the present application, the randomly cropping based on the labeled data and the pseudo-labeled data to construct positive and negative sample pairs includes:
[0022] Setting a cropping size, wherein the cropping size is determined according to the resolution of the medical image and the size of the lesion;
[0023] Randomly selecting a cropping position, wherein the cropping position is independently selected on the annotated data and the pseudo-labeled data;
[0024] A positive sample pair is constructed, wherein the positive sample pair is two different randomly cropped images of the same medical image; and a negative sample pair is constructed, wherein the negative sample pair is different medical images.
[0025] In combination with any embodiment of the present application, performing weighted summation on the reproducing kernel Hilbert space manifold regularization term and the contrast loss term to obtain the contrast manifold regularization term includes:
[0026] The contrast loss term is used to measure the distance difference between the positive sample pair and the negative sample pair in the feature space, using the formula:
[0027] ,
[0028] in, and is the feature representation of the positive sample pair, is the feature representation of the negative sample pair, is the similarity function, is the temperature parameter;
[0029] The manifold regularization term and the contrast loss term are weightedly summed to obtain the contrast manifold regularization term, using the formula:
[0030] ,
[0031] in, is the reproducing kernel Hilbert space manifold regularization term, is the contrast loss term, is the weight of the contrast loss term;
[0032] In combination with any embodiment of the present application, the supervised loss is obtained based on the labeled data, and then the contrast manifold regularization term and the supervised loss are weighted summed as the loss function of the student model, including:
[0033] The supervised loss function is obtained by predicting the labeled data by the student model, and is used to measure the difference between the prediction result of the student model on the labeled data and the true label;
[0034] The supervisory loss term and the contrast manifold regularization term are weighted summed to obtain the loss function of the student model, using the formula:
[0035] ,
[0036] in, is the supervision loss function, is the weight of the comparison manifold regularization term;
[0037] The loss function of the student model is used to guide the training process of the student model.
[0038] In combination with any embodiment of the present application, the iterative training of the student model using the loss function based on the labeled data and the pseudo-labeled data to obtain the student weights includes:
[0039] Set the iteration end conditions and initialize the training parameters;
[0040] Calculate the loss value of the student model on the labeled data and the pseudo-labeled data using the loss function;
[0041] The parameters of the student model are updated according to the loss value; and the iterative process is repeated until the iteration end condition is met.
[0042] In a second aspect, a semi-supervised medical image segmentation device based on contrast manifold regularization is provided, comprising:
[0043] An input unit, configured to import and preprocess a medical image dataset, wherein the medical image dataset includes annotated data and unannotated data;
[0044] A contrastive learning unit randomly crops the labeled data and the pseudo-labeled data to construct positive and negative sample pairs, wherein the positive sample pair is two different randomly cropped images of the same medical image; and the negative sample pair is a different medical image; and a contrastive loss function is calculated using the positive sample pair and the negative sample pair to obtain a contrastive loss term.
[0045] a manifold regularization unit, configured to calculate the similarity between the labeled data and the pseudo-labeled data to obtain a reproducing kernel Hilbert space manifold regularization term;
[0046] The model training unit is used to initialize a teacher model and a student model, train the teacher model using the labeled data to obtain a teacher weight; screen the unlabeled data to obtain filtered unlabeled data; generate pseudo labels for the filtered unlabeled data using the teacher model based on the teacher weight to obtain pseudo-labeled data; and perform a weighted summation of the reproducing kernel Hilbert space manifold regularization term and the contrast loss term to obtain a contrast manifold regularization term; obtain a supervision loss based on the labeled data, and then perform a weighted summation of the contrast manifold regularization term and the supervision loss as a loss function of the student model; and iteratively train the student model using the loss function based on the labeled data and the pseudo-labeled data to obtain a student weight.
[0047] An output unit is used to perform an image segmentation task using the student model based on the student weight to obtain a segmentation result.
[0048] In a third aspect, an electronic device is provided, comprising: a processor, a communication module, a sensor, a user interface, and a storage unit, wherein the storage unit is configured to store computer program code, wherein the program code comprises computer instructions. When the processor executes these instructions, the electronic device performs the method described in the second aspect and any embodiment thereof.
[0049] In a fourth aspect, another electronic device is provided, comprising: a processor, a wireless communication module, a touch screen, a speaker, and a storage unit, wherein the storage unit is configured to store computer program code, wherein the program code comprises computer instructions. When the processor executes these instructions, the electronic device performs the method described in the second aspect and any embodiment thereof.
[0050] In a fifth aspect, a computer-readable storage medium is provided, wherein a computer program is stored, wherein the program includes program instructions. When these instructions are executed by a processor, the processor will perform the method described in the second aspect and any embodiment thereof.
[0051] In a sixth aspect, a computer program product is provided, wherein the computer program product comprises a computer program or instructions. When the computer program or instructions are run on a computer, the computer will execute the method described in the second aspect and any embodiment thereof.
[0052] It should be understood that the above general description and the following detailed description are only used as examples and explanations and do not limit the present application in any way.
[0053] In this application, compared with the prior art, the present invention first obtains a small amount of labeled medical image data and a large amount of unlabeled data in a ratio of 1:N (N≥1); then constructs a semi-supervised learning framework that combines contrastive learning and manifold regularization, defines positive and negative sample pairs through the contrastive learning module and trains the model using the contrastive loss function, and at the same time uses the manifold regularization module to impose regularization constraints on the prediction results in the reproducing kernel Hilbert space (RKHS); finally, the labeled and unlabeled data are input into the framework to complete the model training.
[0054] This invention integrates contrastive learning to mine the intrinsic semantic features of data and manifold regularization to preserve the manifold structure information of the data, breaking through the limitations of traditional supervised learning that only relies on labeled data and the low accuracy of unsupervised learning. It solves the problems of insufficient accuracy and poor noise resistance of existing semi-supervised medical image segmentation methods in complex images, significantly improves the segmentation accuracy and robustness, and is particularly suitable for medical image scenarios where labeled data is scarce. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.
[0056] The drawings herein are incorporated into and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and, together with the specification, are used to illustrate the technical solutions of the present application.
[0057] FIG1 is a flow chart of a semi-supervised medical image segmentation method based on contrast manifold regularization provided in an embodiment of the present application;
[0058] FIG2 is a schematic diagram showing the detailed process of a semi-supervised medical image segmentation method based on contrast manifold regularization provided in an embodiment of the present application;
[0059] FIG3 is a schematic structural diagram of a semi-supervised medical image segmentation device based on contrast manifold regularization provided in an embodiment of the present application;
[0060] FIG4 is a schematic diagram of the hardware architecture of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0061] In order to allow professionals in this technical field to more fully understand the technical solution of the present application, the technical solution of the present application will be explained in detail and clearly with the help of the accompanying drawings. It should be noted that the described embodiments are only some examples of the present application and do not represent all. Based on these embodiments, those skilled in the art can directly deduce all other possible implementation plans without engaging in creative thinking, and these are also included in the scope of protection of the present application.
[0062] In the specification, claims, and related drawings of this application, the terms "first," "second," and the like are used solely to distinguish between different elements and do not imply any particular order. Furthermore, the use of "including," "having," and their variations denotes non-exclusive inclusion. This means that if a process, method, system, product, or apparatus includes a series of steps or components, the process, method, system, product, or apparatus is not limited to the enumerated steps or components and may include other steps or components not listed, or other steps or units inherent to the process, method, system, product, or apparatus.
[0063] The “embodiment” mentioned in this document refers to any instance in which a particular feature, structure or characteristic is combined, and these instances may belong to at least one embodiment of the present application. The “embodiment” mentioned in this document does not necessarily refer to the same specific case, nor does it mean that they are independent or exclusive alternatives. It should be understood by those skilled in the art that the embodiments described herein can be used in conjunction with other embodiments. It should be understood that in this application, “at least one” includes one or more instances, “a plurality” means two or more instances, and “at least two” means two or more instances.
[0064] It should be understood that the method embodiment of the present application can also be implemented by a processor executing computer program code. The embodiment of the present application is described below in conjunction with the drawings in the embodiment of the present application.
[0065] See also Figure 1 FIG1 is a flow chart of a semi-supervised medical image segmentation method based on contrastive manifold regularization provided in an embodiment of the present application. The specific steps are as follows:
[0066] Step 101: Data acquisition and preprocessing: Import a medical image dataset, which contains labeled data and unlabeled data, and preprocess this data so that the subsequent model can better perform learning and segmentation tasks.
[0067] In this embodiment, the modalities of the data set include but are not limited to CT, enhanced CT, ultrasound, MRI, etc., but input of mixed modality data is avoided as much as possible.
[0068] In this embodiment, the preprocessing operations include but are not limited to standardization, data enhancement, data cleaning, and data anonymization.
[0069] In another possible implementation method, in some cases, data augmentation techniques may be used to augment the annotated medical image data, for example, performing operations including but not limited to rotation, scaling, and cropping on the annotated image.
[0070] Step 102: Model initialization and pseudo-label generation: Initialize the teacher model and student model, train the teacher model using the labeled data, and obtain the teacher weight. Then filter the unlabeled data to obtain the filtered unlabeled data. Based on the teacher weight, use the teacher model to generate pseudo labels for the filtered unlabeled data, thereby obtaining pseudo-labeled data. For details, please refer to Figure 2 , Figure 2 A schematic diagram of the detailed process of a semi-supervised medical image segmentation method based on contrast manifold regularization provided in an embodiment of the present application.
[0071] In another possible implementation, the teacher model can be initialized with a pre-trained model to improve the initial performance and training efficiency of the model.
[0072] In yet another possible implementation, the process of screening unlabeled data may be performed based on the characteristics or distribution properties of the data to ensure that the screened unlabeled data is representative.
[0073] Step 103: Obtaining the popular regularization term: Calculate the similarity between the labeled data and the pseudo-labeled data, and obtain the reproducing kernel Hilbert space manifold regularization term through a specific calculation method. This regularization term helps the model learn the intrinsic structure and distribution characteristics of the data. For more details, please refer to Figure 2 . Figure 2 A schematic diagram of the detailed process of a semi-supervised medical image segmentation method based on contrast manifold regularization provided in an embodiment of the present application.
[0074] In another possible implementation, different kernel functions may be used to calculate the reproducing kernel Hilbert space manifold regularization term to adapt to different types of data distributions.
[0075] In another possible implementation, the manifold regularization term can be optimized through an optimization algorithm to improve the performance and generalization ability of the model.
[0076] Step 104: Obtaining the contrastive loss term: Based on the labeled data and pseudo-labeled data, random cropping operations are performed to construct positive and negative sample pairs. The positive sample pair is two different randomly cropped images of the same medical image, and the negative sample pair is a different medical image. Using these positive and negative sample pairs, the contrastive loss function is calculated to obtain the contrastive loss term, which can enable the model to learn to distinguish the differences between different samples. For more details, please refer to Figure 2 , Figure 2 A schematic diagram of the detailed process of a semi-supervised medical image segmentation method based on contrast manifold regularization provided in an embodiment of the present application.
[0077] In another possible implementation, different cropping strategies can be used to construct positive and negative sample pairs to increase the diversity of sample pairs.
[0078] In another possible implementation, the contrastive loss function may adopt different loss function forms, including but not limited to InfoNCE loss or triplet loss, etc., to adapt to different task requirements.
[0079] Step 105: Loss function construction: Perform a weighted summation of the reproducing kernel Hilbert space manifold regularization term and the contrastive loss term to obtain the contrastive manifold regularization term. Then, based on the labeled data, the supervised loss is obtained. The contrastive manifold regularization term and the supervised loss are weighted summed to finally construct the loss function of the student model. This loss function combines the advantages of supervised learning and contrastive learning. For more details, please refer to Figure 2 , Figure 2 A schematic diagram of the detailed process of a semi-supervised medical image segmentation method based on contrast manifold regularization provided in an embodiment of the present application.
[0080] In another possible implementation, different weighting strategies can be used to balance the weights of the manifold regularization term and the contrastive loss term to optimize the performance of the model.
[0081] In another possible implementation, the construction of the loss function can be combined with other regularization terms or constraints to further improve the generalization ability and stability of the model.
[0082] Step 106: Model training and segmentation task execution: Based on the labeled data and pseudo-labeled data, the student model is iteratively trained using the loss function constructed above to obtain student weights. Finally, based on the student weights, the student model is used to perform the medical image segmentation task to obtain the final segmentation result.
[0083] In yet another possible implementation, the execution of the segmentation task may be combined with post-processing operations, such as morphological operations or filtering, to further optimize the quality and accuracy of the segmentation results.
[0084] In some embodiments, the functions or modules included in the device provided in the embodiments of the present application can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be repeated here.
[0085] The above describes in detail the method of the embodiment of the present application, and the following provides an apparatus of the embodiment of the present application.
[0086] See also Figure 3FIG3 is a schematic diagram of the structure of a semi-supervised medical image segmentation device based on contrastive manifold regularization provided in an embodiment of the present application. The segmentation device 1 includes: an input unit 11, a contrastive learning unit 12, a manifold regularization unit 13, a model training unit 14, and an output unit 15. Specifically:
[0087] An input unit 11 is used to import and preprocess a medical image dataset, wherein the medical image dataset includes annotated data and unannotated data;
[0088] A contrastive learning unit 12 randomly crops the labeled data and the pseudo-labeled data to construct positive and negative sample pairs; wherein the positive sample pair is two different randomly cropped images of the same medical image; and the negative sample pair is a different medical image; and a contrastive loss function is calculated using the positive sample pair and the negative sample pair to obtain a contrastive loss term.
[0089] A manifold regularization unit 13 is used to calculate the similarity between the labeled data and the pseudo-labeled data to obtain a reproducing kernel Hilbert space manifold regularization term;
[0090] The model training unit 14 is used to initialize the teacher model and the student model, train the teacher model using the labeled data to obtain a teacher weight; filter the unlabeled data to obtain filtered unlabeled data; generate pseudo labels for the filtered unlabeled data using the teacher model based on the teacher weight to obtain pseudo-labeled data; and perform a weighted summation of the reproducing kernel Hilbert space manifold regularization term and the contrast loss term to obtain a contrast manifold regularization term; obtain a supervision loss based on the labeled data, and then perform a weighted summation of the contrast manifold regularization term and the supervision loss as a loss function of the student model; and iteratively train the student model using the loss function based on the labeled data and the pseudo-labeled data to obtain a student weight.
[0091] The output unit 15 is configured to perform an image segmentation task using the student model based on the student weights to obtain a segmentation result.
[0092] See also Figure 4 Figure 4 shows a schematic diagram of the hardware architecture of an electronic device described in an embodiment of the present application. The electronic device 2 is primarily composed of a processor 21 and a memory 22. Furthermore, the device may also include an input device 23 and an output device 24. The processor 21, memory 22, input device 23, and output device 24 are interconnected via connecting components, which can be various interfaces, data cables, or communication buses, and are not specifically specified in the present embodiment.
[0093] Processor 21 may be one or more graphics processing units (GPUs). If processor 21 is a GPU, the GPU may be single-core or multi-core. Optionally, processor 21 may comprise a processor group consisting of multiple GPUs, interconnected via one or more buses. Furthermore, the processor may be other types of processors, which are not specifically limited in this embodiment of the present application.
[0094] The memory 22 is designed to store computer program instructions and various program codes required to execute the solution of the present application. Optionally, the memory may include, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or compact disc read-only memory (CD-ROM), which are used to store relevant instructions and data.
[0095] The input device 23 is used to input data and / or signals, and the output device 24 is used to output data and / or signals. The input device 23 and the output device 24 can be independent devices or an integrated device.
[0096] It should be appreciated that in the embodiment of the present application, the memory 22 can store not only relevant instructions but also relevant data. The embodiment of the present application does not specify the specific data content stored in the memory.
[0097] It should be understood that FIG3 merely illustrates a simplified design of an electronic device. In actual use, the electronic device may also include other necessary components, such as varying numbers of input / output devices, processors, and memories. All electronic devices capable of implementing the embodiments of this application are within the scope of protection of this application.
[0098] Those skilled in the art will recognize that, according to the components and algorithm steps of each example described in the embodiments disclosed herein, these functions can be implemented by electronic hardware or by combining computer software and electronic hardware. Whether these functions are performed by hardware or software will be determined based on the specific application requirements and design limitations of the technical solution. Technicians can adopt different implementation methods according to the requirements of each specific application, but such implementation methods should not be considered to exceed the scope of protection of this application.
[0099] Professionals should understand that, for the sake of ease of description and simplification, the specific operating procedures of the above-mentioned systems, devices, and components can refer to the corresponding steps in the previous method embodiments and will not be repeated here. At the same time, professionals should also understand that each embodiment in this application has its own focus. For the sake of ease of description and simplification, the same or similar content may not be repeated in different embodiments. Therefore, if a part is not mentioned or not explained in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0100] In the several embodiments provided in this application, it should be recognized that the disclosed systems, devices and methods can also be implemented in other ways. For example, the device embodiments described are only exemplary, in which the division of the units is only a division of logical functions, and there may be different division methods in actual implementation. For example, multiple units or components may be merged or integrated into another system, or certain features may be omitted, or certain steps may not be performed. In addition, the connections between each other shown or discussed, whether direct or indirect, whether coupling or communication connection, may be implemented in electrical, mechanical or other forms through interfaces, devices or units.
[0101] Units described as independent components may or may not actually be physically separate; parts presented as units may or may not be physical entities; that is, they may be centralized in one location or distributed across multiple network nodes. Depending on actual needs, some or all of these units may be selected to achieve the objectives of this embodiment.
[0102] Furthermore, in the various embodiments of the present application, the various functional units may be integrated into a single processing unit, physically exist independently, or two or more units may be combined into a single unit. In the aforementioned embodiments, the relevant functions may be implemented in whole or in part through software, hardware, firmware, or any combination thereof. If software implementation is chosen, it may be implemented in whole or in part in the form of a computer program product. This computer program product comprises one or more computer instructions. When these instructions are loaded and executed on a computer, they will generate, in whole or in part, the processes or functions described in the embodiments of this application. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. These computer instructions may be stored in a computer-readable storage medium or transmitted via such a medium. The computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic cable, DSL) or wireless (e.g., infrared, wireless, microwave, etc.) means. A computer-readable storage medium may be any computer-accessible, usable medium, or a data storage facility such as a server or data center that integrates one or more usable media. These available media may include magnetic media (e.g., floppy disks, hard disks, tapes), optical media (e.g., DVDs), semiconductor media (e.g., SSDs), etc. Those skilled in the art will appreciate that all or part of the process steps for implementing the above-described method embodiments can be accomplished through hardware associated with computer program instructions. These programs can be stored on computer-readable storage media. When executed, these programs will contain the processes for each of the above-described method embodiments. These storage media include, but are not limited to, various media capable of storing program code, such as read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A semi-supervised medical image segmentation method based on contrast manifold regularization, characterized in that: The method comprises: Importing and preprocessing a medical image dataset, wherein the medical image dataset includes labeled data and unlabeled data; Initializing a teacher model and a student model, training the teacher model using the labeled data to obtain a teacher weight; filtering the unlabeled data to obtain filtered unlabeled data; and generating pseudo labels for the filtered unlabeled data using the teacher model based on the teacher weight to obtain pseudo-label data; Selecting a kernel function, and using the kernel function to calculate the similarity between the labeled data and the pseudo-labeled data to obtain a similarity matrix, which is recorded as a reproducing kernel Hilbert space manifold regularization term; Based on the labeled data and the pseudo-labeled data, random cropping is performed to construct positive and negative sample pairs; wherein the positive sample pair is two different randomly cropped images of the same medical image; and the negative sample pair is a different medical image; using the positive sample pair and the negative sample pair to calculate a contrast loss function to obtain a contrast loss term; Performing a weighted summation on the reproducing kernel Hilbert space manifold regularization term and the contrast loss term to obtain a contrast manifold regularization term; Obtaining a supervision loss based on the labeled data, and then performing a weighted summation of the contrast manifold regularization term and the supervision loss as a loss function of the student model; Based on the labeled data and the pseudo-label data, the student model is iteratively trained using the loss function to obtain student weights; based on the student weights, the student model is used to perform an image segmentation task to obtain a segmentation result.
2. The method according to claim 1, characterized in that The filtering of the unlabeled data to obtain the filtered unlabeled data includes: Screening based on data quality, including image clarity and contrast; The screening is performed based on the similarity between the unlabeled data and the labeled data, wherein the similarity is measured by calculating the feature distance between the unlabeled data and the labeled data.
3. The method according to claim 1, characterized in that The kernel function is selected, and the similarity between the labeled data and the pseudo-labeled data is calculated using the kernel function to obtain a similarity matrix, which is recorded as a reproducing kernel Hilbert space manifold regularization term, including: A kernel function is selected; a similarity matrix is calculated, wherein the similarity matrix includes similarity values between the labeled data and the pseudo-labeled data; and the reproducing kernel Hilbert space manifold regularization term is constructed based on the similarity matrix.
4. The method according to claim 1, wherein The randomly cropping based on the labeled data and the pseudo-labeled data to construct positive and negative sample pairs includes: Setting a cropping size, wherein the cropping size is determined according to the resolution of the medical image and the size of the lesion; Randomly selecting a cropping position, wherein the cropping position is independently selected on the annotated data and the pseudo-labeled data; A positive sample pair is constructed, wherein the positive sample pair is two different randomly cropped images of the same medical image; and a negative sample pair is constructed, wherein the negative sample pair is different medical images.
5. The method according to claim 1, wherein The weighted summation of the reproducing kernel Hilbert space manifold regularization term and the contrast loss term to obtain the contrast manifold regularization term includes: The contrast loss term is used to measure the distance difference between positive sample pairs and negative sample pairs in the feature space, using the formula: , in, and is the feature representation of the positive sample pair, is the feature representation of the negative sample pair, is the similarity function, is the temperature parameter; The manifold regularization term and the contrast loss term are weightedly summed to obtain the contrast manifold regularization term, using the formula: , in, is the reproducing kernel Hilbert space manifold regularization term, is the contrast loss term, is the weight of the contrast loss term.
6. The method according to claim 1, characterized in that The supervised loss is obtained based on the labeled data, and then the contrast manifold regularization term and the supervised loss are weighted summed as the loss function of the student model, including: The supervised loss function is obtained by predicting the labeled data by the student model, and is used to measure the difference between the prediction result of the student model on the labeled data and the true label; The supervisory loss term and the contrast manifold regularization term are weighted summed to obtain the loss function of the student model, using the formula: , in, is the supervision loss function, is the weight of the comparison manifold regularization term; The loss function of the student model is used to guide the training process of the student model.
7. The method according to claim 1, characterized in that The method of iteratively training the student model based on the labeled data and the pseudo-labeled data using the loss function to obtain a student weight includes: Set the iteration end conditions and initialize the training parameters; Use the loss function to calculate the loss value of the student model on the labeled data and pseudo-labeled data, and update the parameters of the student model according to the loss value; The iterative process is repeated until the iteration end condition is met.
8. A semi-supervised medical image segmentation device based on contrast manifold regularization, characterized in that: include: An input unit, configured to import and preprocess a medical image dataset, wherein the medical image dataset includes annotated data and unannotated data; a contrastive learning unit, configured to randomly crop the labeled data and the pseudo-labeled data to construct positive and negative sample pairs; wherein the positive sample pair is two different randomly cropped images of the same medical image; and the negative sample pair is a different medical image; and calculate a contrastive loss function using the positive sample pair and the negative sample pair to obtain a contrastive loss term; a manifold regularization unit, configured to select a kernel function, calculate the similarity between the labeled data and the pseudo-labeled data using the kernel function, and obtain a similarity matrix, which is recorded as a reproducing kernel Hilbert space manifold regularization term; The model training unit is used to initialize a teacher model and a student model, train the teacher model using the labeled data to obtain a teacher weight; screen the unlabeled data to obtain filtered unlabeled data; generate pseudo labels for the filtered unlabeled data using the teacher model based on the teacher weight to obtain pseudo-labeled data; and perform a weighted summation of the reproducing kernel Hilbert space manifold regularization term and the contrast loss term to obtain a contrast manifold regularization term; obtain a supervision loss based on the labeled data, and then perform a weighted summation of the contrast manifold regularization term and the supervision loss as a loss function of the student model; and iteratively train the student model using the loss function based on the labeled data and the pseudo-labeled data to obtain a student weight. An output unit is used to perform an image segmentation task using the student model based on the student weight to obtain a segmentation result.
9. An electronic device, characterized in that: include: A processor and a storage unit, the storage unit is used to store computer program code, the code includes computer instructions, when the processor executes these instructions, the electronic device performs the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, the processor is caused to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Deep migration semi-supervised domain adaptive classification method for histopathology images
CN112733859A
Prediction method and device, electronic equipment, storage medium and program product
CN119046751A
Cited By
SAM-based semi-supervised adapter fine tuning and prompt learning medical image segmentation method and related device
CN120451565A
A medical image segmentation method and related device based on semi-supervised adapter fine-tuning and prompt learning based on SAM
CN120451565B