# Unraveling the Impact of Class Imbalance on Deep-Learning Models for Medical Image Classification
## 3 Results and Analysis
### Additional Results and Analysis
\begin{table}
\begin{tabular}{l r r r r r r r r r r r r r r r r r} \hline \hline  & & & & & & & & & & & & & & & & & & & & & \\ \hline keras & 10–40 & No\_bal & – & – & 40 & 30 & 1000 & 0.75 & 0.71 & 0.73 & 0.74 & 0.62 & 0.96 & 0.83 & 0.86 & 0.99 & 0.12 & 0.50 \\ keras & 10–40 & No\_bal & – & 40 & 30 & 20 & 1000 & 0.79 & 0.73 & 0.91 & 0.42 & 0.66 & 0.83 & 0.92 & 0.84 & 0.87 & 0.69 & 0.40 \\ keras & 10–40 & No\_bal & 30 & 10 & 40 & 30 & 1000 & 0.77 & 0.72 & 0.77 & 0.54 & 0.60 & 0.94 & 0.84 & 0.86 & 0.98 & 0.19 & 0.50 \\ \hline keras\_cnn & 10–40 & No\_bal & – & – & 40 & 20 & 1000 & 0.95 & 0.82 & 0.91 & 0.62 & 0.71 & 0.92 & 0.91 & 0.91 & 0.94 & 0.58 & 0.70 \\ keras\_cnn & 10–40 & No\_bal & – & 40 & 30 & 30 & 30 & 1000 & 0.96 & 0.82 & 0.89 & 0.66 & 0.73 & 0.96 & 0.89 & 0.91 & 0.98 & 0.51 & 0.69 \\ keras\_cnn & 10–40 & No\_bal & 40 & 30 & 30 & 30 & 1000 & 0.95 & 0.81 & 0.89 & 0.61 & 0.71 & 0.95 & 0.90 & 0.89 & 0.97 & 0.53 & 0.62 \\ \hline neuralnet & 10–40 & No\_bal & – & – & 20 & 10 & only\_200 & 0.56 & 0.54 & 0.81 & 0.26 & 0.76 & 0.63 & 0.88 & 0.79 & 0.67 & 0.65 & 0.13 \\ neuralnet & 10–40 & No\_bal & – & 40 & 40 & 10 & only\_100 & 0.66 & 0.61 & 0.82 & 0.66 & 0.71 & 0.85 & 0.82 & 0.77 & 0.49 & 0.27 \\ neuralnet & 10–40 & No\_bal & 30 & 30 & 30 & 10 & only\_100 & 0.67 & 0.65 & 0.81 & 0.29 & 0.67 & 0.74 & 0.85 & 0.84 & 0.82 & 0.42 & 0.40 \\ \hline rsnns & 10–40 & No\_bal & – & – & 10 & 20 & only\_200 & 0.74 & 0.72 & 0.85 & 0.21 & 0.54 & 0.86 & 0.82 & 0.93 & 0.91 & 0.03 & 0.81 \\ rsnns & 10–40 & No\_bal & – & 40 & 40 & 30 & only\_100 & 0.70 & 0.70 & 0.75 & 0.36 & 0.63 & 0.90 & 0.83 & 0.86 & 0.96 & 0.12 & 0.52 \\ rsnns & 10–40 & No\_bal & 20 & 20 & 30 & 30 & only\_100 & 0.65 & 0.66 & 0.85 & 0.22 & 0.51 & 0.73 & 0.82 & 0.92 & 0.79 & 0.13 & 0.77 \\ \hline \hline \end{tabular}
\end{table} 
Table 9: Summary of additional the metrics obtained for 1000 training epochs with 2, 3, and 4 layers and tests in different R packages. the specific features of these classes. Despite the prior knowledge of the number of samples per class, these results reflect the existing imbalance in the training data. The consistency of high accuracy for class N, as opposed to the variability for classes V and B, points to a potential model bias toward class N. Given the stability of the overall accuracy, it could be inferred that class N is predominant in the datasets, which could lead to misguided conclusions about the model's overall effectiveness. Class sensitivity highlights significant differences, consistently demonstrating superior effectiveness in identifying positive cases, especially for class N, in models that incorporate convolutional layers (keras_cnn). On the other hand, specificity remains high across all models, showcasing an efficient ability to correctly recognize true negatives. Regarding neuron configuration, models based on artificial neural network algorithms typically exhibit lower accuracy with fewer neurons. However, the four-layer Neuralnet model achieves a slight edge in precision over its counterparts. For deep-learning models subjected to 1000 epochs of training, the resulting accuracy remains consistent, unaffected by the number of neurons deployed. Concluding with the number of training epochs, it is observed that models trained for 1000 epochs generally exhibit a better balance between accuracy in training and testing than those trained for only 100 or 200 epochs.