Next Article in Journal
Machine Learning-Assisted Comparative Analysis of Fracture Propagation Mechanisms in CO2 and Hydraulic Fracturing of Acid-Treated Tight Sandstone
Previous Article in Journal
Penumbra Shadow Representation in Photovoltaics: Comparing Dynamic and Constant Intensity
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

NGBoost Classifier Using Deep Features for Pneumonia Chest X-Ray Classification

1
Department of Information Science and Engineering, JSS Academy of Technical Education, Bengaluru 560060, Karnataka, India
2
Department of Information Science and Engineering, Sri Jayachamarajendra College of Engineering, JSS Science and Technology University, Mysuru 570006, Karnataka, India
*
Author to whom correspondence should be addressed.
Appl. Sci. 2025, 15(17), 9821; https://doi.org/10.3390/app15179821
Submission received: 29 July 2025 / Revised: 30 August 2025 / Accepted: 4 September 2025 / Published: 8 September 2025
(This article belongs to the Section Computing and Artificial Intelligence)

Abstract

Pneumonia remains a major global health concern, leading to significant mortality and morbidity. The identification of pneumonia by chest X-rays can be difficult due to its similarity to other lung disorders. In this paper, Natural Gradiant Boost (NGBoost) classifier is employed on deep features obtained from ResNet50 model to classify chest X-ray images as normal or pneumonia-affected. NGBoost classifier, a probabilistic machine learning model is used in this study to evaluate the discriminative power of handcrafted features like haar, shape and texture and deep features obtained from convolution neural network models like ResNet50, DenseNet121 and VGG16. The dataset used in this study is obtained from the pneumonia RSNA challenge, which consists of 26,684 chest X-ray images. The experimental results show that NGBoost classifier obtained an accuracy of 0.98 using deep features extracted from ResNet50 model. From the analysis, it is found that deep features play an important role in pneumonia chest X-ray classification.

1. Introduction

Inflammation of alveoli in either or both the lungs is a characteristic of pneumonia, a severe respiratory infection usually caused by bacteria, viruses, fungi, or, less commonly, parasites. The disease fills the alveoli with fluid or pus, which generates symptoms such as fever, chills, chest discomfort, coughing up phlegm or pus, and also difficulty in breathing. It may be from mild to fatal, and most often strikes those who are already vulnerable, like the very young, the aged, and individuals with compromised immunity or chronic conditions [1]. The most common cause is a bacterium called streptococcus pneumoniae and viruses such as influenza and SARS-CoV-2 (COVID-19). Successful disease control and prevention of complications like pleural effusion, lung abscess, and respiratory failure rely on efficient diagnosis obtained through clinical assessment and laboratory examination. The most common and cost-effective diagnostic test for detecting pneumonia is chest X-ray imaging; however, due to subtle visual clues, overlapping features with other pulmonary diseases, and inter-observer variation between radiologists, it can be challenging to interpret these images correctly [2].
Recently, to enhance diagnostic accuracy and to facilitate clinical decision-making, numerous studies have explored the application of machine learning methods for the classification of pneumonia based on chest X-ray images in the past few years [3]. In [4], pneumonia was detected using region of interest features and classifiers, namely multilayer perceptron, random forest, and logistic regression. The multilayer perceptron obtained an accuracy of 0.95. Another study was conducted to compare the efficiency of naïve Bayes classifier (NB), k nearest neighbor (kNN), and support vector machine (SVM) to detect pneumonia in children [5]. The SVM selected features namely correlation, average deviation, difference variance, standard deviation gave an accuracy of 0.77. In [6], feature extraction from chest X-ray images were done by 2D discrete wavelet method and fed to the classifiers, namely artificial neural network, random forest, kNN and SVM. The random forest algorithm showed highest performance, with a 0.97 accuracy. In [7], researchers extracted haar, shape, and texture features from chest X-rays, and SVM achieved an accuracy of 0.69.
Many researchers have also employed the convolution neural network (CNN) model for pneumonia classification. In [8], researchers used a parameter optimization method in a 19-layer CNN model which produced an accuracy of 0.96. In [9], the researchers used four deep learning-based transfer learning models. DenseNet201 gave an accuracy of 0.98 for classifying dataset as normal and pneumonia-affected. An accuracy of 0.95 for classifying viral affected and bacteria affected pneumonia was also achieved. In [10], the researchers used DenseNet169 for feature extraction, while the SVM was utilized for classifications, which achieved an accuracy of 0.74. In [11], the researchers designed a customized CNN model to identify pneumonia in chest radiographs. The model gave a 0.93 validation accuracy. Pneumonia detection using the ResNet50 model has previously been used by researchers in [12,13,14]. In [12], reseachers added a few more layers to the ResNet50 model and developed an improved ResNet50 model for classifying pneumonia chest X-ray images with an accuracy of 97%. In [13], researchers developed a ResNet50 model for pneumonia detection and obtained an accuracy of 98.9%. In [14], researchers used ResNet50 model to classify pneumonia chest X-ray images and achieved an accuracy of 88.88%, precision, recall and F1 score of 83%.
Traditional machine learning approaches often face limitations in capturing subtle and complex patterns in chest X-ray images. In contrast, boosting combines the outputs of multiple weak learners to create a strong learner, thereby enhancing the predictive performance. The most commonly used boosting methods are natural gradient boosting (NGBoost), adaptive boosting (AdaBoost), and extreme gradient boosting [15]. Amongst these, NGBoost is a powerful machine learning model that estimates both predictions and associated uncertainties [16]. NGBoost is a probabilistic boosting method, known for its flexibility, interpretability, and better performance in dealing with complex patterns [17]. NGBoost exhibits successful achievements across multiple fields like electrical engineering [18], financial prediction [19], and construction technology [20]. In the field of medical image analysis, NGboost is used in [17,21]. In [21], the researchers used NGBoost classifiers for brain tumor detection. The classifier produced an accuracy of 98.54%. In [17], researchers extracted Xception-based deep features and fed it to NGboost classifier, to classify Monkeypox Skin Lesion Dataset (MSLD). The model gave an accuracy of 98.53%.
In the current study, the commonly used handcrafted features like haar, shape, and texture are extracted and fed as an input to NGBoost classifier. Additionally, deep features were also extracted using widely used CNN models such as ResNet50, DenseNet121, and VGG16 models. The experiments were conducted on 26,684 chest X-ray images obtained from “ChestX-ray8” hospital scale chest X-ray image database of stage 2 RSNA challenge [22].
The paper is structured as follows: Section 2 shows the materials used and methodology incorporated in the study. Section 3 demonstrates the obtained results, and Section 4 draws conclusion based on the obtained results.

