# IC³ AI Anomaly Detection — Menu & Dashboard Design

## 1. NAVIGATION MENU STRUCTURE

```
Analytics & AI (Main Menu)
├── 🔴 Anomaly Detection (Active Alerts Hub)
│   ├── Live Anomalies (Real-time view)
│   ├── Anomaly History (6-month archive)
│   ├── Sensor Health (Trust score per sensor)
│   ├── Alert Rules (Thresholds & configurations)
│   └── Reports (Anomaly trends & KPIs)
├── 🟢 Leak / Burst Classifier
├── 🟠 Pump Health Model
├── 🔵 Quality Risk Model
├── 🟡 Demand Forecasting
├── 🟣 Root Cause Assistant
├── 🟠 NRW Attribution
└── 🟢 Energy Optimisation
```

---

## 2. ANOMALY DETECTION DASHBOARD LAYOUT

### **Header Section**
```
┌─────────────────────────────────────────────────────────────────┐
│  🔴 ANOMALY DETECTION CENTRE          [Last Updated: 2 min ago]  │
│     Real-time Sensor Anomaly Monitoring & Response Tracking      │
└─────────────────────────────────────────────────────────────────┘
```

### **KPI Card Row (Quantified Metrics)**
```
┌──────────────────┬──────────────────┬──────────────────┬──────────────────┐
│ ACTIVE ANOMALIES │  AVG CONFIDENCE  │  MTTR (Minutes)  │ FALSE POS RATE   │
│                  │                  │                  │                  │
│       12         │      87.3%       │      14.2        │     2.8%         │
│   ↑ 3 new       │   (Excellent)    │   (↓ 25% vs mo.) │  (↓ from 3.5%)  │
└──────────────────┴──────────────────┴──────────────────┴──────────────────┘
```

---

## 3. MAIN DASHBOARD PANELS

### **PANEL A: Live Anomalies Table (Center-Left)**
```
┌─────────────────────────────────────────────────────────────────────┐
│ ACTIVE ANOMALIES — Priority Queue                    [🔄 Auto-sort] │
├────┬──────────────┬──────────┬───────────┬──────┬──────────┬────────┤
│ ## │ ASSET        │ SEVERITY │ CONFIDENCE│ TYPE │ VALUE    │ ACTION │
├────┼──────────────┼──────────┼───────────┼──────┼──────────┼────────┤
│ 1  │ Flow Meter   │ 🔴 9.2   │ 94% ✓✓    │ ↑    │ 145      │ ASSIGN │
│    │ DMA-05       │          │           │      │ (vs 120) │ [→WO]  │
├────┼──────────────┼──────────┼───────────┼──────┼──────────┼────────┤
│ 2  │ Pressure     │ 🟠 6.8   │ 82% ✓     │ ↓    │ 2.1      │ ASSIGN │
│    │ Node-23      │          │           │      │ (vs 3.4) │ [→WO]  │
├────┼──────────────┼──────────┼───────────┼──────┼──────────┼────────┤
│ 3  │ Chlorine     │ 🟡 4.5   │ 71%       │ ~    │ 0.42     │ MONITOR│
│    │ Treatment-02 │          │           │      │ (stable) │ [Watch]│
├────┼──────────────┼──────────┼───────────┼──────┼──────────┼────────┤
│ 4  │ Level        │ 🟡 3.1   │ 65%       │ ~    │ 8.2m     │ MONITOR│
│    │ Tank-North   │          │           │      │ (normal) │        │
└────┴──────────────┴──────────┴───────────┴──────┴──────────┴────────┘

[Show 12 anomalies] [Load More] | Filter: All | Severity | Time | Zone
```

