Click here to Skip to main content
15,881,687 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have an IOT device sending the following information every second from a car that is being driven:

-Timestamp
-GPS co-ordinates (latitude/longitude)>
-GPS bearing or Azimuth
-Vehicle speed from GPS
-Accelerometer readings on X, Y and Z axis.
From this information I have to identify the below driving events:

-Braking
-Acceleration
-Left turn
-Right turn

I am trying to achieve this using neural-network from the ENCOG .net library and am trying to find answers to the below questions:
1. How can I format the input so that it can be fed to the neural network? What I have is a matrix of information with 8 columns and a variable number of rows:

Eg:- A Right turn could be a matrix like below

Timestamp  Lattitude  Longitude   Azimuth     Speed  Xacc        Yacc        Zacc
4:57:08 PM 39.937185  -74.9530667 305.3293762 0     -0.904202607 0.33408456  0.105773433
4:57:09 PM 39.93719   -74.95307   303.1105042 0     -0.89096231  0.37406743  0.091855986
4:57:10 PM 39.9372067 -74.9530783 299.4731445 9     -0.880157497 0.395575262 0.058842602

Similarly a left turn could be

Timestamp  Lattitude  Longitude   Azimuth     Speed Xacc         Yacc        Zacc
4:57:26 PM 39.9377    -74.954015  257.7362976 18    -0.932709113 0.267096326 -0.024819622
4:57:27 PM 39.937715  -74.9540733 247.346344  18    -0.94067372  0.271379559 -0.054581382
4:57:28 PM 39.937715  -74.9541317 225.6322174 17    -0.923718111 0.293954308 -0.081829668
4:57:29 PM 39.937695  -74.9541917 213.6928406 20    -0.911598183 0.317324907 -0.128199049
4:57:30 PM 39.93766   -74.9542433 208.975174  24    -0.90052994  0.351010895 -0.121179532
4:57:31 PM 39.9376017 -74.9542833 205.9306641 28    -0.891561502 0.373537211 -0.078259489
4:57:32 PM 39.9375367 -74.9543267 206.532135  31    -0.891412538 0.389423688 -0.047274249

2. What neural-network patterns and typologies could be applied to solve it?

3. What kind of training algorithm(s) could be used?


I would appreciate it if someone could throw light on an approach to this problem.

What I have tried:

Here is how I am attempting to solve this.

Reduce the input matrix to contain only information that is relevant to identify the events. So the following columns are discarded from the input
-Timestamp
-Latitude
-Longitude and
-Speed
2.The reduced input would look like

Az      Xacc        Yacc
257.736 -0.93270911 0.267096326
247.346 -0.94067372 0.271379559
225.632 -0.92371811 0.293954308
213.693 -0.91159818 0.317324907
208.975 -0.90052994 0.351010895
205.931 -0.8915615 0.373537211

3.Interpolate/extrapolate the input to have at least 10 instances (rows)

4.Flatten the 10 rows to a vector containing 30 values as below

Az1     Xacc1       Yacc1       Az2     Xacc2       Yacc2       Az.. Xacc.. Yacc..   Az10       Xacc10      Yacc10      Target
257.736 -0.93270911 0.267096326 247.346 -0.94067372 0.271379559 ..   ..     ..       206.532    -0.89141254 0.389423688 Left

5.Use a Feedforward pattern like Multilayer perceptron with

-30 input neurons
-2 hidden layers
-4 output neurons
-Activation function: Hyperbolic tangent
6.Train using Resilient propagation

Please feel free to let me know your thoughts on this solution.
Posted
Updated 15-Jan-17 10:16am
v2
Comments
Nick_3141592654 13-Apr-17 18:33pm    
I take it this is an MEng project or a job for a major customer? You surely aren't diving into using a neural network in this way unless there's a good reason. (Wanting to play with a Neural net would be a good reason if you had a few months to spare).

Seriously, did you consider a much simpler approach? The data you're capturing could easily be put through a set of simple recursive first-order filters (Yn+1 = Yn * Alpha + Xn * Beta, where Xn is one of your raw measurements and Yn is the filtered value; Alpha + Beta = 1 and as Alpha gets closer to 1.0 you filter does more smoothing).

Given smoothed data with all those random jerks suppressed, just do some simple thresholding:

e.g. If Avg-Speed > <something> we're driving.

Hardest to handle will be the accelerometer readings, but assuming that your GPS device is rigidly attached to the vehicle you can cope with this. Such an attachment is crucial because this ensures that X, Y and Z have consistent meanings: If you were using a hand-held GPS device then of course X, Y, Z are going to change arbitrarily as the device's orientation in 3-D space changes. You can integrate acceleration measurements to obtain speed in X, Y, Z directions.

All of this is a little tricky and subject to short-term noise and long-term drift effects (especially when you start integrating your measurements). However this wheel has been made lots of times before. Look around and you will find standard solutions detailed, which don't need a neural net.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900