Predicting the Energy Consumption of a Robot in an Exploration Task Using Optimized Neural Networks

: This paper deals with the problem of determining a useful energy budget for a mobile robot in a given environment without having to carry out experimental measures for every possible exploration task. The proposed solution uses machine learning models trained on a subset of possible exploration tasks but able to make predictions on untested scenarios. Additionally, the proposed model does not use any kinematic or dynamic models of the robot, which are not always available. The method is based on a neural network with hyperparameter optimization to improve performance. Tabu List optimization strategy is used to determine the hyperparameter values (number of layers and number of neurons per layer) that minimize the percentage relative absolute error (%RAE) while maximize the Pearson correlation coefﬁcient (R) between predicted data and actual data measured under a number of experimental conditions. Once the optimized artiﬁcial neural network is trained, it can be used to predict the performance of an exploration algorithm on arbitrary variations of a grid map scenario. Based on such prediction, it is possible to know the energy needed for the robot to complete the exploration task. A total of 128 tests were carried out using a robot executing two exploration algorithms in a grid map with the objective of locating a target whose location is not known a priori by the robot. The experimental energy consumption was measured and compared with the prediction of our model. A success rate of 96.093% was obtained, measured as the percentage of tests where the energy budget suggested by the model was enough to actually carry out the task when compared to the actual energy consumed in the test, suggesting that the proposed model could be useful for energy budgeting in actual mobile robot applications.