2. Materials and Methods

2.1. Dataset and Preprocessing

The dataset used in this study is obtained from ”ChestX-ray8” hospital scale chest X-ray image database, from stage 2 pneumonia radiological society of North America (RSNA) challenge [22]. The stage 2 image dataset consists of 26,684 images, out of which 6012 images are pneumonia-affected, and the rest are normal. Table 1 shows the demographic data of the incorporated dataset. From Table 1, it is observed that the number of persons affected by pneumonia are 6012. The number of males and females affected by pneumonia are 3510 and 2502, respectively. The average age of the number of affected persons is 45 years, and they fall in the range of 26–50 years.
Each patient in the RSNA dataset is associated with only one chest X-ray image, as verified from the metadata file. Hence, a patient-level split was inherently ensured, and there is no possibility of patient overlap or data leakage across training and testing sets.
Data preprocessing is an important task when deploying any deep learning model. The normal lungs do not absorb X-rays, they appear dark in colour in any chest radiographs while the pneumonia-affected regions can be located by identifying a hazy area or a gray dashed shadow. In order to enhance the contrast and brightness of the X-ray image in the dataset, the contrast limited adaptive histogram equalization (CLAHE) algorithm is employed. CLAHE is an image enhancement method designed to improve the contrast of images, particularly in areas with low contrast. It applies histogram equalization to small localized regions rather than the entire image [23].

2.2. Framework for Pneumonia Classification Using NGBoost Classifier

The framework for pneumonia classification consists of preprocessed chest X-ray images using the CLAHE algorithm. Handcrafted features such as haar, shape, and texture and deep features from ResNet50, VGG16, and DenseNet121 are extracted from these preprocessed images. These features are fed as input to the NGBoost classifier for pneumonia chest X-ray classification. The framework of pneumonia classification using NGBoost is shown in Figure 1. The dimension of the input image is 1024 × 1024, and it is of .dicom format. These images are preprocessed using the CLAHE algorithm preserving the spatial dimension. For handcrafted and deep features, the images are transformed into numerical feature vector of dimension 1 × N, where N is the number of features extracted. Haar feature dimension is 1 × 434, shape feature dimension is 1 × 6, and texture feature dimension is 1 × 59. The ResNet50 deep feature dimension is 1 × 2048, VGG16 deep feature dimension is 1 × 512 and DenseNet121 deep feature dimension is 1 × 1024.

2.3. Feature Extraction

Pneumonia often appears as areas of increased opacity or consolidation in chest X-ray images, indicating fluid-filled alveoli due to infection. These opacities are commonly localized in one or more lobes of the lung and may appear as patchy, segmental, or lobar infiltrates. Thus, extracting these kinds of characteristics play an important role in segregating the images as pneumonia-affected and normal. This research work employs handcrafted features and deep features for pneumonia chest X-ray classification.

2.3.1. Handcrafted Features

