# Enhancing an Imbalanced Lung Disease X-ray Image Classification with the CNN-LSTM Model
## 4 Results and Discussion
### Applying Image Augmentation Techniques  
This stage will involve model training by applying image augmentation techniques. Image augmentation is a method used to perform oversampling, which helps address imbalanced datasets by resampling the imbalanced classes [51]. In this study, the following three types of augmentations will be applied: rotation; shifting; and zooming.  
Figure 10: CNN-LSTM with 2 LSTM Layer.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Scenario** & **F1 Score** \\ \hline
1 layer of LSTM & 0.96 \\ \hline
2 layers of LSTM & 0.99 \\ \hline \hline \end{tabular}
\end{table}
Table 5: Results for the Number of LSTM layers.  
Figure 9: CNN-LSTM with 1 LSTM Layer.  
The test results were obtained by applying image augmentation techniques, as shown in Table 6. Three augmentations yielded the best results. Firstly, a rotation of five degrees achieved an F1 score of 0.98. Secondly, a height shift, which involves vertically moving the image with a range of 0.1 (10% of the size of the image height), resulted in an F1 score of 0.98. Thirdly, a width shift, which involves horizontally shifting the image with a range of 0.1 (10% of the size of the image width), yielded an F1 score value of 0.98.  
After obtaining the best augmentation results, we attempted to combine the three augmentations and recorded the results in Table 7. Surprisingly, the model without augmentation yielded better results than the augmented model, with an F1 score of 0.99. This could be attributed to the fact that the augmented model requires more training to achieve high accuracy. By examining the training process depicted in Figures 11 and 12, it is evident that the model without augmentation achieved higher accuracy and lower loss within the same number of epochs. On the other hand, the augmented model shows potential for improved results if trained for a greater number of epochs.  
To further investigate this, an experiment was conducted by training the augmented model for 85 epochs. The findings, illustrated in Figure 13, indicate that increasing the number of epochs only benefits the training data, as the loss consistently decreases while accuracy steadily increases. However, there is no significant difference observed in the validation data when compared to the 65-epoch model. The graph of the validation data exhibits fluctuations and even shows signs of overfitting around the 80 th epoch. This observation may be attributed to the lack of variation in the dataset and the standardized format of many X-ray datasets, rendering augmentation unnecessary.  
Models with augmentation also require a longer training time. Table 8 presents a comparison of the training process time using the same machine on Kaggle and the GPU P100 accelerator. It turns out that the model without augmentation has the fastest training process, with a duration of 91 s per epoch.  
The most optimal model, based on the findings of stages 1 and 2, consists of five convolutional blocks and two layers of LSTM. Interestingly, this model achieves outstanding accuracy and also boasts the fastest training process.  
Figure 12: Loss and accuracy model with augmentation.  
Figure 13: Loss and accuracy model with augmentation and an epoch of 85.