###### Abstract  
Accurate prediction from electricity demand models is helpful in controlling and optimizing building energy performance. The application of machine learning techniques to adjust the electrical consumption of buildings has been a growing trend in recent years. Battery management systems through the machine learning models allow a control of the supply, adapting the building demand to the possible changes that take place during the day, increasing the users' comfort, and ensuring greenhouse gas emission reduction and an economic benefit. Thus, an intelligent system that defines whether the storage system should be charged according to the electrical needs of that moment and the prediction of the subsequent periods of time is defined. Favoring consumption in the building in periods when energy prices are cheaper or the renewable origin is preferable. The aim of this study was to obtain a building electrical energy demand model in order to be combined with storage devices with the purpose of reducing electricity expenses. Specifically, multilayer perceptron neural network models were applied, and the battery usage optimization is obtained through mathematical modelling. This approach was applied to a public office building located in Bangkok, Thailand. b  
D. E.-O. Optimization of the Electrical Demand of an Existing Building with Storage Management through Machine Learning Techniques  
electrical network fluctuates throughout the day according to generation needs, to meet consumption. Generally, periods with renewable energy correspond to periods with lower prices [9]. The European Union recognizes the development of batteries as a strategic value chain to obtain a prosperous and neutral economy from the point of view of global warming [10]. By means of a storage management system, supply control is optimized by adapting demand to possible changes that may appear throughout the day, favoring consumption in the building in periods when energy prices are cheaper or of renewable origin [11] and supplying power in possible unexpected grid outages [12]. The development of a good battery energy control system allows the achievement of a building with a high quality of energy use [13]. The management system can be more complex in case of considering the production of renewable energy in the same building, the charging of electric vehicles, or a combination of factors, reducing the electrical needs on the electrical network and achieving a nearly zero energy building [14]. In [15] an analysis of the impact of different battery parameters, as capacity, charge/discharge rate, power request process, and cost function, on the cost savings using different energy storage algorithms is performed. In [16] an analysis of the savings, efficiency and emissions in three scenarios with storage using a mathematical optimization was performed. It is shown that the storage system can generate great benefits in each of the fields of study. In [17] an intelligent system of a microgrid with photovoltaic, storage, hybrid vehicle and electrical network was proposed. The control algorithm shows a benefit in reducing demand, maximizing user comfort and minimizing energy costs. There are diverse models of optimization of the battery management system, often consisting of a multiobjective problem. Some of the most used algorithms to solve problems in the field are genetic algorithms [18], linear programming [19], mixed-integer linear programming [20], mixed-integer quadratic programming [21], nonlinear programming [22], mixed-integer nonlinear programming [23], convex programming [24], and reinforcement learning [25]. Accurately recognizing fluctuations in electrical demand, in building, is a key step in optimizing the performance of the storage management system. There are different methods that are developed to know the energy demand. Among them are the white box, through physical modelling; black box, through data driven modelling; and grey box, through the combination of previous models [26].