Handcrafted features are manually designed representations extracted from images based on human expertise and domain knowledge. In this study haar, shape, and texture features are extracted from the chest X-ray images.
Haar Features: Haar features are simple rectangular features used for object detection tasks. They work by comparing the difference in pixel intensity between adjacent rectangular regions. These features capture edge, line, and center-surrounded patterns, which are useful for identifying structural characteristics in an image. Haar features are computed by taking the difference between the sum of pixel intensities in adjacent rectangular regions, mathematically expressed as in Equation (1).
H f = i R white I ( i ) j R black I ( j )
where R white and R black represent the rectangular sub-regions in the haar template designed to capture local contrast and texture, and I ( i ) is the pixel intensity at location i. I ( j ) is the pixel intensity at location j.
From Equation (1), the integral image, a transformed version of the original image is calculated, where each point holds the sum of all pixel intensities above and to the left of that point. Using sliding window approach, the integral image is computed, and haar features are extracted from the entire image [24]. Pneumonia typically causes opacities in lung regions, which appear as irregular, dense patches. Haar features are excellent at capturing intensity changes, such as edges and transitions between dark (air-filled) and bright (fluid-filled or inflamed) regions, which are common in infected lungs. Haar captures these micro-patterns, and haar features are therefore extracted during handcrafted feature extraction in the proposed study.
Shape Features: Shape features focus on capturing the geometric structure and contours of objects in an image. They represent the spatial relationship of object boundaries [25]. Pneumonia causes inflammation of the alveoli, which often leads to fluid accumulation in the lungs. These pathological changes distort the normal shape, boundary, and symmetry of lung fields. Shape features help capture these structural anomalies. In pneumonia cases, the lung contour may appear blurred, asymmetric, or reduced in volume. Shape features can effectively capture these abnormalities and help differentiate between normal and pneumonia-affected lungs. Thus, shape features are extracted for analyzing variations in lung shape and boundary. The shape characteristics extracted in the proposed method are area, perimeter, eccentricity, solidity, extent, and compactness.
Texture Features: Healthy lung tissue has a more uniform texture, while pneumonia introduces coarse or patchy textures. Local binary pattern (LBP) texture descriptors are employed in this work to analyze local pixel neighborhoods to encode patterns [26]. Each pixel is compared with its surrounding neighbors, and a binary code is generated based on whether the neighboring pixels are brighter or darker, using Equation (2). The resulting binary values are then converted into a decimal number that represents the texture at that location using Equation (3).
s ( x ) = 1 if x 0 0 if x < 0
LBP P , R ( x , y ) = p = 0 P 1 s ( I p I c ) · 2 p
LBP features are very useful for classifying pneumonia chest X-ray images, especially because they effectively capture local texture information, which is important for identifying abnormalities in lung tissues. LBP is designed to highlight the texture changes in pneumonia-affected lungs. Thus, LBP features are extracted in this study.

2.3.2. Deep Features

Convolution neural networks automatically learn deep features from the input images. These features are extracted from the fully connected layer of trained networks and are highly effective for tasks like medical image classification. The most widely used deep learning model for medical images are ResNet, DenseNet, VGGNet, and XceptionNet. The ResNet50 model is employed for deep feature extraction in this study. As part of the comparative analysis, the DenseNet121 and VGG16 models are also used.
ResNet50: ResNet50 is a deep residual neural network model that stacks residual blocks of a convolution layer to form a network. When layers are stacked together, and the network goes deeper, the model’s performance becomes saturated and gradually starts to degrade. Thus, to overcome this problem, ResNet uses an identity shortcut connection. The identity shortcut connection skips one or two layers in the middle. The skipped layers are stacked to form an identity block [27]. The ResNet50 model is employed as a feature extraction backbone to classify pneumonia from chest radiograph images due to its proven ability to handle deep network training effectively. Figure 2 shows the ResNet50 model incorporated in this study. It takes the preprocessed image as input, and it undergoes series of convolutions and pooling in order to extract useful information from the images. The stage 1 of the model has a convolutional layer that captures low-level features, followed by batch normalization and a ReLU activation function to introduce non-linearity and improve training stability. A max pooling layer then reduces the spatial dimensions while retaining the most important information. The core of the architecture consists of five stages, each comprising multiple residual blocks with shortcut (identity) connections. These blocks enable the model to learn residual mappings, which help mitigate the vanishing gradient problem in deep networks. As the image progresses through stages 2 to 5, the network learns increasingly complex and abstract features. The output from the final stage is passed through an average pooling layer to reduce dimensionality, then flattened and fed into a fully connected layer. The features stored in the fully connected layer are fetched and given as an input to the NGBoost classifier. From the Figure 2, it is seen that ResNet50 model reduces the 1024 × 1024 .dicom image to 32 × 32 feature map with 2048 channels and after applying average pooling feature vector of 1 × 2048 dimension is obtained.
DenseNet121: DenseNet121 is a densely connected convolution neural network model primarily used for image classification. In DenseNet a layer takes all previous layer feature maps as an input, creating a feature map explosion. In order to overcome this, a dense block is created which contains a pre-specified number of layers [28]. To lower the number of feature maps, the output from each block is deviated to a 1 × 1 convolution layer and a pooling layer. The convolution layer and pooling layer are together called the transition layer.
VGG16: VGG16 is a visual geometry group transfer learning model well known for object detection applications in computer vision. VGG16 has thirteen convolution layers and three fully connected layers. It uses a smaller filter size of 3 × 3 and a stride value of 2 in each of its convolution layers. Five pooling layers are incorporated with max pooling functions. ReLU activation function is used by the first two fully connected layers, and softmax activation function is used by the final fully connected layer [29].

2.4. Classification Using NGBoost

The extracted handcrafted and deep features are fed to the NGBoost classifier. The NGBoost classifier represents an advanced ensemble-based machine learning model that merges gradient boosting methods with uncertainty prediction to create solutions for probabilistic prediction needs. At its core, NGBoost employs decision tree-based learners in an iterative boosting process to progressively refine predictions. NGBoost differentiates from other boosting algorithms by employing natural gradient optimization, to find probability-preserving directions in the parameter space. By using this methodology, the optimization procedure maintains synchronization with statistical data distributions. Hence, NGBoost is employed in the proposed work. The extracted handcrafted and deep features are fed to the NGBoost classifier to classify pneumonia-affected images and normal images. The architectural diagram of the NGBoost classifier along with its feature vector is shown in Figure 3. The input dimension is 1 × 2048 for ResNet50 based deep features and 1 × 449 for concatenated hand features. It also presents an illustration of its operational flow that reveals its distinctive way of performing probabilistic forecasts [15]. Rather than using standard gradients, NGBoost updates parameters using the natural gradient, defined by Equations (4) and (5)
˜ θ L = F 1 θ L
where F is the Fisher Information Matrix. It indicates how much knowledge about a parameter can be gained from the observed data.
F = E θ log p ( y x ; θ ) θ log p ( y x ; θ )
This formulation ensures that parameter updates move in directions that respect the geometry of the underlying probability space, thereby capturing the data’s statistical structure more effectively. The update rule at iteration t is given by Equation (6)
θ t + 1 = θ t η · ˜ θ t L
where η is the learning rate. This process of natural gradient boosting and parameter updating is repeated over a fixed number of estimators to produce accurate classification outcomes.

