Next Article in Journal
Edge Detection Attention Module in Pure Vision Transformer for Low-Dose X-Ray Computed Tomography Image Denoising
Previous Article in Journal
A Lightweight and Efficient Detection Transformer for Highway Abandoned Objects
Previous Article in Special Issue
Nonlinear Optimization and Adaptive Heuristics for Solving Irregular Object Packing Problems
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Adaptive Machine Learning for Automatic Load Optimization in Connected Smart Green Townhouses

by
Seyed Morteza Moghimi
1,*,
Thomas Aaron Gulliver
1,
Ilamparithi Thirumarai Chelvan
1,† and
Hossen Teimoorinia
2,3,†
1
Department of Electrical and Computer Engineering, University of Victoria, 1700, STN CSC, Victoria, BC V8W 2Y2, Canada
2
Department of Physics and Astronomy, University of Victoria, Victoria, BC V8P 5C2, Canada
3
NRC Herzberg Astronomy and Astrophysics, 5071 West Saanich Road, Victoria, BC V9E 2E7, Canada
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Algorithms 2025, 18(3), 132; https://doi.org/10.3390/a18030132
Submission received: 21 January 2025 / Revised: 26 February 2025 / Accepted: 28 February 2025 / Published: 2 March 2025
(This article belongs to the Special Issue Facility Layout Optimization: Bridging Theory and Practice)

Abstract

:
This paper presents an adaptive Machine Learning (ML)-based framework for automatic load optimization in Connected Smart Green Townhouses (CSGTs) The system dynamically optimizes load consumption and transitions between grid-connected and island modes. Automatic mode transitions reduce the need for manual changes, ensuring reliable operation. Actual occupancy, load demand, weather, and energy price data are used to manage loads which improves efficiency, cost savings, and sustainability. An adaptive framework is employed that combines data processing and ML. A hybrid Long Short-Term Memory-Convolutional Neural Network (LSTM-CNN) model is used to analyze time series and spatial data. Multi-Objective Particle Swarm Optimization (MOPSO) is employed to balance costs, carbon emissions, and efficiency. The results obtained show a 3–5% improvement in efficiency for grid-connected mode and 10–12% for island mode, as well as a 4–6% reduction in carbon emissions.

Graphical Abstract

1. Introduction

Residential buildings account for nearly 40% of global energy consumption and Greenhouse Gas (GHG) emissions [1]. Traditional energy management in smart buildings relies on manual adjustments that lack adaptability to changing factors such as occupancy, weather, and energy prices [2]. This results in operational inefficiencies, energy waste, and limited resilience. Adaptive systems based on Machine Learning (ML) models can dynamically respond to real-time conditions, enhancing load efficiency and flexibility. Furthermore, automatic transitions between grid-connected and island modes reduce human intervention and ensure uninterrupted operation during outages [3]. Smart Green Townhouses (SGTs) integrated with Renewable Energy Sources (RESs) offer a promising solution for sustainable urban development by optimizing energy use and reducing environmental impact [4,5].
Despite advances in energy optimization, many existing systems lack prediction capabilities, underutilize Internet of Things (IoT) data, and fail to optimize emission reduction [6]. Addressing these issues can significantly improve load efficiency and resilience by dynamically optimizing energy consumption, prioritizing renewable energy, and automating operational decisions.
This paper proposes an adaptive ML-based framework for automatic load optimization in Connected Smart Green Townhouses (CSGTs). The building considered is located in Burnaby, BC, Canada, and consists of four connected townhouses with 1-, 2-, 3-, and 4-bedrooms, connected water systems, and shared party walls [4,5,7]. Each townhouse type is associated with typical occupancy profiles to reflect realistic load usage patterns. These profiles were informed by publicly available datasets (e.g., from [7,8]) and assumptions based on typical residential load usage. The 1-Bedroom (1-Bd) SGT is designed for a young couple, focusing on compact living with minimal load consumption, representing the lowest load usage. The 2-Bedroom (2-Bd) SGT is suitable for a couple with one young child, providing extra space while remaining load efficient, with moderate load usage. The 3-Bedroom (3-Bd) SGT is designed for a family with two teenage children, prioritizing efficient zoning and load distribution, resulting in higher load usage. Finally, the 4-Bedroom (4-Bd) SGT accommodates a family of five, representing the highest load consumption. The system leverages IoT data, including occupancy, weather, and energy prices, and employs a deep hybrid Long Short-Term Memory-Convolutional Neural Network (LSTM-CNN) model. Multi-Objective Particle Swarm Optimization (MOPSO) is used to balance costs, carbon emissions, and efficiency. This enables adaptive load optimization and automatic mode transitions to improve performance.
The remainder of this paper is organized as follows. The methodology is presented in Section 2 including the proposed ML model and MOPSO algorithm. Section 3 gives the performance results and discussion. Section 4 summarizes the paper including the implications for sustainable urban living.