### **PANEL B: Severity & Confidence Matrix (Right)**
```
┌────────────────────────────────────────────────────┐
│ ANOMALY DISTRIBUTION                               │
│                                                    │
│ Severity Distribution        Confidence Levels     │
│ ┌─────────────────────┐    ┌─────────────────┐   │
│ │ 9.0+ (Critical) │ 3│    │ >90%  │████ 7    │   │
│ │ 7.0-9.0 (High) │ 5│    │ 80-90%│████ 4    │   │
│ │ 5.0-7.0 (Med)  │ 2│    │ <80%  │██ 1      │   │
│ │ <5.0 (Low)     │ 2│    │       │          │   │
│ └─────────────────────┘    └─────────────────┘   │
│                                                    │
│ Status: 12 Active | 47 Resolved Today              │
└────────────────────────────────────────────────────┘
```

---

## 4. DETAIL PANEL — Click on any Anomaly

```
┌──────────────────────────────────────────────────────────────────────┐
│ ANOMALY DETAIL VIEW — DMA-05 Flow Meter                    [Close ✕] │
├──────────────────────────────────────────────────────────────────────┤
│                                                                       │
│ Asset:              Flow Meter (DMA-05 — Sector B)                  │
│ Location:           GPS: 28.6239° N, 77.2090° E  [View on Map]      │
│ Detected:           2024-06-04 14:32:18 UTC (12 min ago)            │
│                                                                       │
│ ┌─ SEVERITY ─────────────────────────────────────────────────────┐  │
│ │ Score: 9.2/10  🔴 CRITICAL                                     │  │
│ │ Confidence: 94% ✓✓ (Excellent — High precision)                │  │
│ │ Reason: Flow spike 21% above 24-hr rolling mean + sensor stable│  │
│ └────────────────────────────────────────────────────────────────┘  │
│                                                                       │
│ ┌─ MEASUREMENT CHART ─────────────────────────────────────────────┐  │
│ │ Flow Rate (m³/hr)                    Normal Range: 95-130       │  │
│ │ 160 ┤                                                            │  │
│ │ 140 ┤     ✓ baseline (120 avg)            ╱╲                  │  │
│ │ 120 ┤   ╱─────────────────────────────────╱──╲ ← ANOMALY      │  │
│ │ 100 ┤  ╱                                        ╲               │  │
│ │  80 ┤╱─────────────────────────────────────────╲──             │  │
│ │ └────┴────┴────┴────┴────┴────┴────┴────┴────┴────             │  │
│ │   6h ago    12h ago      Now ↑       2h fwd                     │  │
│ │                                                                   │  │
│ │ Current:    145 m³/hr                                           │  │
│ │ Baseline:   120 m³/hr (24-hr rolling avg)                      │  │
│ │ Deviation:  +25 m³/hr (+20.8%)                                 │  │
│ └────────────────────────────────────────────────────────────────┘  │
│                                                                       │
│ ┌─ PROBABLE CAUSES (Ranked by Likelihood) ───────────────────────┐  │
│ │ 1. High Demand Peak (72% likely)   — School/hospital intake     │  │
│ │ 2. Pump Ramp-up (18% likely)       — Pressure drop compensation│  │
│ │ 3. Meter Drift (7% likely)         — Sensor calibration drift  │  │
│ │ 4. Pipe Burst (3% likely)          — Sudden loss of 25 m³/hr  │  │
│ └────────────────────────────────────────────────────────────────┘  │
│                                                                       │
│ ┌─ AUDIT TRAIL ──────────────────────────────────────────────────┐  │
│ │ ✓ 14:32:18 — Anomaly detected by AI (severity=9.2)            │  │
│ │ ✓ 14:32:45 — Alert escalated to Operations (confidence=94%)   │  │
│ │ ⏳ 14:35:00 — [Pending] Field dispatch assignment              │  │
│ │                                                                  │  │
│ └────────────────────────────────────────────────────────────────┘  │
│                                                                       │
│ ┌─ ACTIONS ──────────────────────────────────────────────────────┐  │
│ │ [🚗 Create Work Order] [👁 Monitor] [🔕 Dismiss] [📋 Report]  │  │
│ └────────────────────────────────────────────────────────────────┘  │
│                                                                       │
└──────────────────────────────────────────────────────────────────────┘
```

