Optimizing Convolutional Neural Networks for Chronic Obstructive
  Pulmonary Disease Detection in Clinical Computed Tomography Imaging
We aim to optimize the binary detection of Chronic Obstructive Pulmonary
Disease (COPD) based on emphysema presence in the lung with convolutional
neural networks (CNN) by exploring manually adjusted versus automated
window-setting optimization (WSO) on computed tomography (CT) images. 7,194 CT
images (3,597 with COPD; 3,597 healthy controls) from 78 subjects (43 with
COPD; 35 healthy controls) were selected retrospectively (10.2018-12.2019) and
preprocessed. For each image, intensity values were manually clipped to the
emphysema window setting and a baseline 'full-range' window setting.
Class-balanced train, validation, and test sets contained 3,392, 1,114, and
2,688 images. The network backbone was optimized by comparing various CNN
architectures. Furthermore, automated WSO was implemented by adding a
customized layer to the model. The image-level area under the Receiver
Operating Characteristics curve (AUC) [lower, upper limit 95% confidence] was
utilized to compare model variations. Repeated inference (n=7) on the test set
showed that the DenseNet was the most efficient backbone and achieved a mean
AUC of 0.80 [0.76, 0.85] without WSO. Comparably, with input images manually
adjusted to the emphysema window, the DenseNet model predicted COPD with a mean
AUC of 0.86 [0.82, 0.89]. By adding a customized WSO layer to the DenseNet, an
optimal window in the proximity of the emphysema window setting was learned
automatically, and a mean AUC of 0.82 [0.78, 0.86] was achieved. Detection of
COPD with DenseNet models was improved by WSO of CT data to the emphysema
window setting range.
Tina Dorosti, Manuel Schultheiss, Felix Hofmann, Johannes Thalhammer, Luisa Kirchner, Theresa Urban, Franz Pfeiffer, Florian Schaff, Tobias Lasser, Daniela Pfeiffer
Optimizing Convolutional Neural Networks for Chronic Obstructive Pulmonary Disease Detection in Clinical Computed Tomography Imaging

###### Abstract

Chronic Obstructive Pulmonary Disease (COPD) is a leading cause of death worldwide, yet early detection and treatment can prevent the progression of the disease. In contrast to the conventional method of detecting COPD with spirometry tests, X-ray Computed Tomography (CT) scans of the chest provide a measure of morphological changes in the lung. It has been shown that automated detection of COPD can be performed with deep learning models. However, the potential of incorporating optimal window setting selection, typically carried out by clinicians during examination of CT scans for COPD, is generally overlooked in deep learning approaches. We aim to optimize the binary classification of COPD with densely connected convolutional neural networks (DenseNets) through implementation of manual and automated Window-Setting Optimization (WSO) steps. Our dataset consisted of 78 CT scans from the Klinikum rechts der Isar research hospital. Repeated inference on the test set showed that without WSO, the plain DenseNet resulted in a mean slice-level AUC of 0.80\(\pm\)0.05. With input images manually adjusted to the emphysema window setting, the plain DenseNet model predicted COPD with a mean AUC of 0.86\(\pm\)0.04. By automating the WSO through addition of a customized layer to the DenseNet, an optimal window setting in the proximity of the emphysema window setting was learned and a mean AUC of 0.82\(\pm\)0.04 was achieved. Detection of COPD with DenseNet models was optimized by WSO of CT data to the emphysema window setting range, demonstrating the importance of implementing optimal window setting selection in the deep learning pipeline.

Convolutional Neural Network (CNN) emphysema lung Window-Setting Optimization (WSO) X-ray Computed Tomography (CT)

## 1 Introduction

