# anitaokechukwu/chest-xray-pneumonia-detection architecture

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

- Interactive diagram: https://gitdiagram.com/anitaokechukwu/chest-xray-pneumonia-detection
- Repository: https://github.com/anitaokechukwu/chest-xray-pneumonia-detection

## Overview

This is a Streamlit chest X-ray classification demo. A user uploads an image, the app previews it, and on request preprocesses it for the trained CNN; the app then displays a NORMAL/PNEUMONIA prediction and pneumonia score. The README also describes data preparation, training, and evaluation, but this repository contains no source for those stages, so they are not represented as implemented components. Runtime relationships below are supported by app.py; the model is a checked-in artifact.

Main entry points: [`app.py`](https://github.com/anitaokechukwu/chest-xray-pneumonia-detection/blob/main/app.py) (Streamlit app), [`best_pneumonia_cnn.keras`](https://github.com/anitaokechukwu/chest-xray-pneumonia-detection/blob/main/best_pneumonia_cnn.keras) (Trained CNN)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_app["Streamlit app<br/>[app.py]"]
  node_result["Prediction display<br/>[app.py]"]
end

subgraph group_inference["Inference"]
  node_preprocess["Image preprocessing<br/>[app.py]"]
end

subgraph group_model["Model artifact"]
  node_cnn["Trained CNN"]
end

node_user(("User"))

node_user -->|"uploads image"| node_app
node_app -->|"analyzes image"| node_preprocess
node_preprocess -->|"predicts with"| node_cnn
node_app -->|"loads model"| node_cnn
node_preprocess -->|"returns prediction"| node_result
node_app -->|"renders result"| node_result

click node_app "https://github.com/anitaokechukwu/chest-xray-pneumonia-detection/blob/main/app.py"
click node_preprocess "https://github.com/anitaokechukwu/chest-xray-pneumonia-detection/blob/main/app.py"
click node_cnn "https://github.com/anitaokechukwu/chest-xray-pneumonia-detection/blob/main/best_pneumonia_cnn.keras"
click node_result "https://github.com/anitaokechukwu/chest-xray-pneumonia-detection/blob/main/app.py"

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_app,node_result,node_user toneBlue
class node_preprocess toneAmber
class node_cnn toneMint
```

## Components

### User interface

- [Streamlit app](https://github.com/anitaokechukwu/chest-xray-pneumonia-detection/blob/main/app.py): `app.py`
- [Prediction display](https://github.com/anitaokechukwu/chest-xray-pneumonia-detection/blob/main/app.py): `app.py`

### Inference

- [Image preprocessing](https://github.com/anitaokechukwu/chest-xray-pneumonia-detection/blob/main/app.py): `app.py`

### Model artifact

- [Trained CNN](https://github.com/anitaokechukwu/chest-xray-pneumonia-detection/blob/main/best_pneumonia_cnn.keras): `best_pneumonia_cnn.keras`

### Other components

- **User**

## Connections

- User → Streamlit app: uploads image (evidence: `app.py`)
- Streamlit app → Image preprocessing: analyzes image (evidence: `app.py`)
- Image preprocessing → Trained CNN: predicts with (evidence: `app.py`)
- Streamlit app → Trained CNN: loads model (evidence: `app.py`)
- Image preprocessing → Prediction display: returns prediction (evidence: `app.py`)
- Streamlit app → Prediction display: renders result (evidence: `app.py`)
