Mass estimation method for intelligent vehicles based on fusion of machine learning and vehicle dynamic model

Vehicle mass is an important parameter for motion control of intelligent vehicles, but is hard to directly measure using normal sensors. Therefore, accurate estimation of vehicle mass becomes crucial. In this paper, a vehicle mass estimation method based on fusion of machine learning and vehicle dynamic model is introduced. In machine learning method, a feedforward neural network (FFNN) is used to learn the relationship between vehicle mass and other state parameters, namely longitudinal speed and acceleration, driving or braking torque, and wheel angular speed. In dynamics-based method, recursive least square (RLS) with forgetting factor based on vehicle dynamic model is used to estimate the vehicle mass. According to the reliability of each method under different conditions, these two methods are fused using fuzzy logic. Simulation tests under New European Driving Cycle (NEDC) condition are carried out. The simulation results show that the estimation accuracy of the fusion method is around 97%, and that the fusion method performs better stability and robustness compared with each single method.


Introduction
Accurate acquisition of vehicle state parameters is the basis of high-quality motion control of intelligent vehicles. Vehicle mass is an essential parameter in control system of intelligent vehicles [1], and the accuracy of its estimation directly affects how the control system performs. For example, the strategies of fuel consumption optimization [2], active cruise control [3], and anti-lock braking system control [4] all require the knowledge of vehicle mass. Although the nominal values of the vehicle mass, such as curb mass and gross mass, are usually available, the actual value of the vehicle mass varies greatly when the vehicle carries different loads. However, it is hard to be directly obtained from normal sensors. Therefore, researches focusing on accurate estimation of vehicle mass are carried out. Most of the current vehicle mass estimation methods are based on vehicle dynamic model [5][6][7][8][9][10][11]. Because of the coupling of vehicle mass and road slope in the longitudinal vehicle dynamic model, Zhang et al. [5] used the method of recursive least square (RLS) with forgetting factor to estimate vehicle mass and road slope simultaneously. Seungki et al. [6] used the feature that sensor signal of vehicle acceleration includes road slope information, to realize separate estimation of road slope and vehicle mass. Cai et al. [7] proposed a two-layer structure algorithm, in which the road slope was firstly estimated using RLS, and vehicle mass was then estimated based on extended Kalman filter (EKF). Zhao et al. [8] used fuzzy logic to obtain the confidence factor of vehicle mass estimation algorithm, according to longitudinal speed, longitudinal acceleration and engine torque. Only when the confidence factor exceeded a certain limit, RLS with forgetting factor was applied to estimate vehicle mass. Sun et al. [9] firstly used EKF to estimate road slope, and then used EKF and RLS to estimate vehicle mass respectively, based on the estimated road slope. The final estimate of vehicle mass was the weighted average of the estimates based on two methods with constant weights.
There are also studies on vehicle mass estimation based on frequency domain analysis [10,11]. Hu et al. [10] derived the amplitude-frequency functions of longitudinal acceleration and wheel angular speed according to longitudinal vehicle dynamic model, and then used the least square method to estimate vehicle mass, but the effect of real vehicle tests still needs to be studied. Chu et al. [11] combined high-frequency information extraction and RLS method to decouple the vehicle mass and road slope, and then realized vehicle mass estimation. In general, dynamics-based methods show fast convergence speed and good stability. However, the performance of dynamics-based methods requires accurate vehicle dynamic model parameters and state parameter measurement. In addition, dynamics-based methods may obtain accurate vehicle mass estimation results when the vehicle is under large and persistent excitation, but the estimation accuracy is difficult to ensure when the vehicle is under small excitation.
In recent years, machine learning (ML) has been widely applied to intelligent driving [12]. However, ML has rarely been used in the research of vehicle mass estimation. Torabi et al. [13] firstly collected the dynamic information of the vehicle under various conditions as the training set, and then trained the feedforward neural network to realize simultaneous estimation of vehicle mass and road slope. Korayem et al. [14] also used a feedforward neural network with 15 fully-connected layers to estimate the mass of a trailer. By learning a large quantity of training data, ML-based method generally shows good accuracy. However, current researches only included the conditions with little change of vehicle speed and road slope, and the estimation effect under conditions of different tire-road friction coefficient was also not verified. Therefore, the application range (variable driving conditions) of this method still needs to be studied. Besides, the comprehensiveness of the dataset and quality of neural network training directly influences the performance of ML-based method. In addition, the relationship learnt by neural network based on dataset cannot be theoretically explained, which may sometimes cause unexpected unsatisfying performance.
Considering the advantages and limitations of the methods above, a vehicle mass estimation method based on fusion of ML and vehicle dynamic model is proposed in this paper in order to improve the estimation effect. The main contributions of this paper are as follows: (1) An ML-based method of mass estimation is designed, with different driving conditions considered. (2) Dynamics-based method of mass estimation using RLS with forgetting factor is proposed. (3) A mass estimation framework based on fusion of ML-and dynamics-based methods is proposed, and a fusion algorithm based on fuzzy logic is designed. (4) Simulation tests under New European Driving Cycle (NEDC) are carried out, with the results validating that the proposed fusion method shows significant improvement with respect to estimation accuracy, stability and robustness compared with each single estimation method.
This paper is organized as follows. Section 2 presents the vehicle mass estimation method based on ML, including the selection of the neural network input signals, generation of the training data set, pre-processing of the data set, structure of the neural network and the procedure of training. The vehicle mass estimation method based on vehicle dynamic model is analyzed in Section 3. In Section 4, the fusion method based on fuzzy logic is presented. The procedures and results of simulation tests are presented and discussed in Section 5. This paper is concluded in Section 6.

