Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- ARCHITECTURE.md +22 -12
ARCHITECTURE.md
CHANGED
|
@@ -106,7 +106,7 @@ flowchart TB
|
|
| 106 |
end
|
| 107 |
|
| 108 |
subgraph SERIAL["馃攲 PHYSICAL TRANSPORT BUS"]
|
| 109 |
-
UART["W3C navigator.serial (115,200 Baud)<br/>ASCII Frame: $HR,SPO2,SYS,DIA,TEMP*CRC
|
| 110 |
end
|
| 111 |
|
| 112 |
subgraph CLIENT["馃捇 CLINICAL BROWSER CLIENT (PRIMARY PLANE: ZERO-CLOUD)"]
|
|
@@ -115,33 +115,43 @@ flowchart TB
|
|
| 115 |
PRE["StandardScaler & Feature Engineering<br/>z_j = (x_j - 渭_j) / 蟽_j + Risk_Severity"]
|
| 116 |
|
| 117 |
subgraph ENSEMBLE["5-Model Soft-Voting Ensemble (< 20 碌s Latency | 0.0 KB Egress)"]
|
|
|
|
| 118 |
RF["Random Forest (w=0.25)"]
|
| 119 |
MLP["Small-NN MLP (w=0.25)"]
|
| 120 |
LOG["Logistic Reg (w=0.20)"]
|
| 121 |
SVM["Linear SVM (w=0.15)"]
|
| 122 |
KNN["KNN k=5 (w=0.15)"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
end
|
| 124 |
|
| 125 |
DIAG["Real-Time Diagnostic Decision Matrix<br/>Healthy 路 Hypertension 路 Heart Disease 路 Asthma 路 Diabetes"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
end
|
| 127 |
|
| 128 |
subgraph CLOUD["鈽侊笍 SECONDARY CLOUD BACKEND (Hugging Face Spaces 路 Docker / FastAPI)"]
|
| 129 |
-
|
| 130 |
-
MLOPS["MLOps Automated Retrain Engine<br/>Batch CSV Ingest & Alias Normalization"]
|
| 131 |
-
REG["Model Registry (5 .pkl Estimators)"]
|
| 132 |
-
C99["AST C99 Code Exporter (/export_tinyml)<br/>Zero-Malloc model.h Generator"]
|
| 133 |
end
|
| 134 |
|
| 135 |
HW -->|UART Serial Stream| UART
|
| 136 |
UART --> OSC
|
| 137 |
UART --> PRE
|
| 138 |
-
PRE --> ENSEMBLE
|
| 139 |
-
ENSEMBLE --> DIAG
|
| 140 |
|
| 141 |
-
|
| 142 |
-
REST --> MLOPS
|
| 143 |
-
MLOPS --> REG
|
| 144 |
-
REG --> C99
|
| 145 |
|
| 146 |
classDef primary fill:#FBFBFA,stroke:#141413,stroke-width:2px,color:#141413;
|
| 147 |
classDef accent fill:#9F2F2D,stroke:#9F2F2D,stroke-width:2px,color:#ffffff;
|
|
@@ -151,7 +161,7 @@ flowchart TB
|
|
| 151 |
class HW primary;
|
| 152 |
class CLIENT edgeBox;
|
| 153 |
class CLOUD cloudBox;
|
| 154 |
-
class DIAG,C99 accent;
|
| 155 |
```
|
| 156 |
|
| 157 |
> [!IMPORTANT]
|
|
|
|
| 106 |
end
|
| 107 |
|
| 108 |
subgraph SERIAL["馃攲 PHYSICAL TRANSPORT BUS"]
|
| 109 |
+
UART["W3C navigator.serial (115,200 Baud)<br/>ASCII Frame: $HR,SPO2,SYS,DIA,TEMP*CRC"]
|
| 110 |
end
|
| 111 |
|
| 112 |
subgraph CLIENT["馃捇 CLINICAL BROWSER CLIENT (PRIMARY PLANE: ZERO-CLOUD)"]
|
|
|
|
| 115 |
PRE["StandardScaler & Feature Engineering<br/>z_j = (x_j - 渭_j) / 蟽_j + Risk_Severity"]
|
| 116 |
|
| 117 |
subgraph ENSEMBLE["5-Model Soft-Voting Ensemble (< 20 碌s Latency | 0.0 KB Egress)"]
|
| 118 |
+
direction TB
|
| 119 |
RF["Random Forest (w=0.25)"]
|
| 120 |
MLP["Small-NN MLP (w=0.25)"]
|
| 121 |
LOG["Logistic Reg (w=0.20)"]
|
| 122 |
SVM["Linear SVM (w=0.15)"]
|
| 123 |
KNN["KNN k=5 (w=0.15)"]
|
| 124 |
+
VOTE["Calibrated Soft-Voting Arbitration<br/>P(Class_c | X) = 危(w_i 路 P_i) / 危(w_i)"]
|
| 125 |
+
|
| 126 |
+
RF --> VOTE
|
| 127 |
+
MLP --> VOTE
|
| 128 |
+
LOG --> VOTE
|
| 129 |
+
SVM --> VOTE
|
| 130 |
+
KNN --> VOTE
|
| 131 |
end
|
| 132 |
|
| 133 |
DIAG["Real-Time Diagnostic Decision Matrix<br/>Healthy 路 Hypertension 路 Heart Disease 路 Asthma 路 Diabetes"]
|
| 134 |
+
|
| 135 |
+
PRE --> RF
|
| 136 |
+
PRE --> MLP
|
| 137 |
+
PRE --> LOG
|
| 138 |
+
PRE --> SVM
|
| 139 |
+
PRE --> KNN
|
| 140 |
+
VOTE --> DIAG
|
| 141 |
end
|
| 142 |
|
| 143 |
subgraph CLOUD["鈽侊笍 SECONDARY CLOUD BACKEND (Hugging Face Spaces 路 Docker / FastAPI)"]
|
| 144 |
+
direction LR
|
| 145 |
+
REST["FastAPI Gateway (/predict, /ws/feed)"] --> MLOPS["MLOps Automated Retrain Engine<br/>Batch CSV Ingest & Alias Normalization"]
|
| 146 |
+
MLOPS --> REG["Model Registry (5 .pkl Estimators)"]
|
| 147 |
+
REG --> C99["AST C99 Code Exporter (/export_tinyml)<br/>Zero-Malloc model.h Generator"]
|
| 148 |
end
|
| 149 |
|
| 150 |
HW -->|UART Serial Stream| UART
|
| 151 |
UART --> OSC
|
| 152 |
UART --> PRE
|
|
|
|
|
|
|
| 153 |
|
| 154 |
+
DIAG -.->|Optional Telemetry Sync & WS Feed| REST
|
|
|
|
|
|
|
|
|
|
| 155 |
|
| 156 |
classDef primary fill:#FBFBFA,stroke:#141413,stroke-width:2px,color:#141413;
|
| 157 |
classDef accent fill:#9F2F2D,stroke:#9F2F2D,stroke-width:2px,color:#ffffff;
|
|
|
|
| 161 |
class HW primary;
|
| 162 |
class CLIENT edgeBox;
|
| 163 |
class CLOUD cloudBox;
|
| 164 |
+
class DIAG,C99,VOTE accent;
|
| 165 |
```
|
| 166 |
|
| 167 |
> [!IMPORTANT]
|