---

## 5. WORK ORDER INTEGRATION

```
┌────────────────────────────────────────────────────┐
│ [🚗 CREATE WORK ORDER]                             │
├────────────────────────────────────────────────────┤
│                                                    │
│ Title: [Auto-filled]                              │
│ "Investigate high flow anomaly — DMA-05"          │
│                                                    │
│ Priority: 🔴 HIGH                                 │
│ Asset: Flow Meter (DMA-05)                        │
│ GPS Coordinates: 28.6239° N, 77.2090° E           │
│                                                    │
│ Suggested Actions:                                │
│ ☑ Check pump discharge pressure                   │
│ ☑ Verify flow meter calibration                  │
│ ☑ Inspect for leaks in the zone                  │
│ ☐ [Custom action...]                             │
│                                                    │
│ Assigned To: [Dropdown — Zone Engineers]          │
│ Due By: [Auto-set: 30 min]                        │
│                                                    │
│ [Create & Dispatch] [Cancel]                      │
└────────────────────────────────────────────────────┘
```

---

## 6. SENSOR HEALTH SCORECARD

```
┌────────────────────────────────────────────────────┐
│ SENSOR TRUST ENGINE — Health Scoring               │
├────────────────────────────────────────────────────┤
│                                                    │
│ Sensor        │ Trust Score │ Status   │ Action   │
│─────────────────────────────────────────────────  │
│ Flow Meter-05 │ 98% ✓✓      │ 🟢 Healthy│ —       │
│ Pressure-23   │ 91% ✓       │ 🟢 Healthy│ —       │
│ Chlorine-02   │ 76% ⚠       │ 🟡 Drift  │[Calib]  │
│ Tank Level-N  │ 63% ⚠       │ 🟡 Noisy  │[Service]│
│ pH Sensor-01  │ 45% ❌      │ 🔴 Failed │[Replace]│
│                                                    │
│ Note: Anomalies with low-trust sensors are       │
│ flagged as "Confidence" < 70%                     │
└────────────────────────────────────────────────────┘
```

---

## 7. HISTORICAL TRENDS & REPORTS

### **Tab: Anomaly History**
```
┌────────────────────────────────────────────────────┐
│ ANOMALY HISTORY — Last 30 Days                     │
├────────────────────────────────────────────────────┤
│                                                    │
│ Total Anomalies:     847                          │
│ Critical (9.0+):      43  (5.1%) ↓                │
│ High (7-9):         156  (18.4%)                  │
│ Medium (5-7):       398  (47.0%)                  │
│ Low (<5):           250  (29.5%)                  │
│                                                    │
│ ✓ Resolved:         812 (95.9%)                   │
│ ⏳ Pending:           35 (4.1%)                    │
│                                                    │
│ Avg MTTR:            16.3 min (↓ 20% vs month)   │
│ False Positive Rate:  2.8% (↓ from 3.5%)         │
│                                                    │
│ [📊 Download CSV] [📈 Trends] [🔍 Drill-down]   │
└────────────────────────────────────────────────────┘
```

---

## 8. DASHBOARD CONFIGURATION PANEL

### **Tab: Alert Rules**
```
┌─────────────────────────────────────────────────────┐
│ ALERT THRESHOLD CONFIGURATION                       │
├─────────────────────────────────────────────────────┤
│                                                     │
│ Sensor Type      │ Threshold  │ Severity │ Action  │
│──────────────────────────────────────────────────  │
│ Flow Rate        │ ±25%       │ High     │ [Edit]  │
│ Pressure         │ ±15%       │ High     │ [Edit]  │
│ Chlorine         │ <0.2 ppm   │ Critical │ [Edit]  │
│ Turbidity        │ >5 NTU     │ High     │ [Edit]  │
│ pH               │ <6.5, >8.5 │ High     │ [Edit]  │
│ Tank Level       │ >90%/< 10% │ Medium   │ [Edit]  │
│                                                     │
│ [➕ Add New Rule] [📋 Import Presets]             │
└─────────────────────────────────────────────────────┘
```