Selection of the neural network input signals
The selection of neural network input signals directly affects whether it is possible to properly realize the estimation. In this paper, the input signals of the neural network are selected based on the longitudinal vehicle dynamic model. The longitudinal vehicle dynamic model is shown in Fig. 1. It can be expressed as where M is the vehicle mass; a is the longitudinal acceleration, and its different signs (positive and negative) represent acceleration and deceleration of the vehicle respectively; F x is driving or braking force, and its different signs (positive and negative) represent driving and braking respectively; F w is the wind resistance; F f is the rolling resistance; F i is the component of gravity in the direction of road slope, and its different signs (positive and negative) represent uphill and downhill respectively. The vehicle longitudinal dynamic model can be expressed in detail where T is the total driving or braking torque, and its different signs (positive and negative) represent driving and braking respectively; I i is the moment of inertia of a single wheel;ω i is the angular acceleration of the wheel, and its different signs (positive and negative) indicate the acceleration and deceleration of the wheel respectively; r is the effective rolling radius of the wheel; C d is the wind resistance coefficient; A is the frontal area of the vehicle; ρ is the air density; v is the longitudinal speed; g is the gravity acceleration; f is the rolling resistance coefficient; θ is the slope angle of the road, and its different signs (positive and negative) represent uphill and downhill respectively. It can be seen from Eq. (2) that in order to obtain the vehicle mass, the needed dynamic information should at least include the longitudinal speed, longitudinal acceleration, driving or braking torque, wheel angular acceleration and road slope angle of the current time step, respectively denoted as v(k), a(k), T(k),ω f (k),ω r (k) and θ (k), where k represents the current time step. Intelligent vehicles are equipped with high-precision sensors, such as global positioning system (GPS), inertial measurement unit (IMU), and wheel speed sensor, which can respectively provide measurement of longitudinal speed, acceleration and wheel angular speed; for connected vehicles, speed and acceleration can also be obtained with the assistance of road-side sensors [15]. The driving or braking torque can be obtained from traction control system (TCS) and anti-lock braking system (ABS) via controller area network (CAN). When the sampling time step is small, the approximate value of the angular acceleration can be derived from the wheel speed of consecutive two steps, denoted as ω i (k) and ω i (k -1) respectively, where (k -1) represents the last time step. Besides, the road slope angle can be estimated by analyzing speed and acceleration information [6,16], or by using GPS information [17,18], which will not be discussed in this paper. Because acceleration is also proved to be the most related state parameter to the vehicle mass [14], the longitudinal acceleration of the last time step is also added to the input signals, denoted as a(k -1), to capture the temporal relationship hidden in the data [19].
To sum up, the selected neural network input signals are the longitudinal velocity, longitudinal acceleration, driving or braking torque, front wheel speed, rear wheel speed and road slope angle of the current time step, denoted as v(k), a(k), T(k), ω f (k), ω r (k) and θ (k) respectively, as well as the longitudinal acceleration, front wheel angular speed and rear wheel angular speed of the last time step, denoted as a(k -1), ω f (k -1) and ω r (k -1) respectively.

