# nguonheng23dev/blood_cell_image_cnn_repo architecture

> Architecture diagram of the GitHub repository nguonheng23dev/blood_cell_image_cnn_repo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nguonheng23dev/blood_cell_image_cnn_repo
- Repository: https://github.com/nguonheng23dev/blood_cell_image_cnn_repo

## Overview

This is a TensorFlow/Keras coursework pipeline that classifies single white-blood-cell images into four classes. Its main workflow discovers images from Kaggle and LISC layouts, splits and preprocesses data, trains a CNN, then evaluates the saved best checkpoint and generates Grad-CAM visualizations. The README documents additional figures and reports. The implementation is concentrated in one script; edges reflect its sampled calls and documented task sequence, rather than separate runtime services.

Main entry points: [`results_tf`](https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/tree/main/results_tf) (Result files), [`blood_cell_image_cnn_tf.py`](https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/blob/main/blood_cell_image_cnn_tf.py) (Test evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_discovery["Dataset discovery"]
  node_split["Stratified split"]
  node_preprocess["Image preprocessing"]
  node_augmentation["Image augmentation"]
end

subgraph group_learning["Model training"]
  node_cnn["CNN classifier"]
  node_training["Model training"]
  node_callbacks["Checkpoint and LR"]
end

subgraph group_assessment["Evaluation and interpretation"]
  node_convergence["Convergence analysis"]
  node_evaluation["Test evaluation"]
  node_gradcam["Grad-CAM views"]
end

subgraph group_artifacts["Run artifacts"]
  node_results["Result files"]
end

node_user(("Pipeline user"))
node_kaggle[("Kaggle images")]
node_bccd[("Original BCCD images")]
node_lisc[("LISC test images")]

node_user -->|"runs pipeline"| node_discovery
node_kaggle -->|"provides images"| node_discovery
node_bccd -->|"provides originals"| node_discovery
node_lisc -->|"provides test images"| node_discovery
node_discovery -->|"splits training set"| node_split
node_split -->|"loads and resizes"| node_preprocess
node_preprocess -->|"transforms samples"| node_augmentation
node_augmentation -->|"feeds model"| node_cnn
node_cnn -->|"compiled for fit"| node_training
node_training -->|"uses callbacks"| node_callbacks
node_training -->|"analyzes history"| node_convergence
node_callbacks -->|"saves checkpoint"| node_results
node_convergence -->|"writes analysis"| node_results
node_results -->|"loads checkpoint"| node_evaluation
node_evaluation -->|"tests on split"| node_kaggle
node_evaluation -->|"tests originals"| node_bccd
node_evaluation -->|"tests LISC set"| node_lisc
node_evaluation -->|"writes reports"| node_results
node_results -->|"loads checkpoint"| node_gradcam
node_gradcam -->|"saves heatmaps"| node_results

click node_discovery "https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/blob/main/blood_cell_image_cnn_tf.py"
click node_split "https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/blob/main/blood_cell_image_cnn_tf.py"
click node_preprocess "https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/blob/main/blood_cell_image_cnn_tf.py"
click node_augmentation "https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/blob/main/blood_cell_image_cnn_tf.py"
click node_cnn "https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/blob/main/blood_cell_image_cnn_tf.py"
click node_training "https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/blob/main/blood_cell_image_cnn_tf.py"
click node_callbacks "https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/blob/main/blood_cell_image_cnn_tf.py"
click node_convergence "https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/blob/main/blood_cell_image_cnn_tf.py"
click node_evaluation "https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/blob/main/blood_cell_image_cnn_tf.py"
click node_gradcam "https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/blob/main/blood_cell_image_cnn_tf.py"
click node_results "https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/tree/main/results_tf"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_discovery,node_split,node_preprocess,node_augmentation,node_user toneBlue
class node_cnn,node_training,node_callbacks,node_kaggle,node_bccd,node_lisc toneAmber
class node_convergence,node_evaluation,node_gradcam toneMint
class node_results toneRose
```

## Components

### Data preparation

- [Dataset discovery](https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/blob/main/blood_cell_image_cnn_tf.py): `blood_cell_image_cnn_tf.py`
- [Stratified split](https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/blob/main/blood_cell_image_cnn_tf.py): `blood_cell_image_cnn_tf.py`
- [Image preprocessing](https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/blob/main/blood_cell_image_cnn_tf.py): `blood_cell_image_cnn_tf.py`
- [Image augmentation](https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/blob/main/blood_cell_image_cnn_tf.py): `blood_cell_image_cnn_tf.py`

### Model training

- [CNN classifier](https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/blob/main/blood_cell_image_cnn_tf.py): `blood_cell_image_cnn_tf.py`
- [Model training](https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/blob/main/blood_cell_image_cnn_tf.py): `blood_cell_image_cnn_tf.py`
- [Checkpoint and LR](https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/blob/main/blood_cell_image_cnn_tf.py): `blood_cell_image_cnn_tf.py`

### Evaluation and interpretation

- [Convergence analysis](https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/blob/main/blood_cell_image_cnn_tf.py): `blood_cell_image_cnn_tf.py`
- [Test evaluation](https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/blob/main/blood_cell_image_cnn_tf.py): `blood_cell_image_cnn_tf.py`
- [Grad-CAM views](https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/blob/main/blood_cell_image_cnn_tf.py): `blood_cell_image_cnn_tf.py`

### Run artifacts

- [Result files](https://github.com/nguonheng23dev/blood_cell_image_cnn_repo/tree/main/results_tf): `results_tf`

### Other components

- **Pipeline user**
- **Kaggle images**
- **Original BCCD images**
- **LISC test images**

## Connections

- Pipeline user → Dataset discovery: runs pipeline (evidence: `README.md`)
- Kaggle images → Dataset discovery: provides images (evidence: `blood_cell_image_cnn_tf.py`)
- Original BCCD images → Dataset discovery: provides originals (evidence: `blood_cell_image_cnn_tf.py`)
- LISC test images → Dataset discovery: provides test images (evidence: `blood_cell_image_cnn_tf.py`)
- Dataset discovery → Stratified split: splits training set (evidence: `blood_cell_image_cnn_tf.py`)
- Stratified split → Image preprocessing: loads and resizes (evidence: `blood_cell_image_cnn_tf.py`)
- Image preprocessing → Image augmentation: transforms samples (evidence: `blood_cell_image_cnn_tf.py`)
- Image augmentation → CNN classifier: feeds model (evidence: `blood_cell_image_cnn_tf.py`)
- CNN classifier → Model training: compiled for fit (evidence: `blood_cell_image_cnn_tf.py`)
- Model training → Checkpoint and LR: uses callbacks (evidence: `blood_cell_image_cnn_tf.py`)
- Model training → Convergence analysis: analyzes history (evidence: `blood_cell_image_cnn_tf.py`)
- Checkpoint and LR → Result files: saves checkpoint (evidence: `blood_cell_image_cnn_tf.py`)
- Convergence analysis → Result files: writes analysis (evidence: `blood_cell_image_cnn_tf.py`)
- Result files → Test evaluation: loads checkpoint (evidence: `blood_cell_image_cnn_tf.py`)
- Test evaluation → Kaggle images: tests on split (evidence: `blood_cell_image_cnn_tf.py`)
- Test evaluation → Original BCCD images: tests originals (evidence: `blood_cell_image_cnn_tf.py`)
- Test evaluation → LISC test images: tests LISC set (evidence: `blood_cell_image_cnn_tf.py`)
- Test evaluation → Result files: writes reports (evidence: `README.md`)
- Result files → Grad-CAM views: loads checkpoint (evidence: `blood_cell_image_cnn_tf.py`)
- Grad-CAM views → Result files: saves heatmaps (evidence: `README.md`)
