# suhasj30/signsense_cnn architecture

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

- Interactive diagram: https://gitdiagram.com/suhasj30/signsense_cnn
- Repository: https://github.com/suhasj30/signsense_cnn

## Overview

SignSense CNN trains and evaluates an ASL image classifier, then provides full-frame webcam inference through a local WebSocket backend and browser dashboard. The training workflow runs from CLI preflight through dataset preparation, model training/checkpointing, and held-out test evaluation; the interactive workflow captures camera frames, streams them to the backend, and presents predictions for sentence building and speech. Edges reflect excerpts, index references, or README statements; unsampled backend and CLI internals are represented only where documented.

Main entry points: [`frontend/src/App.tsx`](https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/App.tsx) (Dashboard application), [`main.py`](https://github.com/suhasj30/signsense_cnn/blob/main/main.py) (Command entry), [`models/model.py`](https://github.com/suhasj30/signsense_cnn/blob/main/models/model.py) (Model factory), [`evaluation/evaluate.py`](https://github.com/suhasj30/signsense_cnn/blob/main/evaluation/evaluate.py) (Test metrics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI orchestration"]
  node_cli["Command entry<br/>[main.py]"]
  node_config["Run configuration<br/>[config.yaml]"]
end

subgraph group_ml["Model pipeline"]
  node_dataset["Dataset and transforms<br/>[dataset.py]"]
  node_model["Model factory<br/>[model.py]"]
  node_train["Training stages<br/>[trainer.py]"]
  node_trainflow["Training orchestration<br/>[train.py]"]
  node_checkpoint[("Model checkpoints")]
  node_predict["Image inference<br/>[predict.py]"]
  node_webcam["Desktop webcam<br/>[webcam.py]"]
end

subgraph group_eval["Evaluation"]
  node_evaluation["Test metrics<br/>[evaluate.py]"]
  node_confusion["Confusion analysis"]
  node_visualize["Evaluation plots<br/>[visualize.py]"]
end

subgraph group_backend["Live inference"]
  node_backend["WebSocket inference<br/>[app.py]"]
end

subgraph group_frontend["Browser experience"]
  node_app["Dashboard application<br/>[App.tsx]"]
  node_camera["Camera controls<br/>[CameraPanel.tsx]"]
  node_camera_hook["Camera lifecycle<br/>[useCamera.ts]"]
  node_camera_service["Camera device API<br/>[cameraService.ts]"]
  node_recognition["Recognition transport"]
  node_prediction["Prediction display<br/>[PredictionCard.tsx]"]
  node_sentence["Sentence builder"]
  node_speech["Speech synthesis<br/>[useSpeech.ts]"]
  node_history["Recognition history<br/>[HistoryPage.tsx]"]
  node_history_store[("History storage<br/>[historyService.ts]")]
  node_settings["Preferences screen<br/>[SettingsPage.tsx]"]
  node_settings_store[("Settings storage<br/>[settingsService.ts]")]
end

node_developer(("Developer"))
node_browser(("Browser user"))

node_developer -->|"runs commands"| node_cli
node_cli -->|"loads settings"| node_config
node_cli -->|"validates data"| node_dataset
node_cli -->|"starts training"| node_trainflow
node_trainflow -->|"creates loaders"| node_dataset
node_trainflow -->|"builds model"| node_model
node_trainflow -->|"runs stages"| node_train
node_train -->|"configures parameters"| node_model
node_train -->|"saves best model"| node_checkpoint
node_cli -->|"runs evaluation"| node_evaluation
node_evaluation -->|"loads checkpoint"| node_model
node_evaluation -->|"loads test split"| node_dataset
node_evaluation -->|"creates matrix"| node_confusion
node_evaluation -->|"writes reports"| node_visualize
node_cli -->|"starts webcam"| node_webcam
node_webcam -->|"loads checkpoint"| node_model
node_predict -->|"loads checkpoint"| node_model
node_browser -->|"uses dashboard"| node_app
node_app -->|"renders controls"| node_camera
node_camera -->|"uses camera"| node_camera_hook
node_camera_hook -->|"opens device"| node_camera_service
node_app -->|"starts recognition"| node_recognition
node_recognition -->|"streams JPEG frames"| node_backend
node_backend -->|"loads model"| node_model
node_backend -->|"returns predictions"| node_browser
node_app -->|"displays results"| node_prediction
node_app -->|"renders builder"| node_sentence
node_sentence -->|"speaks text"| node_speech
node_app -->|"renders history"| node_history
node_app -->|"clears entries"| node_history_store
node_app -->|"renders preferences"| node_settings
node_app -->|"saves preferences"| node_settings_store
node_history -->|"reads history"| node_history_store
node_settings -->|"configures speech"| node_speech

click node_cli "https://github.com/suhasj30/signsense_cnn/blob/main/main.py"
click node_config "https://github.com/suhasj30/signsense_cnn/blob/main/config/config.yaml"
click node_dataset "https://github.com/suhasj30/signsense_cnn/blob/main/training/dataset.py"
click node_model "https://github.com/suhasj30/signsense_cnn/blob/main/models/model.py"
click node_train "https://github.com/suhasj30/signsense_cnn/blob/main/training/trainer.py"
click node_trainflow "https://github.com/suhasj30/signsense_cnn/blob/main/training/train.py"
click node_checkpoint "https://github.com/suhasj30/signsense_cnn/tree/main/models/checkpoints"
click node_predict "https://github.com/suhasj30/signsense_cnn/blob/main/inference/predict.py"
click node_webcam "https://github.com/suhasj30/signsense_cnn/blob/main/inference/webcam.py"
click node_evaluation "https://github.com/suhasj30/signsense_cnn/blob/main/evaluation/evaluate.py"
click node_confusion "https://github.com/suhasj30/signsense_cnn/blob/main/evaluation/confusion_matrix.py"
click node_visualize "https://github.com/suhasj30/signsense_cnn/blob/main/evaluation/visualize.py"
click node_backend "https://github.com/suhasj30/signsense_cnn/blob/main/backend/app.py"
click node_app "https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/App.tsx"
click node_camera "https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/components/CameraPanel.tsx"
click node_camera_hook "https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/hooks/useCamera.ts"
click node_camera_service "https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/services/cameraService.ts"
click node_recognition "https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/services/recognitionService.ts"
click node_prediction "https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/components/PredictionCard.tsx"
click node_sentence "https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/components/SentenceBuilder.tsx"
click node_speech "https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/hooks/useSpeech.ts"
click node_history "https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/components/HistoryPage.tsx"
click node_history_store "https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/services/historyService.ts"
click node_settings "https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/components/SettingsPage.tsx"
click node_settings_store "https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/services/settingsService.ts"

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_cli,node_config,node_browser toneBlue
class node_dataset,node_model,node_train,node_trainflow,node_checkpoint,node_predict,node_webcam toneAmber
class node_evaluation,node_confusion,node_visualize toneMint
class node_backend toneRose
class node_app,node_camera,node_camera_hook,node_camera_service,node_recognition,node_prediction,node_sentence,node_speech,node_history,node_history_store,node_settings,node_settings_store,node_developer toneIndigo
```

## Components

### CLI orchestration

- [Command entry](https://github.com/suhasj30/signsense_cnn/blob/main/main.py): `main.py`
- [Run configuration](https://github.com/suhasj30/signsense_cnn/blob/main/config/config.yaml): `config/config.yaml`

### Model pipeline

- [Dataset and transforms](https://github.com/suhasj30/signsense_cnn/blob/main/training/dataset.py): `training/dataset.py`
- [Model factory](https://github.com/suhasj30/signsense_cnn/blob/main/models/model.py): `models/model.py`
- [Training stages](https://github.com/suhasj30/signsense_cnn/blob/main/training/trainer.py): `training/trainer.py`
- [Training orchestration](https://github.com/suhasj30/signsense_cnn/blob/main/training/train.py): `training/train.py`
- [Model checkpoints](https://github.com/suhasj30/signsense_cnn/tree/main/models/checkpoints): `models/checkpoints`
- [Image inference](https://github.com/suhasj30/signsense_cnn/blob/main/inference/predict.py): `inference/predict.py`
- [Desktop webcam](https://github.com/suhasj30/signsense_cnn/blob/main/inference/webcam.py): `inference/webcam.py`

### Evaluation

- [Test metrics](https://github.com/suhasj30/signsense_cnn/blob/main/evaluation/evaluate.py): `evaluation/evaluate.py`
- [Confusion analysis](https://github.com/suhasj30/signsense_cnn/blob/main/evaluation/confusion_matrix.py): `evaluation/confusion_matrix.py`
- [Evaluation plots](https://github.com/suhasj30/signsense_cnn/blob/main/evaluation/visualize.py): `evaluation/visualize.py`

### Live inference

- [WebSocket inference](https://github.com/suhasj30/signsense_cnn/blob/main/backend/app.py): `backend/app.py`

### Browser experience

- [Dashboard application](https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Camera controls](https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/components/CameraPanel.tsx): `frontend/src/components/CameraPanel.tsx`
- [Camera lifecycle](https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/hooks/useCamera.ts): `frontend/src/hooks/useCamera.ts`
- [Camera device API](https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/services/cameraService.ts): `frontend/src/services/cameraService.ts`
- [Recognition transport](https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/services/recognitionService.ts): `frontend/src/services/recognitionService.ts`
- [Prediction display](https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/components/PredictionCard.tsx): `frontend/src/components/PredictionCard.tsx`
- [Sentence builder](https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/components/SentenceBuilder.tsx): `frontend/src/components/SentenceBuilder.tsx`
- [Speech synthesis](https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/hooks/useSpeech.ts): `frontend/src/hooks/useSpeech.ts`
- [Recognition history](https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/components/HistoryPage.tsx): `frontend/src/components/HistoryPage.tsx`
- [History storage](https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/services/historyService.ts): `frontend/src/services/historyService.ts`
- [Preferences screen](https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/components/SettingsPage.tsx): `frontend/src/components/SettingsPage.tsx`
- [Settings storage](https://github.com/suhasj30/signsense_cnn/blob/main/frontend/src/services/settingsService.ts): `frontend/src/services/settingsService.ts`

### Other components

- **Developer**
- **Browser user**

## Connections

- Developer → Command entry: runs commands (evidence: `README.md`)
- Command entry → Run configuration: loads settings (evidence: `README.md`)
- Command entry → Dataset and transforms: validates data (evidence: `main.py`)
- Command entry → Training orchestration: starts training (evidence: `main.py`)
- Training orchestration → Dataset and transforms: creates loaders (evidence: `training/train.py`)
- Training orchestration → Model factory: builds model (evidence: `training/train.py`)
- Training orchestration → Training stages: runs stages (evidence: `training/train.py`)
- Training stages → Model factory: configures parameters (evidence: `training/trainer.py`)
- Training stages → Model checkpoints: saves best model (evidence: `training/trainer.py`)
- Command entry → Test metrics: runs evaluation (evidence: `main.py`)
- Test metrics → Model factory: loads checkpoint (evidence: `evaluation/evaluate.py`)
- Test metrics → Dataset and transforms: loads test split (evidence: `evaluation/evaluate.py`)
- Test metrics → Confusion analysis: creates matrix (evidence: `evaluation/evaluate.py`)
- Test metrics → Evaluation plots: writes reports (evidence: `evaluation/evaluate.py`)
- Command entry → Desktop webcam: starts webcam (evidence: `main.py`)
- Desktop webcam → Model factory: loads checkpoint (evidence: `inference/webcam.py`)
- Image inference → Model factory: loads checkpoint (evidence: `inference/predict.py`)
- Browser user → Dashboard application: uses dashboard (evidence: `README.md`)
- Dashboard application → Camera controls: renders controls (evidence: `frontend/src/App.tsx`)
- Camera controls → Camera lifecycle: uses camera (evidence: `frontend/src/components/CameraPanel.tsx`)
- Camera lifecycle → Camera device API: opens device (evidence: `frontend/src/hooks/useCamera.ts`)
- Dashboard application → Recognition transport: starts recognition (evidence: `frontend/src/App.tsx`)
- Recognition transport → WebSocket inference: streams JPEG frames (evidence: `README.md`)
- WebSocket inference → Model factory: loads model (evidence: `backend/app.py`)
- WebSocket inference → Browser user: returns predictions (evidence: `README.md`)
- Dashboard application → Prediction display: displays results (evidence: `frontend/src/App.tsx`)
- Dashboard application → Sentence builder: renders builder (evidence: `frontend/src/App.tsx`)
- Sentence builder → Speech synthesis: speaks text (evidence: `frontend/src/components/SentenceBuilder.tsx`)
- Dashboard application → Recognition history: renders history (evidence: `frontend/src/App.tsx`)
- Dashboard application → History storage: clears entries (evidence: `frontend/src/App.tsx`)
- Dashboard application → Preferences screen: renders preferences (evidence: `frontend/src/App.tsx`)
- Dashboard application → Settings storage: saves preferences (evidence: `frontend/src/App.tsx`)
- Recognition history → History storage: reads history (evidence: `frontend/src/services/historyService.ts`)
- Preferences screen → Speech synthesis: configures speech (evidence: `frontend/src/components/SettingsPage.tsx`)
