CarCoach is an agent designed to give the driver appropriate and timelY feedback on his driving performance. CarCoach reads data from the car bus and other sources of information and analyze it to identify patterns. Then, it uses the driver’s environment to generate feedback on the driving quality in the form of car seat, steering wheel and pedal vibrations, certain car panel lights, audio tones and messages, while using a physical embedded agent for this purpose. The feedback consists of both criticism and affirmation.
One of the mistakes CarCoach tries to identify is unsafe turns. These turns can be characterized as those that activate a strong force (G) on the car. These turns can be modeled using a Gyroscope. However, CarCoach is supposed to work in standard cars without special gear (such as Accelerometers). Thus, it models turns based on steering, brake, throttle, speed, and similar information.
The raw data contains a tab-delimited text file.
Speed | Brake Applied | Brake Pressure | Steering | Throttle Position | Turn | Warning |
---|---|---|---|---|---|---|
0 | 0 | 835 | 1920 | 306 | 1 | 0 |
2.679688 | 0 | 862 | 1904 | 306 | 1 | 0 |
3.421875 | 0 | 862 | 1904 | 306 | 1 | 0 |
4.039063 | 0 | 828 | 1904 | 306 | 1 | 0 |
4.46875 | 0 | 844 | 1888 | 306 | 1 | 0 |
4.84375 | 0 | 844 | 1888 | 306 | 1 | 0 |
4.84375 | 0 | 840 | 1888 | 306 | 1 | 0 |
The data was collected by three different drivers.
The number of observations are:
The initial plan was to perform a feature extraction, to reduce dimensionality,
and then to run a HMM, as this is a time series.
The following features have been selected:
The most significant features, that I expected to be part of the single feature were speed and steering.
I used graphical methods.
First, I realized that the most critical point of a turn was its peak – when the steering is maximal.
Second, I scattered all the points (separated to good and bad). I discovered that there’s a trendline of the good points. Therefore, I used only the good turns to develop the model and left the bad turns for the test (and saved the effort and risk of taking bad turns).
I ran in Excel several options for regression trendlines. The Power one was the best fit.
Then, I ran in Matlab the following algorithm, while watching a set of the best results achieved graphically.
A Power curve: aX.^b starting with the Excel parameters.
I changed the parameters every time in the direction of getting a curve that is above most of the points. After finding a curve that covers 90% of the points I plotted it for each point added, to select a good curve without overfitting.
The classifier generated from this procedure is the following discriminant function:
steering=27067*speed.^-1.2967
Therefore, I stayed with 2 dimensions: steering and speed. That had implications, of course, on the analysis.
The graphical presentation is as follows:
Set | Good turns | Bad turns |
---|---|---|
Training | 59/63 (93.65%) |   |
Test | 30/32 (93.75%) | 16/19 (84.2%) |
I find the results satisfactory, mostly because there are not many false classifications of good turns, while bad turns have high recognition.
This is important because criticizing a driver over a good turn is much worse than praising a bad turn.
Graphically:
There is a need to collect more data, while using an accelerometer, so that the classification of the turns would be objective, rather than subjective.