# chando0185/chest_x_ray_detection architecture

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

- Interactive diagram: https://gitdiagram.com/chando0185/chest_x_ray_detection
- Repository: https://github.com/chando0185/chest_x_ray_detection

## Overview

This is a desktop chest-X-ray pneumonia classifier. The user selects an image, the app loads the saved model, preprocesses the image, predicts a class, and announces the result through speech. A separate notebook-derived script trains and saves the model. The README gives only the project title, so these capabilities and connections are inferred from the supplied source; the generated model file and dataset are not in the tree.

Main entry points: [`chest_xray.py`](https://github.com/chando0185/chest_x_ray_detection/blob/master/chest_xray.py) (Image selection), [`Untitled.py`](https://github.com/chando0185/chest_x_ray_detection/blob/master/Untitled.py) (VGG16 training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop app"]
  node_app["Qt application<br/>[chest_xray.py]"]
  node_upload["Image selection<br/>[chest_xray.py]"]
  node_predict["Result announcement<br/>[chest_xray.py]"]
  node_picker["File dialog<br/>[chest_xray.py]"]
end

subgraph group_inference["Image inference"]
  node_inference["Image preprocessing and prediction<br/>[chest_xray.py]"]
  node_model["Saved model"]
end

subgraph group_training["Model training"]
  node_training["VGG16 training<br/>[Untitled.py]"]
end

node_user(("User"))
node_image["Selected image"]
node_speech["Windows speech"]
node_dataset["Training and validation images"]

node_user -->|"uses"| node_app
node_app -->|"connects upload"| node_upload
node_app -->|"connects prediction"| node_predict
node_upload -->|"opens"| node_picker
node_picker -->|"selects"| node_image
node_upload -->|"loads"| node_model
node_upload -->|"loads"| node_image
node_upload -->|"preprocesses and predicts"| node_inference
node_inference -->|"uses"| node_model
node_predict -->|"announces result"| node_speech
node_dataset -->|"provides images"| node_training
node_training -->|"saves"| node_model

click node_app "https://github.com/chando0185/chest_x_ray_detection/blob/master/chest_xray.py"
click node_upload "https://github.com/chando0185/chest_x_ray_detection/blob/master/chest_xray.py"
click node_predict "https://github.com/chando0185/chest_x_ray_detection/blob/master/chest_xray.py"
click node_picker "https://github.com/chando0185/chest_x_ray_detection/blob/master/chest_xray.py"
click node_inference "https://github.com/chando0185/chest_x_ray_detection/blob/master/chest_xray.py"
click node_training "https://github.com/chando0185/chest_x_ray_detection/blob/master/Untitled.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_upload,node_predict,node_picker,node_user toneBlue
class node_inference,node_model toneAmber
class node_training toneMint
class node_image,node_speech,node_dataset toneIndigo
```

## Components

### Desktop app

- [Qt application](https://github.com/chando0185/chest_x_ray_detection/blob/master/chest_xray.py): `chest_xray.py`
- [Image selection](https://github.com/chando0185/chest_x_ray_detection/blob/master/chest_xray.py): `chest_xray.py`
- [Result announcement](https://github.com/chando0185/chest_x_ray_detection/blob/master/chest_xray.py): `chest_xray.py`
- [File dialog](https://github.com/chando0185/chest_x_ray_detection/blob/master/chest_xray.py): `chest_xray.py`

### Image inference

- [Image preprocessing and prediction](https://github.com/chando0185/chest_x_ray_detection/blob/master/chest_xray.py): `chest_xray.py`
- **Saved model**

### Model training

- [VGG16 training](https://github.com/chando0185/chest_x_ray_detection/blob/master/Untitled.py): `Untitled.py`

### Other components

- **User**
- **Selected image**
- **Windows speech**
- **Training and validation images**

## Connections

- User → Qt application: uses
- Qt application → Image selection: connects upload
- Qt application → Result announcement: connects prediction
- Image selection → File dialog: opens
- File dialog → Selected image: selects
- Image selection → Saved model: loads
- Image selection → Selected image: loads
- Image selection → Image preprocessing and prediction: preprocesses and predicts
- Image preprocessing and prediction → Saved model: uses
- Result announcement → Windows speech: announces result
- Training and validation images → VGG16 training: provides images
- VGG16 training → Saved model: saves
