Lung eighteen-segment segmentation and post-processing correction method and system based on nnunet

By using a lightweight left and right lung segmentation model and a hierarchical post-processing correction method, the problems of long waiting time and limited hardware computing power in multi-model segmentation schemes are solved, achieving efficient and accurate segmentation of the eighteen lung segments and improving the accuracy and robustness of the segmentation results.

CN121639711APending Publication Date: 2026-03-10DOTU TECH (FO SHAN) LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-07
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing lung segmentation methods require the deployment of multiple models, resulting in excessively long waiting times and high hardware computing power requirements. Furthermore, the segmentation results contain erroneous regions, affecting accuracy.

Method used

A lightweight left and right lung segmentation model was used for initial segmentation, and the segmentation results were corrected through region clipping and hierarchical post-processing, including internal correction of the left and right lungs, internal correction of the lung lobes, and external and internal correction of lung segments. Connectivity analysis and geometric center distance were used to identify erroneous regions to ensure the accuracy of the segmentation results.

Benefits of technology

It significantly shortens processing time, reduces hardware computing power requirements, improves the accuracy and robustness of segmentation results, and ensures the efficiency and reliability of lung segmentation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121639711A_ABST
    Figure CN121639711A_ABST
Patent Text Reader

Abstract

The invention provides an nnunet-based lung eighteen-segment segmentation and post-processing correction method and system, which are applied to the technical field of medical image processing, and are characterized in that left and right lung segmentation is carried out on CT image data by adopting a lightweight left and right lung segmentation model, the left and right lungs are independently processed through region cutting, and finally, a hierarchical post-processing correction mechanism is introduced, so that the correction accuracy of the lung eighteen-segment segmentation and post-processing correction is improved. And the anatomical rationality and accuracy of the segmentation result are ensured. In conclusion, by optimizing the model structure and introducing the refined post-processing correction strategy, the lung eighteen-segment segmentation efficiency is improved, the resource consumption is reduced, the accuracy and reliability of the segmentation result are remarkably improved, and a better technical solution is provided for clinical medical image analysis.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of medical image processing, in particular to a lung eighteen segment segmentation and post-processing correction method and system based on nnunet. BACKGROUND

[0002] The lung anatomy is complex, usually divided into left and right lungs, of which the left lung contains an upper lobe and a lower lobe, and the right lung contains an upper lobe, a middle lobe and a lower lobe. On this basis, the lung can be further divided into eighteen lung segments, each of the upper and lower lobes of the left lung consists of four lung segments, and each of the upper, middle and lower lobes of the right lung consists of three, one and five lung segments, respectively. This complex anatomical structure makes the accurate segmentation of lung segments a challenge in medical image analysis.

[0003] In the prior art, in order to realize the accurate segmentation of the eighteen lung segments, it is usually necessary to construct multiple nnunet models (nnunet is a deep learning framework for medical image segmentation). For example, the left and right lung can be extracted by using a left and right lung segmentation model, and then five lung lobes can be extracted by using a left lung lobe segmentation model and a right lung lobe segmentation model, and finally the lung segments of each lung lobe can be segmented by using five lung lobe segmentation models. Although this multi-model joint segmentation method can obtain good segmentation capability, it has the disadvantage of deploying up to eight independent models. This not only leads to a long waiting time in actual project landing, but also puts high requirements on hardware computing power, causing computing power shortage.

[0004] In addition, whether a single model is used for lung eighteen segment segmentation or three models are used for joint segmentation when the data is insufficient, the final segmentation result may have error areas. Since the lung lobe or lung segment is a regular connected region in anatomy, i.e. a kind of tissue usually contains only one connected region. If there are two or more connected regions in the segmentation result, it can be determined that there is an error region, and the connected region with the largest volume is considered to be the correct connected region. The existence of these error regions seriously affects the accuracy of the segmentation result and the clinical application value.

[0005] In view of the above problems, the prior art needs to be improved. SUMMARY

[0006] In view of the above shortcomings of the prior art, the present application provides a lung eighteen segment segmentation and post-processing correction method and system based on nnunet, which aims to solve the problems of long waiting time, high hardware computing power requirement and error areas in the segmentation result in the prior art lung eighteen segment segmentation method.

[0007] In a first aspect, a lung eighteen segment segmentation and post-processing correction method based on nnunet is provided, the method comprising the steps of: S1: Acquire CT image data and use a left and right lung segmentation model to segment the CT image data into left and right lungs to obtain the left and right lung segmentation results. S2: Perform internal correction on the left and right lung segmentation results to obtain the corrected left and right lung regions; S3: Based on the corrected left lung region and right lung region, the CT image data is cropped to obtain the left lung independent processing region and the right lung independent processing region respectively; S4: Use the left lung segmentation model to segment the left lung independently processed region into left lung segments, and use the right lung segmentation model to segment the right lung independently processed region into right lung segments to obtain the initial lung segmentation results; S5: Perform hierarchical post-processing correction on the initial lung segmentation results to obtain the corrected lung segmentation results for the eighteen lung segments.

[0008] This application provides an efficient and accurate method for lung segmentation and post-processing correction in eighteen segments. By introducing left and right lung segmentation, region clipping, and hierarchical post-processing correction, it effectively solves the problems of complexity and computational consumption in traditional multi-model segmentation schemes, and significantly improves the accuracy of segmentation results, overcoming the shortcomings of segmentation error regions in existing technologies.

[0009] Furthermore, in step S1, the left and right lung segmentation model is a pre-trained lightweight left and right lung segmentation model, and the steps for training the left and right lung segmentation model include: S11: Merge the lung segment labels of the left lung and the lung segment labels of the right lung to form a merged label; perform preliminary training on the left and right lung segmentation model based on the merged label; S12: Use the pre-trained left and right lung segmentation model to perform inference on the unlabeled image data and obtain preliminary segmentation results; S13: Manually correct the erroneous regions in the initial segmentation results, generate corrected label data, and merge the corrected label data with the original labeled data to form an extended dataset for training. S14: Reduce the depth and width of the left and right lung segmentation model and improve the spatial resolution of the image data processed by the left and right lung segmentation model; S15: Based on the extended dataset, the reduced model structure, and the adjusted spatial resolution, the left and right lung segmentation model is trained to obtain the lightweight left and right lung segmentation model.

[0010] This technical solution, by introducing a lightweight left and right lung segmentation model training method, utilizes initial training with merged labels, manual correction of erroneous regions to generate an expanded dataset, and model structure reduction and resolution adjustment, effectively improving the efficiency and accuracy of the left and right lung segmentation model, reducing the resource consumption of model deployment, and thus optimizing the performance of the overall segmentation process.

[0011] Furthermore, step S14 includes: S141: Reduce the depth of the left and right lung segmentation model to 4 layers, with feature depths of 16, 32, 64, and 128 for each layer; S142: Obtain the original feature depth. The original depth is 6 layers, and the original feature depth of each layer is 32, 64, 128, 256, 512, 512. S143: Use the first 4 layers with the original depth, and calculate the width reduction ratio by subtracting the corresponding feature depth of each layer from the original feature depth of each layer and then dividing by the original feature depth of each layer. Then reduce the width according to the width reduction ratio. S144: Increase the spatial resolution of the image data processed by the left and right lung segmentation model to 2mm.

[0012] Through this technical solution, this application defines the reduction method of model depth and width, as well as the improvement of spatial resolution, so that the lightweight left and right lung segmentation model can maintain high segmentation accuracy while further reducing the complexity and computational load of the model, improving processing efficiency, and providing a more optimized solution for practical applications.

