Abstract
BACKGROUND:
Chest X-rays (CXR) are widely used to facilitate the diagnosis and treatment of critically ill and emergency patients in clinical practice. Accurate hemi-diaphragm detection based on postero-anterior (P-A) CXR images is crucial for the diaphragm function assessment of critically ill and emergency patients to provide precision healthcare for these vulnerable populations.
OBJECTIVE:
Therefore, an effective and accurate hemi-diaphragm detection method for P-A CXR images is urgently developed to assess these vulnerable populations’ diaphragm function.
METHODS:
Based on the above, this paper proposes an effective hemi-diaphragm detection method for P-A CXR images based on the convolutional neural network (CNN) and graphics. First, we develop a robust and standard CNN model of pathological lungs trained by human P-A CXR images of normal and abnormal cases with multiple lung diseases to extract lung fields from P-A CXR images. Second, we propose a novel localization method of the cardiophrenic angle based on the two-dimensional projection morphology of the left and right lungs by graphics for detecting the hemi-diaphragm.
RESULTS:
The mean errors of the four key hemi-diaphragm points in the lung field mask images abstracted from static P-A CXR images based on five different segmentation models are 9.05, 7.19, 7.92, 7.27, and 6.73 pixels, respectively. Besides, the results also show that the mean errors of these four key hemi-diaphragm points in the lung field mask images abstracted from dynamic P-A CXR images based on these segmentation models are 5.50, 7.07, 4.43, 4.74, and 6.24 pixels,respectively.
CONCLUSION:
Our proposed hemi-diaphragm detection method can effectively perform hemi-diaphragm detection and may become an effective tool to assess these vulnerable populations’ diaphragm function for precision healthcare.
Keywords
Introduction
Compared with computed tomography (CT), magnetic resonance imaging (MRI), positron emission tomography (PET), PET-CT, and other advanced imaging devices, X-ray is a more widely used primary imaging technique for chest and bone radiography as it is widely available, low cost, and easy to acquire [1]. Meanwhile, compared to CT, MRI, PET, PET-CT, etc., X-ray has a faster imaging speed, directly projecting the captured human body onto a two-dimensional plane image. Therefore, a digital X-ray image can be obtained in seconds after exposure. This improves work efficiency and facilitates the diagnosis and treatment of critically ill and emergency patients in clinical practice [2, 3].
Chest X-ray (CXR), as the most frequently performed examination of the routine and emergency setting, has become a priority choice for diagnosing diseases that may affect organs within the thoracic cavity [4, 5]. Pulmonary ventilation highly depends on diaphragm mobilization, which attributes for nearly 80% of the pulmonary ventilation [6]. Specifically, the diaphragm is the primary respiratory muscle controlled by the will. When contracting, the diaphragm descends to assist in inhalation. During diastole, the diaphragm returns to its original position to assist in exhalation. When the diaphragm and abdominal muscles contract simultaneously, abdominal pressure is generated, which helps with movements such as defecation, urination, childbirth, and vomiting [7]. Therefore, abnormalities in the diaphragm can be reflected in some diseases, such as chronic obstructive pulmonary disease (COPD) [6, 9], breathing pattern disorders [10], and diaphragm dysfunction in critically ill patients [11, 12], etc. However, postero-anterior (P-A) CXR images have been applied to the progression of COPD [6], the difference in diaphragmatic motion between COPD patients and normal subjects [8], decreased and slower diaphragmatic activity in severe COPD patients [9], quantitative evaluation of diaphragmatic motion [13], and diaphragmatic dysfunction [14].
Precision hemi-diaphragm detection in P-A CXR images is crucial for accurately assessing diaphragm function. Currently, the existing technology (Konica Minolta Inc., Tokyo, Japan) only recognizes the diaphragm movement by detecting the lung apex and the highest point of the hemi-diaphragm for determining the movement displacement of the diaphragm [6]. However, this technique lacks information on the movement of the entire hemi-diaphragm to assess diaphragm function accurately. Meanwhile, a comprehensive and in-depth understanding of the morphology of the left and right lungs will help accurately detect the hemi-diaphragm. Anatomically, the upper edge of the diaphragm is in close contact with the lower edge of the lungs and heart in the thoracic cavity [15]. Compared to the position of cardiophrenic angles (the top of the hemi-diaphragm), costophrenic angles (the bottom of the hemi-diaphragm) are easy to determine in P-A CXR images. Specifically, the costophrenic angles are located at the bottom of the lung fields. However, it is challenging to decide on the specific location of cardiophrenic angles in P-A CXR images owing to the anatomical irregularity of lung fields. The primary task of effectively detecting the position of cardiophrenic and costophrenic angles is to segment the lung field accurately. Therefore, effective and automatic localization of the lung field in P-A CXR images is a crucial step in accurately detecting the hemi-diaphragm. In engineering, the automatic localization of lung fields in P-A CXR images is essentially a task of lung field segmentation. With the continuous development of medical image segmentation tasks, most researchers have been focusing on improving the architecture or/and loss function of the convolutional neural network (CNN) for lung field segmentation in P-A CXR images [16–18] and have even applied CNN to the lung segmentation of rats for measuring lung parenchyma parameters [19]. The above approaches have indeed improved the performance of the lung field segmentation model. However, the clinical applicability of these lung field segmentation models based on P-A CXR images across centers remains limited. The main reason is the generalization of these lung field segmentation models based on P-A CXR images. The image augmentation techniques [20] and multi-center training datasets are crucial for solving the generalization of lung field segmentation models based on P-A CXR images.
Based on the above, we train a robust and standard segmentation model of pathological lungs [21] based on multi-center training datasets of P-A CXR images and image enhancement techniques for extracting lung fields in P-A CXR images. Then, the position of the hemi-diaphragm is accurately detected based on the morphology of the segmented lung field. Therefore, this paper proposes an effective hemi-diaphragm detection method based on CNN and graphics for P-A CXR images. Our contributions in this paper are briefly described as follows: We develop a robust and standard segmentation model of pathological lungs for extracting lung fields from P-A CXR images. This will promote the development of quantitative analysis based on lung fields of P-A CXR images in clinical applications. We propose a novel localization method of the cardiophrenic angle based on the two-dimensional projection morphology of the left and right lung fields, which helps to detect the hemi-diaphragm effectively. The proposed hemi-diaphragm detection method may become an effective tool for the diaphragm function assessment of COPD, lung surgery, critically ill, and emergency patients to take precision healthcare for these vulnerable populations.
Materials and methods
Materials and methods are described in detail in Sections 2.1 and 2.2, respectively.
Materials
We collected 789 (635 + 54 + 72 + 15 + 13) P-A CXR images from public CXR datasets, the Google website, and a case of P-A CXR video.
Table 1 reports the detailed sources of P-A CXR images in each dataset used in this study. First, 635 static P-A CXR images were selected from the China set (The Shenzhen set – Chest X-ray Database) in the public dataset D1. Specifically, the 635 static P-A CXR images include 324 normal cases and 311 cases with manifestations of tuberculosis. Because of the inability of radiologists to make judgments on the lung field, 24 cases with manifestations of tuberculosis were excluded from this study. Second, 54 P-A static P-A CXR images were randomly selected from the Montgomery County X-ray Set in the public dataset D2. Specifically, the 54 P-A CXR images include 47 normal cases and 7 cases with manifestations of tuberculosis. Meanwhile, 72 static P-A CXR images are selected from the public datasets D3 (NIAID TB portal program dataset [Online]) and D4 (kaggle. RSNA Pneumonia Detection Challenge [Online]). Specifically, the 72 static P-A CXR images include 7 cases with the manifestation of tuberculosis, 60 cases with the manifestation of pneumonia, and five normal cases. Last, 15 static P-A CXR images were collected from the Google website (dataset D5). The remaining 13 dynamic P-A CXR images (dataset D6) from the case of CXR video were collected during free breathing. Specifically, the CXR video was collected from a female participant aged 53 using a digital X-ray imaging system (manufacturer: Lanmage, collection mode: sequence point slice, exposure parameters: 78 KV, 200 mA, 50 ms, and flat panel detector: IRAY) for chest photography. All patients provided written informed consent, and this study was approved by the Guangzhou Medical University Ethics Committee in China (Grant number: 2023-hg-ks-24, Approval Date: 28 August 2023, Tel.: +86-20-34153599, and Fax: +86-20-34153066).
The detailed sources of P-A CXR images in each dataset used in this study
The detailed sources of P-A CXR images in each dataset used in this study
In addition, the subject has been provided written informed consent to the second affiliated hospital of Guangzhou Medical University before chest photography. The public CXR datasets and D2 are collected from the website: https://www.kaggle.com/datasets/kmader/pulmonary-chest-xray-abnormalities?select=ChinaSet_AllFiles. Meanwhile, the public CXR datasets D3 and D4 are collected from the website: https://data.tbportals.niaid.nih.gov/. Meanwhile, the public CXR datasets D3 and D4 are collected from the website: https://data.tbportals.niaid.nih.gov/, and https://www.kaggle.com/c/rsna-pneumonia-detection-challenge/data.
Figure 1 shows the detailed flow chart for detecting the hemi-diaphragm in P-A CXR images in this study. Specifically, Figure 1