3. Results

Experiments are conducted on a stage 2 pneumonia RSNA dataset, which consists of 26,684 chest X-ray images, out of which 6012 images are pneumonia-affected, and 20,672 are normal images. The dataset is divided into 70% training and 30% testing data. This work carries an analysis of handcrafted and deep features with respect to the NGBoost classifier. The result section contains various subsections showing parameter configuration and optimization of the proposed model, results of handcrafted features, results of deep features, and comparison results of handcrafted features and deep features with NGBoost classifier.

3.1. Parameter Configuration and Optimization

Parameter selection plays a vital role in improving the performance of any machine learning or deep learning model [8]. The proposed framework for pneumonia chest classification employs a deep learning model for feature extraction and NGBoost for classification. The NGBoost classifier and deep learning models such as ResNet50, DenseNet121 and VGG16 are trained with different parameters; the optimal parameters are selected. ResNet50, DenseNet121, and VGG16 models are initially trained with a learning rate of 0.1 and marginally increased up to 0.001. The learning rate of 0.01 was selected for the model design, since for other learning rates, accuracy was marginally smaller. In order to select the optimal number of epochs, models were initially trained with 20 epochs, incremented by 10 in each iteration, and the best accuracy was obtained for 40 epochs. Additionally, models were trained with different combination of activation functions and optimizers namely sigmoid and adam, tanh and adam, sigmoid and RMSprop, and tanh and RMSprop. The combination of sigmoid activation function and adam optimizer gave better results for the ResNet50 model. But the combination of sigmoid activation function and RMSprop optimizer gave better results for the VGG16 and DenseNet121 models. The final optimized parameters of the deep learning models are shown in Table 2.
Similarly, parameters of the NGBoost classifier like learning rate and number of estimators were also optimized. The NGBoost classifier was trained with different learning rates from 0.1 to 0.001, and a better accuracy was obtained for the learning rate of 0.01. The NGBoost classifier was also trained with different estimators. The number of estimators was initially chosen as 300, and it was incremented by 200 upto 700 estimators. At 700 estimators accuracy tend to marginally decline and 500 estimators was selected as optimal parameter. Regression tree is used as a base learner since it effectively captures non-linear relationships in the data and is computationally efficient. The final optimized parameters of the NGBoost classifier is shown in Table 3.

3.2. Handcrafted Features

Handcrafted features, namely haar, shape, and texture, were extracted from the input chest X-ray images. The extracted features are used as an input to machine learning classifiers, namely support vector machine, naive Bayes, decision tree, and NGBoost. Experiments were conducted using individual features, and maximum accuracy of 0.71 was obtained for haar features using the NGBoost classifier. Additional experiments were conducted by concatenated haar, shape, and texture features, and results are presented in Table 4. From Table 4 it is observed that decision tree obtained an accuracy of 0.62, naive Bayes obtained an accuracy of 0.65, and support vector machine obtained an accuracy of 0.69. In comparison NGBoost obtained a maximum accuracy of 0.72, precision of 0.70, recall of 0.72, specificity of 0.75 and F1 score of 0.71.

3.3. Deep Features

Experimental analysis using handcrafted features with NGBoost provided a maximum accuracy of 0.72. To further improve the classification accuracy, the role of deep features for pneumonia classification is explored in this work. The preprocessed images were given as input to ResNet50, VGG16, and DenseNet121 model, and their performance is shown in Table 5. From Table 5, it is seen that ResNet50 model gave an accuracy of 0.87, precision of 0.85, recall of 0.86, specificity of 0.89, and F1 score of 0.86. The Densenet121 model gave an accuracy of 0.79, precision of 0.76, recall of 0.70, specificity of 0.85, and F1 score of 0.75. The VGG16 model gave an accuracy of 0.78, precision and recall, F1 score of 0.76, and specificity of 0.82.
From Table 5, it is observed that the ResNet50 model achieved better accuracy compared to the other models. Further features from the fully connected layer of the ResNet50 model are fed to support vector machine, decision tree, naive Bayes, and the NGBoost classifier. The obtained results are illustrated in Table 6. From Table 6, it is seen that ResNet50 features with the NGBoost classifier gave an accuracy of 0.98, a precision of 0.96, recall, F1 score of 0.97, and specificity of 0.97. The support vector machine classifier gave an accuracy of 0.88, precision of 0.87, recall of 0.86, specificity of 0.92 and F1 score of 0.87. The naive Bayes classifier gave an accuracy and precision of 0.82, a recall of 0.79, specificity of 0.89, and F1 score of 0.80. The decision tree classifier gave an accuracy and precision of 0.78, a recall of 0.76, F1 score of 0.77, and specificity of 0.82. Thus, there is a drastic increase in accuracy from handcrafted features to deep features with respect to a basic machine learning classifier and also the NGBoost classifier.
The ROC curve of the Resnet50 feature with the NGBoost classifier is shown in Figure 4. From Figure 4 it is observed that the area under the curve value for employing ResNet50 features with the NGBoost classifier is 0.99.
To analyze the stability of the NGBoost classifier with high dimensional input of ResNet50 model, the features of fully connected layer, features of average pooling layer, and customized dense layer of size 512 were extracted. The extracted features were given as an input to the NGBoost classifier. The features obtained from the average pooling layer of the ResNet50 model is of dimension 2048, with an accuracy of 0.97. The features obtained from the fully connected layer of the ResNet50 model is of dimension 1000, with an accuracy of 0.98. A dense layer of size 512 was added to the fully connected layer, with an accuracy of 0.98. Though all three models achieved similar results irrespective of the feature dimensions, it can be said that the NGBoost classifier is stable.

