Trunk adaptive segmentation method based on deep learning

Through the trunk adaptive segmentation method based on deep learning, the challenge of establishing trunk models in cardiac magnetic resonance imaging is solved, and trunk segmentation with high precision and low resource consumption is achieved, which is suitable for medical imaging processing.

CN120182310AInactive Publication Date: 2025-06-20GUOCI CLOUD DIGITAL (DEQING) TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510663074.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-22
Publication Date
2025-06-20
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In cardiac magnetic resonance imaging, how to establish an accurate trunk model, avoiding the inunique target segmentation boundaries, high dependence on data, and reducing computing resources and time costs is still a challenge that needs to be solved urgently.

Method used

A trunk adaptive segmentation method based on deep learning is adopted. By converting image data from different sources into the same format and standardizing the processing, the areas of both lungs in the image data are identified to locate the upper and lower bounds of the trunk, segmentation is performed using a lightweight U-net network structure, and model parameters are optimized in combination with backpropagation, and segmentation accuracy is improved through the result mapping method.

Benefits of technology

This method effectively solves the uncertainty of the target segmentation boundary and strong dependence on data, significantly reduces the cost of computing resources and time, improves the accuracy and consistency of segmentation results, and is suitable for medical institutions with limited computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120182310A_ABST
    Figure CN120182310A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of medical image processing, in particular to a trunk adaptive segmentation method based on deep learning, which comprises the following steps of: converting image data from different sources into the same image format, and carrying out standardization processing on the image data subjected to format conversion to obtain a standardized image format; enabling the image data subjected to format conversion to meet a model input requirement; performing boundary positioning and segmentation processing on the standardized image data, identifying a region of interest in the image data, synchronously executing cutting operation, and removing a non-target region in the image; according to the method, through image preprocessing operation, the segmentation result is smoother, an automatic adaptation function can be played among different anatomical structures, the final result can better meet the actual medical requirements, and a basis is provided for subsequent fine processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of medical image processing, and in particular to a torso adaptive segmentation method based on deep learning. Background Art

[0002] Thoracic torso segmentation is of great significance in medical image processing, especially in cardiac magnetic field function detection, where an accurate torso model is crucial for determining the position of the heart and the relative position between the detector and the torso surface.

[0003] Traditional trunk segmentation methods mostly rely on manual operations, which are time-consuming and susceptible to human factors, making it difficult to ensure the accuracy and consistency of the segmentation results. With the development of deep learning technology, automatic segmentation methods based on convolutional neural networks (CNNs) have made significant progress in medical image processing. For example, the chest X-ray segmentation system based on the minimum error method uses deep learning technology and statistical principles to process the histogram of the chest X-ray image to achieve effective segmentation of the chest area.

[0004] In the field of magnetic heart, researchers are also exploring trunk segmentation methods based on deep learning. For example, in the study of magnetic heart positive problems based on personalized three-dimensional heart-trunk models, the heart-trunk geometric model is obtained by three-dimensional personalized modeling of the heart and trunk magnetic resonance imaging data sources of the subjects, which provides a basis for subsequent research on cardiac electrical activity. In addition, the application of deep learning in chest CT image segmentation has also achieved good results. For example, the Unet-based chest CT segmentation method uses deep learning technology to achieve accurate segmentation of chest CT images, providing a reliable basis for subsequent medical analysis.

[0005] In recent years, deep learning methods that combine multimodal data and prior knowledge have received more attention. By combining imaging data of different modalities (such as CT, MRI), more comprehensive information can be obtained and the segmentation accuracy can be further improved. At the same time, combining anatomical prior knowledge can optimize the performance of the model, especially when dealing with complex cases. Although these methods have made significant progress, they still face some challenges in practical applications.

[0006] Although existing studies have made some progress in trunk segmentation, how to establish an accurate trunk model in cardiac magnetic resonance imaging, avoid non-unique target segmentation boundaries, have high dependence on data, and reduce computing resources and time costs, is still a challenge that needs to be solved urgently. Summary of the invention

[0007] In view of the above disadvantages of the prior art, the present invention provides a trunk adaptive segmentation method based on deep learning, which solves the technical problems of the uncertainty of the target segmentation boundary, the strong dependence on data, and the high computational resources and time costs.

