A method for lung image classification based on deep learning segmentation of trachea
By constructing a segmentation and classification network and using deep learning to segment the tracheal structure, combined with lung CT images, the problems of low efficiency and insufficient accuracy in lung image classification in existing technologies are solved, achieving more efficient and accurate lung image classification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2026-03-10
AI Technical Summary
Existing technologies, especially deep learning-based methods, struggle to effectively utilize the tracheal structure for accurate lung image classification, and manual segmentation is inefficient, impacting overall classification accuracy.
A deep learning-based segmentation module is used to extract the tracheal tree of the lungs. Combined with lung CT images, the lung images are classified through an image classification module. A segmentation and classification network is constructed, including encoder and decoder, residual block and attention mechanism block. The tracheal segmentation results are used to assist image classification.
It improves the accuracy and efficiency of lung image classification. By integrating tracheal structural features, it enhances the network's discriminative power and improves classification accuracy.
Smart Images

Figure CN119540615B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence technology, specifically relating to a method for lung image classification based on deep learning segmentation of the trachea, which is suitable for lung image classification. Background Technology
[0002] Pulmonary function tests (PFTs) are essential examinations of the respiratory system. However, these tests require repeated forceful breathing, which may cause shortness of breath, dizziness, or even worsen existing breathing difficulties. Furthermore, factors such as the subject's age and gender can introduce errors into the PFT results.
[0003] Besides pulmonary function tests (PFTs), lung imaging is also a major method for lung examination. Common lung imaging methods include X-ray examination, computed tomography (CT), and magnetic resonance imaging (MRI). However, due to the unique structure of the lung cavity and the extensive distribution of small tracheas and alveoli, manual lung image classification faces significant challenges. With the development of deep learning technology, lung image classification based on deep learning has become possible. Deep learning methods for lung image classification mainly rely on feature extraction using convolutional neural networks (CNNs) and graph convolutional neural networks (GCNs). By training on a large amount of lung image data, the classification network can learn the feature representations of lung structures such as trachea, thereby achieving an automated image classification process. Numerous experimental results show that deep learning-based lung image classification methods have high accuracy and are more efficient than manual observation and classification.
[0004] Weikert et al. used the U-Net network model to automatically quantify airway wall thickness on chest CT images and evaluate its performance for lung image classification. Sun et al. developed and validated a CT-DL method using highly heterogeneous Chinese population cohort data. They used a deep residual neural network ResNet18 for feature extraction, a multiple-instance learning (MIL) model based on an attention mechanism for data classification, and finally trained an end-to-end deep learning model to identify cue radiographic features for lung image classification. Wu et al. used multi-view... Figure 2This study integrates 3D snapshots and deep convolutional neural networks to represent the three-dimensional airway and lung field for lung image classification. Existing research primarily focuses on using CT data to classify lung images based on changes in lung parenchyma contours and tracheal details in 2D slices, rarely incorporating lung and tracheal structure. Furthermore, most classification networks require manual segmentation of the lung parenchyma or tracheal walls in the initial stages, resulting in low overall efficiency and impacting final classification accuracy. Summary of the Invention
[0005] The purpose of this invention is to address the aforementioned problems in the existing technology by proposing a method for lung image classification based on deep learning segmentation of the trachea. This method utilizes a segmentation module to extract the tracheal tree, observes changes in the overall airway structure, and combines lung CT images with an image classification module to classify the lung images.
[0006] The above-mentioned objective of the present invention is achieved through the following technical solution:
[0007] A method for lung image classification based on deep learning segmentation of the trachea includes the following steps:
[0008] Step 1: Perform training label creation and preprocessing on the original lung CT images in sequence. The training labels include tracheal segmentation labels and lung classification labels. Take the preprocessed lung CT image corresponding to one original lung CT image and the corresponding training label as a sample, and divide multiple samples into the training set.
[0009] Step 2: Construct a segmentation and classification network, which includes one segmentation module and one image classification module;
[0010] The preprocessed lung CT image is input into the segmentation module to obtain the trachea segmentation result. The trachea segmentation result and the preprocessed lung CT image are input into the image classification module to obtain the lung image classification result.
[0011] Step 3: Define the network loss function. The network loss function is divided into the segmentation module loss function L. s And the image classification module loss function L c ;
[0012] Step 4: Based on the network loss function, train the segmentation and classification network using the training set, and save the parameters of the trained segmentation and classification network.
[0013] Step 5: Input the lung CT image to be processed into the segmentation module of the trained segmentation and classification network to obtain the corresponding trachea segmentation result; input the lung CT image to be processed and the corresponding trachea segmentation result into the image classification module of the trained segmentation and classification network to obtain the corresponding lung image classification result.
[0014] As mentioned above, the segmentation module consists of two parts: an encoder and a decoder.
[0015] The encoder includes downsampling modules; each downsampling module includes convolutional layers and pooling layers, and each convolutional layer is followed by a ReLU activation function;
[0016] The decoder consists of an upsampling module and an output layer; each upsampling module includes an upsampling layer, a convolutional layer, and a ReLU activation function in sequence; the output layer includes a convolutional layer and a Sigmoid activation function in sequence.
[0017] The number of downsampling modules is equal to the number of upsampling modules, and skip connections are made between the downsampling modules and the corresponding upsampling modules.
[0018] As mentioned above, the image classification module includes two classification sub-modules and a Softmax classifier.
[0019] The preprocessed lung CT image is used as the input to the first classification submodule, and the tracheal segmentation result is used as the input to the second classification submodule.
[0020] Each classification submodule includes a residual block and an attention mechanism block. The output feature images of the attention mechanism blocks in the two classification submodules are added together, and then the lung image classification result is output through the Softmax classifier.
[0021] As described above, the segmentation module loss function L s for:
[0022] L s =-(y t log(y p )+(1-y t log(1-y) p ))
[0023] Among them, y t To determine the values of the tracheal segmentation labels for voxels in the training set, y t ∈{0,1};y p This represents the probability that a voxel in the trachea segmentation result obtained by the segmentation module is a positive example.
[0024] As described above, the image classification module loss function L c for:
[0025]
[0026] Where N is the number of samples input into the image classification module in each training iteration, and y i For lung classification labels, p i This represents the probability value of the classification prediction obtained by the image classification module as a positive example, and i represents the index of the sample in each training iteration, i∈{1,2,…N}.
[0027] Each residual block as described above includes a first path and a second path. In each residual block:
[0028] The first path includes multiple convolutional layers. In the first path, except for the last convolutional layer, each convolutional layer is followed by a ReLU activation function and a batch normalization layer. In the first path, a batch normalization layer is added after the last convolutional layer.
[0029] The second path consists of one convolutional layer and one batch normalization layer.
[0030] The output feature image of the second path is added to the output feature image of the first path, and then passed through a ReLU activation function to obtain the output feature image of the corresponding residual block.
[0031] The attention mechanism block described above includes, in sequence, a first convolutional layer, an average pooling layer, a first fully connected layer, a ReLU activation function, a second fully connected layer, and a Tanh activation function. The output feature image of the Tanh activation function is added to the output feature image of the first convolutional layer of the attention mechanism block to obtain a concatenated feature image. The concatenated feature image is then passed through the second convolutional layer of the attention mechanism block to obtain a feature image, which is then added to the concatenated feature image to obtain the output feature image of the attention mechanism block.
[0032] As described above, step 4 involves training the segmentation and classification network using the training set. The specific steps are as follows:
[0033] The segmentation module is trained using the training set;
[0034] After the segmentation module is trained, the preprocessed lung CT images from the training set are sequentially input into the trained segmentation module to obtain the corresponding trachea segmentation results.
[0035] The image classification module is trained using preprocessed lung CT images and corresponding tracheal segmentation results from the training set.
[0036] A computer device includes a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement steps 2-5 of the classification method as described above.
[0037] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements steps 2-5 of the classification method as described above.
[0038] Compared with the prior art, the present invention has the following advantages:
[0039] 1. This invention obtains the tracheal structure of a subject by segmenting the trachea in lung CT images, and assists the image classification module in classifying lung images based on changes in the overall structure, further improving the accuracy of image classification; while using deep learning methods to extract tracheal structures during segmentation, this method further improves the efficiency of the overall network compared to manual annotation methods.
[0040] 2. In constructing the segmentation and classification network, this invention introduces an attention mechanism into the traditional classification network architecture, which further enhances the most discriminative features, thereby improving the overall accuracy of network classification. Attached Figure Description
[0041] Figure 1 This is a flowchart of the present invention;
[0042] Figure 2 This is a schematic diagram of the segmentation module of the present invention, wherein... Indicates downsampling, Indicates upsampling, Indicates a skip connection;
[0043] Figure 3a This is a schematic diagram of the image classification module of the present invention;
[0044] Figure 3b This is a schematic diagram of the attention mechanism block in the image classification module of the present invention;
[0045] Figure 4a The lung and trachea segmentation result shown in the diagram is a positive example of lung and trachea segmentation result obtained by the segmentation module in this embodiment of the invention.
[0046] Figure 4b The image shows a negative example of lung and trachea segmentation results obtained by the segmentation module in an embodiment of the present invention. Detailed Implementation
[0047] To facilitate understanding and implementation of the present invention by those skilled in the art, the following description, in conjunction with embodiments and... Figure 1 -4 provides a further detailed description of the present invention. It should be understood that the embodiments described herein are for illustrative and explanatory purposes only and are not intended to limit the scope of the invention.
[0048] Example 1
[0049] A method for lung image classification based on deep learning segmentation of the trachea includes the following steps:
[0050] Step 1: Perform training label creation and preprocessing on the original lung CT images in sequence. The training labels include tracheal segmentation labels and lung classification labels. Take the preprocessed lung CT image corresponding to an original lung CT image and the corresponding training label as a sample, and divide the sample into training set and test set.
[0051] In this embodiment, 20 original lung CT images were selected. Then, 3D annotation of the tracheal region of the lung was performed on the selected original lung CT images (which can be done using Mimics software) to obtain the tracheal segmentation label and lung classification label used in the experiment. Finally, the selected original lung CT images were preprocessed by data normalization, cropping, and uniform image size to reduce the differences between the preprocessed lung CT images. The preprocessed lung CT image corresponding to one original lung CT image was used as a sample, and all samples were divided into training and test sets at a ratio of 4:1.
[0052] Step 2: Construct a segmentation and classification network for trachea segmentation and lung image classification in preprocessed lung CT images. The segmentation and classification network of this invention includes one segmentation module and one image classification module, such as... Figure 1 As shown.
[0053] The preprocessed lung CT image is input into the segmentation module to obtain the trachea segmentation result. The trachea segmentation result and the preprocessed lung CT image are input into the image classification module to obtain the lung image classification result.
[0054] (1) Segmentation Module
[0055] The segmentation module consists of two parts: an encoder and a decoder.
[0056] The encoder includes downsampling modules; each downsampling module includes convolutional layers and pooling layers, and each convolutional layer is followed by a ReLU activation function;
[0057] The decoder consists of an upsampling module and an output layer; each upsampling module includes an upsampling layer, a convolutional layer, and a ReLU activation function in sequence; the output layer includes a convolutional layer and a Sigmoid activation function in sequence.
[0058] The number of downsampling modules is equal to the number of upsampling modules, and skip connections are made between the downsampling modules and the corresponding upsampling modules.
[0059] In this example, the segmentation module is based on a typical U-Net network architecture, including one encoder and one decoder, as shown in the following structure. Figure 2 As shown;
[0060] The encoder consists of four downsampling modules; each downsampling module consists of two convolutional layers and one pooling layer, with a ReLU activation function following each convolutional layer.
[0061] The decoder consists of four upsampling modules and one output layer; each upsampling module includes one upsampling layer, two convolutional layers, and a ReLU activation function; the output layer includes one convolutional layer and one Sigmoid activation function.
[0062] When the preprocessed lung CT image is input into the segmentation module, it sequentially passes through four downsampling modules. Within each downsampling module, the image passes through a first convolutional layer with a 3×3×3 kernel, a first ReLU activation function, a second convolutional layer with a 3×3×3 kernel, a second ReLU activation function, and then a 2×2×2 pooling layer. The initial data input to the encoder (i.e., the preprocessed lung CT image) has 16 channels; after each downsampling module, the number of channels in the feature image doubles.
[0063] The output feature image from the encoder is input into the decoder, passing through four upsampling modules sequentially. Within each upsampling module, the image passes through a 2×2×2 upsampling layer, followed by a first convolutional layer with a 3×3×3 kernel, a first ReLU activation function, a second convolutional layer with a 3×3×3 kernel, and a second ReLU activation function. The feature image input to the decoder has 256 channels; after each upsampling module, the number of channels is halved. Finally, the output feature image from the fourth upsampling module is input into the output layer, passing through a 1×1×1 convolutional layer and a Sigmoid activation function to obtain the trachea segmentation result.
[0064] (2) Image classification module
[0065] The image classification module includes two classification sub-modules and a Softmax classifier. The preprocessed lung CT image is used as the input to the first classification sub-module, and the trachea segmentation result is used as the input to the second classification sub-module. Each classification sub-module includes a residual block and an attention mechanism block in sequence. The output feature images of the attention mechanism blocks in the two classification sub-modules are added (element-by-element addition), and then the lung image classification result is output through the Softmax classifier.
[0066] In this embodiment, the image classification module includes two classification sub-modules and a Softmax classifier. Each of the two classification sub-modules includes eight residual blocks and one attention mechanism block, as shown in Figure 3.
[0067] The preprocessed lung CT image serves as the input to the first classification submodule, and the trachea segmentation result serves as the input to the second classification submodule. For each classification submodule, the input is first processed through eight residual blocks for feature extraction, then enhanced by an attention mechanism block. Finally, the output feature images from the attention mechanism blocks of the two classification submodules are added together, and then a Softmax classifier is used for final judgment to output the lung image classification result. The specific process is as follows:
[0068] (2.1) The input of each classification submodule is first processed through 8 residual blocks for feature extraction.
[0069] Each residual block includes path 1 and path 2. Within each residual block,
[0070] The first path includes multiple convolutional layers. In the first path, except for the last convolutional layer, each convolutional layer is followed by a ReLU activation function and a batch normalization layer. In the first path, a batch normalization layer is added after the last convolutional layer.
[0071] The second path consists of one convolutional layer and one batch normalization layer.
[0072] The output feature image of the second path is added to the output feature image of the first path (element-by-element addition), and then passed through a ReLU activation function to obtain the output feature image of the corresponding residual block.
[0073] In this embodiment, each residual block includes 4 convolutional layers, 3 ReLU activation functions, and 4 batch normalization layers;
[0074] In the first residual block: The first residual block includes the first path and the second path. The input of the classification submodule passes through the first path and the second path respectively. In the first path of the first residual block: The input of the classification submodule passes through three convolutional layers in sequence. The kernel sizes of the three convolutional layers are 1×1, 3×3, and 1×1, and the number of channels are 64, 64, and 256 respectively. A ReLU activation function and a batch normalization layer are added after the first and second convolutional layers, and a batch normalization layer is added after the third convolutional layer. In the second path of the first residual block: The classification... The input to the submodule passes through a convolutional layer with a kernel size of 1×1 and 256 channels sequentially from the second path, and then through a batch normalization layer. After that, the output feature image from the second path of the first residual block is added to the output feature image from the first path of the first residual block, and then passed through the third ReLU activation function in the first residual block to obtain the output feature image of the first residual block. The output feature image of the first residual block is input into the second residual block and output after passing through the second residual block. The overall structure of the second residual block is the same as that of the first residual block.
[0075] In the third residual block: the output feature image from the second residual block is input into the third residual block. The third residual block includes the first path and the second path. When the output feature image from the second residual block is input into the third residual block, it passes through the first path and the second path respectively. In the first path of the third residual block: the output feature image from the second residual block passes through three convolutional layers in sequence. The kernel sizes of the three convolutional layers are 1×1, 3×3, and 1×1, and the number of channels are 128, 128, and 512, respectively. A ReLU activation function and a batch normalization layer are added sequentially after the first and second convolutional layers. A third convolutional layer is followed by... Add one batch normalization layer; in the second path of the third residual block: the output feature image of the second residual block will pass through a convolutional layer with a kernel size of 1×1 and 512 channels, and then through one batch normalization layer; after that, the output feature image of the second path of the third residual block is added to the output feature image of the first path of the third residual block, and then passed through the third ReLU activation function in the third residual block to obtain the output feature image of the third residual block; the output feature image of the third residual block is input into the fourth residual block, and output after passing through the fourth residual block, while the overall structure of the fourth residual block is the same as that of the third residual block.
[0076] In the 5th residual block: the output feature image from the 4th residual block is input into the 5th residual block. The 5th residual block includes the 1st path and the 2nd path. When the output feature image from the 4th residual block is input into the 5th residual block, it passes through the 1st path and the 2nd path respectively. In the 1st path of the 5th residual block: the output feature image from the 4th residual block passes through 3 convolutional layers in sequence. The kernel sizes of the 3 convolutional layers are 1×1, 3×3, and 1×1, and the number of channels are 256, 256, and 1024, respectively. A ReLU activation function and a batch normalization layer are added sequentially after the 1st and 2nd convolutional layers. A... Add one batch normalization layer; in the second path of the 5th residual block: the output feature image of the 4th residual block will pass through a convolutional layer with a kernel size of 1×1 and 1024 channels sequentially from the second path, and then through one batch normalization layer; after that, the output feature image of the 5th residual block is added to the output feature image of the 5th residual block through the second path and the output feature image of the 5th residual block through the first path, and then passed through the third ReLU activation function in the 5th residual block to obtain the output feature image of the 5th residual block; the output feature image of the 5th residual block is input into the 6th residual block, and output after passing through the 6th residual block. The overall structure of the 6th residual block is the same as that of the 5th residual block.
[0077] In the 7th residual block: the output feature image from the 6th residual block is input into the 7th residual block. The 7th residual block includes the 1st path and the 2nd path. When the output feature image from the 6th residual block is input into the 7th residual block, it passes through the 1st path and the 2nd path respectively. In the 1st path of the 7th residual block: the output feature image from the 6th residual block passes through 3 convolutional layers in sequence. The kernel sizes of the 3 convolutional layers are 1×1, 3×3, and 1×1, and the number of channels are 512, 512, and 2048, respectively. A ReLU activation function and a batch normalization layer are added sequentially after the 1st and 2nd convolutional layers. A... Add one batch normalization layer; in the second path of the 7th residual block: the output feature image of the 6th residual block will pass through a convolutional layer with a kernel size of 1×1 and 512 channels sequentially from the second path, and then through one batch normalization layer; after that, the output feature image of the 7th residual block is added to the output feature image of the 7th residual block through the first path, and then passed through the third ReLU activation function in the 7th residual block to obtain the output feature image of the 7th residual block; the output feature image of the 7th residual block is input into the 8th residual block, and output after passing through the 8th residual block, while the overall structure of the 8th residual block is the same as that of the 7th residual block.
[0078] The structures of each pair of residual blocks are exactly the same (including the number of channels). The only difference between the residual blocks numbered 1, 3, 5, and 7 is the number of channels in the convolutional layer.
[0079] (2.2) Identification of attention mechanism block enhancement features:
[0080] The output feature image after passing through the 8th residual block is input into the attention mechanism block for further feature extraction and enhancement. The attention mechanism block consists of 2 convolutional layers, 2 fully connected layers, 1 ReLU activation function, 1 Tanh activation function, and 1 average pooling layer. The feature image input to the attention mechanism block passes sequentially through the first convolutional layer, average pooling layer, first fully connected layer, ReLU activation function, second fully connected layer, and Tanh activation function. Then, the output feature image of the Tanh activation function is added to the output feature image of the first convolutional layer of the attention mechanism block to obtain the concatenated feature image. The concatenated feature image is then passed through the second convolutional layer of the attention mechanism block, and the resulting feature image is added to the concatenated feature image to obtain the output feature image of the attention mechanism block.
[0081] (2.3) Output lung image classification results:
[0082] The lung image classification result is obtained by adding the output feature image of the attention mechanism block of the first classification submodule to the output feature image of the attention mechanism block of the second classification submodule (element-by-element addition) and then passing it through the Softmax classifier.
[0083] Step 3: Define the network loss function; the network loss function consists of two parts, namely the segmentation module loss function L. s And the image classification module loss function L c .
[0084] Segmentation module loss function L s As shown in the following formula:
[0085] L s =-(y t log(y p )+(1-y t log(1-y) p ))
[0086] Among them, y t To determine the values of the tracheal segmentation labels for voxels in the training set, y t ∈{0,1}, for positive examples then y t The value is 1, and for negative cases, y is... t Setting the value to 0 makes the segmentation module loss function L s Suitable for evaluation of binary classification tasks; yp y represents the probability that a voxel in the trachea segmentation result obtained by the segmentation module is a positive example. If a voxel in the trachea segmentation result is a positive example, then y p The value is 1; otherwise, y p The value is 0; during training, the gradient of the segmentation module is calculated using the tracheal segmentation label and the tracheal segmentation result, and the network parameters of the segmentation module are updated by backpropagating the gradient.
[0087] Image classification module loss function L c As shown in the following formula:
[0088]
[0089] Where N is the number of samples input into the image classification module in each training iteration, and y i For lung classification labels, if it is a positive example, then y i The value is 1; if it is a negative case, then y i The value is 0; p i This represents the value of p, indicating that the lung image classification result obtained by the image classification module is a positive example. If the lung image classification result is a positive example, then p... i The value is 1; if the lung image classification result is negative, then p... i The value is 0; i represents the index of the sample in each training iteration, i∈{1,2,…N}.
[0090] Step 4: Based on the network loss function set in Step 3, train the segmentation and classification network constructed in Step 2 using the training set generated in Step 1, and save the parameters of the trained segmentation and classification network.
[0091] In this embodiment, the segmentation module and the image classification module are trained sequentially using the training set.
[0092] First, the learning rate of the network was initialized to 0.0001, and the batch size was set to 2 (i.e., the number of samples input into the segmentation module in each training iteration was 2). The segmentation module was trained on the PyTroch platform using the Adam optimizer. Training was stopped after a total of 150 iterations, and the parameters of the corresponding segmentation module were saved. After the segmentation module was trained, the preprocessed lung CT images in the training set were input into the trained segmentation module in sequence to obtain the corresponding trachea segmentation results, as shown in Figure 4. The trachea segmentation results corresponding to the trachea structure in the positive lung CT images and the trachea segmentation results corresponding to the trachea structure in the negative lung CT images showed significant differences in complexity and trachea level. This feature provides an important classification basis for the next stage of lung image classification.
[0093] Then, the image classification module was trained using the preprocessed lung CT images and corresponding tracheal segmentation results in the training set. The learning rate of the network was initialized to 0.0001, and the batch size was set to 2 (i.e., the number of samples input into the image classification module in each training iteration was 2). The Adam optimizer was used to train the network on the PyTroch platform. Training was stopped after the total number of iterations reached 150, and the parameters of the corresponding image classification module were saved.
[0094] Step 5: Based on the trained segmentation and classification network obtained in Step 4, perform tracheal segmentation and lung image classification operations on the lung CT image to be processed in sequence to obtain the corresponding tracheal segmentation results and lung image classification results: Input the lung CT image to be processed into the segmentation module in the trained segmentation and classification network to obtain the corresponding tracheal segmentation results; Input the lung CT image to be processed and the corresponding tracheal segmentation results into the image classification module in the trained segmentation and classification network to obtain the corresponding lung image classification results.
[0095] In this embodiment, the preprocessed lung CT images generated in step 1 are sequentially subjected to tracheal segmentation and image classification. The lung image classification results corresponding to the test set are then analyzed through data visualization, with an accuracy of approximately 0.87. Therefore, this invention provides a method for lung image classification based on deep learning-based tracheal segmentation, effectively utilizing the changes in the overall structure of the lung trachea and improving the accuracy of deep learning-based lung image classification.
[0096] Example 2
[0097] A device for lung image classification based on deep learning segmentation of trachea, comprising:
[0098] The network construction module is used to implement step 2 as described in Example 1;
[0099] A network loss function construction module is used to implement step 3 as described in Example 1;
[0100] The training module is used to implement step 4 as described in Example 1;
[0101] The application module is used to implement step 5 as described in Example 1.
[0102] Example 3
[0103] A computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement steps 2-5 in Embodiment 1 above.
[0104] Example 4
[0105] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements steps 2-5 in Embodiment 1 above.
[0106] Example 5
[0107] A computer program product includes a computer program that, when executed by a processor, implements steps 2-5 in Embodiment 1 above.
[0108] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods.
[0109] The specific embodiments described herein are merely illustrative of the spirit of the invention. Those skilled in the art to which this invention pertains may make various modifications or additions to the described specific embodiments or use similar methods to substitute them, without departing from the spirit of the invention or exceeding the scope defined by the appended claims.
Claims
1. A method for classifying lung images based on deep learning segmentation of lung airways, characterized in that, The method comprises the following steps: Step 1, sequentially performing training label making and preprocessing on the original lung CT image, wherein the training label comprises a trachea segmentation label and a lung classification label, taking the preprocessed lung CT image corresponding to an original lung CT image and the corresponding training label as a sample, and dividing a plurality of samples into a training set; Step 2, constructing a segmentation and classification network, wherein the segmentation and classification network comprises one segmentation module and one image classification module; the preprocessed lung CT image is input into the segmentation module to obtain a trachea segmentation result, and the trachea segmentation result and the preprocessed lung CT image are input into the image classification module to obtain a lung image classification result; Step 3, set the network loss function, the network loss function is divided into segmentation module loss function and image classification module loss function ; Step 4, training the segmentation and classification network by using the training set according to a network loss function, and saving the parameters of the trained segmentation and classification network; Step 5, inputting the lung CT image to be processed into the segmentation module of the trained segmentation and classification network to obtain the corresponding trachea segmentation result; inputting the lung CT image to be processed and the corresponding trachea segmentation result into the image classification module of the trained segmentation and classification network to obtain the corresponding lung image classification result; the image classification module comprises two classification sub-modules and a Softmax classifier, the preprocessed lung CT image is input into the first classification sub-module, and the trachea segmentation result is input into the second classification sub-module; each classification sub-module comprises a residual block and an attention mechanism block in sequence, and the output feature images of the attention mechanism blocks in the two classification sub-modules are added and then output through the Softmax classifier to obtain the lung image classification result.
2. The method of claim 1, wherein the lung image classification is performed by segmenting the lung airway based on deep learning. the segmentation module comprises an encoder and a decoder: the encoder comprises a down-sampling module; each down-sampling module comprises a convolution layer and a pooling layer, and each convolution layer is followed by a ReLu activation function; the decoder comprises an up-sampling module and an output layer; each up-sampling module comprises an up-sampling layer, a convolution layer and a ReLu activation function in sequence; and the output layer comprises a convolution layer and a Sigmoid activation function in sequence; the number of down-sampling modules is equal to the number of up-sampling modules, and a skip connection is performed between the down-sampling module and the corresponding up-sampling module.
3. The method of claim 1, wherein the lung image classification is performed by segmenting the lung airway based on deep learning. The segmentation module loss function is: , wherein, is a value of a trachea segmentation label of a voxel of a sample in the training set, ; represents a probability that a voxel in a trachea segmentation result obtained by the segmentation module is a positive example.
4. The method of claim 1, wherein the lung image classification is performed by segmenting the lung airway based on deep learning. The image classification module loss function is: , wherein, is the number of samples inputted into the image classification module in each round of training iteration, is the lung classification label, represents the probability value of the classification prediction obtained through the image classification module being a positive example, represents the serial number of the sample in each round of training iteration, .
5. The method of claim 1, wherein the method is based on deep learning to segment the lung airways for lung image classification. each residual block comprises a first path and a second path, and in each residual block: the first path comprises a plurality of convolution layers, a ReLu activation function and a batch normalization layer are sequentially added after each convolution layer in the first path except the last convolution layer, and a batch normalization layer is added after the last convolution layer in the first path; the second path comprises a convolution layer and a batch normalization layer in sequence; the output feature image of the second path and the output feature image of the first path are added, and then input through a ReLu activation function to obtain the output feature image of the corresponding residual block.
6. The method of classifying lung images by segmenting the lung airways based on deep learning according to claim 1, wherein, In the attention mechanism block, a first convolutional layer, an average pooling layer, a first fully connected layer, a ReLu activation function, a second fully connected layer and a Tanh activation function are sequentially included, an output feature image of the Tanh activation function is added to an output feature image of the first convolutional layer of the attention mechanism block, to obtain a connected feature image, a feature image obtained by the connected feature image passing through a second convolutional layer of the attention mechanism block is added to the connected feature image, to obtain an output feature image output by the attention mechanism block.
7. The method of claim 1, wherein the method is based on deep learning to segment the lung airways for lung image classification. The step 4 is to train the segmentation classification network by using the training set, and the specific steps are as follows: The segmentation module is trained by using the training set; After the training of the segmentation module is completed, the preprocessed lung CT images in the training set are sequentially input into the trained segmentation module, to obtain corresponding trachea segmentation results; The image classification module is trained by using the preprocessed lung CT images in the training set and the corresponding trachea segmentation results.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to realize steps 2-5 of the method for classification in any one of claims 1-7.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize steps 2-5 of the method for classification in any one of claims 1-7.
Citation Information
Patent Citations
Pulmonary nodule benign and malignant identification model training method, application method and system
CN116468103A
Lung medical CT (Computed Tomography) image segmentation and classification device and equipment
CN116703901A
Multi-modal lung MRI (Magnetic Resonance Imaging) image segmentation method based on deep learning and edge information fusion
CN117853508A