3.4. Comparison of Handcrafted and Deep Features with NGBoost Classifier

The comparative analysis of handcrafted features and deep features with respect to the NGBoost classifier was carried out in this study. The obtained results of handcrafted features and deep features with the NGBoost classifier are shown in Table 7. Additional experiments were also conducted by combining the concatenated hand features and ResNet50 based features with respect to NGBoost classifier. This results is also shown in Table 7. From Table 7, it is observed that the accuracy of concatenated handcrafted features is 0.72, precision is 0.70, recall is 0.72, specificity is 0.75, and F1 score is 0.71. The ResNet50 deep features accuracy is 0.98, precision, recall, specificity and F1 score is 0.97 respectively. Thus, it can be said that deep features with respect to the NGBoost classifier are more robust than handcrafted features with respect to the NGBoost classifier for accurately classifying pneumonia in chest X-ray images. The combined handcrafted and deep features gave an accuracy of 0.94, precision of 0.92, recall of 0.87, specificity of 0.93, and F1 score of 0.89. By combining handcrafted and deep features, a slight decrease in accuracy is observed, indicating the model may be overfitting due to an increase in the number of features.
To show the significance of the proposed work, a performance comparison between the proposed approach and existing state-of-the-art approaches was carried out. Table 8 shows the results of comparison with existing studies on pneumonia detection. For instance, in [30], a pretrained VGG model was used with limited training samples, achieving an accuracy of 0.96. In [31] proposed ensemble model of five deep learning models, an accuracy of 0.86 was produced. In [32] residual CNN network was developed by researchers to classify pneumonia chest images. The model gave an accuracy of 0.85. CNN with ReLU activation function was deployed in [33] to produce an accuracy of 0.92. ResNet18 with cycleGAN was developed in [34], and the model produced an accuracy of 0.92. In [35], a model called PneuNet was developed based on Vision Transformer. The model gave an accuracy of 0.94. In [36], a ResNet34 and Vision Transformer were combined to classify pneumonia chest X-ray images. The model achieved an accuracy of 0.94. In [37], a hybrid CNN model with Swin Transformer model was used to classify chest X-ray images as pneumonia-positive and pneumonia-negative, achieving an accuracy of 0.98. When comparing the results of the proposed method with other methods in literature, it can be concluded that by employing deep learning features from ResNet50 and NGBoost classifier, a more accurate pneumonia classification can be achieved.

4. Conclusions

In this study, NGBoost classifier, a probabilistic ensemble model is employed to classify the chest X-rays as pneumonia-affected images and normal images. The dataset used in this study was taken from stage 2 pneumonia RSNA challenge, which consists of 26,684 images. The images are preprocessed using the contrast limited adaptive histogram equalization method to amplify the contrast and brightness of the images. As a part of handcrafted features, haar, shape, and texture features were extracted. As a part of deep features, ResNet50, Densenet121, and VGG16 models were implemented and features were extracted from the fully connected layer of these models. The NGBoost classifier was trained on both handcrafted and deep features. From the analysis, it is found that deep features extracted from ResNet50 model produced an accuracy of 0.98, precision of 0.96, recall, F1 score, and specificity of 0.97. The concatenated handcrafted features produced an accuracy of 0.72, a precision of 0.70, a recall of 0.72, F1 score of 0.71, and specificity of 0.75. From the experimental results, it can be inferred that deep features play a major role in pneumonia chest X-ray classification. However, one of the limitation of the work may be usage of X-ray images and it is better to use higher resolution imaging modality like computed tomography. In future, the proposed approach can be employed for classification of other lung diseases such as tuberculosis, bronchitis and lung cancer.

Author Contributions

Conceptualization, N.S.C. and B.S.M.; methodology, N.S.C. and B.S.M.; data analysis, N.S.C.; writing—original draft preparation, N.S.C.; writing—review and editing, S.R. and B.S.M. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable, as the RSNA dataset is publicly available.

Informed Consent Statement

Not applicable, as the RSNA dataset is publicly available.

Data Availability Statement

The original data presented in the study are openly available in Stage 2 pneumonia RSNA dataset at https://www.kaggle.com/c/rsna-pneumonia-detection-challenge/data (accessed on 21 January 2021).

Acknowledgments

Authors are thankful to the RSNA Pneumonia detection challenge project for providing the data.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
ResNetResidual Neural Network
NGBoostNatural Gradient Boosting
DensenetDensely Connected Convolutional Networks
VGGVisual Geometry Group
AdamAdaptive Moment Estimation
RMSpropRoot Mean Square Propogation

