## 2 Proposed Method
### Adaptive Score Fusion  
To make the final prediction, an adaptive score fusion technique is proposed based on Adaboost ensemble learning [42] where the weights for each classifier are updated based on previous errors made by these classifiers. This is shown in Algorithm 1. First, each classifier is given a weight equally. Second, for several iterations, each classifier is trained and classification error is calculated, and based on that error, each classifier weight is updated where the higher the weighted error, the less the decision power is given to the corresponding classifier. Finally, a weighted sum rule is exploited where the final score is determined via summing the four scores such that:  
\[S_{f}=\sum_{i=1}^{4}S_{i}.\hat{w}_{i}, \tag{5}\]  
where \(S_{f  
imaging such as the position of the patient during image capture, the screening device, medical sensors and tools fixed on the patient while screening, and other inherited health conditions. In particular, the dataset consists of 3883 pneumonia-diagnosed CXR images including bacterial and viral infection and 1349 normal CXR images. As shwon in Table 1, we trained the proposed system utilizing 75% of the dataset with 10-K fold validation to avoid over-fitting achieving a training time of 96.57 s whereas the rest of the data are used for testing with image augmentation including rotation, scaling, and translation.  
The experiment is conducted on a PC with core i7 and 16 GB of RAM under the Matlab 2020b environment and we utilized ResNet50 as the backbone network which was modified using Matlab Deep Learning Design Application. The input size of each image is changed to \(224\times 224\) as the ResNet50 input layer with batch normalization utilized before the activation layer and before the convolution layer. The list of layers before the \(l=5\) residual bottle-neck building blocks depicted in Figure 2 can be listed as the first convolution layer with 64 (7 \(\times\) 7) filters with stride = 2, batch normalization, RELU, and 3 \(\times\) 3 max pooling. Stochastic Gradient Descent (SGD) with a mini-batch size of 256 is used. The learning rate is set to 0.1 and is divided by 10 when the error is high whereas the weight decay is set to 0.0001 and a momentum of 0.9.  
For evaluating the proposed method, three metrics are employed namely: _sensitivity_, _F1 score_, and _accuracy_. These metrics can be defined as:  
\[sensitivity=\frac{TP}{TP+FN} \tag{6}\]  
\[F1\ score=\frac{2 TP}{2 TP+FP+FN} \tag{7}\]  
\[accuracy=\frac{TP+TN}{TP+FP+TN+FN} \tag{8}\]  
where \(TP\) and \(TN\) are the true positives and negatives, respectively, and \(FP\) and \(FN\) are the false positives and negatives consequently. As shown in Table 2, only \(l=5\) bottleneck blocks are needed, which is neither deep nor early layers to achieve the best performance (99.6%) as the accuracy degraded after \(l=6\) although the number of features is the same from \(l=4\). This is an evidence that going deeper using CNN can complicate the classification system while degrading its accuracy.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Category** & **No. of Images** & **Training** & **Testing** \\ \hline Normal & 1349 & 1012 & 337 \\ Bacterial & 2538 & 1903 & 635 \\ Viral & 1345 & 1008 & 337 \\ Total & 5232 & 3922 & 1309 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Training, Validation, and testing CXR image number using Kaggle CXR dataset.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Number of Bottleneck Blocks** & **Accuracy** & **Number of Features** \\ \hline
1 & 95.6 & \(1\times 256\) \\
2 & 96.2 & \(1\times 256\) \\
3 & 96.8 & \(1\times 256\) \\
4 & 96.8 & \(1\times 512\) \\
5 & 99.6 & \(1\times 512\) \\
6 & 97.6 & \(1\times 512\) \\
7 & 97.2 & \(1\times 512\) \\ \hline \hline \end{tabular}
\end{table}
Table 2: Performance of the number of modified ResNet bottleneck layers.