[0013] Furthermore, step S2 includes: S21: Perform connected component analysis on the left and right lung segmentation results to identify each connected region belonging to the left and right lungs; S22: For each left and right lung region, determine the connected region with the largest internal volume as the main region. When an erroneous connected region that does not belong to the main region is identified, calculate the contact area between the erroneous connected region and the main region. S23: If the difference in contact area between the erroneous connected domain and the multiple main regions is less than a preset threshold, then calculate the distance between the geometric center of the erroneous connected domain and the geometric center of the multiple main regions, and assign the erroneous connected domain to the nearest main region; S24: Otherwise, assign the erroneous connected domain to the main region with the largest contact area to obtain the corrected left lung region and right lung region.

[0014] This technical solution introduces a method for correcting the internal structure of the left and right lungs based on connected component analysis. This method can effectively identify and correct erroneous connected components in the segmentation results. By comprehensively considering the contact area and the distance to the geometric center, it improves the accuracy and robustness of the left and right lung region segmentation and ensures the input quality of subsequent lung segmentation.

[0015] Furthermore, step S3 includes: S31: Based on the corrected left and right lung regions, identify regions other than the left and right lungs in the CT image data; S32: Set the pixel values ​​of the identified areas other than the left and right lungs to preset values ​​to eliminate interference; S33: After clearing the interference, based on the corrected boundaries of the left and right lung regions, the smallest unilateral lung bounding rectangle containing the left and right lung regions is cropped from the CT image data to obtain the independent processing regions of the left and right lungs respectively.

[0016] Furthermore, step S5 includes: S51: Merge the initial lung segmentation results into a left lung lobe and a right lung lobe; S52: Perform internal correction on the left and right lung lobes to obtain the corrected left and right lung lobes; S53: sequentially traverse the corrected left and right lung lobes, and perform external and internal corrections on the lung segments within each lobe to obtain the lung segmentation and correction results for eighteen segments.

[0017] Furthermore, step S52 includes: S521: Identify erroneous connected components in the left and right lobes of the lung; S522: Select an inter-regional correction strategy or an intra-regional correction strategy based on the positional relationship between the erroneous connected domain and the left or right lung lobe. Furthermore, the affiliation of the erroneous connected region is determined based on the contact area between the erroneous connected region and the correct region, thereby obtaining the corrected left and right lung lobes.

[0018] Furthermore, step S522 includes: S5221: Obtain the category label of the erroneous connected component; S5222: Determine whether the category label is consistent with the expected anatomical category of the left or right lung lobe; S5223: Based on the consistency judgment result of the category label, calculate the contact area between the erroneous connected region and the left or right lung lobe, or the largest internal connected region of the left or right lung lobe; S5224: Based on the consistency judgment result of the category label, the contact area, and the main position of the erroneous connected domain, determine the positional relationship between the erroneous connected domain and the left or right lung lobe, and select an inter-regional correction strategy or an intra-regional correction strategy.

[0019] Furthermore, in step S53, the external correction is used to process lung segments that do not belong to the current lung lobe, and the internal correction is used to process erroneous connected regions of a certain type of lung segment within the current lung lobe. Step S53 includes: S531: Obtain the connected component labels of the left lung lobe and the right lung lobe; S532: Iterate through the connected component labels of the left lung lobe and the right lung lobe in sequence, and determine whether the category of the connected component label of the lung segment is consistent with that of the current lung lobe. If they are inconsistent, perform external correction on the lung segment. S533: Calculate the contact area between the lung segment after external correction and the current main lung lobe region or the largest connected region of the same category, and perform internal correction based on the contact area to obtain the lung segmentation correction result of eighteen segments.

[0020] Secondly, a lung segmentation and post-processing correction system based on NNUNET is provided for implementing the method described in any of the above claims, the system comprising: First segmentation module: acquires CT image data and uses a left and right lung segmentation model to segment the CT image data into left and right lungs to obtain left and right lung segmentation results; First correction module: Performs internal correction on the left and right lung segmentation results to obtain the corrected left and right lung regions; Cropping module: Based on the corrected left lung region and right lung region, the CT image data is cropped to obtain independent processing regions for the left lung and right lung, respectively; The second segmentation module: uses the left lung segmentation model to segment the left lung independently processed region into left lung segments, and uses the right lung segmentation model to segment the right lung independently processed region into right lung segments, to obtain the initial lung segmentation results; The second correction module performs hierarchical post-processing correction on the initial lung segmentation results to obtain the corrected lung segmentation results for the eighteen lung segments.

[0021] Beneficial Effects: This application proposes a lung segmentation and post-processing correction method and system based on NNUNET for 18 lung segments. First, this application uses a lightweight left and right lung segmentation model to segment CT image data for the left and right lungs, and processes the left and right lungs independently through region clipping. This avoids the problem of deploying multiple independent models in traditional multi-model joint segmentation schemes, significantly shortening processing time and reducing hardware computing power requirements, effectively solving the problems of excessive waiting time and computing power constraints in existing technologies. Second, this application introduces a hierarchical post-processing correction mechanism, including internal correction of the left and right lungs, internal correction of lung lobes, and external and internal correction of lung segments. This hierarchical correction strategy can systematically identify and correct erroneous connected regions in the segmentation results, ensuring the anatomical rationality and accuracy of the segmentation results. By comprehensively judging the contact area, geometric center distance, category label consistency, and main body position of erroneous connected regions, this application can accurately assign erroneous regions to the correct lung structures, thereby overcoming the defect of erroneous regions in the segmentation results of existing technologies. In summary, by optimizing the model structure and introducing a refined post-processing correction strategy, this application not only improves the efficiency of lung segmentation and reduces resource consumption, but also significantly enhances the accuracy and reliability of the segmentation results, providing a better technical solution for clinical medical image analysis. Attached Figure Description

[0022] Figure 1 This is a flowchart of a lung segmentation and post-processing correction method based on NNUNET proposed in this application.

[0023] Figure 2 This is a structural diagram of a lung segmentation and post-processing correction system based on NNUNET proposed in this application.

[0024] Figure 3 This is a schematic diagram of the left and right lung segmentation results proposed in this application.

[0025] Figure 4 This is a schematic diagram of an initial lung segmentation result proposed in this application.

[0026] Labeling explanation: 201, First segmentation module; 202, First correction module; 203, Trimming module; 204, Second segmentation module; 205, Second correction module. Detailed Implementation

[0027] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. The components of the embodiments of this application described and marked in the accompanying drawings can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0028] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0029] Please refer to Figure 1 A method for lung segmentation and post-processing correction based on NNUNET, comprising the following steps: S1: Acquire CT image data and use the left and right lung segmentation model to segment the CT image data into the left and right lungs to obtain the left and right lung segmentation results. S2: Perform internal correction on the left and right lung segmentation results to obtain the corrected left and right lung regions; S3: Based on the corrected left and right lung regions, the CT image data is cropped to obtain the left and right lung independent processing regions respectively; S4: Use the left lung segmentation model to segment the left lung segment of the independently processed area, and use the right lung segmentation model to segment the right lung segment of the independently processed area, to obtain the initial lung segmentation results; S5: Perform hierarchical post-processing correction on the initial lung segmentation results to obtain the corrected lung segmentation results for the eighteen lung segments.

