Explainable Smart-Building Energy Consumption Forecasting and Anomaly Diagnosis Framework Based on Multi-Head Transformer and Dual-Stream Detection
Fine-grained energy management in smart-campus buildings requires accurate load forecasting together with reliable and interpretable anomaly diagnosis. This study presents an integrated forecasting–diagnosis framework for building energy systems. Hourly energy demand is modeled using a Transformer-based sequence-to-sequence architecture, in which a domain-aware attention mechanism is introduced to separately represent historical consumption dynamics, environmental influences, and temporal regularities commonly observed in building energy use. Anomaly diagnosis is conducted through a dual-scale strategy that supports both the timely detection of abrupt abnormal events and the identification of gradual performance degradation. Short-term anomalies are detected from forecasting residuals using adaptive thresholds, while long-term anomalies are identified by comparing current residual patterns with same-season historical baselines and validating multi-window trends over a 48 h horizon. The two detection streams are jointly used to distinguish point, pattern, and composite anomalies. To support practical operation and maintenance, SHAP-based explanations are provided to interpret both energy predictions and detected anomalies. Case studies on two educational buildings from the Building Data Genome Project 2 demonstrate that the proposed framework achieves the best overall forecasting performance against both conventional baselines and stronger recent Transformer-based models, with mean absolute percentage errors of approximately 3%. The results indicate that the proposed framework provides a practical solution for data-driven energy monitoring and decision support in smart buildings.
Authors
- Dan Liao (ORCID: https://orcid.org/0000-0003-3729-3612)
- Bin Liu (ORCID: https://orcid.org/0000-0003-4720-4126)
- Yuanyu Cai
Institutions
- Xiangtan University (CN)
Publication Details
- Journal
- Applied Sciences
- Published
- 2026-04-15
- DOI
- https://doi.org/10.3390/app16083836
- Primary Topic
- Building Energy and Comfort Optimization
- Type
- article
- Field-Weighted Citation Impact
- 0.00