Folio — EditionSakina Saifuddin© 2026
2021

A journey through code, data, and intelligent systems.

Folio — EditionSakina Saifuddin© 2026
SS
01Intro02Work03What I Build04Achievements05Experience06Expertise07Contact
Case studyClick a page, swipe, or use ← → to turn

AI-GENERATEDX-RAYS FORPNEUMONIADETECTION

PNEUMONIA X-RAYGAN

  • The model kept missing normal chest X-rays.
  • My first fix with synthetic images failed, and I learned why.
  • The second try made the model accurate and fair.
73.6% → 82.2%accuracy
0.32 → 0.76normal-case recall
Visit the portfolio
website at:
sakina-saifuddin / works
23383
Pneumonia X-ray GANSakina Saifuddin

AI-GENERATEDX-RAYS FORPNEUMONIADETECTION

Recognize normal X-rays fairly
Fig. 1 — Far more pneumonia than normal images.1
  1. Task
  2. My work
  3. Results
  4. Outcome

Recognize normal X-rays fairly

  • Pneumonia images outnumbered normal ones about 3 to 1.
  • The model missed many normal cases.
  • Goal: a balanced model, not just higher accuracy.
3,876pneumonia images
1,342normal images
2
Experiment 1 failed
Fig. 2 — Experiment 1 lowered accuracy.3
  1. Task
  2. My work
  3. Results
  4. Outcome

Experiment 1 failed

  • The GAN trained for only 20 epochs.
  • Images were noisy and went to the wrong class.
  • Lesson: bad synthetic data hurts a model.
82.9% → 75%accuracy dropped

Tools: PyTorch · DCGAN

4
Experiment 2: a better strategy
Fig. 3 — 50 epochs gives clearer chest structure.5
  1. Task
  2. My work
  3. Results
  4. Outcome

Experiment 2: a better strategy

  • Trained the GAN for 50 epochs, not 20.
  • Generated images for the smaller normal class.
  • Added dropout and class weights.
2,000synthetic normal X-rays

Tools: PyTorch · Torchvision

6
Accurate and fair
Fig. 4 — Final classification report.7
  1. Task
  2. My work
  3. Results
  4. Outcome

Accurate and fair

82.21%accuracy (from 73.56%)
0.76normal recall (from 0.32)
0.82macro F1 (from 0.65)
+8.65accuracy points gained
8
No more defaulting to pneumonia
Fig. 5 — Both experiments compared.9
  1. Task
  2. My work
  3. Results
  4. Outcome

No more defaulting to pneumonia

  • The model now finds normal cases much better.
  • The failed experiment made the success possible.
  • Research only, not a clinical tool.
10
11

Technologies

PyTorch
GAN and classifier.
DCGAN
Generates synthetic X-rays.
CNN
Classifies pneumonia vs. normal.
What I did
  • Measured the class imbalance and baseline.
  • Ran both GAN experiments and diagnosed the failure.
  • Compared every metric across both experiments.
12

PNEUMONIA X-RAYGAN

  • The model kept missing normal chest X-rays.
  • My first fix with synthetic images failed, and I learned why.
  • The second try made the model accurate and fair.
73.6% → 82.2%accuracy
0.32 → 0.76normal-case recall
Visit the portfolio
website at:
sakina-saifuddin / works
23383
Cover