Folio — EditionSakina Saifuddin© 2026
2021

A journey through code, data, and intelligent systems.

Folio — EditionSakina Saifuddin© 2026
SS
01Intro02Work03What I Build04Achievements05Experience06Expertise07Contact
Project Books
08 · GENERATIVE AI · COMPUTER VISION · MEDICAL IMAGING

GAN-Based Chest X-ray Augmentation for Pneumonia Detection

Overview

Ran two DCGAN augmentation experiments, learned from a failed first attempt, changed the augmentation strategy, and improved the second experiment from 73.56% baseline accuracy to 82.21% with much stronger NORMAL recall.

Details
Key result73.56→82.21% — Experiment 2 test accuracy
Links
View my notebook Open full presentation
Stack
PyTorchTorchvisionDCGANCNNComputer VisionMedical Imaging
+8.65 ptsExp 2 accuracy gain
2,000synthetic NORMAL X-rays
0.32→0.76NORMAL recall
0.82final Macro F1
Next projectHarmful Brain Activity Classification — EEG Seizure Detection →
The generator creates synthetic 64×64 chest X-rays, the discriminator learns real versus fake, and the augmented dataset is used by a CNN classifier.
The second experiment produced much clearer chest structure after training the GAN for 50 epochs.
The final comparison shows how the improved Experiment 2 recovered accuracy and greatly improved NORMAL recall and Macro F1.
Follow the complete experiment deck

The entire presentation is included. Scroll left or right to see the dataset, architecture, failed first experiment, changes, second experiment, generated images, metrics, and conclusion.

Project overview: a DCGAN was used to generate chest X-rays and test whether synthetic data could improve pneumonia classification.
The training set was imbalanced: 3,876 pneumonia images versus 1,342 normal images. This imbalance became the main problem to solve.
Architecture overview for the baseline CNN, GAN generator, and discriminator.
Experiment 2 changed the training strategy: more GAN epochs, 2,000 synthetic images for the underrepresented NORMAL class, dropout, class weights, and a lower CNN learning rate.
Experiment 1 baseline reached 82.85% accuracy but normal recall was only 0.57, showing bias toward pneumonia.
A slide from the complete experiment deck. Scroll left or right to follow the full experiment.
The first GAN trained for only 20 epochs. The discriminator dominated and the generated images remained noisy.
The first synthetic X-rays had weak lung structure, so they were not good enough to improve the classifier.
Adding 500 synthetic images to the already larger pneumonia class made performance worse: test accuracy fell to 75%.
A slide from the complete experiment deck. Scroll left or right to follow the full experiment.
This slide explains what failed in Experiment 1 and the exact changes made for Experiment 2.
A slide from the complete experiment deck. Scroll left or right to follow the full experiment.
A slide from the complete experiment deck. Scroll left or right to follow the full experiment.
Experiment 2 trained the GAN for 50 epochs and generated 2,000 images for the NORMAL class.
The 50-epoch GAN produced visibly clearer chest structure than the 20-epoch version.
After the improved augmentation strategy, test accuracy reached 82.21% and normal recall increased to 0.76.
The final classification report shows much better balance between normal and pneumonia recognition, with Macro F1 reaching 0.82.
Full model comparison across both experiments. Experiment 2 augmentation produced the strongest balanced result.
A slide from the complete experiment deck. Scroll left or right to follow the full experiment.
Final conclusion and next step: class-aware synthetic generation helped, while future work could explore a conditional GAN.