[0030] NNUNET is a deep learning framework for medical image segmentation. It provides a complete solution, including data preprocessing, model training, inference, and post-processing. NNUNET's key feature is its "human-intervention-free neural network training," which automatically configures the network architecture, training parameters, and data augmentation strategies based on the characteristics of the dataset. In the overall technical solution, NNUNET serves as the foundational framework for building left and right lung segmentation models, left lung segmentation models, and right lung segmentation models. In step S1, the left and right lung segmentation models are trained using the NNUNET framework to segment the left and right lungs from CT image data. In step S4, the left and right lung segmentation models are also built and trained based on the NNUNET framework to achieve lung segmentation of independently processed regions in the left and right lungs. The introduction of the NNUNET framework aims to address the problems of complex model selection and parameter tuning, as well as limited segmentation accuracy and generalization ability in traditional medical image segmentation. Through its automated configuration and training mechanism, nnunet can automatically adjust the network structure and training strategy according to different medical image datasets, thereby improving the model's segmentation performance and generalization ability, reducing manual intervention, and ensuring the accuracy and efficiency of left and right lung and lung segment segmentation.

[0031] CT imaging data refers to three-dimensional images of the lungs obtained through computed tomography (CT) scanning technology, which contain detailed anatomical information about the lung tissue.

[0032] The left and right lung segmentation model is a trained deep learning model whose function is to identify and distinguish the left and right lung regions in CT image data.

[0033] The left lung segmentation model and the right lung segmentation model are models specifically designed for fine segmentation of their respective lung regions, capable of further subdividing the lung into eighteen anatomical lung segments.

[0034] Hierarchical post-processing correction is a multi-stage correction process that aims to eliminate erroneous regions in the initial lung segmentation results by progressively correcting from macro to micro levels, thereby improving the accuracy of the final segmentation results.

[0035] In step S1, CT image data can be acquired in various ways, such as directly retrieving it from the hospital's PACS system or manually importing DICOM format image files. The left and right lung segmentation model is a deep learning model built on the classic NNUNET segmentation network architecture. By learning from a large amount of labeled data, it can identify the left and right lung regions in CT image data. For example, this model can receive 3D CT image data as input and output a segmentation mask of the same size as the input image, where different pixel values ​​represent the left lung, right lung, or background region. Please refer to... Figure 3 ,Figure 3 This is a schematic diagram showing the segmentation results of the left and right lungs from CT image data, as shown in the left and right lung segmentation model.

[0036] In step S2, the segmentation results of the left and right lungs are corrected internally to obtain the corrected left and right lung regions. The purpose of the internal correction is to correct any erroneous connected regions or irregular regions that may exist in the initial segmentation results. For example, a connected component analysis method can be used to identify small connected regions in the segmentation results that do not belong to the main lung regions, and to determine their affiliation based on their contact area or geometric distance from the main region, thereby eliminating missegmentation or undersegmentation.

[0037] In step S3, based on the corrected left and right lung regions, the CT image data is cropped to obtain separate processing regions for the left and right lungs, respectively. The purpose of region cropping is to separate the left and right lung regions from the complete CT image data, forming independent, smaller processing regions. For example, the minimum bounding rectangle containing each lung can be calculated based on the boundaries of the corrected left and right lung regions, and then the regions corresponding to these rectangles in the CT image data can be cropped. This cropping operation helps reduce the computational load of subsequent lung segmentation models and improves processing efficiency.

[0038] In step S4, the left lung segmentation model is used to segment the independently processed left lung region into left lung segments, and the right lung segmentation model is used to segment the independently processed right lung region into right lung segments, obtaining the initial lung segmentation results. The left and right lung segmentation models can be deep learning models specifically trained for their respective lung anatomy. For example, these models can be built based on the NUNET framework, learning from a large amount of labeled left and right lung segments to achieve refined segmentation of their respective independently processed regions. Each model receives a cropped unilateral lung region as input and outputs a segmentation mask containing multiple lung segment labels. Please refer to [reference needed]. Figure 4 , Figure 4 The top left image shows the minimum bounding rectangle of the left lung region cropped from CT image data; the top right image shows the minimum bounding rectangle of the right lung region cropped from CT image data; the bottom left image is a schematic diagram of the segmentation results from the left lung segmentation model; and the bottom right image is a schematic diagram of the segmentation results from the right lung segmentation model.

[0039] In step S5, the initial lung segmentation results are subjected to hierarchical post-processing correction to obtain the corrected lung segmentation results for eighteen lung segments. Hierarchical post-processing correction is a multi-level correction strategy aimed at further improving the accuracy of lung segmentation. For example, correction can first be performed at the lobe level, merging the initial lung segmentation results into the left and right lobes, and internal correction can be performed on these lobes to eliminate errors at the lobe level. Subsequently, external and internal corrections are performed on the lung segments within each lobe, processing lung segments that do not belong to the current lobe and erroneous connected regions of a certain type of lung segment within the current lobe, thereby obtaining the final corrected lung segmentation results for eighteen lung segments.

[0040] Traditional methods typically require the deployment of up to eight independent models, including left and right lung segmentation models, left and right lung lobe segmentation models, and lung segmentation models within five lobes. This not only leads to excessively long waiting times when implementing projects in practice, but also places high demands on hardware computing power, causing computing power shortages.

[0041] The proposed NNUNET-based lung segmentation and post-processing correction method works by employing a multi-stage, hierarchical processing flow to achieve precise segmentation and correction from macro to micro levels. First, a preliminary left and right lung region identification is performed on the CT image data using a left and right lung segmentation model, laying the foundation for subsequent refined processing. Then, the preliminary left and right lung segmentation results are internally corrected to ensure the accuracy and connectivity of the left and right lung regions, avoiding impact on subsequent processing due to initial segmentation errors. Based on the corrected left and right lung regions, the CT image data is cropped, decomposing the complex whole-lung segmentation task into relatively independent unilateral lung region segmentation tasks, significantly reducing the computational burden and training difficulty of subsequent models. Next, the left and right lung segmentation models are used respectively to perform fine segment-level segmentation on the cropped unilateral lung regions, obtaining the initial lung segmentation results. Finally, a hierarchical post-processing correction mechanism is introduced to progressively correct the initial lung segmentation results from lobes to segments, effectively eliminating problems such as missegmentation, undersegmentation, and irregular connected regions, thereby obtaining highly accurate lung segmentation correction results for the eighteen lung segments. The entire process is interconnected, with the output of the previous stage serving as the input for the next stage. Through iterative optimization, the accurate identification and segmentation of complex lung anatomical structures are ultimately achieved.

[0042] Furthermore, in step S1, the left and right lung segmentation model is a pre-trained lightweight left and right lung segmentation model. The steps for training the left and right lung segmentation model include: S11: Merge the lung segment labels of the left lung and the lung segment labels of the right lung to form a merged label; perform preliminary training on the left and right lung segmentation model based on the merged label; S12: Use the pre-trained left and right lung segmentation model to perform inference on the unlabeled image data and obtain preliminary segmentation results; S13: Manually correct the erroneous regions in the initial segmentation results, generate corrected label data, and merge the corrected label data with the original labeled data to form an extended dataset for training. S14: Reduce the depth and width of the left and right lung segmentation models and improve the spatial resolution of the image data processed by the left and right lung segmentation models; S15: Based on the expanded dataset, the reduced model structure, and the adjusted spatial resolution, the left and right lung segmentation model is trained to obtain a lightweight left and right lung segmentation model.