[0008] To achieve the above objectives, the present invention is realized through the following technical solutions: A trunk adaptive segmentation method based on deep learning, comprising the following steps: Convert image data from different sources into the same image format, and perform standardization processing on the image data after format conversion to make the image data after format conversion meet the model input requirements; perform processing to locate the segmentation boundary on the image data after standardization processing, identify the regions of the two lungs in the image data to locate the upper and lower boundaries of the region of interest (trunk), and synchronously perform a cropping operation to remove non-target regions in the image; based on a lightweight U-net network structure, capture the spatial information in the image and perform segmentation; the training set of the model is the manually labeled trunk region, and its parameters are optimized through backpropagation. In each iteration, the model updates the parameters according to the error, gradually improving its segmentation accuracy for the image content; in the inference stage, adopt a result mapping method to accurately map the model inference result back to the original data space; use visualization software to check whether the output result of the model matches the source data and whether the segmentation region is aligned with the original image.

[0009] Furthermore, the types of the image data include CT and MRI, and the target image formats for the conversion of the image data include NIfTI and DICOM; The standardization processing logic of the image data after format conversion is expressed as: Convert the image data after format conversion into a grayscale image, and perform processing operations with each pixel in the grayscale image as the standardization processing target: ; In the formula: is the grayscale value of the pixel after standardization processing; is the original pixel grayscale value; is the maximum and minimum of the pixel grayscale values in the grayscale image; Based on the above formula, perform per-pixel standardization processing on the grayscale image corresponding to each image data after format conversion, thereby outputting the standardized image data.

[0010] Furthermore, in the stage of performing standardization processing on the image data, all image data are traversed synchronously, and the image data are cleaned: Logic1: Identify the information contained in each image data, and use the image data containing incomplete information as the cleaning target to perform cleaning operations; Logic2: Calculate the grayscale histogram of the image data, preset the effective grayscale value determination interval, compare the grayscale value interval corresponding to the image data grayscale histogram with the effective grayscale value determination interval, and use the image data whose grayscale value interval corresponding to the image data grayscale histogram is not within the effective grayscale value determination interval as the cleaning target, and perform the cleaning operation; Among them, the information included in the image data includes: patient information, image data acquisition time, image data scanning parameters, and image data graphic size.

[0011] Furthermore, in the stage of processing the positioning and segmentation boundary of the image data and identifying the region of interest in the image data, it follows: S1: Read the image data using the corresponding library; S2: Based on the difference in grayscale values between the lung tissue and the surrounding tissues, set the lung determination threshold, segment the lung region image in the image data, use morphological opening and closing operations to remove noise and fill the small holes in the lung region, and at the same time add two aspects of volume screening and morphological registration degree to eliminate data, so as to clean the data that does not contain the region of interest; S3: Determine the connected region where the lung is located through connected region analysis, and use the edge detection algorithm to extract the boundary of the region of interest in the lung; S4: Determine the upper and lower bounds of the torso region according to the segmented lung region, crop the range of the torso based on the rectangular box, and remove the non-target region; S5: Save; Among them, when the image data is in DICOM format, use the pydicom library, and when the image data is in NIfTI format, use the nibabel library.

[0012] Furthermore, the capture operation of the spatial information in the image follows: It includes the feature extraction stage of the encoder and the determination stage of the activation function and the loss function; Configure the encoder: Convolution layer setting: Determine the number of convolution layers, set the number to 4 - 6 layers, and perform feature extraction on the input image data; Pooling layer configuration: After each layer of convolution, add a 2×2 pooling layer to reduce the feature map resolution and expand the receptive field; Configure the decoder: Transposed convolution layer setting: Set the size of the transposed convolution kernel, and based on the transposed convolution kernel, increase its feature region size from (16, 16) to (32, 32); Skip connection initialization: In each layer of the decoder, prepare to splice the feature map of the corresponding layer of the encoder with it, define the splicing function, and ensure that when the model runs, the feature maps of the corresponding layers of the encoder and decoder can be correctly spliced according to the channel dimension.

[0013] Furthermore, the form of the splicing function is as follows: ; In the formula: C is the tensor obtained by splicing tensors A and B in the channel dimension; represents the splicing operation; means splicing is performed in the channel dimension with index 1; wherein, the shapes of tensors A and B are expressed as: , respectively represent the batch size, the number of channels, the height, and the width.

