Hands-on detection for steering wheels with neural networks
In this paper the concept of a machine learning based hands-on detection
algorithm is proposed. The hand detection is implemented on the hardware side
using a capacitive method. A sensor mat in the steering wheel detects a change
in capacity as soon as the driver's hands come closer. The evaluation and final
decision about hands-on or hands-off situations is done using machine learning.
In order to find a suitable machine learning model, different models are
implemented and evaluated. Based on accuracy, memory consumption and
computational effort the most promising one is selected and ported on a micro
controller. The entire system is then evaluated in terms of reliability and
response time.
Michael Hollmer, Andreas Fischer
# Hands-on detection for steering wheels with neural networks

###### Abstract

In this paper the concept of a machine learning based hands-on detection algorithm is proposed. The hand detection is implemented on the hardware side using a capacitive method. A sensor mat in the steering wheel detects a change in capacity as soon as the driver's hands come closer. The evaluation and final decision about hands-on or hands-off situations is done using machine learning. In order to find a suitable machine learning model, different models are implemented and evaluated. Based on accuracy, memory consumption and computational effort the most promising one is selected and ported on a micro controller. The entire system is then evaluated in terms of reliability and response time.

 machine learning, hands-on detection, driving assistance +
Footnote †: publicationid: _6-7 October 2022, Barcelona, Spain_

## I Introduction

The development of advanced driver assistance systems is an essential goal for car manufacturers. As can be seen from a survey, driver assistance systems are by now an important purchase criterion for over 60% of potential buyers [1]. In addition, a unique selling point over the competition and thus a competitive advantage can be gained through the further automation of vehicles. An example is the system from Mercedes-Benz, which was the first to receive approval for autonomous driving at level 3 in December 2021.

Autonomous driving at level 3 enables the driver to divert his attention from what is happening on the road in certain situations. The vehicle takes over the lateral and longitudinal guidance and independently recognizes errors or departure from system limits. In such a case, the system would prompt the driver to take back control of the vehicle. This transfer of vehicle control is a crucial challenge. An autonomous system must be able to recognize whether the driver is ready to take over control of the vehicle again. To ensure this, some form of driver monitoring is required. One way of detecting the driver's condition is a hands-on detection (HOD). This is a system that detects whether the driver's hands are on the steering wheel and therefore control over the vehicle can safely be transferred.

A HOD can be implemented inexpensively by measuring steering angle and torque acting on the steering wheel. The necessary sensors are required for the servo-assistance, anyway. However, there is the disadvantage that false hands-off messages often occur in situations where the driver does not exert any significant force for lateral guidance. In such a case, the driver would be asked to put his hands back on the steering wheel, even though he has not let go of the steering wheel.

A better HOD variant, also used in this paper, uses a capacitance sensor. This allows to detect the driver's contact with the steering wheel, without relying on any exerted force to the steering wheel. However, the evaluation of capacitance values is more complex, since these are dependent on the driver and his environment.

In this paper a machine learning algorithm is implemented, which is able to distinguish between a hands-on and a hands-off situation based on the capacitance values. The AI model is then ported to a micro controller and the reliability and response time of the HOD is evaluated. A maximum response time of 200ms is assumed to be appropriate for timely HOD. This paper aims to answer the question: Can neural networks increase reliability of HOD within a response time of 200ms?

## II Background

Two techniques are combined in this paper to realize HOD: Capacity measurement and machine learning.

### _Capacity measurement_

One option to realize HOD is detection of a contact between the driver and the steering wheel by measuring the change in capacitance. There are different methods to measure the capacitance of the steering wheel. In this paper, a frequency-based measurement method is used. Touching the steering wheel is detected by a change in capacitance in a sensor element, with the capacitance being calculated indirectly from the measured frequency. The sensor element represents a measuring capacitor which forms a resonant circuit together with another capacitor and a coil. The frequency of the resonant
circuit can be calculated using equation 1, which describes an ideal resonant circuit.