[0043] Specifically, in step S11, the original lung segment level labels are merged to generate binary or multi-valued merged labels that distinguish only the left and right lungs. For example, all left lung segment labels are merged into a "left lung" label, and all right lung segment labels are merged into a "right lung" label. Based on these merged labels, an initial left and right lung segmentation model is preliminarily trained to learn the basic features and boundaries of the left and right lung regions.

[0044] In step S12, the pre-trained left and right lung segmentation model is applied to a batch of image data that has not yet been manually labeled to generate preliminary left and right lung segmentation results. This step aims to leverage the model's initial learning capabilities to quickly generate a large number of potential training samples.

[0045] In step S13, the preliminary segmentation results obtained in step S12 are manually reviewed and corrected. This manual correction primarily targets erroneous regions in the initial segmentation, such as incorrectly identifying areas outside the lungs as lungs, or incorrectly segmenting non-lung tissues (such as blood vessels and trachea) inside the lungs as lungs. This manual correction generates high-quality, corrected labeled data. Subsequently, this corrected labeled data is merged with the original, manually labeled dataset to construct a larger, more accurate, and more diverse extended dataset for subsequent model refinement training.

[0046] In step S14, to achieve model lightweighting, the structure of the left and right lung segmentation model is adjusted. Specifically, the model's depth (i.e., the number of network layers) and width (i.e., the number of feature channels in each layer) are reduced. For example, the number of encoder and decoder layers can be reduced, and the number of channels in each feature map can be decreased. Simultaneously, to compensate for potential information loss due to model structural reduction and to ensure preservation of segmentation details, the spatial resolution of the image data processed by the left and right lung segmentation model is increased. This means that the CT image data input to the model is resampled to a higher resolution during the preprocessing stage, thereby providing the model with more refined image information.

[0047] In step S15, the left and right lung segmentation model is finally trained based on the expanded dataset constructed in step S13, the reduced model structure in step S14, and the adjusted spatial resolution. This training process aims to enable the reduced model to learn on a richer and more accurate dataset and to make full use of high-resolution image data, ultimately obtaining a lightweight left and right lung segmentation model that maintains high segmentation accuracy while having a small size and fast inference speed.

[0048] Through the above technical solution, this application obtains a lightweight left and right lung segmentation model, which significantly reduces the model size and computational complexity while maintaining or even improving segmentation accuracy. Therefore, in practical applications, it can greatly shorten the inference time for left and right lung segmentation and improve the overall processing efficiency of the method. Furthermore, because the model undergoes refined manual correction and expansion of the training data, the lightweight left and right lung segmentation model has stronger generalization ability and robustness, and can better adapt to CT image data from different devices and with different pathological features, thereby improving the overall accuracy and reliability of lung segmentation. This lightweight and high-performance characteristic makes the method easier to deploy in clinical environments with limited computing resources, and has higher practical value.

[0049] Furthermore, step S14 includes: S141: Reduce the depth of the left and right lung segmentation model to 4 layers, with feature depths of 16, 32, 64, and 128 for each layer; S142: Obtain the original feature depth. The original depth is 6 layers, and the original feature depth of each layer is 32, 64, 128, 256, 512, 512. S143: Use the first 4 layers with the original depth, and calculate the width reduction ratio by subtracting the corresponding feature depth of each layer from the original feature depth of each layer and then dividing by the original feature depth of each layer. Then reduce the width according to the width reduction ratio. S144: Improves the spatial resolution of the image data processed by the left and right lung segmentation model to 2mm.

[0050] Specifically, in step S141, the depth of the left and right lung segmentation model is set to 4 layers. This means that the encoder and decoder structure of the model will only contain 4 downsampling / upsampling levels. Meanwhile, the feature depths of each layer are specifically set to 16, 32, 64, and 128. These values ​​define the number of channels through which the model processes feature information at different levels; a smaller feature depth helps reduce the number of model parameters and computational complexity.

[0051] In step S142, the original feature depth is obtained, with an initial depth of 6 layers. The initial feature depths of each layer are 32, 64, 128, 256, 512, and 512, respectively. This initial feature depth is typically derived from a pre-trained or standard full-size model, such as the default configuration of NNUNet. Obtaining these initial parameters is for subsequent evidence-based reduction.

[0052] In practical applications, in step S143, the width reduction ratio is calculated by using the first four layers with the original depth and subtracting the corresponding feature depth of each layer from its original feature depth, then dividing by the original feature depth of that layer. For example, for the first layer, the width reduction ratio can be calculated as (32-16) / 32 = 0.5; for the second layer, (64-32) / 64 = 0.5; for the third layer, (128-64) / 128 = 0.5; and for the fourth layer, (256-128) / 256 = 0.5. Based on these calculated width reduction ratios, the width of the model is reduced accordingly. This ratio-based reduction method ensures that the model structure maintains a certain proportional relationship and feature extraction capability after reduction.

[0053] Furthermore, in step S144, the spatial resolution of the image data processed by the left and right lung segmentation model is increased to 2 mm. This means that the CT image data input into the model will be resampled or adjusted to an isotropic resolution of 2 mm. Increasing the spatial resolution helps the model obtain more accurate information when processing details, thereby compensating for the loss of detail that may be caused by the reduction in model depth and width, while maintaining computational efficiency.

[0054] This application's solution achieves a balance between model performance and computational efficiency by finely adjusting the depth, width, and spatial resolution of the input image data for the left and right lung segmentation model. Specifically, reducing the model depth to four layers and setting smaller feature depths (16, 32, 64, 128) significantly reduces the number of model parameters and computational complexity, thereby lowering the model's storage requirements and inference time. Simultaneously, by obtaining the original model's feature depth and calculating the width reduction ratio based on it, the core feature extraction capabilities of the model are maintained during width reduction, avoiding a sudden performance drop that might result from blind reduction. Furthermore, increasing the spatial resolution of the image data processed by the model to 2mm allows the model to receive richer detail information, which to some extent compensates for the potential loss of feature representation capabilities due to model structural simplification, especially crucial for the segmentation of fine lung structures. It is precisely this synergistic optimization of depth, width, and resolution that enables the trained lightweight left and right lung segmentation model to significantly improve its operational efficiency and deployment flexibility while maintaining high segmentation accuracy.

[0055] Furthermore, step S2 includes: S21: Perform connected component analysis on the segmentation results of the left and right lungs to identify the connected regions belonging to the left and right lungs; S22: For each left and right lung region, determine the connected region with the largest internal volume as the main region. When an erroneous connected region that does not belong to the main region is identified, calculate the contact area between the erroneous connected region and the main region. S23: If the difference in contact area between the faulty connected component and multiple main regions is less than a preset threshold, calculate the distance between the geometric center of the faulty connected component and the geometric center of multiple main regions, and assign the faulty connected component to the nearest main region. S24: Otherwise, assign the faulty connected domain to the principal region with the largest contact area to obtain the corrected left and right lung regions.

[0056] Specifically, in step S21, connected component analysis refers to using image processing algorithms, such as breadth-first search or depth-first search based on pixel adjacency, to identify sets of pixels with the same label that are interconnected as independent connected regions in the image. Its purpose is to structurally identify discrete or improperly connected regions in the initial left and right lung segmentation results, providing a basis for subsequent error region identification and correction.