[0014] Furthermore, the activation function and the loss function are as follows: ; In the formula: is the output value; represents taking the maximum value within the parentheses; is the eigenvalue; is the loss value; is the number of samples participating in the calculation of the loss value; is the true label of the i-th sample; is the predicted value of the model for the i-th sample; wherein, (1) is the activation function and (2) is the loss function.

[0015] Furthermore, when using visualization software to check whether the output result of the model matches the source data and whether the segmentation area is aligned with the original image, if the results are all yes, it ends; if any one of the results is no, it synchronously jumps to the annotation stage of the trunk part in the cropped image data and resets the execution.

[0016] Adopting the technical solution provided by the present invention, compared with the known public technologies, it has the following beneficial effects: 1. The present invention provides a trunk self-adaptive segmentation method based on deep learning. Through image preprocessing operations, the segmentation result is made smoother, and it can also play an automatic adaptation function among different anatomical structures, so that the final result can better meet the actual medical needs and provide a basis for subsequent fine processing.

[0017] 2. The present invention adopts the method of adaptive cropping to unify the data, and then combines a small amount of labeled data with prior knowledge in the medical field, greatly reducing the need for a large amount of new labeled data. In this way, even when the data is insufficient, the model can still achieve high accuracy and strong generalization ability.

[0018] 3. By optimizing the structure of the deep learning model and adopting a lightweight network architecture, the present invention significantly reduces the demand for computing resources, not only accelerating the training process but also reducing the dependence on high-end computing hardware, enabling more medical institutions to implement this technology even under limited resources, and greatly enhancing the robustness of this technology in the implementation stage. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.

[0020] Figure 1 It is a schematic flowchart of a trunk adaptive segmentation method based on deep learning; Figure 2 In the present invention Figure 1 It is a detailed schematic flowchart of the preprocessing stages such as positioning the segmentation boundary and cropping in the present invention; Figure 3 It is a schematic diagram showing an example of positioning the upper and lower boundaries of the lungs in the trunk image data of the present invention; Figure 4 It is a schematic diagram showing an example of two-dimensional chest trunk segmentation in the present invention; Figure 5 It is a schematic diagram showing an example of three-dimensional chest trunk segmentation in the present invention; Figure 6 It is a comparison display diagram of the cross-section flatness before and after trunk modeling optimization in the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments of the present invention belong to the scope of protection of the present invention.

[0022] The following further describes the present invention with reference to the embodiments.

[0023] Embodiment: A trunk adaptive segmentation method based on deep learning in this embodiment, as Figure 1 shown, includes the following steps: Convert the image data from different sources into the same image format, and perform normalization processing on the image data after format conversion to make the image data after format conversion meet the model input requirements; The types of image data include CT and MRI, and the target image formats for image data conversion include NIfTI and DICOM; The normalization processing logic of the image data after format conversion is expressed as: Convert the image data after format conversion into a grayscale image, and use each pixel in the grayscale image as the target for normalization processing to perform processing operations: ; In the formula: is the grayscale value of the pixel after normalization processing; is the original pixel grayscale value; are the maximum and minimum pixel grayscale values in the grayscale image; Among them, based on the above formula, each pixel in the grayscale image corresponding to each image data after format conversion is normalized to output the image data after format conversion after normalization processing; During the normalization processing stage of the image data, all image data are traversed synchronously, and the image data are cleaned: Logic1: Identify the information contained in each image data, and use the image data containing incomplete information as the cleaning target to perform cleaning operations; Logic2: Calculate the grayscale histogram of the image data, preset the effective grayscale value determination interval, compare the grayscale value interval corresponding to the grayscale histogram of the image data with the effective grayscale value determination interval, and use the image data whose grayscale value interval corresponding to the grayscale histogram of the image data is not within the effective grayscale value determination interval as the cleaning target to perform cleaning operations; Among them, the information contained in the image data includes: patient information, image data acquisition time, image data scanning parameters, and image data graphic size; Perform the processing of positioning and segmenting the boundary on the image data after normalization processing, identify the region of interest in the image data, and synchronously perform the cropping operation to remove the non-target regions in the image; The positioning and segmentation boundaries include: 1. According to the grayscale distribution of the image, segment the image by dynamic threshold. According to the grayscale value frequency of the image, select a suitable threshold to separate different regions in the image. Using dynamic threshold segmentation maintains a consistent segmentation standard between different images. First, retain the high-threshold region to segment the human body part R, and then perform low-threshold segmentation to obtain R1; 2. Perform volume screening on R1 to obtain the larger volume part R2. Match the connected regions in R2 with the standard lung surface morphology to ensure that the segmented regions conform to the true anatomical morphology, and obtain the lung regions R3. This step ultimately retains the two large volumes of the left and right lungs.

