Pneumothorax, which refers to the presence of air within the pleural cavity and may cause fatal consequences for a patient, necessitates timely and precise diagnosis. Existing approaches to pneumothorax detection based on analysis of chest X-rays manually tend to be both time-consuming and error-prone. In this regard, the current project seeks to develop an automated approach that will allow detecting and segmenting pneumothorax accurately via deep learning models. With the use of convolutional neural networks (CNNs), especially the ones that rely on U-Net architecture, the model learns to detect and segment the areas affected by the condition from chest X-rays. Such an algorithm is intended to help radiologists with diagnostics and improve their workflow efficiency. Specifically, the proposed solution includes a web application that can take chest X-rays from users, analyze them, and show segmented areas on X-rays instantly. In this way, AI-based pneumothorax detection and segmentation will enable more rapid and precise clinical decisions regarding the disease treatment. The model has been developed with the help of PyTorch, using a U-Net architecture and EfficientNet-B3 encoder, having achieved approximately 0.47 Dice score for validation.
Introduction
Traditional manual analysis of X-rays is slow and prone to errors, so the project proposes an automated deep learning solution using Convolutional Neural Networks (CNNs), specifically a U-Net architecture with an EfficientNet-B3 encoder. The model is trained to identify and segment affected lung regions in chest X-ray images, helping radiologists improve diagnostic speed and accuracy.
The system is implemented as a web application where users can upload X-ray images and receive instant analysis with highlighted segmented areas showing the pneumothorax.
Developed using PyTorch, the model achieved a validation Dice score of about 0.47, demonstrating moderate segmentation performance and highlighting its potential as a clinical decision-support tool for faster and more accurate diagnosis.
Conclusion
This project sought to develop an automated system that could detect and segment pneumothorax from chest X-ray images through the use of deep learning. This goal was accomplished as an end-to-end system that included preprocessing, data augmentation, model training, evaluation, and visualization of results. A model architecture based on U-Net segmentation and the EfficientNet-B3 encoder was constructed using the Python framework, PyTorch. The model was trained on chest X-rays labeled for the presence of pneumothorax, with class balancing performed through the use of a hybrid loss function. The model showed the capability of learning features and accurately segmenting pneumothorax areas in the images.
References
[1] Sowmia K. R., et al. (2024). Unmasking Pneumothorax: Deep Learning Approaches to Accurate Classification and Segmentation. IEEE.
[2] Manikandan, J., et al. (2023). Segmentation and Detection of Pneumothorax Utilizing Deep Learning. IEEE.
[3] Asghari, M., et al. (2025). Spontaneous Pneumothorax Detection Using CNN in Chest X-Rays. ISJ Trend.
[4] Lee, S., et al. (2024). Factors Leading to Increasing PPV for Pneumothorax Detection Utilizing Artificial Intelligence. Nature Scientific Reports.
[5] Dumbrique, et al. (2024). FCNN for Patch-Based Detection and Segmentation of Pneumothorax. Frontiers in Radiology.
[6] Sae-Lim, W., et al. (2024). Automated Method for Pneumothorax Segmentation and Quantification. ScienceDirect.
[7] Caturla, et al. (2025). Automatic Pneumothorax Detection Using Multi-Source Data. MDPI.
[8] Monti, et al. (2025). Diagnostic Performance of AI for Pneumothorax Detection. Clinical Imaging.
[9] Montgomery, et al. (2023). Detection of Pneumothorax on Ultrasound Using AI. Journal of Trauma.