[0057] In step S22, for each lung region (e.g., left or right lung region), the volume of all connected regions within it is calculated, and the connected region with the largest volume is determined as the "primary region" of that lung region. The primary region typically represents the main body of the lung. When erroneous connected regions that do not belong to the primary region are identified, such as small, isolated regions or regions not closely connected to the primary region, the contact area between these erroneous connected regions and the primary region needs to be calculated. The contact area can be understood as the number of pixels that are spatially adjacent or overlap between the erroneous connected region and the primary region, and its purpose is to quantify the spatial association strength between the erroneous connected region and the primary region.

[0058] In practical applications, in step S23, if the difference in contact area between the erroneous connected region and multiple main regions (e.g., the main regions of the left and right lungs) is less than a preset threshold, this indicates that the association strength between the erroneous connected region and the multiple main regions is similar, and it is difficult to accurately determine its affiliation based solely on the contact area. In this case, it is necessary to further calculate the distance between the geometric center of the erroneous connected region and the geometric centers of the multiple main regions. The geometric center can be understood as the centroid of the region, representing the spatial location of the region. By comparing the distances, the erroneous connected region is assigned to the nearest main region, the purpose of which is to use spatial geometric information for a more accurate affiliation determination. The preset threshold can be set according to the actual application scenario and experience, for example, it can be set as a certain percentage of the maximum contact area.

[0059] Furthermore, in step S24, if the difference in contact area between the erroneous connected component and multiple main regions is not less than a preset threshold, i.e., there exists a main region whose contact area with the erroneous connected component is significantly larger than that of other main regions, then the erroneous connected component is directly assigned to the main region with the largest contact area. This indicates that the erroneous connected component has a stronger spatial correlation with the main region with the largest contact area. Through the above processing, the corrected left and right lung regions can be obtained, ensuring that each pixel is accurately assigned to its corresponding lung region.

[0060] In some preferred embodiments, it is assumed that after segmenting the CT image data into left and right lungs, an initial lung segmentation result is obtained. In this result, in addition to the clearly defined main regions of the left and right lungs, an isolated erroneous connected component is also identified.

[0061] Specifically, in step S21, the system performs connected component analysis on the initial lung segmentation results to identify the main regions of the left lung, the main regions of the right lung, and the erroneous connected component.

[0062] In step S22, for the left lung region, the connected region with the largest internal volume is determined as the main region of the left lung; for the right lung region, the connected region with the largest internal volume is determined as the main region of the right lung. Subsequently, the contact area between the erroneous connected region and the main region of the left lung is calculated. Specifically, the method for calculating the contact area is to extract the boundary points of the erroneous connected region and determine the relationship between the six points (upper, lower, left, right, front, and back) of this boundary point and the tissue. Medical images (CT image data) are divided into coronal, sagittal, and transverse planes. If the upper or lower point of the boundary point is on the tissue, then the point and the tissue are in transverse plane contact; if the left or right point of the boundary point is on the tissue, it is in sagittal plane contact; if the point in front of or behind the boundary point is on the tissue, it is in coronal plane contact. The final contact surface area is calculated by the number of contact points between the erroneous connected region and the tissue in the coronal, sagittal, and transverse planes. For example, it is 50 pixels. Simultaneously, the contact area between the erroneous connected region and the main region of the right lung is calculated, for example, 45 pixels.

[0063] In step S23, it is determined whether the difference between the two contact areas (50-45=5 pixels) is less than a preset threshold (e.g., set to 10 pixels). Since 5 pixels is less than 10 pixels, it indicates that the contact intensity between the erroneous connected region and the main regions of the left and right lungs is similar, making it difficult to determine its classification based solely on the contact area. At this point, the system further calculates the distance between the geometric center of the erroneous connected region and the geometric center of the main region of the left lung (e.g., 15 mm), and the distance between the geometric center of the erroneous connected region and the geometric center of the main region of the right lung (e.g., 12 mm). Since 12 mm is less than 15 mm, the erroneous connected region is classified as the closest main region of the right lung.

[0064] As another specific implementation, suppose another erroneous connected component has a contact area of ​​80 pixels with the main region of the left lung and a contact area of ​​20 pixels with the main region of the right lung. In step S23, the difference in contact area (80-20=60 pixels) is greater than a preset threshold of 10 pixels. At this time, according to the logic of step S24, the erroneous connected component will be directly assigned to the main region of the left lung with the largest contact area.

[0065] Through the above examples, the solution of this application can intelligently determine the affiliation of erroneous connected components based on the contact area and geometric center distance between them and the main region, thereby effectively correcting errors in the initial lung segmentation results and ensuring the accuracy of the left and right lung regions.

[0066] Furthermore, step S3 includes: S31: Based on the corrected left and right lung regions, identify regions outside the left and right lungs in CT image data; S32: Set the pixel values ​​of the identified areas other than the left and right lungs to preset values ​​to eliminate interference; S33: After clearing interference, based on the corrected boundaries of the left and right lung regions, the smallest unilateral lung bounding rectangle containing the left and right lung regions is cropped from the CT image data to obtain the independent processing regions of the left and right lungs respectively.

[0067] Specifically, in step S31, based on the already corrected and clearly distinguished left and right lung regions, areas in the CT image data that do not belong to any lung can be accurately identified. These areas typically include the chest wall, heart, major blood vessels, spine, and other soft tissues. The identification process can be achieved by performing pixel-level analysis on the CT image data, marking pixels not covered by the left or right lung region labels as areas outside the left and right lungs.

[0068] In step S32, the pixel values ​​of the identified regions outside the left and right lungs are set to preset values. The purpose of this is to effectively mask these non-lung regions. These preset values ​​are typically chosen within the CT value range that do not represent any meaningful tissue, such as extremely low negative values ​​(e.g., -1000 HU, representing air) or a specific background value. In this way, non-lung regions can be effectively excluded from subsequent image processing and segmentation tasks, preventing them from interfering with the lung segmentation model.

[0069] In practical applications, in step S33, based on the corrected boundaries of the left and right lung regions, the smallest unilateral lung bounding rectangle containing both the left and right lung regions is cropped from the CT image data. Here, the "smallest unilateral lung bounding rectangle" refers to calculating the smallest axial bounding box for each lung separately. For example, for the left lung, a rectangle containing only the left lung and its immediate neighbors is calculated; for the right lung, a rectangle containing only the right lung and its immediate neighbors is calculated. Thus, independently processed regions for the left and right lungs can be obtained separately. This cropping method ensures that each lung region is extracted independently, providing a concise and focused input for subsequent unilateral lung segmentation.

[0070] The proposed method first identifies and masks non-lung regions, then performs precise unilateral cropping based on the corrected left and right lung region boundaries. This transforms the original CT image data into two independent processing regions, each containing only a single lung and its necessary surrounding information. This approach effectively isolates the left and right lungs and removes irrelevant background information, providing highly optimized input data for subsequent left and right lung segmentation models. Consequently, it ensures that each lung segmentation model focuses solely on its target lung, avoiding cross-lung interference and significantly reducing the model's processing complexity and computational cost.

[0071] Furthermore, step S5 includes: S51: Merge the initial lung segmentation results into the left lung lobe and the right lung lobe; S52: Perform internal correction on the left and right lobes of the lung to obtain the corrected left and right lobes of the lung. S53: Iterate through the corrected left and right lung lobes in sequence, and perform external and internal corrections on the lung segments within each lobe to obtain the lung segmentation and correction results for eighteen segments.