Chronic Obstructive Pulmonary Disease (COPD) refers to a group of respiratory diseases that reduce the exchange of oxygen and carbon-dioxide in the lung. COPD chronically impairs the structure of the lung by narrowing the airways and damaging the air sacs. One of the common diseases associated with COPD is emphysema, which is most often observed in smokers [1]. Although disease progression can be prevented with early detection, COPD is among the
leading causes of death worldwide, with 3.23 million deaths recorded across the globe in 2019 [2]. In addition to increased mortality rates in direct correlation with the disease, patients with COPD are likely to develop comorbid diseases, such as cardiovascular diseases, mental disorders, and other respiratory diseases [3]. Furthermore, with respect to the recent outbreak of the Severe Acute Respiratory Syndrome Coronavirus type 2 (SARS-CoV-2) in 2019 and the associated Coronavirus disease (COVID-19), current research suggests that all-cause mortality risks are higher for individuals with COPD preconditions [4],[5]. With early detection and intervention, the prevalence and negative impacts of COPD can be decreased [3].

A readily-available procedure for the detection of COPD is the spirometry test, whereby a measure of forced exhalation volume less than a reference value is indicative of COPD. The Global Initiative for Chronic Obstructive Lung Disease (GOLD) committee has defined a four-stage progression scale for the diagnosis of COPD based on spirometry measurements, staging from mild (I) to very severe (IV) [1]. Although spirometry reliably detects advanced stages of COPD, results for patients at an early stage of COPD can still be negative despite the presence of chronic symptoms, such as a persistent cough and shortness of breath [6],[1]. Moreover, patients categorized in the same GOLD stage have shown drastic morphological differences in the lung structure [7].

X-ray Computed Tomography (CT) scanning of the chest is an alternative method for the detection of COPD. Chest CT scans provide detailed three-dimensional morphological information about the lung structure. Each volume element is characterized by its Hounsfield Unit (HU) value, a measure of the local attenuation coefficient for X-rays. The three-dimensional information obtained about phenotypic abnormalities and pattern of morphological changes reflecting emphysema allows for detection and control of disease progression even in early stages. In 2015, the Fleischner Society introduced a disease progression scale based on pattern of abnormalities present in CT data that correspond to COPD and emphysema sub-types [7].

In recent years, large scale studies with publicly-available datasets, such as the Evaluation of COPD Longitudinally to Identify Predictive Surrogate End-points (ECLIPSE) and the COPDGene study, have been carried out to investigate the association of COPD with biomarkers, genetic risk factors, and epidemiologic indicators [8],[9]. In parallel, improvements in computation power and machine learning algorithms have made Convolutional Neural Networks (CNN) a popular tool for automated classification and detection tasks in medical imaging. CNNs are a specialized case of machine learning algorithms that can extract features from image data and are often applied to computer vision tasks [10]. Consequently, with rising prevalence of COPD, large imaging datasets, and technological advancements in the field of machine learning, CNNs have been applied to automate binary classification of COPD and have shown promising results [11],[12],[13],[14]. However, model outcomes are still not ready for integration into a computer-aided clinical workflow for efficient and cost-effective COPD diagnosis. CNN research in other areas of medical data analysis, such as e.g. intracranial hemorrhage classification, has shown that the incorporation of clinically-relevant steps in the model workflow can improve the output. In particular, it was found that optimizing clinical window-setting parameters of input CT images greatly affects the output quality. [15],[16],[17].

Since the extant literature on COPD detection using CNNs predominantly focuses on fine-tuning deep learning algorithms, the potential of implementing preprocessing steps to more closely adapt clinical workflow processes has thus far not been explored in detail. Furthermore, relevant literature mainly benefits from the ECLIPSE and COPDGene study datasets, where ground truth labels for the scans are given on the GOLD standard progression scale, instead of the phenotypic-relevant scale introduced by the Fleischner Society [11],[12],[13],[14]. In this work, we aim to optimize the detection of COPD based on emphysema presence in the lung with densely connected CNNs (DenseNets). We adapted a routine clinical-workflow procedure for a total of 78 chest CT scans obtained from the Klinikum rechts der Isar research hospital of the Technical University of Munich. In doing so, the effects of manually-adjusted versus automated window-setting optimization on the binary classification task for differentiation between healthy and COPD patient slices were explored in detail. Our findings demonstrate that diligent preprocessing based on existing radiological knowledge, as well as selecting phenotypically representative ground truth labels positively impact the outcome of COPD detection with CNN models.