References

  1. El-Ghandour, M.; Obayya, M.I. Pneumonia detection in chest x-ray images using an optimized ensemble with XGBoost classifier. Multimed. Tools Appl. 2025, 84, 5491–5521. [Google Scholar] [CrossRef]
  2. Kumar, R.; Pan, C.T.; Lin, Y.M.; Yow-Ling, S.; Chung, T.S.; Janesha, U.G.S. Enhanced Multi-Model Deep Learning for Rapid and Precise Diagnosis of Pulmonary Diseases Using Chest X-Ray Imaging. Diagnostics 2025, 15, 248. [Google Scholar] [CrossRef]
  3. Al-Waisy, A.; Mohammed, M.A.; Al-Fahdawi, S.; Maashi, M.; Garcia-Zapirain, B.; Abdulkareem, K.H.; Mostafa, S.; Kumar, N.M.; Le, D.N. COVID-DeepNet: Hybrid multimodal deep learning system for improving COVID-19 pneumonia detection in chest X-ray images. Comput. Mater. Contin. 2021, 67, 2409–2429. [Google Scholar] [CrossRef]
  4. Chandra, T.B.; Verma, K. Pneumonia detection on chest x-ray using machine learning paradigm. In Proceedings of the 3rd International Conference on Computer Vision and Image Processing: CVIP 2018, Jabalpur, India, 29 September–1 October 2018; Volume 1, pp. 21–33. [Google Scholar]
  5. Sousa, R.T.; Marques, O.; Soares, F.A.A.; Sene, I.I., Jr.; de Oliveira, L.L.; Spoto, E.S. Comparative performance analysis of machine learning classifiers in detection of childhood pneumonia using chest radiographs. Procedia Comput. Sci. 2013, 18, 2579–2582. [Google Scholar] [CrossRef]
  6. Akgundogdu, A. Detection of pneumonia in chest X-ray images by using 2D discrete wavelet feature extraction with random forest. Int. J. Imaging Syst. Technol. 2021, 31, 82–93. [Google Scholar] [CrossRef]
  7. Nagashree, S.; Mahanand, B.S. Pneumonia chest X-ray classification using support vector machine. In Proceedings of the International Conference on Data Science and Applications: ICDSA 2022, Kolkata, India, 26–27 March 2022; Volume 2, pp. 417–425. [Google Scholar]
  8. Nagashree, S.; Mahanand, B.S.; Raj, S. Parameter Optimization in Convolution Neural Network Model to Accurately Predict Pneumonia in Chest X-ray Images. IAENG Int. J. Comput. Sci. 2025, 52, 1845–1851. [Google Scholar]
  9. Rahman, T.; Chowdhury, M.E.; Khandakar, A.; Islam, K.R.; Islam, K.F.; Mahbub, Z.B.; Kadir, M.A.; Kashem, S. Transfer learning with deep convolutional neural network (CNN) for pneumonia detection using chest X-ray. Appl. Sci. 2020, 10, 3233. [Google Scholar] [CrossRef]
  10. Varshni, D.; Thakral, K.; Agarwal, L.; Nijhawan, R.; Mittal, A. Pneumonia detection using CNN based feature extraction. In Proceedings of the 2019 IEEE International Conference on Electrical, Computer and Communication Technologies (ICECCT), Coimbatore, India, 20–22 February 2019; pp. 1–7. [Google Scholar]
  11. Gupta, P. Pneumonia detection using convolutional neural networks. Sci. Technol. 2021, 7, 77–80. [Google Scholar]
  12. Çınar, A.; Yıldırım, M.; Eroğlu, Y. Classification of pneumonia cell images using improved ResNet50 model. Trait. Du Signal 2021, 38, 165–173. [Google Scholar] [CrossRef]
  13. Tshwale, M.; Owolawi, P.; Olaifa, M.; Malele, V. ResNet50 Pretrained Model Based Pneumonia Detection System. In Proceedings of the 2024 IEEE World AI IoT Congress (AIIoT), Seattle, WA, USA, 29–31 May 2024; pp. 231–236. [Google Scholar]
  14. Rachman, S.A.; Bagaskara, D.C.; Magdalena, R.; Sa’idah, S. Classification of Pneumonia Based on X-Ray Images with ResNet-50 Architecture. In Proceedings of the 3rd International Conference on Electronics, Biomedical Engineering, and Health Informatics: ICEBEHI 2022, Surabaya, Indonesia, 5–6 October 2022; pp. 117–130. [Google Scholar]
  15. Duan, T.; Anand, A.; Ding, D.Y.; Thai, K.K.; Basu, S.; Ng, A.; Schuler, A. Ngboost: Natural gradient boosting for probabilistic prediction. In Proceedings of the International Conference on Machine Learning, PMLR, Virtual Event, 13–18 July 2020; pp. 2690–2700. [Google Scholar]
  16. Malashin, I.; Tynchenko, V.; Gantimurov, A.; Nelyub, V.; Borodulin, A. Boosting-Based Machine Learning Applications in Polymer Science: A Review. Polymers 2025, 17, 499. [Google Scholar] [CrossRef]
  17. Chen, J.; Wang, M.; Zhao, D.; Li, F.; Wu, H.; Liu, Q.; Li, S. MSINGB: A novel computational method based on NGBoost for identifying microsatellite instability status from tumor mutation annotation data. Interdiscip. Sci. Comput. Life Sci. 2023, 15, 100–110. [Google Scholar] [CrossRef]
  18. Hussain, S.; Mustafa, M.W.; Al-Shqeerat, K.H.A.; Saeed, F.; Al-Rimy, B.A.S. A novel feature-engineered–NGBoost machine-learning framework for fraud detection in electric power consumption data. Sensors 2021, 21, 8423. [Google Scholar] [CrossRef]
  19. Zhu, Y.; Hu, Y.; Liu, Q.; Liu, H.; Ma, C.; Yin, J. A Hybrid Approach for Predicting Corporate Financial Risk: Integrating SMOTE-ENN and NGBoost. IEEE Access 2023, 11, 111106–111125. [Google Scholar] [CrossRef]
  20. Das, P.; Kashem, A.; Hasan, I.; Islam, M. A comparative study of machine learning models for construction costs prediction with natural gradient boosting algorithm and SHAP analysis. Asian J. Civ. Eng. 2024, 25, 3301–3316. [Google Scholar] [CrossRef]
  21. Dutta, S.; Bandyopadhyay, S.K. Revealing brain tumor using cross-validated NGBoost classifier. Int. J. Mach. Learn. Netw. Collab. Eng. 2020, 4, 12–20. [Google Scholar] [CrossRef]
  22. Wang, X.; Peng, Y.; Lu, L.; Lu, Z.; Bagheri, M.; Summers, R.M. Chestx-ray8: Hospital-scale chest x-ray database and benchmarks on weakly-supervised classification and localization of common thorax diseases. In Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Honolulu, HI, USA, 21–26 July 2017; pp. 2097–2106. [Google Scholar]
  23. Reza, A.M. Realization of the contrast limited adaptive histogram equalization (CLAHE) for real-time image enhancement. J. VLSI Signal Process. Syst. Signal Image Video Technol. 2004, 38, 35–44. [Google Scholar] [CrossRef]
  24. Park, K.Y.; Hwang, S.Y. An improved Haar-like feature for efficient object detection. Pattern Recognit. Lett. 2014, 42, 148–153. [Google Scholar] [CrossRef]
  25. Goswami, B.; Misra, S.K. Analysis of various Edge detection methods for X-ray images. In Proceedings of the 2016 International Conference on Electrical, Electronics, and Optimization Techniques (ICEEOT), Chennai, India, 3–5 March 2016; pp. 2694–2699. [Google Scholar]
  26. Pietikäinen, M.; Hadid, A.; Zhao, G.; Ahonen, T.; Pietikäinen, M.; Hadid, A.; Zhao, G.; Ahonen, T. Local binary patterns for still images. In Computer Vision Using Local Binary Patterns; Springer: London, UK, 2011; pp. 13–47. [Google Scholar]
  27. Li, W.; Yu, S.; Yang, R.; Tian, Y.; Zhu, T.; Liu, H.; Jiao, D.; Zhang, F.; Liu, X.; Tao, L.; et al. Machine learning model of resnet50-ensemble voting for malignant–benign small pulmonary nodule classification on computed tomography images. Cancers 2023, 15, 5417. [Google Scholar] [CrossRef]
  28. Arulananth, T.; Prakash, S.W.; Ayyasamy, R.K.; Kavitha, V.; Kuppusamy, P.; Chinnasamy, P. Classification of paediatric pneumonia using modified DenseNet-121 deep-learning model. IEEE Access 2024, 12, 2169–3536. [Google Scholar] [CrossRef]
  29. Jiang, Z.P.; Liu, Y.Y.; Shao, Z.E.; Huang, K.W. An improved VGG16 model for pneumonia image classification. Appl. Sci. 2021, 11, 11185. [Google Scholar] [CrossRef]
  30. Zhang, D.; Ren, F.; Li, Y.; Na, L.; Ma, Y. Pneumonia detection from chest X-ray images based on convolutional neural network. Electronics 2021, 10, 1512. [Google Scholar] [CrossRef]
  31. Kundu, R.; Das, R.; Geem, Z.W.; Han, G.T.; Sarkar, R. Pneumonia detection in chest X-ray images using an ensemble of deep learning models. PLoS ONE 2021, 16, e0256630. [Google Scholar] [CrossRef] [PubMed]
  32. Al Mubarok, A.F.; Dominique, J.A.; Thias, A.H. Pneumonia detection with deep convolutional architecture. In Proceedings of the 2019 International Conference of Artificial Intelligence and Information Technology (ICAIIT), Yogyakarta, Indonesia, 13–15 March 2019; pp. 486–489. [Google Scholar]
  33. Shah, S.; Mehta, H.; Sonawane, P. Pneumonia detection using convolutional neural networks. In Proceedings of the 2020 Third International Conference on Smart Systems and Inventive Technology (ICSSIT), Tirunelveli, India, 20–22 August 2022; pp. 933–939. [Google Scholar]
  34. Wang, Z.; Hall, J.; Haddad, R.J. Improving pneumonia diagnosis accuracy via systematic convolutional neural network-based image enhancement. In Proceedings of the SoutheastCon 2021, Atlanta, GA, USA, 10–13 March 2021; pp. 1–6. [Google Scholar]
  35. Wang, T.; Nie, Z.; Wang, R.; Xu, Q.; Huang, H.; Xu, H.; Xie, F.; Liu, X.J. PneuNet: Deep learning for COVID-19 pneumonia diagnosis on chest X-ray image analysis using Vision Transformer. Med. Biol. Eng. Comput. 2023, 61, 1395–1408. [Google Scholar] [CrossRef]
  36. Angara, S.; Mannuru, N.R.; Mannuru, A.; Thirunagaru, S. A novel method to enhance pneumonia detection via a model-level ensembling of CNN and vision transformer. arXiv 2024, arXiv:2401.02358. [Google Scholar] [CrossRef]
  37. Mustapha, B.; Zhou, Y.; Shan, C.; Xiao, Z. Enhanced pneumonia detection in chest x-rays using hybrid convolutional and vision transformer networks. Curr. Med. Imaging 2025, 21, e15734056326685. [Google Scholar] [CrossRef] [PubMed]
