# lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data architecture

> Architecture diagram of the GitHub repository lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data
- Repository: https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data

## Overview

This repository combines two breast-ultrasound workflows: a Streamlit prediction/history/reporting app and a federated-learning research pipeline. The app’s sampled prediction helper generates filename-biased random probabilities rather than invoking the neural models, so the two workflows are not presented as connected. Federated learning prepares client data, trains models with several strategies, and records metrics; sampled excerpts do not establish the full orchestration links. The graph preserves the documented app and analysis capabilities while omitting uncertain connections.

Main entry points: [`predict.py`](https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/predict.py) (Image prediction), [`model.py`](https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/model.py) (Training model and strategy), [`app.py`](https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/app.py) (Streamlit interface), [`data_utils.py`](https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/data_utils.py) (Client data splits)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clinical_app["Prediction App"]
  node_app["Streamlit interface<br/>[app.py]"]
  node_prediction["Image prediction<br/>[predict.py]"]
  node_prediction_helpers["Prediction helpers<br/>[utils.py]"]
  node_history[("Prediction history<br/>[utils.py]")]
  node_reports["PDF reports<br/>[utils.py]"]
  node_advanced_app["Heterogeneity UI<br/>[newapp.py]"]
end

subgraph group_federated["Federated Learning"]
  node_data_prep["Client data splits<br/>[data_utils.py]"]
  node_settings["Training configuration<br/>[config.py]"]
  node_cnn["CNN model<br/>[models.py]"]
  node_training_models["Training model and strategy<br/>[model.py]"]
  node_federated_helpers["Federated utilities<br/>[fl_utils.py]"]
  node_metrics["Training metrics<br/>[fl_utils.py]"]
end

subgraph group_analysis["Dataset Analysis"]
  node_dataset_analysis["Dataset analysis<br/>[analyse.py]"]
end

node_patient(("Patient or researcher"))

node_patient -->|"uses"| node_app
node_patient -->|"uploads images"| node_prediction
node_app -.->|"renders tab"| node_prediction
node_prediction -->|"generates predictions"| node_prediction_helpers
node_prediction -->|"saves entries"| node_history
node_prediction -.->|"builds report"| node_reports
node_patient -->|"uses"| node_advanced_app
node_settings -->|"configures splits"| node_data_prep
node_data_prep -.->|"returns client data"| node_training_models
node_training_models -.->|"trains model"| node_cnn
node_training_models -.->|"uses strategy helpers"| node_federated_helpers
node_federated_helpers -->|"writes metrics"| node_metrics
node_patient -.->|"runs analysis"| node_dataset_analysis

click node_app "https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/app.py"
click node_prediction "https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/predict.py"
click node_prediction_helpers "https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/utils.py"
click node_history "https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/utils.py"
click node_reports "https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/utils.py"
click node_advanced_app "https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/newapp.py"
click node_data_prep "https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/data_utils.py"
click node_settings "https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/config.py"
click node_cnn "https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/models.py"
click node_training_models "https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/model.py"
click node_federated_helpers "https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/fl_utils.py"
click node_metrics "https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/fl_utils.py"
click node_dataset_analysis "https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/analyse.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_prediction,node_prediction_helpers,node_history,node_reports,node_advanced_app toneBlue
class node_data_prep,node_settings,node_cnn,node_training_models,node_federated_helpers,node_metrics toneAmber
class node_dataset_analysis toneMint
class node_patient toneIndigo
```

## Components

### Prediction App

- [Streamlit interface](https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/app.py): `app.py`
- [Image prediction](https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/predict.py): `predict.py`
- [Prediction helpers](https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/utils.py): `utils.py`
- [Prediction history](https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/utils.py): `utils.py`
- [PDF reports](https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/utils.py): `utils.py`
- [Heterogeneity UI](https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/newapp.py): `newapp.py`

### Federated Learning

- [Client data splits](https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/data_utils.py): `data_utils.py`
- [Training configuration](https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/config.py): `config.py`
- [CNN model](https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/models.py): `models.py`
- [Training model and strategy](https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/model.py): `model.py`
- [Federated utilities](https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/fl_utils.py): `fl_utils.py`
- [Training metrics](https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/fl_utils.py): `fl_utils.py`

### Dataset Analysis

- [Dataset analysis](https://github.com/lavanya212005/adaptive-federated-learning-for-non-iid-healthcare-data/blob/main/analyse.py): `analyse.py`

### Other components

- **Patient or researcher**

## Connections

- Patient or researcher → Streamlit interface: uses (evidence: `app.py`)
- Patient or researcher → Image prediction: uploads images (evidence: `predict.py`)
- Streamlit interface → Image prediction: renders tab
- Image prediction → Prediction helpers: generates predictions (evidence: `predict.py`)
- Image prediction → Prediction history: saves entries (evidence: `predict.py`)
- Image prediction → PDF reports: builds report (evidence: `predict.py`)
- Patient or researcher → Heterogeneity UI: uses (evidence: `newapp.py`)
- Training configuration → Client data splits: configures splits (evidence: `data_utils.py`)
- Client data splits → Training model and strategy: returns client data
- Training model and strategy → CNN model: trains model
- Training model and strategy → Federated utilities: uses strategy helpers
- Federated utilities → Training metrics: writes metrics (evidence: `fl_utils.py`)
- Patient or researcher → Dataset analysis: runs analysis