The detailed flow chart for detecting the hemi-diaphragm in P-A CXR images. (
Figure 2

The CNNs’ training process for lung field segmentation of P-A CXR images.
The training process of the lung field segmentation model Figure 2 shows CNN’s training process for static and dynamic lung field segmentation of P-A CXR images. This paper separately trains five traditional and basic CNNs, including FCN [23], SegNet [24], U-Net [25], ResU-Net++ [26, 27] and AttU-Net [28]. Specifically, each CNN is trained by 755 static P-A CXR images (755×512×512×1) with their lung field label images (ground truth). 755 static CXR cases include 371 normal cases, 380 abnormal cases with the manifestation of tuberculosis (N = 320) and pneumonia (N = 60), and 15 unclear cases. The 755 static P-A CXR images’ initial lung field label images were first labeled by an experienced radiologist using the software Labelme (v5.1.0). Then, the initial lung field label images were modified and confirmed by two other experienced radiologists, obtaining the final ground truthimages. Data augmentation techniques were adopted to avoid overfitting, further improving the robustness and generalization ability of the static and dynamic lung field segmentation model in the training process [29]. Specifically, During the training process, we randomly perform flipping, scaling, affine transformation, Gaussian filtering, and histogram equalization on the training set’s static P-A CXR images and corresponding ground truth images. After each training of the model, we use the standard cross entropy loss function to calculate the model’s loss and dynamically adjust the model’s network parameters. Besides, each model’s initial learning rate and weight decay were set to 0.001 and 1e–4. The mathematical expression for the cross entropy loss function is shown in Equation 1.
The number of epochs is configured to an empirical value of 300. Subsequently, all lung field segmentation models of each CNN with the pth format are loaded every ten epochs. After completing the training process, we select each CNN’s optimal lung field segmentation model based on the loss curve. All the Python source codes under the PyTorch framework of the five CNNs run on PyCharm 2017.3.3 (community edition) in Windows 10 Pro 64-bit with an NVIDIA GeForce GTX 1080 Ti GPU and 16 GB RAM. Engineering and evaluation metrics of lung field segmentation models The pth format of each CNN’s optimal lung field segmentation model is converted to the pt format based on PyCharm 2017.3.3. Subsequently, each CNN’s optimal lung field segmentation model with the pt format is called by C++ codes based on Visual Studio 2017 for lung field segmentation of 21 static P-A CXR images (Test set T1) and 13 dynamic P-A CXR images (Test set T2). Specifically, the size 3072×3072 of each dynamic P-A CXR image is resized to the size 512×512 by the downsampling method. Then, the 13×512×512 dynamic P-A CXR images are input into these lung field segmentation models, generating 3×512×512 lung field mask images. The standard evaluation metrics of each lung field segmentation model include accuracy, precision, recall, dice, intersection over Union (IoU), and the median 95th Hausdorff distance (HD). The mathematical expressions of these evaluation metrics are shown in Equation 2–7 [30–32].
Connected domain algorithm To address the issue that may happen over-segmentation of non-lung fields in the developed lung field segmentation models, we add the connected domain (CD) algorithm [33] before detecting the diaphragm. Specifically, eight CD algorithm runs on Visual Studio 2017 to calculate the areas of each segmented region. Then, the first and second largest areas of each lung field mask image are identified as the left and right lung fields, and other regions are removed from each image.
Like the CD algorithm, the hemi-diaphragm detection algorithm is also implemented in Visual Studio 2017 in Windows 10 Pro 64-bit with an NVIDIA GeForce GTX 1080 Ti GPU and 16GB RAM. Specifically, Fig. 2 Lung identification algorithm The proposed localization algorithm of the cardiophrenic angle is based on the morphological characteristics of the left and right lung fields by graphics for detecting the hemi-diaphragm. In clinical practice, depending on the position of the projection, the P-A CXR images may be taken from the posteroanterior or anteroposterior view. This will significantly affect the applicability of the hemi-diaphragm localization algorithm. Therefore, the left and right lung fields must be separately identified based on their respective areas of the lung field mask image processed by the CD algorithm. Specifically, the right and left lung fields differ in morphology and have differences in areas in the CXR image [15]. Anatomically, as the heart is usually located on the left side of the thoracic cavity, the right lung field’s area is larger than the left. Besides, the right lung field of an ordinary person contains three lobes [34]. Unlike this, the left lung field includes two lobes [34]. Therefore, based on the above anatomical theory, we believe the region in each lung field mask image with the largest area should be defined as the right lung field. Meanwhile, the other region in the lung field mask image should be defined as the left lung field. The left and right lung field masks are marked as 1 and 2, respectively. Edge detection algorithm The hemi-diaphragm is located based on the lung field edge. Therefore, a stable and effective edge detection algorithm is crucial for Hemi-diaphragm localization. Figure 3 shows the schematic diagram of the edge detection algorithm for locating the edges of the left and right lungs. An N×N pixels corrosion template is separately applied to the lung field mask images to obtain the edges of the left and right lungs. Specifically, the 3×3 pixels correction template traverses each lung field mask image in rows /columns with a step size of 1 pixel for generating the corroded lung field mask image. More specifically, if the 9 values configured as 1 in the 3×3 pixels correction template are dot multiplied with the traversed lung field mask image, and these 9 values are not 0 for the first and last time, it is considered that the lung field has been detected (orange solid line rectangle). When the lung field has been detected, the location information and its pixel value of the center (the bark green rectangular box) in the 3×3 pixels correction template are recorded. Then, the corroded lung field mask images are generated based on the recorded location information and its pixel value (1 or 2). Subsequently, the lung field mask image subtracts the corresponding corroded lung field to obtain the edges of the left and right lungs. Hemi-diaphragm localization algorithm Through in-depth analysis and research on the two-dimensional projection morphology of the left and right lungs, the proposed hemi-diaphragm localization algorithm first determines the hemi-diaphragm of the right lung based on its edge. Then, the hemi-diaphragm of the left lung is determined based on its edge and the hemi-diaphragm of the right lung. Figure 4 shows the schematic diagram of the hemi-diaphragm localization algorithm for the left and right lungs. Compared to the left cardiophrenic angle C2 on each P-A CXR image, the right cardiophrenic angle C1, farthest from Line 1, has uniqueness. Furthermore, the right cardiophrenic angle C1 can also assist in detecting the left cardiophrenic angle C2 by determining an auxiliary detection point C2’. Therefore, the right hemi-diaphragm B1C1 is first located based on the right lung edge. Specifically, right apex pulmonis A1 (right lung top) and right costophrenic angle B1 (right lung bottom) were detected, respectively. Then, the right apex pulmonis A1 and right costophrenic angle B1 are connected to obtain Line 1. Furthermore, the coordinates of all pixels in the right lung edge on the right side (the right cardiac margin and its upper margin) of Line 1 are extracted. Subsequently, the Euclidean distances of these coordinates to Line 1 are calculated, and the pixel position corresponding to the maximum Euclidean distance is configured as the right cardiophrenic angle C1. Finally, the line segment between the right costophrenic angle B1 and right cardiophrenic angle C1 on the right lung edge is configured as the right hemi-diaphragm B1C1. After the right hemi-diaphragm B1C1 is located, the left hemi-diaphragm B2C2 is located based on the left lung edge and the right cardiophrenic angle C1. Similarly, left apex pulmonis A2 (left lung top) and left costophrenic angle B2 (left lung bottom) were detected, respectively. Then, the left apex pulmonis A2 and left costophrenic angle B2 are connected to obtain Line 2. Furthermore, the right cardiophrenic angle C1 subtracts the displacement Δ y in the y-direction to obtain an auxiliary detection point C2’. Subsequently, the coordinates of all pixels in the left lung edge from the left costophrenic angle B2 and auxiliary detection point C2’ on the left side (the left cardiac margin) of Line 2 are extracted. The Euclidean distances of these coordinates to Line 2 are calculated, and the pixel position corresponding to the maximum Euclidean distance is configured as the left cardiophrenic angle C2. Finally, the line segment between the left costophrenic angle B2 and left cardiophrenic angle C2 on the left lung edge is configured as the left hemi-diaphragm B2C2. In addition, we also have provided the specific mathematical formulas for the above hemi-diaphragm localization algorithm. Specifically, the mathematical expressions for Lines 1 and 2 are shown in equations (8) and (10), respectively. Subsequently, the coordinates of the right cardiophrenic angle C1 and left cardiophrenic angle C2 are determined by equations (9), (11), and (12), respectively.
Where, one-dimensional vector Evaluation metrics for hemi-diaphragm detection The average error Errori,j between the detection points Pi,j (x, y) and their ground truths Gi,j(x*, y*) are calculated by equation (13), respectively.

The schematic diagram of the edge detection algorithm for locating the edges of the left and right lungs.

The hemi-diaphragm localization algorithm schematic diagram for the left and right lungs.
This section comprehensively presents the results of lung field segmentation and hemi-diaphragm detection based on the above materials and methods.
Lung field segmentation results
These five segmentation models perform good performance on test sets T1 and T2. Figures 5 and 6 show the visualized lung field segmentation results of the test set T1 (21×512×512 static P-A CXR images) and the test set T2 (13×512×512 dynamic P-A CXR images) based on various trained CNN models. Meanwhile, Table 2 reports the performance of these trained CNN models on the test set T1(21 static P-A CXR images).

Visualized lung field segmentation results of the test set T1 (21×512×512 static P-A CXR images) based on various trained CNN models. (

Visualized lung field segmentation results of the test set T2 (13×512×512 dynamic P-A CXR images) based on various trained CNN models. (
Performance of various trained CNN models on the test set T1(21 static P-A CXR images)
Specifically, compared to other segmentation models, the segmentation model AttU-Net performs the best on test set 1, achieving 99.04±0.69 of accuracy, 98.34±1.45 of precision, 97.66±2.15 of recall, 97.98±1.43 of dice, 96.08±2.70 of IoU, and 5.12±4.28 of 95th HD. Besides, the CD algorithm further eliminates the problem of over-segmentation that may arise from these segmentation models. The best performance of the segmentation model AttU-Net with CD is improved to 99.05±0.69 of accuracy, 98.36±1.44 of precision, 97.67±2.14 of recall, 97.99±1.43 of dice, 96.11±2.70 of IoU, and 5.02±4.15 of 95th HD.
Figures 7 and 8 show the visualized hemi-diaphragm detection results of the 21 static and 13 dynamic P-A CXR images based on five trained CNN models. Meanwhile, Tables 3 and 4 report the average error distances of key points 1–4 in the test set T1 (21×512×512 static P-A CXR images) and T2 (13×512×512 dynamic P-A CXR images) based on various trained CNN models.

Visualized hemi-diaphragm detection results of the 21 static P-A CXR images based on various trained CNN models. (

Visualized hemi-diaphragm detection of the 13 dynamic P-A CXR images based on various trained CNN models. (
Average distance error of key points 1–4 in the test set T1 (21×512×512 static P-A CXR images) based on various trained CNN models
Average distance error of key points 1–4 in the test set T2 (13×512×512 dynamic P-A CXR images) based on various trained CNN models
Specifically, the visualized hemi-diaphragm detection results of each CXR image in 21 static and 13 dynamic P-A CXR images based on these five trained CNN models are provided in

Typical visualized hemi-diaphragm detection results of a normal case in the test set T1 (21×512×512 static P-A CXR images) based on various trained CNN models. (a) FCN + CD; (b) SegNet + CD; (c) U-Net + CD; (d) ResU-Net++ + CD; (e) AttU-Net + CD.

Typical visualized hemi-diaphragm detection results of a tuberculosis case in the test set T1 (21×;512×512 static P-A CXR images) based on various trained CNN models. (a) FCN + CD; (b) SegNet + CD; (c) U-Net + CD; (d) ResU-Net++ + CD; (e) AttU-Net + CD.

Typical visualized hemi-diaphragm detection results of a dynamic case in the test set T2 (13×512×512 dynamic P-A CXR images) based on various trained CNN models. (a) FCN + CD; (b) SegNet + CD; (c) U-Net + CD; (d) ResU-Net++ + CD; (e) AttU-Net + CD.
Specifically, Tables 3 and 4 report the Euclidean distance error of the key four points between the detection and the ground truth based on these five trained CNN models. Results show that the mean errors of the four key hemi-diaphragm points in the 21 static P-A CXR images based on these five different segmentation models are 9.05, 7.19, 7.92, 7.27, and 6.73 pixels, respectively. Besides, the results also show that the mean errors of these four key hemi-diaphragm points in the 13 dynamic P-A CXR images based on these segmentation models are 5.50, 7.07, 4.43, 4.74, and 6.24 pixels, respectively. Based on the above, the hemi-diaphragm localization algorithm based on AttU-Net + CD performs best on the test set T1, achieving the minimum mean Euclidean distance error of 6.73 pixels. Similarly, the segmentation model AttU-Net with CD performs best of all segmentation models. Besides, the hemi-diaphragm localization algorithm based on U-Net + CD performs best on the test set T2, achieving the least mean Euclidean distance error of 4.43 pixels.
More specifically, the average distance error of point 1 (the costophrenic angel of the right lung field) based on these segmentation models are 6.305 (≈(6.58 + 6.03)/2), 5.715 (≈(5.46 + 5.97)/2), 5.370(≈(7.64 + 3.10)/2), 5.590(≈(5.99 + 5.19)/2), and 5.785(≈(5.72 + 5.85)/2) pixels, respectively. The average distance error of point 2 (the cardiophrenic angel of the right lung field) based on these five different segmentation models are 4.940(≈(6.41 + 3.47)/2), 4.720(≈(5.50 + 3.94)/2), 5.060(≈(5.61 + 4.51)/2), 4.080(≈(4.59 + 3.57)/2), and 4.290((4.59 + 3.99)/2) pixels, respectively. The average distance error of point 3 (the cardiophrenic angel of the left lung field) based on these five different segmentation models are 7.735(≈(8.93 + 6.54)/2), 9.870(≈(6.93 + 12.18)/2), 7.405(≈(9.74 + 5.07)/2), 6.790(≈(8.84 + 4.74)/2), and 8.780(≈(7.82 + 9.74)/2) pixels, respectively. The average distance error of point 4 (the costophrenic angel of the left lung field) based on these segmentation models are 10.125(≈(14.27 + 5.98)/2), 8.220(≈(10.89 + 5.55)/2), 6.860(≈(8.68 + 5.04)/2), 7.555(≈(9.66 + 5.45)/2), and 7.085(≈(8.80 + 5.37)/2) pixels, respectively. The mean errors of these four key hemi-diaphragm points based on these segmentation models are 7.275, 7.130, 6.175, 6.005, and 6.485 pixels, respectively.
This section conducts the following discussion and points out this study’s limitations and the future direction based on the experimental results.
The data diversity of automatic lung field segmentation in routine CXR imaging
A robust and standard segmentation model of pathological lungs is crucial for quantitative analysis of the lungs based on P-A CXR images. However, the generalization of lung field segmentation models based on P-A CXR images has always been a significant engineering problem in clinical applications [35]. The main reason for this engineering problem is the lack of cross-center P-A CXR images and their diversity.
The data augmentation technology enriches the training set of the P-A CXR images and relieves the engineering problem of generalization in lung field segmentation models [36, 37]. However, data augmentation technology uniformly processes the original P-A CXR images and their ground truths. Therefore, the original P-A CXR images form a single center limit the generalization of lung field segmentation models. Meanwhile, the diversity of pathological P-A CXR images in the training set is also essential for improving the generalization of lung field segmentation models. Therefore, the original P-A CXR images of the cross center and the diversity enable CNN to learn more prior knowledge during training. The original P-A CXR images of the cross center and the diversity and data augmentation techniques fundamentally solve the generalization problem of lung field segmentation models. Finally, a robust and standard segmentation model of pathological lungs is generated for the engineering application.
The CNN structure of the automatic lung field segmentation in routing CXR imaging
Experimental results visually and quantitatively show that the five lung field segmentation models perform well. However, compared with the SegNet, U-net and its improved networks (U-Net, ResU-Net, ResU-Net++, and AttU-Net), boundaries of the lung fields extracted based on the lung field segmentation model of the FCN network have significant jagged patterns. The main reason for these significant jagged patterns is the significant differences in network structure among the FCN network, SegNet, U-net, and its improved networks.
The significant differences in network structures of the FCN network, U-net, and its improved networks lead to the FCN network’s failure to generate the anatomical structure of lung field edges. Specifically, the skip connection in the FCN network is connected by summing the corresponding pixels, while U-Net is the concatenation process of its channels [23, 25]. Therefore, compared to the network structures of U-Net and its improved networks, the FCN network loses shallower prediction results with more detailed features, resulting in jagged boundaries of the lung fields. Meanwhile, like the network structure of U-Net and its improved networks, SegNet also adopts an encoding and decoding structure [24–28]. Unlike U-Net and its improved networks, the pooling index function is set in the encoding process of the SegNet structure. Then, the index position information generated by the pooling index function is used to directly place the features of these positions during the decoding process of unpooling [24]. Therefore, SegNet maintains the detailed features of the lung field edges and achieves good segmentation performance. Compared with the basic U-Net, the performance of its improved networks insignificantly differs on the P-A CXR images of the cross center and the diversity. The U-net’s improved networks may be more suitable for finely segmenting tubular structures such as blood vessels and airways [32].
The lung field morphology for precision hemi-diaphragm detection in P-A CXR images
The lung is located on both sides of the mediastinum in the chest cavity [38]. Because of the diaphragm’s higher right side and the heart’s slightly leftward position, the right lung is shorter and broader, while the left is narrower and longer [15]. Therefore, the right and left lungs are morphologically distinct on the postero-anterior (P-A) P-A CXR images.
The morphology of the right lung contributes to the automatic detection of the diaphragm. Specifically, most lung fields above the transverse fissure belong to the right upper lobe on the P-A CXR images, with only the posterior lower part of the lung field overlapping with the upper part of the lower lobe. In addition, the middle lobe of the right lung is located below the transverse fissure on the P-A CXR images, adjacent to the right cardiac margin, and below the right diaphragm, occupying the right cardiophrenic angel. The outer boundary of the right middle lobe is unclear and does not occupy the right costophrenic angle. However, the proposed method cleverly avoids the outer boundary of the right middle lobe. Therefore, even if the segmentation of the outer boundary is inaccurate, it does not affect the hemi-diaphragm detection on the right lung. Finally, the upper part of the right lower lobe overlaps with the upper right lobe on the P-A CXR images, and the lower part overlaps with the middle lobe. The upper part of the right lower lobe projects above the transverse fissure, and the lower edge contacts the right diaphragm, occupying the right costophrenic angle and adjacent to the right edge of the heart. Therefore, the right cardiophrenic angel is easily determined by the farthest point of the right cardiac margin and its upper margin (the right side of Line 1) from Line 1 constructed by the right apex pulmonis and costophrenic angel on the P-A CXR images.
The range and shape of the upper lobe and upper lobe of the left lung are roughly equivalent to the lung field occupied by the upper and middle lobes of the right lung. However, because of the influence of heart position, the left cardiophrenic angel only forms a protrusion at the left cardiac margin. Therefore, the left cardiophrenic angel is easily determined by the farthest point of the left cardiac margin from Line 2 constructed by the left apex pulmonis and costophrenic angel on the P-A CXR images.
Limitations and future research directions
This study also has some limitations. First, this study only applies some basic CNNs for lung field segmentation. However, this study does not include other state-of-the-art CNN networks or frameworks, such as nnU-net [39]. Nevertheless, the lung field segmentation model based on the above CNNs and the P-A CXR images of the cross center and the diversity performs well for the engineering application. Second, this study still lacks sufficient dynamic P-A CXR images. Therefore, we encourage scholars to further collect more dynamic P-A CXR images to reveal the patterns of hemi-diaphragm movement under different lung diseases [6, 8–14]. Finally, the proposed hemi-diaphragm detection method in this study is limited by the P-A CXR images. Specifically, the fundamental reason is that P-A CXR images, as the most conventional position, can intuitively reflect the diaphragm. Compared with P-A CXR images, Other left anterior oblique, right anterior oblique, and left lateral images CXR may have diaphragm occlusion, which will be unfavorable for hemi-diaphragm detection and its subsequent analysis.
Conclusions
This paper proposes an effective hemi-diaphragm detection method for P-A CXR images based on CNN and graphics. First, a robust and standard segmentation model of pathological lungs for extracting lung fields from P-A CXR images has been developed. Then, a novel localization method of the cardiophrenic angle based on the two-dimensional projection morphology of the left and right lung fields is proposed. Finally, the hemi-diaphragms of the left and right lung are effectively detected. Results show that the mean errors of the four key hemi-diaphragm points in the lung field mask images abstracted from static P-A CXR images based on five different segmentation models are 9.05, 7.19, 7.92, 7.27, and 6.73 pixels, respectively. Besides, the results also show that the mean errors of these four key hemi-diaphragm points in the lung field mask images abstracted from dynamic P-A CXR images based on these segmentation models are 5.50, 7.07, 4.43, 4.74, and 6.24 pixels, respectively. Therefore, our proposed hemi-diaphragm detection method may become an effective tool to assess these vulnerable populations’ diaphragm function for precision healthcare.
Supplementary materials
The visualized hemi-diaphragm detection results of each CXR image in 21 P-A static and 13 dynamic P-A CXR images based on these five trained CNN models are provided in Supplementary materials (s1-s2). Supplementary Materials are available on the website: https://github.com/YingjianYang/Chest-X-ray-images.
Author contributions
Conceptualization, Y.G. and H.C.; methodology, J.Z., P.G., Y.Y., Y.G., and H.C.; software, J.Z., P.G., Y.Y., T.W., and Q.G.; validation, T.W., Q.G., X.Z., Z.O., N.Z., and Y.G.; formal analysis, J.Z., P.G., Y.Y., and Y.G.; investigation, X.Z., Z.O., Z.C., N.Z., and Y.G.; resources, H.C.; data curation, H.C.; writing—original draft preparation, Y.Y., J.Z., and P.G.; writing—review and editing, Y.G. and H.C.; visualization, T.W., Q.G., X.Z., Z.C., and Y.G.; supervision, Y.Y., Y.G., and H.C.; project administration, Y.Y., Y.G., and H.C.; funding acquisition, Y.Y., and H.C. All authors have read and agreed to the published version of the manuscript.
Funding
This research was funded by the ZHONGNANSHAN MEDICAL FOUNDATION OF GUANGDONG PROVINCE, China (ZNSXS-20230001); the National Natural Science Foundation of China (62071311); the special program for key fields of colleges and universities in Guangdong Province (biomedicine and health) of China, grant number (2021ZDZX2008).
Data availability statement
The data supporting this study’s findings are available from the corresponding author upon reasonable request.
Footnotes
Acknowledgments
Thanks to the Department of Radiology, the Second Affiliated Hospital of Guangzhou Medical University, for providing the dataset.
Conflicts of interest
The authors declare no conflicts of interest.
