{
  "id": 262588,
  "title": "9th place solution",
  "url": "/competitions/google-smartphone-decimeter-challenge/discussion/262588",
  "author_name": "tarokd",
  "post_date": "2021-08-07T03:36:35.099000",
  "votes": 14,
  "comment_count": 0,
  "views": 0,
  "content": "<p>First, I would like to thank hosts for organizing an exciting competition.</p>\n<p>Here, I introduce my solution.<br>\nMy solution exploits the velocity of the vehicle predicted using doppler shift, which is basically much more reliable than the baseline positions.</p>\n<h3>1. Velocity prediction using doppler shift.</h3>\n<p>Velocity of the vehicle can be estimated using PseudorangeRateMetersPerSecond, as show here:  <a href=\"https://www.kaggle.com/c/google-smartphone-decimeter-challenge/code\" target=\"_blank\">https://www.kaggle.com/c/google-smartphone-decimeter-challenge/code</a></p>\n<h3>2. Smoothing by CNN.</h3>\n<p>A simple 1D convolutional network is applied to the predicted velocity for smoothing.</p>\n<h3>3. Extract reliable points in the baseline.</h3>\n<p>I extracted reliable points in the baseline based on consistency between the velocity and relative position.<br>\nThe consecutive points in the baseline are grouped if the following conditions are satisfied:<br>\n<img src=\"https://i.postimg.cc/vBYch2KT/consistent-group.png\" alt=\"\"><br>\nwhere</p>\n<ul>\n<li><strong>x</strong>t: the baseline position at a time index t,</li>\n<li><strong>v</strong>t: the velocity at a time index t,</li>\n<li>ts, te: time indices of the start and end points of the consistent group,</li>\n</ul>\n<h3>3. Apply snap-to-grid to consistent groups(SJC only).</h3>\n<p>Snap-to-grid is applied to the consistent groups.<br>\nGrid points are generated by the linear interpolation of the ground truth.<br>\nIn order to avoid snapping to an opposite side of road, the orientation degree of the vehicle is added to each grid point.<br>\nThe optimal grid points are obtained by solving the following optimization problem:<br>\n<img src=\"https://i.postimg.cc/5yJsNCnD/snap-to-grid.png\" alt=\"\"><br>\nwhere</p>\n<ul>\n<li>gt: an index of the grid point to which <strong>x</strong>t is snapped,</li>\n<li><strong>u</strong>gt: an unit vector aligned to the orientation degree of the vehicle at the grid point.</li>\n</ul>\n<p>The first term of g(<strong>x</strong>t, <strong>v</strong>t, <strong>x</strong>gt, <strong>u</strong>gt) is the cost related to the distance between the baseline position and the grid points.<br>\nThe second term of g(<strong>x</strong>t, <strong>v</strong>t, <strong>x</strong>gt, <strong>u</strong>gt) is the cost for the deviation between the orientation degree of the velocity and that of the grid points.<br>\nThe above optimization problem can be solved using Dijkstra's algorithm.</p>\n<h3>4. Interpolation based on the velocity.</h3>\n<p>The baseline positions in the consistent groups are fixed.<br>\nBy fixing them, boundary conditions are imposed to the points between the consistent groups.<br>\nIn order to satisfy the boundary conditions, the velocity is modified by solving the following optimization problem:<br>\n<img src=\"https://i.postimg.cc/HkhjMJVN/interpolation-based-on-velocity.png\" alt=\"\"><br>\nwhere</p>\n<ul>\n<li>\\sigma(|<strong>v</strong>t|) is the standard deviation depending on the norm of <strong>v</strong>t, which is estimated using the train set,</li>\n<li>t^{e}_{c}: the time index of end point of the c-th consistent group,</li>\n<li>t^{s}_{c+1}: the time index of start point of the (c+1)-th consistent group.</li>\n</ul>\n<p>Then, the positions between the consistent groups are interpolated as follows:<br>\n<img src=\"https://i.postimg.cc/WbPTZN9n/interpolation-based-on-velocity2.png\" alt=\"\"></p>\n<h3>5. Apply snap-to-grid to the interpolated points(SCJ only).</h3>\n<p>Snap-to-grid are applied to the interpolated points in almost the same way for the consistent groups(Boundary conditions are modified).</p>\n<h3>6.  Smoothing based on the velocity.</h3>\n<p>The positions are smoothed by iteratively solving the optimization problem in \"4. Interpolation based on the velocity\" as shown below:<br>\n<img src=\"https://i.postimg.cc/ht1RFNq1/post-smooth.png\" alt=\"\"></p>\n<h3>7. Ensemble</h3>\n<ul>\n<li>I used several conditions to generate the consistent groups and averaged them.</li>\n<li>The positions of phones in the same collection are averaged with the same weight.</li>\n</ul>\n<h3>8. Result</h3>\n<p>Train: 2.331 / Public: 3.758 / Private: 2.597</p>\n<h3>9. Remaining issues</h3>\n<ul>\n<li>Use IMU data to reduce prediction errors of the velocity.</li>\n<li>Detect stop points and contract them to one point to reduce accumulation errors. <br>\nAlthough the boundary conditions imposed by the consistent groups reduce the accumulation errors, stop points may cause a big problem to the interpolation by the velocity.</li>\n<li>For further improvement, the baseline positions must be improved.<br>\nI will try it by studying other solutions.</li>\n</ul>",
  "messages": [
    {
      "id": 1456673,
      "postDate": "2021-08-07T03:36:35.100Z",
      "content": "<p>First, I would like to thank hosts for organizing an exciting competition.</p>\n<p>Here, I introduce my solution.<br>\nMy solution exploits the velocity of the vehicle predicted using doppler shift, which is basically much more reliable than the baseline positions.</p>\n<h3>1. Velocity prediction using doppler shift.</h3>\n<p>Velocity of the vehicle can be estimated using PseudorangeRateMetersPerSecond, as show here:  <a href=\"https://www.kaggle.com/c/google-smartphone-decimeter-challenge/code\" target=\"_blank\">https://www.kaggle.com/c/google-smartphone-decimeter-challenge/code</a></p>\n<h3>2. Smoothing by CNN.</h3>\n<p>A simple 1D convolutional network is applied to the predicted velocity for smoothing.</p>\n<h3>3. Extract reliable points in the baseline.</h3>\n<p>I extracted reliable points in the baseline based on consistency between the velocity and relative position.<br>\nThe consecutive points in the baseline are grouped if the following conditions are satisfied:<br>\n<img src=\"https://i.postimg.cc/vBYch2KT/consistent-group.png\" alt=\"\"><br>\nwhere</p>\n<ul>\n<li><strong>x</strong>t: the baseline position at a time index t,</li>\n<li><strong>v</strong>t: the velocity at a time index t,</li>\n<li>ts, te: time indices of the start and end points of the consistent group,</li>\n</ul>\n<h3>3. Apply snap-to-grid to consistent groups(SJC only).</h3>\n<p>Snap-to-grid is applied to the consistent groups.<br>\nGrid points are generated by the linear interpolation of the ground truth.<br>\nIn order to avoid snapping to an opposite side of road, the orientation degree of the vehicle is added to each grid point.<br>\nThe optimal grid points are obtained by solving the following optimization problem:<br>\n<img src=\"https://i.postimg.cc/5yJsNCnD/snap-to-grid.png\" alt=\"\"><br>\nwhere</p>\n<ul>\n<li>gt: an index of the grid point to which <strong>x</strong>t is snapped,</li>\n<li><strong>u</strong>gt: an unit vector aligned to the orientation degree of the vehicle at the grid point.</li>\n</ul>\n<p>The first term of g(<strong>x</strong>t, <strong>v</strong>t, <strong>x</strong>gt, <strong>u</strong>gt) is the cost related to the distance between the baseline position and the grid points.<br>\nThe second term of g(<strong>x</strong>t, <strong>v</strong>t, <strong>x</strong>gt, <strong>u</strong>gt) is the cost for the deviation between the orientation degree of the velocity and that of the grid points.<br>\nThe above optimization problem can be solved using Dijkstra's algorithm.</p>\n<h3>4. Interpolation based on the velocity.</h3>\n<p>The baseline positions in the consistent groups are fixed.<br>\nBy fixing them, boundary conditions are imposed to the points between the consistent groups.<br>\nIn order to satisfy the boundary conditions, the velocity is modified by solving the following optimization problem:<br>\n<img src=\"https://i.postimg.cc/HkhjMJVN/interpolation-based-on-velocity.png\" alt=\"\"><br>\nwhere</p>\n<ul>\n<li>\\sigma(|<strong>v</strong>t|) is the standard deviation depending on the norm of <strong>v</strong>t, which is estimated using the train set,</li>\n<li>t^{e}_{c}: the time index of end point of the c-th consistent group,</li>\n<li>t^{s}_{c+1}: the time index of start point of the (c+1)-th consistent group.</li>\n</ul>\n<p>Then, the positions between the consistent groups are interpolated as follows:<br>\n<img src=\"https://i.postimg.cc/WbPTZN9n/interpolation-based-on-velocity2.png\" alt=\"\"></p>\n<h3>5. Apply snap-to-grid to the interpolated points(SCJ only).</h3>\n<p>Snap-to-grid are applied to the interpolated points in almost the same way for the consistent groups(Boundary conditions are modified).</p>\n<h3>6.  Smoothing based on the velocity.</h3>\n<p>The positions are smoothed by iteratively solving the optimization problem in \"4. Interpolation based on the velocity\" as shown below:<br>\n<img src=\"https://i.postimg.cc/ht1RFNq1/post-smooth.png\" alt=\"\"></p>\n<h3>7. Ensemble</h3>\n<ul>\n<li>I used several conditions to generate the consistent groups and averaged them.</li>\n<li>The positions of phones in the same collection are averaged with the same weight.</li>\n</ul>\n<h3>8. Result</h3>\n<p>Train: 2.331 / Public: 3.758 / Private: 2.597</p>\n<h3>9. Remaining issues</h3>\n<ul>\n<li>Use IMU data to reduce prediction errors of the velocity.</li>\n<li>Detect stop points and contract them to one point to reduce accumulation errors. <br>\nAlthough the boundary conditions imposed by the consistent groups reduce the accumulation errors, stop points may cause a big problem to the interpolation by the velocity.</li>\n<li>For further improvement, the baseline positions must be improved.<br>\nI will try it by studying other solutions.</li>\n</ul>",
      "rawMarkdown": "First, I would like to thank hosts for organizing an exciting competition.\n\nHere, I introduce my solution.\nMy solution exploits the velocity of the vehicle predicted using doppler shift, which is basically much more reliable than the baseline positions.\n\n### 1. Velocity prediction using doppler shift.\nVelocity of the vehicle can be estimated using PseudorangeRateMetersPerSecond, as show here:  https://www.kaggle.com/c/google-smartphone-decimeter-challenge/code\n\n### 2. Smoothing by CNN.\nA simple 1D convolutional network is applied to the predicted velocity for smoothing.\n\n### 3. Extract reliable points in the baseline.\nI extracted reliable points in the baseline based on consistency between the velocity and relative position.\nThe consecutive points in the baseline are grouped if the following conditions are satisfied:\n![](https://i.postimg.cc/vBYch2KT/consistent-group.png)\nwhere\n - **x**t: the baseline position at a time index t,\n - **v**t: the velocity at a time index t,\n - ts, te: time indices of the start and end points of the consistent group,\n\n### 3. Apply snap-to-grid to consistent groups(SJC only).\nSnap-to-grid is applied to the consistent groups.\nGrid points are generated by the linear interpolation of the ground truth.\nIn order to avoid snapping to an opposite side of road, the orientation degree of the vehicle is added to each grid point.\nThe optimal grid points are obtained by solving the following optimization problem:\n![](https://i.postimg.cc/5yJsNCnD/snap-to-grid.png)\nwhere\n - gt: an index of the grid point to which **x**t is snapped,\n - **u**gt: an unit vector aligned to the orientation degree of the vehicle at the grid point.\n\nThe first term of g(**x**t, **v**t, **x**gt, **u**gt) is the cost related to the distance between the baseline position and the grid points.\nThe second term of g(**x**t, **v**t, **x**gt, **u**gt) is the cost for the deviation between the orientation degree of the velocity and that of the grid points.\nThe above optimization problem can be solved using Dijkstra's algorithm.\n\n### 4. Interpolation based on the velocity.\nThe baseline positions in the consistent groups are fixed.\nBy fixing them, boundary conditions are imposed to the points between the consistent groups.\nIn order to satisfy the boundary conditions, the velocity is modified by solving the following optimization problem:\n![](https://i.postimg.cc/HkhjMJVN/interpolation-based-on-velocity.png)\nwhere\n - \\sigma(|**v**t|) is the standard deviation depending on the norm of **v**t, which is estimated using the train set,\n - t^{e}_{c}: the time index of end point of the c-th consistent group,\n - t^{s}_{c+1}: the time index of start point of the (c+1)-th consistent group.\n\nThen, the positions between the consistent groups are interpolated as follows:\n![](https://i.postimg.cc/WbPTZN9n/interpolation-based-on-velocity2.png)\n\n### 5. Apply snap-to-grid to the interpolated points(SCJ only).\nSnap-to-grid are applied to the interpolated points in almost the same way for the consistent groups(Boundary conditions are modified).\n\n### 6.  Smoothing based on the velocity.\nThe positions are smoothed by iteratively solving the optimization problem in \"4. Interpolation based on the velocity\" as shown below:\n![](https://i.postimg.cc/ht1RFNq1/post-smooth.png)\n\n### 7. Ensemble\n - I used several conditions to generate the consistent groups and averaged them.\n - The positions of phones in the same collection are averaged with the same weight.\n\n### 8. Result\nTrain: 2.331 / Public: 3.758 / Private: 2.597\n\n### 9. Remaining issues\n - Use IMU data to reduce prediction errors of the velocity.\n - Detect stop points and contract them to one point to reduce accumulation errors. \nAlthough the boundary conditions imposed by the consistent groups reduce the accumulation errors, stop points may cause a big problem to the interpolation by the velocity.\n -  For further improvement, the baseline positions must be improved.\nI will try it by studying other solutions.",
      "votes": 14
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "1456673": "First, I would like to thank hosts for organizing an exciting competition.\n\nHere, I introduce my solution.\nMy solution exploits the velocity of the vehicle predicted using doppler shift, which is basically much more reliable than the baseline positions.\n\n### 1. Velocity prediction using doppler shift.\nVelocity of the vehicle can be estimated using PseudorangeRateMetersPerSecond, as show here:  https://www.kaggle.com/c/google-smartphone-decimeter-challenge/code\n\n### 2. Smoothing by CNN.\nA simple 1D convolutional network is applied to the predicted velocity for smoothing.\n\n### 3. Extract reliable points in the baseline.\nI extracted reliable points in the baseline based on consistency between the velocity and relative position.\nThe consecutive points in the baseline are grouped if the following conditions are satisfied:\n![](https://i.postimg.cc/vBYch2KT/consistent-group.png)\nwhere\n - **x**t: the baseline position at a time index t,\n - **v**t: the velocity at a time index t,\n - ts, te: time indices of the start and end points of the consistent group,\n\n### 3. Apply snap-to-grid to consistent groups(SJC only).\nSnap-to-grid is applied to the consistent groups.\nGrid points are generated by the linear interpolation of the ground truth.\nIn order to avoid snapping to an opposite side of road, the orientation degree of the vehicle is added to each grid point.\nThe optimal grid points are obtained by solving the following optimization problem:\n![](https://i.postimg.cc/5yJsNCnD/snap-to-grid.png)\nwhere\n - gt: an index of the grid point to which **x**t is snapped,\n - **u**gt: an unit vector aligned to the orientation degree of the vehicle at the grid point.\n\nThe first term of g(**x**t, **v**t, **x**gt, **u**gt) is the cost related to the distance between the baseline position and the grid points.\nThe second term of g(**x**t, **v**t, **x**gt, **u**gt) is the cost for the deviation between the orientation degree of the velocity and that of the grid points.\nThe above optimization problem can be solved using Dijkstra's algorithm.\n\n### 4. Interpolation based on the velocity.\nThe baseline positions in the consistent groups are fixed.\nBy fixing them, boundary conditions are imposed to the points between the consistent groups.\nIn order to satisfy the boundary conditions, the velocity is modified by solving the following optimization problem:\n![](https://i.postimg.cc/HkhjMJVN/interpolation-based-on-velocity.png)\nwhere\n - \\sigma(|**v**t|) is the standard deviation depending on the norm of **v**t, which is estimated using the train set,\n - t^{e}_{c}: the time index of end point of the c-th consistent group,\n - t^{s}_{c+1}: the time index of start point of the (c+1)-th consistent group.\n\nThen, the positions between the consistent groups are interpolated as follows:\n![](https://i.postimg.cc/WbPTZN9n/interpolation-based-on-velocity2.png)\n\n### 5. Apply snap-to-grid to the interpolated points(SCJ only).\nSnap-to-grid are applied to the interpolated points in almost the same way for the consistent groups(Boundary conditions are modified).\n\n### 6.  Smoothing based on the velocity.\nThe positions are smoothed by iteratively solving the optimization problem in \"4. Interpolation based on the velocity\" as shown below:\n![](https://i.postimg.cc/ht1RFNq1/post-smooth.png)\n\n### 7. Ensemble\n - I used several conditions to generate the consistent groups and averaged them.\n - The positions of phones in the same collection are averaged with the same weight.\n\n### 8. Result\nTrain: 2.331 / Public: 3.758 / Private: 2.597\n\n### 9. Remaining issues\n - Use IMU data to reduce prediction errors of the velocity.\n - Detect stop points and contract them to one point to reduce accumulation errors. \nAlthough the boundary conditions imposed by the consistent groups reduce the accumulation errors, stop points may cause a big problem to the interpolation by the velocity.\n -  For further improvement, the baseline positions must be improved.\nI will try it by studying other solutions."
  }
}