{
  "id": 261876,
  "title": "2nd place solution",
  "url": "/competitions/google-smartphone-decimeter-challenge/writeups/wojtek-rosa-2nd-place-solution",
  "author_name": "",
  "post_date": "2021-08-05T15:08:50.283Z",
  "votes": 49,
  "comment_count": 10,
  "views": 0,
  "content": "<p>Thank you hosts for such an exciting competition!<br>\nMy final solution can be described as follows:</p>\n<p><img src=\"https://i.ibb.co/VBm4r75/scrn.png\" alt=\"\"></p>\n<p>and I was inspired by Smart PPP algorithm presented <a href=\"https://link.springer.com/article/10.1007/s10291-021-01106-1\" target=\"_blank\">here</a></p>\n<ol>\n<li><p>XGBoost stacked ensemble improved baseline<br>\nI've spend about 3 weeks at this point and started with idea of correcting Baseline PrMs using other device data. This was jumpy but after all it works. Each stacked ensemble model took about 5 hour to train with GPU, and it was hard to validate. In my opinion this gives about 10-40 cm improved baseline. No further smoothing Pseudoranges was applied. Technical trick: amount of correction of PrM was used as weights in WLS algorithm</p></li>\n<li><p>Computing velocity<br>\nI've spend about week on translating WlsPvt.m from gps-measurement google tool in matlab algorithm to python using PseudorangeRateMetersPerSecond and it was 0.08Mps mean average accurate. Technical trick: When algorithm failed I used baseline speedMps described in my notebook position shift. This results improved a lot kalman filtering and mean by stop technique.</p></li>\n<li><p>ADR relative position<br>\nI've spend about week on computing relative position using ADR and I didn't succeeded, thus I've used derived files public version Android GPS tools. It took a lot of time to process raw gnss files in this software, and failed for two phones from test set. Technical trick: some of automatically downloaded ephemeris files were corrupted, thus it works to download them manually and turn off internet for the processing time.</p></li>\n<li><p>Remove outliers<br>\nI took idea from <a href=\"https://www.kaggle.com/dehokanta\" target=\"_blank\">@dehokanta</a> but it was upgraded. Technical trick: If there were two or more consecutive outliers remove and interpolate it</p></li>\n<li><p>Mixing signals from other devices:<br>\nMy very first submissions was starting here. It turns out then median averaging is better then mean, but I've ended with idea found <a href=\"https://stackoverflow.com/questions/55813719/multi-sensors-fusion-using-kalman-filter\" target=\"_blank\">here</a>: which is described as follows:<br>\n<img src=\"https://i.ibb.co/dJddjV9/var.png\" alt=\"\"><br>\nTechnical trick: variance among all epochs is pretty similar so I windowed signal (10-30 epochs adjusted by speed Category and region) </p></li>\n<li><p>Mean by stop<br>\nJust using velocity Mps with threshold adjusted about 0.5-1. At this point (Xgboost + postprocessing: remove_outliers + mixing + kalman + stop) I've reached 3.945 public and 2.379 private</p></li>\n<li><p>Snap to ADR shape<br>\nI used mean adr position - mean position during valid cycle as shift and shifted relative positions. Technical trick: This shift was weighted by adr uncertainity meters (public 3.345 private 1.903)</p></li>\n<li><p>Snap to ground truth<br>\nAt this point i've started to snapping this solution to ground truth (threshold 2m for high speed and threshold way more then 2m for SJC) Technical trick: I've selected SJC regions by mean speed &lt; 6 Mps total. (best public 3.159 private 1.801)</p></li>\n<li><p>Technical trick: joblib + optuna were so useful for me among almost all steps</p></li>\n</ol>\n<p>After all, using  GNSS will never be the same for me thus I've started as a completely newbie - thank you!</p>",
  "messages": [
    {
      "id": "1450882",
      "postDate": "08/05/2021 07:50:46",
      "content": "<p>Thank you hosts for such an exciting competition!<br>\nMy final solution can be described as follows:</p>\n<p><img src=\"https://i.ibb.co/VBm4r75/scrn.png\" alt=\"\"></p>\n<p>and I was inspired by Smart PPP algorithm presented <a href=\"https://link.springer.com/article/10.1007/s10291-021-01106-1\" target=\"_blank\">here</a></p>\n<ol>\n<li><p>XGBoost stacked ensemble improved baseline<br>\nI've spend about 3 weeks at this point and started with idea of correcting Baseline PrMs using other device data. This was jumpy but after all it works. Each stacked ensemble model took about 5 hour to train with GPU, and it was hard to validate. In my opinion this gives about 10-40 cm improved baseline. No further smoothing Pseudoranges was applied. Technical trick: amount of correction of PrM was used as weights in WLS algorithm</p></li>\n<li><p>Computing velocity<br>\nI've spend about week on translating WlsPvt.m from gps-measurement google tool in matlab algorithm to python using PseudorangeRateMetersPerSecond and it was 0.08Mps mean average accurate. Technical trick: When algorithm failed I used baseline speedMps described in my notebook position shift. This results improved a lot kalman filtering and mean by stop technique.</p></li>\n<li><p>ADR relative position<br>\nI've spend about week on computing relative position using ADR and I didn't succeeded, thus I've used derived files public version Android GPS tools. It took a lot of time to process raw gnss files in this software, and failed for two phones from test set. Technical trick: some of automatically downloaded ephemeris files were corrupted, thus it works to download them manually and turn off internet for the processing time.</p></li>\n<li><p>Remove outliers<br>\nI took idea from <a href=\"https://www.kaggle.com/dehokanta\" target=\"_blank\">@dehokanta</a> but it was upgraded. Technical trick: If there were two or more consecutive outliers remove and interpolate it</p></li>\n<li><p>Mixing signals from other devices:<br>\nMy very first submissions was starting here. It turns out then median averaging is better then mean, but I've ended with idea found <a href=\"https://stackoverflow.com/questions/55813719/multi-sensors-fusion-using-kalman-filter\" target=\"_blank\">here</a>: which is described as follows:<br>\n<img src=\"https://i.ibb.co/dJddjV9/var.png\" alt=\"\"><br>\nTechnical trick: variance among all epochs is pretty similar so I windowed signal (10-30 epochs adjusted by speed Category and region) </p></li>\n<li><p>Mean by stop<br>\nJust using velocity Mps with threshold adjusted about 0.5-1. At this point (Xgboost + postprocessing: remove_outliers + mixing + kalman + stop) I've reached 3.945 public and 2.379 private</p></li>\n<li><p>Snap to ADR shape<br>\nI used mean adr position - mean position during valid cycle as shift and shifted relative positions. Technical trick: This shift was weighted by adr uncertainity meters (public 3.345 private 1.903)</p></li>\n<li><p>Snap to ground truth<br>\nAt this point i've started to snapping this solution to ground truth (threshold 2m for high speed and threshold way more then 2m for SJC) Technical trick: I've selected SJC regions by mean speed &lt; 6 Mps total. (best public 3.159 private 1.801)</p></li>\n<li><p>Technical trick: joblib + optuna were so useful for me among almost all steps</p></li>\n</ol>\n<p>After all, using  GNSS will never be the same for me thus I've started as a completely newbie - thank you!</p>",
      "rawMarkdown": "Thank you hosts for such an exciting competition!\nMy final solution can be described as follows:\n\n![](https://i.ibb.co/VBm4r75/scrn.png)\n\nand I was inspired by Smart PPP algorithm presented [here](https://link.springer.com/article/10.1007/s10291-021-01106-1)\n\n1. XGBoost stacked ensemble improved baseline\nI've spend about 3 weeks at this point and started with idea of correcting Baseline PrMs using other device data. This was jumpy but after all it works. Each stacked ensemble model took about 5 hour to train with GPU, and it was hard to validate. In my opinion this gives about 10-40 cm improved baseline. No further smoothing Pseudoranges was applied. Technical trick: amount of correction of PrM was used as weights in WLS algorithm\n\n2. Computing velocity\nI've spend about week on translating WlsPvt.m from gps-measurement google tool in matlab algorithm to python using PseudorangeRateMetersPerSecond and it was 0.08Mps mean average accurate. Technical trick: When algorithm failed I used baseline speedMps described in my notebook position shift. This results improved a lot kalman filtering and mean by stop technique.\n\n3. ADR relative position\nI've spend about week on computing relative position using ADR and I didn't succeeded, thus I've used derived files public version Android GPS tools. It took a lot of time to process raw gnss files in this software, and failed for two phones from test set. Technical trick: some of automatically downloaded ephemeris files were corrupted, thus it works to download them manually and turn off internet for the processing time.\n\n4. Remove outliers\nI took idea from @dehokanta but it was upgraded. Technical trick: If there were two or more consecutive outliers remove and interpolate it\n\n5. Mixing signals from other devices:\nMy very first submissions was starting here. It turns out then median averaging is better then mean, but I've ended with idea found [here](https://stackoverflow.com/questions/55813719/multi-sensors-fusion-using-kalman-filter): which is described as follows:\n![](https://i.ibb.co/dJddjV9/var.png)\nTechnical trick: variance among all epochs is pretty similar so I windowed signal (10-30 epochs adjusted by speed Category and region) \n\n6. Mean by stop\nJust using velocity Mps with threshold adjusted about 0.5-1. At this point (Xgboost + postprocessing: remove_outliers + mixing + kalman + stop) I've reached 3.945 public and 2.379 private\n\n7. Snap to ADR shape\nI used mean adr position - mean position during valid cycle as shift and shifted relative positions. Technical trick: This shift was weighted by adr uncertainity meters (public 3.345 private 1.903)\n\n\n8. Snap to ground truth\nAt this point i've started to snapping this solution to ground truth (threshold 2m for high speed and threshold way more then 2m for SJC) Technical trick: I've selected SJC regions by mean speed < 6 Mps total. (best public 3.159 private 1.801)\n\n0. Technical trick: joblib + optuna were so useful for me among almost all steps\n\nAfter all, using ~~GPS~~ GNSS will never be the same for me thus I've started as a completely newbie - thank you!",
      "votes": null
    },
    {
      "id": "1453260",
      "postDate": "08/05/2021 20:05:12",
      "content": "<p>My congrats nice work!</p>",
      "rawMarkdown": "My congrats nice work!",
      "votes": null
    },
    {
      "id": "1454799",
      "postDate": "08/06/2021 10:29:59",
      "content": "<p>Congrats 2nd place and thank you for sharing!!!</p>\n<p>I have a question, and I am happy you to answer if you have time.</p>\n<p>About XGBoost stacked ensemble improved baseline, what is target value in XGBoost model?<br>\n(Absolute poisition? relative position? separate lat and lng?)</p>",
      "rawMarkdown": "Congrats 2nd place and thank you for sharing!!!\n\nI have a question, and I am happy you to answer if you have time.\n\nAbout XGBoost stacked ensemble improved baseline, what is target value in XGBoost model?\n(Absolute poisition? relative position? separate lat and lng?)",
      "votes": null
    },
    {
      "id": "1454823",
      "postDate": "08/06/2021 10:40:21",
      "content": "<p>Hello :) thanks for question, in fact my diagram is little messy at this point.<br>\nWell target value is <br>\n<code>diffPrM = baselinePrM - groundTruthPrM</code> <br>\nwhere both baselinePrM and groundTruthPrm are computed to satellite position with applied effect of earth rotation<br>\nIn fact I've tested many scenarios of target value and this one works best for me</p>\n<p>P.S congrat to your team achievement surviving shakeup at 6th place with gold!</p>",
      "rawMarkdown": "Hello :) thanks for question, in fact my diagram is little messy at this point.\nWell target value is \n`diffPrM = baselinePrM - groundTruthPrM` \nwhere both baselinePrM and groundTruthPrm are computed to satellite position with applied effect of earth rotation\nIn fact I've tested many scenarios of target value and this one works best for me\n\nP.S congrat to your team achievement surviving shakeup at 6th place with gold!",
      "votes": null
    },
    {
      "id": "1456887",
      "postDate": "08/07/2021 06:15:49",
      "content": "<p>Thank you for a kind answer!!<br>\nGreat idea using PrM prediction!!</p>",
      "rawMarkdown": "Thank you for a kind answer!!\nGreat idea using PrM prediction!!",
      "votes": null
    },
    {
      "id": "1458036",
      "postDate": "08/07/2021 17:16:55",
      "content": "<p>Congratulations!</p>",
      "rawMarkdown": "Congratulations!",
      "votes": null
    },
    {
      "id": "1468166",
      "postDate": "08/12/2021 09:32:46",
      "content": "<p>Congratulations！I am very interested in you great work！ Your solution is wonderful. I will keep this in mind for my future research. Could you show some source code or paper or ideas？</p>",
      "rawMarkdown": "Congratulations！I am very interested in you great work！ Your solution is wonderful. I will keep this in mind for my future research. Could you show some source code or paper or ideas？",
      "votes": null
    },
    {
      "id": "1473032",
      "postDate": "08/15/2021 09:55:34",
      "content": "<p>Congratulations. 　It would be helpful for beginners to share the code.😄</p>",
      "rawMarkdown": "Congratulations. 　It would be helpful for beginners to share the code.😄",
      "votes": null
    },
    {
      "id": "1733886",
      "postDate": "03/24/2022 17:44:13",
      "content": "<p>Congratulations!</p>",
      "rawMarkdown": "Congratulations!",
      "votes": null
    },
    {
      "id": "1754076",
      "postDate": "04/13/2022 11:15:43",
      "content": "<p>Thank you <a href=\"https://www.kaggle.com/michalbrys\" target=\"_blank\">@michalbrys</a> !</p>",
      "rawMarkdown": "Thank you @michalbrys !",
      "votes": null
    },
    {
      "id": "3381148",
      "postDate": "12/23/2025 21:14:31",
      "content": "<p><a href=\"https://www.kaggle.com/wrrosa\" target=\"_blank\">@wrrosa</a> could you reupload the figures in your solution? Thanks!</p>",
      "rawMarkdown": "wrrosa could you reupload the figures in your solution? Thanks!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1453260,
      "author_name": "faxoor",
      "author_url": "",
      "post_date": "08/05/2021 20:05:12",
      "content": "<p>My congrats nice work!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1454799,
      "author_name": "go5kuramubon",
      "author_url": "",
      "post_date": "08/06/2021 10:29:59",
      "content": "<p>Congrats 2nd place and thank you for sharing!!!</p>\n<p>I have a question, and I am happy you to answer if you have time.</p>\n<p>About XGBoost stacked ensemble improved baseline, what is target value in XGBoost model?<br>\n(Absolute poisition? relative position? separate lat and lng?)</p>",
      "votes": null,
      "replies": [
        {
          "id": 1454823,
          "author_name": "wrrosa",
          "author_url": "",
          "post_date": "08/06/2021 10:40:21",
          "content": "<p>Hello :) thanks for question, in fact my diagram is little messy at this point.<br>\nWell target value is <br>\n<code>diffPrM = baselinePrM - groundTruthPrM</code> <br>\nwhere both baselinePrM and groundTruthPrm are computed to satellite position with applied effect of earth rotation<br>\nIn fact I've tested many scenarios of target value and this one works best for me</p>\n<p>P.S congrat to your team achievement surviving shakeup at 6th place with gold!</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1456887,
          "author_name": "go5kuramubon",
          "author_url": "",
          "post_date": "08/07/2021 06:15:49",
          "content": "<p>Thank you for a kind answer!!<br>\nGreat idea using PrM prediction!!</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1458036,
      "author_name": "michau96",
      "author_url": "",
      "post_date": "08/07/2021 17:16:55",
      "content": "<p>Congratulations!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1468166,
      "author_name": "sujinglan",
      "author_url": "",
      "post_date": "08/12/2021 09:32:46",
      "content": "<p>Congratulations！I am very interested in you great work！ Your solution is wonderful. I will keep this in mind for my future research. Could you show some source code or paper or ideas？</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1473032,
      "author_name": "tensorchoko",
      "author_url": "",
      "post_date": "08/15/2021 09:55:34",
      "content": "<p>Congratulations. 　It would be helpful for beginners to share the code.😄</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1733886,
      "author_name": "michalbrys",
      "author_url": "",
      "post_date": "03/24/2022 17:44:13",
      "content": "<p>Congratulations!</p>",
      "votes": null,
      "replies": [
        {
          "id": 1754076,
          "author_name": "wrrosa",
          "author_url": "",
          "post_date": "04/13/2022 11:15:43",
          "content": "<p>Thank you <a href=\"https://www.kaggle.com/michalbrys\" target=\"_blank\">@michalbrys</a> !</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 3381148,
      "author_name": "gmhoang",
      "author_url": "",
      "post_date": "12/23/2025 21:14:31",
      "content": "<p><a href=\"https://www.kaggle.com/wrrosa\" target=\"_blank\">@wrrosa</a> could you reupload the figures in your solution? Thanks!</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1450882": "Thank you hosts for such an exciting competition!\nMy final solution can be described as follows:\n\n![](https://i.ibb.co/VBm4r75/scrn.png)\n\nand I was inspired by Smart PPP algorithm presented [here](https://link.springer.com/article/10.1007/s10291-021-01106-1)\n\n1. XGBoost stacked ensemble improved baseline\nI've spend about 3 weeks at this point and started with idea of correcting Baseline PrMs using other device data. This was jumpy but after all it works. Each stacked ensemble model took about 5 hour to train with GPU, and it was hard to validate. In my opinion this gives about 10-40 cm improved baseline. No further smoothing Pseudoranges was applied. Technical trick: amount of correction of PrM was used as weights in WLS algorithm\n\n2. Computing velocity\nI've spend about week on translating WlsPvt.m from gps-measurement google tool in matlab algorithm to python using PseudorangeRateMetersPerSecond and it was 0.08Mps mean average accurate. Technical trick: When algorithm failed I used baseline speedMps described in my notebook position shift. This results improved a lot kalman filtering and mean by stop technique.\n\n3. ADR relative position\nI've spend about week on computing relative position using ADR and I didn't succeeded, thus I've used derived files public version Android GPS tools. It took a lot of time to process raw gnss files in this software, and failed for two phones from test set. Technical trick: some of automatically downloaded ephemeris files were corrupted, thus it works to download them manually and turn off internet for the processing time.\n\n4. Remove outliers\nI took idea from @dehokanta but it was upgraded. Technical trick: If there were two or more consecutive outliers remove and interpolate it\n\n5. Mixing signals from other devices:\nMy very first submissions was starting here. It turns out then median averaging is better then mean, but I've ended with idea found [here](https://stackoverflow.com/questions/55813719/multi-sensors-fusion-using-kalman-filter): which is described as follows:\n![](https://i.ibb.co/dJddjV9/var.png)\nTechnical trick: variance among all epochs is pretty similar so I windowed signal (10-30 epochs adjusted by speed Category and region) \n\n6. Mean by stop\nJust using velocity Mps with threshold adjusted about 0.5-1. At this point (Xgboost + postprocessing: remove_outliers + mixing + kalman + stop) I've reached 3.945 public and 2.379 private\n\n7. Snap to ADR shape\nI used mean adr position - mean position during valid cycle as shift and shifted relative positions. Technical trick: This shift was weighted by adr uncertainity meters (public 3.345 private 1.903)\n\n\n8. Snap to ground truth\nAt this point i've started to snapping this solution to ground truth (threshold 2m for high speed and threshold way more then 2m for SJC) Technical trick: I've selected SJC regions by mean speed < 6 Mps total. (best public 3.159 private 1.801)\n\n0. Technical trick: joblib + optuna were so useful for me among almost all steps\n\nAfter all, using ~~GPS~~ GNSS will never be the same for me thus I've started as a completely newbie - thank you!",
    "1453260": "My congrats nice work!",
    "1454799": "Congrats 2nd place and thank you for sharing!!!\n\nI have a question, and I am happy you to answer if you have time.\n\nAbout XGBoost stacked ensemble improved baseline, what is target value in XGBoost model?\n(Absolute poisition? relative position? separate lat and lng?)",
    "1454823": "Hello :) thanks for question, in fact my diagram is little messy at this point.\nWell target value is \n`diffPrM = baselinePrM - groundTruthPrM` \nwhere both baselinePrM and groundTruthPrm are computed to satellite position with applied effect of earth rotation\nIn fact I've tested many scenarios of target value and this one works best for me\n\nP.S congrat to your team achievement surviving shakeup at 6th place with gold!",
    "1456887": "Thank you for a kind answer!!\nGreat idea using PrM prediction!!",
    "1458036": "Congratulations!",
    "1468166": "Congratulations！I am very interested in you great work！ Your solution is wonderful. I will keep this in mind for my future research. Could you show some source code or paper or ideas？",
    "1473032": "Congratulations. 　It would be helpful for beginners to share the code.😄",
    "1733886": "Congratulations!",
    "1754076": "Thank you @michalbrys !",
    "3381148": "wrrosa could you reupload the figures in your solution? Thanks!"
  },
  "source": "meta"
}