A Hybrid Approach for Differentiating Fibrotic Hypersensitivity Pneumonitis and Idiopathic Pulmonary Fibrosis: Deep Feature Extraction and Machine Learning.
Authors
Affiliations (5)
Affiliations (5)
- Department of Radiology, Tokat Gaziosmanpaşa University Faculty of Medicine, Tokat, Turkey. [email protected].
- Department of Medical Education and Informatics, Tokat Gaziosmanpaşa University Faculty of Medicine, Tokat, Turkey.
- Department of Basic Medical Sciences, Tokat Gaziosmanpaşa University Faculty of Medicine, Tokat, Turkey.
- Department of Radiology, Tokat Gaziosmanpaşa University Faculty of Medicine, Tokat, Turkey.
- Department of Radiology, Kahramanmaraş Necip Fazıl City Hospital, Kahramanmaraş, Turkey.
Abstract
In patients over 60 years of age who are male, non-smokers, and in whom no organic antigen is identified in the history, differentiating fibrotic hypersensitivity pneumonitis (HP) from idiopathic pulmonary fibrosis (IPF) may be challenging. We aimed to evaluate the contribution of deep learning-based feature extraction and machine learning classification in differentiating these two pathologies, which exhibit similar radiological patterns on high-resolution computed tomography (HRCT) images. The study retrospectively included 87 patients (52 IPF, 35 HP). To completely eliminate data leakage and class imbalance-common methodological flaws in medical AI-we implemented a rigorous 10-repeated fivefold patient-level cross-validation strategy combined with hierarchical random undersampling. A pre-trained AlexNet architecture was utilized strictly as a robust feature extractor (via the fc8 layer) without fine-tuning. The extracted 1000-dimensional semantic features were subsequently classified using Support Vector Machine (SVM) and K-Nearest Neighbor (KNN) algorithms. Under strict patient-level isolation across 50 independent training-testing cycles, the SVM classifier achieved an average accuracy of 83.03%, sensitivity of 81.74%, specificity of 84.29%, F1-score of 82.32%, and an area under the curve (AUC) of 91.93%. The KNN classifier yielded an average accuracy of 80.56% and an AUC of 87.66%. By effectively overcoming data leakage and bias, this study demonstrates the true generalization capability of deep feature extraction in distinguishing IPF from fibrotic HP. The proposed framework provides a highly robust and reliable non-invasive decision-support tool for challenging diagnostic scenarios.