## 2 Methods

### Dataset

A total of 78 patients with contrast enhanced chest CTs were retrospectively selected from our picture archiving and communication system at the Klinikum rechts der Isar research hospital between October, 2018 and December, 2019. CT scans included those of patients suffering from different COPD stages (n = 43) and healthy controls (n = 35). Scans that presented conditions or pathologies that did not correspond to COPD, yet could influence lung parenchyma, such as pulmonary congestion or lung cancer, were excluded in the selection process. Imaging was carried out with an IQon Spectral CT scanner (Royal Philips, Netherlands). The CT scans were first anonymized and then graded by three
expert radiologists with four to 12 years of experience. Patient-level grading was based on the six Fleischner Score (FS) categories of absent (FS = 0), trace (FS = 1), mild (FS = 2), moderate (FS = 3), confluent (FS = 4), and advanced destructive (FS = 5) emphysema, as per Fleischner society's statement [7]. Scans with FS \(>\) 2 were considered as the COPD class for our binary classification task. Patients at a moderate COPD stage exhibit many defined areas of low attenuation in the CT scan covering over 5% of the lung region [7]. Therefore, to distinguish slices presenting COPD from other slices, CT scans with an FS = 3 were further annotated on slice-level basis by a radiologist not involved in the initial FS grading process. Datasets were selected on slice-level basis as such: Training and validation sets each included 3,392 and 1,114 slices, respectively. A total of 2,688 slices were reserved for the test set. All sets contained equal number of slices from the COPD and the no COPD class.

### Data preprocessing

As an initial preprocessing step, each slice was multiplied by its corresponding lung segmentation mask, generated with a commercially available software (IntelliSpace, Royal Philips, Netherlands). The 256x256 pixel images were clipped to the respective window setting and normalized to values between zero and one. A window setting is given by the window width and the window level (WW, WL) in HU as standardized by radiologists. Note that the WL defines the mid-point value of a window setting. Here, the emphysema window (124, -962) HU was used to clip the CT images for classification of COPD. Furthermore, a 'full-range' windowing (2048, 0) HU was applied to introduce a base-line intensity range for all slices. The (WW\({}_{\text{full-range}}\), WL\({}_{\text{full-range}}\)) values were set based on the minimum, -1024 HU, and the maximum, 966 HU, intensity values recorded over all slices. Figure 1 shows an example slice from the no COPD class in (a, b), and a slice from the COPD class in (c-f). The slices were preprocessed to the full-range window setting in Figure 1(a, c, e) and to the emphysema window setting in (b, d, f). The nonhomogeneous patches of low attenuation corresponding to emphysema are emphasized with a stronger contrast in Figure 1(d) compared to the full-range window setting in Figure 1(c).

Figure 1: Example slices from the test set corresponding to (a, b) a patient (FS = 0) in the no COPD class and (c–f) a patient (FS = 4) in the COPD class. Slices are clipped to (a, c, e) the full-range and (b, d, f) the emphysema window settings. The segmented lung region is shown in (a–d).
### Implementation of DenseNets

Three DenseNets with minor differences in their architectures and training process were compared to examine the effects of window setting on COPD detection. The models were implemented with the TensorFlow platform (version 2.4.0) [18].

#### 2.3.1 Plain DenseNet

The DenseNet with 121 layers (plain DenseNet) was chosen as it has been shown to outperform other CNNs such as VGGNet, AlexNet, ResNet, and DenseNet201 for COPD classification [19]. Figure 2 depicts the architecture of the DenseNet model used in this work as introduced by [20] with a growth rate of 32. All models were compiled with a binary cross entropy loss and the Adam optimizer [21]. Early stopping and reduced learning rate were scheduled for the training process over 50 and 15 epochs respectively. A learning rate of 0.01 was initially set and reduced by a factor of 10 after 15 epochs if the validation loss did not reduce. The aforementioned parameters were set empirically. To analyze the influence of preprocessed input slices to different window settings on classification of COPD, the plain DenseNet model was trained and tested on images linearly clipped to the full-range and the emphysema window settings.