2. Methodology

The proposed deep hybrid LSTM-CNN model is used to dynamically adjust to changes in occupancy, load demand, weather, and energy prices [4,5,9,10,11]. The hybrid architecture combines LSTM temporal forecasting with CNN spatial feature extraction to predict load consumption, operational costs, and carbon emissions. The adaptive system leverages IoT data to refine predictions under changing conditions, ensuring responsive and accurate optimization. The experimental setup and algorithms are similar to those in [4,5].
Real data from a variety of sources is employed. This includes occupancy and load demand data from [7,8], IoT sensor data from [12], weather data from [3,10], and energy prices from [3]. Data from IoT sensors (e.g., motion detectors and door sensors) and smart devices (e.g., thermostats and lighting) are integrated with utility data to infer occupancy patterns. The AMPds dataset [7,8] provides high-resolution time-series data on electricity, water, and natural gas consumption. This is employed for load demand modeling under seasonal and weather variations. IoT sensors support real-time adjustments by detecting load usage changes [12]. Energy-efficient technology such as heat pumps is also used [13]. This ensures efficient and sustainable Smart Green Buildings (SGBs) [14].

2.1. Problem Formulation

The proposed framework integrates an LSTM-CNN model for accurate prediction of load demand, energy costs, and carbon emissions with Multi-Objective Particle Swarm Optimization (MOPSO). The LSTM-CNN model employs the Mean Squared Error (MSE) as the lossfunction.
MSE = 1 n i = 1 n Predicted i Actual i 2 ,
where Predicted i is the model prediction for the ith sample, Actual i is the corresponding actual value, and n is the number of samples. These predictions serve as inputs for the MOPSO algorithm to ensure reliable and efficient solutions [15]. This integration provides scalable, adaptive, and robust real-time load optimization [16].
The MOPSO algorithm employs a swarm of N = 60 particles, each representing a potential solution. Particle i is initialized with position vector X i ( 0 ) and velocity vector V i ( 0 ) . Random initialization is employed to ensure diverse exploration of the solution space, reducing bias and aiding in discovering global optima.
The multi-objective function is
f ( 𝒳 ) = α · Cos t ( 𝒳 ) + β · Emissions ( 𝒳 ) γ · Efficiency ( 𝒳 ) ,
where
𝒳 = { P grid ( t ) , P renewable ( t ) , P battery ( t ) , P demand ( t ) } ,
is the vector of decision variables defined as follows.
  • P grid ( t ) is the power supplied from the grid at time t.
  • P renewable ( t ) is the power from RESs (solar panels) at time t.
  • P battery ( t ) is the power discharged from the battery at time t.
  • P demand ( t ) is the total load demand at time t.
The weights α = 0.3 , β = 0.4 , and γ = 0.3 reflect the importance of each objective. This function ensures balanced solutions that address the tradeoffs between economic, environmental, and performance goals. While smart inverter functionalities such as Voltage-Ampere Reactive Control (Volt-VAR) control can contribute to grid stability by injecting or absorbing reactive power, they are more suitable for utility-scale applications and commercial microgrids. In residential settings, customers are typically billed for active power (kWh) rather than reactive power (kVARh), and smart inverters are not necessary to provide voltage regulation. Therefore, this paper focuses on optimizing active power to minimize costs, improve efficiency, and reduce emissions.
The total operational cost is
Cos t ( 𝒳 ) = t = 1 T P demand ( t ) · C electricity ,
where C electricity is the electricity cost per kWh. The carbon emissions are
Emissions ( 𝒳 ) = t = 1 T P demand ( t ) · E factor ,
where E factor is the emission factor in kg C O 2 /kWh. The efficiency is expressed as
Efficiency ( 𝒳 ) = Useful Load Output Total Load Input ,
At time t, particles update their velocities and positions according to
V i ( t ) = ω · V i ( t 1 ) + c 1 r 1 ( P i X i ( t 1 ) ) + c 2 r 2 ( G X i ( t 1 ) ) ,
X i ( t ) = X i ( t 1 ) + V i ( t ) ,
where V i ( t ) is the velocity of particle i, X i ( t ) is the position of particle i, ω is the inertia weight balancing exploration and exploitation, c 1 , c 2 are acceleration coefficients guiding particles towards their personal best P i and the global best G , and r 1 , r 2 are random numbers in the range 0 to 1 to provide stochastic exploration. These updates ensure adaptive exploration to prevent premature convergence and allow the system to respond dynamically to changes.
The algorithm terminates when it has converged or the maximum number of iterations (100) is reached. Convergence is assumed if the global best solution remains within a threshold for a given number of iterations. Empirical results have shown that beyond 100 iterations, the rate of improvement in the objective function decreases significantly, indicating that further iterations yield marginal benefits. To mitigate oscillatory behavior, a dynamic inertia weight is employed where ω decreases each iteration, and c 1 and c 2 are tuned to prevent particle oscillation around local optima. This improves the stability and convergence of the algorithm.
The load optimization framework employs the following expressions.
  • The load balance at time t is
    P grid ( t ) + P renewable ( t ) + P battery ( t ) = P demand ( t ) .
  • The grid constraint at time t is
    P grid min P grid ( t ) P grid max ,
    where P grid min and P grid max are the minimum and maximum allowable power from the grid, respectively, and P grid ( t ) is the power supplied from the grid.
  • The battery State of Charge (SOC) constraint at time t is [5]
    S O C min S O C ( t ) S O C max ,
    where S O C min and S O C max are the minimum ( 10 % ) and maximum ( 90 % ) allowable charge, respectively. This minimum is based on maximizing the available storage for cost and emission reduction while maintaining battery lifespan. However, in some applications, particularly when batteries are used to improve resilience and reliability, the minimum SOC is higher (25–50%) to ensure sufficient availability. Increasing the minimum will reduce the amount available for daily load optimization but improve the available backup power in critical situations. The tradeoff between economic benefits (lower costs and higher efficiency) and resilience (higher availability for grid disturbances) should be based on operational priorities.
  • The power of the renewable energy produced from solar panels at time t is
    P renewable ( t ) = A solar · G ( t ) · η solar ,
    where A solar is the total area of the solar panels, G ( t ) is the solar irradiance at time t, and η solar is the panel efficiency.
  • The demand prediction for time t + 1 is
    P demand ( t + 1 ) = f LSTM-CNN ( P demand ( t ) , occupancy ( t ) , weather ( t ) ) ,
    where f LSTM-CNN ( ) is the hybrid LSTM-CNN model used for prediction, P demand ( t ) is the actual load demand at time t, and occupancy ( t ) and weather ( t ) are the corresponding occupancy information and weather conditions.
