# mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline architecture

> Architecture diagram of the GitHub repository mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline
- Repository: https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline

## Overview

This research prototype combines LUNA16 Mask R-CNN training and evaluation with a FastAPI service, React dashboard, and edge–cloud experiments. A typical workflow is to prepare cached 2.5D patches, run a configured training experiment, inspect its metrics and leaderboard, then upload a patch for checkpoint-backed inference and review the saved result. The README also describes federated learning, split inference, compression, and privacy research. Several routes and edge internals were not sampled, so their connections are omitted or marked unverified.

Main entry points: [`backend/app/main.py`](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/backend/app/main.py) (FastAPI app), [`frontend/src/App.jsx`](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/frontend/src/App.jsx) (App navigation), [`training/trainer.py`](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/training/trainer.py) (Trainer), [`frontend/src/services/api.js`](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/frontend/src/services/api.js) (HTTP and WS client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Research dashboard"]
  node_app["App navigation<br/>[App.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_experiments_ui["Experiments UI<br/>[Experiments.jsx]"]
  node_inference_ui["Inference UI<br/>[InferencePage.jsx]"]
  node_edge_ui["Edge network UI<br/>[EdgeNetwork.jsx]"]
  node_leaderboard["Leaderboard<br/>[Leaderboard.jsx]"]
  node_api_client["HTTP and WS client<br/>[api.js]"]
end

subgraph group_service["API and persistence"]
  node_fastapi["FastAPI app<br/>[main.py]"]
  node_experiment_routes["Experiment routes<br/>[experiments.py]"]
  node_inference_routes["Inference routes<br/>[inference.py]"]
  node_results_routes["Results routes<br/>[results.py]"]
  node_edge_routes["Edge routes<br/>[edge.py]"]
  node_dashboard_routes["Dashboard routes<br/>[dashboard.py]"]
  node_inference_engine["Inference engine<br/>[inference.py]"]
  node_database[("Experiment and result DB<br/>[database.py]")]
  node_data_config["Data configuration<br/>[data_config.py]"]
end

subgraph group_learning["Training and evaluation"]
  node_patch_cache["Patch cache"]
  node_dataset["LUNA16 dataset<br/>[dataset.py]"]
  node_trainer["Trainer<br/>[trainer.py]"]
  node_model["Mask R-CNN model<br/>[model.py]"]
  node_losses["Mask losses<br/>[losses.py]"]
  node_metrics["Evaluation metrics<br/>[metrics.py]"]
  node_experiment_orchestration["Phase orchestration<br/>[experiment.py]"]
end

subgraph group_edge["Edge-cloud research"]
  node_federated["Federated simulation<br/>[federated.py]"]
  node_edge_node["Edge node service<br/>[edge_node.py]"]
  node_feature_extractor["Split feature extractor"]
  node_compressor["Feature compressor<br/>[compressor.py]"]
  node_network_monitor["Network monitor<br/>[network_monitor.py]"]
  node_edge_preprocessor["Edge preprocessing<br/>[preprocessor.py]"]
end

subgraph group_research["Research utilities"]
  node_split_analysis["Split analysis"]
  node_privacy_research["Privacy experiments"]
end

node_researcher(("Researcher"))

node_researcher -->|"uses"| node_app
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_experiments_ui
node_app -->|"routes to"| node_inference_ui
node_app -->|"routes to"| node_edge_ui
node_app -->|"routes to"| node_leaderboard
node_dashboard -->|"requests data"| node_api_client
node_experiments_ui -.->|"requests experiments"| node_api_client
node_inference_ui -->|"submits patches"| node_api_client
node_edge_ui -.->|"requests network data"| node_api_client
node_leaderboard -.->|"requests rankings"| node_api_client
node_api_client -.->|"sends HTTP and WS"| node_fastapi
node_fastapi -->|"registers router"| node_inference_routes
node_fastapi -->|"registers router"| node_experiment_routes
node_fastapi -->|"registers router"| node_results_routes
node_fastapi -->|"registers router"| node_edge_routes
node_fastapi -->|"registers router"| node_dashboard_routes
node_fastapi -->|"creates tables"| node_database
node_fastapi -->|"initializes"| node_inference_engine
node_fastapi -->|"reads runtime info"| node_data_config
node_inference_routes -->|"runs inference"| node_inference_engine
node_inference_routes -->|"stores and reads results"| node_database
node_experiment_routes -->|"manages experiments"| node_database
node_experiment_routes -->|"starts training"| node_trainer
node_experiment_routes -->|"resolves data paths"| node_data_config
node_trainer -->|"trains"| node_model
node_trainer -->|"loads batches"| node_dataset
node_trainer -->|"computes losses"| node_losses
node_trainer -->|"evaluates"| node_metrics
node_dataset -->|"reads cached patches"| node_patch_cache
node_patch_cache -->|"uses dataset helpers"| node_dataset
node_inference_engine -->|"loads checkpoint model"| node_model
node_experiment_orchestration -.->|"orchestrates phases"| node_trainer
node_federated -->|"uses model"| node_model
node_federated -->|"uses data"| node_dataset
node_federated -->|"uses losses"| node_losses
node_federated -->|"uses metrics"| node_metrics
node_edge_node -.->|"communicates with cloud"| node_fastapi
node_edge_node -.->|"uses split inference"| node_feature_extractor
node_edge_node -.->|"uses compression"| node_compressor
node_edge_node -.->|"measures network"| node_network_monitor
node_edge_node -.->|"prepares inputs"| node_edge_preprocessor
node_split_analysis -.->|"studies split points"| node_feature_extractor
node_privacy_research -.->|"explores privacy"| node_federated

click node_app "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/frontend/src/App.jsx"
click node_dashboard "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/frontend/src/pages/Dashboard.jsx"
click node_experiments_ui "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/frontend/src/pages/Experiments.jsx"
click node_inference_ui "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/frontend/src/pages/InferencePage.jsx"
click node_edge_ui "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/frontend/src/pages/EdgeNetwork.jsx"
click node_leaderboard "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/frontend/src/pages/Leaderboard.jsx"
click node_api_client "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/frontend/src/services/api.js"
click node_fastapi "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/backend/app/main.py"
click node_experiment_routes "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/backend/app/routes/experiments.py"
click node_inference_routes "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/backend/app/routes/inference.py"
click node_results_routes "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/backend/app/routes/results.py"
click node_edge_routes "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/backend/app/routes/edge.py"
click node_dashboard_routes "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/backend/app/routes/dashboard.py"
click node_inference_engine "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/backend/app/ml/inference.py"
click node_database "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/backend/app/database.py"
click node_data_config "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/backend/app/data_config.py"
click node_patch_cache "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/training/preprocess_cache.py"
click node_dataset "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/training/dataset.py"
click node_trainer "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/training/trainer.py"
click node_model "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/training/model.py"
click node_losses "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/training/losses.py"
click node_metrics "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/training/metrics.py"
click node_experiment_orchestration "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/training/experiment.py"
click node_federated "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/training/federated.py"
click node_edge_node "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/edge/edge_node.py"
click node_feature_extractor "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/edge/feature_extractor.py"
click node_compressor "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/edge/compressor.py"
click node_network_monitor "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/edge/network_monitor.py"
click node_edge_preprocessor "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/edge/preprocessor.py"
click node_split_analysis "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/scripts/cn1_split_analysis.py"
click node_privacy_research "https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/scripts/cn5_differential_privacy.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_dashboard,node_experiments_ui,node_inference_ui,node_edge_ui,node_leaderboard,node_api_client toneBlue
class node_fastapi,node_experiment_routes,node_inference_routes,node_results_routes,node_edge_routes,node_dashboard_routes,node_inference_engine,node_database,node_data_config toneAmber
class node_patch_cache,node_dataset,node_trainer,node_model,node_losses,node_metrics,node_experiment_orchestration toneMint
class node_federated,node_edge_node,node_feature_extractor,node_compressor,node_network_monitor,node_edge_preprocessor toneRose
class node_split_analysis,node_privacy_research,node_researcher toneIndigo
```

## Components

### Research dashboard

- [App navigation](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Dashboard](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Experiments UI](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/frontend/src/pages/Experiments.jsx): `frontend/src/pages/Experiments.jsx`
- [Inference UI](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/frontend/src/pages/InferencePage.jsx): `frontend/src/pages/InferencePage.jsx`
- [Edge network UI](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/frontend/src/pages/EdgeNetwork.jsx): `frontend/src/pages/EdgeNetwork.jsx`
- [Leaderboard](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/frontend/src/pages/Leaderboard.jsx): `frontend/src/pages/Leaderboard.jsx`
- [HTTP and WS client](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### API and persistence

- [FastAPI app](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/backend/app/main.py): `backend/app/main.py`
- [Experiment routes](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/backend/app/routes/experiments.py): `backend/app/routes/experiments.py`
- [Inference routes](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/backend/app/routes/inference.py): `backend/app/routes/inference.py`
- [Results routes](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/backend/app/routes/results.py): `backend/app/routes/results.py`
- [Edge routes](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/backend/app/routes/edge.py): `backend/app/routes/edge.py`
- [Dashboard routes](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/backend/app/routes/dashboard.py): `backend/app/routes/dashboard.py`
- [Inference engine](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/backend/app/ml/inference.py): `backend/app/ml/inference.py`
- [Experiment and result DB](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/backend/app/database.py): `backend/app/database.py`
- [Data configuration](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/backend/app/data_config.py): `backend/app/data_config.py`

### Training and evaluation

- [Patch cache](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/training/preprocess_cache.py): `training/preprocess_cache.py`
- [LUNA16 dataset](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/training/dataset.py): `training/dataset.py`
- [Trainer](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/training/trainer.py): `training/trainer.py`
- [Mask R-CNN model](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/training/model.py): `training/model.py`
- [Mask losses](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/training/losses.py): `training/losses.py`
- [Evaluation metrics](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/training/metrics.py): `training/metrics.py`
- [Phase orchestration](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/training/experiment.py): `training/experiment.py`

### Edge-cloud research

- [Federated simulation](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/training/federated.py): `training/federated.py`
- [Edge node service](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/edge/edge_node.py): `edge/edge_node.py`
- [Split feature extractor](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/edge/feature_extractor.py): `edge/feature_extractor.py`
- [Feature compressor](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/edge/compressor.py): `edge/compressor.py`
- [Network monitor](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/edge/network_monitor.py): `edge/network_monitor.py`
- [Edge preprocessing](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/edge/preprocessor.py): `edge/preprocessor.py`

### Research utilities

- [Split analysis](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/scripts/cn1_split_analysis.py): `scripts/cn1_split_analysis.py`
- [Privacy experiments](https://github.com/mandeep15686/mask-r-cnn-lung-nodule-detection-edge-cloud-pipeline/blob/main/scripts/cn5_differential_privacy.py): `scripts/cn5_differential_privacy.py`

### Other components

- **Researcher**

## Connections

- Researcher → App navigation: uses (evidence: `frontend/src/App.jsx`)
- App navigation → Dashboard: routes to (evidence: `frontend/src/App.jsx`)
- App navigation → Experiments UI: routes to (evidence: `frontend/src/App.jsx`)
- App navigation → Inference UI: routes to (evidence: `frontend/src/App.jsx`)
- App navigation → Edge network UI: routes to (evidence: `frontend/src/App.jsx`)
- App navigation → Leaderboard: routes to (evidence: `frontend/src/App.jsx`)
- Dashboard → HTTP and WS client: requests data (evidence: `frontend/src/pages/Dashboard.jsx`)
- Experiments UI → HTTP and WS client: requests experiments
- Inference UI → HTTP and WS client: submits patches (evidence: `frontend/src/pages/InferencePage.jsx`)
- Edge network UI → HTTP and WS client: requests network data
- Leaderboard → HTTP and WS client: requests rankings
- HTTP and WS client → FastAPI app: sends HTTP and WS
- FastAPI app → Inference routes: registers router (evidence: `backend/app/main.py`)
- FastAPI app → Experiment routes: registers router (evidence: `backend/app/main.py`)
- FastAPI app → Results routes: registers router (evidence: `backend/app/main.py`)
- FastAPI app → Edge routes: registers router (evidence: `backend/app/main.py`)
- FastAPI app → Dashboard routes: registers router (evidence: `backend/app/main.py`)
- FastAPI app → Experiment and result DB: creates tables (evidence: `backend/app/main.py`)
- FastAPI app → Inference engine: initializes (evidence: `backend/app/main.py`)
- FastAPI app → Data configuration: reads runtime info (evidence: `backend/app/main.py`)
- Inference routes → Inference engine: runs inference (evidence: `backend/app/routes/inference.py`)
- Inference routes → Experiment and result DB: stores and reads results (evidence: `backend/app/routes/inference.py`)
- Experiment routes → Experiment and result DB: manages experiments (evidence: `backend/app/routes/experiments.py`)
- Experiment routes → Trainer: starts training (evidence: `backend/app/routes/experiments.py`)
- Experiment routes → Data configuration: resolves data paths (evidence: `backend/app/routes/experiments.py`)
- Trainer → Mask R-CNN model: trains (evidence: `training/trainer.py`)
- Trainer → LUNA16 dataset: loads batches (evidence: `training/trainer.py`)
- Trainer → Mask losses: computes losses (evidence: `training/trainer.py`)
- Trainer → Evaluation metrics: evaluates (evidence: `training/trainer.py`)
- LUNA16 dataset → Patch cache: reads cached patches (evidence: `training/dataset.py`)
- Patch cache → LUNA16 dataset: uses dataset helpers (evidence: `training/preprocess_cache.py`)
- Inference engine → Mask R-CNN model: loads checkpoint model (evidence: `backend/app/ml/inference.py`)
- Phase orchestration → Trainer: orchestrates phases
- Federated simulation → Mask R-CNN model: uses model (evidence: `training/federated.py`)
- Federated simulation → LUNA16 dataset: uses data (evidence: `training/federated.py`)
- Federated simulation → Mask losses: uses losses (evidence: `training/federated.py`)
- Federated simulation → Evaluation metrics: uses metrics (evidence: `training/federated.py`)
- Edge node service → FastAPI app: communicates with cloud
- Edge node service → Split feature extractor: uses split inference
- Edge node service → Feature compressor: uses compression
- Edge node service → Network monitor: measures network
- Edge node service → Edge preprocessing: prepares inputs
- Split analysis → Split feature extractor: studies split points
- Privacy experiments → Federated simulation: explores privacy
