This study evaluates pneumonia classification in chest X-rays using VGG19, MobileNetV2, ResNet50, and a custom CNN, and explores Generative Adversarial Network (GAN)-based synthetic data augmentation. MobileNetV2 achieved the highest reported accuracy of 88% with balanced class-wise performance. The custom CNN achieved pneumonia recall of 92.67% and precision of 79.43%, highlighting a precision-recall trade-off. Accuracy, F1-score, precision, recall, confusion matrices, and training curves were used to assess performance. Synthetic pneumonia images were combined with real images to investigate whether augmentation could improve classification performance. In the reported VGG19 comparison, augmented-data training accuracy reached approximately 100%, while validation accuracy remained near 50%, below the real-data validation accuracy. This experiment therefore did not demonstrate a validation-performance benefit from GAN augmentation. The classifier comparison highlights differences in accuracy and pneumonia recall, while the augmentation experiment indicates the need for further evaluation of synthetic-image quality and training settings.
Figures & tables
Fig. 1: Shown is a generic architecture of a sequential CNN applied for chest X-ray pneumonia detection.
Fig. 2: Shown is a Resnet50 Architecture
Fig. 3: Shown is a MobileNet Architecture
Fig. 4: Shown is a VGG19 Architecture
Fig. 5: Images showing x-ray image (pneumonia and normal image)
Fig. 6: Shown is a sample of a synthetic chest X-ray image.
Hyperparameter
Custom CNN
Base Architecture
None
Optimizer
Adam
Learning Rate
0.001
Activation Functions
ReLU (Conv, Dense), Sigmoid (Output)
Dropout
0.5
Pooling
MaxPooling2D
TABLE I: Tuned Hyperparameters for Custom CNN and MobileNetV2 Models
Hyperparameter
ResNet50
Base Architecture
ResNet50
Optimizer
Adam
Learning Rate
Default (0.001)
Activation Functions
ReLU (Backbone), Sigmoid (Output)
Dropout
None
Pooling
GlobalAveragePooling2D
TABLE II: Tuned Hyperparameters for ResNet50 and VGG19 Models
Fig. 7: Training Epoch For CNN model
Fig. 8: CNN - Loss VS Epoch
Model
Class
Precision
Recall
F1-Score
Support
CNN
0
0.91
0.76
0.83
150
1
0.79
0.93
0.86
150
Acc.
0.84 (300)
Macro Avg
0.85
0.84
0.84
300
Wtd. Avg
0.85
0.84
0.84
300
MobileNetV2
0
0.88
0.89
0.88
150
TABLE III: Classification Reports for Various Models
Model
Accuracy
F1 Score
Precision
Recall
CNN
0.8433
0.8554
0.7943
0.9267
MobileNet
0.8800
0.8792
0.8851
0.8733
ResNet50
0.7667
0.7756
0.7469
0.8067
VGG19
0.8233
0.8285
0.8050
0.8533
TABLE IV: Performance Metrics for Various Models
Fig. 10: Confusion Matrix for Various Models
Fig. 11: Accuracy VS Epoch for CNN and MobileNet
Fig. 13: VGG19 training and validation accuracy with real data and GAN-augmented data.
Fig. 14: ROC Curve Comparison
Fig. 15: Precision Recall Curve for CNN and MobileNet
Fig. 16: Precision Recall Curve for Resnet50 and VGG19
School of Electrical Engineering and Computer Science (SEECS) National University of Sciences and Technology (NUST) Islamabad, Pakistan · Independent Researcher Islamabad, Pakistan