Development of an Integrated Mathematical Modeling Framework for Predicting and Optimizing Building Energy Consumption Using Machine Learning and Real-World Environmental Data
Keywords:
Building energy prediction, Hybrid XGBoost–LSTM, NSGA-II, optimization, Thermal comfort constraints, Pareto-optimal operation, Real-world environmentalAbstract
Introduction: Building energy consumption prediction and optimization remain challenging due to the complex interplay between environmental conditions, occupant behavior, and building systems. While machine learning has improved prediction accuracy, most existing frameworks treat prediction and optimization separately, limiting their practical utility.
Objective: This study develops an integrated mathematical modeling framework that couples machine learning-based prediction with multi-objective optimization using real-world environmental data, enabling simultaneous improvement of energy accuracy and operational efficiency.
Method: The framework employs a hybrid XGBoost-LSTM architecture for energy prediction, incorporating real-time meteorological variables, indoor hygrothermal measurements, and temporal features. Prediction outputs feed directly into an NSGA-II optimization module that balances energy minimization against thermal comfort constraints. The framework was validated using one year of hourly operational data from a mixed-use university building.
Results: The prediction module achieved a CV(RMSE) of 8.7% and MAPE of 6.2%, surpassing ASHRAE Guideline 14 thresholds. The integrated optimization demonstrated 14.3% energy savings relative to baseline operation while maintaining 94.1% thermal comfort satisfaction. Sensitivity analysis revealed that outdoor humidity and occupancy-driven internal gains were the most influential features.
Conclusion: The integrated framework demonstrates that coupling accurate prediction with Pareto-based optimization yields actionable operational strategies superior to prediction-only or rule-based approaches. The methodology is generalizable to diverse building typologies with accessible environmental monitoring infrastructure.
References
Government of Pakistan, Asian Development Bank, European Union, United Nations, World Bank. Pakistan floods 2022: post-disaster needs assessment. Islamabad: Government of Pakistan; 2022. Available from:https://documents.worldbank.org/en/publication/documents-reports/documentdetail/099910201032325572
Tariq MAUR, van de Giesen N. Floods and flood management in Pakistan. Phys Chem Earth Parts A/B/C. 2012;47-48:11-20. doi:10.1016/j.pce.2011.08.014.
Sayama T, Ozawa G, Kawakami T, Nabesaka S, Fukami K. Rainfall-runoff-inundation analysis of the 2010 Pakistan flood in the Kabul River basin. Hydrol Sci J. 2012;57(2):298-312. doi:10.1080/02626667.2011.644245.
Khattak MS, Anwar F, Saeed TU, Sharif M, Sheraz K, Ahmed A. Floodplain mapping using HEC-RAS and ArcGIS: a case study of Kabul River. Arab J Sci Eng. 2016;41:1375-1390. doi:10.1007/s13369-015-1915-3.
Bibi T, Nawaz F, Abdul Rahman A, Azahari Razak K, Latif A. Flood risk assessment of River Kabul and Swat catchment area: District Charsadda, Pakistan. Int Arch Photogramm Remote Sens Spatial Inf Sci. 2018;XLII-4/W9:105-113. doi:10.5194/isprs-archives-XLII-4-W9-105-2018.
Hamidi AR, Jing L, Shahab M, Azam K, Tariq MAUR, Ng AW. Flood exposure and social vulnerability analysis in rural areas of developing countries: an empirical study of Charsadda District, Pakistan. Water. 2022;14(7):1176. doi:10.3390/w14071176.
Ibrahim M, Huo A, Ullah W, Ullah S, Ahmad A, Zhong F. Flood vulnerability assessment in the flood prone area of Khyber Pakhtunkhwa, Pakistan. Front Environ Sci. 2024;12:1303976. doi:10.3389/fenvs.2024.1303976.
Ibrahim M, Huo A, Ullah W, Ullah S, Xuantao Z. An integrated approach to flood risk assessment using multi-criteria decision analysis and geographic information system: a case study from a flood-prone region of Pakistan. Front Environ Sci. 2025;12:1476761. doi:10.3389/fenvs.2024.1476761.
Eskandarinejad A, Nazari R, Nikoo MR, Arellano D, Pezeshk S, Ghasemi SH. A comprehensive review of geotechnical implications of floods and water-driven disasters. Sci Total Environ. 2025;985:179731. doi:10.1016/j.scitotenv.2025.179731.
Johnston I, Murphy W, Holden J. A review of floodwater impacts on the stability of transportation embankments. Earth Sci Rev. 2021;215:103553. doi:10.1016/j.earscirev.2021.103553.
Shah IA, Khan H, Muhammad Z, Ullah R, Iqbal S, Nafidi HA, et al. Evaluation of climate change impact on plants and hydrology. Front Environ Sci. 2024;12:1328808. doi:10.3389/fenvs.2024.1328808.
Pakistan Bureau of Statistics. National Census Report 2023. Islamabad: Pakistan Bureau of Statistics; 2025. Available from: https://www.pbs.gov.pk/wp-content/uploads/2020/07/National-Census-Report-2023-1.pdf
United Nations Satellite Centre. Updated flood waters in Charsadda and Nowshera Districts, Pakistan. Product 2078. Geneva: UNOSAT; 2010 Aug 9. Available from: https://unosat.org/products/2078
Page MJ, McKenzie JE, Bossuyt PM, Boutron I, Hoffmann TC, Mulrow CD, et al. The PRISMA 2020 statement: an updated guideline for reporting systematic reviews. BMJ. 2021;372:n71. doi:10.1136/bmj.n71.
de Brito MM, Evers M. Multi-criteria decision-making for flood risk management: a survey of the current state of the art. Nat Hazards Earth Syst Sci. 2016;16(4):1019-1033. doi:10.5194/nhess-16-1019-2016.
Farooq M, Shafique M, Khattak MS. Flood hazard assessment and mapping of River Swat using HEC-RAS 2D model and high-resolution 12-m TanDEM-X DEM. Nat Hazards. 2019;97:477-492. doi:10.1007/s11069-019-03638-9.
Rahman ZU, Ullah W, Bai S, Ullah S, Jan MA, Khan M, et al. GIS-based flood susceptibility mapping using bivariate statistical model in Swat River Basin, Eastern Hindukush region, Pakistan. Front Environ Sci. 2023;11:1178540. doi:10.3389/fenvs.2023.1178540.
Farish S, Munawar S, Siddiqua A, Alam N, Alam M. Flood risk zonation using GIS techniques: District Charsadda, 2010 floods Pakistan. Environ Risk Assess Remediat. 2017;1(2). doi:10.4066/2529-8046.100014.
Fida M, Hussain I, Tao W, Rashid A, Ali Shah SA. Land use and land cover change analysis of District Charsadda, Pakistan along Kabul River in 2010 flood: using advanced GIS and remote-sensing techniques. Nat Hazards Earth Syst Sci Discuss. 2020:1-16. doi:10.5194/nhess-2020-255.
Iqbal MS, Dahri ZH, Querner EP, Khan A, Hofstra N. Impact of climate change on flood frequency and intensity in the Kabul River Basin. Geosciences. 2018;8(4):114. doi:10.3390/geosciences8040114.
Ushiyama T, Sayama T, Tatebe Y, Fujioka S, Fukami K. Numerical simulation of 2010 Pakistan flood in the Kabul River Basin by using lagged ensemble rainfall forecasting. J Hydrometeorol. 2014;15(1):193-211. doi:10.1175/JHM-D-13-011.1.
Communication and Works Department, Government of Khyber Pakhtunkhwa. Highway Bridge Design Code 2025 (HBDC-25). Peshawar: Government of Khyber Pakhtunkhwa; 2025. Available from: https://seed-pk.com/bridge-code/
Arneson LA, Zevenbergen LW, Lagasse PF, Clopper PE. Evaluating scour at bridges. 5th ed. Hydraulic Engineering Circular No. 18, FHWA-HIF-12-003. Washington (DC): Federal Highway Administration; 2012.
US Army Corps of Engineers. Seepage analysis and control for dams. Engineer Manual EM 1110-2-1901. Washington (DC): USACE; 1986.
US Army Corps of Engineers. Slope stability. Engineer Manual EM 1110-2-1902. Washington (DC): USACE; 2003.
US Army Corps of Engineers. Design and construction of levees. Engineer Manual EM 1110-2-1913. Washington (DC): USACE; 2000.
Foster M, Fell R, Spannagle M. The statistics of embankment dam failures and accidents. Can Geotech J. 2000;37(5):1000-1024. doi:10.1139/t00-030.
Fell R, Wan CF, Cyganiewicz J, Foster M. Time for development of internal erosion and piping in embankment dams. J Geotech Geoenviron Eng. 2003;129(4):307-314. doi:10.1061/(ASCE)1090-0241(2003)129:4(307).
Briaud JL, Ting FCK, Chen HC, Cao Y, Han SW, Kwak KW. Erosion function apparatus for scour rate predictions. J Geotech Geoenviron Eng. 2001;127(2):105-113. doi:10.1061/(ASCE)1090-0241(2001)127:2(105).
Otto FEL, Zachariah M, Saeed F, Siddiqi A, Kamil S, Mushtaq H, et al. Climate change increased extreme monsoon rainfall, flooding highly vulnerable communities in Pakistan. Environ Res Clim. 2023;2:025001. doi:10.1088/2752-5295/acbfd5.
Arshad A, Mirchi A, He C, Shah AA, AghaKouchak A. Anthropogenic and climatic drivers of the 2022 mega-flood in Pakistan. npj Nat Hazards. 2025;2:57. doi:10.1038/s44304-025-00109-z.
Federal Flood Commission, Ministry of Water Resources, Government of Pakistan. National Flood Protection Plan IV (2016-2025). Islamabad: Federal Flood Commission; 2017. Available from: https://ffc.gov.pk/plans-policies/
Ministry of Climate Change and Environmental Coordination, Government of Pakistan. Pakistan National Adaptation Plan. Islamabad: Government of Pakistan; 2023.
Planning and Development Department, Government of Khyber Pakhtunkhwa. Flood Response Plan 2022. Peshawar: Government of Khyber Pakhtunkhwa; 2022. Available from: https://pndkp.gov.pk/2022/12/08/kp-government-prepared-flood-response-plan-2022/
Pakistan Engineering Council. Building Code of Pakistan 2021. Islamabad: Pakistan Engineering Council; 2021. Available from: https://www.pec.org.pk/thinktank/building-code-of-pakistan-thinktank/
United Nations Office for Disaster Risk Reduction. Sendai Framework for Disaster Risk Reduction. Geneva: UNDRR; 2015.
Farr TG, Rosen PA, Caro E, Crippen R, Duren R, Hensley S, et al. The Shuttle Radar Topography Mission. Rev Geophys. 2007;45:RG2004. doi:10.1029/2005RG000183.
Poggio L, de Sousa LM, Batjes NH, Heuvelink GBM, Kempen B, Ribeiro E, et al. SoilGrids 2.0: producing soil information for the globe with quantified spatial uncertainty. SOIL. 2021;7:217-240. doi:10.5194/soil-7-217-2021.
Pekel JF, Cottam A, Gorelick N, Belward AS. High-resolution mapping of global surface water and its long-term changes. Nature. 2016;540:418-422. doi:10.1038/nature20584.
Gorelick N, Hancher M, Dixon M, Ilyushchenko S, Thau D, Moore R. Google Earth Engine: planetary-scale geospatial analysis for everyone. Remote Sens Environ. 2017;202:18-27. doi:10.1016/j.rse.2017.06.031.
van Genuchten MT. A closed-form equation for predicting the hydraulic conductivity of unsaturated soils. Soil Sci Soc Am J. 1980;44(5):892-898. doi:10.2136/sssaj1980.03615995004400050002x.
American Society of Civil Engineers. Flood resistant design and construction. ASCE/SEI 24-24. Reston (VA): ASCE; 2024.
Saaty TL. The analytic hierarchy process: planning, priority setting, resource allocation. New York: McGraw-Hill; 1980.
Bruneau M, Chang SE, Eguchi RT, Lee GC, O'Rourke TD, Reinhorn AM, et al. A framework to quantitatively assess and enhance the seismic resilience of communities. Earthquake Spectra. 2003;19(4):733-752. doi:10.1193/1.1623497.
Downloads
Published
Issue
Section
License

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.