# dasrohit15/lungs_disease_prediction architecture

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

- Interactive diagram: https://gitdiagram.com/dasrohit15/lungs_disease_prediction
- Repository: https://github.com/dasrohit15/lungs_disease_prediction

## Overview

This is a Streamlit chest-X-ray classifier: a user uploads an image, the app preprocesses it, runs a VGG16-based model, and presents disease predictions and probabilities. It also provides medical guidance, tracks session history, and supports CSV export. The workflow and these capabilities are documented or visible in app.py; components are grouped by responsibility, though they share that implementation file. The model asset is loaded by the app. The separate class_names.json is not referenced in the sampled source, so its runtime role is unclear.

Main entry points: [`app.py`](https://github.com/dasrohit15/lungs_disease_prediction/blob/main/app.py) (Streamlit App), [`lungs_disease_vgg16.h5`](https://github.com/dasrohit15/lungs_disease_prediction/blob/main/lungs_disease_vgg16.h5) (VGG16 Model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User Interface"]
  node_app["Streamlit App<br/>[app.py]"]
  node_upload["Image Upload<br/>[app.py]"]
end

subgraph group_analysis["Image Analysis"]
  node_preprocess["Image Preprocessing<br/>[app.py]"]
  node_model["VGG16 Model"]
  node_inference["Disease Inference<br/>[app.py]"]
end

subgraph group_results["Results"]
  node_classification["Class Selection<br/>[app.py]"]
  node_confidence["Confidence Check<br/>[app.py]"]
  node_advice["Medical Advice<br/>[app.py]"]
  node_probabilities["Probability Views<br/>[app.py]"]
end

subgraph group_history["History"]
  node_history["Session History<br/>[app.py]"]
  node_export["CSV Export<br/>[app.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"offers"| node_upload
node_app -->|"preprocesses"| node_preprocess
node_app -->|"loads"| node_model
node_app -->|"predicts"| node_inference
node_app -->|"selects class"| node_classification
node_app -->|"checks"| node_confidence
node_app -->|"displays advice"| node_advice
node_app -->|"renders"| node_probabilities
node_app -->|"records"| node_history
node_app -->|"exports"| node_export

click node_app "https://github.com/dasrohit15/lungs_disease_prediction/blob/main/app.py"
click node_upload "https://github.com/dasrohit15/lungs_disease_prediction/blob/main/app.py"
click node_preprocess "https://github.com/dasrohit15/lungs_disease_prediction/blob/main/app.py"
click node_model "https://github.com/dasrohit15/lungs_disease_prediction/blob/main/lungs_disease_vgg16.h5"
click node_inference "https://github.com/dasrohit15/lungs_disease_prediction/blob/main/app.py"
click node_classification "https://github.com/dasrohit15/lungs_disease_prediction/blob/main/app.py"
click node_confidence "https://github.com/dasrohit15/lungs_disease_prediction/blob/main/app.py"
click node_advice "https://github.com/dasrohit15/lungs_disease_prediction/blob/main/app.py"
click node_probabilities "https://github.com/dasrohit15/lungs_disease_prediction/blob/main/app.py"
click node_history "https://github.com/dasrohit15/lungs_disease_prediction/blob/main/app.py"
click node_export "https://github.com/dasrohit15/lungs_disease_prediction/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_upload,node_user toneBlue
class node_preprocess,node_model,node_inference toneAmber
class node_classification,node_confidence,node_advice,node_probabilities toneMint
class node_history,node_export toneRose
```

## Components

### User Interface

- [Streamlit App](https://github.com/dasrohit15/lungs_disease_prediction/blob/main/app.py): `app.py`
- [Image Upload](https://github.com/dasrohit15/lungs_disease_prediction/blob/main/app.py): `app.py`

### Image Analysis

- [Image Preprocessing](https://github.com/dasrohit15/lungs_disease_prediction/blob/main/app.py): `app.py`
- [VGG16 Model](https://github.com/dasrohit15/lungs_disease_prediction/blob/main/lungs_disease_vgg16.h5): `lungs_disease_vgg16.h5`
- [Disease Inference](https://github.com/dasrohit15/lungs_disease_prediction/blob/main/app.py): `app.py`

### Results

- [Class Selection](https://github.com/dasrohit15/lungs_disease_prediction/blob/main/app.py): `app.py`
- [Confidence Check](https://github.com/dasrohit15/lungs_disease_prediction/blob/main/app.py): `app.py`
- [Medical Advice](https://github.com/dasrohit15/lungs_disease_prediction/blob/main/app.py): `app.py`
- [Probability Views](https://github.com/dasrohit15/lungs_disease_prediction/blob/main/app.py): `app.py`

### History

- [Session History](https://github.com/dasrohit15/lungs_disease_prediction/blob/main/app.py): `app.py`
- [CSV Export](https://github.com/dasrohit15/lungs_disease_prediction/blob/main/app.py): `app.py`

### Other components

- **User**

## Connections

- User → Streamlit App: uses (evidence: `app.py`)
- Streamlit App → Image Upload: offers (evidence: `app.py`)
- Streamlit App → Image Preprocessing: preprocesses (evidence: `app.py`)
- Streamlit App → VGG16 Model: loads (evidence: `app.py`)
- Streamlit App → Disease Inference: predicts (evidence: `app.py`)
- Streamlit App → Class Selection: selects class (evidence: `app.py`)
- Streamlit App → Confidence Check: checks (evidence: `app.py`)
- Streamlit App → Medical Advice: displays advice (evidence: `app.py`)
- Streamlit App → Probability Views: renders (evidence: `app.py`)
- Streamlit App → Session History: records (evidence: `app.py`)
- Streamlit App → CSV Export: exports (evidence: `app.py`)
