# mohtadaayesha/pneumonia-detection architecture

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

- Interactive diagram: https://gitdiagram.com/mohtadaayesha/pneumonia-detection
- Repository: https://github.com/mohtadaayesha/pneumonia-detection

## Overview

This repository is a notebook-based chest-X-ray classification experiment. Its principal workflow loads labelled images, explores and preprocesses them, trains a custom CNN and a VGG16 transfer-learning model, compares validation performance, then selects a threshold and evaluates VGG16 on the test set. The README documents these stages and evaluation capabilities; no notebook source excerpts were available, so the graph reflects documented relationships only.

Main entry points: [`Pneumonia_Detection.ipynb`](https://github.com/mohtadaayesha/pneumonia-detection/blob/main/Pneumonia_Detection.ipynb) (VGG16 transfer learning), [`images`](https://github.com/mohtadaayesha/pneumonia-detection/tree/main/images) (Analysis figures)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_loading["Load and encode"]
  node_eda["Exploratory analysis"]
  node_preprocessing["Resize and preprocess"]
  node_augmentation["Training augmentation"]
end

subgraph group_models["Model training"]
  node_custom_cnn["Custom CNN"]
  node_vgg16["VGG16 transfer learning"]
end

subgraph group_evaluation["Evaluation"]
  node_validation["Validation comparison"]
  node_threshold["Threshold selection"]
  node_test_eval["Test evaluation"]
  node_error_analysis["Error analysis"]
  node_metrics["Classification metrics"]
  node_figures["Analysis figures"]
end

node_researcher(("Researcher"))
node_drive[("Google Drive")]
node_xray_data[("Chest X-ray splits")]

node_researcher -->|"runs notebook"| node_loading
node_loading -->|"reads dataset"| node_drive
node_drive -->|"provides splits"| node_xray_data
node_loading -->|"inspects data"| node_eda
node_loading -->|"loads and encodes"| node_preprocessing
node_preprocessing -->|"augments training"| node_augmentation
node_preprocessing -->|"feeds images"| node_custom_cnn
node_augmentation -->|"feeds training"| node_custom_cnn
node_preprocessing -->|"feeds images"| node_vgg16
node_augmentation -->|"feeds training"| node_vgg16
node_custom_cnn -->|"validation predictions"| node_validation
node_vgg16 -->|"validation predictions"| node_validation
node_validation -->|"compares models"| node_threshold
node_vgg16 -->|"provides probabilities"| node_threshold
node_threshold -->|"selects threshold"| node_test_eval
node_vgg16 -->|"provides predictions"| node_test_eval
node_test_eval -->|"computes scores"| node_metrics
node_test_eval -->|"supports review"| node_error_analysis
node_eda -->|"produces plots"| node_figures
node_validation -->|"produces plots"| node_figures
node_test_eval -->|"produces plots"| node_figures

click node_loading "https://github.com/mohtadaayesha/pneumonia-detection/blob/main/Pneumonia_Detection.ipynb"
click node_eda "https://github.com/mohtadaayesha/pneumonia-detection/blob/main/Pneumonia_Detection.ipynb"
click node_preprocessing "https://github.com/mohtadaayesha/pneumonia-detection/blob/main/Pneumonia_Detection.ipynb"
click node_augmentation "https://github.com/mohtadaayesha/pneumonia-detection/blob/main/Pneumonia_Detection.ipynb"
click node_custom_cnn "https://github.com/mohtadaayesha/pneumonia-detection/blob/main/Pneumonia_Detection.ipynb"
click node_vgg16 "https://github.com/mohtadaayesha/pneumonia-detection/blob/main/Pneumonia_Detection.ipynb"
click node_validation "https://github.com/mohtadaayesha/pneumonia-detection/blob/main/Pneumonia_Detection.ipynb"
click node_threshold "https://github.com/mohtadaayesha/pneumonia-detection/blob/main/Pneumonia_Detection.ipynb"
click node_test_eval "https://github.com/mohtadaayesha/pneumonia-detection/blob/main/Pneumonia_Detection.ipynb"
click node_error_analysis "https://github.com/mohtadaayesha/pneumonia-detection/blob/main/Pneumonia_Detection.ipynb"
click node_metrics "https://github.com/mohtadaayesha/pneumonia-detection/blob/main/Pneumonia_Detection.ipynb"
click node_figures "https://github.com/mohtadaayesha/pneumonia-detection/tree/main/images"

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_loading,node_eda,node_preprocessing,node_augmentation toneBlue
class node_custom_cnn,node_vgg16,node_drive,node_xray_data toneAmber
class node_validation,node_threshold,node_test_eval,node_error_analysis,node_metrics,node_figures toneMint
class node_researcher toneIndigo
```

## Components

### Data preparation

- [Load and encode](https://github.com/mohtadaayesha/pneumonia-detection/blob/main/Pneumonia_Detection.ipynb): `Pneumonia_Detection.ipynb`
- [Exploratory analysis](https://github.com/mohtadaayesha/pneumonia-detection/blob/main/Pneumonia_Detection.ipynb): `Pneumonia_Detection.ipynb`
- [Resize and preprocess](https://github.com/mohtadaayesha/pneumonia-detection/blob/main/Pneumonia_Detection.ipynb): `Pneumonia_Detection.ipynb`
- [Training augmentation](https://github.com/mohtadaayesha/pneumonia-detection/blob/main/Pneumonia_Detection.ipynb): `Pneumonia_Detection.ipynb`

### Model training

- [Custom CNN](https://github.com/mohtadaayesha/pneumonia-detection/blob/main/Pneumonia_Detection.ipynb): `Pneumonia_Detection.ipynb`
- [VGG16 transfer learning](https://github.com/mohtadaayesha/pneumonia-detection/blob/main/Pneumonia_Detection.ipynb): `Pneumonia_Detection.ipynb`

### Evaluation

- [Validation comparison](https://github.com/mohtadaayesha/pneumonia-detection/blob/main/Pneumonia_Detection.ipynb): `Pneumonia_Detection.ipynb`
- [Threshold selection](https://github.com/mohtadaayesha/pneumonia-detection/blob/main/Pneumonia_Detection.ipynb): `Pneumonia_Detection.ipynb`
- [Test evaluation](https://github.com/mohtadaayesha/pneumonia-detection/blob/main/Pneumonia_Detection.ipynb): `Pneumonia_Detection.ipynb`
- [Error analysis](https://github.com/mohtadaayesha/pneumonia-detection/blob/main/Pneumonia_Detection.ipynb): `Pneumonia_Detection.ipynb`
- [Classification metrics](https://github.com/mohtadaayesha/pneumonia-detection/blob/main/Pneumonia_Detection.ipynb): `Pneumonia_Detection.ipynb`
- [Analysis figures](https://github.com/mohtadaayesha/pneumonia-detection/tree/main/images): `images`

### Other components

- **Researcher**
- **Google Drive**
- **Chest X-ray splits**

## Connections

- Researcher → Load and encode: runs notebook
- Load and encode → Google Drive: reads dataset
- Google Drive → Chest X-ray splits: provides splits
- Load and encode → Exploratory analysis: inspects data
- Load and encode → Resize and preprocess: loads and encodes
- Resize and preprocess → Training augmentation: augments training
- Resize and preprocess → Custom CNN: feeds images
- Training augmentation → Custom CNN: feeds training
- Resize and preprocess → VGG16 transfer learning: feeds images
- Training augmentation → VGG16 transfer learning: feeds training
- Custom CNN → Validation comparison: validation predictions
- VGG16 transfer learning → Validation comparison: validation predictions
- Validation comparison → Threshold selection: compares models
- VGG16 transfer learning → Threshold selection: provides probabilities
- Threshold selection → Test evaluation: selects threshold
- VGG16 transfer learning → Test evaluation: provides predictions
- Test evaluation → Classification metrics: computes scores
- Test evaluation → Error analysis: supports review
- Exploratory analysis → Analysis figures: produces plots
- Validation comparison → Analysis figures: produces plots
- Test evaluation → Analysis figures: produces plots