\[f_{0}=\frac{1}{2\pi\sqrt{L(C_{k}+C_{s})}} \tag{1}\]

The equation depends on the capacitance of the capacitor \(C_{k}\), the capacitance of the sensor element \(C_{s}\) and the inductance of the coil \(L\). As long as the steering wheel is in an untouched state, the resonant circuit oscillates with its maximum frequency \(f_{0}\). If the driver puts his hands on the steering wheel, the capacity of the sensor element is increased, leading to a reduction in the frequency of the resonant circuit.

The sensor element is a capacitive mat that is wrapped around the core of the steering wheel and represents the active part of the measuring capacitor. Since there is no opposite side, a stray electric field forms between the active capacitor side and the environment. An approaching object causes a change of the capacitance value of the sensor element.

To illustrate, the measuring capacitor can be seen as a plate capacitor, which can be described by the equation \(C=\epsilon_{0}\cdot\epsilon_{r}\cdot\frac{A}{d}\). Here, both electrically conductive and non-conductive objects cause a change in capacitance for different reasons. A nearby conductive object causes the distance \(d\) between the active capacitor side and its surroundings to decrease, increasing the capacitance. On the other hand, non-conductive objects lead to an increase in capacity via a change in relative permittivity \(\epsilon_{r}\).

### _Machine learning approaches_

To classify the capacitance values four different machine learning models are trained. In the following a brief overview of the different approaches is given.

#### Ii-B1 Time Delay Neural Network

One machine learning approach is the Time Delay Neural Network (TDNN). The TDNN is structured as a standard multiperceptron with a delay buffer connected in front. New values in a time series are buffered until a certain amount is reached. Subsequently, these buffered values are passed in a final input into the multiperceptron, which then carries out the classification [2].

#### Ii-B2 Long Short Term Memory

As a second approach to classify the capacitance values a Long Short Term Memory (LSTM) net, a variant of a recurrent neural network is used. In difference to feed-forward networks like the TDNN, the neurons of the LSTM can have connections to neurons in the previous layer, to the same layer or to themselves, in addition to the standard forward-pointing connections. The feedback loops implement a memory, which allows the network to remember previous events [2]. This is an advantage in time-dependent series of measurements, since each measured value is dependent on its predecessor in a certain way. In contrast to TDNN, which assumes independent measured values, recurrent neural networks can use this memory to take account of the temporal dependency [3].

#### Ii-B3 Random Forest

The last approach is the random forest which combines the prediction results of multiple decision trees using the bootstrap aggregating (bagging) method. The idea behind bagging is to train several decision trees with a subset of the training data. The subsets are created by randomly selecting samples from the entire training data. This process is also called bootstrapping [4]. The result are multiple decision trees that are structured differently and ideally even out in their classification errors. The output of the random forest is the class chosen by most of the decision trees.

## III Related Work

Other work also used machine learning to develop HOD, differing in sensors, algorithms, and response times.

Johansson and Linder [5] used a camera system and the torque acting on the steering wheel to implement HOD. For the camera, two CNN approaches were compared in classifying the most recently acquired image. For evaluating the torque measurement a one-dimensional convolutional neural network and an LSTM network were used. According to the authors, the evaluation of the torque requires a few seconds to detect a hands-off situation and up to two seconds to detect a hands-on. The camera approach reacted to a situation change within 5.4 seconds. Both solutions are thus well above the response time of 200ms we aim for in this work.

Hoang Ngan Le et al. [6] have also developed a machine learning based HOD with a camera system. In their paper the image evaluation is performed by a Region Based Convolutional Neural Network (RCNN) which has been improved for the specific purpose. The improved RCNN achieved 0.09 frames per second, which roughly corresponds to the evaluation of one frame every eleven seconds. As such, the time required for detection is also well above the 200ms limit.

