http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 11
Participatory Platform for
Trip Quality Measurement
Intelligent Systems Centre, NTU
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 22
Outline
 Core Work Done For The Project
 System Architecture
 iOS/Android App Development
 Backend Development
 Data Analytics
 Project Website
 Data Collection and Testing
 Performance Evaluation
 Demo
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 33
Core Work Done For The Project
 TripQ app (both iOS and Android). Developed the trip rating
module and feedback interface for users to report bumping and
jamming events.
 Released the TripQ app to both the Apple App Store and the
Google Play Store.
 Backend server development, including database and data
processing.
 Develop the web portal for user (personal trip data visualization
and retrieval) and agency (global information visualization).
 Trip quality analytics development.
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 44
System Architecture
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 55
iOS/Android App Development
 High sampling rate (100 Hz) for accelerometer (low battery usage),
because according to sampling theory the sampling frequency should
be two times that of the signal bandwidth.
 Capture all the raw accelerometer data.
 Set the GPS sampling rate as 1 point per second (1Hz).
 Map and merge the accelerometer data between two GPS sampling
points to match with the same sampling rate of GPS.
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 66
Backend Development
 Platform access logics and portal:
• For user: obtain the trip analytics results and trip data
retrieval.
• For agency: process and obtain the global information
about the traffic based on the participatory data.
 Service Modules:
• Data Management Service: Data upload/Storage/Summary
modules
• Data Retrieve Service: ID Manager/File locator/Filter
• Data Provisioning Service
• Data Analytics Service
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 77
Data Analytics
 Core Data Analytics Algorithms
• TQI calculation and statistics (e.g. mean, standard
error)
• Pumping and jamming detection algorithm
• Distinguish bumping and jamming
• Moving time percentage calculation
• Data aggregation per day
• Data summary versus time for different areas
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 88
Bumping and Jamming Detection
Algorithm Complexity: O(n)
 Using peak searching
algorithm
• Define a peak function
• Define a window size
• Filter the results
 Peak function is based on
information entropy .
 Large value of entropy
means an event occurred.
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 99
Distinguish Bumping and Jamming
2 2
2 2 2
( ) /
| | | |
| | ( ) ( )
| | ( ) ( ) ( )
event v h total
z
v t
x y
h t t
x y z
total t t t
R Vector Vector Vector
Vector a
Vector a a
Vector a a a
= −
=
= +
= + +
eventR has value between [-1, 1], the sign can distinguish the
bumping and jamming events, the value gives the information
of how pure of the event is bumping or jamming
 Bumping will result in vertical acceleration.
 Jamming will result in horizontal acceleration.
 Bumping indicates the road situation.
 Jamming may be caused by diver behavior or road situation.
 We define an event ratio to distinguish the bumping and
jamming events.
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 1010
Moving Time Calculation
Algorithm Complexity: O(n)
 Define a stop time left and right
boundary based on the location
speed data
 One time scan to calculate the
total stop time
 Calculate the moving time and
percentage
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 1111
Overall TQI for Whole Trip
Using our algorithm, we compute a list of statistical metrics:
 Expected Value of instant TQI for whole trip, Ev
 Standard Deviation of instant TQI, Sd
 Events (normalized bump/jam) per minute, events
 Percentage Time in moving, moving
 User Ratings, ratings
By weighting the list of metrics and mapping them to [0,100] for the
whole trip, we compute the Overall TQI :
0.3 0.1 0.3 0.1 0.2Ev Sd events moving ratings+ + + +
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 1212
Global Info Summary
 Data aggregation per day
• Aggregate the data from all the users each day to analyze
and visualize the global traffic information.
• Generate heat map to visualize a list of trip metrics
including TQI, bumping/jamming, speed.
 Data summary versus time for different areas
• Analyze the area based trip behavior along the time axis.
• For each area, a list of metrics including TQI,
bumping/jamming event, user number, trip number, data
sampling number are summarized.
• Geo location algorithms etc. such as to calculate
longitude/latitude in which area are applied to do the
statistical summary.
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 1313
Project Website
The project website is :
http://sensorgrid.ntu.edu.sg/tripq/
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 1414
Using the Project Website
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 1515
Web GUI for User
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 1616
Web GUI for Agency
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 1717
Data Collection and Testing
 Internal testing:
• Start from Nov 2014. Mainly conduct data collection in NTU
campus and surrounding area.
 Collaborate with Cedar Girls’ Secondary School for platform
