A deep learning project for detecting Acute Myeloid Leukemia (AML) from blood cell images using Convolutional Neural Networks and Transfer Learning.
This project implements a two-phase approach for AML detection:
- Phase 1: Basic CNN model for initial classification
- Phase 2: Transfer Learning with EfficientNetB0 for improved accuracy
aml-detection/
├── data/ # Dataset (see data/README.md for download)
│ ├── Blood cell Cancer [ALL]/
│ └── raw/
├── models/ # Trained models
│ ├── phase1/
│ │ ├── basic_cnn.h5
│ │ └── best_model.h5
│ └── phase2/
│ ├── best_efficientnetb0.h5
│ └── efficientnetb0_final.h5
├── results/ # Training results and visualizations
├── scripts/ # Training scripts
│ ├── phase1_basic_model.py
│ └── phase2_transfer_learning.py
└── requirements.txt # Python dependencies
Note: This project uses the Blood Cell Cancer [ALL] - 4 Class dataset from Kaggle.
📥 Kaggle Dataset: Blood Cell Cancer [ALL] - 4 Class
- Size: ~6 GB
- Format: Blood cell microscopy images
- Classes: 4 classes (Malignant early Pre-B, Pre-B, Pro-B, and Benign)
Method 1: Manual Download
- Visit the Kaggle dataset page
- Click "Download" (requires free Kaggle account)
- Extract the downloaded zip file
- Move the extracted folder to the
data/directory
Method 2: Using Kaggle API
# Install Kaggle API
pip install kaggle
# Download dataset (make sure your Kaggle API credentials are configured)
kaggle datasets download -d mohammadamireshraghi/blood-cell-cancer-all-4class
# Extract to data folder
unzip blood-cell-cancer-all-4class.zip -d data/For more details, see data/README.md
- Python 3.8+
- TensorFlow 2.x
- CUDA-compatible GPU (recommended)
- Clone the repository:
git clone https://github.com/Parisaroozgarian/aml-detection.git
cd aml-detection- Create virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Download the dataset (see Dataset section above)
python scripts/phase1_basic_model.pypython scripts/phase2_transfer_learning.pyTraining results, visualizations, and performance metrics are available in the results/ folder.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
- Dataset source: Blood Cells Cancer (ALL) dataset. (2021, October 30). Kaggle. https://www.kaggle.com/datasets/mohammadamireshraghi/blood-cell-cancer-all-4class
- Inspired by medical AI research in leukemia detection
If you use this dataset in your research, please cite:
Blood Cells Cancer (ALL) dataset. (2021, October 30). Kaggle. https://www.kaggle.com/datasets/mohammadamireshraghi/blood-cell-cancer-all-4class