Abstract
Nasogastric tube (NGT) malpositioning is a significant clinical risk that can lead to severe respiratory complications. This study develops and validates a two-stage deep learning pipeline for the automated localization and detection of NGTs on portable supine chest X-rays. By integrating a DeepLabv3+ segmentation model with a DenseNet121 classification model, the system achieves high diagnostic performance (AUC > 0.96) for malposition detection. Validation across multiple centers and temporal datasets demonstrates the model's robustness and potential as a clinical decision support tool in emergency and intensive care environments.
Introduction
Nasogastric tubes (NGTs) are essential for delivering nutrition and medication to patients unable to swallow. However, blind insertion is prone to errors, such as bronchial or esophageal placement, which can result in life-threatening complications like pneumonia or respiratory failure. Chest X-rays (CXRs) remain the gold standard for verifying tube position, yet their interpretation in acute care settings is often hindered by image noise, the presence of other medical devices, and the lack of immediate radiologist review. This research addresses the need for an automated, reliable verification system to eliminate preventable medical errors associated with NGT placement.
Methods
The proposed computer-aided detection (CAD) system utilizes a two-stage architecture. The first stage employs a DeepLabv3+ model with a ResNeSt50 backbone to segment the NGT, the NGT tip, the lungs, and the diaphragm. A spatially-weighted Dice loss is used to enhance the precision of tip localization, forcing the model to prioritize pixels around the NGT tip. In the second stage, a DenseNet121 classification model receives both the original CXR and the segmentation masks to determine the presence and positioning of the tube. This anatomy-aware approach allows the model to interpret the spatial relationship between the NGT and critical anatomical landmarks.
Datasets
The study leveraged a comprehensive multi-center dataset for training and validation. The NTUH-1519 dataset (5,767 images) served as the primary training set. Temporal validation was performed on the NTUH-20 dataset (955 images), while geographical validation was conducted using the NTUH-YB dataset (656 images) from a separate branch hospital. Additionally, the public CLiP dataset was utilized for external validation to ensure the model's generalizability across different clinical environments.
Results
The system demonstrated exceptional performance across all metrics. NGT presence detection reached an AUC of 0.998. For the critical task of identifying malpositions, the model achieved AUCs between 0.964 and 0.991 on internal validation sets and 0.839 on the external CLiP dataset. Localization performance was also strong, with mean tip-localization errors ranging from 1.64 cm to 2.83 cm. The inclusion of Class Activation Maps (CAMs) provides clinicians with visual evidence of the model's focus, facilitating trust and clinical integration.
Discussion and Conclusion
The results suggest that a two-stage, anatomy-aware deep learning model can effectively identify NGT malpositions on portable X-rays. The model's ability to maintain performance across different institutions and time periods underscores its potential for real-world deployment. While limitations exist regarding data imbalance and the complexity of ICU images, the system offers a promising solution for real-time NGT verification, potentially reducing "never events" and improving patient safety in high-pressure clinical environments.
Summary updated