Acquisition and pre-processing of the dataset
The dataset used for training of the neural network is composed of vehicle state parameters collected in a variety of simulation experiments under different conditions [13]. The conditions are set in the CarSim-Simulink cosimulation platform. Considering the possible mass value of common passenger vehicles, a series of mass values with equal interval are chosen, namely 1200 kg, 1300 kg, 1400 kg, . . . , 1700 kg, 1800 kg; other parameters of the vehicle are shown in Table 1. Totally 11 different road segments with the slope angle changing in range from -5°to 5°, which covers the range of longitudinal slopes of Chinese highways [20], are shown in Fig. 2. Tire-road peak adhesion coefficient (TRPAC) is chosen from 0.2, 0.5 and 0.8.
In acceleration experiments, the initial speed is set to 0, the maximum speed is set to 120 km/h and the maximum simulation time is set to 100 s. The throttle is chosen from constant values (including 10%, 20%, . . . , 90%, 100%) and linear changing values (25% to 75%, 25% to Because the data of different features in the original dataset have different units and magnitudes, it is necessary to normalize them before they are used for training. The min-max normalization (MMN) is applied to map all data to the range from 0 to 1 [21]. Finally, the normalized data set is randomly divided into training set with 18,000,000 samples and validation set with 3,732,835 samples.

Construction and training of the neural network
In this study, a feedforward neural network (FFNN) with one input layer, two hidden layers and one output layer is constructed and trained in Pytorch ML framework. The input layer contains 9 neurons corresponding to the 9 selected input signals mentioned above. Two hidden layers contain 1024 and 256 neurons. The output layer has one neuron corresponding to the output signal, namely the ML-based estimate of vehicle mass, denoted asM ML . The structure of the FFNN is shown in Fig. 3.
The method of weight initialization and forward propagation of the FFNN are designed according to [22]. The rectifier linear unit (ReLU) function is chosen as the activation functions of all neurons in hidden layers, with the form as follows: where, o i is the input of the ReLU function in the ith neuron.
The FFNN is trained using the gradient descent algorithm described in [23], with the learning rate of 0.001 and the batch size of 1024. To avoid overfitting, the performance over the validation set is also calculated in training process, and the training ends when the performance starts to turn worse.
Under application conditions, the needed state parameters of the vehicle are collected or calculated, then preprocessed in the same way as that of the training data, and input into the trained FFNN. The ML-based estimate of the vehicle mass, denoted asM ML , can then be calculated and updated.

Estimation based on RLS with forgetting factor
Vehicle mass estimation using RLS with forgetting factor is based on the longitudinal vehicle dynamic model shown in Fig. 1 and expressed as Eqs. (1)- (2). Equation (2) can be rewritten as: Equation (4) can then be transformed into the form for RLS: where y is the output of the system; is the measurable input of the system; b is the parameter to be identified [8].
The recursive process can be expressed as: where k and (k -1) represent the values of the current and the last time step respectively;b is the estimated value of the parameter b; L is the gain factor; P is the covariance; λ is the forgetting factor. In this study, λ is set to 0.95, which makes the impact of the previous data gradually diminish. Under the application conditions, the needed state parameters of the vehicle are collected or calculated in every time step, and input into the RLS algorithm. The dynamics-based estimate of the vehicle mass, denoted aŝ M DM , can then be calculated and updated. It should be noted that only longitudinal dynamic model is considered above. Considering the fact that daily driving condition is mainly composed of direct-line driving, it is reasonable to temporarily stop the estimation and maintain the latest result under conditions with large lateral excitations, such as lane changing and cornering, in order to avoid invalid estimation caused by modelling error [14]. Therefore, these conditions are not discussed in this paper.

Pre-processing of the fusion-based estimator input signals
The framework of fusion-based vehicle mass estimator is shown in Fig. 4, with the input signals including the MLand dynamics-based vehicle mass estimate of the current time step, and the fusion-based estimate of the last time step, denoted respectively asM ML (k),M DM (k) andM(k -1).
When the absolute value of the longitudinal acceleration is small, the estimation result of ML-based method is greatly affected by the noise of acceleration signal, so the accuracy cannot be guaranteed. This is also the reason why the constant speed conditions are not considered in the experiments for training set. Therefore, the estimated value of the vehicle mass is set to the value of the last time step when the longitudinal acceleration is not large enough.

Figure 4 Framework of fusion-based vehicle mass estimator
The dynamics-based estimate is pre-processed by judging whether the RLS algorithm has converged. The variance of the latest several values is calculated and normalized: where σ is the normalized variance of the latest n estimated values;M DM,i represents the estimate of vehicle mass;M DM is the average of the latest n estimates. When σ is less than a certain limit (e.g., 0.00001), it is regarded that the algorithm has already converged, and the estimation result is set to the value of the last time step until the next time that the vehicle starts after it stops.

Design of the fuzzy logic
The design idea of the fusion estimator based on fuzzy logic is to utilize fuzzy logic to derive the weights of the three input signals, namelyM DL (k),M DM (k) andM(k -1), according to the driving condition, and then take their weighted average value as the final result, namelyM(k). Under the conditions that the reliability of a certain estimation method is high, the corresponding weight is increased; when both of the estimation methods are not so reliable, the weight of the final estimation result in the last time step is increased, so as to improve the accuracy and stability.
The input signals of the fuzzy logic system are the absolute value of the longitudinal speed and acceleration of the current time step, and the absolute value of the difference of longitudinal acceleration between the current time step and the last time step, denoted as |v(k)|, |a(k)| and |a(k)a(k -1)| respectively; the output signals of the fuzzy logic system are the three weights mentioned above, denoted as w ML (k), w DM (k) and w k-1 (k) respectively. The domains of |v(k)|, |a(k)| and |a(k)a(k -1)| are respectively set to 0-120 km/h, 0-6 m/s 2 and 0-0.03 m/s 2 , with the sampling time step of 0.01 s; the domain of w ML (k), w DM (k) and w k-1 (k) are all set to 0-1. The membership functions of the input signals are all divided into 3 levels, namely S, M and B, representing small, medium and big respectively; the membership functions of the output signals are all divided into 5 levels, namely SS, S, M, B and BB, representing very small, small, medium, big and very big respectively. The membership functions of the input and output signals of the fuzzy logic system are shown in Fig. 5.
The fuzzy rules are designed based on 5 main principles listed as follows: • When the speed is small, dynamics-based estimation has not yet converged and the estimation result oscillates greatly, so the value of w DM (k) should be reduced.

Figure 5 Membership functions of inputs and outputs of the fuzzy logic
• When the acceleration of the vehicle changes rapidly, namely when |a(k)a(k -1)| is large, the estimation result of ML-based method oscillates greatly, so the value of w ML (k) should be reduced. • When the vehicle is at medium speed with strong acceleration, the estimation result of ML-based method usually has high accuracy and stability, so the value of w ML (k) should be increased. • Under the condition of very high speed, the estimation result of ML-based method, which is in real-time updated, is more likely to be influenced by the oscillation of the state parameter signals; the dynamics-based estimation result, which has been maintained since the estimation algorithm converged in vehicle starting process, shows by contrary better stability. Therefore, the value of w ML (k) should be reduced while the value of w DM (k) should be increased. • Under other conditions, the performances of the two methods are similar, so the values of w ML (k) and w DM (k) should also be set approximately equal. The designed fuzzy rules based on these principles are shown in Table 2.

Acquisition of the fusion-based estimation result
With ML-and dynamics-based estimates and the weights, the fusion-based estimation result can be obtained by Table 2 Fuzzy rules (outputs are w ML (k), w DM (k) and w k-1 (k) in order) Eq. (8).

Simulation tests
In order to verify the accuracy and stability of the proposed fusion estimation method, several simulation tests are carried out based on CarSim-Simulink co-simulation. The actual mass of the test vehicle is chosen from the values of 1350 kg and 1750 kg, and other parameters are the same as that of Sect. 2.2. Two models of road segments are generated for the simulation tests (see Fig. 6), with the road slope angles varying in range from -5°to 5°, which is the same as that of the training dataset. The TRPAC of Test Roads 1 and 2 are respectively set to 0.3 and 0.7.
The speed profile of the vehicle shown in Fig. 7 is generated based on the complete New European Driving Cycle (NEDC). NEDC simulates the driving process of vehicles in general urban and suburban areas, including multi-  ple acceleration, deceleration, constant speed driving and parking stages, with the speed in range of 0 to 120 km/h. The vehicle speed is controlled to follow the desired speed according to the speed profile using a proportion-integraldifferential (PID) controller. In order to simulate the finetune behavior of steering wheel angle for lane keeping, gaussian noise is applied as steering wheel angle input [24]. In total, 4 tests are made under the conditions as follows:  Fig. 8 and Table 3.
As can be seen in Table 3, the average relative estimation error of fusion-based estimation method is lower than that of each single estimation method. It should be noticed that compared with each single estimation method, the time of fusion-based method in which the error is within 5% is much longer (with the value of 80%-90%), verifying the significant advantage of robustness to various driving conditions of the fusion method. As can be seen from Fig. 8, the ML-based estimate of vehicle mass shows generally good accuracy of around 95%, but most of the time keeps oscillating, especially when the acceleration of the vehicle suddenly changes, which is especially negative for the application to control systems [25]. The dynamics-based estimate, on the contrary, shows generally better stability (except the significant oscillations when vehicle starts). This is because the estimation converges every time after the vehicle starting process and the estimation result is maintained until the next vehicle starting, so it cannot be affected by the disturbances and noises of the vehicle state parameter signals most of the time. However, the accuracy of the convergence value is not always guaranteed, depending on the excitation in starting process. In comparison, the fu-sion method generally shows better accuracy, stability and robustness to variable driving conditions. Compared with each single estimation method, the error is reduced by up to 3 percentage points, and the percentage of time in which the error is within 5% is increased by more than 10 percentage points. This is because it fuses ML-and dynamicsbased estimation result properly, places larger weight on more reliable results and makes them complementary to each other.

Conclusion
In this paper, a vehicle mass estimation method based on fusion of machine learning and vehicle dynamic model is proposed for intelligent vehicles.
(1) By constructing and training a feedforward neural network using data collected from a series of simulation experiments under variable driving conditions, the mapping relationship between vehicle mass and other vehicle state parameters is learnt, and ML-based vehicle mass estimation is realized. (2) The longitudinal vehicle model is established and method of recursive least square with forgetting factor is designed on the basis of this. The dynamics-based estimate of vehicle mass is then obtained. (3) The framework of fusion-based vehicle mass estimator is proposed. By judging the current driving condition based on vehicle state parameters, a fuzzy logic system is designed to fuse ML-and dynamics-based estimate of vehicle mass into the final estimation result. (4) Simulation tests with various driving conditions are carried out based on CarSim-Simulink co-simulation platform, to validate the effect of the proposed fusion-based vehicle mass estimation method. The results show that the accuracy of the fusion-based method reaches 97% (relative error of 3%). Compared with each single estimation methods, the fusion-based method shows better accuracy, stability and robustness to driving conditions. The relative error is reduced by up to 3 percentage points, and the percentage of time in which the error is within 5% is increased by more than 10 percentage points.