
that can be analyzed to reveal patterns and trends, referring to the so-called big data [2, 3] . In fact, the relevant impact of big data also applies to the automotive context, where data gathered from the vehicle can be exploited in different ways, ranging over predictive maintenance and advanced real-time analytics [4] . These emerging technologies and paradigms are particularly interesting with regard to the electric vehicles segment, the spread of which is constantly growing thanks to several factors, such as a reduced impact on the environment [5] , a faster and more accurate motor torque generation [6] , and lower long-term costs of ownership [7] . In this context, the streams of data, collected by exploiting interconnected sensors, could be a unique chance to mitigate the so-called "range anxiety", defined as the fear of fully depleting a battery electric vehicles (BEVs) battery in the middle of a trip, leaving the driver stranded [8] . In fact, despite the several advantages described above, the use of electric vehicles still presents some limitations, including:
• Limited traveling distance: currently the distance that can be covered by electric cars is limited.
• Lack of recharge points: electric vehicles require charging stations, but there is a significant lack of infrastructures. While this problem is mitigated in an urban context, it becomes critical in long distance travels, since they require a network of charging stations strategically located.
• Long recharge time: unlike gasoline-powered cars, electric ones take hours to get fully charged.
Considering these open issues, it is clear the need for optimizing energy consumption in electric vehicles. With this purpose in mind, we focused on different driving styles, evaluating which one leads to the efficient use of the battery charge. From an empirical analysis, and according to the current literature [9] , we found out that the regenerative brake has a significant impact in this sense. In fact, electric vehicles are equipped with two different brakes: the regenerative and the friction ones. In particular, the activation of the regenerative brake implies recharging the battery, on the contrary of the activation of the friction one. Hence, a more aware use of the brake can significantly change the battery level. Starting from these considerations, our aim is to provide drivers with an integrated solution that fosters eco-driving behaviours, and in particular, that enhances an optimized use of the regenerative brake. This study was conducted within the TIME project 2 (which stands for "Tecnologie Integrate per la Mobilitá Elettrica" in Italian language, meaning "integrated technologies for electric mobility"). The whole TIME project is focused on the development of complete technological systems (powertrains) with integrated solutions for electric vehicles. The main purpose is to identify a methodology to build the integrated components of an efficient electric vehicle, obtained by converting a petrol car (retrofit) or by directly being installed in a new vehicle. While the TIME project involves several research areas, in this paper we are mainly investigating how to combine big data and machine learning in order to predict the activation of the friction brake. This aims to optimize energy consumption in electric vehicles, improving drivers' consciousness, and then let them better deal with the "range anxiety". Then, the in-vehicle Human-Machine Interface can take advantage of such a real-time prediction, equipping the driver with more accurate and complete information about his/her braking styles, thus enhancing eco-driving behaviours.
Hence, here we present the design and implementation of a prototype system, integrated in a real electric vehicle. Such a prototype exploits: (i) vehicles data collection, (ii) a machine learning algorithm, and (iii) the Human-Machine Interface (i.e., the car dashboard). In this scenario, we have taken advantage of the use of the most adequate machine learning algorithm so as to predict the friction brake activation. Such an algorithm has been evaluated on simulated and real datasets of driving cycles.
Summarizing, the main contributions of our study are: (i) the design and implementation of a system that uses big data gathered by in-vehicle sensors and components to provide drivers with real-time visual feedback to optimize the battery energy consumption; (ii) the identification of the machine learning algorithm that best suits our need to predict the friction brake activation. Moreover, we assessed the feasibility of our approach by using both simulated and real data (collected from the field, integrating the system in a real electric vehicle).
The remainder of the paper is structured as follows. "Background and related work" section briefly presents studies conducted in the field, which analyze and exploit topics and research projects similar to the ones of interest in our work. "Problem statement" section details the context and the research questions that motivated our study, then, "Methods" section presents our approach, detailing the dataset used, the system overview, and describing the machine learning module. "Results and discussion" section illustrates the results obtained with the consequent discussion. Finally, "Conclusion and future work" section concludes this paper, presenting some final remarks and future work.
Background and related work
In this Section, we present some projects and studies related to our approach, introducing some cases based on sensed data and machine learning techniques and on increasing the user awareness about driving styles and eco-driving behaviours in the automotive context. Finally, some works that exploit gamification strategies to support drivers and users on the move are briefly introduced.
The growing number of sensors integrated in vehicles, in addition to the possibility of having a complete view of the vehicle status, thanks to the messages exchanged on the controller area network (CAN) bus, made possible exploiting big data to obtain useful explanation and/or insights behind different phenomena. The data gathered from in-vehicle sensors can be variegated, ranging from the speed of the vehicle to the percentage of the battery charge. In this context, it emerges the opportunity to feed machine learning algorithms with these data, in order to extract new knowledge, as witnessed by recent studies. For instance, the authors of [10] developed ML_EMO_HEV, a framework that uses big data about motor torque, power, and vehicle speed, together with machine learning algorithms with the aim of predicting roadway types, traffic congestion levels, and driving trends. Then, starting from this prediction, it exploits another algorithm so as to learn optimal energy settings. This way, a real-time quasi-optimal control of energy flow in a hybrid electric vehicle (HEV) can be obtained. With the same aim in mind (optimizing the engine performance), [11] tried to determine optimal biodiesel ratio using advanced machine learning methods, exploiting a dataset composed by engine torque and fuel blends. The authors of this work compared different techniques to create engine models based on experimental data, in particular: Extreme Learning Machine, Least-Squares Support Vector Machine, and Radial-Basis Function Neural Network.
Different aspects were analyzed by [12, 13] in their studies. In particular, [12] exploited machine learning to model human recognition of vehicle-driving situations. The purpose of such research is to provide physical context to mitigate unnecessary distractions, allowing the driver to maintain focus during periods that require high concentration. While [13] , proposed a system to detect early onset of fatigue in drivers using heart rate variability, since fatigue can acutely impair driver's alertness and performance. In particular, the detection was performed by a neural network, trained and tested on a set of electrocardiogram (ECG) data recorded under laboratory conditions. Finally, Ezzini et al. [14] addressed the problem of driver identification using in-vehicle sensors measurements. They investigated both the minimum learning and classification times required, exploiting several algorithms like Extra Tree, Random Forest, KNN, and SVM. Monitoring heart rate is also at the basis of [15] , where the authors have assessed the correlation of driving behaviour with heart rate changes. The authors considered that there are situations where the emotional conditions of drivers vary due to different reasons (beyond their control or not). With the aim of controlling such variations, the authors designed and developed an Android application to real-time monitoring both physiological data from the driver and diagnostic data from the vehicle, so as to investigate their correlation. In particular, an OBD-II connector has been used to obtain the vehicle diagnostic data, while non-invasive biomedical sensors packaged in belts and smart watches have been used to gather data about the drivers' heart rate, focusing on the connection between driving aggressiveness and heart rate.
The study and the identification of driving styles are at the basis of [16] and of [17] . The authors integrated both data mining techniques and neural networks with the aim of generating a classification of driving styles by analyzing the driver's behavior along specific routes. The authors implemented a neural network-based algorithm, that can characterize the type of road on which the vehicle is moving, as well as drivers' styles, taking into account parameters such as speed, acceleration, and revolutions per minute of the engine (rpm). The final aim of this work is to assist the driver, so as to avoid or at least to limit bad habits in their driving behavior, while supporting useful tips to improve fuel economy, by exploiting the evolution of mobile terminals and the availability of a standard interface to access car data. The results presented in these papers show that neural networks were able to achieve a high degree of exactitude at classifying both road and driver types based on user traces.
The prediction of consumption in vehicles while supporting drivers in optimizing vehicles consumption are the purpose of [18] [19] [20] . In particular, [18] proposes a methodology to real-time calculate the consumption and the environmental impact of spark ignition and diesel vehicles from a set of variables, such as engine fuel rage, speed, mass air flow, absolute load, and manifold absolute pressure. All these data can be collected from the vehicle's Electronic Control Unit (ECU). The methodology has been defined with the aim of supporting eco-driving behaviors in drivers, by improving fuel economy. This work shows, through data mining, how much the driving style really affects (both negatively or positively) the fuel consumption, as well as the improvement or the reduction of greenhouse gas emissions generated by vehicles. While predicting the consumption of electric vehicles and their electricity demand are at the basis of [20] . In fact, it proposes an approach based on having specific knowledge about information on the number of vehicles that are going to recharge their batteries at a particular point and instant and on the available charging points. Obtained results report that the proposed approach can predict the electricity requirements of the electric vehicles that are expected to recharge their batteries up to 180 minutes in advance [20] .
Both in the industrial and academic world, there are a lot of examples of the adoption of Gamification strategies with different purposes, such as fostering eco-driving behaviours. Different car manufacturers developed several Gamification mechanisms and embedded them in their models. Diewald et al. [21] provided a comprehensive review of such applications. From Volkswagen's BlueMotion Roulette to Ford's SmartGauge with EcoGuide, passing through the Kia's ECOdynamics and Fiat's eco:Drive. With regard to academic research, there are plenty of works on this subject, even if with different aims [22] . Corcoba Magaña and Munoz-Organero [23] developed a mobile application to provide a vocal eco-driving assistant. The application employs two types of feedback, one real-time (while the user is driving) and the other one at the end of the trip. The first one is activated when a driver does not comply with predefined eco-driving rules. In this case, the system tries to identify a group of drivers in a similar situation, exploiting information about weather, traffic, time, and vehicle location. Then, using fuzzy logic, each attribute of the user telemetry is compared with the ones of the best driver of the cluster. If the difference exceeds a threshold, the relative eco-advice will be provided. The second type of feedback, instead, is provided at the end of every trip, and generally reports about his/her driving style. In particular, it consists in the unlocking of achievements, that are one of the most common Gamification mechanisms. In this study, achievements have to encourage drivers to save fuel and motivate them to continually use the eco-driving assistant. Vaezipour et al. [24] , through a user-centered design approach, evaluated a series of conceptual designs of in-vehicle gamified interfaces. A particular focus has been paid to the ability to increase drivers' acceptance of feedback from such interfaces in order to improve fuel efficiency and promote safe driving.
An example exploiting real-time analysis of data gathered by in-vehicle sensors is the study presented by Steinberg [25] , that proposed a game concept to encourage safer driving behaviours, in particular avoiding tailgating, the practice of driving too close to a frontward vehicle. They defined an area around cars and they implemented a real-time data analysis with a zombie narrative as theme [26] , so that crossing the area results in the infection of the car.
All these studies differ from the approach we propose and the objectives which are at the basis of our study. In fact, our approach seeks to take advantage of sensed big data and machine learning strategies to understand the user's driving style. Then, real-time feedback through graphical elements is prompted to induce a more efficient driving style and management of the electric vehicle.
Problem statement
Electric vehicles are equipped with two different brakes. Figure 1 presents how the activation of the two brakes impact the battery in terms of energy consumption optimization. In particular, the case a in Fig. 1 represents the activation of the friction brake, that consists of a pad pushing on a disc to create friction, resulting in a neutral effect on the battery; while case b shows the positive impact on the battery of the activation of the regenerative brake, where the vehicle's momentum is used to turn the motor into a generator and to recover energy in the battery that would be, otherwise, lost as heat. Figure 2 describes the behavior of the vehicle. While running, the vehicle simply consumes the electricity stored in the batteries (case a). They can be recharged in two ways. The first one is through the engine brake when the vehicle is downhill (case b). The second is during a brake. In the TIME prototype, as in many electric vehicles, light or moderate braking takes advantage of the regenerative brake (case c) while heavy braking will also engage the friction braking system (case d). In the latter situation, the energy is not fully recovered but it is partially lost as heat. Hence, the braking style that allows maximizing the recovered energy consists of using only and exclusively the regenerative brake (i.e., reducing the red area of Fig. 2 , and increasing, consequently, the green one). Since a threshold (e.g., brake pedal position), that defines the friction brake activation, does not exist, we want to predict its activation exploiting in-vehicle sensors and components data, and machine learning techniques. Starting from these predictions, the system should provide real-time suggestions and indications with the aim of improving the driver's braking style, taking advantage only of the regenerative brake, with a consequent increase of the recovered energy.
Given these premises, with this study, we intend to prove that it is possible to effectively exploit big data gathered from in-vehicle sensors and components to provide drivers with real-time feedback aimed to optimize their braking style, and, accordingly, the energy consumption. In more detail, the research questions that drove our study are the following ones:
1. What is the machine learning algorithm that best allows to extract meaningful information from our dataset and address our objective to predict the friction brake activation, keeping into account the need of continuously train the model and the limited computational power? 2. Is the identified algorithm able to predict the friction brake activation with good performances? 3. Are the performance of the selected algorithm comparable to the ones of other common machine learning algorithms? 4. Is the algorithm, trained on simulated data, able to predict the friction brake activation using sensed real data?
Methods
In this section, as a main contribution of the paper, we describe our approach, detailing the dataset, the system architecture, and the machine learning algorithm.
Dataset description
The dataset is composed of (i) simulated data, used for the training, and (ii) real data, used as a further validation set. The simulated data were derived from Matlab Simulink simulator of the TIME's vehicle. The simulations were conducted on six heterogeneous driving cycles: urban (ECE-15, ARTEMIS urban, Bologna urban, Rome urban), rural (ARTEMIS rural road) and motorway (ARTEMIS motorway). The Urban Driving Cycle ECE-15 was introduced first in 1970 as part of ECE vehicle regulations. The cycle has been designed to represent typical driving conditions of busy European cities and is characterized by low engine load, low exhaust gas temperature, and a maximum speed of 50 km/h. The ARTEMIS cycles were defined within the ARTEMIS research project, supported by the European Commission to set-up and improve the European methods for estimating and inventorying the pollutant emissions from the transports. In particular, we used the driving cycles (urban, rural and motorway ones) developed by [27] . Finally, Bologna and Rome urban are both driving cycles created within the TIME project, starting from a set of GPS data in Bologna and Rome. The first one consists in Bologna avenues, the latter one is mainly an urban cycle, but it also includes a part of the "Grande Raccordo Anulare" (orbital motorway that encircles Rome). With regards to the real data, since the vehicle has not been yet type-approved, it was not possible to collect a large amount of data. For this reason, we were able to collect real data related to a cycle of 1.2 km performed on a private road. The features collected are: (i) gas pedal position (expressed in degrees), (ii) percentage of use of the electric brake, (iii) percentage of use of the mechanic brake, (iv) speed of the vehicle (expressed in km/h), (v) percentage of the battery charge. While the first four features are closely related to the activation of the friction brake, the last one is not. We choose to include it since it may be useful in view of a possible future integration with a different approach based on the prediction of the future state of charge of the battery, as described in [28] . All the features are sampled at a rate of 0.1 s (100 ms).
We aggregated the data according to two main parameters: the input temporal window width (i.e., how many samples are used as input) and the time offset (i.e., the future instant of the prediction). We evaluated different temporal-window widths (from 0.1 to 2.3 s) and different time offsets (from 0.1 to 2.3 s). More details about the motivation behind these intervals value are provided in the "Prediction of the friction brake activation" subsection. Only temporal windows included within a braking are considered (i.e., the driver is braking). The datasets contain from 1500 to 6000 sample windows, with an average of 4300. Figure 3 presents an overview of the proposed system. All the data about the vehicle state are transmitted on the CAN (Controlled Area Network) bus, including the input features of the machine learning module. The vehicle has two tangible-car-infotainmentsystems (TCIS). One of them is the car dashboard, and it is directly ahead of a vehicle's driver (named car dashboard), displaying instrumentation and controls for the vehicle's operation. The other one is the control panel that delivers entertainment and information content (named infotainment system). It allows calling someone, playing music, etc. Each TCIS has its own controller, that consists of a single-board computer. The dashboard controller can only read from the CAN bus and visualizes the correspondent information on the display. Instead, the infotainment controller can both read and write on the can bus. Thus, its display is touch-screen, since it has to manage also the driver's input.
System overview
Essentially, considering our approach, the primary information to display drivers, in order to affect their driving style, is the real-time prediction of the imminent activation of the friction brake. This visual information can be displayed in both the car dashboard and the infotainment system since the machine learning (ML) module can interact with both the interfaces. Even if the car dashboard has strong constraints imposed by various regulations [29] , we decided to display the prediction in the car dashboard, since such information has to be provided real-time to the driver. In this way, the information is immediately visible to the driver, in a clear and not distracting way. 
Machine learning module
The main purpose of the ML module is to predict how likely (calculating a value between 0 and 1) the friction brake will be active in a future instant. To address this objective, answering to the first research question, we evaluated the use of different machine learning algorithms. Two main factors drove our final choice.
First of all, the module should be able to continuously train the model with the new data generated while the vehicle is running, without starting from scratch (i.e., without employing all the data used for training until then). This is a crucial aspect since the different components developed within the TIME project are designed to be suitable not only for installation on new vehicles but also on existing vehicles produced by different car manufacturers. So the model, designed to address this constraint, must adapt itself to different vehicles. Thus, each driver has his/her own driving styles, that can also change during time, so the model must also adapt itself to different driving styles. For this reason, we excluded the use of traditional approaches such as linear regression, gradient boosting, etc.. that do not support incremental learning.
The second factor to take into account when selecting the more suitable algorithm is the available computational power. The Dashboard controller (Fig. 3) runs on a singleboard computer, like a Raspberry PI 3 Model B, that has a Quad Core 1.2GHz Broadcom BCM2837 64bit CPU with 1GB RAM. Thus, the sample rate is 0.1 s. Since our system aims to be as real-time as possible, the model has to predict the activation of the friction brake with the lowest sample time (i.e., 0.1 s). These constraints exclude deep learning approaches like Recurrent Neural Networks, that are the best option when working with sequential data [30] . Hence, we decided to employ a multilayer perceptron (MLP) with one hidden layer composed of 20 neurons. Such a neural network can be trained on new samples, adapting itself to different cars and drivers, even if it runs on a single-board computer, and it is able to compute the result every 0.1 s.
Then, we focused on how to visualize the feedback about the activation of the friction brake in the car dashboard. An important aspect, that we took into consideration, is the cognitive load. It is particularly relevant since driving is one of the most complex activity. Different studies [31, 32] investigated the impact of car interfaces in terms of the distraction of the driver. Based on the findings of past studies, we decided to use an icon with a battery that appears only during braking, and its color changes with respect to the neural network prediction. In particular, it can be: The whole car dashboard was developed using QT, 3 standard "de facto" of automotive HMI. A screenshot of the car dashboard is visible in Fig. 4 , where braking is simulated. It is possible to notice the yellow icon of the battery, which indicates a medium probability of activation of the friction brake.
Results and discussion
In this section we evaluate and compare our method to predict the friction brake activation. Finally, we validate our approach using both simulated and real data, collected in the field.
Prediction of the friction brake activation
To answer the second research question, we focused on the simulation data. We evaluated the performances of the model varying both the time-width and the time-offset from 0.1 to 2.3 s. The tests have been performed in cross-validation on the data of the six simulated driving cycles. In the simulations, we employed the same vehicle characteristics and the same driving style. A crucial aspect of our approach is how far in advance the activation of the friction brake can be predicted, so that, through the car dashboard battery icon, the driver can be advised far in advance.
In Table 1 we reported the average AUC on the six driving cycles. As shown, the neural network has the best performances with larger time-width and lower timeoffset. However, the neural network has good prediction capabilities (0.85 and 0.82) also when the time-offset is large (e.g., 2.1 s and 2.3 s). It is possible to notice that already with time-width equal to 2.3 s, results get worse compared to the previous time-width in many cases. Since the driver's reaction time is on the average 2 s [33, 34] we decided to fix the time-offset to 2.1 s. With such time-offset, the best model is the one with a temporal width equal to 2.3 s.
Performance comparison
Subsequently, to answer the third research question, we checked if the performances of the selected algorithm were comparable to the ones of other common machine learning algorithms. It is worth to notice that we already discussed the reasons behind our choice in "Machine learning module" section. However, we want to compare the performances of the MLP to be sure that other algorithms do not outperform it.
In particular, we evaluated the performances of the following ones: We fixed the time-width and the time-offset respectively to 2.3 s and 2.1 s, as explained in the previous section. The tests have always been performed in cross-validation on the data of the six simulated driving cycles. The results are shown in Fig. 5 , in which the box plot for each algorithm is reported, and in Table 2 , where the performances on the test path are reported for each algorithm. As shown, our MLP has generally better performances than the other approaches. In particular, it works better than almost all the others except for the adaptive boosting and the gradient boosting which are slightly more accurate on average.
In conclusion, the MLP has proved to be the right choice, since it works better than many of the presented approaches, in addition to presenting all the advantages described in "Machine learning module" section.
Evaluation on real data
To answer the fourth and final question, we also considered the prediction capabilities of the model using real data related to the test cycle directly sampled from the first prototype of the TIME vehicle (i.e. not Simulink samples). Figure 6 shows the ROC curve on the six simulating driving cycles (continuous lines) and on real data sampled from the TIME vehicle, named TIME test cycle (dashed line), for temporal-window of 2.3 s and time-offset of 2.1 s. As shown, the prediction performances of the neural network model are also good when applied to real data, with an AUC equal to 0.82. Although our real test case is quite limited (as explained in "Dataset description" section), this confirms that the implemented neural network model can predict the activation of the friction brake with good performances also when fed with real data. As shown in Fig. 6 , the prediction capabilities are overall good on all driving cycles with lower performances on the rural and motorway cycles. Since these two driving cycles are the two more under-represented in our training set, we can aspect better prediction results with larger datasets including more data in these driving conditions.
Conclusion and future work
This paper describes a prototype we have designed and deployed on a real electric vehicle, with the aim of optimizing the consumption of energy battery in electric vehicles, exploiting big data gathered from in-vehicle sensors and components. A neural network is employed to predict the activation of the friction brake in order to visualize this information in the HMI, and foster eco-driving behaviours. The tests, conducted using both simulated and real data, highlighted how it is possible to predict the activation of the 

{'paper_id': '198173941', 'title': 'On combining Big Data and machine learning to support eco-driving behaviours', 's2_url': 'https://api.semanticscholar.org/CorpusID:198173941', 'source': 'S2ORC'}