The hyperparameter tuning results for the proposed LSTM-CNN model are given in Table 1. They were obtained using Windows 11 on an Intel Core i7-12700K processor with 32 GB RAM and an NVIDIA RTX 3090 GPU. The average training time was 4.2 h. Compared to traditional static methods, this model provides a 15–20% improvement in accuracy.
The proposed ML model predicts load demand, carbon emissions, and costs, while the MOPSO algorithm determines operational parameters to balance costs, carbon emissions, and efficiency [15]. They were implemented using Python 3.11.5 with Pandas for data manipulation, NumPy for calculations, and Matplotlib for visualization [4]. The optimization algorithms considered include Genetic Algorithm (GA) [17,18], MOPSO [15,19,20,21], Simulated Annealing (SA) [21], Reinforcement Learning (RL) [22,23], and Mixed-Integer Linear Programming (MILP) [24,25]. Table 2 provides a comparative analysis of these algorithms for load management. In addition to their strengths, weaknesses, and applicability, the average execution time is given based on our experimental results. This shows that MOPSO outperforms the other methods. The average time for MOPSO is significantly lower than GA, SA, and MILP, making it more suitable for real-time applications. RL, while adaptive, has a high execution time due to extensive training requirements. Although MOPSO may converge to a local optimum, its speed and ability to handle multi-objective problems make it the best choice for SGBs.
Figure 1 gives a flowchart of the load optimization for CSGTs. It begins with the data input including load demand, energy prices, occupancy, and weather. If the building is in grid-connected mode, the load is optimized using the grid supply, otherwise the load is managed using battery storage and RESs. In the latter case, the battery SOC is checked to ensure it is within the acceptable range. If it is, the system proceeds to charge and/or discharge the battery as needed, otherwise, the process terminates. This flowchart illustrates the dynamic approach to balance grid dependency, renewable resources, and battery usage for load optimization.
Model performance is assessed using the Mean Absolute Error (MAE) and coefficient of determination ( R 2 ). The MAE is
MAE = 1 n i = 1 n | Predicted i Actual i | ,
where Predicted i is the ith predicted value, Actual i is the corresponding actual value, and n is the number of values. The coefficient of determination is
R 2 = 1 i = 1 n ( Predicted i Actual i ) 2 i = 1 n ( Actual i Actual ¯ ) 2 ,
where Actual ¯ is the average actual value.

2.2. Other Deep Learning-Based Methods

While the proposed model effectively predicts load demand, costs, and emissions, there are other deep learning approaches. Transformer-based models have good temporal learning capabilities but require significantly more computational resources. Hybrid attention mechanisms can improve interpretability but increase model complexity. Variational Autoencoders (VAEs) are suitable for anomaly detection but may not generalize well for optimization problems. The proposed LSTM-CNN hybrid model was selected due to its ability to capture both temporal dependencies (LSTM) and spatial patterns (CNN) efficiently. In addition, it is less complex than other deep learning methods, which is important for real-time applications.

2.3. External Uncertainties in Load Optimization

The proposed framework provides effective load optimization based on weather, occupancy, and energy prices. External uncertainties that can affect performance include policy changes, demand fluctuations, and renewable energy intermittency. These are discussed below.
  • Policy Changes: Regulatory policies include adjustments in net metering policies, carbon pricing, and/or energy tariffs that affect costs. To ensure adaptability, the framework can integrate periodic policy updates by retraining the model with revised energy pricing and regulatory data.
  • Demand Fluctuations: Unpredictable occupant behavior, seasonal variations, and external grid constraints may cause deviations from expected load patterns. To address this, the framework updates continuously using occupancy-driven forecasts based on real-time IoT and environmental data to enable fast load adjustments.
  • Renewable Energy Intermittency: Variations in solar irradiance affect the availability of renewable energy. The framework mitigates this by incorporating probabilistic forecasting to anticipate fluctuations and by dynamically managing battery storage to compensate for variability. Historical weather data and real-time solar radiation measurements can also be used to improve prediction accuracy.

3. Performance Results

In this section, the load profiles for CSGTs are analyzed. They incorporate data from public datasets [7,8] and assumptions about typical residential load usage patterns. The electricity, gas, and water loads for each townhouse type (1-Bd, 2-Bd, 3-Bd, and 4-Bd) were calculated separately, and the optimization algorithms ML, PSO, and MOPSO were used to generate load profiles. The results were then aggregated to provide combined load usage for the CSGTs. The normalized total load L total ( t ) at time t is given by
L total ( t ) = i = 1 N w i L normalized , i ( t ) ,
where N = 4 is the number of townhouse types, L normalized , i ( t ) is the normalized load for the i-Bd townhouse at time t, and w i is the corresponding weight. The weights are w 1 = 0.20 , w 2 = 0.30 , w 3 = 0.25 , and w 4 = 0.25 and reflect the relative contributions of the townhouses based on their size and occupancy. They were determined using energy consumption patterns derived from publicly available datasets [7,8] and occupancy assumptions.
The normalization for load type j (e.g., electricity, gas, or water) and townhouse type i is
L normalized , i , j ( t ) = L i , j ( t ) L min , i , j L max , i , j L min , i , j ,
where L i , j ( t ) is the load for townhouse type i and load type j at time t, L max , i , j is the maximum load for townhouse type i and load type j across the dataset, and L min , i , j is the corresponding minimum load. This is performed independently for each load and townhouse type to maintain consistency and ensure comparability across electricity, gas, and water loads. This prevents any single load type from dominating the total load profile due to differences in magnitude or units. The normalization for the ith Bd townhouse is then
L normalized , i ( t ) = 1 3 j = 1 3 L normalized , i , j ( t ) .
The electricity load is
Electricity Load = P appliance + P lighting + P HVAC ,
where P appliance , P lighting , and P HVAC represent the power demand from electrical appliances, lighting, and Heating, Ventilation, and Air Conditioning (HVAC) systems, respectively. The gas load is
Gas Load ( kWh ) = Gas Volume ( m 3 ) · C gas ,
where Gas Volume ( m 3 ) is the volume of natural gas consumed, and C gas is the calorific value of gas (kWh/ m 3 ). The water load is
Water Load ( kWh ) = Water Volume ( m 3 ) · C water ,
where Water Volume ( m 3 ) is the volume of water used, and C water is the energy required to pump, heat, and treat water (kWh/ m 3 ).
Figure 2, Figure 3, Figure 4 and Figure 5 present the electricity, gas, and water load profiles over 24 h in kWh for the four townhouse types. These results show the variations in load patterns that reflect the differences in occupancy, space utilization, and resource needs. The 1-Bd SGT has the lowest load due to its compact size and low occupancy and so serves as a baseline for the other townhouses. The 2-Bd SGT shows a moderate increase in load due to the greater demand for heating, lighting, and water. The 3-Bd SGT has a higher load due to the needs of a larger family driven by increased space utilization and occupancy. These results indicate how load demand scales with family size. The 4-Bd SGT has the highest load because it has the largest family which results in significant demands for heating, lighting, and water. The aggregated load profiles for the four townhouse types are given in Figure 6. These results are used to evaluate the load optimization techniques and validate the scalability and adaptability of the proposed framework in addressing the dynamic requirements of CSGTs.
Figure 7 gives the base (actual) and MOPSO optimized carbon emissions over time. This shows a 20% reduction in carbon emissions, with the peak lowered to 5.7 kg C O 2 from 6.3 kg C O 2 and a minimum of 3.8 kg C O 2 . Figure 8 gives the base and MOPSO optimized operational costs over time. The MOPSO results range from less than 1.1 Canadian Dollar (CAD) to 1.6 CAD versus a maximum of 1.9 CAD in the base case, which indicates a cost savings of 15–20%.
Figure 9 presents the load optimization results for CSGTs over 24 h considering electricity, gas, and water loads. This shows that the unoptimized (base) aggregate total load is 14.2 kWh at hour 1 and varies throughout the day with a peak of 16.8 kWh at hour 16 and a minimum of 12.2 kWh at hour 20. The ML, PSO, and MOPSO loads are progressively lower indicating improved load management. For example, at hour 16, the ML load is approximately 16.2 kWh, but the PSO load is about 15.9 kWh, and the MOPSO load is the lowest at approximately 15.5 kWh. Further, MOPSO consistently provides the best results over the 24 h and is 9.4–10.3% lower than the base load. These results indicate the effectiveness of the algorithms in reducing load consumption while maintaining load requirements.
While this paper considers CSGTs in Burnaby, BC, the proposed ML-based optimization framework can be generalized to other building types, locations, and energy systems. This flexibility stems from the ability to incorporate different occupancy profiles, energy consumption behavior, and load patterns using any data and real-world assumptions. By adjusting input parameters such as floor area, number of occupants, local energy pricing, and climate conditions, this framework can be employed for any residential configuration, including detached houses, apartment complexes, and smart communities. The adaptability of the proposed framework means it can be effective in any climate and with different energy systems. The LSTM-CNN model dynamically adjusts to variations in weather, energy prices, and demand-side fluctuations, so it can used with diverse energy policies and renewable energy integration. Furthermore, the MOPSO algorithm can be employed with any smart building configuration and various heating/cooling strategies, storage capacities, and demand-response mechanisms, so it can adapt to evolving energy management needs.

Proposed ML Model Results

K-fold cross-validation with K = 10 [4] was used with the proposed ML model to mitigate overfitting and ensure robust solutions. Table 3 gives the validation results for load, costs, and carbon emissions. This shows that the model lowers the annual load to 17,000 kWh/year from the base of 200,000 kWh/year which is a 15% reduction. The annual costs are 1700 CAD/year which is 15% less than the base of 2000 CAD/year. Carbon emissions are also reduced by 15%, from 5000 kg C O 2 /year to 4250 kg C O 2 /year. These results fall within the expected range of 10–20% and thus validate the effectiveness of the proposed model in load optimization while minimizing costs and environmental impact.
Table 4 compares the results for the proposed model and the approaches in [9,10]. This shows that the proposed model achieves a 15% reduction in annual load, costs, and carbon emissions while the reductions with the other methods range from 8–12%. Thus, the hybrid ML model provides better adaptability and efficiency compared to traditional methods.
The proposed framework offers benefits to both residential customers and utilities that align with modern load management goals. For customers, the framework reduces electricity costs while ensuring load efficiency without compromising occupant comfort. The optimized load scheduling maintains the necessary heating, lighting, and appliance use while minimizing unnecessary consumption. For utilities, Demand-Side Management (DSM) through optimized usage improves grid reliability and efficiency and lowers peak demand. This leads to deferred investments in generation capacity and improved resilience. The reduction in carbon emissions conforms with national and regional decarbonization policies and regulatory requirements. Programs such as carbon credits, peak shaving, and grid flexibility encourage utilities to promote customer-side load efficiency.
Utilities often employ Time-Of-Use (TOU) pricing, demand response, and Grid-interactive Efficient Buildings (GEBs) to provide economic and environmental benefits. This can be exploited with the proposed framework to directly benefit customers while improving grid efficiency, reducing capacity constraints, and meeting regulatory targets. While the focus here was on CSGTs in Burnaby, BC, the proposed adaptive framework can be applied in any geographic location with any energy infrastructure. This flexibility lies in the integration of real-time data such as occupancy patterns, weather conditions, and dynamic energy pricing. It can be customized to reflect diverse conditions, regulations, and constraints, and supports various grid structures (grid-connected, microgrid, off-grid). The framework can also be aligned with regional energy and load policies such as Leadership in Energy and Environmental Design (LEED), Building Research Establishment Environmental Assessment Method (BREEAM), and the National Australian Built Environment Rating System (NABERS).

4. Conclusions

This paper presented a new load optimization framework for Connected Smart Green Townhouses (CSGTs). It outperforms existing methods in terms of load reduction, cost savings, emission reduction, and accuracy, with lower MAE and higher R 2 . The results obtained show improvements of up to 15% in load efficiency, 15–20% in cost savings, and 10–15% in carbon emission reduction. Thus, it is effective in improving performance and supporting sustainability goals. It can adjust to real-time conditions, ensuring efficient and reliable operation for practical real-time applications in dynamic environments.
Future work will examine the implementation of an integrated Machine Learning (ML) and Internet of Things (IoT) system. The goal is to improve adaptability and reduce manual intervention for greater efficiency and sustainability. Validation of the proposed framework will also be considered for various building configurations and locations to assess its robustness in urban and suburban settings. Smart grid scenarios such as buildings with high renewable energy penetration and battery storage will be examined. In addition, the proposed framework will be extended to large scale residential and commercial developments.

Author Contributions

Conception and design, S.M.M., T.A.G., I.T.C. and H.T.; preparation and analysis, S.M.M., I.T.C. and T.A.G.; writing—original draft, T.A.G., S.M.M. and I.T.C.; writing—review and editing, T.A.G., S.M.M., I.T.C. and H.T.; supervision, T.A.G. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The original contributions presented in the study are included in the article, further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
SymbolDescription
BCBritish Columbia
CADCanadian Dollar
CSGTConnected Smart Green Townhouse
GAGenetic Algorithm
GHGGreenhouse Gas
IoTInternet of Things
LSTMLong Short-Term Memory
MILPMixed-Integer Linear Programming
MOPSOMulti-Objective Particle Swarm Optimization
NABERSNational Australian Built Environment Rating System
R 2 Coefficient of Determination
RLReinforcement Learning
SGBSmart Green Building
TanhHyperbolic Tangent
VAEVariational Autoencoders
BREEAMBuilding Research Establishment Environmental Assessment Method
CNNConvolutional Neural Network
DSMDemand Side Management
GEBGrid-Interactive Efficient Building
HVACHeating, Ventilation, and Air Conditioning
LEEDLeadership in Energy and Environmental Design
MAEMean Absolute Error
MLMachine Learning
MSEMean Squared Error
ReLURectified Linear Unit
RESRenewable Energy Source
SBSmart Building
SOCState of Charge
TOUTime-Of-Use
Volt-VARVoltage and Volt-Ampere Reactive Control

References

  1. Hafez, F.S.; Sa, B.; Safa-Gamal, M.; Taufiq-Yap, Y.H.; Alrifaey, M.; Seyedmahmoudian, M.; Stojcevski, A.; Horan, B.; Mekhilef, S. Energy efficiency in sustainable buildings: A systematic review with taxonomy, challenges, motivations, methodological aspects, recommendations, and pathways for future research. Energy Strategy Rev. 2023, 45, 101013. [Google Scholar] [CrossRef]
  2. Qayyum, F.; Jamil, H.; Ali, F. A review of smart energy management in residential buildings for smart cities. Energies 2024, 17, 83. [Google Scholar] [CrossRef]
  3. Yuan, J.; Zeng, X.; Zhou, J.; Li, J.; Lv, J.; Chen, R.; Chen, K.; Yang, W.; Zhang, Y. Data-driven real-time home energy management system based on adaptive dynamic programming. Electr. Power Syst. Res. 2025, 238, 111055. [Google Scholar] [CrossRef]
  4. Moghimi, S.M.; Gulliver, T.A.; Chelvan, I.T.; Teimoorinia, H. Resource optimization for grid-connected smart green townhouses using deep hybrid machine learning. Energies 2024, 17, 6201. [Google Scholar] [CrossRef]
  5. Moghimi, S.M.; Gulliver, T.A.; Chelvan, I.T.; Teimoorinia, H. Load optimization for connected modern buildings using deep hybrid machine learning in island mode. Energies 2024, 17, 6475. [Google Scholar] [CrossRef]
  6. Li, K.; Huang, W.; Hu, G.; Li, J. Ultra-short term power load forecasting based on CEEMDAN-SE and LSTM neural network. Energy Build. 2023, 279, 112666. [Google Scholar] [CrossRef]
  7. Makonin, S. Electricity, water, and natural gas consumption of a residential house in Canada from 2012 to 2014. Sci. Data 2016, 3, 160037. Available online: https://www.nature.com/articles/sdata201637 (accessed on 22 January 2025). [CrossRef]
  8. Makonin, S.; Popowich, F.; Bartram, L.; Gill, B.; Bajić, I.V. AMPds: A public dataset for load disaggregation and eco-feedback research. In Proceedings of the IEEE Electrical Power & Energy Conference, Halifax, NS, Canada, 21–23 August 2013. [Google Scholar] [CrossRef]
  9. Venkateswaran, D.; Cho, Y.; Shin, C. Hybrid LSTM-Markovian model for greenhouse power consumption prediction: A dynamical approach. In The European Physical Journal Special Topics; Springer: Berlin, Germany, 2024. [Google Scholar] [CrossRef]
  10. Da, T.N.; Cho, M.Y.; Thanh, P.N. Hourly load prediction based on feature selection and a hybrid CNN-LSTM method for building’s smart solar microgrid. Expert Syst. 2024, 41, e13539. [Google Scholar] [CrossRef]
  11. Onteru, R.R.; Sandeep, V. An intelligent model for efficient load forecasting and sustainable energy management in sustainable microgrids. Discov. Sustain. 2024, 5, 170. [Google Scholar] [CrossRef]
  12. Gaur, M.; Makonin, S.; Bajić, I.V.; Majumdar, A. Performance evaluation of techniques for identifying abnormal energy consumption in buildings. IEEE Access 2019, 7, 62721–62733. [Google Scholar] [CrossRef]
  13. Decuypere, R.; Robaeyst, B.; Hudders, L.; Baccarne, B.; Van De Sompel, D. Transitioning to energy efficient housing: Drivers and barriers of intermediaries in heat pump technology. Energy Policy 2021, 156, 112709. [Google Scholar] [CrossRef]
  14. Benavente-Peces, C. On the energy efficiency in the next generation of smart buildings—Supporting technologies and techniques. Energies 2019, 12, 4399. [Google Scholar] [CrossRef]
  15. Anh, H.P.H.; Kien, C.V. Optimal energy management of microgrid using advanced multi-objective particle swarm optimization. Eng. Comput. 2020, 37, 2085–2110. [Google Scholar] [CrossRef]
  16. Moghimi, S.M.; Gulliver, T.A.; Chelvan, I.T. Energy management in modern buildings based on demand prediction and machine learning—A review. Energies 2024, 17, 555. [Google Scholar] [CrossRef]
  17. Zupančič, J.; Filipič, B.; Gams, M. Genetic-programming-based multi-objective optimization of strategies for home energy-management systems. Energy 2020, 203, 117769. [Google Scholar] [CrossRef]
  18. Parvin, K.; Lipu, M.H.; Hannan, M.A.; Abdullah, M.A.; Jern, K.P.; Begum, R.A.; Mansur, M.; Muttaqi, K.M.; Mahlia, T.I.; Dong, Z.Y. Intelligent controllers and optimization algorithms for building energy management towards achieving sustainable development: Challenges and prospects. IEEE Access 2021, 9, 41577–41602. [Google Scholar] [CrossRef]
  19. Zhang, Y.; Yuan, L.-J.; Zhang, Q.; Sun, X.-Y. Multi-objective optimization of building energy performance using a particle swarm optimizer with less control parameters. J. Build. Eng. 2020, 32, 101505. [Google Scholar] [CrossRef]
  20. Garces-Jimenez, A.; Gomez-Pulido, J.M.; Gallego-Salvador, N.; Garcia-Tejedor, A.J. Genetic and swarm algorithms for optimizing the control of building HVAC systems using real data: A comparative study. Mathematics 2021, 9, 2181. [Google Scholar] [CrossRef]
  21. Kivanç, Ö.C.; Akgün, B.T.; Bilgen, S.; Öztürk, S.B.; Baysan, S.; Tuncay, R.N. Residential energy management system based on integration of fuzzy logic and simulated annealing. Turk. J. Electr. Eng. Comput. Sci. 2022, 30, 1539–1554. [Google Scholar] [CrossRef]
  22. Xu, X.; Jia, Y.; Xu, Y.; Xu, Z.; Chai, S.; Lai, C.S. A multi-agent reinforcement learning-based data-driven method for home energy management. IEEE Trans. Smart Grid 2020, 11, 3201–3211. [Google Scholar] [CrossRef]
  23. Wang, Z.; Hong, T. Reinforcement learning for building controls: The opportunities and challenges. Appl. Energy 2020, 269, 115036. [Google Scholar] [CrossRef]
  24. ACosic; Stadler, M.; Mansoor, M.; Zellinger, M. Mixed-integer linear programming-based optimization strategies for renewable energy communities. Energy 2021, 237, 121559. [Google Scholar] [CrossRef]
  25. Javanmard, M.E.; Ghaderi, S.F.; Sangari, M.S. Integrating energy and water optimization in buildings using multi-objective mixed-integer linear programming. Sustain. Cities Soc. 2020, 62, 102409. [Google Scholar] [CrossRef]