[0024] 3. Locate the upper and lower boundaries of the torso based on the lung regions, that is, the slice positions of the upper and lower bounds of R3 in the source data, denoted as S1 and S2, and use this position as the starting and ending points for subsequent segmentation. By this method, the segmentation accuracy can be greatly improved, ensuring that each segmentation result includes the cardiopulmonary part, and at the same time, the flatness of the segmentation boundary can be improved.

[0025] 4. Extract the image data in this interval from the source data using the slice position information. These extracted data will be used as the input for the subsequent deep learning model training to ensure that the training process is targeted and effectively learns the key features of the data.

[0026] The processing of the image data for locating the segmentation boundary and identifying the region of interest in the image data follows: S1: Read the image data using the corresponding library; S2: Based on the difference in gray values between the lung tissue and the surrounding tissue, set the lung determination threshold, segment the lung region image in the image data, use morphological opening and closing operations to remove noise and fill the small holes in the lung region, and at the same time add volume screening and morphological registration degree for data elimination to clean up the data that does not contain the region of interest; S3: Determine the connected region where the lung is located through connected region analysis, and use the edge detection algorithm to extract the boundary of the lung region; S4: Determine the region of interest of the torso based on the boundary of the lung region, and crop the determined region of interest of the torso based on the rectangular box to remove the non-target region; S5: Save; Among them, when the image data is in DICOM format, use the pydicom library, and when the image data is in NIfTI format, use the nibabel library; Based on the lightweight U-net network structure, capture the spatial information in the image and perform segmentation; The operation of capturing the spatial information in the image follows: It includes the feature extraction stage of the encoder and the determination stage of the activation function and loss function; Configure the encoder: Convolution layer setting: Determine the number of convolution layers, and set the number to 4 - 6 layers to extract features from the input image data; Pooling layer configuration: After each layer of convolution, add a 2×2 pooling layer to reduce the resolution of the feature map and expand the receptive field; Configure the decoder: Transposed convolution layer settings: Set the size of the transposed convolution kernel. Based on the transposed convolution kernel, increase the size of its feature region from (16, 16) to (32, 32); Among them, each layer of the decoder uses a 2×2 transposed convolution kernel, with a stride of 2 and no padding, gradually doubling the size of the feature map. For example, the first layer of transposed convolution upsamples the size from (16, 16) to (32, 32), the second layer from (32, 32) to (64, 64), and so on. Skip connection initialization: At each layer of the decoder, prepare to concatenate the feature map of the corresponding layer of the encoder. Define a concatenation function to ensure that during the operation of the model, the feature maps of the corresponding layers of the encoder and decoder can be correctly concatenated along the channel dimension; The form of the concatenation function is: ; In the formula: C is the tensor obtained by concatenating tensors A and B along the channel dimension; represents the concatenation operation; is to perform concatenation along the channel dimension with index 1; Among them, the shapes of tensors A and B are expressed as: , represent the batch size, number of channels, height, and width respectively; The activation function and loss function are: ; In the formula: is the output value; represents taking the maximum value within the parentheses; is the eigenvalue; is the loss value; is the number of samples participating in calculating the loss value; is the true label of the i-th sample; is the predicted value of the model for the i-th sample; Among them, (1) is the activation function and (2) is the loss function; The model learns through the input labeled data and optimizes its parameters through backpropagation. In each iteration, the model updates the parameters according to the error, gradually improving its segmentation accuracy for the image content. The preprocessed data is inferred in the generated segmentation model, and the inference result is remapped back to the original data through the slice boundary information; Post-processing: During inference, the segmentation result output by the model (including size 256×256) needs to be restored to the original image size (including 512×512) through interpolation or the sliding window method, and the slice boundary is aligned according to the coordinates during preprocessing; Use visualization software to check whether the output results of the model match the source data, and whether the segmented regions are aligned with the original images; When using visualization software to check whether the output results of the model match the source data and whether the segmented regions are aligned with the original images, if the results are both yes, end; if any one of the results is no, synchronously jump to the annotation stage of the trunk part in the post-cropped image data and reset the execution.