#### 2.3.2 DenseNet with Added Window-Setting Optimization Layer (DenseNetwso)

A window-setting optimization (WSO) layer was added to the aforementioned DenseNet as suggested by [16]. Both a Rectified Linear Unit (ReLU) function and a sigmoid function were initially considered for the WSO layer. The ReLU variant consistently outperformed the sigmoid variant for the validation set. Therefore, only DenseNetwso models with a ReLU activation function in the WSO layer are considered here. As depicted in Figure 2, the WSO layer consisted of a 1x1 convolution layer followed by a ReLU activation function. The ReLU hereby acts as a windowing function, trained

Figure 2: DenseNet architecture used for binary classification of COPD. The model constituents, Dense Block (DB), Dense Layer (DL), and Transition Layer (TL), are expanded in detail. The convolution (conv) and pooling (pool) layers are described by their stride (s) and padding (p) parameters. DenseNet-characteristic skip connections are shown in the DB and DL. The model had a growth rate of 32. The window-setting optimization (WSO) layer consisted of a 1x1 convolution layer followed by a ReLU activation and was used for automatic optimization of the window setting in the DenseNetwso and DenseNetNF implementations. The architecturally specific vertical digits for each box represent the side length dimensions, and the numbers over each block correspond to the number of filters. Adapted from [22].
to find an optimal window setting for the classification task. The WW and WL values were related to the learnable weight (w) and bias (b) parameters of the ReLU function, taken from [16] with correction,

\[f_{\mathrm{ReLU}}(x)=max(min(\mathrm{w}x+\mathrm{b},\mathrm{U}),0),\quad\mathrm{ where}\quad\mathrm{w}=\frac{\mathrm{U}}{\mathrm{WW}},\quad\mathrm{b}=\frac{ \mathrm{U}}{\mathrm{WW}}(\frac{\mathrm{WW}}{2}-\mathrm{WL}). \tag{1}\]

The parameter U sets the upper bound for the ReLU windowing function. Therefore, to achieve learned window settings that range between zero and one, the upper limit was set to \(\mathrm{U}=1\). The DenseNetwso model was trained to converge to an optimal window setting after being initialized to the full-range and the emphysema window settings, while simultaneously adjusting learnable parameters of the DenseNet block for classification of COPD. Initialization of the WSO layer was carried out by defining the learnable parameters for each window setting respectively. To do so, all input slices for DenseNetwso were given in the full-range window setting and normalized. The optimal window settings learned by the model were calculated using (1). All other architectural elements and training processes were identical to that of the plain DenseNet.

#### 2.3.3 DenseNetwso with Sequentially Trained WSO Parameters (DenseNetFNF)

The learned window setting by the DenseNetwso model after initialization to the full-range window setting exhibited large standard deviations over seven runs, as described in subsection 3.2. In an attempt to stabilize the learned window setting over all runs, the DenseNetwso model was first trained with the learnable parameters from the WSO layer, w and b, frozen. In doing so, the clipping parameters from the WSO layer were fixed to the initialized settings. Then, the model was further trained with the WSO layer unfrozen, which allowed its parameters to adjust for the optimal window setting. Additionally, the same model was trained continuously for a third round, again with the learnable parameters of the WSO layer frozen. We refer to this sequence of training with frozen, not-frozen, and frozen (FNF) WSO layer learnable parameters as DenseNetFNF. Similar to DenseNetwso, all input slices for DenseNetFNF were clipped to the full-range windowing and normalized. All other architectural elements and training processes were identical to that of the plain DenseNet.

### Evaluation Metrics