[0072] Specifically, in step S51, the merging operation can be understood as logically classifying or aggregating multiple lung segment labels belonging to the same lung lobe to form a higher-level anatomical region. For example, the left upper lobe can be formed by merging lung segments such as the apical-posterior segment, anterior segment, superior lingular segment, and inferior lingular segment of the left upper lobe. The purpose is to provide a macroscopic and anatomically more stable regional division for subsequent hierarchical correction, thereby enabling the handling of errors at the lung lobe level first and laying the foundation for subsequent lung segment level correction.

[0073] Furthermore, in step S52, internal correction aims to address potential segmentation errors within lung lobes, such as incorrectly including pixels that do not belong to the current lung lobe within the lobe region, or incorrectly excluding pixels that do belong to the current lung lobe. Specifically, internal correction may involve connected component analysis, morphological operations (such as opening and closing operations), or rule-based judgments based on anatomical prior knowledge to ensure the integrity and accuracy of each lung lobe region. Its purpose is to ensure the overall segmentation quality of the lung lobes before performing finer-grained lung segment correction, preventing lung lobe-level errors from propagating downwards.

[0074] Subsequently, in step S53, external correction primarily addresses lung segmentation errors that are incorrectly segmented outside the current lobe, or that incorrectly include lung segmentation regions not belonging to the current lobe within it. Internal correction focuses on resolving segmentation errors within a specific type of lung segment itself within the current lobe, such as cavities, discontinuities, or blurred boundaries with other lung segments within the same lobe. Through this phased external and internal correction, segmentation errors at the lung segment level can be systematically resolved, ultimately yielding a high-precision lung segmentation correction result for all eighteen lung segments.

[0075] In some preferred embodiments, a specific example is given below. Suppose that in the initial lung segmentation results, due to image noise or model recognition bias, the following errors occur: ① Some pixels belonging to the posterior segment of the left upper lobe were incorrectly classified as the left lower lobe.

[0076] ② There are some small, isolated pixel clusters inside the upper lobe of the left lung that do not belong to any lung segment.

[0077] ③ The boundary between the middle lobe of the right lung and the anterior segment of the upper lobe of the right lung is blurred, resulting in some pixels being incorrectly divided.

[0078] In view of the above situation, the specific implementation method of this application is as follows: First, in step S51, the initial lung segmentation results are merged. For example, the apical-posterior segment, anterior segment, superior lingular segment, and inferior lingular segment of the left upper lobe are merged into the left upper lobe; the dorsal segment, medial basal segment, anterior basal segment, lateral basal segment, and posterior basal segment of the left lower lobe are merged into the left lower lobe. Similarly, the lung segments of the right lung are merged into the right upper lobe, right middle lobe, and right lower lobe. Through this merging operation, the first error mentioned above (the apical-posterior segment pixel of the left upper lobe being incorrectly classified into the left lower lobe) manifests at the lobar level as the absence of the left upper lobe region and the abnormal expansion of the left lower lobe region.

[0079] Next, in step S52, internal corrections are performed on the merged left and right lobes. For example, for the left upper and lower lobes, through connected component analysis and morphological operations, erroneous pixels in the left lower lobe that originally belonged to the posterior segment of the left upper lobe can be identified and reassigned to the left upper lobe. Simultaneously, for isolated pixel clusters within the left upper lobe, if their volume is too small and they are not connected to any major lung segment region, they can be removed or merged into the nearest correct lung segment region, thus resolving the second error. This internal correction at the lobe level ensures the anatomical integrity and reasonable boundaries of each lobe region.

[0080] Finally, in step S53, the corrected left and right lung lobes are traversed sequentially, and external and internal corrections are performed on the lung segments within each lobe. For example, when processing the right middle lobe, external correction is performed first to identify and correct pixels that were incorrectly classified as belonging to the right middle lobe but actually belong to the anterior segment of the right upper lobe, thus resolving the third error. Subsequently, internal correction is performed to ensure the integrity and boundary clarity of each lung segment within the right middle lobe (such as the medial segment and the lateral segment). Through this hierarchical, lobe-first, segment-later correction strategy, segmentation errors at different levels can be systematically resolved, ultimately yielding a highly accurate lung segmentation correction result for the eighteen lung segments.

[0081] Furthermore, step S52 includes: S521: Identify faulty connected components in the left and right lobes of the lung; S522: Select an inter-regional correction strategy or an intra-regional correction strategy based on the positional relationship between the faulty connected component and the left or right lung lobe. Furthermore, the affiliation of the erroneous connected component is determined based on the contact area between the erroneous connected component and the correct region, thereby obtaining the corrected left and right lung lobes.

[0082] Specifically, in step S521, identifying erroneous connected components in the left and right lung lobes refers to using image processing techniques, such as connected component analysis, to detect and separate pixel sets that were incorrectly classified as being within the left or right lung lobe in the initial segmentation results, but which do not actually belong to that lobe. These erroneous connected components may manifest as isolated small regions, regions loosely connected to the main region, or other tissue structures incorrectly included within the lung lobe. The purpose is to accurately locate abnormal parts in the segmentation results, providing targets for subsequent correction operations.

[0083] In step S522, an inter-regional correction strategy or an intra-regional correction strategy is selected based on the positional relationship between the erroneous connected domain and the left or right lung lobe. Positional relationship can be understood as whether the erroneous connected domain is entirely within a lung lobe, partially within a lung lobe and adjacent to an external region, or the relative position of its geometric center to the main body of the lung lobe. Inter-regional correction strategies are typically used to handle erroneous connected domains that cross lung lobe boundaries or are in contact with adjacent lung lobes / tissues, aiming to correctly assign them to their proper region. Intra-regional correction strategies primarily handle erroneous connected domains entirely within a lung lobe, such as merging them into the main body of the lung lobe or removing them from the lung lobe. The purpose is to employ the most appropriate correction method based on the characteristics and location of the erroneous connected domain, thereby improving the accuracy of the correction.

[0084] The assignment of erroneous connected components is determined based on the contact area between them and correct regions. A correct region can refer to the main body of either the left or right lung lobe, or it can be an adjacent correctly segmented region. The contact area refers to the number of shared boundaries or adjacent pixels between an erroneous connected component and a correct region in three-dimensional space. By calculating and comparing the contact areas of erroneous connected components with different correct regions, the erroneous connected component can be assigned to the correct region with the largest contact area. For example, if the contact area of ​​an erroneous connected component with the main body of the left lung lobe is much larger than its contact area with the main body of the right lung lobe, then the erroneous connected component will be assigned to the left lung lobe. The purpose is to utilize spatial proximity and connectivity information to find the most reasonable assignment for erroneous connected components, thereby completing the internal correction of lung lobes.

[0085] This application's solution first identifies erroneous connected regions in the left and right lobes of the lung, ensuring the targeted nature of the correction operation. Then, based on the positional relationship between these erroneous connected regions and the main body of the lung lobe, it dynamically selects either an inter-regional correction strategy or an intra-regional correction strategy, allowing the correction process to flexibly adapt to different types of segmentation errors. Finally, by quantifying the contact area between erroneous connected regions and correct regions, it provides an objective basis for determining the attribution of erroneous connected regions, thereby effectively merging erroneous pixels into the correct lung lobe regions and achieving precise internal correction of the left and right lung lobes.