[0027] In this embodiment, the method adopts dynamic threshold segmentation technology to segment different regions of the image through gray-scale distribution analysis, and maintains a consistent segmentation standard by dynamically adjusting the threshold. Further combined with the volume screening method (from smaller regions to larger volume regions) to retain key regions, and ensure the anatomical rationality of the segmentation through lung surface morphology matching; locate the upper and lower boundaries of the trunk according to the lung region to ensure the improvement of subsequent segmentation accuracy. Extract the target region data through the slice position information, and ensure that each segmentation result accurately covers the cardiopulmonary region, optimize the flatness of the segmentation boundary, and provide accurate data input for subsequent deep learning training; in the model design, adopt a lightweight U-net network structure to reduce the amount of calculation and the number of parameters, and improve the training speed and efficiency. This design is not only applicable to environments with limited computing resources, but also maintains high segmentation accuracy, thus adapting to the computing and time limitations in medical image segmentation tasks.

[0028] It should be noted that: The operation of positioning and segmenting the boundary of the image data also includes: 1. Segment the image through dynamic threshold according to the gray-scale distribution of the image. Select a suitable threshold according to the gray-scale value frequency of the image to separate different regions in the image. Adopt dynamic threshold segmentation to maintain a consistent segmentation standard between different images. First, retain the high-threshold region to segment the human body part R, and then perform low-threshold segmentation to obtain R1; 2. Perform volume screening on R1 to obtain the larger volume part R2. Perform standard lung surface morphology matching on each connected domain in R2 to ensure that the segmented region conforms to the real anatomical morphology, and obtain the lung region R3. This step finally retains the two large volumes of the left and right lungs.

[0029] 3. Locate the upper and lower boundaries of the trunk according to the lung region, that is, the slice positions of the upper and lower bounds of R3 in the source data, denoted as S1 and S2, and use this position as the starting and ending points of subsequent segmentation. Through this method, the segmentation accuracy can be greatly improved, ensuring that each segmentation result includes the cardiopulmonary part, and at the same time, the flatness of the segmentation boundary can be improved.

[0030] 4. Extract the image data of this interval from the source data using the slice position information. These extracted data will be used as the input for the subsequent deep learning model training to ensure that the training process is targeted and effectively learns the key features of the data; Figure 2: Schematic diagram of the detailed process of the preprocessing stage such as positioning the segmentation boundary and cropping: This figure shows the core process of the image data preprocessing, and the specific steps are as follows: Data reading and initialization: Use the pydicom library (DICOM format) or the nibabel library (NIfTI format) to read the image header file and parse metadata such as patient information and scanning parameters.

[0031] Image adjustment and rough segmentation: Adjust the window width and clarity according to the header file information, separate the human body area (the high threshold retains the main body area R) through dynamic threshold segmentation technology, and further extract the potential lung area R1 through low threshold segmentation.

[0032] Connected component screening and morphological matching: Perform volume screening on R1, eliminate small volume noise areas, and retain large volume areas R2; determine the real lung area R3 through standard lung surface morphological matching (matching degree ≥ 70%) to ensure that the segmentation result conforms to anatomical features.

[0033] Boundary positioning and data cropping: According to the upper and lower slice positions (D1 and D2) of the lung area R3, crop the target interval image from the source data as the input data for the subsequent model training.

[0034] Post - processing verification: After model inference, map the segmentation result back to the source data through the slice boundary information to verify the segmentation accuracy.

[0035] Key technical points: Dynamic threshold segmentation combined with morphological operations effectively excludes noise interference, accurately locates the region of interest in the trunk (chest), and provides high - quality data for model training.

[0036] Figure 3: Schematic diagram of the example of the positioning of the lungs and the upper and lower boundaries of the segmentation in the trunk image data: The figure shows the positioning result of the lung area in the image data. Set the threshold to segment the lungs through the gray - scale difference, use connected component analysis to determine the spatial positions of the left and right lungs, and mark their upper and lower slice positions (D1 and D2).

[0037] Core function: Determine the start and end ranges of the trunk segmentation through the lung boundary, ensure that the segmentation result includes the key areas of the heart and lungs, and at the same time avoid interference from non - target areas, improving the flatness and accuracy of the segmentation boundary.

