Self-supervised medical image segmentation method and system based on random walk path
By adopting a self-supervised method based on random walking paths in medical image segmentation, the topological imbalance and heterogeneous structure capture difficulties in processing complex medical image structures in the prior art are solved, and more accurate and robust Medical image segmentation effect.
Patent Information
- Application Number
- CN202411452914.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-10-17
AI Technical Summary
Existing medical image segmentation methods have topological imbalance, homogeneous structure assumption constraints, remote information weakness and label attenuation when dealing with complex medical image structures, making it difficult to accurately capture the complex relationships and heterogeneous structures between nodes.
Using a self-supervised medical image segmentation method based on random walk paths, sampling multi-hop paths through close-range and long-range random walk strategies, combining attention mechanisms and structured contrast losses, global embedding representations and optimize sub-graphs to enhance Globality and locality of image representation.
Effectively capture the relationships and local features between pixels in medical images, overcome homogeneity limitations, reduce the attenuation of long-distance nodes, enhance the robustness and adaptability of medical image representation, and is suitable for processing medical image data of complex heterogeneous structures. .
Smart Images

Figure CN119477961A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image segmentation, and in particular relates to a self-supervised medical image segmentation method and system based on random walk paths. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] With the widespread application of medical imaging data in various fields (such as tumor diagnosis, organ segmentation, pathological image analysis, and biomedical research), graph representation learning has become a research hotspot in medical image processing. Traditional graph representation learning methods mainly rely on labeled data and use supervised learning strategies to generate embedded representations of pixels or voxels. However, due to the inherent imbalance and heterogeneity of medical imaging data, existing methods have the following major problems when dealing with complex medical image structures:
[0004] (1) Topological imbalance: The connection relationships between graph nodes are complex and diverse, which is manifested as asymmetric and uneven distribution of nodes in the topological space. This imbalance makes it difficult for traditional graph representation learning methods to accurately capture the relationship between nodes, affecting the quality of representation.
[0005] (2) Homogeneous structure assumption constraint: Existing methods usually assume that graphs are isomorphic, that is, the connected nodes have similar characteristics. However, in practical applications, many graph data are heterogeneous, and traditional methods are difficult to effectively capture these complex heterogeneous relationships.
[0006] (3) Distant information attenuation: As the topological distance between nodes increases, the influence of nodes on central nodes gradually weakens, making it difficult to effectively utilize the information of distant nodes, affecting the globality of graph representation.
[0007] (4) Label decay problem: Self-supervised learning methods need to automatically mine supervisory signals from data. However, in graph data, due to the scarcity of labeled data, the supervisory signals that can be provided are naturally weak, which affects the learning effect of the model. Summary of the invention
[0008] In order to solve the above problems, the present invention proposes a self-supervised medical image segmentation method and system based on random walk paths. The present invention deeply explores the complex tissue relationships and uneven distributions in medical images, improves the accuracy and robustness of automatic segmentation technology in processing medical images with diverse and irregular boundaries, thereby providing more accurate support for medical diagnosis and treatment planning.
[0009] According to some embodiments, the present invention adopts the following technical solutions:
[0010] A self-supervised medical image segmentation method based on random walk path, comprising the following steps:
[0011] Preprocessing the acquired medical image and converting it into a graph data structure, extracting the initial features of each node in the graph data structure, and standardizing the initial features;
[0012] Update the features of each node based on the message passing mechanism, and aggregate the updated features of all nodes to obtain the global features;
[0013] Based on the short-distance random walk strategy and the long-distance random walk strategy, the homogeneous neighborhood distribution and the heterogeneous neighborhood distribution of the central node are sampled respectively to form a random walk path;
[0014] Encode each random walk path, learn the weight of each random walk path through the attention mechanism, concatenate the path information after weight aggregation, and generate a global embedding representation;
[0015] Nodes and edges whose topological distance from the central node does not exceed the set threshold are extracted to form a subgraph, random perturbations are introduced to generate a comparative view, and the similarity between nodes is used for embedding calculation to generate a comparative subgraph with node features and edges;
[0016] Based on subgraphs and contrast subgraphs, a structured contrast loss is used to optimize subgraphs.
[0017] As an optional embodiment, the process of converting to a graph data structure includes defining each pixel or voxel in the medical image as a node in the graph, the edges between the nodes are established based on the spatial proximity of the pixels or voxels, and the weights of the edges reflect the similarity between the nodes.
[0018] As an optional implementation, it also includes using an adjacency matrix to represent the topological structure of the graph. For an unweighted graph, the adjacency matrix is a binary matrix that indicates whether there is an edge connection between nodes; for a weighted graph, the elements of the adjacency matrix are the weight values of the edges, indicating the similarity between nodes.
[0019] As an optional implementation, the features include some of pixel values, color information, and local gradient information.
[0020] As an optional implementation, the process of aggregating the updated features of all nodes includes propagating the node features through the adjacency matrix to generate a new node representation, and using the encoder of the graph convolutional network to aggregate the features of the graph data. By superimposing multiple layers of graph convolutional networks, the final features of the node contain information about its direct neighbors and more distant nodes. In the last layer of the encoder, the features of all nodes are aggregated into global features.
[0021] As an optional implementation, during the random walk, a non-normalized transition probability is used to maximize the topological relationship between nodes. The transition probability is:
[0022]
[0023] Among them, L i-1i+1 Represents node v i-1 With V i+1 The shortest path length between i-1,i+1 =1, v i-1 v i+1 ; α and β are the transfer parameters of the random walk, which control the preference of the nearest and distant neighbor nodes respectively; when α<1 and β>1, the random walk strategy collects the information of the adjacent nodes and extracts the homogeneous information; when α>1 and β<1, the random walk strategy gives priority to visiting the more distant nodes and extracts the heterogeneous information.
[0024] As an optional implementation, a gated recurrent unit encoder is used to encode each random walk path, the importance weight of each path is learned through an attention mechanism, multi-head attention calculation is performed on the path information after weight aggregation, and the results are spliced.
[0025] As an optional implementation, random perturbations are introduced to generate contrast views, and similarities between nodes are used for embedding calculation. The process of generating contrast views with node features and edges includes: j and v l The embedding similarity between is calculated as:
[0026] S(v j , v l )=θ(W c [W v v j ||W v v l ])
[0027] in, is a subgraph, W c and W v is a learnable weight matrix, θ(·) is an activation function;
[0028] Similarity-based node embedding aggregation:
[0029] W l =Softmax(sim(v j , v l ));
[0030]
[0031] Among them, Softmax is used to normalize the weights, W l Represents the node embedding after aggregation.
[0032] As an optional implementation, in the process of optimizing a subgraph using structured contrast loss, Wasserstein contrast loss and Gromov-Wasserstein contrast loss are used to measure the similarity between nodes and edges, respectively, where Wasserstein contrast loss is used to represent the transmission cost between a subgraph and its contrast subgraph, and optimization is achieved by minimizing the node similarity difference between positive samples while maximizing the node similarity difference between negative samples. Gromov-Wasserstein contrast loss is used to capture the structural similarity of edges in the subgraph, and optimization is achieved by minimizing the edge similarity difference between positive samples while maximizing the edge similarity difference between negative samples.
[0033] A self-supervised medical image segmentation system based on random walk paths, comprising:
[0034] A preprocessing module is configured to preprocess the acquired medical image and convert it into a graph data structure, extract the initial features of each node in the graph data structure, and perform standardization on the initial features;
[0035] The node information updating module is configured to update the features of each node based on the message passing mechanism, and perform feature aggregation on the updated features of all nodes to obtain the global features;
[0036] The multi-hop path sampling module is configured to sample the homogeneous neighborhood distribution and the heterogeneous neighborhood distribution of the central node based on the short-distance random walk strategy and the long-distance random walk strategy, respectively, to form a random walk path;
[0037] The inter-path information aggregation module is configured to encode each random walk path, learn the weights of each random walk path through the attention mechanism, and concatenate the path information after weight aggregation to generate a global embedding representation;
[0038] The subgraph generation module is configured to extract nodes and edges whose topological distance from the central node does not exceed a set threshold to form a subgraph, introduce random perturbations to generate a comparison view, and use the similarity between nodes for embedding calculation to generate a comparison subgraph with node features and edges;
[0039] The structured optimization module is configured to optimize the subgraphs using a structured contrast loss based on the subgraphs and the contrast subgraphs.
[0040] An electronic device comprises a memory and a processor, and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the steps in the above method are completed.
[0041] Compared with the prior art, the present invention has the following beneficial effects:
[0042] The present invention introduces the concept of sub-medical image neighborhood of multi-hop path to comprehensively capture the relationship and local features between pixels in medical images, overcome the limitation of homogeneity, solve the problem of attenuation of influence of long-distance nodes, and enhance the globality and locality of medical image representation.
[0043] The present invention utilizes an inter-path aggregation strategy based on the attention mechanism to aggregate the information in multi-hop paths and learn the homogeneous and heterogeneous features in the paths, which not only retains the original properties of the nodes but also maintains the initial structural connections of the nodes in the random walk sequence.
[0044] The present invention introduces a subgraph sampling strategy based on aggregated multi-hop paths, which can capture node information at longer distances and alleviate the negative impact caused by topological distance attenuation.
[0045] The present invention combines structured contrast loss and adopts Wasserstein distance and Gromov-Wasserstein distance to measure the similarity between subgraphs, thereby maximizing the similarity of positive subgraphs, minimizing the similarity of negative subgraphs, and enhancing the self-supervision signal of the model.
[0046] The present invention can effectively process medical image data with complex heterogeneous structures, breaking through the limitations of traditional methods and having strong adaptability; through multi-hop path sampling and structured contrast learning, it can better deal with the problem of topological imbalance and enhance the stability of medical image representation;
[0047] The present invention is applicable to graph data processing in various fields, and has broad application prospects and is widely used, especially in social network analysis, bioinformatics, and knowledge graph construction.
[0048] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0050] Figure 1 is a flow chart of an embodiment;
[0051] Figure 2 The present invention is a schematic diagram of the structure of an electronic device according to an embodiment. DETAILED DESCRIPTION
[0052] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0053] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0054] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0055] In the absence of conflict, the embodiments in this application and the features in the embodiments may be combined with each other.
[0056] Embodiment 1
[0057] A self-supervised graph topology imbalance learning method based on random walk paths, such as Figure 1 As shown, the following steps are included:
[0058] Step S1: preprocessing the acquired medical image and converting it into a graph data structure, extracting the initial features of each node in the graph data structure, and standardizing the initial features;
[0059] Step S2: Update the features of each node based on the message passing mechanism, and aggregate the updated features of all nodes to obtain the global features;
[0060] Step S3: Based on the short-distance random walk strategy and the long-distance random walk strategy, the homogeneous neighborhood distribution and the heterogeneous neighborhood distribution of the central node are sampled respectively to form a random walk path;
[0061] Step S4: Encode each random walk path, learn the weight of each random walk path through the attention mechanism, concatenate the path information after weight aggregation, and generate a global embedding representation;
[0062] Step S5: extract nodes and edges whose topological distance from the central node does not exceed the set threshold to form a subgraph, introduce random perturbations to generate a comparison view, and use the similarity between nodes to perform embedding calculations to generate a comparison subgraph with node features and edges;
[0063] Step S6: Based on the sub-graph and the contrast sub-graph, optimize the sub-graph using a structured contrast loss.
[0064] Each step is described in detail below.
[0065] First, in step S1, the medical image needs to be preprocessed and converted into a graph data structure. Each pixel or voxel in the medical image is defined as a node in the graph. The edges between nodes are established based on the spatial proximity of pixels or voxels, and the weights of the edges reflect the similarity between nodes, which are usually calculated by pixel value differences, gradient changes, or texture features.
[0066] Secondly, the initial features of each node are extracted. The features may include pixel values, color information (RGB or grayscale values), local gradient information, etc. The features constitute a node feature matrix, which represents the properties of the node. Subsequently, the adjacency matrix is used to represent the topological structure of the graph. For an unweighted graph, the adjacency matrix is a binary matrix that indicates whether there is an edge connection between nodes; for a weighted graph, the elements of the adjacency matrix are the weight values of the edges, which represent the similarity between nodes.
[0067] Finally, the node features are standardized by using mean normalization or Z-score normalization to ensure that the features are within the same numerical range, which helps to improve the stability of the values during training.
[0068] Of course, in other embodiments, other methods may be used to standardize the data.
[0069] In step S2, the encoder based on the graph convolutional network (GCN) aggregates the features of the graph data through the message passing mechanism. The features of each node are not only determined by its own features, but also aggregate the information of its neighboring nodes through adjacency relationships, gradually generating a global feature representation.
[0070] Each node feature is updated at layer l by the following formula:
[0071]
[0072] Among them, H (l) is the feature matrix of the l-th layer node, is the adjacency matrix with self-loops added, is the degree matrix of the adjacency matrix, W (l) is the learnable weight matrix of the lth layer, and σ is a nonlinear activation function (such as ReLU or LeakyReLU). This formula shows that node features are propagated through the adjacency matrix to generate new node representations.
[0073] In order to extract features at different levels, multiple layers of GCN are usually stacked, and each layer further fuses the node features with its neighboring nodes. Through the superposition of multiple layers, the final features of the node contain not only the information of its direct neighbors, but also the information of its more distant nodes.
[0074] In the last layer of the GCN encoder, the features of all nodes are aggregated into global features.
[0075] In step S3, by setting the short-distance and long-distance random walk strategies, the homogeneous neighborhood distribution and heterogeneous neighborhood distribution of the central node are sampled respectively. The short-distance strategy focuses on capturing the neighbor information directly connected to the central node to obtain homogeneous information; while the long-distance strategy further samples the node information that is topologically far away from the central node to obtain heterogeneous information.
[0076] During the random walk, non-normalized transition probabilities are used as follows to maximize the preservation of the topological relationships between nodes.
[0077]
[0078] Where L i-1,i+1 Represents node v i-1 With v i+1 The shortest path length between. i-1,i+1 =1, v i-1 v i+1 When α is less than 1 and β is greater than 1, the random walk is similar to a breadth-first search, collecting information about neighboring nodes and extracting homogeneous information; when α is greater than 1 and β is less than 1, the random walk is similar to a depth-first search, giving priority to visiting more distant nodes and extracting heterogeneous information.
[0079] In step S4, based on the multiple path information obtained by sampling, a GRU (Gated Recurrent Unit) encoder is used to encode each path, and then the importance weight of the path is learned through the attention mechanism.
[0080] The path encoding formula is as follows:
[0081] s p =GRU({g pk |k∈K})
[0082] Among them, s p is the encoding feature of each path, g pk is node v pk The encoded features obtained by the encoder, GRU is a gated recurrent unit used to obtain the encoded features of each path.
[0083] The path weight calculation formula is as follows:
[0084]
[0085] Among them, W path is the normalized weight of each path, W node is a learnable attention parameter, θ(·) is the LeakyReLU activation function, and the softmax function is used to normalize the weights.
[0086] Perform multi - head attention calculation on the path information after weight aggregation, and splice the results to generate a unified global embedding representation.
[0087] The multi - head attention aggregation formula is as follows.
[0088]
[0089] Where, W head is the learnable multi - head attention weight, e i is the global embedding representation of the central node v i , and cat(·) represents the feature splicing operation.
[0090] In step S5, sub - graph sampling is performed based on the strategy of aggregating multi - hop paths, and nodes and edges whose topological distance from the central node does not exceed a set threshold are extracted to form a sub - graph.
[0091] The specific sampling process includes:
[0092] Obtain the graph G, the central node v i , the sampling path length threshold K, the parameter p, and the parameter q;
[0093] Perform initialization settings, set the sampling path length len path = 0, and the sampled sub - graph contains the central node v i ;
[0094] When len_path < K:
[0095] If len_path = 1:
[0096] Randomly select a first - order neighborhood node v j connected to v i ;
[0097] Add the edge (v I , v j ) to the sampled sub - graph
[0098] Increment the value of len_path by 1;
[0099] Set v j as the new central node v i ;
[0100] Otherwise:
[0101] Perform random walk according to the probability parameters p and q to select the next node v k ;
[0102] Add the edge (V I , v k)Add sampling subgraph
[0103] Add 1 to the value of len_path;
[0104] v k Set as the new center node v i ;
[0105] Returns the sampled subgraph
[0106] The comparative views are generated by introducing random perturbations with lower probability and using the similarity between nodes for embedding calculation to generate comparative views with the same nodes and edge relationships.
[0107] Two nodes v j and The embedding similarity calculation formula between:
[0108] S(v j , v l )=θ(W c [W v v j ||W v v l ])
[0109] Among them, W c and W v is a learnable weight matrix and θ(·) is the LeakyReLU activation function.
[0110] Similarity-based node embedding aggregation:
[0111] W l =softmax(sim(v j , v l ));
[0112]
[0113] Among them, Softmax is used to normalize the weights, W l Represents the node embedding after aggregation.
[0114] Through the above steps, we get a comparison subgraph with node features and edges, denoted as
[0115] In step S6, after completing the sub-image sampling and contrast view generation, the structured contrast loss is used to optimize the model. This embodiment uses the Wasserstein contrast loss L w Comparison loss L with Gromov-Wasserstein gw to measure the similarity between nodes and edges respectively.
[0116] The loss function is as follows:
[0117] L=αL w +(1-α)L gw ;
[0118] Where L is the Wasserstein contrast loss. L w is the Wasserstein contrast loss, which is used to measure the node similarity between positive and negative samples. gw is the Gromov-Wasserstein contrast loss, which is used to measure the edge similarity between positive and negative samples. α is a hyperparameter that controls L w and L gw The relative importance of the total loss function.
[0119] Wasserstein contrastive loss L w :
[0120]
[0121] in is the Wasserstein distance, indicating the subgraph And its comparison sub-graph is the transmission cost between them. n is the number of sampled sub-images. m is the number of negative samples for each sub-image. k is a temperature parameter that controls the distribution smoothness in the contrast loss.
[0122] Wasserstein distance
[0123]
[0124] Where T is the transmission matrix, which represents the set of nodes from the source subgraph The transmission plan of the set of nodes to the target subgraph. ij is the source node e i To the target node The transmission quality or probability determines how to map node features from one distribution to another while maintaining the minimum cost. Represents node e i and Δ(·) is the cosine similarity between node features.
[0125] Wasserstein contrastive loss L w It aims to improve the robustness of the model by minimizing the node similarity difference between positive samples and maximizing the node similarity difference between negative samples.
[0126] Gromov-Wasserstein contrastive loss L gw :
[0127]
[0128] Gromov-Wasserstein distance The calculation formula is as follows:
[0129]
[0130] in, The calculation of is as follows:
[0131]
[0132] Gromov-Wasserstein contrastive loss L gw It is used to capture the structural similarity of edges in subgraphs, by minimizing the edge similarity difference between positive samples and maximizing the edge similarity difference between negative samples, thereby improving the model's ability to capture the global structure of the graph.
[0133] As a verification, the method provided in this embodiment performs well in multiple eye disease medical image segmentation tasks, especially when processing medical data with complex topological structures, showing strong generalization ability and stability. Experimental results on the OCT eye disease datasets published by Dr ive and Kermany show that even with less labeled data, the method of the present invention can still achieve a high segmentation accuracy.
[0134] As shown in Tables 1 and 2, the combination of the graph convolutional network encoder and the global embedding strategy can effectively capture the local and global topological information in ocular medical images, thereby significantly improving the segmentation performance. This capability is particularly important in the pixel or region classification task of ocular diseases, because the annotation of ophthalmic medical data is usually expensive and limited, and the segmentation accuracy is of great significance for clinical diagnosis.
[0135] Table 1 Comparison of experimental results of DRIVE dataset
[0136]
[0137]
[0138] Table 2 Comparison of experimental results of OCT dataset
[0139]
[0140] Embodiment 2
[0141] A self-supervised medical image segmentation system based on random walk paths, comprising:
[0142] A preprocessing module is configured to preprocess the acquired medical image and convert it into a graph data structure, extract the initial features of each node in the graph data structure, and perform standardization on the initial features;
[0143] The execution process of this module may refer to the process of step S1 in the first embodiment, which will not be described in detail here.
[0144] The node information updating module is configured to update the features of each node based on the message passing mechanism, and perform feature aggregation on the updated features of all nodes to obtain the global features;
[0145] The execution process of this module may be specifically referred to the process of step S2 of the first embodiment, which will not be repeated here.
[0146] The multi-hop path sampling module is configured to sample the homogeneous neighborhood distribution and the heterogeneous neighborhood distribution of the central node based on the short-distance random walk strategy and the long-distance random walk strategy, respectively, to form a random walk path;
[0147] The execution process of this module may refer to the process of step S3 of the first embodiment for details, which will not be repeated here.
[0148] The inter-path information aggregation module is configured to encode each random walk path, learn the weights of each random walk path through the attention mechanism, and concatenate the path information after weight aggregation to generate a global embedding representation;
[0149] The execution process of this module may be specifically referred to the process of step S4 of the first embodiment, which will not be repeated here.
[0150] The subgraph generation module is configured to extract nodes and edges whose topological distance from the central node does not exceed a set threshold to form a subgraph, introduce random perturbations to generate a comparison view, and use the similarity between nodes for embedding calculation to generate a comparison subgraph with node features and edges;
[0151] The execution process of this module may be specifically referred to the process of step S5 of the first embodiment, which will not be described in detail here.
[0152] The structured optimization module is configured to optimize the subgraphs using a structured contrast loss based on the subgraphs and the contrast subgraphs.
[0153] The execution process of this module may be specifically referred to the process of step S6 of the first embodiment, which will not be described in detail here.
[0154] It can be understood that the above-mentioned units / modules can be separately or completely combined into one or several other units / modules, or one (some) of the units can be further divided into multiple functionally smaller units, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application.
[0155] The above modules of the system are divided based on logical functions. In practical applications, the function of one module can also be implemented by multiple modules, or the functions of multiple modules can be implemented by one module. For example, the preprocessing module of this embodiment may include:
[0156] A graph data structure building module configured to define each pixel or voxel in the medical image as a node in the graph, edges between the nodes are established according to the spatial proximity of the pixels or voxels, and the weights of the edges reflect the similarity between the nodes;
[0157] The adjacency matrix representation module is configured to use the adjacency matrix to represent the topological structure of the graph. For an unweighted graph, the adjacency matrix is a binary matrix that indicates whether there is an edge connection between nodes; for a weighted graph, the adjacency matrix elements are the weight values of the edges, indicating the similarity between nodes;
[0158] The initial feature processing module is configured to extract the initial features of each node in the graph data structure and perform standardization processing on the initial features.
[0159] Similarly, in other embodiments of the present application, the system may also include other units / modules. In actual applications, these functions may also be implemented with the assistance of other units, and may be implemented by collaboration of multiple units.
[0160] According to another embodiment of the present application, the system described in this embodiment can be constructed and the method of Embodiment 1 can be implemented by running a computer program (including program code) capable of executing the steps involved in the corresponding method described in Embodiment 1 on a general computing device such as a computer including processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM). The computer program can be recorded on, for example, a computer-readable recording medium, and loaded into the above-mentioned computing device through the computer-readable recording medium and run therein.
[0161] Embodiment 3
[0162] This implementation provides an electronic device, such as Figure 2As shown, the electronic device includes a processor 1001, a communication interface 1002, and a computer-readable storage medium 1003. The processor 1001, the communication interface 1002, and the computer-readable storage medium 1003 may be connected via a bus or other means.
[0163] Among them, the communication interface 1002 is used to receive and send data, the computer-readable storage medium 1003 can be stored in the memory of the electronic device, the computer-readable storage medium 1003 is used to store a computer program, the computer program includes program instructions, and the processor 1001 is used to execute the program instructions stored in the computer-readable storage medium 1003.
[0164] Processor 1001 (or CPU (Central Processing Unit)) is the computing core and control core of the electronic device, which is suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions to implement corresponding method processes or corresponding functions.
[0165] The processor 1001 is configured to execute the following process:
[0166] Preprocessing the acquired medical image and converting it into a graph data structure, extracting the initial features of each node in the graph data structure, and standardizing the initial features;
[0167] Update the features of each node based on the message passing mechanism, and aggregate the updated features of all nodes to obtain the global features;
[0168] Based on the short-distance random walk strategy and the long-distance random walk strategy, the homogeneous neighborhood distribution and the heterogeneous neighborhood distribution of the central node are sampled respectively to form a random walk path;
[0169] Encode each random walk path, learn the weight of each random walk path through the attention mechanism, concatenate the path information after weight aggregation, and generate a global embedding representation;
[0170] Nodes and edges whose topological distance from the central node does not exceed the set threshold are extracted to form a subgraph, random perturbations are introduced to generate a comparative view, and the similarity between nodes is used for embedding calculation to generate a comparative subgraph with node features and edges;
[0171] Based on subgraphs and contrast subgraphs, a structured contrast loss is used to optimize subgraphs.
[0172] Or the process of steps S1-S6 in embodiment 1 is not repeated here.
[0173] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0174] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0175] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0176] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0177] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made by those skilled in the art within the spirit and principle of the present invention without creative labor shall be included in the protection scope of the present invention.
Claims
1. A self-supervised medical image segmentation method based on random walk paths, characterized in that: The following steps are involved: Preprocessing the acquired medical image and converting it into a graph data structure, extracting the initial features of each node in the graph data structure, and standardizing the initial features; Update the features of each node based on the message passing mechanism, and aggregate the updated features of all nodes to obtain the global features; Based on the short-distance random walk strategy and the long-distance random walk strategy, the homogeneous neighborhood distribution and the heterogeneous neighborhood distribution of the central node are sampled respectively to form a random walk path; Encode each random walk path, learn the weight of each random walk path through the attention mechanism, concatenate the path information after weight aggregation, and generate a global embedding representation; Nodes and edges whose topological distance from the central node does not exceed the set threshold are extracted to form a subgraph, random perturbations are introduced to generate a comparative view, and the similarity between nodes is used for embedding calculation to generate a comparative subgraph with node features and edges; Based on subgraphs and contrast subgraphs, a structured contrast loss is used to optimize subgraphs.
2. A self-supervised medical image segmentation method based on random walk path as claimed in claim 1, characterized in that the conversion The process of constructing a graph data structure includes defining each pixel or voxel in the medical image as a node in the graph, and the edges between the nodes are established according to the spatial proximity of the pixels or voxels, and the weights of the edges reflect the similarity between the nodes.
3. A self-supervised medical image segmentation method based on random walk path as claimed in claim 1 or 2, characterized in that: It also includes the use of adjacency matrices to represent the topological structure of a graph. For unweighted graphs, the adjacency matrix is a binary matrix that indicates whether there are edge connections between nodes; for weighted graphs, the elements of the adjacency matrix are the weight values of the edges, indicating the similarity between nodes.
4. The method for self-supervised medical image segmentation based on random walk path as claimed in claim 1, characterized in that: The process of feature aggregation for the updated features of all nodes includes propagating node features through the adjacency matrix to generate new node representations, and using the encoder of the graph convolutional network to perform feature aggregation on the graph data. By superimposing multiple layers of graph convolutional networks, the final features of the node contain information about its direct neighbors and more distant nodes. In the last layer of the encoder, the features of all nodes are aggregated into global features.
5. The self-supervised medical image segmentation method based on random walk path as claimed in claim 1, characterized in that During the random walk, the non-normalized transition probability is used to maximize the topological relationship between nodes. The transition probability is: Among them, L i-1,i+1 Represents node v i-1 With v i+1 The shortest path length between i-1,i+1 =1, v i-1 v i+1 ; α and β are the transfer parameters of the random walk, which control the preference of the nearest and distant neighbor nodes respectively; when α<1 and β>1, the random walk strategy collects the information of the adjacent nodes and extracts the homogeneous information; when α>1 and β<1, the random walk strategy gives priority to visiting the more distant nodes and extracts the heterogeneous information.
6. The method for self-supervised medical image segmentation based on random walk path as claimed in claim 1, characterized in that: A gated recurrent unit encoder is used to encode each random walk path, and the importance weight of each path is learned through the attention mechanism. Multi-head attention calculation is performed on the path information after weight aggregation, and the results are spliced.
7. The method for self-supervised medical image segmentation based on random walk path as claimed in claim 1, characterized in that: Random perturbations generate contrast views and use the similarity between nodes for embedding calculation. The process of generating contrast views with node features and edges includes: two nodes v j and v l The embedding similarity between is calculated as: S(v j ,v l )=θ(W c [IN v in j ||In v in l ]) in, is a subgraph, W c and W v is a learnable weight matrix, θ(·) is an activation function; Similarity-based node embedding aggregation: W l =softmax(sim(v j ,v l )); Among them, Softmax is used to normalize the weights, W l Represents the node embedding after aggregation.
8. The method for self-supervised medical image segmentation based on random walk path as claimed in claim 1, characterized in that: In the process of optimizing subgraphs using structured contrastive loss, Wasserstein contrastive loss and Gromov-Wasserstein contrastive loss are used to measure the similarity between nodes and edges, respectively. Wasserstein contrastive loss is used to represent the transmission cost between a subgraph and its contrast subgraph, and optimization is achieved by minimizing the node similarity difference between positive samples and maximizing the node similarity difference between negative samples. Gromov-Wasserstein contrastive loss is used to capture the structural similarity of edges in subgraphs, and optimization is achieved by minimizing the edge similarity difference between positive samples and maximizing the edge similarity difference between negative samples.
9. A self-supervised medical image segmentation system based on random walk paths, characterized in that: include: A preprocessing module is configured to preprocess the acquired medical image and convert it into a graph data structure, extract the initial features of each node in the graph data structure, and perform standardization on the initial features; The node information updating module is configured to update the features of each node based on the message passing mechanism, and perform feature aggregation on the updated features of all nodes to obtain the global features; The multi-hop path sampling module is configured to sample the homogeneous neighborhood distribution and the heterogeneous neighborhood distribution of the central node based on the short-distance random walk strategy and the long-distance random walk strategy, respectively, to form a random walk path; The inter-path information aggregation module is configured to encode each random walk path, learn the weights of each random walk path through the attention mechanism, and concatenate the path information after weight aggregation to generate a global embedding representation; The subgraph generation module is configured to extract nodes and edges whose topological distance from the central node does not exceed a set threshold to form a subgraph, introduce random perturbations to generate a comparison view, and use the similarity between nodes for embedding calculation to generate a comparison subgraph with node features and edges; The structured optimization module is configured to optimize the subgraphs using a structured contrast loss based on the subgraphs and the contrast subgraphs.
10. An electronic device, characterized in that: The method comprises a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the steps in the method according to any one of claims 1 to 8 are completed.
Citation Information
Patent Citations
MR (magnetic resonance) image three-dimensional interactive segmenting method for random walks and graph cuts based active contour model
CN106780518A
Image segmentation method based on random walk combining local structure information around pixel points
CN107818566A
Illegal account identification method based on graph contrast learning
CN116738201A
Network node full-granularity anomaly detection method and system based on attribute enhanced sampling
CN118074958A
Heterogeneous graph anomaly detection method based on adaptive selection of multi-channel neighborhood nodes
CN118540239A