How piyushnile1509/sickle-detection works
This is an experimental sickle-cell image-classification and cell-counting research project, explicitly not a diagnostic device. The documented workflow prepares a primary dataset, prevents duplicate leakage in splits, trains and evaluates field classifiers, then exposes image predictions and Grad-CAM through CLI and Streamlit. Cell counting is a separate capability with a trained cell detector and a Cellpose shape-heuristic alternative. Some workflow links are documented rather than visible in sampled source; those are marked dashed.
Main entry points: inference.py Field inference · app.py Streamlit demo · loop.py Training loop · detector_counting.py YOLO cell counting
Components 18
Dataset preparation
- Primary images
data/train_source - Label manifest
src/data/manifest.py - Duplicate grouping
src/data/duplicates.py - Leakage-safe splits
src/data/splitting.py - Dataset transforms
src/data/dataset.py - Class weighting
src/data/imbalance.py
Classifier training
- Model factory
src/training/models.py - Training loop
src/training/loop.py - Model checkpoint
models
Inference and evaluation
- Classifier evaluation
scripts/evaluate_classifier.py - Field inference
src/inference.py - Prediction CLI
scripts/predict.py - Streamlit demo
app.py
Cell counting
- Detector CLI
scripts/count_cells.py - YOLO cell counting
src/detector_counting.py - Cellpose heuristic
src/counting.py - Detector weights
models/sickle5k_detector/weights
Other components
- Researcher / user
Connections 21
- Researcher / user → Primary images: provides images
- Primary images → Label manifest: builds labels
- Label manifest → Duplicate grouping: groups duplicates
- Duplicate grouping → Leakage-safe splits: informs groups
- Leakage-safe splits → Dataset transforms: selects samples
- Dataset transforms → Training loop: provides batches
- Class weighting → Training loop: weights loss
- Training loop → Model factory: sets training stage
src/training/loop.py - Training loop → Model checkpoint: saves model
- Model factory → Field inference: builds model
src/inference.py - Model checkpoint → Field inference: loads weights
src/inference.py - Researcher / user → Prediction CLI: requests prediction
- Prediction CLI → Field inference: runs inference
scripts/predict.py - Researcher / user → Streamlit demo: uploads image
README.md - Streamlit demo → Field inference: predicts field
README.md - Field inference → Classifier evaluation: supplies predictions
scripts/evaluate_classifier.py - Researcher / user → Detector CLI: requests counts
README.md - Detector CLI → YOLO cell counting: runs detector
scripts/count_cells.py - YOLO cell counting → Detector weights: loads weights
- Streamlit demo → YOLO cell counting: offers detector mode
README.md - Streamlit demo → Cellpose heuristic: offers fallback mode
README.md