[0038] Figure 4: Schematic diagram of the two - dimensional example of the trunk segmentation of the chest: The figure shows the trunk segmentation result of a certain layer of CT / MRI image. The background is the original grayscale image, and the foreground (highlighted area) is the trunk area segmented by the model (such as chest soft tissues, bones, etc.).

[0039] Technical effect: The lightweight U-net model extracts spatial features through the encoder, and the decoder combines skip connections to restore details, achieving precise delineation of the trunk boundary in two-dimensional images. The segmentation result highly coincides with the anatomical structure.

[0040] Figure 5: Schematic diagram of a three-dimensional chest trunk segmentation example: The figure shows a three-dimensional trunk model reconstructed from multi-layer images. By superimposing the segmentation results of consecutive slices, a complete three-dimensional trunk structure (such as the overall contour of the thoracic cavity) is formed.

[0041] Advantage manifestation: The three-dimensional segmentation result intuitively presents the spatial morphology of the trunk, verifies the segmentation ability of the model in cross-layer continuity, and provides a three-dimensional anatomical basis for cardiac electrical activity research, surgical planning, etc.

[0042] Figure 6: Comparison display diagram of the cross-section flatness before and after trunk modeling optimization: Left side (before optimization): Due to the blurred boundary positioning of the traditional segmentation method, the cross-section edge is uneven, with stepped artifacts or non-anatomical protrusions.

[0043] Right side (after optimization): The method of the present invention significantly improves the flatness of the segmentation boundary through adaptive preprocessing and the lightweight U-net model. The edge is continuous and smooth, which better meets the actual medical needs.

[0044] Comparison significance: Intuitively shows the improvement of the segmentation quality by preprocessing operations (such as dynamic threshold segmentation, morphological operations) and model optimization, and verifies the advantages of the method in anatomical structure adaptability and result accuracy.

[0045] Accompanying drawing 2 - Figure 6 From dimensions such as the preprocessing process, boundary positioning, two-dimensional / three-dimensional segmentation results, and optimization comparison, the technical details and actual effects of the method of the present invention are systematically shown, reflecting its high precision, robustness, and clinical application value in medical image segmentation.

[0046] Next, for the method in Example 1, an application example is given: 1. Scenario setting: The input data is the chest CT image of a certain patient (DICOM format, 512×512 pixels, 200 layers). The goal is to locate the upper and lower boundaries of the trunk area (with the lungs as the core reference points) through dynamic threshold segmentation, volume screening, and morphological matching, and crop the target image data.

[0047] 2. Dynamically Threshold Segment the Human Body and Potential Lung Regions: Step 1: Read the image and extract the grayscale matrix; Use the pydicom library to read the DICOM file and obtain the grayscale matrix of the image (with a shape of 512×512). The matrix values correspond to tissue densities (e.g., there are significant differences in grayscale values between bones, soft tissues, and the lungs).

[0048] Step 2: High-threshold segment the main human body region (R); Set a high threshold (e.g., 150), and retain the regions with grayscale values ≥150 through grayscale value screening, marked as the main human body region R (mainly including bones and high-density soft tissues, excluding low-grayscale backgrounds such as air).

[0049] Step 3: Low-threshold segment the potential lung region (R1); Further set a low threshold (e.g., 50), and screen the regions with grayscale values ≥50, marked as the potential lung region R1 (with a larger range than R, including low-density tissues such as the lungs and some noise).

[0050] 3. Volume Screening to Eliminate Small-Volume Noise: Step 1: Connected component analysis; Perform connected component labeling on R1 to identify all independent regions (such as the lungs, heart, mediastinum, etc.), and calculate the pixel volume (area) of each region.

[0051] Step 2: Eliminate small-volume regions; Set a volume threshold (e.g., 5000 pixels), and only retain the regions with a volume ≥5000 to obtain the large-volume region R2 (excluding small-volume noises such as blood vessels and lymph nodes, and retaining the main structures such as the lungs and heart).

[0052] 4. Morphological Matching to Locate the True Lung Region (R3): Step 1: Standard lung morphology modeling; Based on anatomical knowledge, use the ellipse equation to simulate the two-dimensional morphology of the lungs (major axis 60 pixels, minor axis 40 pixels), and generate a standard lung template (grayscale value 1 represents the lung region, 0 is the background).

