Fetal lung ultrasound image segmentation method based on lightweight deep transfer learning
By using a lightweight deep transfer learning method in fetal lung ultrasound image segmentation, combined with a lightweight inverse residual convolution module and an attention mechanism, the problem of high computational resource consumption is solved and efficient and accurate fetal lung segmentation is achieved. Ultrasound image segmentation, suitable for clinical practice.
Patent Information
- Application Number
- CN202410834677.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-09-24
AI Technical Summary
The existing technology has the problems of high consumption of computing resources and large demand for training data in fetal lung ultrasound image segmentation, which limits its application in clinical practice.
Using a method based on lightweight deep transfer learning, a fetal lung ultrasound image segmentation model including a lightweight inverse residual convolution module, an attention mechanism module and a semantic image segmentation convolution module was constructed, and transfer learning was used to initialize the model parameters. , and introduce an improved attention mechanism to the MobileNetV2 and DeepLabV3+ architecture to improve the performance and training efficiency of the model under limited computing resources.
It achieves efficient and accurate automatic segmentation of fetal lung ultrasound images, reduces computing resource requirements, improves the practicality of the model and the accuracy of segmentation results, and is suitable for clinical practice.
Smart Images

Figure CN118691817A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of medical image processing, and specifically provides a fetal lung ultrasound image segmentation method based on lightweight deep transfer learning. Background Art
[0002] Fetal lungs are the basis of the neonatal respiratory system, and their developmental maturity is directly related to the survival of the newborn. Some common pregnancy diseases, such as gestational diabetes (GDM), preeclampsia (PE), fetal growth restriction (FGR), oligohydramnios and fetal chest tumors, may have adverse effects on the maturity of fetal lungs. Fetal lung immaturity is the main cause of neonatal respiratory morbidity (NRM), and NRM is the leading cause of neonatal death. Therefore, accurate and timely prenatal assessment of fetal lung maturity is of great significance for reducing neonatal morbidity and mortality and optimizing clinical decision-making.
[0003] Traditional methods of assessing fetal lung maturity mainly rely on amniocentesis biochemical testing, which is direct but invasive. It may not only cause potential harm to the fetus and pregnant women, but also easily cause anxiety and fear in pregnant women. In recent years, with the development of medical imaging, non-invasive methods of assessing fetal lung maturity have gradually gained attention; among them, ultrasound examination has become an important means of prenatal assessment due to its simplicity, non-invasiveness, no radiation and repeatability; however, the interpretation and analysis of ultrasound images are highly dependent on the doctor's clinical experience, which is not only time-consuming, but also requires professional medical knowledge, increasing medical costs and the workload of doctors.
[0004] With the rapid development of computer vision and deep learning technology, breakthrough progress has been made in the processing and analysis of medical images; studies have shown that deep learning technology can significantly improve the accuracy and efficiency of medical image recognition. In terms of fetal lung maturity assessment, studies have also demonstrated the potential of deep learning in automatic segmentation of ultrasound images. For example, Hu Q et al. proposed an effective method for lung segmentation in CT images in the paper "Hu, Q., et al. An Effective Approach for CT Lung Segmentation Using MaskRegion-Based Convolutional Neural Networks. Artificial Intelligence inMedicine, 2020, 103, 101792.", using Mask R-CNN to specialize the model for lung region mapping and combining supervised learning and unsupervised learning methods. For example, Cheng D et al. studied the rib segmentation from lung ultrasound images in the paper "Cheng D, Lam E Y. Transfer learning U-Net deep learning for lung ultrasound segmentation [J]. arXiv preprint arXiv: 2110.02196, 2021." and found a U-Net-based transfer learning technology to achieve accurate and fast image segmentation. Although the application of deep learning in the field of medical image segmentation has achieved remarkable results, the existing methods still have some limitations; for example, U-Net, as a commonly used deep learning architecture, performs well in medical image segmentation, but it requires a lot of computing resources and large-scale data sets for training, which limits its wide application in clinical practice. Therefore, it is of great practical significance and application value to develop an efficient, accurate and clinically applicable fetal lung ultrasound image segmentation method based on lightweight deep transfer learning. Summary of the invention
[0005] The main purpose of the present invention is to provide a fetal lung ultrasound image segmentation method based on lightweight deep transfer learning, aiming to efficiently and accurately realize the automatic segmentation of fetal lung ultrasound images to evaluate the maturity of the fetal lungs.
[0006] To achieve the above object, the technical solution adopted by the present invention is:
[0007] A fetal lung ultrasound image segmentation method based on lightweight deep transfer learning includes the following steps:
[0008] Step 1. Construct a training set and perform data preprocessing on the input images and label images in the training set;
[0009] Step 2. Construct a fetal lung ultrasound image segmentation model, initialize the model parameters based on transfer learning, and then use the training set to complete the model training; the fetal lung ultrasound image segmentation model includes: a lightweight reverse residual convolution module, an attention mechanism module and a semantic image segmentation convolution module; the input image is extracted after passing through the lightweight reverse residual convolution module to obtain a low-level feature map P1 and a high-level feature map P2, and the high-level feature map P2 is converted into a high-level feature map P3 through the attention mechanism module; the semantic image segmentation convolution module includes: an encoder and a decoder, the low-level feature map P1 is input to the decoder, the high-level feature map P3 is input to the encoder, the encoder outputs a multi-scale semantic feature P4 to the decoder, and the decoder outputs an image segmentation result P5;
[0010] Step 3: pre-process the fetal lung ultrasound image to be segmented and input it into the trained fetal lung ultrasound image segmentation model, and the fetal lung ultrasound image segmentation model outputs the image segmentation result.
[0011] Furthermore, in step 1, the input image is a fetal lung ultrasound image, the label image is a segmentation mask image, and the fetal lung ultrasound image and the segmentation mask image correspond one to one and together constitute a training sample.
[0012] Furthermore, in step 1, data preprocessing is specifically as follows: first, the image is converted into a single-channel grayscale image, then, the image is scaled to unify the image resolution to a preset size; finally, the image is converted into a storage format and stored for later use.
[0013] Furthermore, in step 2, the lightweight reverse residual convolution module adopts the MobileNetV2 network, including three convolution blocks connected in sequence, the first convolution block adopts a 1×1 convolution layer, and the operation result is output after passing through the normalization layer and the non-linear activation function ReLU6 and is used as the low-level feature map P1; the second convolution block adopts a 3×3 depth-separable convolution layer, and the operation result is output after passing through the normalization layer and the non-linear activation function ReLU6; the third convolution block adopts a 1×1 convolution layer, and the operation result is output after passing through the normalization layer and is used as the high-level feature map P2.
[0014] Furthermore, in step 2, the attention mechanism module includes: a channel attention module and a spatial attention module; wherein the function expression of the channel attention module is:
[0015] F′=F×W C +F
[0016] W C =sigmoid(FC2(ReLU(FC1(Favg (F)+F max (F)))))
[0017]
[0018] F max (F) = max(F(i,j):i∈W,j∈H)
[0019] Among them, F′ is the output feature map of the channel attention module, F is the input feature map of the channel attention module, (i, j) represents the pixel coordinates, W and H represent the width and height of the input feature map respectively, sigmoid and ReLU represent nonlinear activation functions, FC1 and FC2 represent fully connected processing, and F avg represents the global average pooling process, F max Represents maximum pooling processing;
[0020] The function expression of the spatial attention module is:
[0021] F″=F′×Conv(cat(F max (F′),F mean (F′), dim=1))
[0022] Among them, F″ is the output feature map of the spatial attention module, Conv represents the convolution operation, cat represents the splicing processing according to the channel dimension, dim represents the channel dimension, and F max represents the maximum pooling process, F mean Represents average pooling processing.
[0023] Furthermore, in step 2, the semantic image segmentation convolution module adopts a DeepLabV3+ network, including: an encoder and a decoder; the high-level feature map P3 is input to the encoder, and after the atrous space pyramid pooling module and the pooling operation, it is output to the 1×1 convolution layer for convolution processing to obtain the multi-scale semantic feature P4 of the image and output to the decoder; in the decoder, the low-level feature map P1 is convolved by the 1×1 convolution layer, and the multi-scale semantic feature P4 is upsampled 4 times by the first sampler, the processed low-level feature map P1 and the multi-scale semantic feature P4 are spliced and merged, and then convolved by the 3×3 convolution layer and upsampled 4 times by the second sampler to obtain the image segmentation result P5.
[0024] Based on the above scheme, the beneficial effects of the present invention are:
[0025] The present invention provides a fetal lung ultrasound image segmentation method based on lightweight deep transfer learning. An improved attention mechanism is introduced on the DeepLabV3+ architecture based on MobileNetV2 to construct a lightweight fetal lung ultrasound image segmentation model. The attention weights of important features are increased during the image segmentation process, while features with smaller contributions are ignored, thereby effectively improving the performance and practicality of the model under limited computing resources, which is beneficial to clinical practice. At the same time, transfer learning is introduced during the model training process to improve the model training efficiency and further improve the accuracy of the model segmentation results. Finally, the present invention can efficiently and accurately realize the automatic segmentation of fetal lung ultrasound images to evaluate the maturity of the fetal lungs. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 Schematic diagram of the network structure of the fetal lung ultrasound image segmentation model in the present invention.
[0027] Figure 2 Schematic diagram of the network structure of the lightweight reverse residual convolution module in the present invention.
[0028] Figure 3 Schematic diagram of the network structure of the attention mechanism module in the present invention.
[0029] Figure 4 Schematic diagram of the network structure of the semantic image segmentation convolution module in the present invention.
[0030] Figure 5 This is a graph of mIoU for non-transfer learning in an embodiment of the present invention;
[0031] Figure 6 Graph showing the loss function of non-transfer learning in an embodiment of the present invention;
[0032] Figure 7 It is a mIoU curve diagram of transfer learning in an embodiment of the present invention;
[0033] Figure 8 This is a loss function curve diagram of transfer learning in an embodiment of the present invention.
[0034] Fig. 9 This is a diagram showing the segmentation result of a fetal lung ultrasound image in an embodiment of the present invention. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solution and beneficial effects of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments.
[0036] Example 1
[0037] This embodiment provides a fetal lung ultrasound image segmentation method based on lightweight deep transfer learning, which introduces an improved attention mechanism on the DeepLabV3+ architecture based on MobileNetV2 to efficiently and accurately realize the automatic segmentation of fetal lung ultrasound images; specifically, the following steps are included:
[0038] Step 1. Data preprocessing, constructing training set, validation set and test set;
[0039] In this embodiment, a fetal lung ultrasound image dataset is obtained, including 1,300 fetal lung ultrasound images. The fetal lung ultrasound image data is collected from a Samsung WS80A ultrasound device equipped with a curved array ultrasound probe CA1-7A, and each fetal lung ultrasound image is equipped with a segmentation mask image. The segmentation mask image is produced and evaluated by medical personnel in the imaging department with more than 10 years of clinical experience; the fetal lung ultrasound image is used as an input image during model training, and the segmentation mask image is used as a label image during model training to form a dataset;
[0040] Data preprocessing was performed on fetal lung ultrasound images and segmentation mask images. First, the images were converted from the original RGB three-channel images to single-channel grayscale images. Then, the images were scaled to unify the image resolution to 936×735 pixels. Finally, the images were converted to storage formats and stored in Digital Imaging and Communications in Medicine (DICOM) format.
[0041] The preprocessed fetal lung ultrasound image dataset was divided into a training set, a validation set, and a test set in a ratio of 7:2:1;
[0042] Step 2. Construct a fetal lung ultrasound image segmentation model and complete model training using the training set;
[0043] In this embodiment, the fetal lung ultrasound image segmentation model is as follows: Figure 1 As shown, it includes: a lightweight reverse residual convolution module, an attention mechanism module and a semantic image segmentation convolution module; the input image is extracted after passing through the lightweight reverse residual convolution module to obtain a low-level feature map P1 and a high-level feature map P2, and the high-level feature map P2 is converted into a high-level feature map P3 through the attention mechanism module; the semantic image segmentation convolution module includes: an encoder and a decoder, the low-level feature map P1 is input to the decoder, the high-level feature map P3 is input to the encoder, the encoder outputs a multi-scale semantic feature P4 to the decoder, and the decoder outputs an image segmentation result P5;
[0044] Furthermore, the lightweight reverse residual convolution module is as follows Figure 2As shown, the MobileNetV2 network is specifically used, including three convolution blocks connected in sequence. The first convolution block uses a 1×1 convolution layer. The operation result is output after the normalization layer and the nonlinear activation function ReLU6 and is used as the low-level feature map P1. The first convolution block is used to map the low-dimensional features of the image to the high-dimensional space to achieve image dimensionality increase; the second convolution block uses a 3×3 depth-separable convolution layer. The operation result is output after the normalization layer and the nonlinear activation function ReLU6. The second convolution block is used to implement lightweight convolution operations, which can effectively reduce the amount of calculation and the amount of parameters; the third convolution block uses a 1×1 convolution layer. The operation result is output after the normalization layer and is used as the high-level feature map P2. The third convolution block is used to map the high-dimensional features of the image back to the low-dimensional space to achieve image dimensionality reduction; in addition, the three convolution blocks all use the normalization layer as a connection, and the first convolution block and the second convolution block both use nonlinear activation function modules to make them more robust in low-precision calculations;
[0045] Furthermore, the attention mechanism module is as follows Figure 3 As shown, it includes: a channel attention module and a spatial attention module; wherein the function expression of the channel attention module is:
[0046] F′=F×W C +F
[0047] W C =sigmoid(FC2(ReLU(FC1(F avg (F)+F max (F)))))
[0048]
[0049] F max (F) = max(F(i,j):i∈W,j∈H)
[0050] Among them, F′ is the output feature map of the channel attention module, F is the input feature map of the channel attention module, (i, j) represents the pixel coordinates, W and H represent the width and height of the input feature map respectively, sigmoid and ReLU represent nonlinear activation functions, FC1 and FC2 represent fully connected processing, and F avg represents the global average pooling process, F max Represents maximum pooling processing;
[0051] The function expression of the spatial attention module is:
[0052] F″=F′×Conv(cat(F max (F′),F mean (F′), dim=1))
[0053] Among them, F″ is the output feature map of the spatial attention module, Conv represents the convolution operation, cat represents the splicing processing according to the channel dimension, dim represents the channel dimension, and F max represents the maximum pooling process, F mean represents average pooling processing;
[0054] Furthermore, the semantic image segmentation convolution module is as follows Figure 4 As shown, a DeepLabV3+ network is used, including: an encoder and a decoder; the high-level feature map P3 is input to the encoder, and after the atrous space pyramid pooling module and the pooling operation, it is output to the 1×1 convolution layer for convolution processing to obtain the multi-scale semantic feature P4 of the image and output to the decoder; in the decoder, the low-level feature map P1 is convolved by the 1×1 convolution layer, and the multi-scale semantic feature P4 is upsampled 4 times by the first sampler, and the processed low-level feature map P1 and the multi-scale semantic feature P4 are spliced and merged, and then convolved by the 3×3 convolution layer and upsampled 4 times by the second sampler to obtain the image segmentation result P5;
[0055] Based on the above-mentioned fetal lung ultrasound image segmentation model, transfer learning is used to set pre-trained weight information for the model. The weight information is obtained by training the public data set VOC data set (see the document "Everingham MR, EslamiS MA, Gool LJ, et al. The Pascal Visual Object Classes Challenge [J]. International Journal of Computer Vision, 2015."), and then the training set is used to complete the model training. The loss function in the training process adopts the cross entropy loss function;
[0056] Step 3, pre-processing the fetal lung ultrasound image to be segmented and inputting it into the trained fetal lung ultrasound image segmentation model, and the fetal lung ultrasound image segmentation model outputs the image segmentation result;
[0057] In this embodiment, the fetal lung ultrasound image segmentation model after training is first verified using a verification set, and the fetal lung ultrasound image segmentation model after verification is tested using a test set to obtain a performance test result of the model.
[0058] Specifically, this embodiment is implemented using Python 3.9.13, Pytorch framework and CUDA 12.1 on a workstation equipped with a Windows 11 system. The workstation is equipped with an Nvidia Geforce RTX 4060 GPU (with 8GB GPU memory) and an Intel Core i9 processor with 16 logical processors. The training of this architecture combines the idea of transfer learning and is initialized by pre-training weights from the VOC dataset. In addition, the number of training iterations is set to 100, the initial learning rate is 0.0005, and the cosine annealing algorithm is used to reduce the learning rate. The training is completed using the SGD optimizer.
[0059] The traditional U-net architecture, the DeepLabV3+ architecture based on Xception, and the DeepLabV3+ architecture based on MobileNetV2 are used as comparative examples 1 to 3, and the present embodiment and the comparative examples are tested and compared in terms of computing resource utilization, performance, etc. In order to evaluate the performance, the predicted segmentation result is compared with the label image, and indicators such as DICE coefficient, mIoU (mean intersection over union), accuracy, recall, and precision are used. At the same time, true positive examples (TP), true negative examples (TN), false positive examples (FP), and false negative examples (FN) are also used to evaluate the results, and the specific definitions are shown in Table 1 below:
[0060] Table 1
[0061]
[0062]
[0063] Furthermore, in this embodiment, the model is trained and compared by non-transfer learning and transfer learning, and the Dice coefficient mIoU curve and loss function curve between the two methods are shown in Figure 2. Figures 5 to 8 As shown in the figure, it can be seen that non-transfer learning requires about 80 trainings to make the loss function converge to a stable value, while the loss function of transfer learning tends to be stable after 40 trainings; in addition, the training process based on transfer learning is more stable than non-transfer learning in terms of loss changes, indicating that the training process based on transfer learning can learn the features of the image faster; the specific results are shown in Table 2:
[0064] Table 2
[0065]
[0066] As can be seen from the above table, each evaluation indicator based on transfer learning has been significantly improved compared with non-transfer learning, which further proves the effectiveness of transfer learning, which not only improves the training efficiency but also improves the segmentation effect.
[0067] Furthermore, this embodiment also introduces the number of floating point operations (FLOPs) to evaluate the computational efficiency and the number of parameters (Params) to evaluate the capacity of the model; FLOPs provides insights into the number of floating point operations performed per second, reflecting the computational load during the inference process; Params reflects the total number of trainable parameters, which is related to the complexity of the model and potential overfitting. The test results of this embodiment and comparative examples 1 to 3 are shown in Table 3:
[0068]
[0069] The above table proves that the present invention is superior to the comparative example in performance, and the computing resources of the present invention are much lower than those of the comparative example. Furthermore, the image segmentation results of this embodiment are as follows: Fig. 9 As shown, column A is the original ultrasound image of the fetal lung, column B is the segmentation mask image, and column C is the model-predicted image segmentation result (the green area represents the fetal lung); it can be seen from the figure that the lung area is accurately segmented, proving its effectiveness in clinical practice.
[0070] The above description is only a specific implementation mode of the present invention. Any feature disclosed in this specification, unless otherwise stated, can be replaced by other alternative features that are equivalent or have similar purposes; all the disclosed features, or all the steps in the methods or processes, except for mutually exclusive features and / or steps, can be combined in any way.
Claims
1. A fetal lung ultrasound image segmentation method based on lightweight deep transfer learning, characterized in that: The following steps are involved: Step 1. Construct a training set and perform data preprocessing on the input images and label images in the training set; Step 2. Construct a fetal lung ultrasound image segmentation model, initialize the model parameters based on transfer learning, and then use the training set to complete the model training; the fetal lung ultrasound image segmentation model includes: a lightweight reverse residual convolution module, an attention mechanism module and a semantic image segmentation convolution module; the input image is extracted after passing through the lightweight reverse residual convolution module to obtain a low-level feature map P1 and a high-level feature map P2, and the high-level feature map P2 is converted into a high-level feature map P3 through the attention mechanism module; the semantic image segmentation convolution module includes: an encoder and a decoder, the low-level feature map P1 is input to the decoder, the high-level feature map P3 is input to the encoder, the encoder outputs a multi-scale semantic feature P4 to the decoder, and the decoder outputs an image segmentation result P5; Step 3: pre-process the fetal lung ultrasound image to be segmented and input it into the trained fetal lung ultrasound image segmentation model, and the fetal lung ultrasound image segmentation model outputs the image segmentation result.
2. The fetal lung ultrasound image segmentation method based on lightweight deep transfer learning according to claim 1, characterized in that: In step 1, the input image is a fetal lung ultrasound image, and the label image is a segmentation mask image. The fetal lung ultrasound image and the segmentation mask image correspond one to one and together constitute a training sample.
3. The fetal lung ultrasound image segmentation method based on lightweight deep transfer learning according to claim 1, characterized in that: In step 1, data preprocessing is specifically as follows: first, the image is converted into a single-channel grayscale image, then the image is scaled to unify the image resolution to a preset size; finally, the image is converted into a storage format and stored for later use.
4. The fetal lung ultrasound image segmentation method based on lightweight deep transfer learning according to claim 1, characterized in that: In step 2, the lightweight reverse residual convolution module adopts the MobileNetV2 network, including three convolution blocks connected in sequence. The first convolution block adopts a 1×1 convolution layer, and the operation result is output after passing through the normalization layer and the non-linear activation function ReLU6 and is used as the low-level feature map P1; the second convolution block adopts a 3×3 depth-separable convolution layer, and the operation result is output after passing through the normalization layer and the non-linear activation function ReLU6; the third convolution block adopts a 1×1 convolution layer, and the operation result is output after passing through the normalization layer and is used as the high-level feature map P2.
5. The fetal lung ultrasound image segmentation method based on lightweight deep transfer learning according to claim 1, characterized in that: In step 2, the attention mechanism module includes: a channel attention module and a spatial attention module; wherein the function expression of the channel attention module is: F′=F×W C +F W C =sigmoid(FC2(ReLU(FC1(F avg (F)+F max (F))))) F max (F)=max(F(i,j):i∈W,j∈H) Among them, F′ is the output feature map of the channel attention module, F is the input feature map of the channel attention module, (i, j) represents the pixel coordinates, W and H represent the width and height of the input feature map respectively, sigmoid and ReLU represent nonlinear activation functions, FC1 and FC2 represent fully connected processing, and F avg represents the global average pooling process, F max Represents maximum pooling processing; The function expression of the spatial attention module is: F″=F′×Conv(cat(F max (F′),F mean (F′),dim=1)) Among them, F″ is the output feature map of the spatial attention module, Conv represents the convolution operation, cat represents the splicing processing according to the channel dimension, dim represents the channel dimension, and F max represents the maximum pooling process, F mean Represents average pooling processing.
6. The fetal lung ultrasound image segmentation method based on lightweight deep transfer learning according to claim 1, characterized in that: In step 2, the semantic image segmentation convolution module adopts the DeepLabV3+ network, including: an encoder and a decoder; the high-level feature map P3 is input to the encoder, and after the atrous space pyramid pooling module and the pooling operation, it is output to the 1×1 convolution layer for convolution processing to obtain the multi-scale semantic feature P4 of the image and output to the decoder; in the decoder, the low-level feature map P1 is convolved by the 1×1 convolution layer, and the multi-scale semantic feature P4 is upsampled 4 times by the first sampler, the processed low-level feature map P1 is spliced and merged with the multi-scale semantic feature P4, and then convolved by the 3×3 convolution layer and upsampled 4 times by the second sampler to obtain the image segmentation result P5.
