# eshwarkothapalli11/healthsense-ai architecture

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

- Interactive diagram: https://gitdiagram.com/eshwarkothapalli11/healthsense-ai
- Repository: https://github.com/eshwarkothapalli11/healthsense-ai

## Overview

HealthSense AI is a multimodal health-risk assessment application. A user submits physical-health measurements or a mental-health text assessment through the Gradio interface; the system evaluates the relevant models and can combine their predictions into a unified risk report. Separately, a training workflow prepares datasets, trains or loads models, and evaluates performance. The graph follows documented capabilities and shown references; some UI-to-model wiring and unsampled subsystem internals are not established by the excerpts.

Main entry points: [`src/ui/app.py`](https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/src/ui/app.py) (Gradio interface), [`training/train_all.py`](https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/training/train_all.py) (Training orchestrator), [`main.py`](https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/main.py) (App entry), [`training/models`](https://github.com/eshwarkothapalli11/healthsense-ai/tree/main/training/models) (Model training implementations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Assessment runtime"]
  node_entry["App entry<br/>[main.py]"]
  node_ui["Gradio interface<br/>[app.py]"]
  node_physical["Diabetes model<br/>[diabetes_model.py]"]
  node_heart["Heart model<br/>[heart_model.py]"]
  node_mental["Mental model<br/>[mental_model.py]"]
  node_fusion["Risk fusion<br/>[fusion_engine.py]"]
  node_artifacts[("Model artifacts")]
  node_scalers[("Preprocessor artifacts")]
  node_config["Runtime configuration<br/>[config.py]"]
end

subgraph group_data["Data preparation"]
  node_download["Dataset download"]
  node_tabular["Tabular preprocessing"]
  node_textprep["Text preprocessing<br/>[preprocess_text.py]"]
end

subgraph group_training["Model training"]
  node_trainer["Training orchestrator<br/>[train_all.py]"]
  node_model_training["Model training implementations"]
end

subgraph group_insights["Reporting and insights"]
  node_evaluation["Model evaluation<br/>[evaluator.py]"]
  node_explain["Explainability<br/>[explainability.py]"]
  node_visuals["Assessment visualizations<br/>[visualizations.py]"]
end

node_user(("Health assessor"))
node_dataset_sources(("Dataset sources"))

node_user -->|"opens app"| node_entry
node_entry -->|"loads models"| node_artifacts
node_entry -->|"loads preprocessors"| node_scalers
node_entry -->|"mounts interface"| node_ui
node_entry -->|"initializes engine"| node_fusion
node_ui -->|"fuses predictions"| node_fusion
node_ui -.->|"predicts text risk"| node_mental
node_ui -.->|"predicts diabetes risk"| node_physical
node_ui -.->|"predicts heart risk"| node_heart
node_ui -->|"prepares text"| node_textprep
node_ui -->|"requests explanations"| node_explain
node_ui -->|"renders charts"| node_visuals
node_dataset_sources -.->|"provides datasets"| node_download
node_trainer -->|"downloads data"| node_download
node_trainer -->|"prepares tabular data"| node_tabular
node_trainer -->|"prepares text data"| node_textprep
node_trainer -->|"trains models"| node_model_training
node_model_training -->|"uses tabular preparation"| node_tabular
node_model_training -->|"uses text preparation"| node_textprep
node_trainer -->|"evaluates models"| node_evaluation
node_model_training -.->|"saves trained models"| node_artifacts
node_tabular -->|"saves scalers"| node_scalers
node_textprep -->|"saves tokenizer"| node_scalers
node_config -->|"sets artifact paths"| node_artifacts
node_config -->|"sets artifact paths"| node_scalers

click node_entry "https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/main.py"
click node_ui "https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/src/ui/app.py"
click node_physical "https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/src/models/diabetes_model.py"
click node_heart "https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/src/models/heart_model.py"
click node_mental "https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/src/models/mental_model.py"
click node_fusion "https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/src/fusion/fusion_engine.py"
click node_artifacts "https://github.com/eshwarkothapalli11/healthsense-ai/tree/main/artifacts/models"
click node_scalers "https://github.com/eshwarkothapalli11/healthsense-ai/tree/main/artifacts/scalers"
click node_download "https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/src/data/download_datasets.py"
click node_tabular "https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/src/data/preprocess_tabular.py"
click node_textprep "https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/src/data/preprocess_text.py"
click node_trainer "https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/training/train_all.py"
click node_model_training "https://github.com/eshwarkothapalli11/healthsense-ai/tree/main/training/models"
click node_evaluation "https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/src/evaluation/evaluator.py"
click node_explain "https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/src/evaluation/explainability.py"
click node_visuals "https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/src/ui/visualizations.py"
click node_config "https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/config.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_entry,node_ui,node_physical,node_heart,node_mental,node_fusion,node_artifacts,node_scalers,node_config toneBlue
class node_download,node_tabular,node_textprep toneAmber
class node_trainer,node_model_training toneMint
class node_evaluation,node_explain,node_visuals toneRose
class node_user,node_dataset_sources toneIndigo
```

## Components

### Assessment runtime

- [App entry](https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/main.py): `main.py`
- [Gradio interface](https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/src/ui/app.py): `src/ui/app.py`
- [Diabetes model](https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/src/models/diabetes_model.py): `src/models/diabetes_model.py`
- [Heart model](https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/src/models/heart_model.py): `src/models/heart_model.py`
- [Mental model](https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/src/models/mental_model.py): `src/models/mental_model.py`
- [Risk fusion](https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/src/fusion/fusion_engine.py): `src/fusion/fusion_engine.py`
- [Model artifacts](https://github.com/eshwarkothapalli11/healthsense-ai/tree/main/artifacts/models): `artifacts/models`
- [Preprocessor artifacts](https://github.com/eshwarkothapalli11/healthsense-ai/tree/main/artifacts/scalers): `artifacts/scalers`
- [Runtime configuration](https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/config.py): `config.py`

### Data preparation

- [Dataset download](https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/src/data/download_datasets.py): `src/data/download_datasets.py`
- [Tabular preprocessing](https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/src/data/preprocess_tabular.py): `src/data/preprocess_tabular.py`
- [Text preprocessing](https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/src/data/preprocess_text.py): `src/data/preprocess_text.py`

### Model training

- [Training orchestrator](https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/training/train_all.py): `training/train_all.py`
- [Model training implementations](https://github.com/eshwarkothapalli11/healthsense-ai/tree/main/training/models): `training/models`

### Reporting and insights

- [Model evaluation](https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/src/evaluation/evaluator.py): `src/evaluation/evaluator.py`
- [Explainability](https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/src/evaluation/explainability.py): `src/evaluation/explainability.py`
- [Assessment visualizations](https://github.com/eshwarkothapalli11/healthsense-ai/blob/main/src/ui/visualizations.py): `src/ui/visualizations.py`

### Other components

- **Health assessor**
- **Dataset sources**

## Connections

- Health assessor → App entry: opens app (evidence: `README.md`)
- App entry → Model artifacts: loads models (evidence: `main.py`)
- App entry → Preprocessor artifacts: loads preprocessors (evidence: `main.py`)
- App entry → Gradio interface: mounts interface (evidence: `main.py`)
- App entry → Risk fusion: initializes engine (evidence: `main.py`)
- Gradio interface → Risk fusion: fuses predictions (evidence: `README.md`)
- Gradio interface → Mental model: predicts text risk
- Gradio interface → Diabetes model: predicts diabetes risk
- Gradio interface → Heart model: predicts heart risk
- Gradio interface → Text preprocessing: prepares text (evidence: `src/ui/app.py`)
- Gradio interface → Explainability: requests explanations (evidence: `src/ui/app.py`)
- Gradio interface → Assessment visualizations: renders charts (evidence: `src/ui/app.py`)
- Dataset sources → Dataset download: provides datasets
- Training orchestrator → Dataset download: downloads data (evidence: `training/train_all.py`)
- Training orchestrator → Tabular preprocessing: prepares tabular data (evidence: `training/train_all.py`)
- Training orchestrator → Text preprocessing: prepares text data (evidence: `training/train_all.py`)
- Training orchestrator → Model training implementations: trains models (evidence: `training/train_all.py`)
- Model training implementations → Tabular preprocessing: uses tabular preparation (evidence: `training/models/heart_model.py`)
- Model training implementations → Text preprocessing: uses text preparation (evidence: `training/models/mental_model.py`)
- Training orchestrator → Model evaluation: evaluates models (evidence: `training/train_all.py`)
- Model training implementations → Model artifacts: saves trained models
- Tabular preprocessing → Preprocessor artifacts: saves scalers (evidence: `src/data/preprocess_tabular.py`)
- Text preprocessing → Preprocessor artifacts: saves tokenizer (evidence: `src/data/preprocess_text.py`)
- Runtime configuration → Model artifacts: sets artifact paths (evidence: `config.py`)
- Runtime configuration → Preprocessor artifacts: sets artifact paths (evidence: `config.py`)