Training was repeated seven times and each run was inferred on once with the test data. The Receiver Operating Characteristics (ROC) curve, and area under the ROC curve (AUC) were used to assess the performance of DenseNet models with different window settings on the binary classification task. As the AUC utilizes different threshold choices, this metric was considered over the conventional accuracy metric. Additionally, for smaller sample sizes, the choice of maximizing for sensitivity or (\(1-\)specificity) becomes ambiguous since there is an inherent trade-off between the two parameters. Therefore, the AUC value was taken as the evaluation metric to resolve any ambiguities based on the choice of threshold by providing the highest value for the best observer while independent of the choice of a threshold [23]. The Scikit-learn library (version 1.2.0) was used to generate the ROC curves, choose optimal thresholds for each curve, and calculate the respective AUC values [24].

## 3 Results

This section presents the classification results of the three DenseNet variants.

### Manually-adjusted WSO

Using the plain DenseNet model, slice-level ROC plots with corresponding AUC values were compared between full-range and emphysema window settings in Figure 3. Since the test set had balanced slices from both classes of no COPD and COPD, the chance diagonal was used as a visual guide to mark the AUC value of 0.5. We see in Figure 3 that clipping data to emphysema window setting allows the model to consistently achieve better results (mean AUC = 0.86\(\pm\)0.04) in comparison to the full-range window setting (mean AUC = 0.80\(\pm\)0.05). The single highest AUC value of 0.91 corresponded to the plain DenseNet model with the input slices preprocessed to the emphysema window setting.

### Automatically-adjusted WSO

The window-setting values in Table 1 correspond to the mean and standard deviation values for WW and WL over the seven runs of each arrangement. The information in Table 1 is independent of the inference data set, as the learned window-setting values are fixed model-specific parameters after a completed training run. The learned WW and WL
parameters were calculated from the weights and bias values of the WSO layer using (1). Figure 4 shows the learned and the corresponding initialization window setting for each WSO model. Note that the window settings used for initialization of WSO models were the same as the parameters used for clipping the inputs to the plain DenseNet.
We notice a shift towards the lower end of the HU range in all learned window settings, as given by Table 1 and Figure 4. The mean learned WL decreased more drastically for models initialized to the full-range window setting. The observed trends suggest a convergence towards the standard emphysema window setting for the learned WW and WL parameters by both DenseNetwso and DenseNetFNF when initialized to the full-range window setting. Between the two models, DenseNetNF learned a window setting closer to the emphysema window setting regardless of initialization window setting. However, when initialized to the full-range window, the DenseNetFNF arrived at the mean WW and WL parameters over seven runs with less deviation in comparison to when the model was initialized to the emphysema window. Overall, we see that when the learned window setting is closer to the standard emphysema window, the better mean AUC values are achieved.

Figure 6 and Figure 6 depict the ROC curves for DenseNetWSO and DenseNetFNF models respectively. We observe that initialization to emphysema windowing results in more consistent AUC values over seven runs compared to the full-range window setting for the DenseNetWSO model. Conversely, for the DenseNetFNF model, initialization to the full-range window generates more consistent AUC values over seven runs compared to the emphysema window setting. These results are in agreement with the standard deviation values given in Table 1. The highest AUC value achieved between the DenseNetWSO and the DenseNetFNF models was 0.91. This corresponded to the emphysema window setting initialization for the DenseNetFNF model.

### Optimal Window Setting for COPD Detection

The mean AUC values for all model and window setting combinations for inference on the same test set are provided in Table 2. Overall, the plain DenseNet with input slices initialized to the emphysema window setting resulted in the best
mean AUC value at 0.86\(\pm\)0.04 over all runs. Implementation of the WSO layer in DenseNet\({}_{\text{WSO}}\) and DenseNet\({}_{\text{FNF}}\) models did not drastically enhance the AUC compared to the results obtained with the plain DenseNet. Taking the plain DenseNet model with full-range input images as baseline, the DenseNet\({}_{\text{FNF}}\) model generated slightly better AUC values when initialized to either window setting. However, The most optimal window setting for the COPD detection task was the standard emphysema window setting of (124, -962) HU and not a window setting learned by either of the automated WSO models.

## 4 Discussion

Results in Table 2 indicate that adjusting input slices to different window settings directly impacts the binary classification of COPD. Looking closer at the plain DenseNet model, clipping the input data to different window settings influenced the AUC values: with AUC values for the plain DenseNet model for full-range input data as baseline, when the input was clipped to the emphysema window, the AUC values increased from 0.80 to 0.86.

