Method for segmenting tumor region in medical image, computer device and storage medium
By employing random sampling and local search to obtain high-quality seed points in medical images, and combining the watershed algorithm, deep Q-network, and average linking algorithm, the problem of tumor segmentation deviation in existing technologies is solved, and accurate segmentation of tumor regions is achieved.
Patent Information
- Application Number
- CN202511308315.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-15
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2045-09-15
AI Technical Summary
Existing medical image tumor segmentation methods are prone to oversegmentation or undersegmentation in images with complex grayscale distribution and blurred boundaries, and are sensitive to the selection of seed points, leading to deviations in segmentation results.
Random sampling and local search are used to obtain target voxels with extremely small local gray values as seed points for the watershed algorithm. The watershed algorithm is then used for preliminary segmentation. Texture feature data of candidate segmentation regions are used for merging and optimization. Clustering is then performed using a deep Q-network and an average linking algorithm to finally obtain accurate tumor region segmentation results.
It improves the accuracy of tumor region segmentation, reduces oversegmentation, eliminates noise interference, and ensures the precision of tumor region segmentation, especially showing significant effects in complex head and neck cancer malignant tumor regions.
Smart Images

Figure CN120807556B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of medical images, in particular to a tumor region segmentation method in a medical image, a computer device and a storage medium. BACKGROUND
[0002] Tumor region image segmentation can provide an important basis for doctors to develop treatment plans. In related technologies, medical image tumor segmentation methods mainly include threshold segmentation method, region growing method, etc. The threshold segmentation method is a segmentation method based on image gray value. For images with complex gray distribution and fuzzy boundaries, the segmentation effect is not ideal, and over-segmentation or under-segmentation may occur. The region growing method is sensitive to the selection of seed points, and the design of the growth criterion needs to fully consider the characteristics of tumors in certain body parts, otherwise the deviation of the segmentation result may be caused. Therefore, it is urgent to propose a new tumor region segmentation method in a medical image. SUMMARY
[0003] The present application provides a tumor region segmentation method in a medical image, a computer device and a storage medium, which solves the technical problem of deviation of tumor segmentation results in medical images in related technologies, and achieves the technical effect of improving the accuracy of segmentation results.
[0004] In order to achieve the above purpose, the present application provides a tumor region segmentation method in a medical image, which comprises: acquiring a to-be-segmented medical image, performing random sampling and local search based on the to-be-segmented medical image to obtain a target voxel with a local minimum gray value as a seed point of a watershed algorithm; performing watershed algorithm segmentation on the to-be-segmented medical image based on the seed point to obtain a preliminary segmentation result; wherein the candidate segmentation region in the preliminary segmentation result has texture feature data; merging and optimizing the candidate segmentation region in the preliminary segmentation result by using the texture feature data of the candidate segmentation region to obtain an intermediate segmentation result; and clustering the intermediate segmentation result to obtain a target segmentation result corresponding to the tumor region.
[0005] Optionally, the random sampling and local search based on the to-be-segmented medical image to obtain a target voxel with a local minimum gray value comprises: performing normalization preprocessing on the to-be-segmented medical image according to the gray values of each voxel in the to-be-segmented medical image to obtain a normalized result; and performing random sampling and local search on the normalized result by a dynamic Monte Carlo algorithm to obtain the target voxel.
[0006] Optionally, the random sampling and local search on the normalized result by a dynamic Monte Carlo algorithm to obtain the target voxel comprises: randomly sampling according to the normalized result to obtain a preset number of preliminary voxels; wherein the preliminary voxel has a current statistical number of being randomly selected as a local minimum value; selecting any preliminary voxel to be reserved with a probability of the reciprocal of the current statistical number, updating the current statistical number corresponding to the any preliminary voxel to obtain an updated statistical number in the current round; performing local search on the gray value of the any preliminary voxel in the preset number of preliminary voxels to obtain a local search result; wherein the local search result comprises a preliminary voxel with a local minimum gray value in the current round; if the iteration process is completed, sorting according to the updated statistical number of the preliminary voxel in the last round to obtain the target voxel satisfying the preset sorting requirement.
[0007] Optionally, the local search based on the gray value of the any preliminary voxel in the preset number of preliminary voxels to obtain a local search result comprises: determining a specified number of other preliminary voxels around the any preliminary voxel in the preset number of preliminary voxels; performing local search based on the gray value of the any preliminary voxel and the gray values of the specified number of other preliminary voxels to obtain the local search result.
[0008] Optionally, the texture feature data comprises contrast index data, uniformity index data, homogeneity index data and entropy index data; and the merging optimization of the candidate segmentation region in the preliminary segmentation result by using the texture feature data of the candidate segmentation region to obtain an intermediate segmentation result comprises: for two adjacent candidate segmentation regions in the preliminary segmentation result, performing merging evaluation by using the contrast index data, uniformity index data, homogeneity index data and entropy index data of the two candidate segmentation regions respectively to obtain a merging evaluation result between the two candidate segmentation regions; wherein the merging evaluation result is used to describe whether the two candidate segmentation regions perform a merging operation or a non-merging operation; and performing merging optimization on the preliminary segmentation result according to the merging evaluation result to obtain the intermediate segmentation result.
[0009] Optionally, the merging evaluation result between the two candidate segmentation regions is obtained by using the contrast index data, the uniformity index data, the homogeneity index data and the entropy index data of the two candidate segmentation regions respectively, including: determining texture feature difference data between the two candidate segmentation regions by using the contrast index data, the uniformity index data, the homogeneity index data and the entropy index data of the two candidate segmentation regions respectively; constructing a state space based on the texture feature difference data between the two candidate segmentation regions; and obtaining the merging evaluation result by estimating the state space through a target deep Q network.
[0010] Optionally, the intermediate segmentation result is obtained by estimating based on the texture feature data of the candidate segmentation region by using a target deep Q network; a reward function used for training the target deep Q network includes a first reward item and a second reward item; wherein the first reward item is a reward item for operation rationality judgment based on the change of gray value features before and after the merging of adjacent candidate segmentation regions; and the second reward item is a reward item for operation rationality judgment based on the change of similarity between the shape before and after the merging of adjacent candidate segmentation regions and the actual shape of the tumor.
[0011] Optionally, the adjacent candidate segmentation regions include a first candidate region and a second candidate region; the first reward item and the second reward item are determined by: using the first gray mean variance of the first candidate region before merging, the second gray mean variance of the second candidate region before merging, and the third gray mean variance of the first candidate region and the second candidate region after merging to judge the rationality of merging operation and non-merging operation, to obtain the first reward item; and using the first overlap degree between the merged region of the first candidate region and the second candidate region and the tumor label region, and the second overlap degree between the first candidate region and the tumor label region to judge the rationality of merging operation and non-merging operation, to obtain the second reward item.
[0012] Embodiments of the present application provide a computer device, comprising: a memory and a processor, which are communicatively connected with each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the method of any one of the above embodiments.
[0013] Embodiments of the present application provide a computer readable storage medium, which stores computer instructions, and the computer instructions are used to make a computer execute the method of any one of the above embodiments.
[0014] In the embodiments of the present application, firstly, a to-be-segmented medical image is acquired, and random sampling and local search are performed based on the to-be-segmented medical image to obtain target voxels with locally minimum gray value; secondly, the target voxels are taken as seed points of a watershed algorithm to segment the to-be-segmented medical image by the watershed algorithm to obtain a preliminary segmentation result; then, candidate segmentation regions in the preliminary segmentation result are merged and optimized by using texture feature data of the candidate segmentation regions to obtain an intermediate segmentation result; finally, the intermediate segmentation result is clustered to obtain a target segmentation result corresponding to a tumor region. In the above process, the high-quality local minimum points are taken as the seed points of the watershed algorithm, which not only can reduce the over-segmentation problem, but also can exclude accidental noise minimum points, retain stable tumor region candidate points, improve the accuracy of tumor segmentation at the first level, and on this basis, optimize the preliminary segmentation result to improve the accuracy of tumor region segmentation at the second level, thereby ensuring the accuracy of the tumor region segmentation result. BRIEF DESCRIPTION OF DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without any creative effort.
[0016] Figure 1a A flowchart of a segmentation method of a tumor region in a medical image provided by the embodiments of the present application is shown in the figure.
[0017] Figure 1b A flowchart of an average link algorithm provided by the embodiments of the present application is shown in the figure.
[0018] Figure 2 A flowchart of a segmentation method of a tumor region in a medical image provided by the embodiments of the present application is shown in the figure.
[0019] Figure 3a A flowchart of a segmentation method of a tumor region in a medical image provided by the embodiments of the present application is shown in the figure.
[0020] Figure 3b A process diagram for determining local minimum gray value based on the principle of Monte Carlo algorithm provided by the embodiments of the present application is shown in the figure.
[0021] Figure 4a A diagram of four directions provided by the embodiments of the present application is shown in the figure.
[0022] Figure 4b A flowchart of a segmentation method of a tumor region in a medical image provided by the embodiments of the present application is shown in the figure.
[0023] Figure 5a A flowchart of a method for segmenting a tumor region in a medical image according to an embodiment of the present application is shown in FIG. 1.
[0024] Figure 5b A schematic diagram of a DQN learning framework according to an embodiment of the present application is shown in FIG. 2.
[0025] Figure 5c A schematic diagram of a DQN training process according to an embodiment of the present application is shown in FIG. 3.
[0026] Figure 6 A structural schematic diagram of a computer device according to an embodiment of the present application is shown in FIG. 4. DETAILED DESCRIPTION
[0027] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the following will be combined with the accompanying drawings for the embodiments of the present application to make a clear and complete description of the technical solutions in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0028] In the related art, due to the particularity of some body parts, image segmentation for tumors in these body parts faces many challenges. Taking the head and neck as an example, first, the boundary between a malignant tumor and the surrounding normal tissue may not be clear on a computed tomography (CT) image, increasing the difficulty of positioning. Second, the skeletal structure of the head and neck region is complex, and these skeletal structures will produce different degrees of artifacts on the CT image, affecting the positioning of the tumor. Third, the shape and size of tumors in different parts of the head and neck vary greatly, and this diversity makes it difficult to use a uniform standard to locate the tumor. Finally, the growth and spread of malignant tumors can change their relationship with the surrounding tissues, causing the shape and position of these tissues on the CT image to change, thereby affecting tumor positioning.
[0029] In addition to the threshold segmentation method and region growing method mentioned in the background art, in the related art, the tumor segmentation methods based on machine learning mainly include support vector machine (SVM) and convolutional neural network (CNN). Among them, SVM is a binary classification model, and its processing capability for high-dimensional data and complex sample distribution is limited, and the performance of the model is sensitive to the selection of kernel function and parameter adjustment; the convolutional neural network automatically extracts the features of the image through the combination of convolutional layer, pooling layer and full connection layer and the like, but the training of the convolutional neural network requires a large amount of labeled data, and the model complexity is high, and overfitting problem is easy to occur. In addition, the watershed algorithm can also be used for tumor segmentation, but it is sensitive to noise and fine texture, and is prone to over-segmentation problem.
[0030] Based on the above analysis, the embodiment of the present application provides a tumor region segmentation method in a medical image. In the method flow, first, the Monte Carlo algorithm with dynamic sampling strategy is used to statistically obtain the voxel points most likely to be local minimum gray value as the catchment basin seeds; second, the watershed algorithm is performed with the catchment basin seeds to obtain the segmentation result; third, the deep Q network (DQN) calculation framework is used to merge the segmentation result; and finally, the average linkage algorithm is used to separate the tumor region. The embodiment of the present application combines the dynamic Monte Carlo algorithm, the watershed algorithm, the deep Q network and the average linkage algorithm to segment the tumor region. Compared with the algorithm flow in the related art, the embodiment of the present application is more accurate in tumor region segmentation, and has faster calculation speed, especially for complex head and neck cancer tumor regions.
[0031] Referring to Figure 1a The tumor region segmentation method in a medical image provided by the embodiment of the present application includes the following steps:
[0032] S110, obtaining a to-be-segmented medical image, performing random sampling and local search based on the to-be-segmented medical image to obtain a target voxel with a local minimum gray value as a seed point of a watershed algorithm.
[0033] The to-be-segmented medical image can be three-dimensional CT data in DICOM format, which contains gray value information of multiple slice images. The to-be-segmented medical image can include a head and neck CT scan image of a patient, which contains gray value distribution to reflect the density difference of different tissues. The tumor region can be a lesion region that needs to be identified and segmented in the medical image, and its gray value or texture feature usually has a significant difference from normal tissue. For example, in a head and neck cancer CT image, the gray value or texture feature of the tumor region is contrasted with normal tissue.
[0034] The target voxel can be a voxel confirmed as a local gray value minimum after random sampling and local search, and it is a seed point of the watershed algorithm. For example, the gray value of the target voxel can be significantly lower than the surrounding voxels, and it is verified as a stable minimum value point by sampling and searching.
[0035] The seed point of the watershed algorithm can be a starting point for initializing region segmentation in the watershed algorithm, and each seed point corresponds to a catchment basin (region). For example, in a three-dimensional CT image, the seed points can be distributed in the potential low gray value region of the tumor region, thereby guiding the watershed algorithm to gradually expand to the boundary of the segmented region.
[0036] Specifically, the original image data is read from a medical imaging device (such as a CT machine) or a digital image storage system and loaded into a computer system for processing. A number of voxels are selected as initial candidate points based on the medical image to be segmented by random selection. For example, random sampling can use the Marsen rotation algorithm to generate random coordinates, thereby selecting 5000 voxels uniformly distributed in the image space. Based on the randomly sampled voxels, local minimum points are found by comparing the gray values of any voxel and its neighborhood voxels. For example, the local search can use a 26-neighborhood (up, down, left, right, front, back, etc. in three-dimensional space) as the range, and gradually move towards the voxel with the lowest gray value until a voxel with a gray value lower than all its neighborhood voxels is found, thereby determining that the voxel is a local minimum point. In this embodiment, by screening out high-quality local minimum points as seed points of the watershed algorithm, not only can the over-segmentation problem be reduced, but also accidental noise minimum points can be excluded, and stable tumor region candidate points can be retained.
[0037] S120, performing watershed algorithm segmentation on the medical image to be segmented based on the seed points to obtain a preliminary segmentation result.
[0038] The candidate segmentation region in the preliminary segmentation result has texture feature data. The watershed algorithm segmentation refers to a technique that simulates the "water injection" process to divide the image into multiple catchment basins (regions). The candidate segmentation region can be a region that needs to be further optimized in the preliminary segmentation result, which can contain tumor tissue or normal tissue. For example, the candidate segmentation region can include multiple small regions with low gray values, some of which belong to tumors, and others belong to normal tissue or noise.
[0039] Specifically, a target voxel with a local minimum gray value is taken as a starting point of the initialization region segmentation, and the gray values of the hospital image to be segmented are sorted, and then the adjacent voxels are marked step by step from the seed point until all voxels are assigned to a catchment basin, so as to obtain a plurality of candidate segmentation regions, that is, a preliminary segmentation result. The texture feature data can be a feature parameter extracted by analyzing a gray level co-occurrence matrix (GLCM) or other texture statistical methods of the candidate segmentation region, and the texture characteristics of the region are described by the texture feature data. For example, the texture feature data can include contrast, uniformity, entropy, homogeneity and the like, which reflect the spatial distribution law of the region gray value.
[0040] Exemplarily, the calculation process of the watershed algorithm includes two steps, namely, a sorting process and a flooding process.
[0041] In the sorting process, each voxel in the medical image to be segmented is traversed based on the gray value h, and is sorted from low to high, and the sorting result is put into a one-dimensional array. For example, from all voxels of a three-dimensional CT image, N gray values are identified, that is, {h1, h2, …… hn}, where n∈[1, N]. After sorting, the obtained sequence H0 is denoted as [hmin, …… h1, …… hmax]. Where hmin is the minimum gray value, and hmax is the maximum gray value. The purpose of this step is to provide an ordered gray value sequence for the subsequent flooding process to process the medical image to be segmented.
[0042] In the flooding process, in the initialization stage, a label is defined for each catchment basin seed (that is, a target voxel with a local minimum gray value determined by a dynamic Monte Carlo algorithm) to distinguish different catchment basin regions; all target voxels representing seeds are added to a "first-in, first-out" F queue; then the following operations are repeatedly executed in a loop:
[0043] 1) An unused gray value in the sequence HO is taken as a threshold value Gth of the current iteration;
[0044] 2) A voxel in the F queue is taken out, denoted as T0;
[0045] 3) The neighborhood voxels T1-T26 (that is, the surrounding 26 voxels) of the voxel T0 are checked, if the gray value of a neighborhood voxel (such as T12) is less than or equal to the current gray value threshold Gth and has not been marked, then the neighborhood voxel T12 is marked as belonging to the same catchment basin as the current voxel T0, and the neighborhood voxel T12 is added to the queue F. If a voxel has been marked, it is not added to the F queue;
[0046] 4) Step 2) is repeated until the queue is empty or all voxels are marked;
[0047] 5) Repeat step 1) until all gray values are used as threshold, i.e. until hmax.
[0048] After the flooding process is completed, all voxels containing different catchment basin labels are the watershed, i.e. the three-dimensional CT image is segmented into different candidate regions by voxels containing different catchment basin labels. For example, if there are 500 seed points, there are 500 candidate regions. The candidate region set can be denoted as r, represented as [r1, r2, …, ri], where i ∈ [1, 500].
[0049] S130, merging and optimizing the candidate segmentation regions in the preliminary segmentation result using the texture feature data of the candidate segmentation regions to obtain an intermediate segmentation result.
[0050] In some cases, the medical image to be segmented can be quickly segmented into multiple regions using the watershed algorithm, but over-segmentation may occur due to uneven distribution of seed points, and therefore further optimization is needed. Specifically, by comparing the texture feature data of the candidate segmentation regions, it is determined whether they should be merged into one region, thereby reducing the problem of over-segmentation or under-segmentation. For example, the region merging strategy can be dynamically adjusted by a machine learning model to improve segmentation accuracy. For example, the merging and optimization can be to evaluate the texture feature difference between two regions using a deep Q network (DQN), and if the difference is small and the gray variance decreases after merging, the merging operation is performed. After merging and optimization, the number of candidate regions in the segmentation result is reduced compared to the preliminary segmentation result, and the shape is closer to that of the actual tumor region. For example, the intermediate segmentation result can include merging at least two small regions into one connected tumor region; the intermediate segmentation result can also include merging at least two small regions into one connected normal tissue region.
[0051] S140, clustering the intermediate segmentation result to obtain a target segmentation result corresponding to the tumor region.
[0052] The clustering can be a statistical method based on the texture feature data of the candidate segmentation regions to divide them into tumor tissue clusters and normal tissue clusters. For example, the Average Linkage algorithm can be used to gradually merge regions with high similarity by calculating the Euclidean distance between regions.
[0053] Specifically, the tumor tissue is separated from the intermediate segmentation result by the clustering method. For example, the target segmentation result can determine that a cluster with fewer regions is a tumor region, and a cluster with more regions is normal tissue, thereby clearly identifying the tumor tissue and the normal tissue, and further completing the accurate segmentation of the tumor region. In this embodiment, the regions in the intermediate segmentation result are divided into two categories based on the similarity of the texture features, and the tumor tissue is determined by the number of regions, thereby outputting a clinically usable segmentation result.
[0054] In this embodiment, the average linkage algorithm of the agglomerative hierarchical clustering is used to cluster all the tumor tissue regions and normal tissue regions together, respectively, so as to realize the final tumor tissue recognition.
[0055] The core idea of the average linkage algorithm is that the distance between two clusters is equal to the average distance of all sample pairs in the two clusters, and the formula is as follows:
[0056]
[0057] wherein, and are two clusters, and are the number of regions in the cluster, is the distance between region and region , ∈ , ∈ .
[0058] wherein, the attribute of the region to be clustered is denoted as RV=[Vɵ1,Vɵ2,Vɵ3, Vɵ4]. The distance between regions is calculated using the Euclidean distance, and the formula is as follows:
[0059]
[0060] wherein, is the attribute of region , such as a 16-dimensional texture feature, is the attribute of region .
[0061] The calculation process of the average linkage algorithm is exemplarily illustrated in Figure 1b . It is initially considered that each sample is an independent cluster, the average distance between all clusters is calculated, the two clusters with the smallest average distance are merged, it is judged whether there are two clusters left, if yes, the cluster with fewer members is determined as the malignant tumor tissue, if not, the average distance between the remaining clusters is calculated again, the above steps are repeated until there are two clusters left.
[0062] In the above embodiment, firstly, the medical image to be segmented is acquired, and random sampling and local search are performed based on the medical image to be segmented to obtain target voxels with local minimum gray value; secondly, the target voxels are taken as seed points of a watershed algorithm to perform watershed algorithm segmentation on the medical image to be segmented to obtain a preliminary segmentation result; then, candidate segmentation regions in the preliminary segmentation result are merged and optimized by using texture feature data of the candidate segmentation regions to obtain an intermediate segmentation result; finally, clustering is performed on the intermediate segmentation result to obtain a target segmentation result corresponding to a tumor region. In the above process, the high-quality local minimum points are taken as seed points of the watershed algorithm, which can not only reduce the over-segmentation problem, but also exclude accidental noise minimum points and retain stable tumor region candidate points, thereby improving the accuracy of tumor segmentation at the first level, and on this basis, the preliminary segmentation result is optimized to improve the accuracy of tumor region segmentation at the second level, so as to ensure the accuracy of the tumor region segmentation result.
[0063] In some embodiments, referring to Figure 2 , random sampling and local search are performed based on the medical image to be segmented to obtain target voxels with local minimum gray value, including:
[0064] S210, performing normalization preprocessing on the medical image to be segmented according to the gray values of the voxels in the medical image to be segmented to obtain a normalized result.
[0065] Specifically, the gray values of the voxels in the medical image to be segmented, the maximum gray value and the minimum gray value in the medical image to be segmented are determined. The gray values of the voxels in the medical image to be segmented are mapped to between 0 and 1 by using the maximum gray value and the minimum gray value, to obtain the normalized result.
[0066] It can be understood that a voxel is the smallest unit of a three-dimensional space composed of a CT image. Each voxel in the CT image has a corresponding gray value (Hounsfield Unit, HU). The maximum and minimum values of the gray values of all voxels are normalized, that is, the gray values of the image are mapped to between 0 and 1, to eliminate the gray difference between different images and improve the stability and generalization ability of the algorithm. The formula of normalization is as follows:
[0067]
[0068] wherein h is the original gray value of the voxel in the medical image to be segmented, is the minimum gray value in the medical image to be segmented, is the maximum gray value in the medical image to be segmented, is the normalized result.
[0069] S220, randomly sampling and locally searching the normalized result by a dynamic Monte Carlo algorithm to obtain the target voxel.
[0070] The dynamic Monte Carlo algorithm refers to a method combining random sampling and probability selection to screen local minimum points in the normalized medical image. For example, the dynamic Monte Carlo algorithm can combine the Mason rotation algorithm to generate random coordinates, iteratively sample the image multiple times, and dynamically adjust the sampling strategy according to the frequency of the voxel being selected as a local minimum value, so as to preferentially retain local minimum points with high stability.
[0071] Specifically, the gray level difference between different voxels is eliminated by normalization to provide a unified data basis for subsequent random sampling and local search. The dynamic Monte Carlo algorithm is used to randomly sample and locally search the normalized result to screen high-quality local minimum points as seed points for the watershed algorithm, thereby reducing the over-segmentation problem. For example, the dynamic Monte Carlo algorithm preferentially retains local minimum points with high frequency by multiple iterations and probability selection mechanism. These points are more likely to correspond to the true boundary of the tumor region, while low-frequency points are likely to be excluded as noise or false minimum points.
[0072] In the above embodiments, firstly, the normalization preprocessing is used to avoid segmentation deviation caused by inconsistent gray value ranges, and secondly, the dynamic Monte Carlo algorithm is used to preferentially retain local minimum points with high frequency, thereby reducing the influence of noise interference on the quality of seed points.
[0073] In some embodiments, referring to Figure 3a The dynamic Monte Carlo algorithm is used to randomly sample and locally search the normalized result to obtain the target voxel, including:
[0074] S310, randomly sampling the normalized result to obtain a preset number of preliminary voxels.
[0075] The preliminary voxels have a current statistical number of being randomly selected as local minimum values. The preset number of preliminary voxels can be an initial candidate voxel set randomly sampled from the normalized medical image. The initial candidate voxel set includes the preset number of preliminary voxels. For example, the preset number can be 5000, and these voxels are uniformly distributed in the image by randomly selecting coordinates generated by the Mason rotation algorithm as the starting point for subsequent local search.
[0076] The current statistical number can be a statistical value of the number of times that each preliminary voxel is randomly selected and participates in the local search, and is used to measure the stability of the local minimum value. For example, if a voxel is selected in multiple iterations, the current statistical number will gradually increase, indicating that it is more likely to correspond to a real local minimum point. It should be noted that the current statistical number is denoted as c, and the initial value of c can be equal to 1.
[0077] Specifically, the image space is covered by uniform distribution random sampling to provide candidate points for subsequent local search. Random sampling ensures the diversity of local minimum points, avoiding segmentation deviation caused by local area being too dense or too sparse.
[0078] S320, selecting any preliminary voxel to be retained with the reciprocal of the current statistical number as the probability, updating the current statistical number corresponding to any preliminary voxel, and obtaining the updated statistical number in the current round.
[0079] The updated statistical number can be the result of the incremental operation on the current statistical number of the retained preliminary voxel, and is used to record the contribution of the preliminary voxel in the current round of iteration. For example, if a voxel is retained in the current round, the updated statistical number of the voxel is equal to the current statistical number of the voxel plus one. Thus, the possibility of the voxel as a seed point is strengthened.
[0080] Specifically, in order to strengthen the contribution of high stability voxels and make them more likely to be retained in subsequent iterations, the probability of being retained is dynamically adjusted according to the current statistical number of the preliminary voxel, so that high stability local minimum points are preferentially retained. For example, if the current statistical number of a voxel is c, the probability of being retained is 1 / c. If c is large (such as c=10), the retention probability is low (0.1), and vice versa if c is small (such as c=1), the retention probability is high (1.0). This mechanism filters low-frequency false minimum points by probability selection and retains high-frequency real minimum points.
[0081] S330, performing local search on any preliminary voxel based on the gray value of the preliminary voxel in a preset number of preliminary voxels, and obtaining a local search result.
[0082] The local search result includes the preliminary voxel with the local minimum gray value in the current round. Specifically, the process of gradually finding the local minimum point by comparing the gray values of the neighbor voxels of the retained preliminary voxel is started.
[0083] In some embodiments, the local search is performed based on the gray value of any preliminary voxel in a preset number of preliminary voxels to obtain a local search result, including: determining a specified number of other preliminary voxels around any preliminary voxel in the preset number of preliminary voxels; and performing the local search based on the gray value of any preliminary voxel and the gray values of the specified number of other preliminary voxels to obtain the local search result.
[0084] In this embodiment, the specified number can be equal to 26, or for the purpose of reducing the amount of calculation, the specified number can be less than 26. Exemplarily, the local search can adopt a 26-neighborhood strategy (up, down, left, right, front, back, etc. in a three-dimensional space), starting from the current voxel, finding the neighborhood voxel with the minimum gray value, and repeating the process until a voxel is found whose gray value is lower than all 26 of its neighborhood voxels, thereby determining that the voxel is a local minimum point. The set of preliminary voxels with local minimum gray values confirmed by the local search in the current round of iteration. For example, in each round of iteration, the local search result can contain several voxels whose gray values are significantly lower than those of the surrounding voxels, and their stability is verified by multiple iterations.
[0085] S340, if the iteration process of the above steps is completed, the preliminary voxels are sorted according to the updated statistical number in the last round to obtain target voxels meeting the preset sorting requirement.
[0086] Specifically, in the multi-round execution process of the dynamic Monte Carlo algorithm, through repeated random sampling, probability selection, local search and statistical number updating, the set of local minimum points with high quality is gradually converged. For example, the iteration process can be performed for N rounds, and in each round, the retention probability is adjusted according to the updated statistical number, and finally the most stable local minimum points are screened out. The preset sorting requirement refers to the rule for sorting the updated statistical number of the preliminary voxels in the last round of iteration, which is used to determine the final set of seed points. For example, the preset sorting requirement can be to arrange the updated statistical number in descending order, and take the top 500 voxels as the target voxels (i.e. the seed points of the watershed algorithm).
[0087] Please refer to Figure 3b for an exemplary explanation of the process of determining local minimum gray values based on the principle of Monte Carlo algorithm.
[0088] Each voxel is defined to have 5-dimensional attributes v = [x, y, z, h, c] in the Cartesian product coordinate system.
[0089] Wherein, x, y, z are the coordinates of X-axis, Y-axis, Z-axis respectively. For example, a medical image to be segmented with a length of N pixels, a width of M pixels, and a thickness of L pixels, x e [1, N], y e [1, M], z e [1, L], the total number of voxels is N*M*L. h is the result of voxel gray value normalization. c is the statistical number of times that the voxel is randomly selected as a local minimum value.
[0090] Taking a three-dimensional CT image as an example, the medical image to be segmented is first generated in the x, y, z directions using the Mason rotation algorithm, and 5000 voxels Tw in the three-dimensional CT image space are randomly sampled, wherein w e [1, 5000].
[0091] The reciprocal of the selected voxel c value (i.e. 1 / c) is used as the probability for selection: whether the selected voxel is retained as the random result of this time. If retained, the voxel proceeds to the subsequent link; otherwise, the voxel is discarded. The c value of each retained voxel Tw is incremented by 1.
[0092] Secondly, a local search is performed, i.e. taking the selected voxel Tw0 as the starting point, finding the voxel Tw1 with the smallest gray value among the 26 voxels around it, and then continuing to find the voxel Tw2 with the smallest gray value among the 26 voxels around Tw1, until a voxel Twi is found whose gray value is smaller than that of all the 26 voxels around it. Twi is the final result of the local search (the gray value is the smallest). All search results are local minimum values randomly selected this time, i.e. the seeds of the watershed algorithm.
[0093] Next, the iteration operation of randomly sampling W voxels is performed again, until the preset number of iterations is completed.
[0094] Finally, all voxels are arranged in descending order according to the c value, and the top 500 voxels are taken as the seeds of the watershed algorithm.
[0095] In the above embodiment, after a preliminary number of voxels are randomly sampled, a dynamic probability mechanism is used to filter low-frequency false minimum value points and retain high-frequency true minimum value points. After multiple iterations, the statistical number of high-frequency voxels increases significantly, further consolidating their status as seed points. Through local search, the gray value of the voxel is ensured to be significantly lower than that of the surrounding voxels, thereby reducing noise interference and excluding false judgments caused by gray fluctuations in the neighborhood. Finally, a high-quality seed point set is screened out based on multiple rounds of iteration, which can effectively guide the watershed algorithm to segment the tumor region and reduce the problem of over-segmentation.
[0096] In some embodiments, the texture feature data includes contrast indicator data, uniformity indicator data, homogeneity indicator data, and entropy indicator data. For each candidate segmentation region, there are four gray level indicators, namely, contrast, uniformity, homogeneity, and entropy. Since the CT image has low resolution in the Z-axis direction, the embodiments of the present application use a two-dimensional gray level co-occurrence matrix (2D GLCM) to statistically calculate the four indicators in the X-axis and Y-axis directions, so as to represent the texture features of the corresponding region.
[0097] The GLCM is a matrix of size N x N (N is the number of different gray values after normalization of the image). For a pixel pair , the matrix element represents the frequency of the simultaneous occurrence of a pixel with a gray value of i and a pixel with a gray value of j in the direction and at a distance d. The specific calculation steps are as follows:
[0098] Step 1: Set the direction and the distance d.
[0099] The direction is set to four directions Figure 4a , and the distance is one pixel. Please refer to Figure 4a for the four directions.
[0100] Step 2: Traverse the entire image and count the number of pixel pairs that satisfy the direction and the distance d.
[0101] Step 3: Normalize the statistical result to obtain the probability matrix:
[0102]
[0103] The following four indicators are obtained using the GLCM:
[0104] 1) Contrast, which has the physical meaning of reflecting the local variation intensity of the image, and the greater the value, the clearer the texture. The formula is as follows:
[0105]
[0106] 2) Uniformity, which has the physical meaning of reflecting the uniformity of the gray scale distribution of the image, and the greater the value, the more uniform the texture. The formula is as follows:
[0107]
[0108] 3) Entropy, its physical meaning: reflects the complexity of the image, the greater the value of the texture more complex. The formula is as follows:
[0109]
[0110] 4) Homogeneity, its physical meaning: reflects the local similarity of the image, the greater the value of the texture more smooth. The formula is as follows:
[0111]
[0112] The above four indicators of each direction are calculated to obtain the texture feature attribute Vɵ=[c, u, e, h], wherein c represents contrast, u represents uniformity, e represents entropy, and h represents homogeneity. Each candidate region r has 16 attributes to represent its texture features, that is:
[0113] RV=[Vɵ1, Vɵ2, Vɵ3, Vɵ4]
[0114] Correspondingly, refer to Figure 4b , the texture feature data of the candidate segmentation region is used to merge and optimize the candidate segmentation region in the preliminary segmentation result, to obtain an intermediate segmentation result, including:
[0115] S410, for two adjacent candidate segmentation regions in the preliminary segmentation result, the contrast index data, uniformity index data, homogeneity index data and entropy index data of the two candidate segmentation regions are used for merging evaluation, to obtain a merging evaluation result between the two candidate segmentation regions.
[0116] The merging evaluation result is used to describe whether the two candidate segmentation regions perform merging operation or non-merging operation. The two adjacent candidate segmentation regions can be two regions adjacent in space (such as sharing a boundary) in the preliminary segmentation result, which can have similarity in gray scale or texture features. For example, in a CT image, two adjacent low gray regions can belong to the same tumor region, and a low gray region and a high gray region can belong to different tissue types.
[0117] In some cases, since the selection of the contrast index data, the uniformity index data, the homogeneity index data and the entropy index data is based on the statistical characteristics of the gray level co-occurrence matrix (GLCM), the texture distribution law of the region can be comprehensively reflected. For example, the contrast and the uniformity focus on describing the local change of the gray value, and the homogeneity and the entropy focus on describing the global distribution of the gray value, and the combination of the four can provide more robust basis for the similarity judgment of the region. Therefore, in the embodiment, the texture feature similarity of the two candidate segmentation regions is obtained by quantitatively comparing the contrast index data, the uniformity index data, the homogeneity index data and the entropy index data of the two candidate segmentation regions respectively; or in other words, the decision result of whether the two adjacent candidate segmentation regions should be merged into one region is determined by comparing the contrast, the uniformity, the homogeneity and the entropy index data of the two adjacent candidate segmentation regions. For example, if the contrast difference of the two regions is small, the uniformity difference is large, and the entropy difference is low, the merging evaluation result may determine that the operation is “merging”; otherwise, if the difference exceeds the threshold range, it is determined that the operation is “not merging”. For example, in the head and neck cancer CT image, the tumor region and the normal tissue have different performances in the above four indicators, and therefore the two types of regions can be effectively distinguished by merging evaluation.
[0118] S420, merging optimization is performed on the preliminary segmentation result according to the merging evaluation result to obtain an intermediate segmentation result.
[0119] In some cases, since the watershed algorithm may cause over-segmentation problem, in order to improve the accuracy and integrity of the segmentation result, the region division of the preliminary segmentation result is dynamically adjusted, the merging optimization is performed on the preliminary segmentation result, and the intermediate segmentation result is obtained. The merging optimization ensures that the region division is neither too rough (to preserve the details of the tissue boundary) nor too fine (to avoid over-segmentation).
[0120] In the above embodiment, the multi-dimensional texture feature quantitative analysis is used to determine whether the adjacent regions belong to the same type of tissue, the four indicators are considered comprehensively, the limitation of a single indicator is avoided, and the stability of the merging decision can be improved. Further, the preliminary segmentation result is merged and optimized based on the merging decision, and the over-segmentation or under-segmentation problem is reduced.
[0121] In some embodiments, referring to Figure 5a , the merging evaluation is performed on the two candidate segmentation regions by using the contrast index data, the uniformity index data, the homogeneity index data and the entropy index data of the two candidate segmentation regions respectively, and the merging evaluation result between the two candidate segmentation regions is obtained, including:
[0122] S510, the texture feature difference data between the two candidate segmentation regions is determined by using the contrast index data, the uniformity index data, the homogeneity index data and the entropy index data of the two candidate segmentation regions respectively.
[0123] Specifically, the texture feature difference data can be a set of difference values obtained by quantitatively comparing the contrast index data, the uniformity index data, the homogeneity index data and the entropy index data of two adjacent candidate segmentation regions. For example, the texture feature difference DV of two adjacent candidate segmentation regions in a certain direction is defined as [dc, du, de, dh]. Wherein, dc represents the contrast difference value of the two adjacent candidate segmentation regions, du represents the uniformity difference value of the two adjacent candidate segmentation regions, de represents the entropy difference value of the two adjacent candidate segmentation regions, and dh represents the homogeneity difference value of the two adjacent candidate segmentation regions, i∈[1, 2, 3, 4].
[0124] S520, constructing a state space based on the texture feature difference data between the two candidate segmentation regions.
[0125] Wherein, the state space can be the texture feature difference data converted into an input form that can be processed by a machine learning model, which is used to describe the feature set of the current decision environment. The state space can be represented in the form of a vector as the input of the target deep Q network for predicting the operation value of merging or not merging. Specifically, the texture feature difference data between the two candidate segmentation regions is converted into the input form of the machine learning model, which is convenient for the target deep Q network to make decisions. For example, the texture feature difference vector can be standardized and input into the target deep Q network, so that it can extract high-order features through the neural network, thereby more accurately evaluating the rationality of the merging operation.
[0126] S530, estimating the state space by the target deep Q network to obtain a merging evaluation result.
[0127] Wherein, the target deep Q network refers to a reinforcement learning model that learns the policy of selecting the optimal action (merging or not merging) in a specific state through training. For example, the target deep Q network can be a neural network containing an input layer (4 neurons), a hidden layer (128 neurons, ReLU activation function) and an output layer (2 neurons, corresponding to the Q values of “merge” and “not merge” respectively).
[0128] Specifically, the reinforcement learning model is used to dynamically adjust the merging strategy to improve the adaptability of the segmentation result. For example, the target deep Q network learns through training that when the comprehensive score of the texture feature difference data is lower than a threshold, the “merge operation” is selected; when the difference data exceeds the threshold, the “non-merge operation” is selected, thereby reducing the over-segmentation or under-segmentation problem. The action space of the deep Q network can be represented as:
[0129] a=[Merge, Miss]
[0130] Wherein, Merge represents the merging operation, and Miss represents the non-merging operation.
[0131] The training process of the target deep Q network (DQN) is exemplarily explained. The DQN algorithm is based on the Q-learning method, and uses a deep neural network to estimate the Q value function, the algorithm of which is defined as:
[0132]
[0133] wherein, represents the Q value of taking action a in state s; represents a learning rate for controlling the update step of the Q value; r is an immediate reward obtained after taking action a in state s; is a discount factor for weighing the importance of the immediate reward and the future reward; represents the next state the maximum Q value of the optimal action that can be taken in the next state.
[0134] The calculation formula of the target Q value is as follows:
[0135]
[0136] wherein, represents the Q value estimated by the target network; represents the maximum Q value of the optimal action that can be taken in the next state by the target network.
[0137] The loss function uses the mean squared error (MSE) to minimize the prediction error of the Q value. In order to prevent the occurrence of local optimal results, the ε-greed strategy is adopted for action selection. That is, with the probability of ε, a random behavior is selected, and with the probability of (1-ε), the optimal action is selected according to the Q value function to select the behavior.
[0138] A three-layer neural network is defined as , wherein the input layer contains 16 neurons corresponding to 16 elements of the state space; the hidden layer contains 128 neurons; and the output layer contains 2 neurons corresponding to the Q values of two actions in the action space. The learning framework of the DQN is as shown in Figure 5b . In the 4-tuple , s is the state at the current time, is the behavior at the current time, is the reward for the behavior, is the next state after the behavior is performed. When is the merge behavior, then is the texture feature difference between the merged tile and the tile merged by the agent, and the merge result becomes a new agent; when a is the non-merge operation, then The state at the current time Each group of 4-tuple is stored, which can improve sample usage and reduce sample relevance. It can be understood that the segmented region is a tile in the CT image.
[0139] Please refer to Figure 5c , randomly initialize the main network parameters , use as the initialization network parameters of the target network, start a learning round, randomly select a three-dimensional tile that has not been merged and has not become an agent from the segmentation result as the current agent, pair the current agent with a tile that has not been paired in this round to calculate the state s, use the ε-greed strategy to obtain the action a, determine the reward r, and obtain the new state Store the 4-tuple in the experience pool, determine whether the action is merging, if so, use the merged tile as the new agent, if not, determine whether all adjacent tiles of the agent have been paired and calculated in this round, and randomly extract a group of samples from the experience pool , use the target network to calculate the Q value, perform MES operation with the Q value calculated by the main network to obtain loss data (LOSS value), and update the parameters of the main network using the gradient descent method. After this step, return to randomly extract other samples from the experience pool for iteration. After x iterations, use the parameters of the main network as the new target network parameters. Return to randomly select a three-dimensional tile that has not been merged and has not become an agent from the segmentation result as the current agent for iteration, iterate y times, and end a learning round. Iterate z times, and start a new learning round.
[0140] The formula of the mean square error loss function is as follows:
[0141]
[0142] Where N is the number of training samples, is the i-th state-action pair, is the value estimate of the state under the action calculated by the DQN according to the current main network parameters w, is the corresponding target value calculated by the target network.
[0143] Use stochastic gradient descent to update the parameter network parameters , and the parameter update formula is:
[0144]
[0145] Where, is the parameter value at the current time t, The learning rate controls the step size for parameter updates. It is a loss function In parameters The gradient at that point.
[0146] The gradient of the MSE loss function in DQN is calculated as follows:
[0147] =
[0148] The backpropagation algorithm can be used to calculate... Regarding parameters gradient This allows us to obtain the gradient of the loss function.
[0149] After DQN completes training, the final network parameters are obtained. This model is used to merge the segmentation results of all watershed algorithms to obtain complete normal human tissue and tumor tissue.
[0150] In some embodiments, the intermediate segmentation result is estimated using a target depth Q-network based on the texture feature data of the candidate segmentation region.
[0151] The reward function used in training the target depth Q-network includes a first reward term and a second reward term. The first reward term is based on the change in grayscale value features before and after merging adjacent candidate segmentation regions to determine the reasonableness of the operation. The second reward term is based on the change in the similarity between the morphology of adjacent candidate segmentation regions before and after merging and the actual morphology of the tumor to determine the reasonableness of the operation.
[0152] Specifically, the reward function used in training the target depth Q-network is designed based on the rationality of region merging or non-merging behavior. Specifically, the reward function R consists of the following two parts:
[0153]
[0154] in, It is the first reward item. This is the second reward item. α and β are weighting coefficients, representing the degree of influence of gray-level-based rewards and morphological similarity-based rewards on the reward value, respectively. α can be set to 0.5 and β to 0.5.
[0155] It should be noted that if the gray values of the merged area are more uniform, i.e., the gray variance is reduced, the merging operation is considered reasonable and a positive reward is given; otherwise, a negative reward is given. If the gray values of the merged area are more chaotic, i.e., the gray variance is increased, the non-merging operation is considered reasonable and a positive reward is given; otherwise, a negative reward is given.
[0156] It should be noted that if the similarity between the merged region and the actual region is higher, the merge operation is considered reasonable and a positive reward is given; otherwise, a negative reward is given. If the similarity between the merged region and the actual region is lower, the non-merge operation is considered reasonable and a positive reward is given; otherwise, a negative reward is given.
[0157] In some embodiments, adjacent candidate segmentation regions include a first candidate region and a second candidate region; the first reward item and the second reward item are determined in the following manner:
[0158] The rationality of merging and not merging operations is judged by using the first gray-level mean variance of the first candidate region before merging, the second gray-level mean variance of the second candidate region before merging, and the third gray-level mean variance of the first and second candidate regions after merging, and the first reward item is obtained.
[0159] The rationality of merging and not merging operations is judged by using the first degree of overlap between the merged region of the first candidate region and the second candidate region and the tumor-labeled region, as well as the second degree of overlap between the first candidate region and the tumor-labeled region, to obtain the second reward item.
[0160] In this embodiment, the first candidate region is denoted as region i, the first candidate region is denoted as region j, and the first grayscale mean variance is denoted as... The second grayscale mean and variance are denoted as The third grayscale mean and variance are denoted as .
[0161] It can be defined as:
[0162]
[0163] In this embodiment, the Dice coefficient is used to measure the degree of overlap (or coincidence) between a given region and its corresponding real-world region. The formula for calculating Dice is as follows:
[0164]
[0165] Where A represents the segmentation result of the tumor region, and B represents the labeled actual tumor region. The closer the coefficient is to 1, the more similar A and B are. A value above 0.7 is generally considered to meet clinically usable standards, while a value below 0.5 indicates insufficient reliability of the segmentation results. Compared to conventional accuracy metrics, Dice effectively avoids assessment bias caused by class imbalance.
[0166] based on Rewards Can be defined as
[0167]
[0168] in, It is the merged region. This is the first candidate region, i.e., the agent. Reward items. Its function is to reward The behavior of increasing or not decreasing the coefficient, if A significant reward is given if the coefficient increases to 0.7 or higher; if A severe penalty is imposed if the coefficient decreases to below 0.5.
[0169] It should be emphasized that, since the candidate segmentation regions in this embodiment are in a dynamic adjustment state, the "agent" in this embodiment refers to one agent in each of the candidate segmentation regions obtained by the watershed algorithm. After the merging operation is performed, the merged region obtained by merging the candidate segmentation regions can be regarded as the new agent. Correspondingly, the difference data between adjacent segmentation regions can be understood as the environment in which the agent is located.
[0170] This application embodiment also provides a segmentation device for tumor regions in medical images, the segmentation device comprising:
[0171] The seed point determination module is used to acquire the medical image to be segmented, and to perform random sampling and local search based on the medical image to be segmented to obtain target voxels with extremely small local gray values, which are used as seed points for the watershed algorithm.
[0172] The preliminary segmentation module is used to perform watershed algorithm segmentation on the medical image to be segmented based on seed points to obtain preliminary segmentation results; among them, the candidate segmentation regions in the preliminary segmentation results have texture feature data;
[0173] The merging and optimization module is used to merge and optimize the candidate segmentation regions in the preliminary segmentation result using the texture feature data of the candidate segmentation regions to obtain intermediate segmentation results.
[0174] The region clustering module is used to cluster the intermediate segmentation results to obtain the target segmentation result corresponding to the tumor region.
[0175] Further functional descriptions of the above modules are the same as those in the corresponding embodiments described above, and will not be repeated here. The segmentation device in this embodiment is presented in the form of functional units. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0176] Referring to Figure 6 , Figure 6 is a structural schematic diagram of a computer device provided by an embodiment of the present application, as Figure 6 shown, the computer device includes one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are communicatively connected through different buses, and can be installed on a common mainboard or in other manners as needed. The processor can process instructions executed within the computer device, including instructions stored in the memory or on the memory to display graphical information of a GUI on an external input / output device, such as a display device coupled to the interface. In some optional embodiments, multiple processors and / or multiple buses can be used with multiple memories and multiple memory, if needed. Also, multiple computer devices can be connected, each providing part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 The processor 10 is taken as an example in the
[0177] The processor 10 can be a central processor, a network processor, or a combination thereof. The processor 10 can further include a hardware chip. The hardware chip can be an application specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device can be a complex programmable logic device, a field programmable logic device, a general array logic, or any combination thereof.
[0178] The memory 20 stores instructions executable by the at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiments.
[0179] The memory 20 can include a program storage area and a data storage area. The program storage area can store an operating system and application programs required by at least one function; the data storage area can store data created according to the use of the computer device, etc. In addition, the memory 20 can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some optional embodiments, the memory 20 can optionally include a memory remotely arranged with respect to the processor 10, and these remote memories can be connected to the computer device through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0180] The memory 20 can include a volatile memory, such as a random access memory; the memory can also include a non-volatile memory, such as a flash memory, a hard disk, or a solid state disk; the memory 20 can also include a combination of the above kinds of memories.
[0181] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 can be connected through a bus or other means, Figure 6 The bus connection is taken as an example in the foregoing description.
[0182] The input device 30 can receive inputted digital or character information, and generate key signal input related to user settings and function control of the computer device, such as touch screen, keypad, mouse, trackpad, touchpad, pointing stick, one or more mouse buttons, trackball, joystick, etc. The output device 40 can include display device, auxiliary lighting device (e.g. LED), and tactile feedback device (e.g. vibration motor), etc. The display device includes but is not limited to liquid crystal display, light emitting diode, display and plasma display. In some optional embodiments, the display device can be a touch screen. The computer device also includes a communication interface for communication of the computer device with other devices or communication network.
[0183] The embodiments of the present application also provide a computer readable storage medium, and the method according to the embodiments of the present application can be implemented in hardware, firmware, or recorded in a storage medium, or be implemented as computer code stored in a remote storage medium or non-transitory machine readable storage medium and stored in a local storage medium through network downloading, so that the method described herein can be processed by such software on a storage medium using a general purpose computer, a special purpose processor or programmable or special hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk or a solid state disk, etc. Further, the storage medium can also include a combination of the above-mentioned memories. It can be understood that the computer, the processor, the microprocessor controller or the programmable hardware include a storage component that can store or receive software or computer code, when the software or computer code is accessed and executed by the computer, the processor or the hardware, the method shown in the above embodiments is implemented.
[0184] The embodiments of the present application provide a computer program product, which includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method of any embodiment of the present application.
[0185] Although the embodiments of the present application are described in conjunction with the accompanying drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present application, and such modifications and changes fall within the scope defined by the appended claims.
[0186] It should also be noted that the terms "comprising", "comprises" or other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus.
[0187] Various embodiments in the present specification are described in progressive manner, and the same or similar parts between various embodiments can be mutually referred to, and each embodiment focuses on the difference from other embodiments. In particular, for system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the description of the method embodiments.
[0188] The above only describes the embodiments of the present application and is not intended to limit the present application. The present application can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the scope of claims of the present application.
[0189] Although the embodiments of the present application are described in conjunction with the drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present application, and such modifications and changes fall within the scope defined by the appended claims.
Claims
1. A method of segmenting a tumor region in a medical image, characterized by, The method comprises: acquiring a medical image to be segmented, performing random sampling and local search based on the medical image to be segmented, and obtaining a target voxel with a local minimum gray value as a seed point of a watershed algorithm, wherein the method comprises: performing normalization preprocessing on the medical image to be segmented according to the gray values of voxels in the medical image to be segmented to obtain a normalized result; performing random sampling and local search on the normalized result by a dynamic Monte Carlo algorithm to obtain the target voxel, and the method comprises: performing random sampling on the normalized result to obtain a preset number of preliminary voxels; wherein the preliminary voxels have a current statistical number of times of being randomly selected as local minimum values; selecting any preliminary voxel to be retained with a probability of the inverse of the current statistical number of times, updating the current statistical number of times of the any preliminary voxel to obtain an updated statistical number of times in the current round; performing local search on the any preliminary voxel based on the gray value of the any preliminary voxel among the preset number of preliminary voxels to obtain a local search result; wherein the local search result comprises a preliminary voxel with a local minimum gray value in the current round; and if the iteration process is completed, sorting the preliminary voxels according to the updated statistical number of times of the preliminary voxels in the last round to obtain the target voxel meeting a preset sorting requirement; performing watershed algorithm segmentation on the medical image to be segmented based on the seed point to obtain a preliminary segmentation result; wherein a candidate segmentation region in the preliminary segmentation result has texture feature data; performing merging optimization on the candidate segmentation region in the preliminary segmentation result by using the texture feature data of the candidate segmentation region to obtain an intermediate segmentation result; performing clustering on the intermediate segmentation result to obtain a target segmentation result corresponding to the tumor region.
2. The method of claim 1, wherein, The method comprises: determining a specified number of other preliminary voxels around the any preliminary voxel among the preset number of preliminary voxels; performing local search based on the gray value of the any preliminary voxel and the gray values of the specified number of other preliminary voxels to obtain the local search result.
3. The method according to claim 1 or 2, characterized in that, The texture feature data comprises contrast index data, uniformity index data, homogeneity index data and entropy index data; and the method comprises: for two adjacent candidate segmentation regions in the preliminary segmentation result, performing merging evaluation on the two candidate segmentation regions by using the contrast index data, the uniformity index data, the homogeneity index data and the entropy index data of the two candidate segmentation regions respectively to obtain a merging evaluation result between the two candidate segmentation regions; wherein the merging evaluation result is used to describe whether the two candidate segmentation regions perform a merging operation or a non-merging operation; performing merging optimization on the preliminary segmentation result according to the merging evaluation result to obtain the intermediate segmentation result.
4. The method of claim 3, wherein, The merging evaluation result between the two candidate segmentation regions is obtained by merging and evaluating the contrast index data, the uniformity index data, the homogeneity index data and the entropy index data of the two candidate segmentation regions respectively. The texture feature difference data between the two candidate segmentation regions is determined by using the contrast index data, the uniformity index data, the homogeneity index data and the entropy index data of the two candidate segmentation regions respectively. The state space is constructed based on the texture feature difference data between the two candidate segmentation regions. The merging evaluation result is obtained by estimating the state space through a target deep Q network.
5. The method of claim 1, wherein, The intermediate segmentation result is obtained by estimating the texture feature data of the candidate segmentation region based on a target deep Q network. The reward function used for training the target deep Q network includes a first reward item and a second reward item; wherein the first reward item is a reward item for operation rationality judgment based on the change of gray value features before and after the merging of adjacent candidate segmentation regions; and the second reward item is a reward item for operation rationality judgment based on the change of similarity between the shape before and after the merging of adjacent candidate segmentation regions and the actual shape of the tumor.
6. The method of claim 5, wherein, The adjacent candidate segmentation regions include a first candidate region and a second candidate region. The first reward item and the second reward item are determined by the following methods: The first reward item is obtained by performing rationality judgment on the merging operation and the non-merging operation by using the first gray mean variance of the first candidate region before merging, the second gray mean variance of the second candidate region before merging, and the third gray mean variance of the first candidate region and the second candidate region after merging; The second reward item is obtained by performing rationality judgment on the merging operation and the non-merging operation by using the first overlap degree between the merged region of the first candidate region and the second candidate region and the tumor label region, and the second overlap degree between the first candidate region and the tumor label region.
7. A computer device, comprising: The computer readable storage medium stores computer instructions, and the computer instructions are used to make the computer execute the method of any one of claims 1 to 6. The computer readable storage medium stores computer instructions, and the computer instructions are used to make the computer execute the method of any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that,
Citation Information
Patent Citations
Image hierarchical superpixel segmentation method and system, electronic equipment and storage medium
CN113240685A
Tumor segmentation method and system based on feature extraction and storage medium
CN118521793A