[0053] Step 2: Template matching to screen the lungs; For each connected component in R2, use the template matching algorithm to calculate the similarity with the standard lung template (range 0 - 1), and retain the regions with a matching degree ≥0.7, marked as the true lung region R3 (excluding structures with large morphological differences such as the heart).

[0054] 5. Locate the upper and lower boundaries of the torso and crop the data: Step 1: Determine the slice positions of the upper and lower boundaries of the lungs; Traverse all slices and find the lowest layer (D1) and the highest layer (D2) where R3 exists in the three-dimensional space as the upper and lower boundaries of the torso segmentation (for example, if R3 is distributed in layers 50 - 150, then D1 = 50 and D2 = 150).

[0055] Step 2: Crop the images in the target interval; According to D1 and D2, extract the image data of layers 50 - 150 from the original three-dimensional image, and eliminate the non-target areas outside the upper and lower boundaries to obtain the cropped image data (with a shape of 101×512×512, only containing the key areas of the heart and lungs).

[0056] 6. Explanation of key parameters and effects: Function of the dynamic threshold: The high threshold quickly separates the human body main part, and the low threshold extends to low-density areas such as the lungs to avoid boundary omission or misjudgment caused by a single threshold.

[0057] Function of volume screening: By setting the minimum volume (5000 pixels), small-volume noises (such as cross-sections of blood vessels) are effectively excluded, improving the subsequent matching accuracy.

[0058] Function of morphological matching: Use elliptical template matching (threshold 0.7) to ensure that the segmented area conforms to the anatomical shape of the lungs and exclude the interference of approximate areas such as the heart.

[0059] Effect of cropping: The data volume is reduced by about 30% (from 200 layers to 101 layers), focusing on the heart and lung areas and reducing the computational complexity of model training.

[0060] In summary, the method in the above embodiments makes the segmentation result smoother through image preprocessing operations, and can also play an automatic adaptation function between different anatomical structures, enabling the final result to better meet the actual medical needs, providing a basis for subsequent fine processing, and using the method of adaptive cropping to unify the data. Then, with a small amount of labeled data and combined with prior knowledge in the medical field, the demand for a large amount of new labeled data is greatly reduced. In this way, even in the case of insufficient data, the model can still achieve high accuracy and strong generalization ability. At the same time, by optimizing the structure of the deep learning model and adopting a lightweight network architecture, the demand for computing resources is significantly reduced, not only accelerating the training process but also reducing the dependence on high-end computing hardware, enabling more medical institutions to implement this technology even with limited resources, greatly enhancing the robustness of this technology in the implementation stage.

[0061] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements will not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A trunk adaptive segmentation method based on deep learning, characterized in that, Including the following steps: Convert the image data from different sources into the same image format, and perform normalization processing on the image data after format conversion to make the image data after format conversion meet the model input requirements; Perform processing to locate the segmentation boundary on the image data after normalization processing, identify the region of interest in the image data, and synchronously perform a cropping operation to remove the non-target region in the image; The user manually marks the trunk part in the cropped image data; Based on the lightweight U-net network structure, capture the spatial information in the image and perform segmentation; The model learns through the input annotation data and optimizes its parameters through backpropagation. In each iteration, the model updates the parameters according to the error, gradually improving its segmentation accuracy of the image content. The preprocessed data is inferred in the generated segmentation model, and the inference result is remapped back to the original data through the slice boundary information; Use visualization software to check whether the output result of the model matches the source data and whether the segmented area is aligned with the original image.

2. The trunk adaptive segmentation method based on deep learning according to claim 1, characterized in that, The types of the image data include CT and MRI, and the target image formats for the conversion of the image data include NIfTI and DICOM; The normalization processing logic of the image data after format conversion is expressed as: Convert the image data after format conversion into a grayscale image, and use each pixel in the grayscale image as the target for normalization processing to perform the processing operation: ; Where: is the gray value of the pixel after normalization; is the gray value of the original pixel; are the maximum and minimum gray values of the pixels in the grayscale image; Among them, based on the above formula, each pixel in the grayscale image corresponding to each image data after format conversion is normalized to output the image data after format conversion and normalization processing.

