{"doi":"10.37933/nipes/7.4.2025.si87","title":"Evaluating the performance of Transformer and Ensemble Pre-trained models for Pneumonia Detection in X-ray Images","abstract":"Over the years, many infectious diseases have resulted in the deaths of numerous promising lives. One such disease is pneumonia, an infection of the lungs that affects the pulmonary alveoli and is caused by various bacteria, viruses, and fungi. Timely and accurate detection of the disease plays a crucial role in medical treatment, with chest X-rays frequently used as the primary imaging modality for diagnosis. Given the proven effectiveness of deep learning models in diagnosing pneumonia, it is essential to determine the best-performing model to ensure accurate and reliable results. In this study, standalone deep learning models were developed using VGG19, AlexNet, and DenseNet121 pre-trained CNN models. Additionally, a vision transformer-based model was developed using the ViT16-224 vision transformer. The pre-trained CNN models—VGG19, AlexNet, and DenseNet121—were then ensemble using a soft-voting technique. The study utilized an unbalanced dataset publicly available on Kaggle. The evaluation of the models shows that DenseNet121 and the ensemble model outperform the ViT16-224 vision transformer-based model across all metrics, with the ensemble model achieving the highest performance, with an accuracy of 94.20%, a precision of 97.9%, and an F1-score of 98.60%. The study concludes that CNN models outperform vision transformer models in tasks that rely on localized features, due to its convolution architecture, particularly when dealing with small and imbalanced datasets for classification tasks.","journal":"NIPES Journal of Science and Technology Research","year":2025,"id":587775,"datarank":0.0,"base_score":0.0,"endowment":0.0,"self_citation_contribution":0.0,"citation_network_contribution":0.0,"self_endowment_contribution":0.0,"citer_contribution":0.0,"corpus_percentile":null,"corpus_rank":null,"citation_count":0,"citer_count":0,"citers_with_citation_signal":0,"citers_with_endowment":0,"datacite_reuse_total":0,"is_dataset":false,"is_dataset_confidence":0.9571,"is_data_producer":false,"deposit_databanks":null,"is_oa":true,"file_count":0,"downloads":0,"has_version_chain":false,"published_date":"2025-01-01","fair_score":null,"fair_percentile":null,"algorithm_id":"datarank_citation_only_1hop_v6","ranking_scope":"data_only","authors":[{"id":1503962,"name":"Blessing Oluwatobi Olorunfemi","orcid":null,"position":1,"is_corresponding":false},{"id":1503963,"name":"Michael Olugbenga Abolarinwa","orcid":null,"position":2,"is_corresponding":false},{"id":617421,"name":"Olufunmilayo Olopade","orcid":null,"position":3,"is_corresponding":false},{"id":361128,"name":"Benjamin S. Aribisala","orcid":"0000-0002-6290-1707","position":4,"is_corresponding":false},{"id":1503343,"name":"Adenike Adegoke-Elijah","orcid":"0009-0005-4423-2297","position":0,"is_corresponding":true}],"reference_count":0,"raw_metadata":null,"created_at":"2026-07-19T02:59:39.958043Z","pmid":null,"pmcid":null,"fwci":null,"citation_percentile":null,"influential_citations":0,"oa_status":null,"license":null,"views":0,"total_file_size_bytes":0,"version_count":0,"fair_f":null,"fair_a":null,"fair_i":null,"fair_r":null,"fair_zscore":null,"fair_rationale":null,"fair_model":null,"fair_agent_version":null,"fair_fulltext_source":null,"fair_has_llm":null,"fair_computed_at":null,"clinical_trials":[],"software_tools":[],"db_accessions":[],"linked_datasets":[],"topics":[]}