# Enhancing an Imbalanced Lung Disease X-ray Image Classification with the CNN-LSTM Model
## 4 Results and Discussion
### Evaluation  
An evaluation was conducted to assess the performance of the optimal model. The model was validated using a dataset of 1514 observations, including 361 for the COVID-19 class, 1019 for the normal class, and 134 for the pneumonia class. The classification results are presented in Table 9, demonstrating that the model performs well in accurately classifying X-ray images, with a significant number of correct classifications. Out of the total 1514 images, 1497 were classified correctly, resulting in an overall accuracy of 98.88% (1497/1514). However, some errors were observed in the COVID-19 class, with 11 images misclassified as normal. Figure 14 displays the misclassified images for the COVID-19 class, highlighting that some of these images do not meet the required standards, such as being too small, leading to their misclassification.  
The classification report is presented in Table 10, revealing that the CNN-LSTM model effectively classifies X-ray images of the lungs with an overall F1 score of 0.99. The precision score for the pneumonia class was found to be the highest at 1.00, indicating a low probability of misclassifying COVID-19 or normal images as pneumonia. On the other hand, the recall score for the normal class was the highest at 1.00, indicating a low error rate in misclassifying normal images into other classes. The F1 score for the normal class was also the highest at 0.99, demonstrating that the CNN-LSTM model performs exceptionally well in predicting the normal class compared to the other two classes. These findings suggest that the CNN-LSTM model exhibits a high level of accuracy in classifying X-ray images of the lungs, which could potentially assist medical professionals in diagnosing respiratory diseases.  
To validate the performance of the constructed model architecture, the k-fold cross-validation method will be employed. This method aims to assess the model's performance when tested with different datasets. In this study, the test was conducted 10 times using 10 different validation data sets. The results, as presented in Table 11, indicate an average precision value of 0.97, a recall value of 0.96, and an F1 score of 0.977.  
To assess the performance of our proposed model, we conducted a thorough comparison with other existing models using the same dataset. Table 12 presents a comparison of different architectures for the classification of lung diseases using chest X-ray images. Our proposed architecture (CNN-LSTM) outperforms the other architectures with an impressive F1 score of 0.9887. Despite having a similar training time of 91 s per epoch, the CNN-LSTM model demonstrates superior classification performance in accurately identifying lung diseases. These results highlight the potential of deep-learning models, particularly CNN-LSTM, in improving the accuracy of lung disease classification. The findings of this research emphasize the importance of selecting appropriate architectures for specific tasks and underscore the benefits of utilizing CNN-LSTM models in the field of medical image analysis.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline  & **Precision** & **Recall** & **F1 Score** \\ \hline COVID-19 & 0.99 & 0.97 & 0.98 \\ \hline Normal & 0.99 & 1.00 & 0.99 \\ \hline Pneumonia & 1.00 & 0.97 & 0.98 \\ \hline Accuracy & & & 0.99 \\ \hline \hline \end{tabular}
\end{table}
Table 10: Classification report.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Fold** & **Precision** & **Recall** & **F1 Score** \\ \hline
1 & 0.99 & 0.97 & 0.9887 \\ \hline
2 & 0.96 & 0.95 & 0.9788 \\ \hline
3 & 0.95 & 0.99 & 0.9808 \\ \hline
4 & 0.99 & 0.96 & 0.9854 \\ \hline
5 & 0.98 & 0.94 & 0.97