A lightweight, end-to-end system for detecting and classifying leukemic cells from microscopic blood smear images. This project includes:
-Deep learning model (ResNet-50 backbone)
-Automated cell segmentation using OpenCV
-Flask backend (model inference + preprocessing + segmentation)
-Streamlit frontend (user interface + visualization)
-Logging of predictions and annotated outputs
Early detection of leukemia can significantly improve treatment outcomes. This system classifies blood cells into:
-Leukemic
-Normal
-Image Upload (JPG/PNG/BMP)
-Automated Nucleus Segmentation
-Bounding-Box Extraction
-ResNet-based Classification
-Probability Scores + Annotated Image Output
-Prediction Logging for Auditability
The model doesn’t look at the entire image at once. Instead, it:
--Segments the nucleus or dominant WBC region --Using thresholding + contour detection.
--Extracts the region of interest (ROI) --This focuses the model on the actual cell, not the background.
--Resizes and normalizes the ROI (224×224, scaled between 0–1)
--Uses a fine-tuned ResNet-50 to classify the cell.
-Feature Leukemic Cells Normal Cells -Nucleus Shape Often irregular, larger, more variable More uniform and rounded -Chromatin Texture Dense, clumped Smooth and consistent -Color/Staining Pattern Darker nucleus, uneven staining Evenly stained -Cell Boundary May appear distorted Clear, defined boundary
-With:
--Larger balanced datasets
--Better quality microscopic images
--Modern architectures (EfficientNet-V2, ViT, ConvNeXt)
--Learned segmentation models (U-Net, Mask R-CNN)
--Accuracy can be pushed well above 90%.
This project lays the foundation — the system is fully functional and can grow as better data becomes available.
--Upload up to 5 images
--Annotated images
--Cropped cells
--Prediction labels
--Probability scores
--Backend (Flask)
--Accepts images
--Performs segmentation + preprocessing
--Runs inference
--Annotated outputs
--Cropped cells
--cd backend --pip install -r requirements.txt --python app.py
--cd frontend --pip install -r requirements.txt --streamlit run streamlit_app.py
project/
│
├── LDwebapp/
│ ├── backend/
│ │ ├── app.py
│ │ ├── leukemia_model.keras
│ │ ├── utils.py
│ │ ├── requirements.txt
│ │ └── static/
│ │ └── saved/
│ │
│ └── frontend/
│ ├── streamlit_app.py
│ ├── sample_input.jpg
│ └── requirements.txt
│
└── README.md