The AUC values for the DenseNet\({}_{\text{WSO}}\) model in Table 2 suggest the shortcoming of the model in simultaneously detecting COPD and converging to optimal windowing parameters when initialized to the full-range window setting. Furthermore, the windowing parameters learned with this setup suffered from large standard deviations between the seven runs, as seen in Table 1. Lower standard deviations in learned window settings were observed when the WSO layer was trained with periodically frozen learnable parameters, as implemented in DenseNet\({}_{\text{FNF}}\) initialized to the full-range window setting.

Through automatic WSO, only minimal improvement in AUC value was observed with the DenseNet\({}_{\text{WSO}}\) and the DenseNet\({}_{\text{FNF}}\) models initialized to emphysema window setting, in comparison to the baseline. The window settings learned by these two models were in the vicinity of the standard emphysema window at the lower ranges of the HU scale. However, neither DenseNet\({}_{\text{WSO}}\) nor DenseNet\({}_{\text{FNF}}\) outperformed the mean AUC values obtained with the plain DenseNet model with images clipped to the standard emphysema window setting. A possible explanation is that although the single WSO layer was effective in converging to the optimal emphysema window setting, it was not sufficiently complex for the task of optimal window setting selection.

The standard emphysema windowing is tailored to present high contrast between healthy and emphysematous tissue in the lung. Therefore, as the ground truth labels for our dataset were graded based on the severity of emphysema, the results were in line with the hypothesis that slices clipped directly to the standard emphysema windowing, or automatically clipped with the WSO layer to learned window-setting parameters in the proximity of standard emphysema window, would improve classification of COPD with DenseNets. Optimizing for window setting as a means of increasing contrast in slices was effective for the detection task because the Fleischner Score (FS) ground-truth labels were directly based on disease-relevant morphological changes in the lung. Therefore, for models trained with spirometry-based GOLD standard COPD stages as ground truth label for lung CTs, adjusting input data based on window setting could potentially not be as effective. Utilizing FS as ground-truth labels also enabled us to achieve comparable results to related works in the literature, despite our use of a considerably smaller dataset [12],[13],[14].

The main limitation of this work was its small dataset, giving rise to intra-slice correlation for slice-level evaluations. Additionally, all patients were examined at the same hospital. Extendability of our findings to a larger, more diverse dataset should be further explored. In the context of COPD, future works could further explore categorical classification of the disease based on the progression scale introduced by the Fleischner society.

We showed that optimizing for a task-specific window-setting improved CNN outcome by enhancing disease-relevant information from the input data. Our findings can be extended to a range of computer vision tasks in medicine focusing on X-ray and CT data. Specifically, when disease relevant window settings are commonly used by radiologists, that information can be extended to the deep learning pipeline.

\begin{table}
\begin{tabular}{l c c} \hline \hline Model \(\text{Windowing}\) & Full-range & Emphysema \\ \hline Plain DenseNet & 0.80\(\pm\) 0.05 & **0.86\(\pm\) 0.04** \\ DenseNet\({}_{\text{seq}}\) & 0.79\(\pm\) 0.07 & 0.81\(\pm\) 0.04 \\ DenseNet\({}_{\text{FNF}}\) & 0.81\(\pm\) 0.03 & 0.82\(\pm\) 0.04 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Mean and standard deviation AUC values from test set inference on each model and window setting combination calculated over seven runs.
## 5 Conclusion

Our results demonstrate the importance of incorporating the common clinical workflow process of window setting selection for CT scans in the CNN pipeline for binary classification of COPD. Specifically, preprocessing CT images to emphysema window setting improved the plain DenseNet model's performance. Furthermore, we showed that when information regarding the optimal window setting for classification of COPD is unknown, learning an optimal windowing through the addition of a WSO layer with the DenseNet\({}_{\text{FNF}}\) model would result in higher AUC values in comparison to training a plain DenseNet model with full-range normalized slices.
