## 2 Materials and Methods
### Model Architecture  
We chose EfficientNet B5 as the base architecture of our analysis. EfficientNet [63] is a family of CNN (Convolutional Neural Network) architectures released in 2019 that achieved state-of-the-art (SOTA) metrics on large-scale image classification benchmarks, with focus on reducing model size and computational cost. This was achieved by using _compound scaling_, which applies a set of constants to uniformly scale model depth, width, and input resolution simultaneously (instead of only increasing one dimension of network capacity). This balanced approach yielded several models (from B0 to B7) that progressively increased parameter count, image resolution, and computational cost, with the benefit of better classification performance.  
There are several reasons for the selection of this architecture. First, some recent studies suggest EfficientNet architecture (in particular, EfficientNet B3) may be superior to DenseNet121 [64] (previously the most common and best-performing amongst other architectures) in the setting of chest X-ray classification [38; 65].  
Second, because some papers reflect the importance of the image size in the detection of pneumothorax (particularly in small pneumothorax). While 224 \(\times\) 224 was the standard for some architectures (ResNet50 and DenseNet121) due to the usage of ImageNet pretraining, pneumothorax detection seems to benefit from larger image sizes, even up to 1024 \(\times\) 1024 [66; 67; 68]. Thus, we selected an architecture that we could train using a local GPU, has enough inference speed to enable triaging, and could benefit from an already available ImageNet-pretrained model.  
We adopted a two-stage training pipeline to leverage both general and radiological image features. First, we used the EfficientNet B5-pretrained model (on ImageNet general-purpose images), where we applied domain-specific intermediate pretraining on a binary task (frontal vs. lateral radiographic view) using a subset of all datasets combined, by retaining the last three convolutional blocks (blocks 5, 6, and 7 from the original architecture). This helps the model to learn fine features specific to the radiology domain [69]. After that, we froze all the weights from the base architecture and replaced the classification head of the model to suit the final classification task for pneumothorax classification, with gradual unfreezing of blocks 7, 6, and 5 after several epochs.  
Instead of training a plain binary pneumothorax classification model, we designed a multi-label model with three classes: _pneumothorax_, _no_finding_ (if images contained any pathology or disease), and _support_devices_ (if images contained external devices such as pacemakers, chest tubes, endotracheal tubes, etc.). While pneumothorax was the primary classification goal, two auxiliary outputs were included to mitigate the potential effect of confounder biases, rather than as targets of clinical interest. That allowed the model to learn to differentiate different devices from chest tubes, and also to detect features of pathologies that may be correlated with pneumothorax but are independent.  
Training was performed for 20 epochs with batch size 8, using weighted binary cross entropy loss (which allows us to leverage the importance of each label to give more weight to pneumothorax detection itself, using a weighted value of 5) and Adam optimizer with a  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Dataset** & **\# Images** & **\# Pneumothorax** \\ \hline BRAX & 19,429 & 158 (0.81\%) \\ CANDID-PTX & 19,237 & 3196 (16.61\%) \\ Indiana & 3822 & 28 (0.73\%) \\ PTX-498 & 498 & 498 (100\%) \\ CRADI & 10,440 & 201 (1.93\%) \\
**Total** & 53,429 & 4081 (7.64\%) \\ \hline \hline \end{tabular}
\end{table}
Table 3: Test datasets used in our work.  
starting learning rate of \(1\times 10^{-4}\), reducing the learning rate automatically by a factor of two if the pneumothorax validation AUROC did not improve after two epochs.