{
  "id": 459595,
  "title": "34th Place solution",
  "url": "/competitions/child-mind-institute-detect-sleep-states/writeups/bull-34th-place-solution",
  "author_name": "",
  "post_date": "2023-12-06T01:30:40.893Z",
  "votes": 29,
  "comment_count": 5,
  "views": 0,
  "content": "<p>First of all, I would like to thank the organizers and kaggle staff for organizing the competition. I learned a lot through the competition.</p>\n<h1>Summary</h1>\n<ul>\n<li>based on 213tubo's repository</li>\n<li>Data cleansing</li>\n<li>Ensemble models</li>\n<li>Reduce FP by post-processing</li>\n</ul>\n<h1>data cleansing</h1>\n<p>When I visualized <code>train_series.parquet</code> and <code>train_events.csv</code> by series_id as shown below, I noticed that the label data was dirty.</p>\n<p>Labels were not assigned where they should have been, or were assigned where they should not have been (where the organizer may have filled in values for missing values).</p>\n<p>There were many areas of concern, such as labels that were assigned at times that were probably tens of minutes or more off from the time the subjects were onset/wakeup.</p>\n<p>We thought that such dirty label data would be an obstacle in training the model, so we examined the data for every series_id and cleansed the label data by shifting or adding the position of the labels.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4472591%2F54084323b61ae128f11ae023af23f952%2F1.png?generation=1701821199709357&amp;alt=media\" alt=\"\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4472591%2F094a8b23da8b1a11b44d8518081a552d%2F2.png?generation=1701821213143683&amp;alt=media\" alt=\"\"></p>\n<h1>Model</h1>\n<ul>\n<li>Unet</li>\n<li>encoder<ul>\n<li>maxvit_tiny</li>\n<li>eca_nfnet_l1</li>\n<li>dm_nfnet_f0</li></ul></li>\n<li>Augment<ul>\n<li>Mixup</li>\n<li>Spec_augment</li></ul></li>\n<li>Label_smoosing(sleep)</li>\n<li>Sliding inference</li>\n<li>Not using both ends of the inference</li>\n</ul>\n<h1>Post-processing</h1>\n<p>When I visualized the data, I noticed that some of the data showed unnatural periodic patterns, such as <code>1e6717d93c1d</code>.</p>\n<p>I considered these unnatural periodic patterns to be invalid because the organizers had filled in common values for each time of the day for periods when no data were measured.</p>\n<p>The model may output onset/wakeup predictions within these periodic patterns, but they are considered false positives.</p>\n<p>We post-processed the model to remove predictions within these periodic patterns.</p>\n<p>The criteria for periodic patterns are as follows,</p>\n<ul>\n<li>When anglez and envo are shifted back and forth 17280*n steps, if both anglez and envo values are consistent, the prediction is considered invalid.</li>\n<li>However, if they do not match for two or more consecutive steps, they are not judged invalid (considering those due to coincidence)</li>\n</ul>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4472591%2F2f9154d75cc09c12501a037c8fe0b2d6%2F3.png?generation=1701821229161164&amp;alt=media\" alt=\"\"></p>",
  "messages": [
    {
      "id": "2550264",
      "postDate": "12/06/2023 00:08:55",
      "content": "<p>First of all, I would like to thank the organizers and kaggle staff for organizing the competition. I learned a lot through the competition.</p>\n<h1>Summary</h1>\n<ul>\n<li>based on 213tubo's repository</li>\n<li>Data cleansing</li>\n<li>Ensemble models</li>\n<li>Reduce FP by post-processing</li>\n</ul>\n<h1>data cleansing</h1>\n<p>When I visualized <code>train_series.parquet</code> and <code>train_events.csv</code> by series_id as shown below, I noticed that the label data was dirty.</p>\n<p>Labels were not assigned where they should have been, or were assigned where they should not have been (where the organizer may have filled in values for missing values).</p>\n<p>There were many areas of concern, such as labels that were assigned at times that were probably tens of minutes or more off from the time the subjects were onset/wakeup.</p>\n<p>We thought that such dirty label data would be an obstacle in training the model, so we examined the data for every series_id and cleansed the label data by shifting or adding the position of the labels.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4472591%2F54084323b61ae128f11ae023af23f952%2F1.png?generation=1701821199709357&amp;alt=media\" alt=\"\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4472591%2F094a8b23da8b1a11b44d8518081a552d%2F2.png?generation=1701821213143683&amp;alt=media\" alt=\"\"></p>\n<h1>Model</h1>\n<ul>\n<li>Unet</li>\n<li>encoder<ul>\n<li>maxvit_tiny</li>\n<li>eca_nfnet_l1</li>\n<li>dm_nfnet_f0</li></ul></li>\n<li>Augment<ul>\n<li>Mixup</li>\n<li>Spec_augment</li></ul></li>\n<li>Label_smoosing(sleep)</li>\n<li>Sliding inference</li>\n<li>Not using both ends of the inference</li>\n</ul>\n<h1>Post-processing</h1>\n<p>When I visualized the data, I noticed that some of the data showed unnatural periodic patterns, such as <code>1e6717d93c1d</code>.</p>\n<p>I considered these unnatural periodic patterns to be invalid because the organizers had filled in common values for each time of the day for periods when no data were measured.</p>\n<p>The model may output onset/wakeup predictions within these periodic patterns, but they are considered false positives.</p>\n<p>We post-processed the model to remove predictions within these periodic patterns.</p>\n<p>The criteria for periodic patterns are as follows,</p>\n<ul>\n<li>When anglez and envo are shifted back and forth 17280*n steps, if both anglez and envo values are consistent, the prediction is considered invalid.</li>\n<li>However, if they do not match for two or more consecutive steps, they are not judged invalid (considering those due to coincidence)</li>\n</ul>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4472591%2F2f9154d75cc09c12501a037c8fe0b2d6%2F3.png?generation=1701821229161164&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "First of all, I would like to thank the organizers and kaggle staff for organizing the competition. I learned a lot through the competition.\n# Summary\n\n- based on 213tubo's repository\n- Data cleansing\n- Ensemble models\n- Reduce FP by post-processing\n\n# data cleansing\n\nWhen I visualized `train_series.parquet` and `train_events.csv` by series_id as shown below, I noticed that the label data was dirty.\n\nLabels were not assigned where they should have been, or were assigned where they should not have been (where the organizer may have filled in values for missing values).\n\nThere were many areas of concern, such as labels that were assigned at times that were probably tens of minutes or more off from the time the subjects were onset/wakeup.\n\nWe thought that such dirty label data would be an obstacle in training the model, so we examined the data for every series_id and cleansed the label data by shifting or adding the position of the labels.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4472591%2F54084323b61ae128f11ae023af23f952%2F1.png?generation=1701821199709357&alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4472591%2F094a8b23da8b1a11b44d8518081a552d%2F2.png?generation=1701821213143683&alt=media)\n\n# Model\n- Unet\n- encoder\n  - maxvit_tiny\n  - eca_nfnet_l1\n  - dm_nfnet_f0\n- Augment\n  - Mixup\n  - Spec_augment\n- Label_smoosing(sleep)\n- Sliding inference\n- Not using both ends of the inference\n\n# Post-processing\n\nWhen I visualized the data, I noticed that some of the data showed unnatural periodic patterns, such as `1e6717d93c1d`.\n\nI considered these unnatural periodic patterns to be invalid because the organizers had filled in common values for each time of the day for periods when no data were measured.\n\nThe model may output onset/wakeup predictions within these periodic patterns, but they are considered false positives.\n\nWe post-processed the model to remove predictions within these periodic patterns.\n\nThe criteria for periodic patterns are as follows,\n\n- When anglez and envo are shifted back and forth 17280*n steps, if both anglez and envo values are consistent, the prediction is considered invalid.\n- However, if they do not match for two or more consecutive steps, they are not judged invalid (considering those due to coincidence)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4472591%2F2f9154d75cc09c12501a037c8fe0b2d6%2F3.png?generation=1701821229161164&alt=media)",
      "votes": null
    },
    {
      "id": "2550267",
      "postDate": "12/06/2023 00:12:35",
      "content": "<p>What score increase you received after filtering periodic patterns?</p>",
      "rawMarkdown": "What score increase you received after filtering periodic patterns?",
      "votes": null
    },
    {
      "id": "2550269",
      "postDate": "12/06/2023 00:16:48",
      "content": "<p>PL 0.707→0.713</p>",
      "rawMarkdown": "PL 0.707→0.713",
      "votes": null
    },
    {
      "id": "2550275",
      "postDate": "12/06/2023 00:22:48",
      "content": "<p>Hi Bull, nice solution! Can you please comment on the score boost you got with mixup aug?</p>",
      "rawMarkdown": "Hi Bull, nice solution! Can you please comment on the score boost you got with mixup aug?",
      "votes": null
    },
    {
      "id": "2550282",
      "postDate": "12/06/2023 00:28:57",
      "content": "<p>Nice finding of the anglez-enmo pairs! Congrats!! </p>",
      "rawMarkdown": "Nice finding of the anglez-enmo pairs! Congrats!!",
      "votes": null
    },
    {
      "id": "2550306",
      "postDate": "12/06/2023 01:00:21",
      "content": "<p>Hi, AnatoliK. It improved by about 0.008 with our CV settings.</p>",
      "rawMarkdown": "Hi, AnatoliK. It improved by about 0.008 with our CV settings.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2550267,
      "author_name": "nhargan",
      "author_url": "",
      "post_date": "12/06/2023 00:12:35",
      "content": "<p>What score increase you received after filtering periodic patterns?</p>",
      "votes": null,
      "replies": [
        {
          "id": 2550269,
          "author_name": "welshonionman",
          "author_url": "",
          "post_date": "12/06/2023 00:16:48",
          "content": "<p>PL 0.707→0.713</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 2550275,
      "author_name": "akorol",
      "author_url": "",
      "post_date": "12/06/2023 00:22:48",
      "content": "<p>Hi Bull, nice solution! Can you please comment on the score boost you got with mixup aug?</p>",
      "votes": null,
      "replies": [
        {
          "id": 2550306,
          "author_name": "daimarusui3",
          "author_url": "",
          "post_date": "12/06/2023 01:00:21",
          "content": "<p>Hi, AnatoliK. It improved by about 0.008 with our CV settings.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 2550282,
      "author_name": "snnclsr",
      "author_url": "",
      "post_date": "12/06/2023 00:28:57",
      "content": "<p>Nice finding of the anglez-enmo pairs! Congrats!! </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2550264": "First of all, I would like to thank the organizers and kaggle staff for organizing the competition. I learned a lot through the competition.\n# Summary\n\n- based on 213tubo's repository\n- Data cleansing\n- Ensemble models\n- Reduce FP by post-processing\n\n# data cleansing\n\nWhen I visualized `train_series.parquet` and `train_events.csv` by series_id as shown below, I noticed that the label data was dirty.\n\nLabels were not assigned where they should have been, or were assigned where they should not have been (where the organizer may have filled in values for missing values).\n\nThere were many areas of concern, such as labels that were assigned at times that were probably tens of minutes or more off from the time the subjects were onset/wakeup.\n\nWe thought that such dirty label data would be an obstacle in training the model, so we examined the data for every series_id and cleansed the label data by shifting or adding the position of the labels.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4472591%2F54084323b61ae128f11ae023af23f952%2F1.png?generation=1701821199709357&alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4472591%2F094a8b23da8b1a11b44d8518081a552d%2F2.png?generation=1701821213143683&alt=media)\n\n# Model\n- Unet\n- encoder\n  - maxvit_tiny\n  - eca_nfnet_l1\n  - dm_nfnet_f0\n- Augment\n  - Mixup\n  - Spec_augment\n- Label_smoosing(sleep)\n- Sliding inference\n- Not using both ends of the inference\n\n# Post-processing\n\nWhen I visualized the data, I noticed that some of the data showed unnatural periodic patterns, such as `1e6717d93c1d`.\n\nI considered these unnatural periodic patterns to be invalid because the organizers had filled in common values for each time of the day for periods when no data were measured.\n\nThe model may output onset/wakeup predictions within these periodic patterns, but they are considered false positives.\n\nWe post-processed the model to remove predictions within these periodic patterns.\n\nThe criteria for periodic patterns are as follows,\n\n- When anglez and envo are shifted back and forth 17280*n steps, if both anglez and envo values are consistent, the prediction is considered invalid.\n- However, if they do not match for two or more consecutive steps, they are not judged invalid (considering those due to coincidence)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4472591%2F2f9154d75cc09c12501a037c8fe0b2d6%2F3.png?generation=1701821229161164&alt=media)",
    "2550267": "What score increase you received after filtering periodic patterns?",
    "2550269": "PL 0.707→0.713",
    "2550275": "Hi Bull, nice solution! Can you please comment on the score boost you got with mixup aug?",
    "2550282": "Nice finding of the anglez-enmo pairs! Congrats!!",
    "2550306": "Hi, AnatoliK. It improved by about 0.008 with our CV settings."
  },
  "source": "existing_discussion",
  "complete": true,
  "competition_id": 53666,
  "competition_slug": "child-mind-institute-detect-sleep-states",
  "team_id": 11211811,
  "solution_url": "/competitions/child-mind-institute-detect-sleep-states/writeups/bull-34th-place-solution"
}