## 2 Proposed Method
### Discussion  
This work set out with the aim of assessing the importance of utilizing features extracted from modified deep network layers to detect viral and bacterial pneumonia in CXR lung images. A light-weighted bottleneck layer feature descriptors with an adaptive score fusion with learned weights are applied in two scenarios which are: Normal vs. infected lungs and normal vs. bacterial vs. viral infected lungs.  
One interesting finding is only four iterations were required to optimize the hyperparameters of the SVM classification utilizing Bayesian optimization and achieving a classification error lower than 0.1% as shown in Figure 4 compared to Random search optimization in terms of performance and processing time. Furthermore, the proposed weight learning method as depicted in Algorithm 1 has showed a significant benefit of score fusion of four descriptors as \(S_{f}\) achieved 99.6% of area under the curve in Figure 5 compared to scores acquired individually (i.e.,) \(S_{i}(\mu),S_{i}(\sigma),S_{i}(\max)\), and \(S_{i}(\min)\).  
Another interesting finding for normal vs. infected lungs fashion including a mix of bacterial and viral infection CXR images scenario was that going deeper in some classification tasks could have a negative impact on accuracy. This is evident in Table 2 when the value of \(l>5\), the accuracy starts degrading as well as the complexity increases as more layers are used to extract features. Nevertheless, the proposed method has the upper hand compared to recent state-of-the-art methods shown in Tables 3 and 4.  
Despite these promising results, questions remain. For instance, the accuracy of determining viral or bacterial pneumonia by either human experts or prediction models and how the process is prone to errors affecting patients' health. For instance, the observed results when viral vs. bacterial vs. normal lung CXR images are used confirm the challenging  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Pneumonia Diagnosis** & **Deep Learning** & **Accuracy** \\
**Method** & **Technique** & **(\%)** \\ \hline [PERSON] et al. [4] & Transfer Learning & 99.00 \\  & with SqueezeNet & \\ \hline [PERSON] et al. [14] & Transfer Learning & 96.61 \\  & with ResNet50 & \\ \hline [PERSON] et al. [15] & CNN & 95.30 \\  & \(10\) Layers & 96.78 \\ \hline [PERSON] et al.[16] & Transfer Learning & 96.78 \\  & with MobileNet2 & \\ \hline [PERSON] and [PERSON] [21] & CNN with 49 & 95.30 \\  & Residual Blocks & \\ \hline [PERSON] et al. [22] & Transfer Learning & 92.80 \\  & with AlexNet & 99.41 \\ \hline [PERSON] et al. [23] & Deep Features & 99.41 \\  & Fused from AlexNet, & 99.41 \\  & VGG16, and VGG19 & \\ \hline [PERSON] et al. [24] & Transfer Learning & 82.83 \\  & with ChexNet & \\ \hline [PERSON] et al. [26] & Contrastive Learning & 88.00 \\  & with ResNetAttention & \\ \hline [PERSON] et al. [28] & Transfer Learning & 96.40 \\  & with S Deep Networks & \\ \hline [PERSON] et al. [30] & Transfer Learning & 98.00 \\  & with DenseNet201 & \\ \hline [PERSON] et al. [31] & One-Class Classification & 83.61 \\  & Based Anomaly Detection & 95.21 \\ \hline [PERSON] et al. [32] & Transfer Learning with & 95.21 \\  & Ensemble Voting & \\ \hline [PERSON] et al. [33] & CNN with & \\  & EML and PCA & 99.83 \\ \hline [PERSON] and [PERSON] [34] & fine-tuned & 99.83 \\  & EfficientNet-B3 & \\ \hline Proposed & Bottleneck Layer Features & \\ Method & with 5 Densely-Connected & 99.60 \\  & Residual Building Blocks & \\ \hline \hline \end{tabular}
\end{table}
Table 4: Comparison of proposed pneumonia diagnosis system with recent state-of-the-art methods.  
task as the overall accuracy degraded to 89.5%. We recommend more future studies on the aforementioned issue.