A solution not based on machine learning was published as a patent by Volkswagen AG. This connects two possible approaches for HOD. On the one hand, the values of the steering angle or torque sensor are used and on the other hand, the capacitance values of the steering wheel are considered to distinguish between a hands-on and hands-off situation. The idea behind the combined approach is to use the torque sensor to detect hands-on situations with high confidence. During these situations, the corresponding capacitance values are recorded. With the data a function is set up with which it is possible to quickly decide for each new capacitance value whether it corresponds to a hands-on or hands-off situation [7].

Another non machine learning option for evaluating capacitance sensors was published by Analog Devices [8] and relies on dynamic threshold values. An algorithm continuously monitors the values of the capacitance sensor and measures the ambient level if no touch is detected. In addition, the average maximum sensor value is measured with each touch. The threshold from which a capacitance increase is counted as a touch is a certain percentage of the average measured maximum sensor value.

These approaches bear a potential problem: If the driver only touches the steering wheel very lightly, the measured average maximum sensor value decreases. The dynamic threshold adapts to the small capacitance values. Thus, at some point a slight increase in capacitance values is erroneously
recognized as a touch. If the driver brings both hands close to the steering wheel without touching it, this could trigger a similar increase in capacity as previous two-finger touch. The HOD would then recognize a hands-on situation even though the driver is not touching the steering wheel.

## IV Experimental description

The implementation of the different machine learning models is divided into several steps. First, training data is recorded, classified and processed, which is then used to train the machine learning models. Based on the model results, the most promising model is selected and transferred to a micro controller. Finally, the system is evaluated in terms of reliability and response time.

### _Generating training data_

For generating the training data, the steering wheel is alternately touched and released at defined points for five seconds. This process is repeated 30 minutes each for a two-finger, four-finger and two-hand touch. Figure 1 shows the points of contact. It should be noted that the points in the figure do not only refer to the front of the steering wheel. Alternately also the outside, the back and the inside were touched. Regarding the sampling rate a new capacitance value was recorded every 2 ms.

### _Preprocessing data for learning_

After recording the training data two preprocessing steps were implemented. In the first step, every sample was assigned a "hands-on" or "hands-off" label. This was automated by following the change in capacitance when touching or releasing the steering wheel. The corresponding edge was used to separate and label all samples. Once the difference between two measured capacity values is above noise level, it is interpreted as an edge. The required change in capacitance to trigger an edge was set separately and fine tuned for each of the three data sets. A rising edge triggers the "hands-on" label, while a falling edge triggers the "hands-off" label.

In the second preprocessing step, every sample in the dataset was normalized in its length. This was done because the machine learning model should learn to classify a hands-on or hands-off situation based on capacitance values of just a few hundred milliseconds to speed up the reaction time of the HOD. Therefore a window with a fixed length of 100 values is placed over every sample. The values in the window form the input for the machine learning models. In each step, this window is moved one value, dropping an old value and adding a new value. Thus, all models have a fixed length input of 100 capacitance values, corresponding to 200 ms of recorded time.

### _Preparation of gradient data_

In order for the machine learning models to deliver optimal results, capacitance values have to be normalized. For this, it is necessary to obtain minimum and maximum capacitance value during execution. In the training phase this is not a problem because all data is known a-priori. In a real world application this is not the case, which means that minimum and maximum values have to be determined dynamically. An estimate of the minimum value can be obtained by measuring the ambient level when the steering wheel is untouched. The maximum value, however, is a greater challenge. It would require the driver to place both of his hands on the steering wheel, which the system can never be sure is the case. Additionally, estimating the maximum value from the minimum value is not possible, as the change in capacitance caused by a driver heavily depends on his body weight. To eliminate this issue, the absolute capacitance values were converted into gradient values, focussing on change in capacity over time instead. This makes it easier to normalize the values, since only the maximum capacitive rate of change need to be known. Figure 2 shows gradient values when the steering wheel is touched with one hand.

## V Evaluation

For the evaluation all machine learning approaches are trained with the created datasets. The most promising model is then selected and ported to the STM32F769 micro controller where the final reliability and reaction time testing is done.

### _Training_

In order to decide which machine learning model is best suited for the classification task, all models are trained with five different combinations of parameters. The resulting machine learning models are examined based on memory consumption, execution time and reliability.

Fig. 1: Contact points on the steering wheel during the training phase

Fig. 2: Change in capacity when the hand is approached
#### Iv-A1 Without gradient data

First, the models are trained with absolute capacitance values. All models achieve a very high level of accuracy as well as precision and recall, with differences visible mainly in memory usage and execution time (cf. Tab. I). With no major difference in accuracy, the random forest requires far more memory than other models, which is particularly disadvantageous for embedded systems. Therefore, measuring the execution time was neglected.

Looking at the neural networks, the biggest difference is the execution time. While the TDNN only need a few microseconds for a forward pass, the LSTM networks need several milliseconds due to their more complex structure. This is relevant, because data is sampled with a rate of 2ms in the experiments. Thus, when used on the micro controller, LSTM networks with more than one hidden neuron lose data because the measurement is faster than the processing.

#### Iv-A2 With gradient data

Looking at the models trained with the gradient data, the previously observed disadvantages regarding the memory consumption of the random forest remain (cf. Tab. II). The processing time of the LSTM is still inferior to that of the TDNN. However, the LSTM with a hidden neuron performs slightly better in accuracy, precision and recall compared to the TDNN with 50 hidden neurons and occupies with 27 kB of memory almost just a third of the memory. The TDNN on the other hand, offers a significantly shorter execution time. The delay between input and output for the TDNN with 50 hidden neurons is only 150 \(\mu\)s compared to the 0.6 ms of the smallest LSTM. Training the TDNN takes 1:08 minutes which is only a fraction of the training time for the LSTM, which takes 20:48 minutes. For this reason the TDNN with 50 hidden neurons was selected and ported to the micro controller.

### _Practical reliability test_

To test if the system recognizes touches by the driver reliably, the steering wheel was touched with two fingers, four fingers one hand and two hands at the points shown in figure 1. In the runs in which the steering wheel was touched with two and four fingers, a distinction was made between touching the front, back, inside and outside for each point. In each of the four runs, all points were touched ten times to see whether touches were only recognized sporadically in some places.

In these experiments, the recognition of two fingers proved to be the most difficult. Especially on the inside, where there is a seam, the distance to the sensor mat is particularly large. This decreases sensitivity and a touch triggers only a small increase in capacitance, resulting in no touch detection at all for the two finger experiments and a maximum of 7 out of 10 correctly identified events in the four finger experiment.

Regarding the position, the 6 o'clock position proved to be difficult, both with two and with four fingers. Somewhat less (but still noticeably) impacted positions were the 3 o'clock and 9 o'clock positions. These three positions are located, where the steering wheel spokes connect to the wheel--likely the root causes of the problem.

In the 10 and 2 positions typical for driving a car, all events were recognized reliably irrespective of finger count, as long as any area apart from the inside of the wheel was touched. Also, when the steering wheel was not just touched, but gripped with one or two hands, the success rate rose to 100%.

### _Reaction time_

Next, the reaction time of the system was tested with two fingers which represents the hardest challenge as shown in the previous section. Fig. 3 shows the capacitance values over time
when the steering wheel was touched with two fingers. The red line represents the threshold from which the steering wheel was actually touched and released. The increase in capacitance below the red line is caused by approaching the fingers but not having made contact yet. Reaction time measurement is started, when the capacitance values first exceed the threshold and stopped when the values drop below it. In ten experimental runs, results ranged between 108ms and 294ms for "hands-on" events and a significantly faster reaction time of 30-60ms for "hands-off" events, if two fingers were used. With four fingers, reaction times could be reduced to 74-94ms (hands-on) and 38-58ms (hands-off), respectively.

## VI Conclusion

The results show that it is possible to use a machine learning algorithm to evaluate capacitance values for HOD and achieve fast reaction times. By using the change in capacitance instead of the absolute values in the machine learning model, the problem of normalizing the input values was solved and the HOD worked without external calibration, independent of the driver and environment.