Figure 1. Framework of pneumonia classification using NGBoost classifier.
Figure 1. Framework of pneumonia classification using NGBoost classifier.
Applsci 15 09821 g001
Figure 2. Feature Extraction using ResNet50 model.
Figure 2. Feature Extraction using ResNet50 model.
Applsci 15 09821 g002
Figure 3. Classification using NGBoost classifier.
Figure 3. Classification using NGBoost classifier.
Applsci 15 09821 g003
Figure 4. Receiver operating characteristic of ResNet50 features with NGBoost classifier.
Figure 4. Receiver operating characteristic of ResNet50 features with NGBoost classifier.
Applsci 15 09821 g004
Table 1. Demographic information of the dataset.
Table 1. Demographic information of the dataset.
NormalPneumonia
Number of subjects20,6726012
Gender (Male/Female)11,656/90153510/2502
Age (Mean, Range)(47, 26–50)(45, 26–50)
Table 2. Deep learning model parameters.
Table 2. Deep learning model parameters.
ParametersResNet 50VGG16DenseNet121
Learning rate0.010.010.01
Number of Epochs404040
Activation FunctionSigmoidSigmoidSigmoid
OptimizerAdamRMSpropRMSprop
Table 3. NGBoost parameters.
Table 3. NGBoost parameters.
ParametersValues
Learning rate0.01
Number of Estimators500
Base LearnerRegression Tree
DistributionBernoulli
Table 4. Results of concatenation of haar, shape and texture features with machine learning classifiers.
Table 4. Results of concatenation of haar, shape and texture features with machine learning classifiers.
AccuracyPrecisionRecall (Sensitivity)SpecificityF1 Score
NGBoost0.720.700.720.750.71
SVM0.690.690.690.720.69
NB0.650.660.650.680.69
DT0.620.620.620.650.62
Table 5. Results for deep learning model.
Table 5. Results for deep learning model.
AccuracyPrecisionRecall (Sensitivity)SpecificityF1 Score
ResNet500.870.850.860.890.86
DenseNet1210.790.760.700.850.75
VGG160.780.760.760.820.76
Table 6. Results for deep features obtained from ResNet50.
Table 6. Results for deep features obtained from ResNet50.
AccuracyPrecisionRecall (Sensitivity)SpecificityF1 Score
NGBoost0.980.960.970.970.97
SVM0.880.870.860.920.87
NB0.820.820.790.890.80
DT0.780.780.760.820.77
Table 7. Comparative results of concatenated handcrafted, deep and combined handcrafted and deep features.
Table 7. Comparative results of concatenated handcrafted, deep and combined handcrafted and deep features.
FeaturesAccuracyPrecisionRecall (Sensitivity)SpecificityF1 Score
Concatenated handcrafted features0.720.700.720.750.71
ResNet50 deep features0.980.960.970.970.97
Combined hand and deep features0.940.920.870.930.89
Table 8. Performance comparison of the proposed study with similar work in literature.
Table 8. Performance comparison of the proposed study with similar work in literature.
ApproachAccuracy
Proposed ApproachNGBoost+ResNet500.98
Zhang et al. [30]VGG model0.96
Kundu et al. [31]Ensemble model0.86
Al Munarok et al. [32]Residual CNN network0.85
Shah et al. [33]CNN model with ReLU0.92
Wang et al. [34]ResNet180.92
Wang et al. [35]Vision Transformer0.94
Angara et al. [36]Vision Transformer0.94
Mustapha et al. [37]Swin Transformer0.98
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Satish Chandra, N.; Raj, S.; Mahanand, B.S. NGBoost Classifier Using Deep Features for Pneumonia Chest X-Ray Classification. Appl. Sci. 2025, 15, 9821. https://doi.org/10.3390/app15179821

AMA Style

Satish Chandra N, Raj S, Mahanand BS. NGBoost Classifier Using Deep Features for Pneumonia Chest X-Ray Classification. Applied Sciences. 2025; 15(17):9821. https://doi.org/10.3390/app15179821

Chicago/Turabian Style

Satish Chandra, Nagashree, Shyla Raj, and B. S. Mahanand. 2025. "NGBoost Classifier Using Deep Features for Pneumonia Chest X-Ray Classification" Applied Sciences 15, no. 17: 9821. https://doi.org/10.3390/app15179821

APA Style

Satish Chandra, N., Raj, S., & Mahanand, B. S. (2025). NGBoost Classifier Using Deep Features for Pneumonia Chest X-Ray Classification. Applied Sciences, 15(17), 9821. https://doi.org/10.3390/app15179821

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop