Gas classification and leak detection are independent processes. The system can classify "NoGas" while still detecting a leak if concentration exceeds safety thresholds, or classify "Smoke" without detecting a leak if concentration remains low.
flowchart LR
subgraph Sensors["Sensors"]
S[7 MQ Sensors
MQ2-MQ135
Raw Data Collection]
end
subgraph Orchestrator["Orchestrator"]
N8N[n8n
Event Routing
Data Encapsulation
Logging]
end
subgraph Classifier["ML Classifier"]
Models[8 ML Algorithms
Random Forest: 99.58%
SVM, KNN, MLP, DT
Classification & Scoring]
LG[LangGraph
Agent Coordination
Decision Logic]
end
subgraph Data["Data Layer"]
VDB[Vector DB
Semantic Search
Pattern Storage]
TS[Time-Series DB
Drift Tracking
Temporal Evolution]
end
subgraph Analytics["AI Analytics"]
AN[Anomaly Detection
Predictive Maintenance
Root Cause Analysis
Adaptive Alerts]
end
subgraph MCP_Layer["MCP Integration"]
MCP[Model Context
Protocol
Action Generation]
end
subgraph Enterprise["Enterprise Systems"]
SAP[SAP ERP
Maintenance]
Teams[MS Teams
Personnel Interaction]
Ext[External
Systems]
end
S -->|Raw Data| N8N
N8N -->|Route to Models| Models
Models -->|Classifications & Scores| LG
LG -->|Store Results| VDB
LG -->|Store Results| TS
VDB --> Analytics
TS --> Analytics
Analytics -->|Trigger Actions| MCP
MCP --> SAP
MCP --> Teams
MCP --> Ext
SAP -.->|Feedback| N8N
Teams -.->|Feedback| N8N
Ext -.->|Context| Analytics
classDef sensorStyle fill:#3b82f6,stroke:#1e40af,color:#fff,stroke-width:3px
classDef orchestrationStyle fill:#8b5cf6,stroke:#6d28d9,color:#fff,stroke-width:3px
classDef classifierStyle fill:#10b981,stroke:#059669,color:#fff,stroke-width:3px
classDef dataStyle fill:#f59e0b,stroke:#d97706,color:#fff,stroke-width:3px
classDef analyticsStyle fill:#ec4899,stroke:#be185d,color:#fff,stroke-width:3px
classDef mcpStyle fill:#ef4444,stroke:#dc2626,color:#fff,stroke-width:3px
classDef enterpriseStyle fill:#64748b,stroke:#475569,color:#fff,stroke-width:3px
class S sensorStyle
class N8N orchestrationStyle
class Models,LG classifierStyle
class VDB,TS dataStyle
class AN analyticsStyle
class MCP mcpStyle
class SAP,Teams,Ext enterpriseStyle
| Model | Accuracy | Precision | Recall | F1-Score | Value Score |
|---|---|---|---|---|---|
| Random Forest | 99.58% | 99.58% | 99.58% | 99.58% | 3,780,000 |
| K-Nearest Neighbors | 99.32% | 99.33% | 99.32% | 99.32% | 3,742,500 |
| Decision Tree | 99.17% | 99.17% | 99.17% | 99.17% | 3,720,000 |
| Support Vector Machine | 98.59% | 98.60% | 98.59% | 98.59% | 3,637,500 |
| Quadratic Discriminant Analysis | 92.29% | 92.50% | 92.29% | 92.27% | 2,730,000 |
The MQ2 sensor can detect methane physically, but the training dataset does not include a specific "Methane" class. If methane is present, the system will classify it as "Smoke" or "Mixture" based on sensor response patterns. The leak detection system operates independently and will identify dangerous concentrations regardless of gas type classification.
Advanced machine learning delivering 99.58% accuracy with enterprise-ready integration