{
  "id": 541397,
  "title": "LB First Place Solution",
  "content": "<p>Ensemble of Models Using Two Autoregressive Approaches</p>\n<p><strong>Approach 1: Predicting One Timestep at a Time</strong></p>\n<p>In this approach, the models use 5 timesteps of all input data(wind speed (ustar), temperature (theta), and fire-line location (xi), slope (alpha) and mean wind speed (u10)) to predict xi for the next timestep. The predicted xi is then appended, and the oldest xi is discarded to predict the next timestep. This process is repeated to predict the required number of timesteps.</p>\n<p>Models:<br>\n<strong>1. Residual CNN:</strong><br>\nUses residual blocks with skip connections.<br>\nIt consists of initial convolutions, batch normalization, ReLU activations, residual blocks, and a final convolution for prediction.<br>\nReshapes the input to [batch_size, num_steps, channels, height, width] for multi-step forecasting.</p>\n<p><strong>2. Self-Attention Residual CNN:</strong><br>\nCombines residual blocks with a self-attention mechanism to capture dependencies across feature maps.<br>\nResidual blocks extract spatial features, and self-attention highlights important spatial regions.<br>\nIt applies the self-attention mechanism to the feature maps before producing the output via a convolution layer.</p>\n<p><strong>3. Self-Attention ConvLSTM:</strong><br>\nIntegrates ConvLSTM cells with self-attention.<br>\nUses stacked ConvLSTM cells to process sequential inputs, with self-attention enhancing spatial focus.<br>\nThe model outputs the hidden state of the last timestep after applying a convolution to predict xi.</p>\n<p><strong>Approach 2: Predicting Multiple Timesteps at Once</strong></p>\n<p>In this approach, the models predict xi for the next 20 timesteps using all input data(wind speed (ustar), temperature (theta), and fire-line location (xi), slope (alpha) and mean wind speed (u10)) from the last 5 timesteps. Last 5 timesteps from predicted 20 timesteps are used to predict the next 20 timesteps. This autoregressive process repeats to predict the required number of timesteps.</p>\n<p>Model:<br>\n<strong>1. Residual CNN (Multi-Timestep Prediction):</strong><br>\nSimilar structure to Approach 1, but modified to predict multiple future timesteps (20) in one forward pass.<br>\nUtilizes residual blocks to process input sequences and a final convolutional layer to generate predictions for multiple future steps.</p>\n<p>Both approaches are autoregressive and can predict any number of timesteps by iteratively updating predictions. The inference code supports flexible timestep forecasting.</p>\n<p>Training and Inference code: <a href=\"https://drive.google.com/drive/folders/1EIcfL37vR9eAaGsANDbbCkZZBf7uwU9Q?usp=drive_link\" target=\"_blank\">https://drive.google.com/drive/folders/1EIcfL37vR9eAaGsANDbbCkZZBf7uwU9Q?usp=drive_link</a><br>\nWeights - <br>\n<a href=\"https://www.kaggle.com/datasets/ajayasaithambi/residualcnn20-200-seq-len-5-1050\" target=\"_blank\">https://www.kaggle.com/datasets/ajayasaithambi/residualcnn20-200-seq-len-5-1050</a><br>\n<a href=\"https://www.kaggle.com/datasets/ajayasaithambi/selfattconvlstm-seq-len-5\" target=\"_blank\">https://www.kaggle.com/datasets/ajayasaithambi/selfattconvlstm-seq-len-5</a><br>\n<a href=\"https://www.kaggle.com/datasets/ajayasaithambi/residualcnnsa-seq-len-5\" target=\"_blank\">https://www.kaggle.com/datasets/ajayasaithambi/residualcnnsa-seq-len-5</a><br>\n<a href=\"https://www.kaggle.com/datasets/ajayasaithambi/residualcnn-seq-len-5\" target=\"_blank\">https://www.kaggle.com/datasets/ajayasaithambi/residualcnn-seq-len-5</a><br>\n<a href=\"https://www.kaggle.com/datasets/ajayasaithambi/residualcnnsa20-200-seq-len-5-6\" target=\"_blank\">https://www.kaggle.com/datasets/ajayasaithambi/residualcnnsa20-200-seq-len-5-6</a></p>",
  "comments": [
    {
      "id": 3025509,
      "author_name": "Harikotapati",
      "author_url": "",
      "post_date": "2024-10-22T21:08:38.037000",
      "content": "<p>In the labels there is heavily imbalance,Any steps used to overcome <br>\nWhich loss function you used?</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 3024350,
      "author_name": "Deepak Saldanha",
      "author_url": "",
      "post_date": "2024-10-21T14:46:24.687000",
      "content": "<p>Congratulations!, Kudos for using pure pytorch</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 3022089,
      "author_name": "Rafał Pawłowski",
      "author_url": "",
      "post_date": "2024-10-19T08:54:58.557000",
      "content": "<p>Congratulations! Did you check it for long time predictions? I have tried one by one step prediction, but my signal disappeared after some rounds. </p>",
      "votes": 0,
      "replies": [
        {
          "id": 3022124,
          "author_name": "Ajay Asaithambi",
          "author_url": "",
          "post_date": "2024-10-19T10:00:12.130000",
          "content": "<p>Yes i checked with 145 timesteps in training data. It worked fine(MSE only slightly increased).</p>\n<blockquote>\n  <blockquote>\n    <p>I have tried one by one step prediction, but my signal disappeared after some rounds.<br>\n    Did it do well for 20 timesteps?</p>\n  </blockquote>\n</blockquote>",
          "votes": 1,
          "replies": []
        }
      ]
    }
  ],
  "comment_count": 4,
  "messages": [
    {
      "id": 3022078,
      "postDate": "2024-10-19T08:35:52.527Z",
      "content": "<p>Ensemble of Models Using Two Autoregressive Approaches</p>\n<p><strong>Approach 1: Predicting One Timestep at a Time</strong></p>\n<p>In this approach, the models use 5 timesteps of all input data(wind speed (ustar), temperature (theta), and fire-line location (xi), slope (alpha) and mean wind speed (u10)) to predict xi for the next timestep. The predicted xi is then appended, and the oldest xi is discarded to predict the next timestep. This process is repeated to predict the required number of timesteps.</p>\n<p>Models:<br>\n<strong>1. Residual CNN:</strong><br>\nUses residual blocks with skip connections.<br>\nIt consists of initial convolutions, batch normalization, ReLU activations, residual blocks, and a final convolution for prediction.<br>\nReshapes the input to [batch_size, num_steps, channels, height, width] for multi-step forecasting.</p>\n<p><strong>2. Self-Attention Residual CNN:</strong><br>\nCombines residual blocks with a self-attention mechanism to capture dependencies across feature maps.<br>\nResidual blocks extract spatial features, and self-attention highlights important spatial regions.<br>\nIt applies the self-attention mechanism to the feature maps before producing the output via a convolution layer.</p>\n<p><strong>3. Self-Attention ConvLSTM:</strong><br>\nIntegrates ConvLSTM cells with self-attention.<br>\nUses stacked ConvLSTM cells to process sequential inputs, with self-attention enhancing spatial focus.<br>\nThe model outputs the hidden state of the last timestep after applying a convolution to predict xi.</p>\n<p><strong>Approach 2: Predicting Multiple Timesteps at Once</strong></p>\n<p>In this approach, the models predict xi for the next 20 timesteps using all input data(wind speed (ustar), temperature (theta), and fire-line location (xi), slope (alpha) and mean wind speed (u10)) from the last 5 timesteps. Last 5 timesteps from predicted 20 timesteps are used to predict the next 20 timesteps. This autoregressive process repeats to predict the required number of timesteps.</p>\n<p>Model:<br>\n<strong>1. Residual CNN (Multi-Timestep Prediction):</strong><br>\nSimilar structure to Approach 1, but modified to predict multiple future timesteps (20) in one forward pass.<br>\nUtilizes residual blocks to process input sequences and a final convolutional layer to generate predictions for multiple future steps.</p>\n<p>Both approaches are autoregressive and can predict any number of timesteps by iteratively updating predictions. The inference code supports flexible timestep forecasting.</p>\n<p>Training and Inference code: <a href=\"https://drive.google.com/drive/folders/1EIcfL37vR9eAaGsANDbbCkZZBf7uwU9Q?usp=drive_link\" target=\"_blank\">https://drive.google.com/drive/folders/1EIcfL37vR9eAaGsANDbbCkZZBf7uwU9Q?usp=drive_link</a><br>\nWeights - <br>\n<a href=\"https://www.kaggle.com/datasets/ajayasaithambi/residualcnn20-200-seq-len-5-1050\" target=\"_blank\">https://www.kaggle.com/datasets/ajayasaithambi/residualcnn20-200-seq-len-5-1050</a><br>\n<a href=\"https://www.kaggle.com/datasets/ajayasaithambi/selfattconvlstm-seq-len-5\" target=\"_blank\">https://www.kaggle.com/datasets/ajayasaithambi/selfattconvlstm-seq-len-5</a><br>\n<a href=\"https://www.kaggle.com/datasets/ajayasaithambi/residualcnnsa-seq-len-5\" target=\"_blank\">https://www.kaggle.com/datasets/ajayasaithambi/residualcnnsa-seq-len-5</a><br>\n<a href=\"https://www.kaggle.com/datasets/ajayasaithambi/residualcnn-seq-len-5\" target=\"_blank\">https://www.kaggle.com/datasets/ajayasaithambi/residualcnn-seq-len-5</a><br>\n<a href=\"https://www.kaggle.com/datasets/ajayasaithambi/residualcnnsa20-200-seq-len-5-6\" target=\"_blank\">https://www.kaggle.com/datasets/ajayasaithambi/residualcnnsa20-200-seq-len-5-6</a></p>",
      "rawMarkdown": "Ensemble of Models Using Two Autoregressive Approaches\n\n**Approach 1: Predicting One Timestep at a Time**\n\nIn this approach, the models use 5 timesteps of all input data(wind speed (ustar), temperature (theta), and fire-line location (xi), slope (alpha) and mean wind speed (u10)) to predict xi for the next timestep. The predicted xi is then appended, and the oldest xi is discarded to predict the next timestep. This process is repeated to predict the required number of timesteps.\n\nModels:\n**1. Residual CNN:**\nUses residual blocks with skip connections.\nIt consists of initial convolutions, batch normalization, ReLU activations, residual blocks, and a final convolution for prediction.\nReshapes the input to [batch_size, num_steps, channels, height, width] for multi-step forecasting.\n\n**2. Self-Attention Residual CNN:**\nCombines residual blocks with a self-attention mechanism to capture dependencies across feature maps.\nResidual blocks extract spatial features, and self-attention highlights important spatial regions.\nIt applies the self-attention mechanism to the feature maps before producing the output via a convolution layer.\n\n**3. Self-Attention ConvLSTM:**\nIntegrates ConvLSTM cells with self-attention.\nUses stacked ConvLSTM cells to process sequential inputs, with self-attention enhancing spatial focus.\nThe model outputs the hidden state of the last timestep after applying a convolution to predict xi.\n\n**Approach 2: Predicting Multiple Timesteps at Once**\n\nIn this approach, the models predict xi for the next 20 timesteps using all input data(wind speed (ustar), temperature (theta), and fire-line location (xi), slope (alpha) and mean wind speed (u10)) from the last 5 timesteps. Last 5 timesteps from predicted 20 timesteps are used to predict the next 20 timesteps. This autoregressive process repeats to predict the required number of timesteps.\n\nModel:\n**1. Residual CNN (Multi-Timestep Prediction):**\nSimilar structure to Approach 1, but modified to predict multiple future timesteps (20) in one forward pass.\nUtilizes residual blocks to process input sequences and a final convolutional layer to generate predictions for multiple future steps.\n\nBoth approaches are autoregressive and can predict any number of timesteps by iteratively updating predictions. The inference code supports flexible timestep forecasting.\n\nTraining and Inference code: https://drive.google.com/drive/folders/1EIcfL37vR9eAaGsANDbbCkZZBf7uwU9Q?usp=drive_link\nWeights - \nhttps://www.kaggle.com/datasets/ajayasaithambi/residualcnn20-200-seq-len-5-1050\nhttps://www.kaggle.com/datasets/ajayasaithambi/selfattconvlstm-seq-len-5\nhttps://www.kaggle.com/datasets/ajayasaithambi/residualcnnsa-seq-len-5\nhttps://www.kaggle.com/datasets/ajayasaithambi/residualcnn-seq-len-5\nhttps://www.kaggle.com/datasets/ajayasaithambi/residualcnnsa20-200-seq-len-5-6\n\n",
      "votes": 14
    },
    {
      "id": 3025509,
      "postDate": "2024-10-22T21:08:38.037Z",
      "content": "<p>In the labels there is heavily imbalance,Any steps used to overcome <br>\nWhich loss function you used?</p>",
      "rawMarkdown": "In the labels there is heavily imbalance,Any steps used to overcome \nWhich loss function you used?"
    },
    {
      "id": 3024350,
      "postDate": "2024-10-21T14:46:24.687Z",
      "content": "<p>Congratulations!, Kudos for using pure pytorch</p>",
      "rawMarkdown": "Congratulations!, Kudos for using pure pytorch"
    },
    {
      "id": 3022089,
      "postDate": "2024-10-19T08:54:58.557Z",
      "content": "<p>Congratulations! Did you check it for long time predictions? I have tried one by one step prediction, but my signal disappeared after some rounds. </p>",
      "rawMarkdown": "Congratulations! Did you check it for long time predictions? I have tried one by one step prediction, but my signal disappeared after some rounds. ",
      "replies": [
        {
          "id": 3022124,
          "postDate": "2024-10-19T10:00:12.130Z",
          "content": "<p>Yes i checked with 145 timesteps in training data. It worked fine(MSE only slightly increased).</p>\n<blockquote>\n  <blockquote>\n    <p>I have tried one by one step prediction, but my signal disappeared after some rounds.<br>\n    Did it do well for 20 timesteps?</p>\n  </blockquote>\n</blockquote>",
          "rawMarkdown": "Yes i checked with 145 timesteps in training data. It worked fine(MSE only slightly increased).\n\n>> I have tried one by one step prediction, but my signal disappeared after some rounds.\nDid it do well for 20 timesteps?",
          "votes": 1
        }
      ]
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-19T13:44:09Z",
  "competition_id": 85210,
  "competition_slug": "2024-flame-ai-challenge",
  "team_id": 12656596,
  "solution_url": "/competitions/2024-flame-ai-challenge/writeups/ajay-asaithambi-lb-first-place-solution"
}