Medical image segmentation method
By preprocessing and feature analysis of PET image data, combined with segmentation middleware and simulation data enhancement technology, the problem of insufficient accuracy of positioning of PET image segmentation algorithm at the edge of the lesion area is solved, and high-accurate lesion area identification and diagnosis is achieved Improve efficiency.
Patent Information
- Application Number
- CN202411177150.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2044-08-26
AI Technical Summary
The existing PET medical image segmentation algorithm has insufficient accuracy in the positioning of the edge of the lesion area, and the acquisition of real data is limited by privacy protection, so it is difficult for simulated data to truly reflect the lesion characteristics, and the lack of data affects the training effect of the algorithm.
By preprocessing PET image data, image features are extracted and morphological and grayscale distribution characteristics of the lesion area are analyzed, and a segmentation middleware is designed to integrate multiple algorithms, and labeled data is generated using simulation technology, and large-scale training data is constructed with data enhancement technology. Set, using a deep learning model for preliminary segmentation and optimization through morphological operations to further refine the segmentation results.
It significantly improves the accuracy and generalization ability of lesion area segmentation, realizes accurate identification and positioning of lesion areas, and improves the efficiency and accuracy of clinical diagnosis.
Smart Images

Figure CN119323587A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information technology, and in particular to a medical image segmentation method. Background Art
[0002] In the field of medical image segmentation of PET indirect imaging, existing segmentation algorithms face the challenge of insufficient accuracy when processing PET images. In particular, in the positioning of the edge of the lesion area, the algorithm often deviates and cannot accurately depict the actual outline of the lesion. This inaccuracy may lead to deviations in clinical diagnosis and treatment plan formulation. In order to improve the segmentation accuracy, researchers proposed to introduce segmentation middleware for auxiliary annotation. However, this method encountered new difficulties in the implementation process. First, the acquisition of real case data is subject to strict privacy protection constraints, and the number of samples available for algorithm training and testing is seriously insufficient. Second, even if some real data is obtained, it is still difficult to cover all possible lesion conditions due to the diversity and complexity of cases. In response to the problem of data scarcity, researchers proposed to use simulation technology to generate labeled data. However, how to ensure that the simulated data can truly reflect the characteristics of PET images, especially in the performance of the lesion area, is consistent with the real data, has become a difficult technical problem. The quality of simulated data directly affects the training effect and segmentation accuracy of subsequent algorithms. Therefore, it is necessary to consider multiple factors in the data generation process, including image noise, tissue attenuation, scattering effects, etc. In addition, how to effectively integrate simulated data with limited real data to improve the generalization ability of the algorithm is also a problem that needs to be solved urgently. Summary of the invention
[0003] The present invention provides a medical image segmentation method, which mainly includes:
[0004] Acquire the raw image data of PET indirect imaging, and preprocess the image, including denoising, contrast enhancement and grayscale normalization, to obtain a preprocessed PET image data set;
[0005] According to the preprocessed PET image data set, a convolutional neural network is used to extract image features and construct feature vectors. The shape index, texture features and grayscale statistics of the lesion area are calculated through the feature vectors, and the morphological characteristics and grayscale distribution characteristics of the lesion area are analyzed.
[0006] Design segmentation middleware, integrate multiple segmentation algorithms, including threshold segmentation, region growing and level set method, and select appropriate segmentation algorithms for different types of lesion areas according to the results of feature vector analysis;
[0007] Use simulation technology to generate annotated PET image data, combine real case data to build a training data set, use data enhancement technology to expand the sample size, and generate a large-scale data set for algorithm training;
[0008] The deep learning model U-Net is used to perform preliminary segmentation of the lesion area and obtain a rough segmentation result. The generated large-scale data set is used to train the U-Net model, and the segmentation result is optimized through morphological operations to eliminate isolated small areas and fill holes.
[0009] The segmentation middleware is used to refine the segmentation results of U-Net, focusing on the edge of the lesion area, and the lesion boundary is accurately located through the edge detection algorithm to obtain a fine segmentation result;
[0010] The fine segmentation results were quantitatively evaluated, and the Dice coefficient and Jaccard index evaluation indicators were calculated. If the evaluation indicators were lower than the preset threshold, the segmentation algorithm was re-selected for optimization for different types of lesion areas based on the feature vector analysis results. If the preset threshold was still not reached after multiple optimizations, the case was recorded and marked as requiring manual review.
[0011] The technical solution provided by the embodiment of the present invention may have the following beneficial effects:
[0012] The present invention discloses a medical image segmentation method. Firstly, by preprocessing the original PET image data, the problems of noise, contrast and grayscale inconsistency in the original PET image data are solved, the image quality is improved, and a better basis is provided for subsequent analysis and processing. By extracting and analyzing the features, multiple features of the lesion area are effectively extracted, and the morphology and grayscale distribution features are deeply analyzed, which provides an important basis for accurately segmenting the lesion area. Secondly, by designing a segmentation middleware, integrating multiple segmentation algorithms, and selecting a suitable algorithm according to the characteristics of the lesion area, the problem that a single segmentation algorithm cannot adapt to different types of lesions is solved. In addition, a large-scale training data set is generated by using simulation technology and data enhancement technology, which solves the problem of insufficient real case data and improves the training effect and generalization ability of the model. Finally, the rough segmentation result is optimized by morphological operation, isolated small areas are eliminated and holes are filled, and then the segmentation middleware is used to further refine the segmentation result, which improves the accuracy of lesion area segmentation. In summary, the present invention significantly improves the generalization ability and accuracy of the segmentation algorithm, realizes accurate identification and positioning of the lesion area, and thus significantly improves the efficiency and accuracy of clinical diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 The present invention is a flowchart of a medical image segmentation method.
[0014] Figure 2It is a schematic diagram of a medical image segmentation method of the present invention.
[0015] Figure 3 It is another schematic diagram of a medical image segmentation method of the present invention. DETAILED DESCRIPTION
[0016] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0017] like Figure 1 -3. A medical image segmentation method in this embodiment may specifically include:
[0018] Step S101, obtaining PET indirect imaging raw image data, and preprocessing the image, including denoising, contrast enhancement and grayscale normalization, to obtain a preprocessed PET image data set.
[0019] The original projection data collected by the PET scanner is obtained, and the random noise and scattered noise in the original projection data are processed by a wavelet transform denoising algorithm to obtain the first projection data. The first projection data is subjected to a signal-to-noise ratio analysis. If the signal-to-noise ratio is lower than a preset threshold, the first projection data is processed by a median filtering algorithm to obtain the second projection data. The second projection data is reconstructed and a first tomographic image is generated by a maximum likelihood expectation maximization algorithm. The first tomographic image is processed by an adaptive contrast enhancement algorithm, and the contrast is dynamically adjusted according to the grayscale distribution of the local area to obtain the second tomographic image. The second tomographic image is subjected to grayscale normalization processing, and the grayscale value of the second tomographic image is mapped to a preset grayscale range by a linear stretching method to obtain a third tomographic image. The third tomographic image is saved in DICOM format, and a metadata index including patient information and scanning parameters is established.
[0020] Exemplarily, the original projection data collected by the PET scanner is obtained, and the random noise and scattered noise in the projection data are processed by a wavelet transform denoising algorithm. The original projection data is subjected to wavelet decomposition, an appropriate wavelet basis and decomposition layer number are selected, and the wavelet coefficients of each layer are threshold processed, and finally wavelet reconstruction is performed to obtain the denoised projection data. The denoised projection data is subjected to signal-to-noise ratio analysis, and if the signal-to-noise ratio is lower than a preset threshold, an additional median filter is performed. The processed projection data is reconstructed, and a tomographic image is generated using a maximum likelihood expectation maximization algorithm. By adjusting the number of iterations, relaxation factors, and regularization parameters, the signal-to-noise ratio and spatial resolution of the image are optimized to obtain a reconstructed PET image. In view of the problem of insufficient contrast of the reconstructed PET image, an adaptive contrast enhancement algorithm is used for processing. The contrast is dynamically adjusted according to the grayscale distribution of the local area, and the contrast difference between the lesion area and the normal tissue is highlighted to obtain a contrast-enhanced PET image. The enhanced PET image is subjected to grayscale normalization processing, and the image grayscale value is mapped to the range of 0-255. The linear stretching method was used to adjust the grayscale distribution so that the images acquired by different scanning devices and at different times were comparable. The processed PET images were saved in DICOM format, and the corresponding metadata index was established, including patient information and scanning parameters. A standardized PET image data set was constructed to facilitate subsequent analysis and retrieval. During the PET imaging process, a high-sensitivity detector array was used to obtain the original projection data, with a detector spacing of 4 mm, a detector ring diameter of 80 cm, a field of view of 15.7 cm, and an acquisition time of 15 minutes. The acquired original projection data were denoised by wavelet transform. The Daubechies wavelet basis was used, and a three-layer wavelet decomposition was selected. The wavelet coefficients of each layer were processed by the soft threshold method, and the threshold was set to 3 times the standard deviation. After processing, the signal-to-noise ratio was calculated. If it was lower than the preset threshold of 20 decibels, a 3x3 window median filter was used for additional processing. The maximum likelihood expectation maximization algorithm was used for image reconstruction, with the number of iterations set to 30, the relaxation factor to 1.5, and the regularization parameter to 0.01. The reconstructed PET images have a resolution of 128x128x47 and a voxel size of 4x4x3.27 mm. An adaptive contrast enhancement algorithm was applied to the reconstructed images, with the local window size set to 7x7 and the contrast enhancement factor set to 1.5. After processing, contrast-enhanced PET images were obtained. When grayscale normalization was performed, the image grayscale values were mapped to the range of 0-255 using a linear stretching method, with the minimum threshold set to the 10% quantile of the original image and the maximum threshold set to the 90% quantile. Finally, the processed PET images were saved in DICOM format with a 16-bit depth per pixel, and metadata information such as patient ID, scan date, and injection dose were recorded in the DICOM header file to construct a standardized PET image dataset containing 500 images from 100 patients.
[0021] Step S102, based on the preprocessed PET image data set, a convolutional neural network is used to extract image features, a feature vector is constructed, the shape index, texture feature and grayscale statistics of the lesion area are calculated through the feature vector, and the morphological features and grayscale distribution characteristics of the lesion area are analyzed.
[0022] Image data is read from the PET image data set after preprocessing, and features of the image data are extracted using a U-Net network to obtain feature data; the feature data is subjected to Z-score standardization to obtain a standardized feature vector; based on the standardized feature vector, the image data is segmented using a region growing algorithm to obtain a preliminary segmentation result of the lesion area; for the preliminary segmentation result, shape indicators, texture features and grayscale statistics are calculated to construct a lesion area feature descriptor; the lesion area feature descriptor is standardized to calculate a covariance matrix; if the cumulative contribution rate of the covariance matrix reaches a preset threshold, the corresponding principal component is selected to reconstruct the feature space to obtain the morphological features and grayscale distribution feature representation of the lesion area; based on the morphological features and grayscale distribution feature representation, a shape factor is calculated, and a grayscale distribution histogram is analyzed to obtain a specific feature description of the lesion area.
[0023] Exemplarily, image data is read from a preprocessed PET image data set, and a U-Net network is used to extract features from the image. The U-Net network includes 4 layers of encoders and 4 layers of decoders, each layer uses a 3x3 convolution kernel, the activation function is ReLU, and the pooling layer uses 2x2 maximum pooling. A 512-dimensional feature vector is obtained through the U-Net network, and the feature vector is subjected to Z-score normalization to make the feature data distribution uniform. According to the standardized feature vector, the image is segmented using a region growing algorithm. The point with the highest gray value in the image is selected as the seed point, and the growth threshold is set to 80% of the gray value of the seed point. The region is gradually expanded until it cannot grow, and the preliminary segmentation result of the lesion area is obtained. For the segmented lesion area, shape indicators such as area, perimeter and circularity are calculated. Texture features are extracted using a gray level co-occurrence matrix, and the directions are set to 0°, 45°, 90° and 135°, and the distance is 1 pixel, and features such as energy, contrast and entropy are calculated. Gray statistics such as mean, standard deviation, skewness and kurtosis are calculated. The feature descriptor of the lesion area is constructed by combining shape index, texture feature and grayscale statistics. The feature descriptor is standardized, the covariance matrix is calculated, and the eigenvalue decomposition is performed. The first N principal components with a cumulative contribution rate of 95% are selected to reconstruct the feature space, and the morphological features and grayscale distribution feature representation of the lesion area are obtained. The shape factor is calculated, and the grayscale distribution histogram is analyzed to obtain the specific feature description of the lesion area. In the process of PET image feature extraction, the preprocessed PET image dataset is first read, and the image size is 256x256x128. The U-Net network is used for feature extraction. The network structure contains 4 layers of encoders and 4 layers of decoders. Each layer uses 32 3x3 convolution kernels, the step size is 1, the activation function is ReLU, and the pooling layer uses 2x2 maximum pooling. A 512-dimensional feature vector is obtained through the U-Net network, and the feature vector is Z-score standardized so that the feature data has a mean of 0 and a standard deviation of 1. According to the standardized feature vector, the region growing algorithm is used for image segmentation. The point with the highest gray value in the image is selected as 200 as the seed point, and the growth threshold is set to 80% of the gray value of the seed point, that is, 160. The region is gradually expanded until it cannot grow, and the preliminary segmentation result of the lesion area is obtained. For the segmented lesion area, shape indicators such as area, such as 500 square millimeters, perimeter, such as 80 millimeters, and circularity, such as 0.85 are calculated. The gray level co-occurrence matrix is used to extract texture features, and the directions are set to 0°, 45°, 90°, and 135°, and the distance is 1 pixel. Features such as energy, such as 0.2, contrast, such as 15, and entropy, such as 4.5 are calculated. Gray statistics such as mean, such as 150, standard deviation, such as 30, skewness, such as 0.5, and kurtosis, such as 2.8, are calculated. Combining shape indicators, texture features, and gray statistics, a 20-dimensional lesion area feature descriptor is constructed. The feature descriptor is standardized, and the 20x20 covariance matrix is calculated for eigenvalue decomposition.The first 10 principal components with a cumulative contribution rate of 95% were selected to reconstruct the feature space and obtain a 10-dimensional morphological feature and grayscale distribution feature representation of the lesion area. The shape factor was calculated as 1.2, and the grayscale distribution histogram was analyzed. It was found that the grayscale values were concentrated in the range of 120-180, showing a right-skewed distribution, and the specific feature description of the lesion area was obtained.
[0024] Step S103, designing segmentation middleware, integrating multiple segmentation algorithms, including threshold segmentation, region growing and level set method, and selecting appropriate segmentation algorithms for different types of lesion regions according to the feature vector analysis results.
[0025] A segmentation algorithm selector is constructed according to shape index and grayscale distribution characteristics, and the segmentation algorithm selector is implemented by a decision tree classifier; the decision tree classifier is trained by a pre-labeled training data set to obtain the optimal segmentation point and decision rule; if the decision tree classifier determines that the circularity index of the lesion area is within a preset range and the grayscale standard deviation is less than a preset threshold, the region growing algorithm is used for segmentation; the region growing algorithm starts to grow from the highest point of the grayscale value to obtain the segmentation result; if the decision tree classifier determines that the shape of the lesion area is irregular and there is an obvious boundary in the grayscale distribution, the level set method is used for segmentation; the level set method calculates the level by the fast marching method A flat set function is used to obtain the segmentation boundary; if the decision tree classifier determines that the grayscale distribution of the lesion area is bimodal or multimodal, a multi-threshold OTSU algorithm is used for segmentation; the multi-threshold OTSU algorithm determines the optimal number of thresholds by maximizing the inter-class variance, calculates each threshold, and divides the image into multiple grayscale levels; a segmentation middleware is designed to integrate the region growing algorithm, the level set method and the multi-threshold OTSU algorithm; the segmentation middleware calls the corresponding segmentation algorithm for processing according to the output result of the segmentation algorithm selector; the segmentation results of different algorithms are post-processed, including morphological operations and boundary smoothing, to obtain the final lesion area segmentation result.
[0026] Exemplarily, according to the result of feature vector analysis, a segmentation algorithm selector is constructed and implemented by a decision tree classifier. The input features include shape indicators such as circularity, complexity and grayscale distribution characteristics such as mean, standard deviation, skewness, and kurtosis, and the output is the most suitable segmentation algorithm. The decision tree is trained by a pre-labeled training data set to determine the optimal segmentation point and decision rule. For lesion areas with a circularity index between 0.7 and 0.9 and a grayscale standard deviation less than a preset threshold, a regional growing algorithm is used for segmentation. The growth threshold is set to 85% of the grayscale value of the seed point, and the growth starts from the highest grayscale value to obtain the segmentation result. For lesion areas with irregular shapes and obvious boundaries in grayscale distribution, the level set method is used for segmentation. The level set function is initialized as a signed distance map and calculated by the fast marching method. The evolution speed function is set to a weighted combination of image gradient and curvature, and the level set function is iteratively updated. When the level set function change of two consecutive iterations is less than the preset threshold, the iteration is stopped to obtain the segmentation boundary. For lesion areas with bimodal or multimodal grayscale distribution characteristics, the multi-threshold OTSU algorithm is used for segmentation. The optimal number of thresholds is determined by maximizing the inter-class variance, and the number of thresholds is gradually increased until the increase in the inter-class variance is less than the preset value. Each threshold is calculated, the image is segmented into multiple grayscale levels, and the lesion area is extracted. The segmentation middleware is designed to integrate the above segmentation algorithms. According to the output result of the algorithm selector, the corresponding segmentation algorithm is called for processing. The segmentation results of different algorithms are post-processed, including morphological operations and boundary smoothing, and multiple segmentation results are fused to obtain the final lesion area segmentation result. In practical applications, the C4.5 decision tree classifier is used when constructing the segmentation algorithm selector based on the feature vector analysis results. The input features include circularity 0-1, complexity boundary length / area, grayscale mean 0-255, standard deviation 0-127, skewness -2 to 2, and kurtosis 1-5. The decision tree is trained by 1000 pre-labeled samples to obtain the optimal segmentation rule. For example, when the circularity is greater than 0.8 and the standard deviation is less than 20, the region growing algorithm is selected; when the complexity is greater than 0.1 and the skewness is greater than 1, the level set method is selected; when the kurtosis is greater than 3, the multi-threshold OTSU algorithm is selected. For the lesion area with a circularity of 0.85 and a standard deviation of 15, the region growing algorithm is used for segmentation. Set the growth threshold to 170. Assume that the gray value of the seed point is 200, start growing from the coordinates 100, 100, and finally get a segmentation area of 500 square pixels. For irregular lesions with a complexity of 0.15 and a skewness of 1.5, the level set method is used for segmentation. Initialize the level set function to a signed distance map of -3 to 3, and set the evolution rate function to 0.5 image gradient + 0.5 curvature. After 50 iterations, the level set function changes less than 0.01, stop the iteration, and obtain a closed segmentation boundary. For multi-peak grayscale distribution lesions with a kurtosis of 4, the multi-threshold OTSU algorithm is used.By maximizing the inter-class variance, the optimal number of thresholds was determined to be 3, and the calculated thresholds were 85, 150, and 210, respectively. The image was segmented into 4 grayscale levels, and the area with a grayscale value greater than 210 was extracted as the lesion area. Finally, the segmentation results of different algorithms were post-processed, including the opening operation of the 3x3 structure element to remove small noise points and the 5x5 Gaussian filter for boundary smoothing to obtain the final lesion area segmentation result.
[0027] Step S104, using simulation technology to generate annotated PET image data, combining real case data to build a training data set, using data enhancement technology to expand the sample size, and generating a large-scale data set for algorithm training.
[0028] The positron annihilation process is simulated according to the Monte Carlo method to obtain simulated PET raw data; the maximum likelihood expectation maximization algorithm is used to reconstruct the simulated PET raw data to obtain a simulated PET image; for the simulated PET image, the corresponding lesion area annotation information is automatically generated; the U-Net deep learning algorithm is applied to the real case PET image for segmentation, the lesion area is extracted, and the annotation information of the real case is obtained; if the simulated PET image and the real case PET image are obtained, the simulated PET image and the real case PET image are mixed in a ratio of 7:3 to construct an initial training data set; for the initial training data For each image in the set, five variants are generated, including: rotating the image by -15° to 15°, scaling the image by 0.9 to 1.1 times, translating the image by -10 to 10 pixels, adjusting the image brightness by ±20%, and enhancing the image contrast by ±20%; through the image enhancement method, a large-scale training data set containing 5 times the number of original samples is obtained; the cross-validation method is used to evaluate the representativeness and diversity of the large-scale training data set; the inter-class distance and intra-class distance of the large-scale training data set are calculated; it is determined whether the inter-class distance and intra-class distance meet the preset standard; if the inter-class distance and intra-class distance do not meet the preset standard, return to the image enhancement process for adjustment.
[0029] Exemplarily, a PET image simulator is constructed, and the positron annihilation process is simulated based on the Monte Carlo method to generate simulated PET raw data. By setting different lesion types, sizes, locations and metabolic activities, the maximum likelihood expectation maximization algorithm is used for image reconstruction to obtain simulated PET images, and the corresponding lesion area annotation information is automatically generated. The simulated image is evaluated for quality, and the signal-to-noise ratio and contrast are calculated to ensure that it is similar to the characteristics of the real PET image. The real case PET image data is collected, and the U-Net deep learning algorithm is used to segment the real case PET image, extract the lesion area, and generate the annotation information of the real case. The simulated data and the real data are mixed in a ratio of 7:3 to construct an initial training data set. For the initial training data set, the image enhancement method is used for data expansion. Five variants are generated for each image, including rotation of -15° to 15°, scaling of 0.9 to 1.1 times, translation of -10 to 10 pixels, brightness adjustment of ±20% and contrast enhancement of ±20%. Through these processes, the diversity of the data set is improved, and a large-scale training data set containing 5 times the number of original samples is finally generated. The cross-validation method was used to evaluate the representativeness and diversity of the dataset, and the inter-class distance and intra-class distance were calculated to ensure that the dataset could cover different types of lesion characteristics. If the evaluation result did not meet the preset standard, the data enhancement process was returned for adjustment. In the PET image simulator, the GATE Geant4 Application for Tomographic Emission software package was used to implement Monte Carlo simulation. The 18F-FDG tracer activity was set to 5 MBq, the simulation time was 300 seconds, the detector crystal material was LYSO, and the crystal size was 4x4x20 mm3. Different types of lesions were simulated, such as spherical diameters of 5-30 mm and irregular shapes with a maximum size of 10-40 mm, with positions randomly distributed in the phantom and metabolic activity 2-5 times the background uptake. The OSEM algorithm was used for image reconstruction, with 2 iterations and 21 subsets, to obtain a 128x128x47 PET image. The image signal-to-noise ratio target value was calculated to be >15 dB and the contrast target value was >2. For real case data, U-Net was used for segmentation, with a network depth of 5 layers, 3x3 convolution kernels in each layer, ReLU as the activation function, and 300 rounds of training using the cross entropy loss function. When enhancing data, the OpenCV library was used to implement image processing, with the rotation angle randomly selected between -15° and 15°, the scaling factor randomly selected between 0.9 and 1.1, the translation pixel randomly selected between -10 and 10, and the brightness and contrast adjustment range of ±20%. Finally, 25,000 enhanced images were generated. The quality of the data set was evaluated using 5-fold cross validation, and the target value of the inter-class Euclidean distance was calculated to be >100 and the target value of the intra-class variance was <50. If the standard was not met, the data enhancement parameters were adjusted and regenerated.
[0030] Step S105, using the deep learning model U-Net to perform preliminary segmentation on the lesion area to obtain a rough segmentation result, using the generated large-scale data set to train the U-Net model, and optimizing the segmentation result through morphological operations to eliminate isolated small areas and fill holes.
[0031] A U-Net neural network model is constructed according to the training set, validation set and test set data, and the U-Net neural network model includes a 4-layer encoder and a 4-layer decoder structure; the PET image to be segmented is input into the U-Net neural network model, and a lesion area probability map is obtained through forward propagation; the Otsu algorithm is used to automatically calculate the optimal threshold, and the lesion area probability map is binarized to obtain a rough segmentation result; the rough segmentation result is subjected to morphological post-processing, including: using a 3x3 circular structure element to perform an opening operation to remove isolated small areas with an area less than 0.1% of the total image area, performing a closing operation to fill internal holes less than 5% of the lesion area, and using a Gaussian filter to perform edge smoothing to obtain an optimized lesion area segmentation result; the Dice coefficient, Jaccard index and average surface distance of the optimized lesion area segmentation result and the manual annotation result are calculated; if the Dice coefficient is greater than 0.8, the Jaccard index is greater than 0.7, and the average surface distance is less than 2 pixels, it is determined that the optimized lesion area segmentation result meets the quality requirements.
[0032] Exemplarily, based on the generated large-scale data set, the data is divided into training set, validation set and test set in a ratio of 8:1:1, and a U-Net neural network model is constructed. A 4-layer encoder and a 4-layer decoder structure are set. Each layer uses a 3x3 convolution kernel and a ReLU activation function, and a cross entropy loss function is adopted. The Adam optimizer is used, the learning rate is set to 0.001, the batch size is 16, and 500 rounds of training are adopted. The model performance is evaluated on the validation set every 50 rounds, the best model is saved, and the initial segmentation model is obtained. The PET image to be segmented is input into the trained U-Net model, and the probability map of the lesion area is obtained by forward propagation. The Otsu algorithm is used to automatically calculate the optimal threshold and the probability Figure 2The rough segmentation results were obtained by quantization. Morphological post-processing was performed on the rough segmentation results. First, an opening operation was performed, using a 3x3 circular structure element to remove isolated small areas with an area less than 0.1% of the total image area, and then a closing operation was performed to fill the internal holes less than 5% of the lesion area. Finally, a Gaussian filter was used for edge smoothing to obtain the optimized lesion area segmentation results. Indicators such as the Dice coefficient, Jaccard index, and average surface distance were calculated and compared with the manual annotation results. If the Dice coefficient is greater than 0.8, the Jaccard index is greater than 0.7, and the average surface distance is less than 2 pixels, the segmentation result is judged to meet the quality requirements; otherwise, the morphological post-processing step is returned to adjust the parameters and re-optimize. In practical applications, a large-scale dataset containing 10,000 PET images was used, which was divided into 8,000 training sets, 1,000 validation sets, and 1,000 test sets in a ratio of 8:1:1. The U-Net model was constructed with an input image size of 256x256x1, 4 encoder layers and 4 decoder layers, 32 3x3 convolution kernels in each layer, ReLU activation function, maximum pooling layer and upsampling layer. The Adam optimizer was used, with an initial learning rate of 0.001, a decay of 10% every 100 rounds, a batch size of 16, and 500 rounds of training. On the validation set, the best model was saved when the Dice coefficient reached 0.85. For the newly input PET image of 128x128x47, it was resampled to 256x256x1 and input into the U-Net model to obtain the probability map. The Otsu algorithm was used to calculate the optimal threshold value such as 0.43, and the coarse segmentation result was obtained by binarization. Morphological post-processing was performed, and a circular structure element with a radius of 1.5 pixels was used for opening operation to remove isolated areas with an area less than 33 square pixels, about 0.1% of the image area. Then the same structure element was used for closing operation to fill the internal holes less than 150 square pixels, about 5% of the area of the lesion area. Finally, a 3x3 Gaussian filter with σ = 0.8 was applied to smooth the edges. The evaluation indicators were calculated, and the Dice coefficient was 0.88, the Jaccard index was 0.79, and the average surface distance was 1.5 pixels. The segmentation result was judged to meet the quality requirements. If not, the structure element radius was adjusted to 1.2 pixels and the morphological processing steps were repeated.
[0033] Step S106, using the segmentation middleware to refine the U-Net segmentation result, focusing on the edge of the lesion area, accurately locating the lesion boundary through the edge detection algorithm, and obtaining a fine segmentation result.
[0034] The segmentation result of U-Net is received and input into the segmentation middleware, and the segmentation middleware calculates the average value of the multi-channel PET image to obtain a single-channel image; the gradient-based Sobel operator is used to perform edge detection according to the single-channel image, and the gradients in the horizontal and vertical directions are calculated to obtain an edge intensity map and a direction map; the Otsu algorithm is used to automatically calculate the optimal threshold for the edge intensity map, and a preliminary edge point set is extracted; the non-maximum suppression algorithm is used to remove non-edge points from the preliminary edge point set to obtain a refined edge point set; the edge tracking algorithm is used to connect the refined edge point set, and the maximum connection distance is set to connect adjacent edge points into a connected point set. The method comprises the following steps: first, a continuous contour line is formed; the continuous contour line is subjected to morphological thinning and bridging operations to optimize edge connection, so as to form a closed lesion area boundary; the closed lesion area boundary is smoothed by a cubic B-spline curve fitting algorithm, control points are selected by equidistant sampling, the control point spacing is set, the boundary is interpolated and smoothed, and a fine lesion area segmentation result is obtained; the Hausdorff distance and the average contour distance between the fine lesion area segmentation result and the original U-Net segmentation result are calculated; if the Hausdorff distance is less than a preset first threshold and the average contour distance is less than a preset second threshold, it is determined that the edge thinning is effective.
[0035] Exemplarily, the segmentation result of U-Net is input into the segmentation middleware. For multi-channel PET images, the average value of each channel is calculated to obtain a single-channel image. The gradient-based Sobel operator is used to detect the edge of the single-channel image, and the gradients in the horizontal and vertical directions are calculated to obtain the edge intensity map and direction map. The edge intensity map is smoothed using a 5x5 Gaussian filter σ=1.0 to reduce the influence of noise. According to the smoothed edge intensity map, the Otsu algorithm is used to automatically calculate the optimal threshold and extract the preliminary edge point set. The edge points are refined, and the non-maximum suppression algorithm is used to remove non-edge points to obtain a refined edge point set. The refined edge points are connected using the edge tracking algorithm, and the maximum connection distance is set to 5 pixels, and the adjacent edge points are connected into a continuous contour line. Morphological refinement and bridging operations are used to optimize edge connections to form a closed lesion area boundary. The obtained lesion area boundary is smoothed using a cubic B-spline curve fitting algorithm. Control points are selected by equidistant sampling, and the control point spacing is set to 5 pixels. The boundary is interpolated and smoothed to obtain a refined lesion area segmentation result. The Hausdorff distance and the average contour distance were calculated and compared with the original U-Net segmentation results to evaluate the edge thinning effect. If the Hausdorff distance is less than 3 pixels and the average contour distance is less than 1 pixel, the edge thinning is considered to be effective. In practical applications, for a 128x128x47 multi-channel PET image, the average of 47 channels is first calculated to obtain a 128x128 single-channel image. A 3x3 Sobel operator is used for edge detection to obtain horizontal and vertical gradient maps. The gradient amplitude is calculated as the edge intensity map, and the edge intensity map is smoothed using a 5x5 Gaussian filter with σ=1.0. The Otsu algorithm is used to calculate the optimal threshold, such as a threshold of 45. Pixels greater than 45 are extracted as the preliminary edge point set. The non-maximum suppression algorithm of the 3x3 neighborhood is used to thin the edges, and the local maximum points are retained. The edge points are connected using the 8-connected edge tracking algorithm, and the maximum connection distance is set to 5 pixels. The morphological thinning operation of the 3x3 structure element is applied with 10 iterations, and then the 1-pixel interval breakpoints are connected using the bridge operation. The closed boundary was sampled equidistantly, and a control point was selected every 5 pixels, with a total of about 200 control points. The cubic B-spline curve fitting algorithm was used, and the smoothing parameter λ was set to 0.5 to interpolate and smooth the boundary. Finally, the Hausdorff distance and the average contour distance were calculated and compared with the original U-Net results. For example, the Hausdorff distance was 2.8 pixels and the average contour distance was 0.9 pixels, which determined that the edge refinement was effective and obtained a fine lesion area segmentation result.
[0036] Step S107, quantitatively evaluate the fine segmentation results, calculate the Dice coefficient and Jaccard index evaluation indicators, if the evaluation indicators are lower than the preset threshold, re-select the segmentation algorithm for optimization for different types of lesion areas based on the feature vector analysis results, if the preset threshold is still not reached after multiple optimizations, record the case and mark it as requiring manual review.
[0037] Quantitatively evaluate the fine segmentation results to obtain the Dice coefficient and Jaccard index. According to the Dice coefficient and Jaccard index, determine whether the preset threshold is reached. If the Dice coefficient is less than the preset threshold or the Jaccard index is less than the preset threshold, the random forest algorithm is used to select a new algorithm from the segmentation algorithm library. The lesion area is re-segmented by the new algorithm to obtain the optimized segmentation result. Calculate the Dice coefficient and Jaccard index for the optimized segmentation result to determine whether the preset threshold is reached. If the Dice coefficient and Jaccard index do not reach the preset threshold, repeat the optimization process. If after multiple optimization iterations, the Dice coefficient and Jaccard index still do not reach the preset threshold, the case is recorded in the list to be reviewed.
[0038] Exemplarily, the fine segmentation results are quantitatively evaluated, the Dice coefficient and the Jaccard index are calculated, and the Dice coefficient threshold is set to 0.80 and the Jaccard index threshold is set to 0.70. At the same time, the over-segmentation and under-segmentation of the segmentation results are analyzed, and the over-segmentation rate and under-segmentation rate are calculated. The calculated evaluation index is compared with the preset threshold, and the detailed evaluation results are recorded. If the Dice coefficient is less than 0.80 or the Jaccard index is less than 0.70, a new algorithm is selected from the segmentation algorithm library for optimization using the random forest algorithm according to the feature vector analysis results. The selection basis includes the shape, size, location and grayscale distribution characteristics of the lesion, and a mapping relationship between the feature vector and the algorithm performance is established. The lesion area is re-segmented using the selected new algorithm to obtain the optimized segmentation result, and the Dice coefficient and the Jaccard index are calculated again and compared with the preset threshold. According to the degree of improvement of the index after each optimization, the maximum number of iterations is dynamically adjusted, and the initial setting is 5 times. If the threshold is still not reached, the optimization process is repeated. The segmentation results, evaluation indicators and algorithm parameters of each iteration are saved as structured data, including metadata in JSON format and image data in DICOM format. If the evaluation index still does not reach the preset threshold after multiple optimization iterations, the case will be recorded in the list of pending reviews and marked as requiring manual review. A visual interface is provided to display the original image, segmentation results and evaluation indicators, support manual adjustment of segmentation boundaries, and record the adjustment process. In practical applications, after fine segmentation of a 128x128x64 PET image, the Dice coefficient was calculated to be 0.78 and the Jaccard index was 0.68, which were lower than the preset threshold. Analysis found that the over-segmentation rate was 5% and the under-segmentation rate was 8%. Based on these evaluation results, a new segmentation method was selected from the algorithm library using the random forest algorithm. The random forest contains 100 decision trees, and the features include lesion shape circularity 0.85, size volume 3.2cm3, location center coordinates 64, 58, 32, and grayscale distribution mean 150, standard deviation 25. The level set algorithm was selected for re-segmentation, and the evolution rate function was set to 0.5 image gradient + 0.3 curvature, and iterated 100 times. After optimization, the new segmentation results are obtained, the Dice coefficient is increased to 0.83, and the Jaccard index reaches 0.72. Due to the significant improvement in the indicators, the maximum number of iterations is dynamically adjusted to 3 times. The segmentation results are saved in DICOM format, and the evaluation indicators and algorithm parameters are saved as JSON files, including the fields
[0039] "iteration": 1, "dice": 0.83, "jaccard": 0.72, "algorithm": "level_set", "params": {"speed_function": "0.5 gradient + 0.3 curvature", "iterations": 100}. The final segmentation result still did not reach the threshold, and the case ID-20230701001 was added to the list for review. The original PET image, the segmentation result overlay, and the evaluation index curve were displayed in the visual interface. It supports manual adjustment of the segmentation boundary by dragging the mouse, and records the sequence of adjusted coordinate points.
[0040] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A medical image segmentation method, characterized in that: The method comprises: Acquire the raw image data of PET indirect imaging, and preprocess the image, including denoising, contrast enhancement and grayscale normalization, to obtain a preprocessed PET image data set; According to the preprocessed PET image data set, a convolutional neural network is used to extract image features and construct feature vectors. The shape index, texture features and grayscale statistics of the lesion area are calculated through the feature vectors, and the morphological characteristics and grayscale distribution characteristics of the lesion area are analyzed. Design segmentation middleware, integrate multiple segmentation algorithms, including threshold segmentation, region growing and level set method, and select appropriate segmentation algorithms for different types of lesion areas according to the results of feature vector analysis; Use simulation technology to generate annotated PET image data, combine real case data to build a training data set, use data enhancement technology to expand the sample size, and generate a large-scale data set for algorithm training; The deep learning model U-Net is used to perform preliminary segmentation of the lesion area and obtain a rough segmentation result. The generated large-scale data set is used to train the U-Net model, and the segmentation result is optimized through morphological operations to eliminate isolated small areas and fill holes. The segmentation middleware is used to refine the segmentation results of U-Net, focusing on the edge of the lesion area, and the lesion boundary is accurately located through the edge detection algorithm to obtain a fine segmentation result; The fine segmentation results were quantitatively evaluated, and the Dice coefficient and Jaccard index evaluation indicators were calculated. If the evaluation indicators were lower than the preset threshold, the segmentation algorithm was re-selected for optimization for different types of lesion areas based on the feature vector analysis results. If the preset threshold was still not reached after multiple optimizations, the case was recorded and marked as requiring manual review.
2. The method according to claim 1, wherein: The method of obtaining the original PET indirect imaging image data and preprocessing the image, including denoising, contrast enhancement and grayscale normalization, to obtain a preprocessed PET image data set includes: Acquire original projection data collected by a PET scanner, and process random noise and scattered noise in the original projection data using a wavelet transform denoising algorithm to obtain first projection data; Performing a signal-to-noise ratio analysis on the first projection data, and if the signal-to-noise ratio is lower than a preset threshold, processing the first projection data using a median filter algorithm to obtain second projection data; Reconstructing according to the second projection data, and generating a first tomographic image by using a maximum likelihood expectation maximization algorithm; The first tomographic image is processed by using an adaptive contrast enhancement algorithm, and the contrast is dynamically adjusted according to the grayscale distribution of the local area to obtain a second tomographic image; Performing grayscale normalization processing on the second tomographic image, mapping the grayscale value of the second tomographic image into a preset grayscale range by using a linear stretching method, so as to obtain a third tomographic image; The third tomographic image is saved in DICOM format, and a metadata index including patient information and scanning parameters is established.
3. The method according to claim 1, wherein: The method uses a convolutional neural network to extract image features based on the preprocessed PET image data set, constructs a feature vector, calculates the shape index, texture feature and grayscale statistics of the lesion area through the feature vector, and analyzes the morphological features and grayscale distribution features of the lesion area, including: Reading image data from the preprocessed PET image data set, and extracting features from the image data using a U-Net network to obtain feature data; Performing Z-score normalization processing on the feature data to obtain a normalized feature vector; According to the standardized feature vector, the image data is segmented using a region growing algorithm to obtain a preliminary segmentation result of the lesion area; Based on the preliminary segmentation results, shape indexes, texture features and grayscale statistics are calculated to construct a feature descriptor of the lesion area; Performing standardization processing on the lesion region feature descriptor and calculating the covariance matrix; If the cumulative contribution rate of the covariance matrix reaches a preset threshold, the corresponding principal component is selected to reconstruct the feature space to obtain the morphological features and grayscale distribution feature representation of the lesion area; According to the morphological features and grayscale distribution feature representation, the shape factor is calculated, the grayscale distribution histogram is analyzed, and the specific feature description of the lesion area is obtained.
4. The method according to claim 1, wherein: The segmentation middleware is designed to integrate multiple segmentation algorithms, including threshold segmentation, region growing and level set method, and select appropriate segmentation algorithms for different types of lesion areas according to the feature vector analysis results, including: Constructing a segmentation algorithm selector according to shape indexes and grayscale distribution characteristics, wherein the segmentation algorithm selector is implemented using a decision tree classifier; The decision tree classifier is trained by using a pre-labeled training data set to obtain an optimal segmentation point and a decision rule; If the decision tree classifier determines that the circularity index of the lesion area is within a preset range and the grayscale standard deviation is less than a preset threshold, a region growing algorithm is used for segmentation; The region growing algorithm starts growing from the point with the highest gray value to obtain the segmentation result; If the decision tree classifier determines that the shape of the lesion area is irregular and the grayscale distribution has obvious boundaries, the level set method is used for segmentation; The level set method calculates the level set function by the fast marching method to obtain the segmentation boundary; If the decision tree classifier determines that the grayscale distribution of the lesion area is bimodal or multimodal, a multi-threshold OTSU algorithm is used for segmentation; The multi-threshold OTSU algorithm determines the optimal number of thresholds by maximizing the inter-class variance, calculates each threshold, and divides the image into multiple gray levels; Design segmentation middleware, integrating the region growing algorithm, level set method and multi-threshold OTSU algorithm; The segmentation middleware calls the corresponding segmentation algorithm for processing according to the output result of the segmentation algorithm selector; The segmentation results of different algorithms are post-processed, including morphological operations and boundary smoothing, to obtain the final lesion area segmentation results.
5. The method according to claim 1, wherein: The method uses simulation technology to generate annotated PET image data, combines real case data to build a training data set, and uses data enhancement technology to expand the sample size to generate a large-scale data set for algorithm training, including: The positron annihilation process is simulated according to the Monte Carlo method to obtain simulated PET raw data; Reconstructing the simulated PET raw data using a maximum likelihood expectation maximization algorithm to obtain a simulated PET image; For the simulated PET image, automatically generate corresponding lesion area annotation information; Apply U-Net deep learning algorithm to segment the PET images of real cases, extract the lesion area, and obtain the annotation information of real cases; If the simulated PET image and the real case PET image are obtained, the simulated PET image and the real case PET image are mixed in a ratio of 7:3 to construct an initial training data set; For each image in the initial training data set, five variants are generated, including: rotating the image by -15° to 15°, scaling the image by 0.9 to 1.1 times, translating the image by -10 to 10 pixels, adjusting the image brightness by ±20%, and enhancing the image contrast by ±20%; Through image enhancement methods, a large-scale training dataset containing 5 times the number of original samples was obtained; A cross-validation method is used to evaluate the representativeness and diversity of the large-scale training dataset; Calculating the inter-class distance and intra-class distance of the large-scale training data set; Determine whether the inter-class distance and the intra-class distance meet the preset standard; If the inter-class distance and the intra-class distance do not meet the preset standard, the image enhancement process is returned to make adjustments.
6. The method according to claim 1, wherein: The deep learning model U-Net is used to perform preliminary segmentation of the lesion area to obtain a rough segmentation result, and the generated large-scale data set is used to train the U-Net model. The segmentation result is optimized through morphological operations to eliminate isolated small areas and fill holes, including: According to the training set, validation set and test set data, a U-Net neural network model is constructed, wherein the U-Net neural network model includes a 4-layer encoder and a 4-layer decoder structure; The PET image to be segmented is input into the U-Net neural network model, and a probability map of the lesion area is obtained through forward propagation; The Otsu algorithm is used to automatically calculate the optimal threshold, and the probability map of the lesion area is binarized to obtain a rough segmentation result; The rough segmentation result is subjected to morphological post-processing, including: performing an opening operation using a 3x3 circular structure element to remove isolated small areas whose area is less than 0.1% of the total image area, performing a closing operation to fill internal holes whose area is less than 5% of the lesion area, and performing edge smoothing using a Gaussian filter to obtain an optimized lesion area segmentation result; Calculating the Dice coefficient, Jaccard index and average surface distance between the optimized lesion area segmentation result and the manual annotation result; If the Dice coefficient is greater than 0.8, the Jaccard index is greater than 0.7, and the average surface distance is less than 2 pixels, it is determined that the optimized lesion region segmentation result meets the quality requirements.
7. The method according to claim 1, wherein: The segmentation middleware is used to refine the segmentation result of U-Net, focusing on the edge of the lesion area, and accurately locating the lesion boundary through the edge detection algorithm to obtain a fine segmentation result, including: The segmentation result of U-Net is received and input into the segmentation middleware, and the segmentation middleware calculates the average value of the multi-channel PET image to obtain a single-channel image; Performing edge detection using a gradient-based Sobel operator on the single-channel image, calculating horizontal and vertical gradients, and obtaining an edge intensity map and a direction map; The Otsu algorithm is used to automatically calculate the optimal threshold value for the edge intensity map, and a preliminary edge point set is extracted; A non-maximum suppression algorithm is used to remove non-edge points from the preliminary edge point set to obtain a refined edge point set; Using an edge tracking algorithm to connect the refined edge point set, setting a maximum connection distance, and connecting adjacent edge points into a continuous contour line; The continuous contour lines are subjected to morphological thinning and bridging operations to optimize edge connections to form a closed lesion area boundary; The closed lesion area boundary is smoothed by using a cubic B-spline curve fitting algorithm, and control points are selected by equidistant sampling, and the control point spacing is set to interpolate and smooth the boundary to obtain a fine lesion area segmentation result; Calculating the Hausdorff distance and the average contour distance between the refined lesion area segmentation result and the original U-Net segmentation result; If the Hausdorff distance is less than a preset first threshold and the average contour distance is less than a preset second threshold, it is determined that edge thinning is effective.
8. The method according to claim 1, wherein: The fine segmentation results are quantitatively evaluated, and the Dice coefficient and Jaccard index evaluation indicators are calculated. If the evaluation indicators are lower than the preset threshold, the segmentation algorithm is re-selected for optimization for different types of lesion areas according to the feature vector analysis results. If the preset threshold is still not reached after multiple optimizations, the case is recorded and marked as requiring manual review, including: Quantitatively evaluate the fine segmentation results to obtain the Dice coefficient and Jaccard index; According to the Dice coefficient and the Jaccard index, determine whether a preset threshold is reached; If the Dice coefficient is less than a preset threshold or the Jaccard index is less than a preset threshold, a random forest algorithm is used to select a new algorithm from a segmentation algorithm library; Re-segment the lesion area using the new algorithm to obtain an optimized segmentation result; Calculate the Dice coefficient and Jaccard index for the optimized segmentation result to determine whether it reaches a preset threshold; If the Dice coefficient and the Jaccard index do not reach the preset threshold, the optimization process is repeated; If after multiple optimization iterations, the Dice coefficient and the Jaccard index still do not reach the preset threshold, the case will be recorded in the list to be reviewed.
Citation Information
Patent Citations
Automatic tumor area partition method based on improved level set
CN104715484A
Systems and methods for segmentation and processing of tissue images and feature extraction from same for treating, diagnosing, or predicting medical conditions
US20130230230A1
Method and device for analysing an image
US20170231550A1
Cited By
Cancer image contrast enhancement method and system based on deep learning
CN119599925A
Image segmentation labeling method and system based on machine learning
CN120339733A
Chest X-ray image processing method for pneumoconiosis based on AI small shadow detection rate
CN120747041A
Chest x-ray image processing method for ai small shadow detection rate for pneumoconiosis
CN120747041B
Hepatobiliary calculus identification method and system based on deep learning
CN121095158A