# a-joshika-git/multimodelopttab---early-lung-cancer-detection architecture

> Architecture diagram of the GitHub repository a-joshika-git/multimodelopttab---early-lung-cancer-detection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/a-joshika-git/multimodelopttab---early-lung-cancer-detection
- Repository: https://github.com/a-joshika-git/multimodelopttab---early-lung-cancer-detection

## Overview

MultiModalOptTab is a Gradio demo for lung-cancer risk prediction from a chest CT image and patient attributes. A user supplies those inputs and prediction controls; the app delegates to a predictor that validates the image, prepares model inputs, runs a checkpoint-loaded ensemble, and presents a risk estimate and related details. The README documents five ensemble checkpoints, preprocessing/calibration artifacts, and an optional CT reference profile. The excerpts do not show the complete inference or model implementation, so internal stages are represented at a high level.

Main entry points: [`inference.py`](https://github.com/a-joshika-git/multimodelopttab---early-lung-cancer-detection/blob/main/inference.py) (Predictor orchestration), [`app.py`](https://github.com/a-joshika-git/multimodelopttab---early-lung-cancer-detection/blob/main/app.py) (Gradio inputs), [`validators.py`](https://github.com/a-joshika-git/multimodelopttab---early-lung-cancer-detection/blob/main/validators.py) (CT validation), [`model.py`](https://github.com/a-joshika-git/multimodelopttab---early-lung-cancer-detection/blob/main/model.py) (Multimodal ensemble)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_gradio_ui["Gradio inputs<br/>[app.py]"]
  node_result_view["Risk display<br/>[app.py]"]
end

subgraph group_prediction["Prediction runtime"]
  node_predictor["Predictor orchestration<br/>[inference.py]"]
  node_ct_validation["CT validation<br/>[validators.py]"]
  node_model["Multimodal ensemble<br/>[model.py]"]
  node_checkpoints[("Model artifacts")]
end

node_user(("Demo user"))

node_user -->|"enters inputs"| node_gradio_ui
node_gradio_ui -->|"requests prediction"| node_predictor
node_predictor -->|"validates image"| node_ct_validation
node_predictor -->|"runs ensemble"| node_model
node_predictor -->|"loads artifacts"| node_checkpoints
node_predictor -->|"returns prediction"| node_result_view
node_result_view -->|"shows risk"| node_user

click node_gradio_ui "https://github.com/a-joshika-git/multimodelopttab---early-lung-cancer-detection/blob/main/app.py"
click node_result_view "https://github.com/a-joshika-git/multimodelopttab---early-lung-cancer-detection/blob/main/app.py"
click node_predictor "https://github.com/a-joshika-git/multimodelopttab---early-lung-cancer-detection/blob/main/inference.py"
click node_ct_validation "https://github.com/a-joshika-git/multimodelopttab---early-lung-cancer-detection/blob/main/validators.py"
click node_model "https://github.com/a-joshika-git/multimodelopttab---early-lung-cancer-detection/blob/main/model.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_gradio_ui,node_result_view,node_user toneBlue
class node_predictor,node_ct_validation,node_model,node_checkpoints toneAmber
```

## Components

### User interface

- [Gradio inputs](https://github.com/a-joshika-git/multimodelopttab---early-lung-cancer-detection/blob/main/app.py): `app.py`
- [Risk display](https://github.com/a-joshika-git/multimodelopttab---early-lung-cancer-detection/blob/main/app.py): `app.py`

### Prediction runtime

- [Predictor orchestration](https://github.com/a-joshika-git/multimodelopttab---early-lung-cancer-detection/blob/main/inference.py): `inference.py`
- [CT validation](https://github.com/a-joshika-git/multimodelopttab---early-lung-cancer-detection/blob/main/validators.py): `validators.py`
- [Multimodal ensemble](https://github.com/a-joshika-git/multimodelopttab---early-lung-cancer-detection/blob/main/model.py): `model.py`
- **Model artifacts**

### Other components

- **Demo user**

## Connections

- Demo user → Gradio inputs: enters inputs (evidence: `app.py`)
- Gradio inputs → Predictor orchestration: requests prediction (evidence: `app.py`)
- Predictor orchestration → CT validation: validates image (evidence: `inference.py`)
- Predictor orchestration → Multimodal ensemble: runs ensemble (evidence: `inference.py`)
- Predictor orchestration → Model artifacts: loads artifacts (evidence: `README.md`)
- Predictor orchestration → Risk display: returns prediction (evidence: `app.py`)
- Risk display → Demo user: shows risk (evidence: `app.py`)
