{
  "id": 262355,
  "title": "3rd place solution",
  "url": "/competitions/google-smartphone-decimeter-challenge/writeups/3rd-place-solution",
  "author_name": "",
  "post_date": "2021-08-06T12:36:33.417048300Z",
  "votes": 39,
  "comment_count": 5,
  "views": 0,
  "content": "<p>Looks like I should somehow present my solution</p>\n<p>First, I want to beg your pardon for my terrible English, but hopefully there will not be a much text.</p>\n<p>I did not use any preprocessing or post-processing for the data, with one exception - I had to filter DeltaRange because on some tracks they are completely false. Also, I have not used any complex algorithms.</p>\n<p>All I used from the data is pseudo-ranges and deltas.</p>\n<p>In order to filter out the deltas, I calculated the position offset to the next epoch, and left only those epochs that gave enough consistent satellites</p>\n<p>The main idea of my algorithm was that the positions that I get on the track must be in good agreement with the psevdoranges and deltas, in addition, they must satisfy certain physical laws.</p>\n<p>To do this, I built a tensorflow model that contained positions and time offsets as weights. Then I minimized the loss, which consisted of the sum satellite distance errors and the delta changes errors. Plus, I add penalty for unnecessary acceleration - to avoid trajectory wobbling.</p>\n<p>This allowed me to get the first place in the public rating and the third in the private one.<br>\nAs you can see, I did not use the data from the ground true positions at all.</p>\n<p>After the end of the competition, I spent a little bit more time and added psevdoranges correction from the base station and the calculated offset relative to the gt positions, that greatly improved the result and now it looks like this<br>\nPrivate  Public <br>\n1.39533 2.59287</p>\n<p>On training data, the error decreased to 1.1</p>\n<p>I'm going to add some more data from the IMU - perhaps this will allow us to overcome the error of one meter</p>",
  "messages": [
    {
      "id": "1455060",
      "postDate": "08/06/2021 12:36:33",
      "content": "<p>Looks like I should somehow present my solution</p>\n<p>First, I want to beg your pardon for my terrible English, but hopefully there will not be a much text.</p>\n<p>I did not use any preprocessing or post-processing for the data, with one exception - I had to filter DeltaRange because on some tracks they are completely false. Also, I have not used any complex algorithms.</p>\n<p>All I used from the data is pseudo-ranges and deltas.</p>\n<p>In order to filter out the deltas, I calculated the position offset to the next epoch, and left only those epochs that gave enough consistent satellites</p>\n<p>The main idea of my algorithm was that the positions that I get on the track must be in good agreement with the psevdoranges and deltas, in addition, they must satisfy certain physical laws.</p>\n<p>To do this, I built a tensorflow model that contained positions and time offsets as weights. Then I minimized the loss, which consisted of the sum satellite distance errors and the delta changes errors. Plus, I add penalty for unnecessary acceleration - to avoid trajectory wobbling.</p>\n<p>This allowed me to get the first place in the public rating and the third in the private one.<br>\nAs you can see, I did not use the data from the ground true positions at all.</p>\n<p>After the end of the competition, I spent a little bit more time and added psevdoranges correction from the base station and the calculated offset relative to the gt positions, that greatly improved the result and now it looks like this<br>\nPrivate  Public <br>\n1.39533 2.59287</p>\n<p>On training data, the error decreased to 1.1</p>\n<p>I'm going to add some more data from the IMU - perhaps this will allow us to overcome the error of one meter</p>",
      "rawMarkdown": "Looks like I should somehow present my solution\n\nFirst, I want to beg your pardon for my terrible English, but hopefully there will not be a much text.\n\nI did not use any preprocessing or post-processing for the data, with one exception - I had to filter DeltaRange because on some tracks they are completely false. Also, I have not used any complex algorithms.\n\nAll I used from the data is pseudo-ranges and deltas.\n\nIn order to filter out the deltas, I calculated the position offset to the next epoch, and left only those epochs that gave enough consistent satellites\n\nThe main idea of my algorithm was that the positions that I get on the track must be in good agreement with the psevdoranges and deltas, in addition, they must satisfy certain physical laws.\n\nTo do this, I built a tensorflow model that contained positions and time offsets as weights. Then I minimized the loss, which consisted of the sum satellite distance errors and the delta changes errors. Plus, I add penalty for unnecessary acceleration - to avoid trajectory wobbling.\n\nThis allowed me to get the first place in the public rating and the third in the private one.\nAs you can see, I did not use the data from the ground true positions at all.\n\nAfter the end of the competition, I spent a little bit more time and added psevdoranges correction from the base station and the calculated offset relative to the gt positions, that greatly improved the result and now it looks like this\nPrivate  Public \n1.39533 2.59287\n\nOn training data, the error decreased to 1.1\n\nI'm going to add some more data from the IMU - perhaps this will allow us to overcome the error of one meter",
      "votes": null
    },
    {
      "id": "1455112",
      "postDate": "08/06/2021 13:00:06",
      "content": "<p>Congratulations - awesome, thanks for sharing!<br>\nLooks like a lot of teams didn't apply corrections from the base stations. I ran out of time, too bad it was 'only' two months. <br>\nHow about another edition of this competition? I am interested</p>",
      "rawMarkdown": "Congratulations - awesome, thanks for sharing!\nLooks like a lot of teams didn't apply corrections from the base stations. I ran out of time, too bad it was 'only' two months. \nHow about another edition of this competition? I am interested",
      "votes": null
    },
    {
      "id": "1455148",
      "postDate": "08/06/2021 13:15:45",
      "content": "<p>I have tried to apply base station during competition, but suprisingly got a worse result than without corrections. Only after competition was over I have found that results are very good but are shifted about 2 meters</p>\n<p>Even more, the shift is 1.5 to the north and 0.5 to the west. They looks artifical. May be GT data is not so GT</p>",
      "rawMarkdown": "I have tried to apply base station during competition, but suprisingly got a worse result than without corrections. Only after competition was over I have found that results are very good but are shifted about 2 meters\n\nEven more, the shift is 1.5 to the north and 0.5 to the west. They looks artifical. May be GT data is not so GT",
      "votes": null
    },
    {
      "id": "1467660",
      "postDate": "08/12/2021 05:12:29",
      "content": "<p>Congratulations！emm，Could you show some source code or paper？I am very interested in you great work！ Congrats again! Your solution is wonderful. I will keep this in mind for my future research.</p>",
      "rawMarkdown": "Congratulations！emm，Could you show some source code or paper？I am very interested in you great work！ Congrats again! Your solution is wonderful. I will keep this in mind for my future research.",
      "votes": null
    },
    {
      "id": "1468108",
      "postDate": "08/12/2021 09:07:18",
      "content": "<p>I am planning to publish code after refactoring and adding inertial measurements. For now it is too dirty and buggy. Actually main idea is simple and you can easily reproduce it.</p>\n<p>May be before I need to say few words about ADR.<br>\nWithout car movement, ADR incorporate changes in satellites positions only. ADR measurement is very accurate; you will get ~0.02 meter error in changes of observable satellite distances and differentials of ADR. In case of car movement, you will get non zero result for difference of distance change to constant position and change of ADR. If you get X meters difference for ADR change and satellite distance change you can use this measure to move current position X meter towards the current satellite position. So, during loading ADRs I transform measurements to unit vectors pointed to satellite  and position shift at that direction. If founded position shift is correct, that shift correspond most part of loaded differences (with exception of measurements where cycle slips occurs)</p>\n<p>You create tf model which contains position and biases as trainable weight layer. Position should be initialized from baseline prediction. Biases initialization is zero. Model is very simple - it takes epoch as input and return position and bias for that epoch just from the weights.</p>\n<p>After that you make a custom learning cycle. <br>\nAt every step </p>\n<ol>\n<li>Run model and get positions for every epoch<br>\n1.1 Using this positions calculate distance to satellite for every psevdorange measurement from logs<br>\n1.2 Add absolute value of difference between calculated distances and psevdoranges shifted by epoch bias to loss<br>\n2.1 Using positions calculate speed - that is just a shift from previous to current epoch<br>\n2.2 Calculate acceleration - that is again just difference between speed of epochs<br>\n2.3 Add all acceleration which is greater than 10 to loss<br>\n3.1 Calculate movement towards satellite for every ADR measurement you have (that is just scalar multiplication of prepared vectors pointed to satellites and positions shift)<br>\n3.2 Add difference between observed movement and calculated movement to loss</li>\n<li>Use calculated loss for gradient descent of model weights</li>\n</ol>\n<p>That’s all. After some time of training you will get correct positions</p>",
      "rawMarkdown": "I am planning to publish code after refactoring and adding inertial measurements. For now it is too dirty and buggy. Actually main idea is simple and you can easily reproduce it.\n\nMay be before I need to say few words about ADR.\nWithout car movement, ADR incorporate changes in satellites positions only. ADR measurement is very accurate; you will get ~0.02 meter error in changes of observable satellite distances and differentials of ADR. In case of car movement, you will get non zero result for difference of distance change to constant position and change of ADR. If you get X meters difference for ADR change and satellite distance change you can use this measure to move current position X meter towards the current satellite position. So, during loading ADRs I transform measurements to unit vectors pointed to satellite  and position shift at that direction. If founded position shift is correct, that shift correspond most part of loaded differences (with exception of measurements where cycle slips occurs)\n\nYou create tf model which contains position and biases as trainable weight layer. Position should be initialized from baseline prediction. Biases initialization is zero. Model is very simple - it takes epoch as input and return position and bias for that epoch just from the weights.\n\nAfter that you make a custom learning cycle. \nAt every step \n0. Run model and get positions for every epoch\n1.1 Using this positions calculate distance to satellite for every psevdorange measurement from logs\n1.2 Add absolute value of difference between calculated distances and psevdoranges shifted by epoch bias to loss\n2.1 Using positions calculate speed - that is just a shift from previous to current epoch\n2.2 Calculate acceleration - that is again just difference between speed of epochs\n2.3 Add all acceleration which is greater than 10 to loss\n3.1 Calculate movement towards satellite for every ADR measurement you have (that is just scalar multiplication of prepared vectors pointed to satellites and positions shift)\n3.2 Add difference between observed movement and calculated movement to loss\n4. Use calculated loss for gradient descent of model weights\n\nThat’s all. After some time of training you will get correct positions",
      "votes": null
    },
    {
      "id": "1473043",
      "postDate": "08/15/2021 10:04:11",
      "content": "<p><a href=\"https://www.kaggle.com/ielenik\" target=\"_blank\">@ielenik</a> <br>\nI want to see it . We look forward to. 😄</p>",
      "rawMarkdown": "ielenik \nI want to see it . We look forward to. 😄",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1455112,
      "author_name": "wrrosa",
      "author_url": "",
      "post_date": "08/06/2021 13:00:06",
      "content": "<p>Congratulations - awesome, thanks for sharing!<br>\nLooks like a lot of teams didn't apply corrections from the base stations. I ran out of time, too bad it was 'only' two months. <br>\nHow about another edition of this competition? I am interested</p>",
      "votes": null,
      "replies": [
        {
          "id": 1455148,
          "author_name": "ielenik",
          "author_url": "",
          "post_date": "08/06/2021 13:15:45",
          "content": "<p>I have tried to apply base station during competition, but suprisingly got a worse result than without corrections. Only after competition was over I have found that results are very good but are shifted about 2 meters</p>\n<p>Even more, the shift is 1.5 to the north and 0.5 to the west. They looks artifical. May be GT data is not so GT</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1467660,
      "author_name": "sujinglan",
      "author_url": "",
      "post_date": "08/12/2021 05:12:29",
      "content": "<p>Congratulations！emm，Could you show some source code or paper？I am very interested in you great work！ Congrats again! Your solution is wonderful. I will keep this in mind for my future research.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1468108,
          "author_name": "ielenik",
          "author_url": "",
          "post_date": "08/12/2021 09:07:18",
          "content": "<p>I am planning to publish code after refactoring and adding inertial measurements. For now it is too dirty and buggy. Actually main idea is simple and you can easily reproduce it.</p>\n<p>May be before I need to say few words about ADR.<br>\nWithout car movement, ADR incorporate changes in satellites positions only. ADR measurement is very accurate; you will get ~0.02 meter error in changes of observable satellite distances and differentials of ADR. In case of car movement, you will get non zero result for difference of distance change to constant position and change of ADR. If you get X meters difference for ADR change and satellite distance change you can use this measure to move current position X meter towards the current satellite position. So, during loading ADRs I transform measurements to unit vectors pointed to satellite  and position shift at that direction. If founded position shift is correct, that shift correspond most part of loaded differences (with exception of measurements where cycle slips occurs)</p>\n<p>You create tf model which contains position and biases as trainable weight layer. Position should be initialized from baseline prediction. Biases initialization is zero. Model is very simple - it takes epoch as input and return position and bias for that epoch just from the weights.</p>\n<p>After that you make a custom learning cycle. <br>\nAt every step </p>\n<ol>\n<li>Run model and get positions for every epoch<br>\n1.1 Using this positions calculate distance to satellite for every psevdorange measurement from logs<br>\n1.2 Add absolute value of difference between calculated distances and psevdoranges shifted by epoch bias to loss<br>\n2.1 Using positions calculate speed - that is just a shift from previous to current epoch<br>\n2.2 Calculate acceleration - that is again just difference between speed of epochs<br>\n2.3 Add all acceleration which is greater than 10 to loss<br>\n3.1 Calculate movement towards satellite for every ADR measurement you have (that is just scalar multiplication of prepared vectors pointed to satellites and positions shift)<br>\n3.2 Add difference between observed movement and calculated movement to loss</li>\n<li>Use calculated loss for gradient descent of model weights</li>\n</ol>\n<p>That’s all. After some time of training you will get correct positions</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1473043,
          "author_name": "tensorchoko",
          "author_url": "",
          "post_date": "08/15/2021 10:04:11",
          "content": "<p><a href=\"https://www.kaggle.com/ielenik\" target=\"_blank\">@ielenik</a> <br>\nI want to see it . We look forward to. 😄</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1455060": "Looks like I should somehow present my solution\n\nFirst, I want to beg your pardon for my terrible English, but hopefully there will not be a much text.\n\nI did not use any preprocessing or post-processing for the data, with one exception - I had to filter DeltaRange because on some tracks they are completely false. Also, I have not used any complex algorithms.\n\nAll I used from the data is pseudo-ranges and deltas.\n\nIn order to filter out the deltas, I calculated the position offset to the next epoch, and left only those epochs that gave enough consistent satellites\n\nThe main idea of my algorithm was that the positions that I get on the track must be in good agreement with the psevdoranges and deltas, in addition, they must satisfy certain physical laws.\n\nTo do this, I built a tensorflow model that contained positions and time offsets as weights. Then I minimized the loss, which consisted of the sum satellite distance errors and the delta changes errors. Plus, I add penalty for unnecessary acceleration - to avoid trajectory wobbling.\n\nThis allowed me to get the first place in the public rating and the third in the private one.\nAs you can see, I did not use the data from the ground true positions at all.\n\nAfter the end of the competition, I spent a little bit more time and added psevdoranges correction from the base station and the calculated offset relative to the gt positions, that greatly improved the result and now it looks like this\nPrivate  Public \n1.39533 2.59287\n\nOn training data, the error decreased to 1.1\n\nI'm going to add some more data from the IMU - perhaps this will allow us to overcome the error of one meter",
    "1455112": "Congratulations - awesome, thanks for sharing!\nLooks like a lot of teams didn't apply corrections from the base stations. I ran out of time, too bad it was 'only' two months. \nHow about another edition of this competition? I am interested",
    "1455148": "I have tried to apply base station during competition, but suprisingly got a worse result than without corrections. Only after competition was over I have found that results are very good but are shifted about 2 meters\n\nEven more, the shift is 1.5 to the north and 0.5 to the west. They looks artifical. May be GT data is not so GT",
    "1467660": "Congratulations！emm，Could you show some source code or paper？I am very interested in you great work！ Congrats again! Your solution is wonderful. I will keep this in mind for my future research.",
    "1468108": "I am planning to publish code after refactoring and adding inertial measurements. For now it is too dirty and buggy. Actually main idea is simple and you can easily reproduce it.\n\nMay be before I need to say few words about ADR.\nWithout car movement, ADR incorporate changes in satellites positions only. ADR measurement is very accurate; you will get ~0.02 meter error in changes of observable satellite distances and differentials of ADR. In case of car movement, you will get non zero result for difference of distance change to constant position and change of ADR. If you get X meters difference for ADR change and satellite distance change you can use this measure to move current position X meter towards the current satellite position. So, during loading ADRs I transform measurements to unit vectors pointed to satellite  and position shift at that direction. If founded position shift is correct, that shift correspond most part of loaded differences (with exception of measurements where cycle slips occurs)\n\nYou create tf model which contains position and biases as trainable weight layer. Position should be initialized from baseline prediction. Biases initialization is zero. Model is very simple - it takes epoch as input and return position and bias for that epoch just from the weights.\n\nAfter that you make a custom learning cycle. \nAt every step \n0. Run model and get positions for every epoch\n1.1 Using this positions calculate distance to satellite for every psevdorange measurement from logs\n1.2 Add absolute value of difference between calculated distances and psevdoranges shifted by epoch bias to loss\n2.1 Using positions calculate speed - that is just a shift from previous to current epoch\n2.2 Calculate acceleration - that is again just difference between speed of epochs\n2.3 Add all acceleration which is greater than 10 to loss\n3.1 Calculate movement towards satellite for every ADR measurement you have (that is just scalar multiplication of prepared vectors pointed to satellites and positions shift)\n3.2 Add difference between observed movement and calculated movement to loss\n4. Use calculated loss for gradient descent of model weights\n\nThat’s all. After some time of training you will get correct positions",
    "1473043": "ielenik \nI want to see it . We look forward to. 😄"
  },
  "source": "meta"
}