# tharunbalajis/bearing-lifecycle-analysis architecture

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

- Interactive diagram: https://gitdiagram.com/tharunbalajis/bearing-lifecycle-analysis
- Repository: https://github.com/tharunbalajis/bearing-lifecycle-analysis

## Overview

This repository predicts bearing remaining useful life from NASA IMS vibration records and presents the resulting health, fault, and prognosis diagnostics in a dashboard. The primary workflow extracts time-frequency and physics features, trains a diagnostic CNN while retaining proxy RMS health as the authoritative curve, then estimates RUL. Separately, the dashboard serves pipeline artifacts and CNN inference through an API or precomputed static data. The graph reflects documented orchestration and indexed imports; some dashboard data wiring is not excerpted, so uncertain links are omitted.

Main entry points: [`dashboard/frontend/src/pages/Dashboard.tsx`](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/frontend/src/pages/Dashboard.tsx) (Dashboard page), [`dashboard/backend/main.py`](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/backend/main.py) (API application), [`dashboard/backend/inference_cache.py`](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/backend/inference_cache.py) (Inference cache), [`run_pipeline.py`](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/run_pipeline.py) (Pipeline orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pipeline["Analysis pipeline"]
  node_orchestrator["Pipeline orchestration<br/>[run_pipeline.py]"]
end

subgraph group_features["Signal features"]
  node_extraction["Feature extraction"]
  node_peaks["Peak windows<br/>[peak_detection.py]"]
  node_tf["Time-frequency analysis<br/>[tf_extraction.py]"]
  node_physics["Physics features"]
  node_io["NASA file loading<br/>[io_utils.py]"]
end

subgraph group_models["Health and prognosis"]
  node_cnnmodel["CNN health model"]
  node_training["CNN training and proxy HI<br/>[train_cnn.py]"]
  node_inference["CNN inference<br/>[predict_hi.py]"]
  node_rul["RUL estimation<br/>[rul_estimation.py]"]
end

subgraph group_backend["Dashboard backend"]
  node_staticexport["Static data export<br/>[export_static.py]"]
  node_scaloprecompute["Scalogram precompute"]
  node_cache["Inference cache<br/>[inference_cache.py]"]
  node_api["API application<br/>[main.py]"]
  node_healthroute["Health index route<br/>[health_index.py]"]
  node_rulroute["RUL route<br/>[rul.py]"]
  node_bpfroute["Fault trend route<br/>[bpfo_trend.py]"]
  node_detailroute["File detail route<br/>[file_detail.py]"]
  node_scaleroute["Scalogram route<br/>[scalogram.py]"]
end

subgraph group_frontend["Dashboard interface"]
  node_dashboard["Dashboard page<br/>[Dashboard.tsx]"]
  node_client["Data client<br/>[client.ts]"]
  node_scrubber["File scrubber<br/>[FileScrubber.tsx]"]
  node_timeline["Health timeline"]
  node_rulcurve["RUL curve<br/>[RULCurve.tsx]"]
  node_cnncompare["CNN proxy comparison"]
  node_faultpanel["Fault frequency panel"]
  node_scalaview["Scalogram viewer"]
  node_bearing["Bearing visualization<br/>[BearingModel3D.tsx]"]
  node_hero["Dashboard introduction<br/>[HeroIntro.tsx]"]
end

node_operator(("Pipeline operator"))
node_rawdata[("NASA IMS records")]
node_user(("Dashboard user"))

node_operator -->|"runs"| node_orchestrator
node_orchestrator -->|"runs extraction"| node_extraction
node_rawdata -.->|"provides records"| node_extraction
node_extraction -->|"detects windows"| node_peaks
node_extraction -->|"extracts spectra"| node_tf
node_extraction -->|"loads records"| node_io
node_orchestrator -->|"augments features"| node_physics
node_physics -->|"loads records"| node_io
node_physics -->|"detects windows"| node_peaks
node_physics -->|"uses spectra"| node_tf
node_orchestrator -->|"trains model"| node_training
node_training -->|"uses model"| node_cnnmodel
node_training -->|"loads records"| node_io
node_orchestrator -->|"estimates RUL"| node_rul
node_cache -->|"builds inference"| node_cnnmodel
node_api -->|"loads at startup"| node_cache
node_api -->|"registers route"| node_healthroute
node_api -->|"registers route"| node_rulroute
node_api -->|"registers route"| node_bpfroute
node_api -->|"registers route"| node_detailroute
node_api -->|"registers route"| node_scaleroute
node_healthroute -->|"reads data"| node_cache
node_rulroute -->|"reads data"| node_cache
node_bpfroute -->|"reads data"| node_cache
node_detailroute -->|"reads data"| node_cache
node_user -.->|"views"| node_dashboard
node_dashboard -->|"requests data"| node_client
node_dashboard -->|"renders"| node_scrubber
node_dashboard -->|"renders"| node_timeline
node_dashboard -->|"renders"| node_rulcurve
node_dashboard -->|"renders"| node_cnncompare
node_dashboard -->|"renders"| node_faultpanel
node_dashboard -->|"renders"| node_scalaview
node_dashboard -->|"renders"| node_hero
node_hero -->|"renders"| node_bearing
node_scalaview -->|"gets image path"| node_client

click node_orchestrator "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/run_pipeline.py"
click node_extraction "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/src/features/extract_features.py"
click node_peaks "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/src/features/peak_detection.py"
click node_tf "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/src/features/tf_extraction.py"
click node_physics "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/src/features/physics_features.py"
click node_io "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/src/utils/io_utils.py"
click node_cnnmodel "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/src/models/cnn_health_index.py"
click node_training "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/src/models/train_cnn.py"
click node_inference "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/src/models/predict_hi.py"
click node_rul "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/src/models/rul_estimation.py"
click node_staticexport "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/backend/export_static.py"
click node_scaloprecompute "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/backend/precompute_scalograms.py"
click node_cache "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/backend/inference_cache.py"
click node_api "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/backend/main.py"
click node_healthroute "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/backend/routes/health_index.py"
click node_rulroute "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/backend/routes/rul.py"
click node_bpfroute "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/backend/routes/bpfo_trend.py"
click node_detailroute "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/backend/routes/file_detail.py"
click node_scaleroute "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/backend/routes/scalogram.py"
click node_dashboard "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/frontend/src/pages/Dashboard.tsx"
click node_client "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/frontend/src/api/client.ts"
click node_scrubber "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/frontend/src/components/FileScrubber.tsx"
click node_timeline "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/frontend/src/components/HealthIndexTimeline.tsx"
click node_rulcurve "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/frontend/src/components/RULCurve.tsx"
click node_cnncompare "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/frontend/src/components/CNNvsProxyPanel.tsx"
click node_faultpanel "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/frontend/src/components/FaultFrequencyPanel.tsx"
click node_scalaview "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/frontend/src/components/ScalogramViewer.tsx"
click node_bearing "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/frontend/src/components/BearingModel3D.tsx"
click node_hero "https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/frontend/src/components/HeroIntro.tsx"

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_orchestrator,node_user toneBlue
class node_extraction,node_peaks,node_tf,node_physics,node_io,node_rawdata toneAmber
class node_cnnmodel,node_training,node_inference,node_rul toneMint
class node_staticexport,node_scaloprecompute,node_cache,node_api,node_healthroute,node_rulroute,node_bpfroute,node_detailroute,node_scaleroute toneRose
class node_dashboard,node_client,node_scrubber,node_timeline,node_rulcurve,node_cnncompare,node_faultpanel,node_scalaview,node_bearing,node_hero,node_operator toneIndigo
```

## Components

### Analysis pipeline

- [Pipeline orchestration](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/run_pipeline.py): `run_pipeline.py`

### Signal features

- [Feature extraction](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/src/features/extract_features.py): `src/features/extract_features.py`
- [Peak windows](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/src/features/peak_detection.py): `src/features/peak_detection.py`
- [Time-frequency analysis](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/src/features/tf_extraction.py): `src/features/tf_extraction.py`
- [Physics features](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/src/features/physics_features.py): `src/features/physics_features.py`
- [NASA file loading](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/src/utils/io_utils.py): `src/utils/io_utils.py`

### Health and prognosis

- [CNN health model](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/src/models/cnn_health_index.py): `src/models/cnn_health_index.py`
- [CNN training and proxy HI](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/src/models/train_cnn.py): `src/models/train_cnn.py`
- [CNN inference](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/src/models/predict_hi.py): `src/models/predict_hi.py`
- [RUL estimation](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/src/models/rul_estimation.py): `src/models/rul_estimation.py`

### Dashboard backend

- [Static data export](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/backend/export_static.py): `dashboard/backend/export_static.py`
- [Scalogram precompute](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/backend/precompute_scalograms.py): `dashboard/backend/precompute_scalograms.py`
- [Inference cache](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/backend/inference_cache.py): `dashboard/backend/inference_cache.py`
- [API application](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/backend/main.py): `dashboard/backend/main.py`
- [Health index route](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/backend/routes/health_index.py): `dashboard/backend/routes/health_index.py`
- [RUL route](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/backend/routes/rul.py): `dashboard/backend/routes/rul.py`
- [Fault trend route](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/backend/routes/bpfo_trend.py): `dashboard/backend/routes/bpfo_trend.py`
- [File detail route](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/backend/routes/file_detail.py): `dashboard/backend/routes/file_detail.py`
- [Scalogram route](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/backend/routes/scalogram.py): `dashboard/backend/routes/scalogram.py`

### Dashboard interface

- [Dashboard page](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/frontend/src/pages/Dashboard.tsx): `dashboard/frontend/src/pages/Dashboard.tsx`
- [Data client](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/frontend/src/api/client.ts): `dashboard/frontend/src/api/client.ts`
- [File scrubber](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/frontend/src/components/FileScrubber.tsx): `dashboard/frontend/src/components/FileScrubber.tsx`
- [Health timeline](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/frontend/src/components/HealthIndexTimeline.tsx): `dashboard/frontend/src/components/HealthIndexTimeline.tsx`
- [RUL curve](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/frontend/src/components/RULCurve.tsx): `dashboard/frontend/src/components/RULCurve.tsx`
- [CNN proxy comparison](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/frontend/src/components/CNNvsProxyPanel.tsx): `dashboard/frontend/src/components/CNNvsProxyPanel.tsx`
- [Fault frequency panel](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/frontend/src/components/FaultFrequencyPanel.tsx): `dashboard/frontend/src/components/FaultFrequencyPanel.tsx`
- [Scalogram viewer](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/frontend/src/components/ScalogramViewer.tsx): `dashboard/frontend/src/components/ScalogramViewer.tsx`
- [Bearing visualization](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/frontend/src/components/BearingModel3D.tsx): `dashboard/frontend/src/components/BearingModel3D.tsx`
- [Dashboard introduction](https://github.com/tharunbalajis/bearing-lifecycle-analysis/blob/main/dashboard/frontend/src/components/HeroIntro.tsx): `dashboard/frontend/src/components/HeroIntro.tsx`

### Other components

- **Pipeline operator**
- **NASA IMS records**
- **Dashboard user**

## Connections

- Pipeline operator → Pipeline orchestration: runs (evidence: `run_pipeline.py`)
- Pipeline orchestration → Feature extraction: runs extraction (evidence: `run_pipeline.py`)
- NASA IMS records → Feature extraction: provides records
- Feature extraction → Peak windows: detects windows (evidence: `src/features/extract_features.py`)
- Feature extraction → Time-frequency analysis: extracts spectra (evidence: `src/features/extract_features.py`)
- Feature extraction → NASA file loading: loads records (evidence: `src/features/extract_features.py`)
- Pipeline orchestration → Physics features: augments features (evidence: `run_pipeline.py`)
- Physics features → NASA file loading: loads records (evidence: `src/features/physics_features.py`)
- Physics features → Peak windows: detects windows (evidence: `src/features/physics_features.py`)
- Physics features → Time-frequency analysis: uses spectra (evidence: `src/features/physics_features.py`)
- Pipeline orchestration → CNN training and proxy HI: trains model (evidence: `run_pipeline.py`)
- CNN training and proxy HI → CNN health model: uses model (evidence: `src/models/train_cnn.py`)
- CNN training and proxy HI → NASA file loading: loads records (evidence: `src/models/train_cnn.py`)
- Pipeline orchestration → RUL estimation: estimates RUL (evidence: `run_pipeline.py`)
- Inference cache → CNN health model: builds inference (evidence: `dashboard/backend/inference_cache.py`)
- API application → Inference cache: loads at startup (evidence: `dashboard/backend/main.py`)
- API application → Health index route: registers route (evidence: `dashboard/backend/main.py`)
- API application → RUL route: registers route (evidence: `dashboard/backend/main.py`)
- API application → Fault trend route: registers route (evidence: `dashboard/backend/main.py`)
- API application → File detail route: registers route (evidence: `dashboard/backend/main.py`)
- API application → Scalogram route: registers route (evidence: `dashboard/backend/main.py`)
- Health index route → Inference cache: reads data (evidence: `dashboard/backend/routes/health_index.py`)
- RUL route → Inference cache: reads data (evidence: `dashboard/backend/routes/rul.py`)
- Fault trend route → Inference cache: reads data (evidence: `dashboard/backend/routes/bpfo_trend.py`)
- File detail route → Inference cache: reads data (evidence: `dashboard/backend/routes/file_detail.py`)
- Dashboard user → Dashboard page: views
- Dashboard page → Data client: requests data (evidence: `dashboard/frontend/src/pages/Dashboard.tsx`)
- Dashboard page → File scrubber: renders (evidence: `dashboard/frontend/src/pages/Dashboard.tsx`)
- Dashboard page → Health timeline: renders (evidence: `dashboard/frontend/src/pages/Dashboard.tsx`)
- Dashboard page → RUL curve: renders (evidence: `dashboard/frontend/src/pages/Dashboard.tsx`)
- Dashboard page → CNN proxy comparison: renders (evidence: `dashboard/frontend/src/pages/Dashboard.tsx`)
- Dashboard page → Fault frequency panel: renders (evidence: `dashboard/frontend/src/pages/Dashboard.tsx`)
- Dashboard page → Scalogram viewer: renders (evidence: `dashboard/frontend/src/pages/Dashboard.tsx`)
- Dashboard page → Dashboard introduction: renders (evidence: `dashboard/frontend/src/pages/Dashboard.tsx`)
- Dashboard introduction → Bearing visualization: renders (evidence: `dashboard/frontend/src/components/HeroIntro.tsx`)
- Scalogram viewer → Data client: gets image path (evidence: `dashboard/frontend/src/components/ScalogramViewer.tsx`)