[0086] Furthermore, step S522 includes: S5221: Obtain the category label of the faulty connected component; S5222: Determine whether the category label is consistent with the expected anatomical category of the left or right lung lobe; S5223: Based on the consistency judgment of the category label, calculate the contact area between the erroneous connected component and the left or right lung lobe, or the largest internal connected component of the left or right lung lobe. S5224: Based on the consistency judgment results of the category labels, the contact area, and the main position of the erroneous connected domain, determine the positional relationship between the erroneous connected domain and the left or right lung lobe, and select an inter-regional correction strategy or an intra-regional correction strategy.

[0087] Specifically, in step S5221, the category label of the erroneous connected component refers to the category information of the lung segment or lobe to which the connected component belongs, as identified in the initial lung segmentation results. For example, an erroneous connected component may be incorrectly labeled by the initial segmentation model as a segment of the left upper lobe, when in fact it may belong to the right lung. Obtaining this category label helps to initially determine its affiliation tendency.

[0088] In step S5222, determining whether the category label is consistent with the expected anatomical category of the left or right lung lobe involves comparing the category label of the obtained erroneous connected component with the anatomical definition of the currently processed left or right lung lobe. For example, if the currently processed segment is the upper lobe of the left lung, but the category label of the erroneous connected component indicates that it belongs to the middle lobe of the right lung, then it is determined to be inconsistent. This determination aims to utilize prior anatomical knowledge to verify the rationality of the segmentation result.

[0089] In step S5223, based on the consistency judgment result of the category label, the contact area between the erroneous connected region and the left or right lung lobe or its largest internal connected region is calculated. Specifically, if the category label is consistent with the expected anatomical category, the contact area between the erroneous connected region and the main region of the current lung lobe (i.e., the largest internal connected region) is calculated; if the category labels are inconsistent, it may be necessary to calculate the contact area between the erroneous connected region and the current lung lobe and other adjacent lung lobes in order to subsequently determine its true affiliation. The size of the contact area reflects the degree of physical connectivity between the erroneous connected region and the surrounding area.

[0090] In step S5224, based on the consistency judgment result of the category labels, the contact area, and the main position of the erroneous connected region, the positional relationship between the erroneous connected region and the left or right lung lobe is determined, and an inter-regional correction strategy or an intra-regional correction strategy is selected. Here, the main position refers to the coordinates of the geometric center or the main part of the erroneous connected region in three-dimensional space. For example, if the category labels are consistent, the contact area is large, and the main position is located inside the current lung lobe, an intra-regional correction strategy is preferred; if the category labels are inconsistent, the contact area is small, and the main position is significantly deviated from the current lung lobe, an inter-regional correction strategy is preferred. By combining this information, it is possible to more accurately determine whether the erroneous connected region is a segmentation error within the current lung lobe or a confusion with other lung lobes or external regions.

[0091] Furthermore, in step S53, external correction is used to process lung segments that do not belong to the current lung lobe, and internal correction is used to process erroneous connected regions of a certain type of lung segment within the current lung lobe. Step S53 includes: S531: Obtain the connected component labels of the left and right lung lobes; S532: Iterate through the connected component labels of the left and right lobes of the lung in sequence, and determine whether the category of the connected component label of the lung segment is consistent with that of the current lung lobe. If they are inconsistent, perform external correction on the lung segment. S533: Calculate the contact area between the externally corrected lung segment and the current main lung lobe region or the largest connected region of the same category, perform internal correction based on the contact area, and obtain the lung segmentation correction result of eighteen segments.

[0092] Specifically, the external correction aims to correct situations where lung segments are incorrectly assigned to lobes that do not belong to them. For example, if a lung segment's segmentation results show it as being located in the left upper lobe, but its anatomical label or major connectivity region clearly indicates it belongs to the right middle lobe, then that lung segment will be identified as requiring external correction. The internal correction focuses on addressing incorrectly connected regions within the current lobe that are incorrectly identified as belonging to a specific lung segment within that lobe. For example, a lung segment may contain small, discontinuous clusters of pixels that are incorrectly labeled as part of that segment; in such cases, internal correction is needed to eliminate these internal inconsistencies.

[0093] In step S531, the connected component labels of the left and right lung lobes are processed. This typically involves performing connected component analysis on all pixels within each lobe, assigning a unique label to each individual connected region, and recording its corresponding lung segment category. This process aims to provide a refined region identification basis for subsequent corrections.

[0094] In step S532, the system sequentially traverses the connected component labels of the left and right lung lobes. For each traversed lung segment, the system determines whether the category of its connected component label matches the category of the connected component label of the current lung lobe. For example, if the current processing is of the left upper lobe, but the connected component label of a lung segment indicates that it belongs to the right lower lobe, then the categories are considered inconsistent. If the determination result is inconsistent, external correction is performed on the lung segment. The specific implementation of external correction may include modifying the label of the lung segment to the correct lung lobe label, or removing it from the current lung lobe and reassigning it to the appropriate lung lobe to ensure the correct classification of the lung segment.

[0095] In step S533, the contact area between the externally corrected lung segment and the current main lung lobe region or the largest connected region of the same category is calculated. The current main lung lobe region can be understood as the largest connected region within the lung lobe after preliminary correction. The largest connected region of the same category refers to the largest connected region within the current lung lobe that has the same category label as the lung segment to be corrected. By calculating the contact area, the spatial proximity and connection strength between the lung segment to be corrected and the correct region can be quantified. Subsequently, internal correction is performed based on the contact area. Internal correction can merge small, isolated erroneous connected regions into the correct region with the largest contact area, or remove them from the segmentation result, based on the size of the contact area, thereby obtaining a more accurate lung segmentation and correction result.

[0096] Please refer to Figure 2 A lung segmentation and post-processing correction system based on NNUNET, used to implement any of the above methods, the system includes: First segmentation module 201: Acquires CT image data and uses a left and right lung segmentation model to segment the CT image data into left and right lungs, and obtains the left and right lung segmentation results; First correction module 202: Performs internal correction of the left and right lung segmentation results to obtain the corrected left and right lung regions; Cropping module 203: Based on the corrected left and right lung regions, the CT image data is cropped to obtain the left and right lung independent processing regions respectively; Second segmentation module 204: Use the left lung segmentation model to segment the left lung independent processing area into left lung segments, and use the right lung segmentation model to segment the right lung independent processing area into right lung segments, to obtain the initial lung segmentation results; Second correction module 205: Performs hierarchical post-processing correction on the initial lung segmentation results to obtain the corrected lung segmentation results for the eighteen lung segments.

[0097] The system of this application adopts a modular design, with each key step in the lung segmentation and post-processing correction method implemented by a corresponding functional module. Specifically, the first segmentation module 201 is responsible for the initial left and right lung segmentation, providing basic data for subsequent processing; the first correction module 202 refines the preliminary segmentation results to ensure the accuracy of the left and right lung regions; the cropping module 203, based on this, divides the entire CT image data into independent left and right lung processing regions, avoiding interference between the left and right lungs and improving the efficiency and accuracy of subsequent lung segmentation; the second segmentation module 204 performs lung segment-level segmentation in parallel on the independent processing regions of the left and right lungs; finally, the second correction module 205 performs hierarchical post-processing on the initial lung segmentation results, further improving the accuracy and anatomical rationality of the segmentation results. Through this collaborative working method, the entire system can efficiently and accurately complete the lung segmentation and correction task.

[0098] The aforementioned system design enables the automated and efficient execution of the 18-segment lung segmentation and post-processing correction method. The modular design clearly defines the responsibilities of each processing step, facilitating system development, maintenance, and upgrades. Furthermore, the system provides an integrated solution, encapsulating the complex segmentation and correction process, offering a convenient and accurate lung image analysis tool for clinical applications, significantly improving diagnostic efficiency and accuracy.