Introduction
Energy consumption is a key issue for mobile robotics [1]. Many mobile robots are currently deployed on industrial scenarios, and many more are expected to be in operation in the near future. Typically, like in shipping warehouses, these robots are powered by batteries and are required to autonomously search for and move objects from one location to another. It is important that these robots accomplish their jobs in an energy efficient and secure way [2], so productivity will not be affected due to a robot depleting its batteries in the middle of an assignment [3,4] Battery management becomes then a critical aspect in the operation of these robots [5]. Having a mechanism to compute the energy than the robot will require to finish a particular job will be a useful tool for a battery management system [6], allowing a smoother scheduling of the available robots.
Different approaches for predicting energy consumption in mobile robotics can be currently found in the literature. For example, by applying terramechanical models on deformable terrains [7]. However, in industrial applications, robots commonly move on surfaces with little or no deformation. Other state of the art model presented in [2,[8][9][10][11][12][13] consider the energy requirements of several of its components to make the energy prediction and/or power analysis. For his part [8] proposes that the robot calculates and predicts energy consumption by considering three main factors: the sensor system, the control system and the motion system. A mathematical model is developed for each of those factors and the relationship between the three systems is elaborated using explicit formulas. The calculations are related to the speed of the robot and the characteristics of the robot itself.
"Usually, energy consumption modeling for industrial robots is based on dynamic parameters identification. However, since the parts of industrial robots are not easy to be disassembled and the sensor modules cannot be installed easily inside robots, it is difficult to obtain all such physical parameters through sensing method, in particular the torque data" [14]. In this context, [14] proposes a practical method of energy modeling by measuring the total power consumed by the robots, thus avoiding the problem of directly measuring the relevant parameters within the robots. The experimental results of [14] show that the proposed energy modeling method can be used to predict the energy consumption of the robot.
Therefore, the lack of availability of the robot model on many occasions, the large number of variables and parameters that are required to know to build a dynamic and/or kinematic model and the particularity of the existing models, are problems that must be addressed.
For their part, scientists from Stanford University, the Massachusetts Institute of Technology and the Toyota Research Institute applied machine learning models to predict how many more cycles each battery could last. The combination of experimental data and artificial intelligence revealed the key to diagnose and predict the condition of batteries. The results obtained from the predictions were correct 95 percent of the time. This method of machine learning speeds up and reduces research costs [15].
In this work, we propose an energy consumption estimation approach that does not need an explicit dynamic or kinematic model of the robot. In STAGE 1, a machine learning predictor of the performance (number of movements needed to finish the task) of the particular exploration algorithm employed by the robot is created. Next, in STAGE 2, a linear model relates the electrical discharge in the robot's battery with the variable predicted in STAGE 1, thus estimating the energy needed for the robot to finish the task using that particular exploration algorithm. The core of the proposed method is a machine learning system with supervised training which exploits our previous work in [16][17][18].
For the work presented here, the correlation coefficient (R), which computes the similarity between actual measurements and predicted data, and the Percentage Relative Absolute Error (%RAE), which computes the difference between measured values and their estimates but relative to the magnitude of the measured values, were selected as evaluation metrics for the predictive model in STAGE 1. This is consistent with the metrics used for evaluation in our previous related works described in [16][17][18].
The results in [17,18] show that machine learning models can estimate well the performance of robot exploration algorithms, both deterministic and non-deterministic, for untested experimental conditions. These previous results also demonstrated that among the machine learning techniques that were considered, Artificial Neural Networks (ANNs) attained better prediction performance. These previous works also evidenced that when comparing the Bayesian Regularization training algorithm with other training algorithms such as Levenberg-Marquardt and Scaled conjugate gradient, prediction error was reduced. In [16,18] it was shown that the proposed method works well not only for non-deterministic exploration algorithms, such as Random Walk (RW) and Random Walk without step (RW_WSB), but also for other exploration algorithms such as Q_Learning, which, after training, have a deterministic behavior.
The work in [19] defines the optimization of a problem P, as: "the task of looking for parameter values that applied to P, satisfy certain expectations. For each problem P, an objective function f that measures the suitability of each possible solution of P is defined. The domain of f, that is, the set of points that can be proved as a solution to the problem, is called the space of solutions S. In an optimization problem, it is possible to find many areas of S with relatively good solutions (local optimums), while a single area of S, or a few ones in the best case, provide the best overall solution (global optimum)". Under this definition, Tabu list optimization is proposed to search the ANN topology (i.e., number of layers and number of neurons per layer) that maximizes R and minimizes %RAE. This metaheuristic method was selected because it has proven its effectiveness in combinatorial approaches with ANNs [20], despite there are other optimization algorithms applied to similar problems, such as the Grey wolf optimizer which is used in [21] to tune PI-fuzzy controllers with a reduced process parametric sensitivity. It is also used in [22] to tune a second order intelligent proportional-integral fuzzy control of twin rotor aerodynamic systems. Other recent optimization algorithm is the Island-based cuckoo search with highly disruptive polynomial mutation which mimics the nesting and parasitic reproduction behaviors of some species of cuckoo (CS) and includes improved variation to empower its capability to control the diversity of its population and tries to improve the exploration of the CS [23].
The remainder of this document is organized as follows: Section 2 describes the experimental setup; Section 3 explains the implemented method; in Section 4 experimental results are presented and discussed and finally, Section 5 contains the conclusions.

Experimental Setup
The industrial environments, such as warehouses, where mobile robots are currently being deployed are typically setup to favor straight line movements, with intersections as turning points and some sort of guiding lines, either physical, radio frequency or other, to mark the possible paths for the robots [4]. Therefore, for this work we selected a test scenario based on a two-dimensional grid, where a robot (iRobot Create 2) [24] explores the grid by moving from intersection to intersection limited to four directions: up, down, left or right, until it locates a target (colored square on the floor) whose location is unknown a priori by the robot, as shown in Figure 1a,b. The following variables are used to setup the grid: id size, target location, number of obstacles and their locations, exploration algorithm. The robot's staring point is fixed to the upper-left corner of the grid. is called the space of solutions S. In an optimization problem, it is possible to find many areas of S with relatively good solutions (local optimums), while a single area of S, or a few ones in the best case, provide the best overall solution (global optimum)". Under this definition, Tabu list optimization is proposed to search the ANN topology (i.e., number of layers and number of neurons per layer) that maximizes R and minimizes %RAE. This metaheuristic method was selected because it has proven its effectiveness in combinatorial approaches with ANNs [20], despite there are other optimization algorithms applied to similar problems, such as the Grey wolf optimizer which is used in [21] to tune PI-fuzzy controllers with a reduced process parametric sensitivity. It is also used in [22] to tune a second order intelligent proportional-integral fuzzy control of twin rotor aerodynamic systems. Other recent optimization algorithm is the Island-based cuckoo search with highly disruptive polynomial mutation which mimics the nesting and parasitic reproduction behaviors of some species of cuckoo (CS) and includes improved variation to empower its capability to control the diversity of its population and tries to improve the exploration of the CS [23]. The remainder of this document is organized as follows: Section 2 describes the experimental setup; Section 3 explains the implemented method; in Section 4 experimental results are presented and discussed and finally, Section 5 contains the conclusions.

Experimental Setup
The industrial environments, such as warehouses, where mobile robots are currently being deployed are typically setup to favor straight line movements, with intersections as turning points and some sort of guiding lines, either physical, radio frequency or other, to mark the possible paths for the robots [4]. Therefore, for this work we selected a test scenario based on a two-dimensional grid, where a robot (iRobot Create 2) [24] explores the grid by moving from intersection to intersection limited to four directions: up, down, left or right, until it locates a target (colored square on the floor) whose location is unknown a priori by the robot, as shown in Figure 1a  Two microprocessors (Arduino nano and Raspberry Pi 3) are added to the Create 2, connected by a communication cable to the robot's internal controller in order to provide additional sensors and computing capabilities, see Figure 2a,b. A color sensor (TCS3200) is connected to the Arduino nano to check for the target square at the current intersection reached by the robot, see Figure 2b. When the target is detected, a signal is sent from the Arduino to the Raspberry Pi, indicating that the target has been located. Additionally, two optical-reflective sensors (TCRT5000) see Figure 2c, are connected to the Raspberry Pi Two microprocessors (Arduino nano and Raspberry Pi 3) are added to the Create 2, connected by a communication cable to the robot's internal controller in order to provide additional sensors and computing capabilities, see Figure 2a,b. A color sensor (TCS3200) is connected to the Arduino nano to check for the target square at the current intersection reached by the robot, see Figure 2b. When the target is detected, a signal is sent from the Arduino to the Raspberry Pi, indicating that the target has been located. Additionally, two optical-reflective sensors (TCRT5000) see Figure 2c, are connected to the Raspberry Pi computer to implement a line following function. Square grids with various sizes: 3 × 3, Regarding software, the Raspberry Pi has the Raspbian operating system installed and the Python programming language was used to implement the exploration algorithms, communications, control and sensing on the robot; the code is available at [25]. Python was selected because of the availability of the PyCreate2 library [26] which facilitates the communication between the Raspberry Pi and the robot to program the exploration algorithms. Likewise, an Arduino program is used to implement the algorithm that detects the target square.
On the other hand, the neural networks and optimization algorithms were implemented in Matlab and the code is available at [27].
Taking into account that we worked with a small database, the data processing did not have special memory requirements. A computer with a 1.8 GHz Intel Core i7 processor (Intel, Santa Clara, CA, USA), with 8 GB of RAM and a 64-bit operating system was used to perform the neural network training in 20 h. It should be noted that network training is a one-time process. Once the model is obtained, a prediction takes approximately 1 s to 2 s to execute.

Method
Artificial neural networks are a computational model that consists of a set of artificial neurons connected to each other to transmit signals. Each neuron is connected to others Regarding software, the Raspberry Pi has the Raspbian operating system installed and the Python programming language was used to implement the exploration algorithms, communications, control and sensing on the robot; the code is available at [25]. Python was selected because of the availability of the PyCreate2 library [26] which facilitates the communication between the Raspberry Pi and the robot to program the exploration algorithms. Likewise, an Arduino program is used to implement the algorithm that detects the target square.
On the other hand, the neural networks and optimization algorithms were implemented in Matlab and the code is available at [27].
Taking into account that we worked with a small database, the data processing did not have special memory requirements. A computer with a 1.8 GHz Intel Core i7 processor (Intel, Santa Clara, CA, USA), with 8 GB of RAM and a 64-bit operating system was used to perform the neural network training in 20 h. It should be noted that network training is a one-time process. Once the model is obtained, a prediction takes approximately 1 s to 2 s to execute.

Method
Artificial neural networks are a computational model that consists of a set of artificial neurons connected to each other to transmit signals. Each neuron is connected to others through links. In these links the output value of the previous neuron is multiplied by Electronics 2021, 10, 920 5 of 19 a weight value that can increase or inhibit the activation state of the adjacent neurons. Similarly, at the output of the neuron, there may be a non-linear activation function, which modifies the result value or imposes a limit that must not be exceeded before propagating to following neurons. These systems are trained by minimizing a loss function that compares known outputs against the current outputs of the network. The values of the weights of the neurons are updated seeking to reduce the value of the loss function [28]. These systems are widely applied in areas where the detection of solutions is difficult to express with conventional programming.
The results presented in [16][17][18] demonstrated that a system based on machine learning using ANN with Bayesian regularization predicts well the performance of exploration algorithms applied to mobile robotics. In particular, such ANN model can estimate the maximum number of steps that the robot will spend to locate the target in a two-dimensional grid, given the following inputs: grid size, number of obstacles and the target location. Two purposely built databases [29,30] are used to train, validate and test an ANN model with supervised learning.
In [16,18] different optimization strategies for the ANN model architecture were compared: hand tuning, Hill Climbing, Hill Climbing-Random Restart and Tabu List; concluding that Tabu list converges faster than the others and delivers the best performing ANN architecture [16].
Tabu List is a mathematical optimization method, belonging to the class of local search techniques. The Tabu List increases the performance of the local search method by using memory structures: once a potential solution is determined, it is marked as "Tabu" so that the algorithm does not revisit that possible solution [31].
The parameters of the optimization algorithm that are selected by the user are: Maximum number of iterations and stop condition. This last parameter is the allowed error value and is selected taking as a reference the R and% RAE values to be improved. Other parameters such as: Starting point of the search for local minimums (for the case of% RAE) or local maximums (for the case of R) are random.
The block diagram in Figure 3 shows our proposed system to use the ANN model introduced above for the prediction of the energy consumption of a robot in an exploration task. The process consists of two stages: STAGE 1 is responsible for training a predictive model based on an ANN with Tabu list-based hyperparameter optimization to obtain maximum R and minimum %RAE. This stage was developed in previous works referenced in [15][16][17] and the contribution for the present work is in the next stage. In STAGE 2, the predictions made by the trained model for a particular test scenario are used as input for computing, through a battery electrical discharge model, the energy required to successfully complete the search task.

STAGE 1. Training of the exploration performance prediction model (nonlinear model):
The process is initiated with data collection to obtain a database with which to carry out the supervised training of the neural network, as well as the validation and testing of the resulting prediction model. The dataset for training and validation of the optimized artificial neural network to predict the performance of the exploration algorithm Random Walk is available at [29] and for the exploration algorithm Random Walk_WSB is available at [30]. The characteristics of the dataset are described in Table 1. The process is initiated with data collection to obtain a database with which to 253 carry out the supervised training of the neural network, as well as the validation and test-254 ing of the resulting prediction model. The dataset for training and validation of the op-255 timized artificial neural network to predict the performance of the exploration algorithm 256 Random Walk is available at [29] and for the exploration algorithm Random Walk_WSB 257 is available at [30]. The characteristics of the dataset are described in Table 1   After obtaining the database, the ANN is trained using the Bayesian regularization algorithm. During each iteration, the evaluation metrics, %RAE and R, are calculated. Subsequently, the stop conditions are evaluated. If these are not fulfilled then a new cycle executes the Tabu list optimization algorithm to propose new hyperparameters (number of layers and number of neurons per layer) to carry out a new training and validation cycle of the ANN. This iterative algorithm is completed when the stop conditions are met.
In the previous work [16], Tabu List algorithm is proposed to solve an optimization problem that consists of searching for the ANN topology that minimizes %RAE and, at the same time, maximizes the Pearson correlation coefficient (R) between the predicted data and the actual data in a number of experimental conditions. The Tabu list optimization algorithm calculates the number of layers and neurons per layer that maximizes the performance of the neural network for one or two layers and therefore, gets the best descriptive metrics of system behavior.
increases the chances of finding the global optimum using Tabu list.
"To ensure that optimization algorithms include single and two-layer neural network structures, we vary the number of neurons in layer two between zero and twenty (0-20). Then, if a local optimum is found in the zero column of the search grid, it means that the structure of the neural network is single layer. Variations with respect to the rows of the zero column between one and twenty (1)(2)(3)(4)(5)(6)(7)(8)(9)(10)(11)(12)(13)(14)(15)(16)(17)(18)(19)(20) determine the number of neurons in layer 1 when these structures are presented. For example, for the coordinate (20, 0) shown in Figure 4, a structure of 20 neurons in layer 1 and zero neurons in layer 2 (structure that does not have layer 2) is tested, obtaining a prediction model which is evaluated according to the metrics (% RAE and R) defined. Now, for the coordinate (20, 10) of the same figure a neural network structure of 20 neurons in layer 1 and 10 neurons in layer 2 is tested" [16]. According to the results in [16], Tabu List converges faster than Hill Climbing when used to optimize the hyperparameters of the ANN. This result was verified with the simulations performed for this work. Both, Hill Climbing and Tabu List, reach about the same optimal value for the target metric, but Tabu list does it faster as shown in Figure 5. In general, the comparison of the resulting evaluation metrics evidences that the proposed Tabu list optimization method definitely have a significant and positive impact on model performance. "To ensure that optimization algorithms include single and two-layer neural network structures, we vary the number of neurons in layer two between zero and twenty (0-20). Then, if a local optimum is found in the zero column of the search grid, it means that the structure of the neural network is single layer. Variations with respect to the rows of the zero column between one and twenty (1)(2)(3)(4)(5)(6)(7)(8)(9)(10)(11)(12)(13)(14)(15)(16)(17)(18)(19)(20) determine the number of neurons in layer 1 when these structures are presented. For example, for the coordinate (20, 0) shown in Figure 4, a structure of 20 neurons in layer 1 and zero neurons in layer 2 (structure that does not have layer 2) is tested, obtaining a prediction model which is evaluated according to the metrics (% RAE and R) defined. Now, for the coordinate (20, 10) of the same figure a neural network structure of 20 neurons in layer 1 and 10 neurons in layer 2 is tested" [16].
According to the results in [16], Tabu List converges faster than Hill Climbing when used to optimize the hyperparameters of the ANN. This result was verified with the simulations performed for this work. Both, Hill Climbing and Tabu List, reach about the same optimal value for the target metric, but Tabu list does it faster as shown in Figure 5. In general, the comparison of the resulting evaluation metrics evidences that the proposed Tabu list optimization method definitely have a significant and positive impact on model performance.
By replicating the experiment in [16], the optimal structure obtained is presented in Table 2.
A %RAE of 2.55 and an R very close to 1 suggest a very reliable predictor for the RW exploration algorithm using a [19:19] structure for the ANN, that is, a first hidden layer with 19 neurons and a second hidden layer with 19 neurons as is shown in Figure 6.
For its part, for the case of the RW_WSB exploration algorithm, a % RAE of 3.31 was obtained with an R very close to 1, when the structure of the ANN is [18:20], that is, a first hidden layer with 18 neurons and a second hidden layer with 20 neurons as is shown in Figure 7. By replicating the experiment in [16], the optimal structure obtained is presented in Table 2. A %RAE of 2.55 and an R very close to 1 suggest a very reliable predictor for the RW exploration algorithm using a [19:19] structure for the ANN, that is, a first hidden layer with 19 neurons and a second hidden layer with 19 neurons as is shown in Figure 6.   By replicating the experiment in [16], the optimal structure obtained is presented in Table 2. A %RAE of 2.55 and an R very close to 1 suggest a very reliable predictor for the RW exploration algorithm using a [19:19] structure for the ANN, that is, a first hidden layer with 19 neurons and a second hidden layer with 19 neurons as is shown in Figure 6.  For its part, for the case of the RW_WSB exploration algorithm, a % RAE of 3.31 was obtained with an R very close to 1, when the structure of the ANN is [18:20], that is, a first hidden layer with 18 neurons and a second hidden layer with 20 neurons as is shown in Figure 7. To take advantage of the ability of ANNs to learn complex or non-linear relationships between variables, sigmoidal activation functions are used for the neurons of the hidden layers. An identity activation function is used in the output layer, as usually done in regression tasks.   To take advantage of the ability of ANNs to learn complex or non-linear relationships between variables, sigmoidal activation functions are used for the neurons of the hidden layers. An identity activation function is used in the output layer, as usually done in regression tasks.

STAGE 2. Energy estimation model (linear model):
The ANN model is then used to predict the maximum number of steps (one step is a single displacement between adjacent intersections), Max_NS, required for the robot to complete the navigation task for a particular environment configuration. Max_NS is then used as input to a discharge battery model to obtain the desired energy budget.
To complete this task, we determined experimentally an electric discharge model for the robot's battery. With the battery fully charged, the robot moved across the grid describing a pentagonal trajectory. The battery voltage and stored charge measurements are taken every five seconds. This experiment was replicated 2 times (Experiment 1, replicate 1 and replicate 2). In a second experiment the robot moved across the grid on a four-step square path that was repeated until the battery was completely discharged. This square trajectory is considered the worst case power consumption scenario because at each grid intersection the robot has to make a 90 degree turn. In actual exploration tasks most paths do not require turns at every step. Battery voltage and stored charge measurements are taken at every intersection. This experiment was replicated 2 times (Experiment 2, replicate 1 and replicate 2). As shown in Figure 8, a very linear behavior was observed in the electrical discharge of the battery during its operation, therefore, it is to be expected to obtain an adjusted linear model that shows a correlation coefficient very close to one. The measured experimental data are referenced in [32,33].
The discharge behavior of the robot's battery, shown in Figure 8, fits very well a linear model: with a Correlation Coefficient of −0.999978 and a R 2 of 99.9955%. Then, every 5 s there is a loss of charge of 0.56 mAh on the robot's battery. The battery voltage remains very close to 15 volts with a deviation of approximately ±1 volt in the initial and final part of the discharge curve as shown in Figure 9.
The discharge behavior of the robot's battery, shown in Figure 8, fits very well a linear model:  The battery voltage remains very close to 15 volts with a deviation of approximately ±1 volt in the initial and final part of the discharge curve as shown in Figure 9.    Theoretically, at a constant speed (10 m/s) and a constant distance between the inter-385 sections of the grid (40 cm), the time spent by the robot taking a single step is 4 seconds. 386 However, the time in which the robot performs angular movements to make direction 387 changes in its path must be added. We took 3806 measurements of the battery's discharge 388 while the robot was rotating and moving between intersections to compute the well-fitting 389 linear model shown in Figure 10(a) and Figure 10 For this linear regression model the correlation coefficient is equal to 0.999992, indi-403 cating a strong relationship between predicted and measured values. The R-squared sta-404 tistic indicates that the model explains 99.9984% of the variability of the Electrical dis-405 charge [mAh]. Taking into account the previous results, it is observed that the relationship 406 between the variables Max_NS and electric discharge is well described by a linear model, 407 and that this proposed model can be used to estimate the maximum energy required by 408 the robot to carry out an exploration task.

410
Once we have the model described above, relating the number of steps taken by the 411 robot and the electric discharge of its battery, we can answer the problem question: Is the 412 current energy stored in the robot's battery enough for the robot to successfully complete 413 Theoretically, at a constant speed (10 m/s) and a constant distance between the intersections of the grid (40 cm), the time spent by the robot taking a single step is 4 s. However, the time in which the robot performs angular movements to make direction changes in its path must be added. We took 3806 measurements of the battery's discharge while the robot was rotating and moving between intersections to compute the well-fitting linear model shown in Figure 10a,b, to describe the relationship between electrical discharge and number of steps taken by the robot. Equation (2)  Therefore, for every step that the robot advances it expends 0.669792 mAh of the battery charge.
For this linear regression model the correlation coefficient is equal to 0.999992, indicating a strong relationship between predicted and measured values. The R-squared statistic indicates that the model explains 99.9984% of the variability of the Electrical discharge [mAh]. Taking into account the previous results, it is observed that the relationship between the variables Max_NS and electric discharge is well described by a linear model, and that this proposed model can be used to estimate the maximum energy required by the robot to carry out an exploration task. model shown in Figure 10a,b, to describe the relationship between electrical discharge and number of steps taken by the robot. Equation (2) shows the equation that describes the fitted model: Electrical discharge [mAh] = 2699.29 − 0.669792 × Number of steps (2) Therefore, for every step that the robot advances it expends 0.669792 mAh of the battery charge. For this linear regression model the correlation coefficient is equal to 0.999992, indicating a strong relationship between predicted and measured values. The R-squared statistic indicates that the model explains 99.9984% of the variability of the Electrical discharge [mAh]. Taking into account the previous results, it is observed that the relationship between the variables Max_NS and electric discharge is well described by a linear model, and that this proposed model can be used to estimate the maximum energy required by the robot to carry out an exploration task.

Results and Discussion
Once we have the model described above, relating the number of steps taken by the robot and the electric discharge of its battery, we can answer the problem question: Is the current energy stored in the robot's battery enough for the robot to successfully complete the task of exploring and searching for an object? Our proposed model is applicable to deterministic and non-deterministic exploration algorithms.
For the present work we are considering non-deterministic algorithms, where each time they are executed the robot reaches its goal using a different number of steps. Therefore, there is no point in trying to predict exactly how much energy the robot will expend for a particular run, but rather the maximum amount of energy that the robot will need according to the expected worst performance of the exploration algorithm as determined by the ANN prediction model. For our evaluation, 64 tests were performed with the iRobot Create 2, using the RW exploration algorithm with different experimental conditions and 64 tests using the RW_WSB algorithm, for a total of 128 tests. Knowing the energy stored in the robot's battery at the beginning of each test run, we predict if the robot will be able to successfully complete its exploration task. After completion of the run, we determined the accuracy of

Results and Discussion
Once we have the model described above, relating the number of steps taken by the robot and the electric discharge of its battery, we can answer the problem question: Is the current energy stored in the robot's battery enough for the robot to successfully complete the task of exploring and searching for an object? Our proposed model is applicable to deterministic and non-deterministic exploration algorithms.
For the present work we are considering non-deterministic algorithms, where each time they are executed the robot reaches its goal using a different number of steps. Therefore, there is no point in trying to predict exactly how much energy the robot will expend for a particular run, but rather the maximum amount of energy that the robot will need according to the expected worst performance of the exploration algorithm as determined by the ANN prediction model.
For our evaluation, 64 tests were performed with the iRobot Create 2, using the RW exploration algorithm with different experimental conditions and 64 tests using the RW_WSB algorithm, for a total of 128 tests. Knowing the energy stored in the robot's battery at the beginning of each test run, we predict if the robot will be able to successfully complete its exploration task. After completion of the run, we determined the accuracy of the model prediction.
As can be seen in Figure 11, in 96.88% of the cases the actual number of steps taken by the robot during experimentation did not exceed the predicted number of steps, which suggests a good prediction performance. Electronics 2021, 10, x FOR PEER REVIEW 13 of 19 Figure 11. Comparison between real number of steps and predicted maximum number of steps for RW algorithm.
When the RW_WSB exploration algorithm is used, the percentage of tests where the predicted number of steps is higher than the actual number of steps (which is good since we are trying to predict the worst case) was 95.31%, which also suggests a very good prediction, as shown in Figure 12. In terms of energy consumption, as shown in Figure 13, out of the 128 tests carried out, 96.09% of the time the amount of energy needed by the robot according to the model would have been enough for the robot to actually finish the task in practice, indicating that only in a small percentage of cases the energy-budget suggested by the model would fail short. When the RW_WSB exploration algorithm is used, the percentage of tests where the predicted number of steps is higher than the actual number of steps (which is good since we are trying to predict the worst case) was 95.31%, which also suggests a very good prediction, as shown in Figure 12. When the RW_WSB exploration algorithm is used, the percentage of tests where the predicted number of steps is higher than the actual number of steps (which is good since we are trying to predict the worst case) was 95.31%, which also suggests a very good prediction, as shown in Figure 12. In terms of energy consumption, as shown in Figure 13, out of the 128 tests carried out, 96.09% of the time the amount of energy needed by the robot according to the model would have been enough for the robot to actually finish the task in practice, indicating that only in a small percentage of cases the energy-budget suggested by the model would fail short. In terms of energy consumption, as shown in Figure 13, out of the 128 tests carried out, 96.09% of the time the amount of energy needed by the robot according to the model would have been enough for the robot to actually finish the task in practice, indicating that only in a small percentage of cases the energy-budget suggested by the model would fail short.
It should be noted that for the scenarios described in this work it is not possible to create an energy budget based on pre-computed paths to the target, since the location of such target is unknown to the robot at the beginning of the task. However, the proposed prediction model can calculate the maximum energy that the robot needs to reach each and every one of the possible destinations considering the particular exploration algorithm executed by the robot. An example for the case of a 6 × 6 grid is shown in Figure 14 where the highest estimated energy consumption is 263 mAh. The areas with the highest estimated energy consumption are the three remaining corners of the grid, considering that the robot always starts its exploration from the upper left corner. It should be noted that for the scenarios described in this work it is not possible to create an energy budget based on pre-computed paths to the target, since the location of such target is unknown to the robot at the beginning of the task. However, the proposed prediction model can calculate the maximum energy that the robot needs to reach each and every one of the possible destinations considering the particular exploration algorithm executed by the robot. An example for the case of a 6 × 6 grid is shown in Figure 14 where the highest estimated energy consumption is 263 mAh. The areas with the highest estimated energy consumption are the three remaining corners of the grid, considering that the robot always starts its exploration from the upper left corner. A final set of tests was carried out using 9 experimental scenarios not previously considered, as listed in Table 3. Each scenario in the list was executed 32 times for a total of 288 experimental tests (9 scenarios by 32 replicas per scenario).  It should be noted that for the scenarios described in this work create an energy budget based on pre-computed paths to the target, such target is unknown to the robot at the beginning of the task. Ho prediction model can calculate the maximum energy that the robot and every one of the possible destinations considering the particul rithm executed by the robot. An example for the case of a 6x6 grid i where the highest estimated energy consumption is 263 mAh. The ar estimated energy consumption are the three remaining corners of t that the robot always starts its exploration from the upper left corner Predicted energy consumption [mAh]  1  5  9  13  17  21  25  29  33  37  41  45  49  53  57  61  65  69  73  77  81  85  89  93  97 Predicted energy consumption Real Energy cons A final set of tests was carried out using 9 experimental scenarios not previously considered, as listed in Table 3. Each scenario in the list was executed 32 times for a total of 288 experimental tests (9 scenarios by 32 replicas per scenario). Due to the non-deterministic behavior of the exploration algorithms under test, each time an experimental scenario is executed different results are observed. However, as can be seen in Figure 15, there is a concentration of data that presents a higher frequency and probability of occurrence, as observed in the following graphs of frequencies and accumulated probabilities for each of the 9 experimental conditions. 472 A final set of tests was carried out using 9 experimental scenarios not previously con-473 sidered, as listed in Table 3. Each scenario in the list was executed 32 times for a total of 474 288 experimental tests (9 scenarios by 32 replicas per scenario).  Due to the non-deterministic behavior of the exploration algorithms under test, each 479 time an experimental scenario is executed different results are observed. However, as can 480 be seen in Figure 15, there is a concentration of data that presents a higher frequency and 481 probability of occurrence, as observed in the following graphs of frequencies and accu-482 mulated probabilities for each of the 9 experimental conditions. For the analysis below, we define the real electrical discharge as energy consumption 494 value at which the robot reached the target object at least 94% of the time, as also indicated 495 in the cumulative probability in Table 4. For the analysis below, we define the real electrical discharge as energy consumption value at which the robot reached the target object at least 94% of the time, as also indicated in the cumulative probability in Table 4. Max _NS is predicted using the optimized neural network model. The predicted Electrical discharge is calculated using the battery model that describe the relationship between Electrical discharge and Number of steps.
The real maximum energy used by the robot never exceeded the predicted value, which can be described as an excellent result, since the energy required for the robot to accomplish its task was enough 100% of the time as shown in Figure 16. The difference between the predicted energy and the real energy can be seen as a reserve energy, that on our experiments averaged 15 mAh. It is relevant that the predicted values are always higher than the real values (not necessarily equal) so that the safety of the robot's mission is not affected, which is the preponderant factor in this work.   1  102  68  42  97%  2  90  61  52  94%  3  104  69  67  94%  4  169  113  71  94%  5  32  21  17  94%  6  55  37  18  97%  7  121  81  45  100%  8  47  32  31  97%  9 96 65 64 97% Max _NS is predicted using the optimized neural network model. The predicted Electrical discharge is calculated using the battery model that describe the relationship between Electrical discharge and Number of steps.
The real maximum energy used by the robot never exceeded the predicted value, which can be described as an excellent result, since the energy required for the robot to accomplish its task was enough 100% of the time as shown in Figure 16. The difference between the predicted energy and the real energy can be seen as a reserve energy, that on our experiments averaged 15 mAh. It is relevant that the predicted values are always higher than the real values (not necessarily equal) so that the safety of the robot's mission is not affected, which is the preponderant factor in this work. The drawback of this method is the overestimation of the model, because a robot that could strictly perform an exploration task with its stored energy, the overestimation could reject it. However, this estimate has a positive impact on the useful life of the battery since in the execution of the exploration by the robot, the battery could reach its lowest charge

Electrical discharge predicted versus real
Electrical discharge predicted Electrical discharge Real The drawback of this method is the overestimation of the model, because a robot that could strictly perform an exploration task with its stored energy, the overestimation could reject it. However, this estimate has a positive impact on the useful life of the battery since in the execution of the exploration by the robot, the battery could reach its lowest charge levels, thus reducing its charge and discharge cycles. It could be as future work to review that the useful life of the robot's battery is improved with this proposed method.

Conclusions
This research work demonstrates that a Machine Learning system with Tabu List hyperparameter optimization can predict the energy consumption for robots considering the performance of the exploration algorithms. Earlier methods in the literature generally require explicit equations to model the dynamics and kinematics of the robot in order to estimate its energy consumption.
Many recent applications of Machine Learning focus on the use of big datasets for training [34], however, there are many problems where the available datasets are small. Our method based on Machine Learning techniques has generated excellent results for small databases in general.
A total of 128 tests were carried out using a robot executing two exploration algorithms with the objective of locating a target whose location is initially unknown. The experimental consumption energy was measured and compared with the prediction of our model. A success rate of 96.09% was obtained, suggesting an adequate energy predictor, which could be useful for energy budgeting in actual mobile robot applications.
To evaluate the performance of the predictor with the two selected, non-deterministic, navigation algorithms 9 experimental scenarios were run, with each one replicated 32 times. The results obtained show that the actual energy expended by the robot did not exceed the predicted energy with probability ≥ 94%.
For future work, the prediction of energy consumption will be applied for deterministic exploration algorithms such as those based on reinforcement learning.