functional testing:
• Testing activity started from early March until now.
• More than 100 users use the App/platform.
• More than 700 trips data uploaded (over 500 trips with
enough correctly recorded data).
• After launching the activities, every day we have about 10
new trips and over 1000 data samples per day.
• The global information is summarized from Nov until now.
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 1818
Performance Evaluation
 TQI calculation is based on ISO 2631 standard by processing
the accelerometer data in three axis.
 For bumping/jamming detection algorithm, we check all the
trips during 1 Mar-15 Apr 2015 with user feedback and obtain
consistent results.
 The accuracy rate (for each trip, if all the bump/jam points
feedback are covered by the algorithm, then it counts a
successful calculation) is over 86%(31/36).
 Accuracy rate for reported event detection is over
93%(169/180).
 It should be noted that our users may not always correctly give
feedback, and there is no doubt that sensor data are more
sensitive than peoples’ subjective feedback.
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 1919
Performance Evaluation
 After processing by our algorithm, the participatory data from
users’ smartphone provide consistent results with basic intuition
and facts:
• The trip TQI on highway is better than on small streets.
• Jamming normally happen near road turning/branch,
pedestrian crossing, or traffic lights.
• Traffic speed is lower near traffic lights and turning areas.
• The statistics about the contributed trip data and users
distribution for each area are also consistent with fact.
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 2020
Performance Evaluation
We calculate the distribution of all the trips’ TQI
 The TQI of most trips is below 50.
 Only small number of trips at both ends of the profile.
 Two peaks at [7-14] and [21-28].
 More than half the trips have TQI in the range [17-31].
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 2121
Demo
 Client App Demo(iOS/Android)
 Web Portal Demo
 Trip Analytics
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 2222
Questions ?
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 2323
' cos 0 sin 1 0 0 cos sin 0 0
' 0 1 0 0 cos sin sin cos 0 0
sin 0 cos 0 sin cos 0 0 1'
x
y
z
g
g
gg
ω ω θ θ
φ φ θ θ
ω ω φ φ
  −       
         = −         
  −               
' cos 0 sin 1 0 0 0
' 0 1 0 0 cos sin 0
sin 0 cos 0 sin cos'
x
y
z
g
g
gg
ω ω
φ φ
ω ω φ φ
       
       = −       
  −           
' cos sin sin cos sin 0
' 0 cos sin 0
sin sin cos cos cos'
x
y
z
g
g
gg
ω φ ω φ ω
φ φ
ω φ ω φ ω
     
     = −     
  −       
' cos sin
' sin
cos cos'
x
y
z
g g
g g
gg
φ ω
φ
φ ω
   
   = −   
     
1 '
tan
'
x
z
g
g
φ −
=
1
2 2
'
tan
' '
y
x z
g
g g
ω − −
=
+
Step 1: calculate the rotation angle between device status and inertial coordinate
Trip Quality Index Calculation
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 2424
Step 2: calculate acceleration vector component in inertial coordinate
Note:
1.The value of θ is not determined by the sensed value of acceleration (g’), but of magnetic
field. However, the value of θ has no effect on trip quality index, so it is not necessary to obtain
the value of magnetic field.
2.The sign of the accelerometer components are not important which will be squared while
calculating the trip quality index.
1 1
cos 0 sin 1 0 0 '
0 1 0 0 cos sin '
sin 0 cos 0 sin cos '
x x
y y
zz
Accel Accel
Accel Accel
AccelAccel
ω ω
φ φ
ω ω φ φ
− −
       
       = −       
  −           
cos sin sin cos sin '
0 cos sin '
sin sin cos cos cos '
x x
y y
zz
Accel Accel
Accel Accel
AccelAccel
ω φ ω φ ω
φ φ
ω φ ω φ ω
  −   
     =     
  −       
Trip Quality Index Calculation
http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 2525
Step 3: calculate acceleration and trip quality index
ISO 2631 standard[1]:
[1] ISO. ISO 2631-1-1997: Mechanical vibration and shock Evaluation of human exposure to whole-body vibration. International Organization for
Standardization, Geneva, Switzerland, 1997.
*Cheng-Yu Lin, Ling-Jyh Chen, Ying-Yu Chen, and Wang-Chien Lee, “Comfort Measuring System for Public Transportation Systems Using
Participatory Phone Sensing”
2 2 2
(1.4a ) (1.4a )x y z
t t t ta a= + +
Expressed in log(dB):
5 2
20log , 10 / sect
t ref
ref
a
L a m
a
−
= =
100, 103
5 ( 83)
0, 83
t
index t
t
L
Q L
L
>

= × −
 <
Trip Quality calculation:
Trip Quality index calculation

Participatory Project

  • 1.
    http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 11 Participatory Platformfor Trip Quality Measurement Intelligent Systems Centre, NTU
  • 2.
    http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 22 Outline  CoreWork Done For The Project  System Architecture  iOS/Android App Development  Backend Development  Data Analytics  Project Website  Data Collection and Testing  Performance Evaluation  Demo
  • 3.
    http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 33 Core WorkDone For The Project  TripQ app (both iOS and Android). Developed the trip rating module and feedback interface for users to report bumping and jamming events.  Released the TripQ app to both the Apple App Store and the Google Play Store.  Backend server development, including database and data processing.  Develop the web portal for user (personal trip data visualization and retrieval) and agency (global information visualization).  Trip quality analytics development.
  • 4.
  • 5.
    http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 55 iOS/Android AppDevelopment  High sampling rate (100 Hz) for accelerometer (low battery usage), because according to sampling theory the sampling frequency should be two times that of the signal bandwidth.  Capture all the raw accelerometer data.  Set the GPS sampling rate as 1 point per second (1Hz).  Map and merge the accelerometer data between two GPS sampling points to match with the same sampling rate of GPS.
  • 6.
    http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 66 Backend Development Platform access logics and portal: • For user: obtain the trip analytics results and trip data retrieval. • For agency: process and obtain the global information about the traffic based on the participatory data.  Service Modules: • Data Management Service: Data upload/Storage/Summary modules • Data Retrieve Service: ID Manager/File locator/Filter • Data Provisioning Service • Data Analytics Service
  • 7.
    http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 77 Data Analytics Core Data Analytics Algorithms • TQI calculation and statistics (e.g. mean, standard error) • Pumping and jamming detection algorithm • Distinguish bumping and jamming • Moving time percentage calculation • Data aggregation per day • Data summary versus time for different areas
  • 8.
    http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 88 Bumping andJamming Detection Algorithm Complexity: O(n)  Using peak searching algorithm • Define a peak function • Define a window size • Filter the results  Peak function is based on information entropy .  Large value of entropy means an event occurred.
  • 9.
    http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 99 Distinguish Bumpingand Jamming 2 2 2 2 2 ( ) / | | | | | | ( ) ( ) | | ( ) ( ) ( ) event v h total z v t x y h t t x y z total t t t R Vector Vector Vector Vector a Vector a a Vector a a a = − = = + = + + eventR has value between [-1, 1], the sign can distinguish the bumping and jamming events, the value gives the information of how pure of the event is bumping or jamming  Bumping will result in vertical acceleration.  Jamming will result in horizontal acceleration.  Bumping indicates the road situation.  Jamming may be caused by diver behavior or road situation.  We define an event ratio to distinguish the bumping and jamming events.
  • 10.
    http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 1010 Moving TimeCalculation Algorithm Complexity: O(n)  Define a stop time left and right boundary based on the location speed data  One time scan to calculate the total stop time  Calculate the moving time and percentage
  • 11.
    http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 1111 Overall TQIfor Whole Trip Using our algorithm, we compute a list of statistical metrics:  Expected Value of instant TQI for whole trip, Ev  Standard Deviation of instant TQI, Sd  Events (normalized bump/jam) per minute, events  Percentage Time in moving, moving  User Ratings, ratings By weighting the list of metrics and mapping them to [0,100] for the whole trip, we compute the Overall TQI : 0.3 0.1 0.3 0.1 0.2Ev Sd events moving ratings+ + + +
  • 12.
    http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 1212 Global InfoSummary  Data aggregation per day • Aggregate the data from all the users each day to analyze and visualize the global traffic information. • Generate heat map to visualize a list of trip metrics including TQI, bumping/jamming, speed.  Data summary versus time for different areas • Analyze the area based trip behavior along the time axis. • For each area, a list of metrics including TQI, bumping/jamming event, user number, trip number, data sampling number are summarized. • Geo location algorithms etc. such as to calculate longitude/latitude in which area are applied to do the statistical summary.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
    http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 1717 Data Collectionand Testing  Internal testing: • Start from Nov 2014. Mainly conduct data collection in NTU campus and surrounding area.  Collaborate with Cedar Girls’ Secondary School for platform functional testing: • Testing activity started from early March until now. • More than 100 users use the App/platform. • More than 700 trips data uploaded (over 500 trips with enough correctly recorded data). • After launching the activities, every day we have about 10 new trips and over 1000 data samples per day. • The global information is summarized from Nov until now.
  • 18.
    http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 1818 Performance Evaluation TQI calculation is based on ISO 2631 standard by processing the accelerometer data in three axis.  For bumping/jamming detection algorithm, we check all the trips during 1 Mar-15 Apr 2015 with user feedback and obtain consistent results.  The accuracy rate (for each trip, if all the bump/jam points feedback are covered by the algorithm, then it counts a successful calculation) is over 86%(31/36).  Accuracy rate for reported event detection is over 93%(169/180).  It should be noted that our users may not always correctly give feedback, and there is no doubt that sensor data are more sensitive than peoples’ subjective feedback.
  • 19.
    http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 1919 Performance Evaluation After processing by our algorithm, the participatory data from users’ smartphone provide consistent results with basic intuition and facts: • The trip TQI on highway is better than on small streets. • Jamming normally happen near road turning/branch, pedestrian crossing, or traffic lights. • Traffic speed is lower near traffic lights and turning areas. • The statistics about the contributed trip data and users distribution for each area are also consistent with fact.
  • 20.
    http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 2020 Performance Evaluation Wecalculate the distribution of all the trips’ TQI  The TQI of most trips is below 50.  Only small number of trips at both ends of the profile.  Two peaks at [7-14] and [21-28].  More than half the trips have TQI in the range [17-31].
  • 21.
    http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 2121 Demo  ClientApp Demo(iOS/Android)  Web Portal Demo  Trip Analytics
  • 22.
  • 23.
    http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 2323 ' cos0 sin 1 0 0 cos sin 0 0 ' 0 1 0 0 cos sin sin cos 0 0 sin 0 cos 0 sin cos 0 0 1' x y z g g gg ω ω θ θ φ φ θ θ ω ω φ φ   −                 = −            −                ' cos 0 sin 1 0 0 0 ' 0 1 0 0 cos sin 0 sin 0 cos 0 sin cos' x y z g g gg ω ω φ φ ω ω φ φ                = −          −            ' cos sin sin cos sin 0 ' 0 cos sin 0 sin sin cos cos cos' x y z g g gg ω φ ω φ ω φ φ ω φ ω φ ω            = −        −        ' cos sin ' sin cos cos' x y z g g g g gg φ ω φ φ ω        = −          1 ' tan ' x z g g φ − = 1 2 2 ' tan ' ' y x z g g g ω − − = + Step 1: calculate the rotation angle between device status and inertial coordinate Trip Quality Index Calculation
  • 24.
    http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 2424 Step 2:calculate acceleration vector component in inertial coordinate Note: 1.The value of θ is not determined by the sensed value of acceleration (g’), but of magnetic field. However, the value of θ has no effect on trip quality index, so it is not necessary to obtain the value of magnetic field. 2.The sign of the accelerometer components are not important which will be squared while calculating the trip quality index. 1 1 cos 0 sin 1 0 0 ' 0 1 0 0 cos sin ' sin 0 cos 0 sin cos ' x x y y zz Accel Accel Accel Accel AccelAccel ω ω φ φ ω ω φ φ − −                = −          −            cos sin sin cos sin ' 0 cos sin ' sin sin cos cos cos ' x x y y zz Accel Accel Accel Accel AccelAccel ω φ ω φ ω φ φ ω φ ω φ ω   −         =        −        Trip Quality Index Calculation
  • 25.
    http://www.ntu.edu.sg/intellisyshttp://www.ntu.edu.sg/intellisys 2525 Step 3:calculate acceleration and trip quality index ISO 2631 standard[1]: [1] ISO. ISO 2631-1-1997: Mechanical vibration and shock Evaluation of human exposure to whole-body vibration. International Organization for Standardization, Geneva, Switzerland, 1997. *Cheng-Yu Lin, Ling-Jyh Chen, Ying-Yu Chen, and Wang-Chien Lee, “Comfort Measuring System for Public Transportation Systems Using Participatory Phone Sensing” 2 2 2 (1.4a ) (1.4a )x y z t t t ta a= + + Expressed in log(dB): 5 2 20log , 10 / sect t ref ref a L a m a − = = 100, 103 5 ( 83) 0, 83 t index t t L Q L L >  = × −  < Trip Quality calculation: Trip Quality index calculation