[0099] In this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying any such actual relationship or order between these entities or operations.

[0100] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A lung eighteen segment segmentation and post-processing correction method based on nnunet, characterized in that, The method comprises the steps of: S1: acquiring CT image data, and performing left and right lung segmentation on the CT image data using a left and right lung segmentation model to obtain a left and right lung segmentation result; S2: performing left and right lung internal correction on the left and right lung segmentation result to obtain a corrected left lung region and a corrected right lung region; S3: performing region cropping on the CT image data based on the corrected left lung region and the corrected right lung region to obtain a left lung independent processing region and a right lung independent processing region, respectively; S4: performing left lung segment segmentation on the left lung independent processing region using a left lung segment segmentation model, and performing right lung segment segmentation on the right lung independent processing region using a right lung segment segmentation model to obtain an initial lung segment segmentation result; S5: performing hierarchical post-processing correction on the initial lung segment segmentation result to obtain a lung eighteen segment segmentation correction result.

2. The nnunet-based lung eighteen-segment segmentation and post-processing correction method of claim 1, wherein, In step S1, the left and right lung segmentation model is a pre-trained lightweight left and right lung segmentation model, and the steps for training the left and right lung segmentation model comprise: S11: merging the lung segment labels of the left lung and the lung segment labels of the right lung to form merged labels, and performing preliminary training on the left and right lung segmentation model based on the merged labels; S12: using the preliminarily trained left and right lung segmentation model to infer unannotated image data to obtain a preliminary segmentation result; S13: manually correcting error regions in the preliminary segmentation result to generate corrected label data, combining the corrected label data with original annotation data to form an extended data set for training; S14: reducing the depth and width of the left and right lung segmentation model and increasing the spatial resolution of image data processed by the left and right lung segmentation model; S15: training the left and right lung segmentation model based on the extended data set, the reduced model structure, and the adjusted spatial resolution to obtain the lightweight left and right lung segmentation model.

3. The nnunet-based lung eighteen-segment segmentation and post-processing correction method of claim 2, wherein, Step S14 comprises: S141: reducing the depth of the left and right lung segmentation model to 4 layers, and the feature depth of each layer is 16, 32, 64, and 128; S142: obtaining an original feature depth, and the original depth is 6 layers, and the original feature depth of each layer is 32, 64, 128, 256, 512, and 512; S143: using the first 4 layers of the original depth, and calculating the width reduction ratio by subtracting the feature depth of each layer from the original feature depth of each layer and dividing by the original feature depth of each layer, and reducing the width according to the width reduction ratio; S144: increasing the spatial resolution of image data processed by the left and right lung segmentation model to 2mm.

4. The nnunet-based lung eighteen-segment segmentation and post-processing correction method of claim 1, wherein, Step S2 comprises: S21: performing connected component analysis on the left and right lung segmentation result to identify each connected region belonging to the left lung and the right lung; S22: for each left and right lung region, determining the connected region with the largest internal volume as the main region, and when an error connected domain that does not belong to the main region is identified, calculating the contact area between the error connected domain and the main region; S23: If the contact area difference between the error connected domain and the plurality of main regions is less than a preset threshold, calculate the distance between the geometric center of the error connected domain and the geometric center of the plurality of main regions, and attribute the error connected domain to the main region closest to it; S24: Otherwise, attribute the error connected domain to the main region with the largest contact area to obtain the corrected left lung region and right lung region.

5. The nnunet-based lung eighteen-segment segmentation and post-processing correction method of claim 1, wherein, Step S3 comprises: S31: Based on the corrected left lung region and right lung region, identify the region other than the left and right lungs in the CT image data; S32: Set the pixel value of the identified region other than the left and right lungs to a preset value to remove interference; S33: After removing interference, according to the boundary of the corrected left lung region and right lung region, crop a minimum single lung external rectangle frame containing the left lung region and right lung region from the CT image data to obtain the left lung independent processing region and the right lung independent processing region respectively.

6. The nnunet-based lung eighteen-segment segmentation and post-processing correction method of claim 1, wherein, Step S5 comprises: S51: Merge the initial lung segment segmentation results into left lung lobes and right lung lobes; S52: Perform internal correction on the left lung lobes and right lung lobes to obtain corrected left lung lobes and right lung lobes; S53: Traverse the corrected left lung lobes and right lung lobes in turn, and perform external correction and internal correction on the lung segments in each lobe to obtain lung eighteen segment segmentation correction results.

7. The nnunet-based lung eighteen-segment segmentation and post-processing correction method of claim 6, wherein, Step S52 comprises: S521: Identify the error connected domain in the left lung lobe and the right lung lobe; S522: According to the position relationship between the error connected domain and the left lung lobe or right lung lobe, select an inter-regional correction strategy or an intra-regional correction strategy; And according to the contact area between the error connected domain and the correct region, determine the attribution of the error connected domain, thereby obtaining the corrected left lung lobe and right lung lobe.

8. The nnunet-based lung eighteen-segment segmentation and post-processing correction method of claim 7, wherein, Step S522 comprises: S5221: Obtain the category label of the error connected domain; S5222: Determine whether the category label is consistent with the expected anatomical category of the left lung lobe or right lung lobe; S5223: According to the result of the consistency judgment of the category label, calculate the contact area between the error connected domain and the left lung lobe or right lung lobe, or the largest connected domain inside the left lung lobe or right lung lobe; S5224: According to the consistency judgment result of the category label, the contact area and the main position of the error connected domain, determine the position relationship between the error connected domain and the left lung lobe or right lung lobe, and select an inter-regional correction strategy or an intra-regional correction strategy.

9. The nnunet-based lung eighteen-segment segmentation and post-processing correction method of claim 6, wherein, In step S53, the external correction is used to process lung segments that do not belong to the current lobe, and the internal correction is used to process error connected domains of a certain type of lung segments in the current lobe, and step S53 comprises: S531: Obtain the connected domain label of the left lung lobe and the right lung lobe; S532: Traverse the connected domain labels of the left lung lobe and the right lung lobe in turn, and determine whether the category of the lung segment is consistent with the connected domain label of the current lobe, if not, perform external correction on the lung segment; S533: Calculate the contact area between the lung segment after external correction and the current lung lobe main region or the maximum connected domain of the same category, perform internal correction according to the contact area, and obtain the lung eighteen segment segmentation correction result.

10. A nnunet-based lung eighteen-segment segmentation and post-processing correction system, characterized in that, The system is used for implementing the method in any one of claims 1-9, and the system comprises: A first segmentation module: acquiring CT image data, and performing left and right lung segmentation on the CT image data by using a left and right lung segmentation model to obtain left and right lung segmentation results; A first correction module: performing internal correction on the left and right lung segmentation results to obtain corrected left lung regions and right lung regions; A cropping module: performing region cropping on the CT image data based on the corrected left lung regions and right lung regions to obtain left lung independent processing regions and right lung independent processing regions respectively; A second segmentation module: performing left lung segment segmentation on the left lung independent processing regions by using a left lung segment segmentation model, and performing right lung segment segmentation on the right lung independent processing regions by using a right lung segment segmentation model to obtain initial lung segment segmentation results; A second correction module: performing hierarchical post-processing correction on the initial lung segment segmentation results to obtain lung eighteen segment segmentation correction results.