Lung Disease Diagnosis Based on MRI Data Using CNN Transfer Learning Method with MobileNetV2 and DenseNet121 - Dinar Munggaran Akhmad; Dimas Ramadhan; Eneng Tita Tosida (Universitas Negeri Jakarta, 2026)
Accurate lung disease diagnosis plays a critical role in medical treatment and improving patient outcomes. Conventional diagnostic methods often require experienced radiologists and are time-consuming. This study develops a lung disease diagnosis system based on Magnetic Resonance Imaging (MRI) data using the Convolutional Neural Network (CNN) method with Transfer Learning, specifically utilizing MobileNetV2 and DenseNet121 architectures. The dataset comprises 7,141 MRI images collected from Kaggle and RS Islam Aysha Bogor, classified into nine categories: Bacterial Pneumonia, Covid-19, Normal, Tuberculosis, Pneumothorax, Viral Infection, Asthma, Bronchitis, and Bronchopneumonia. Images were preprocessed to 224×224 pixels with pixel normalization to [0,1]. Four experimental scenarios were evaluated, varying optimizer, learning rate, batch size, and number of epochs. Results showed that MobileNetV2 achieved the best accuracy of 92.14%using RMSprop optimizer, learning rate 0.001, batch size 32, and 40 epochs. DenseNet121 achieved 87.82% accuracy with Adam optimizer under the same configuration. Validation using the confusion matrix yielded an overall accuracy of 91%, precision of 91.37%, recall of 92.25%, and F1-score of 91.79%. The best model was deployed as a web-based application built with Python Flask, enabling automatic image normalization and real-time classification without manual preprocessing. This research demonstrates that CNN-based Transfer Learning is effective for automated lung disease diagnosis with limited datasets