Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

White Blood Cell Classification

A binary image classifier built on top of VGG16, trained on the BCCD blood cell dataset. This project is a work-in-progress and currently has an unresolved training bug - see Known Issues below before trusting any reported numbers.


Dataset

BCCD Dataset - blood smear images organized into train/ and val/ folders, 2 classes (205 train images, 87 val images).


Model Architecture

VGG16 (ImageNet pretrained, fully trainable - not frozen)
    ↓
Flatten
    ↓
Dense(32, relu)
    ↓
Dense(1, sigmoid)
  • Optimizer: Adam
  • Loss: binary_crossentropy
  • Epochs: 10, batch size: 16

Note: unlike a typical transfer-learning setup, the VGG16 base is not frozen here - all ~15.5M parameters are trainable from the start.


⚠️ Known Issues

This notebook has a real, unresolved bug in the training setup:

  1. Validation generator points at the training directory. validate_generator is built from /bccd/train instead of /bccd/val, so model.fit() never sees a real held-out set - val metrics during training are measured on training data itself. A separate, correctly-configured image_dataset_from_directory pipeline (train_ds / validate_ds) exists in the notebook but isn't actually used in model.fit().
  2. Training loss is stuck at 0.0000e+00 for all 10 epochs. This is visible in the committed notebook output and has not been root-caused yet - likely related to how predictions/labels interact with binary_crossentropy here. A Keras warning also fires during training about applying softmax over a size-1 axis, which is a related symptom.
  3. Reported accuracy (~0.56-0.57) isn't meaningful. Given #1 and#2, the training run in this notebook doesn't demonstrate real learning yet - it's barely above chance for a binary task.

No accuracy/precision/recall numbers are reported here as project results because they aren't trustworthy until the above is fixed. Fixing requires re-running training with the correct val split and debugging the loss issue, which is tracked as follow-up work, not something fixable from a docs commit.


Usage

The notebook (White_Blood_Cell_Classification.ipynb) is built for Google Colab:

  1. Mount Google Drive and place the BCCD dataset at /content/drive/MyDrive/bccd with train/ and val/ subfolders (each containing 2 class subfolders).
  2. Run all cells in order. The VGG16 base downloads ImageNet weights automatically on first run.
  3. The final cells run inference on a few sample images - swap in your own image paths to test.

Tech Stack

  • Python, TensorFlow / Keras
  • VGG16 (ImageNet pretrained)
  • OpenCV, Matplotlib
  • Google Colab

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A CNN classification model that classifies between blood cells

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages