Journal of Intelligent Systems and Internet of Things

Early Energy Consumption Prediction as a Key Element in Smart City Sustainability

Fausto Vizcaino Naranjo, Silvio Machuca Vivar, Edmundo Jalon Arias, Reem Atassi
Volume 11, Issue 1, pp. 12-20 (2024)
DOI: https://doi.org/10.54216/JISIoT.110102
Online: https://www.americaspg.com/journal/18/article/2277

Abstract

In the era of smart cities, the pursuit of sustainability stands as a paramount goal, with energy management playing a central role. This paper is dedicated to the exploration of early energy consumption prediction as a linchpin in the realization of sustainable smart cities. Employing advanced long short-term memory (LSTM) networks, we introduce a potent predictive model tailored to anticipate energy consumption patterns within urban environments. Notably, our model achieves remarkable performance metrics, with a root mean square error of 547.71 and a strikingly low mean absolute percentage error (MAPE) of 1.22. Through meticulous comparisons against baseline models, our LSTM-based approach emerges as a beacon of accuracy, reliability, and sustainability. Beyond predictive analytics, our research offers actionable insights for urban planners and policymakers, fostering the creation of greener, more sustainable, and ecologically responsible smart cities that harmonize technological innovation with environmental stewardship. As smart cities continue to evolve, our work lays the foundation for a future where sustainability is not merely a goal but a reality.

Keywords: Smart City Sustainability; Urban Energy Management; Predictive Analytics; Sustainable Urban Planning; Renewable Energy Integration; Data-Driven Sustainability; Resource Optimization; Sustainable Development; Green urban policies

1. Introduction

A smart city represents the convergence of technology, urbanization, and sustainability, redefining the way we live and interact within urban environments. These cities leverage advanced digital technologies, data analytics, and interconnected infrastructure to enhance the quality of life for their residents. Smart cities aim to tackle the numerous challenges posed by rapid urbanization, such as traffic congestion, resource scarcity, and environmental degradation, by promoting efficient resource management and improving the overall urban experience. In an era marked by increasing urbanization trends, the concept of smart cities has gained immense prominence, heralding a new era of urban development and innovation [1].

Energy consumption within smart cities is a pivotal aspect of urban development, given the surging energy demands of densely populated areas. The rapid pace of urbanization has led to heightened energy consumption, posing significant challenges to sustainability and environmental conservation. Managing energy consumption is imperative for the long-term well-being of smart cities, as it directly impacts the availability of resources, economic stability, and the overall quality of life for residents. To address these challenges, it is essential to adopt strategies that optimize energy use and reduce environmental footprints, making energy consumption prediction a crucial component of smart city sustainability initiatives [2].

The concept of sustainability transcends geographical boundaries and resonates globally as an urgent imperative. In a world grappling with environmental degradation, climate change, and resource depletion, the need for sustainable practices has never been more apparent. Sustainability entails responsible resource management and the preservation of natural ecosystems to ensure the well-being of current and future generations. Smart cities, by their very nature, are positioned to play a pivotal role in advancing sustainability goals, given their potential to integrate innovative technologies and data-driven solutions into urban planning. As the world collectively strives for a more sustainable future, smart cities emerge as catalysts for positive change and environmental stewardship. Early energy consumption prediction stands at the forefront of sustainable urban planning in smart cities. Predicting energy consumption is not merely a technical endeavor; it is a strategic imperative that enables cities to allocate resources efficiently, reduce waste, and minimize the environmental impact of energy production. Accurate prediction allows city planners and policymakers to make informed decisions regarding infrastructure development, energy sourcing, and conservation initiatives. Furthermore, early prediction facilitates proactive measures to address energy demands, enhancing the overall resilience and adaptability of smart cities in the face of dynamic urban growth [3].

While smart cities hold great potential for sustainable urban development, there exist critical research gaps in the field of early energy consumption prediction. These gaps limit our ability to harness the full potential of smart city technologies for sustainability. This paper aims to bridge these gaps by exploring the current state of energy consumption prediction in smart cities, identifying challenges, and proposing innovative solutions. By addressing these issues, this research seeks to contribute to the advancement of sustainable urban planning and the realization of greener, more resilient cities. This study revolves around several key research questions and objectives. These include examining the accuracy and effectiveness of existing energy consumption prediction models in smart cities, identifying the barriers to implementation, and proposing enhancements that can lead to more reliable predictions. In addition, we aim to assess the impact of early energy consumption prediction on resource allocation, environmental conservation, and overall sustainability within smart urban environments [4].

In this paper, our investigation unfolds across several key sections, each contributing to a comprehensive understanding of this critical domain. In Section 2, we review the existing literature, highlighting key insights and research efforts that inform our study. Section 3, provides a detailed account of our research approach, encompassing data collection methods, predictive modeling techniques, and analytical tools employed to investigate early energy consumption prediction in smart cities. Moving to Section 4, we describe the specific parameters, datasets, and scenarios used in our experiments to assess the accuracy and effectiveness of our predictive models. In Section 5, we present the outcomes of our research, dissecting the findings and engaging in a comprehensive discussion to illuminate the implications and significance of our results. Finally, in Section 6, we synthesize our study’s contributions.

In this section, we get on a journey through the existing body of literature surrounding early energy consumption prediction and its pivotal role in smart city sustainability. By examining prior research, we aim to contextualize our study, identify gaps, and build on the collective wisdom of the research community. Our exploration encompasses a wide spectrum of works, ranging from predictive modeling techniques to sustainability initiatives within the context of smart urban environments. Abbasabadi and Ashayeri [5] provided a comprehensive review of urban energy use modeling methods and tools. Their work serves as a foundational reference for understanding the complexities of energy consumption modeling in urban environments, which is central to our exploration of early energy consumption prediction in smart cities. Naphade et al. [6] delved into the challenges of innovation in smarter cities. Their insights on innovation challenges are highly relevant as we seek to advance sustainable practices within smart cities through the predictive capabilities discussed in this paper. Sepasgozar [7] presented a conceptual distinction between digital twins and digital shadows, offering insights into the emerging paradigm shift in smart and sustainable built environments. Understanding this paradigm shift is crucial in the context of our exploration of sustainability in smart cities. Wang et al. [8] introduced fuzzy rough set-based sustainable methods for energy-efficient smart city development. Their research is pertinent as it intersects with our aim to optimize energy consumption through predictive modeling in smart urban environments. da Silva et al. [9] conducted a survey of smart city software architectures, providing valuable insights into the technological infrastructure of smart cities. This reference informs our understanding of the technological landscape in which energy consumption prediction operates. Elmi and Tan [10] proposed DeepFEC, a model for energy consumption prediction under real-world driving conditions in smart cities. Their work directly aligns with our focus on predictive modeling and its application in smart city contexts. Nižetić et al. [11] explored smart technologies for promoting energy efficiency and sustainable resource utilization. Their comprehensive review is instrumental in understanding the broader context of sustainability initiatives in smart cities. Berntzen et al. [12] addressed the role of sensors in smart city projects, which is a crucial aspect of data collection and predictive modeling for energy consumption. Their insights are highly relevant to our methodology. Kim [13] developed an integrated smart water grid model for climate-smart cities, showcasing the intersection of multiple sustainability factors in urban environments. This reference provides valuable context for our discussion on sustainability in smart cities.

3. Methodology

In this section, we lay the methodological groundwork that underpins our investigation into early energy consumption prediction as a catalyst for smart city sustainability. Our research journey is propelled by a meticulously designed framework, integrating data collection, preprocessing, modeling, and validation stages. We delve into the intricacies of our approach, revealing the tools, techniques, and strategies harnessed to harness the power of predictive analytics in the realm of urban energy management. As we navigate through each methodological facet, we provide clarity on our data sources, processing methodologies, model architectures, and evaluation criteria.

In our pursuit of early energy consumption prediction, we leveraged state-of-the-art deep learning techniques, particularly long short-term memory (LSTM) networks, renowned for their capacity to capture temporal dependencies in time series data. LSTM, as a type of recurrent neural network, is inherently suited to handle sequential data, making it an ideal candidate for modeling energy consumption patterns in smart cities. Our LSTM-based model was meticulously designed to capture the intricate dynamics of energy consumption, considering both short-term fluctuations and longterm trends. The architecture of our model comprised multiple LSTM layers, facilitating the learning of hierarchically structured patterns within the energy data. In addition, we incorporated dropout layers to mitigate overfitting and enhance model generalization. LSTM networks typically consist of three main gates: The input gate, the forget gate, and the output gate [Figure 1]. Each gate plays a crucial role in determining what information is passed, stored, or discarded at each time step in the sequence.

i w h x b t i t t i O 1 3 § ( [ , ] ) 1 (1)
f w h x b t f t t f O 1 3 § ( [ , ] ) 1 (2) o w h x b t o t t o O 1 . / 3 § 1, (3)

c tanh w h x b t c t t c O 1 3 ( [ , ] ) 1 (4)

 1 − = × + × t t t T t c f c i c (5)

t O ( ) (6) h o tanh c t t

The development of our LSTM-based model was complemented by a rigorous data preprocessing and training phase. We began by preparing our dataset, encompassing 4 years of electrical consumption, generation, pricing, and weather data for Spain, for model ingestion. Data cleaning and transformation were performed to handle missing values, outliers, and standardize data formats, ensuring data integrity.

x min x max x min x

( ) ( ) ( ) (7)

Figure 1. Visualization of long short-term memory cell architecture.
Figure 1. Visualization of long short-term memory cell architecture.

Subsequently, we partitioned the dataset into training, validation, and testing sets to facilitate model training and evaluation. Our LSTM model was then trained on the training set, with the aim of learning the underlying patterns and dependencies within the data. Hyperparameter tuning, including the optimization of learning rates and batch sizes, was conducted to fine-tune model performance. Training was closely monitored using validation data to prevent overfitting. This meticulous approach to data preprocessing and model training culminated in the development of a robust LSTM-based predictive model, poised to unravel the intricacies of energy consumption dynamics in smart cities.

In our quest to develop a high-performing predictive model for energy consumption in smart cities, the choice of an appropriate loss function is pivotal. To this end, we adopted the log cosh loss function, a robust and effective choice for regression tasks, particularly well-suited for our LSTM-based model. The log cosh loss combines the benefits of both mean squared error (MSE) and mean absolute error (MAE) by providing a smooth and differentiable loss curve.

ˆ ( ) Root meansquare error ∑ i i y y

n O 1 1 n y y MAE O 3 i

i i (9)

This characteristic is particularly advantageous in training deep learning models like our LSTM, as it promotes stable convergence during optimization. Moreover, the log cosh loss function is less sensitive to outliers, offering resilience to extreme data points that may occasionally occur in energy consumption datasets. We define the log-cosh loss function as follows:

1 log cosh  (10)

L y y y y p i i ( , ) ( ( )) O 3

The training process of our LSTM-based predictive model hinged on the utilization of the log cosh loss function. During each training epoch, the model iteratively adjusted its parameters to minimize the log cosh loss, aligning its predictions with the ground truth energy consumption values. This training strategy enabled our model to learn and adapt to the complex patterns and temporal dependencies present in the energy consumption data. One notable advantage of the log cosh loss function is its inherent ability to handle both overestimations and underestimations of predictions. It assigns lower penalties to small errors while effectively addressing the influence of outliers. This characteristic is particularly valuable when dealing with energy consumption data, which can exhibit significant variations over time. By employing the log cosh loss function, we aimed to train a model that not only provides accurate predictions but also offers a robust and stable performance across diverse energy consumption scenarios within smart cities, ultimately contributing to the sustainability of urban energy management.

4. Experimental Setups

In this section, we delve into the intricacies of our experimental configurations, designed to rigorously assess the performance and reliability of our early energy consumption prediction models within the context of smart city sustainability. As we navigate the path toward a greener tomorrow, it is imperative to subject our predictive models to rigorous testing, scrutinizing various parameters and real-world scenarios. Through a meticulously designed set of experiments, we aim to shed light on the efficacy of our models in predicting energy consumption accurately, ensuring their practical applicability and relevance in the dynamic landscape of smart urban environments. The experimental configurations presented herein encompass an array of factors, ranging from dataset selection to predictive model evaluation criteria, all of which collectively contribute to the robustness and comprehensiveness of our investigation [12-14].

To ensure the robustness and reliability of our experiments, we meticulously designed the implementation setup, encompassing the following key components. The hardware environment for our experiments was carefully selected to mimic real-world conditions and facilitate the execution of computationally intensive predictive modeling tasks. We employed a high-performance computing cluster comprising Intel Xeon CPU, NVIDIA RTX 2060 GPU, 256 RAM to ensure efficient processing of the data and model computations. This configuration enabled us to handle the complexities associated with large-scale datasets and predictive algorithms. The software framework utilized in our experiments was chosen to support various aspects of data processing, model development, and evaluation. We employed Python, TensorFlow, and scikit-learn for data preprocessing, predictive model development, and result analysis.

Our experiments were conducted using a diverse and representative set of datasets sourced from [14]. The dataset utilized in this study encompasses a span of 4 years and encompasses a rich repository of information encompassing electrical consumption, generation, pricing, and meteorological data specifically pertaining to Spain. The electrical consumption and generation data were sourced from ENTSOE, a publicly accessible transmission service operator (TSO) data repository. Settlement prices, vital for market analysis, were procured from the authoritative Spanish TSO known as Red Electric España. Furthermore, weather data were secured as part of an independent project from the Open Weather API, covering meteorological parameters for the five largest cities within Spain. It is important to note that this weather data were subsequently made publicly available for research purposes. This dataset, characterized by its comprehensive nature and relevance to the Spanish energy landscape, served as the cornerstone of our empirical analysis, facilitating the evaluation and validation of our early energy consumption prediction models in the context of a real-world energy market scenario. Cross-validation techniques were employed where applicable to mitigate overfitting and optimize model generalization. A sample of training data is given in Table 1.

5. Results and Discussion

In this pivotal section, we unveil the culmination of our empirical journey, where theory and practice converge to illuminate the effectiveness of early energy consumption prediction within the intricate landscape of smart city

Table 1. Sample training data for early energy consumption prediction
Table 1. Sample training data for early energy consumption prediction

0 1 2 3 4

Price actual 65.41 64.92 64.48 59.32 56.04 sustainability. Here, we present the results of our experiments, bringing forth quantitative and qualitative insights derived from rigorous assessments of our predictive models.

In Figure  2, we present a visualization of the autocorrelation analysis, a crucial component of our methodology. Autocorrelation, also known as serial correlation, explores the relationship between a time series dataset and its lagged versions, providing essential insights into the temporal dependencies within the data. By visualizing the autocorrelation function, we aim to uncover patterns, seasonality, and potential predictive lags in our energy consumption data. This analysis serves as a fundamental step in understanding the underlying dynamics of energy consumption in smart cities, laying the groundwork for the subsequent development and validation of our predictive models. The patterns and trends revealed through this visualization are pivotal in informing the predictive accuracy of our models, as they help identify temporal factors that may influence energy consumption patterns over time.

In Figure 3, we provide a visual representation of the partial autocorrelation analysis, a crucial element within our analytical framework. Partial autocorrelation analysis enables us to explore the direct relationship between observations at different time lags while controlling for the effects of intermediate lags. By visualizing the partial autocorrelation function, we aim to uncover and isolate specific time lags that have the most significant influence on energy consumption patterns. This analysis is indispensable in identifying the most relevant features for our predictive models and determining the optimal lag order for time series forecasting. The insights gained from this visualization contribute to the refinement of our early energy consumption prediction models, enhancing their accuracy and predictive capabilities.

In Figure 4, we present a crucial visualization that encapsulates the essence of our research efforts — the prediction versus actual curve. This figure provides a visual representation of the performance of our early energy consumption prediction models in contrast to the actual observed energy consumption data. By overlaying our model’s predictions with the real-world data, we offer a comprehensive evaluation of the model’s predictive accuracy. This comparative analysis allows us to assess the model’s ability to capture and forecast energy consumption patterns in smart cities accurately. Figure  4 is pivotal in establishing the practical applicability and real-world impact of our research, emphasizing the role of predictive modeling in shaping a greener and more sustainable tomorrow for smart cities.

To gauge the predictive prowess of our LSTM-based model for early energy consumption prediction in smart cities, we conducted a rigorous comparative analysis against established baseline models commonly used in time series forecasting tasks. The primary metrics used for evaluation include root mean square error (RMSE) and mean absolute percentage error (MAPE). These metrics serve as reliable indicators of predictive accuracy and generalization performance. In our experimental evaluations, our LSTM-based model outperformed the baseline models by a substantial margin, showcasing its robustness and efficacy in capturing complex energy consumption patterns. The RMSE values, which measure the average prediction error, ranged significantly lower at 547.71, compared to the baselines. This suggests that our model excels in providing more accurate predictions of energy consumption, ensuring that urban energy resources are optimally allocated. Furthermore, the MAPE results, reflecting the percentage error in our predictions, stood impressively low at 1.22. This demonstrates that our LSTM-based model offers high precision and reliability in forecasting energy consumption trends, which is paramount for sustainable energy management in smart cities. By achieving these exemplary RMSE and MAPE values, our model solidifies its position as a valuable tool for enhancing energy efficiency and sustainability within urban environments, offering a substantial improvement over traditional forecasting techniques [Table 2].

Figure 2. Autocorrelation analysis visualization.
Figure 2. Autocorrelation analysis visualization.
Figure 3. Partial autocorrelation analysis visualization.
Figure 3. Partial autocorrelation analysis visualization.
Table 2. Comparative performance of predictive models
Table 2. Comparative performance of predictive models

Model RMSE MAPE

RF 740.89 1.86

RMSE: Root mean square error, MAPE: Mean absolute percentage error

Figure 4. Prediction versus actual energy consumption curve.
Figure 4. Prediction versus actual energy consumption curve.

6. Conclusions

In this paper, we have embarked on a transformative journey into the realm of smart city sustainability, with a specific focus on the pivotal role of early energy consumption prediction. By developing and rigorously evaluating an LSTM-based predictive model, we have demonstrated the potential to revolutionize urban energy management. Our model’s remarkable performance, with an RMSE of 547.71 and an impressively low MAPE of 1.22, underscores its precision and reliability in capturing complex energy consumption patterns. These findings reaffirm the significance of predictive analytics in achieving sustainable energy utilization within smart cities, laying the foundation for optimized resource allocation, and reduced environmental impact.

The implications of our research are far-reaching, with the potential to reshape the future of urban sustainability. Through the fusion of cutting-edge technologies like LSTM networks and the insightful analysis of energy data, we have presented a compelling case for smarter, more efficient, and greener urban environments. As we stand at the cusp of an increasingly urbanized world, our work serves as a beacon of hope, offering actionable insights to city planners, policymakers, and stakeholders, guiding them toward a more sustainable, resilient, and energy-efficient tomorrow. In harnessing the power of early energy consumption prediction, we stride towards a future where smart cities harmonize with nature, forging a path towards a greener and more sustainable world for generations to come.

References

  1. [1] D. Gonçalves, Y. Sheikhnejad, M. Oliveira, and N. Martins, “One Step Forward toward Smart City Utopia: Smart Building Energy Management based on Adaptive Surrogate Modelling,” Energy and Buildings, vol. 223, p. 110146, 2020, doi: 10.1016/j.enbuild.2020.110146 [2] A. T. Hoang, and X. P. Nguyen, “Integrating Renewable Sources into Energy System for Smart City as a Sagacious Strategy towards Clean and Sustainable Process,” Journal of Cleaner Production, vol. 305, p. 127161, 2021, doi: 10.1016/j.jclepro.2021.127161 [3] M. Zekić-Sušac, S. Mitrović, and A. Has, “Machine Learning based System for Managing Energy Efficiency of Public Sector as an Approach towards Smart Cities,” International Journal of Information Management, vol. 58, p. 102074, 2021, doi: 10.1016/j.ijinfomgt.2020.102074 [4] A. Almadhor, K. Mallikarjuna, R. Rahul, G. Chandra Shekara, R. Bhatia, W. Shishah, and S. P. Thimothy, “Solar Power Generation in Smart Cities Using an Integrated Machine Learning and Statistical Analysis Methods,” International Journal of Photoenergy, vol. 2022, p. 5442304, 2022, doi: 10.1155/2022/5442304 [5] N. Abbasabadi, and M. Ashayeri, “Urban Energy Use Modeling Methods and Tools: A Review and an Outlook,” Building and Environment, vol. 161, p. 106270, 2019, doi: 10.1016/j.buildenv.2019.106270 [6] M. Naphade, G. Banavar, C. Harrison, J. Paraszczak, and R. Morris, “Smarter Cities and Their Innovation Challenges,” Computer, vol. 44, no. 6, pp. 32-39, 2011. [7] S. M. Sepasgozar, “Differentiating Digital Twin from Digital Shadow: Elucidating a Paradigm Shift to Expedite a Smart, Sustainable Built Environment,” Buildings, vol. 11, no. 4, p. 151, 2021. doi: 10.3390/buildings11040151 [8] X. Wang, Q. Chen, and J. Wang, “Fuzzy Rough Set based Sustainable Methods for Energy Efficient Smart City Development,” Journal of Intelligent and Fuzzy Systems, vol. 40, no. 4, pp. 8173-8183, 2021. doi: 10.3233/JIFS-189640 [9] W. M. da Silva, A. Alvaro, G. H. Tomas, R. A. Afonso, K. L. Dias, and V. C. Garcia, Smart Cities Software Architectures: A Survey. In: “Proceedings of the 28th Annual ACM Symposium on Applied Computing,” pp. 1722-1727, Mar. 2013. [10] S. Elmi, and K. L. Tan. Deep FEC: Energy Consumption Prediction Under Real-world Driving Conditions for Smart Cities, In: “Proceedings of the Web Conference 2021,” pp. 1880-1890, Apr. 2021. [11] S. Nižetić, N. Djilali, A. Papadopoulos, and J. J. Rodrigues, “Smart Technologies for Promotion of Energy Efficiency, Utilization of Sustainable Resources and Waste Management,” Journal of Cleaner Production, vol. 231, pp. 565-591, 2019. doi: 10.1016/j.jclepro.2019.04.397 [12] L. Berntzen, M. R. Johannessen, and A. Florea, Sensors and the Smart City: Creating a Research Design for Sensor-based Smart City Projects, In: “ThinkMind//SMART 2016, The Fifth International Conference on Smart Cities, Systems, Devices and Technologies,” 2016. [13] K. G. Kim, “Development of An Integrated Smart Water Grid Model as a Portfolio of Climate Smart Cities,” Journal of Smart Cities, vol. 3, no. 1, pp. 23-34, 2019. [14] Available from: https://transparency.entsoe.eu/dashboard/show [Last accessed on 2023 Jun 11].