3. The trunk adaptive segmentation method based on deep learning according to claim 1, characterized in that, During the normalization processing stage of the image data, all image data are traversed synchronously to clean the image data: Logic1: Identify the information contained in each image data, and use the image data containing incomplete information as the cleaning target to perform the cleaning operation; Logic2: Calculate the grayscale histogram of the image data, preset the effective grayscale value determination interval, compare the grayscale value interval corresponding to the grayscale histogram of the image data with the effective grayscale value determination interval, and use the image data whose grayscale value interval corresponding to the grayscale histogram of the image data is not within the effective grayscale value determination interval as the cleaning target to perform the cleaning operation; Among them, the information contained in the image data includes: patient information, image data acquisition time, image data scanning parameters, and image data graphic size.

4. The trunk adaptive segmentation method based on deep learning according to claim 1, characterized in that, During the processing of locating the segmentation boundary of the image data and identifying the region of interest in the image data, it follows: S1: Read the image data using the corresponding library; S2: Based on the difference in grayscale values between the lung tissue and the surrounding tissues, set the lung determination threshold, segment the lung region image in the image data, use morphological opening and closing operations to remove noise and fill the small holes in the lung region, and at the same time perform data elimination in terms of volume screening and morphological registration degree to clean the data that does not contain the region of interest; S3: Determine the connected region where the lung is located through connected region analysis, and use the edge detection algorithm to extract the boundary of the region of interest of the lung; S4: Determine the cropped rectangular box according to the boundary of the region of interest in the lungs, and crop the image data based on the cropping range determined by the rectangular box to remove the non-target regions; S5: Save; Among them, when the image data is in DICOM format, use the pydicom library, and when the image data is in NIfTI format, use the nibabel library.

5. The trunk adaptive segmentation method based on deep learning according to claim 1, characterized in that, The user terminal manually marks the trunk part in the cropped image data, manually delimits several annotation regions by the user terminal, and then several corresponding user terminals simultaneously execute the annotation operation; Among them, when performing the annotation operation on the trunk part of the image data, the annotation accuracy is user-defined by the user terminal, and the annotation accuracy of each annotation region is kept consistent.

6. The trunk adaptive segmentation method based on deep learning according to claim 1, characterized in that, The capture operation of the spatial information in the image follows: Including the feature extraction stage of the encoder, the determination stage of the activation function and the loss function; Configure the encoder: Convolution layer setting: Determine the number of convolution layers, set the number to 4 - 6 layers, and perform feature extraction on the input image data; Pooling layer configuration: After each layer of convolution, add a 2×2 pooling layer to reduce the feature map resolution and expand the receptive field; Configure the decoder: Transposed convolution layer setting: Set the size of the transposed convolution kernel, and based on the transposed convolution kernel, increase its feature region size from (16, 16) to (32, 32); Skip connection initialization: In each layer of the decoder, prepare to splice the feature map of the corresponding layer of the encoder; Define the splicing function to ensure that when the model runs, the feature maps of the corresponding layers of the encoder and decoder can be correctly spliced along the channel dimension.

7. A trunk adaptive segmentation method based on deep learning according to claim 6, characterized in that, The form of the splicing function is: ; Where: C is the tensor obtained by concatenating tensors A and B in the channel dimension; represents the concatenation operation; is for concatenating in the channel dimension at index 1; Among them, the shapes of tensors A and B are represented as: , representing the batch size, number of channels, height, and width respectively.

8. A trunk adaptive segmentation method based on deep learning according to claim 6, characterized in that, The activation function and the loss function are: ; Wherein: is the output value; represents taking the maximum value within the brackets; is the eigenvalue; is the loss value; is the number of samples participating in calculating the loss value; is the true label of the i-th sample; is the predicted value of the model for the i-th sample; Among them, (1) is the activation function and (2) is the loss function.

9. A trunk adaptive segmentation method based on deep learning according to claim 1, characterized in that, Use visualization software to check whether the output result of the model matches the source data. When the results that the segmented region is aligned with the original image are both yes, end. When any one of the results is no, synchronously jump to the annotation stage of the trunk part in the cropped image data and reset the execution.

Citation Information

Patent Citations

  • Lung CT image data segmentation method and system

    CN111062955A

  • Improved 3D U-Net model-based preschool child lung image region-of-interest segmentation method

    CN114581459A

  • Medical image rapid segmentation method based on segmentation cutting model

    CN118229974A

  • AI-based medical image automatic segmentation and labeling system

    CN119418061A

  • Lightweight network architecture for medical image segmentation

    CN119722692A