Optimizing a CNN–LSTM Model for Respiratory Disease Classification from Lung Sounds
Abstract
Respiratory diseases remain a significant health concern, while accurate identification of respiratory conditions from lung sounds is challenging because acoustic characteristics can overlap among disease categories. This study aims to optimize a Convolutional Neural Network–Long Short-Term Memory (CNN–LSTM) model for multiclass respiratory disease classification from lung sound recordings while addressing class imbalance and limited subject diversity. The study used the Lung Dataset containing 336 recordings from 112 subjects. After excluding subjects with combined diagnoses and consolidating low-frequency categories, 324 recordings from 108 subjects representing seven classes were retained. The audio signals were normalized, standardized to 20 s, and transformed into 64-bin Mel-spectrograms with 160 time steps. CNN was employed to extract time-frequency features, while LSTM modeled temporal dependencies. Model optimization was further evaluated using subject-level 5-fold Group Cross-Validation, data augmentation, Focal Loss, and Class-Balanced Cross-Entropy. The baseline CNN–LSTM achieved an accuracy of 34.85%, precision of 24.61%, recall of 34.85%, and F1-score of 28.22% in the initial evaluation, with a macro-F1 of 14.07%. In the extended cross-validation experiment, the baseline CNN–LSTM achieved a mean accuracy of 35.87 ± 5.43% and macro-F1 of 10.26 ± 3.50%. Among the imbalance-handling strategies, Class-Balanced Cross-Entropy produced the highest macro-F1 of 12.16%, compared with 10.26% for the baseline, although its overall accuracy decreased to 27.52%. The results indicate that the principal challenge is not solely the model architecture but also severe class imbalance and the limited number of independent subjects. Therefore, subject-level validation and class-sensitive evaluation metrics are essential for obtaining a more reliable assessment of respiratory sound classification models. The optimized CNN–LSTM framework demonstrates potential for automated respiratory disease classification, although further validation using larger and more diverse datasets is required before clinical application.
References
Ayappan, G., Sumathi, S., Mani, V., & Jebarani, P. E. (2026). Novel deep learning-based optimization framework for the classification of respiratory diseases using lung sound analysis. Scientific Reports 2026 16:1, 16(1), 19018-. https://doi.org/10.1038/s41598-026-44936-0
Bardou, D., Zhang, K., & Ahmad, S. M. (2018). Lung sounds classification using convolutional neural networks. Artificial Intelligence in Medicine, 88, 58–69. https://doi.org/10.1016/J.ARTMED.2018.04.008
Fraiwan, M., Fraiwan, L., Alkhodari, M., & Hassanin, O. (2021). Recognition of pulmonary diseases from lung sounds using convolutional neural networks and long short-term memory. Journal of Ambient Intelligence and Humanized Computing 2021 13:10, 13(10), 4759–4771. https://doi.org/10.1007/S12652-021-03184-Y
Hochreiter, S., & Schmidhuber, J. (1997). Long Short-Term Memory. Neural Computation, 9(8), 1735–1780. https://doi.org/10.1162/NECO.1997.9.8.1735
Jung, S. Y., Liao, C. H., Wu, Y. S., Yuan, S. M., & Sun, C. T. (2021). Efficiently Classifying Lung Sounds through Depthwise Separable CNN Models with Fused STFT and MFCC Features. Diagnostics 2021, Vol. 11, Page 732, 11(4), 732. https://doi.org/10.3390/DIAGNOSTICS11040732
Kim, Y., Hyon, Y. K., Jung, S. S., Lee, S., Yoo, G., Chung, C., & Ha, T. (2021). Respiratory sound classification for crackles, wheezes, and rhonchi in the clinical field using deep learning. Scientific Reports, 11(1), 1–11. https://doi.org/10.1038/S41598-021-96724-7;SUBJMETA=139,228,692,700;KWRD=DIAGNOSIS,HEALTH+SERVICES
Petmezas, G., Cheimariotis, G. A., Stefanopoulos, L., Rocha, B., Paiva, R. P., Katsaggelos, A. K., & Maglaveras, N. (2022). Automated Lung Sound Classification Using a Hybrid CNN-LSTM Network and Focal Loss Function. Sensors 2022, Vol. 22, Page 1232, 22(3), 1232. https://doi.org/10.3390/S22031232
Serbes, G., Ulukaya, S., & Kahya, Y. P. (2018). An automated lung sound preprocessing and classification system based onspectral analysis methods. IFMBE Proceedings, 66, 45–49. https://doi.org/10.1007/978-981-10-7419-6_8/SAVE-RESEARCH
Wahyudi, A. E., Batau, R., Aziz, F., & Jeffry, J. (2025). A Deep Learning Approach to Respiratory Disease Classification Using Lung Sound Visualization for Telemedicine Applications. Journal of System and Computer Engineering, 6(4), 306–311. https://doi.org/10.61628/JSCE.V6I4.2144
Wang, Zhaoping, & Sun, Z. (2024). Performance evaluation of lung sounds classification using deep learning under variable parameters. EURASIP Journal on Advances in Signal Processing 2024 2024:1, 2024(1), 51-. https://doi.org/10.1186/S13634-024-01148-W
Wang, Zijie, & Wang, Z. (2022). A DOMAIN TRANSFER BASED DATA AUGMENTATION METHOD FOR AUTOMATED RESPIRATORY CLASSIFICATION. ICASSP, IEEE International Conference on Acoustics, Speech and Signal Processing - Proceedings, 2022-May, 9017–9021. https://doi.org/10.1109/ICASSP43922.2022.9746941
Yu, S., Yu, J., Chen, L., Zhu, B., Liang, X., Xie, Y., & Sun, Q. (2025). Advances and Challenges in Respiratory Sound Analysis: A Technique Review Based on the ICBHI2017 Database. Electronics 2025, Vol. 14, Page 2794, 14(14), 2794. https://doi.org/10.3390/ELECTRONICS14142794
Zhang, Y., Huang, Q., Sun, W., Chen, F., Lin, D., & Chen, F. (2024). Research on lung sound classification model based on dual-channel CNN-LSTM algorithm. Biomedical Signal Processing and Control, 94, 106257. https://doi.org/10.1016/J.BSPC.2024.106257