---

## 9. MOBILE FIELD APP INTEGRATION

```
┌─────────────────────────────┐
│ 📱 FIELD CREW VIEW          │
├─────────────────────────────┤
│                             │
│ 🚨 NEW ANOMALY ALERT       │
│                             │
│ DMA-05 Flow Meter          │
│ "High flow spike detected"  │
│                             │
│ Severity: 9.2/10 🔴        │
│ Distance: 2.3 km away      │
│ [📍 Route to Site]         │
│                             │
│ Instructions:              │
│ □ Check pump discharge     │
│ □ Verify meter reading     │
│ □ Inspect for leaks        │
│                             │
│ [📷 Capture Photo]         │
│ [✓ Mark Complete]          │
│ [⏸ Pause]                  │
│                             │
└─────────────────────────────┘
```

---

## 10. EXECUTIVE DASHBOARD SUMMARY

```
┌──────────────────────────────────────────────────────┐
│ AI ANOMALY DETECTION — EXECUTIVE HEALTH SCORE        │
├──────────────────────────────────────────────────────┤
│                                                      │
│ KPI Snapshot:                                        │
│ ────────────                                         │
│ • Detection Latency:     3.2 min (↓ 35% vs baseline)│
│ • MTTR (Mean Time to Resolve): 14 min                │
│ • Anomalies Resolved:    95.9% | Critical: 100%    │
│ • False Positive Rate:   2.8% | Target: <5%        │
│ • Sensor Trust Avg:      84.2% (Healthy)            │
│                                                      │
│ ROI Impact (Monthly):                                │
│ • Prevented emergency calls: 12                     │
│ • Avoided burst damage: $45K                        │
│ • Reduced manual monitoring: 120 hrs                │
│                                                      │
│ Status: ✓ All Systems Operational                   │
└──────────────────────────────────────────────────────┘
```

---

## 11. TECHNICAL SPECIFICATIONS

### **Data Refresh Rates**
- **Live Anomalies**: Real-time (WebSocket push)
- **KPI Cards**: Every 30 seconds
- **History Tables**: Every 5 minutes
- **Reports**: Cached hourly

### **User Permissions**
- **Operators**: View, assign work orders, dismiss (with reason)
- **Engineers**: Configure rules, adjust thresholds
- **Managers**: View reports, export data, manage teams
- **Admins**: Full access + sensor calibration

### **Alert Escalation Logic**
```
Severity 9.0+ → Immediate SMS + Push Notification + Email
Severity 7.0-9.0 → Push + Email (1 min delay)
Severity <7.0 → Dashboard only + Historical logging
```

---

## 12. COLOR CODING & UI SYSTEM

```
Severity Levels:
🔴 Critical (9.0-10.0)  — Immediate action required
🟠 High (7.0-9.0)       — Address within 30 min
🟡 Medium (5.0-7.0)     — Monitor & plan action
🟢 Low (<5.0)           — Low priority, log

Confidence Levels:
✓✓ 85-100%   — Excellent (trusted output)
✓  70-85%    — Good (monitor closely)
⚠  50-70%    — Fair (may require validation)
❌ <50%      — Poor (sensor drift likely)

Status Icons:
🔴 Active/Escalated
🟡 Monitoring
🟢 Resolved
⏳ Pending action
```

---

## 13. IMPLEMENTATION ROADMAP

**Phase 1 (Weeks 1-2):**
- Live Anomalies table + KPI cards
- Detail panel with chart visualization
- Basic work order integration

**Phase 2 (Weeks 3-4):**
- Sensor health scorecard
- Historical trends & reports
- Alert rule configuration UI

**Phase 3 (Weeks 5-6):**
- Mobile field app push notifications
- GPS integration + heat maps
- Executive dashboard summary

**Phase 4 (Weeks 7-8):**
- Advanced filtering & search
- Custom dashboard layouts
- Audit trail compliance export