Figure 1. Flowchart for CSGT load optimization.
Figure 1. Flowchart for CSGT load optimization.
Algorithms 18 00132 g001
Figure 2. Load profiles for the 1-bedroom SGT over 24 h.
Figure 2. Load profiles for the 1-bedroom SGT over 24 h.
Algorithms 18 00132 g002
Figure 3. Load profiles for the 2-bedroom SGT over 24 h.
Figure 3. Load profiles for the 2-bedroom SGT over 24 h.
Algorithms 18 00132 g003
Figure 4. Load profiles for the 3-bedroom SGT over 24 h.
Figure 4. Load profiles for the 3-bedroom SGT over 24 h.
Algorithms 18 00132 g004
Figure 5. Load profiles for the 4-bedroom SGT over 24 h.
Figure 5. Load profiles for the 4-bedroom SGT over 24 h.
Algorithms 18 00132 g005
Figure 6. Aggregated load profiles for the 1-4-Bedroom SGTs over 24 h.
Figure 6. Aggregated load profiles for the 1-4-Bedroom SGTs over 24 h.
Algorithms 18 00132 g006
Figure 7. Base and MOPSO optimized carbon emissions over 24 h.
Figure 7. Base and MOPSO optimized carbon emissions over 24 h.
Algorithms 18 00132 g007
Figure 8. Base and MOPSO optimized operational costs over 24 h.
Figure 8. Base and MOPSO optimized operational costs over 24 h.
Algorithms 18 00132 g008
Figure 9. ML, PSO, MOPSO, and base load results over 24 h.
Figure 9. ML, PSO, MOPSO, and base load results over 24 h.
Algorithms 18 00132 g009
Table 1. Hyperparameter Tuning Results for the LSTM-CNN Model.
Table 1. Hyperparameter Tuning Results for the LSTM-CNN Model.
HyperparameterValuesBest ValueSelection Method
LSTM Units{64, 128, 256}128Grid Search
CNN Kernel Size{3 × 3, 5 × 5}3 × 3Grid Search
Activation Function{Tanh, ReLU}ReLUEmpirical Evaluation
Batch Size{32, 64}64Grid Search
Learning Rate{0.001, 0.0005}0.0005Grid Search
Dropout Rate{0.2, 0.3}0.2Empirical Testing
Optimizer{Adam, RMSprop}AdamEmpirical Testing
Number of Epochs150 (with early stopping)150 (early stop at plateau)Convergence
Early Stopping Patience 10 epochsConvergence
Table 2. Comparison of Optimization Algorithms for Energy Management.
Table 2. Comparison of Optimization Algorithms for Energy Management.
AlgorithmStrengths and ApplicabilityWeaknessesReferencesAverage Execution Time (s)
Genetic Algorithm (GA)Effective for multi-objective optimization and nonlinear problems; suitable for large search spaces.Requires careful parameter tuning; computationally expensive for real-time applications.[17,18]6.21
MOPSOFast convergence; ideal for real-time applications; effectively handles multi-objective problems.Can converge to local optima if not implemented and initialized properly.[15,19,20,21]1.42
Simulated Annealing (SA)Suitable for discrete and continuous problems; simple implementation.Prone to local minima and slow convergence, especially in complex problems.[21]7.89
Reinforcement Learning (RL)Adaptive and can learn optimal strategies over time; suitable for dynamic environments.Requires large datasets and extensive training time.[22,23]15.34
Mixed-Integer Linear Programming (MILP)Provides exact solutions with linear constraints; well-suited to small-scale problems.Computationally expensive and impractical for large-scale, real-time applications.[24,25]23.91
Table 3. Comparison of Predicted and Actual Results.
Table 3. Comparison of Predicted and Actual Results.
ParameterPredictedActualExpected Range
Load (kWh/year)17,000 (15% reduction)20,000 ([7,8])10–20% reduction
Cost Savings (CAD/year)1700 (15% savings)2000 ([8])10–20% reduction
Carbon Emissions (kg C O 2 /year)4250 (15% reduction)5000 ([8])10–20% reduction
Table 4. Comparison of Model Performance.
Table 4. Comparison of Model Performance.
ParameterProposed Model[9][10]
Load Savings15%10%12%
Cost Savings15%8%10%
Carbon Emissions Reduction15%9%10%
MAE (kWh)506055
R 2 0.980.920.95
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Moghimi, S.M.; Gulliver, T.A.; Thirumarai Chelvan, I.; Teimoorinia, H. Adaptive Machine Learning for Automatic Load Optimization in Connected Smart Green Townhouses. Algorithms 2025, 18, 132. https://doi.org/10.3390/a18030132

AMA Style

Moghimi SM, Gulliver TA, Thirumarai Chelvan I, Teimoorinia H. Adaptive Machine Learning for Automatic Load Optimization in Connected Smart Green Townhouses. Algorithms. 2025; 18(3):132. https://doi.org/10.3390/a18030132

Chicago/Turabian Style

Moghimi, Seyed Morteza, Thomas Aaron Gulliver, Ilamparithi Thirumarai Chelvan, and Hossen Teimoorinia. 2025. "Adaptive Machine Learning for Automatic Load Optimization in Connected Smart Green Townhouses" Algorithms 18, no. 3: 132. https://doi.org/10.3390/a18030132

APA Style

Moghimi, S. M., Gulliver, T. A., Thirumarai Chelvan, I., & Teimoorinia, H. (2025). Adaptive Machine Learning for Automatic Load Optimization in Connected Smart Green Townhouses. Algorithms, 18(3), 132. https://doi.org/10.3390/a18030132

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop