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.
BCCD Dataset - blood smear images organized into train/ and val/ folders, 2 classes (205 train images, 87 val images).
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.
This notebook has a real, unresolved bug in the training setup:
- Validation generator points at the training directory.
validate_generatoris built from/bccd/traininstead of/bccd/val, somodel.fit()never sees a real held-out set - val metrics during training are measured on training data itself. A separate, correctly-configuredimage_dataset_from_directorypipeline (train_ds/validate_ds) exists in the notebook but isn't actually used inmodel.fit(). - Training loss is stuck at
0.0000e+00for 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 withbinary_crossentropyhere. A Keras warning also fires during training about applying softmax over a size-1 axis, which is a related symptom. - 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.
The notebook (White_Blood_Cell_Classification.ipynb) is built for Google Colab:
- Mount Google Drive and place the BCCD dataset at
/content/drive/MyDrive/bccdwithtrain/andval/subfolders (each containing 2 class subfolders). - Run all cells in order. The VGG16 base downloads ImageNet weights automatically on first run.
- The final cells run inference on a few sample images - swap in your own image paths to test.
- Python, TensorFlow / Keras
- VGG16 (ImageNet pretrained)
- OpenCV, Matplotlib
- Google Colab
This project is licensed under the MIT License - see the LICENSE file for details.