{
  "id": 417258,
  "title": "37 Rank solution",
  "url": "/competitions/vesuvius-challenge-ink-detection/discussion/417258",
  "author_name": "",
  "post_date": "2023-06-15T00:21:58.030788400Z",
  "votes": 11,
  "comment_count": 7,
  "views": 0,
  "content": "<h1>Data Augmentation</h1>\n<pre><code>    A.Resize(size, size),\n    A.HorizontalFlip(=0.5),\n    A.VerticalFlip(=0.5),\n    A.RandomBrightnessContrast(=0.75),\n    A.GaussNoise(var_limit=[10, 50]),\n    A.GaussianBlur(),\n    A.RandomGamma(=0.5, gamma_limit=(50, 200)),\n    A.OneOf([A.OpticalDistortion(=0.3), A.GridDistortion(=0.3), A.ElasticTransform(=0.1)], =0.5),\n    A.GridDistortion(=5, =0.3, =0.5),\n    A.CoarseDropout(=1, =int(size * 0.3), =int(size * 0.3),=0, \n     =0.5),\n    A.Normalize(\n        mean= [0] * in_chanss,\n        std= [1] * in_chanss\n    ),\n    ToTensorV2(=)\n</code></pre>\n<h1>Resolution</h1>\n<pre><code> *Height = *\n</code></pre>\n<h1>Loss</h1>\n<pre><code>   =.*BCE + .*Dice + .*Tversky\n</code></pre>\n<h1>Model Architectures</h1>\n<pre><code>  - seres_xd\n  - rest\n  - resd\n</code></pre>\n<h1>Methods worked for me:</h1>\n<pre><code>   Networks Seresnet + resnet34D : \n      - Zaxis pooling\n      - Mean pooling  \n      - Dialated CNNs \n      - Dynamic Pooling\n</code></pre>\n<h1>Post processing</h1>\n<pre><code>  #Apply post-processing techniques\n  kernel = np.ones((, ), np.uint8)\n  min_area_threshold = \n  kernel_size = \n  sigmaX = \n  threshold = TH  # Adjust the threshold value  needed\n  mask_pred = cv2.morphology\n  labels, num_labels = scipy.ndimage.label(mask_pred)\n   label_idx  range(, num_labels + ):\n     region_area = np.sum(labelslabel_idx)\n      region_area &lt; min_area_threshold:\n        mask_pred = \n  mask_pred = cv2., (kernel_size, kernel_size), sigmaX)\n  mask_pred = (mask_pred &gt; threshold).astype()\n</code></pre>\n<h1>Threshold</h1>\n<pre><code>   - . with TTA rotate    \n</code></pre>\n<h2>Best Score single model</h2>\n<pre><code>-   : 0.63 \n-  Public:  \n</code></pre>\n<h2>6 Ensemble model score</h2>\n<pre><code> - : \n - Public : 0.76\n</code></pre>",
  "messages": [
    {
      "id": "2302899",
      "postDate": "06/15/2023 00:21:58",
      "content": "<h1>Data Augmentation</h1>\n<pre><code>    A.Resize(size, size),\n    A.HorizontalFlip(=0.5),\n    A.VerticalFlip(=0.5),\n    A.RandomBrightnessContrast(=0.75),\n    A.GaussNoise(var_limit=[10, 50]),\n    A.GaussianBlur(),\n    A.RandomGamma(=0.5, gamma_limit=(50, 200)),\n    A.OneOf([A.OpticalDistortion(=0.3), A.GridDistortion(=0.3), A.ElasticTransform(=0.1)], =0.5),\n    A.GridDistortion(=5, =0.3, =0.5),\n    A.CoarseDropout(=1, =int(size * 0.3), =int(size * 0.3),=0, \n     =0.5),\n    A.Normalize(\n        mean= [0] * in_chanss,\n        std= [1] * in_chanss\n    ),\n    ToTensorV2(=)\n</code></pre>\n<h1>Resolution</h1>\n<pre><code> *Height = *\n</code></pre>\n<h1>Loss</h1>\n<pre><code>   =.*BCE + .*Dice + .*Tversky\n</code></pre>\n<h1>Model Architectures</h1>\n<pre><code>  - seres_xd\n  - rest\n  - resd\n</code></pre>\n<h1>Methods worked for me:</h1>\n<pre><code>   Networks Seresnet + resnet34D : \n      - Zaxis pooling\n      - Mean pooling  \n      - Dialated CNNs \n      - Dynamic Pooling\n</code></pre>\n<h1>Post processing</h1>\n<pre><code>  #Apply post-processing techniques\n  kernel = np.ones((, ), np.uint8)\n  min_area_threshold = \n  kernel_size = \n  sigmaX = \n  threshold = TH  # Adjust the threshold value  needed\n  mask_pred = cv2.morphology\n  labels, num_labels = scipy.ndimage.label(mask_pred)\n   label_idx  range(, num_labels + ):\n     region_area = np.sum(labelslabel_idx)\n      region_area &lt; min_area_threshold:\n        mask_pred = \n  mask_pred = cv2., (kernel_size, kernel_size), sigmaX)\n  mask_pred = (mask_pred &gt; threshold).astype()\n</code></pre>\n<h1>Threshold</h1>\n<pre><code>   - . with TTA rotate    \n</code></pre>\n<h2>Best Score single model</h2>\n<pre><code>-   : 0.63 \n-  Public:  \n</code></pre>\n<h2>6 Ensemble model score</h2>\n<pre><code> - : \n - Public : 0.76\n</code></pre>",
      "rawMarkdown": "#Data Augmentation\n        A.Resize(size, size),\n        A.HorizontalFlip(p=0.5),\n        A.VerticalFlip(p=0.5),\n        A.RandomBrightnessContrast(p=0.75),\n        A.GaussNoise(var_limit=[10, 50]),\n        A.GaussianBlur(),\n        A.RandomGamma(p=0.5, gamma_limit=(50, 200)),\n        A.OneOf([A.OpticalDistortion(p=0.3), A.GridDistortion(p=0.3), A.ElasticTransform(p=0.1)], p=0.5),\n        A.GridDistortion(num_steps=5, distort_limit=0.3, p=0.5),\n        A.CoarseDropout(max_holes=1, max_width=int(size * 0.3), max_height=int(size * 0.3),mask_fill_value=0, \n         p=0.5),\n        A.Normalize(\n            mean= [0] * in_chanss,\n            std= [1] * in_chanss\n        ),\n        ToTensorV2(transpose_mask=True)\n\n#Resolution\n     Width*Height = 320*320\n#Loss\n      loss =0.3*BCE + 0.4*Dice + 0.3*Tversky\n#Model Architectures \n      - seresnext50_32x4d\n      - resnet10t\n      - resnet34d\n#Methods worked for me:\n      Stacked Networks Seresnet + resnet34D : \n          - Zaxis pooling\n          - Mean pooling  \n          - Dialated CNNs \n          - Dynamic Pooling\n\n#Post processing \n      #Apply post-processing techniques\n      kernel = np.ones((3, 3), np.uint8)\n      min_area_threshold = 100\n      kernel_size = 5\n      sigmaX = 1.0\n      threshold = TH  # Adjust the threshold value as needed\n      mask_pred = cv2.morphologyEx(mask_pred, cv2.MORPH_CLOSE, kernel)\n      labels, num_labels = scipy.ndimage.label(mask_pred)\n      for label_idx in range(1, num_labels + 1):\n         region_area = np.sum(labels == label_idx)\n         if region_area < min_area_threshold:\n            mask_pred[labels == label_idx] = 0\n      mask_pred = cv2.GaussianBlur(mask_pred.astype(np.float32), (kernel_size, kernel_size), sigmaX)\n      mask_pred = (mask_pred > threshold).astype(int)\n \n#Threshold\n      Thr - 0.6 with TTA rotate    \n\n##Best Score single model \n    -  Private : 0.63 \n    -  Public:  0.74\n\n## 6 Ensemble model score\n     - Private: 0.62\n     - Public : 0.76",
      "votes": null
    },
    {
      "id": "2302943",
      "postDate": "06/15/2023 01:34:53",
      "content": "<p>can you tell which model is the best single model?</p>",
      "rawMarkdown": "can you tell which model is the best single model?",
      "votes": null
    },
    {
      "id": "2302947",
      "postDate": "06/15/2023 01:38:45",
      "content": "<p>Seresnet stacked with dynamic pooling </p>",
      "rawMarkdown": "Seresnet stacked with dynamic pooling",
      "votes": null
    },
    {
      "id": "2302959",
      "postDate": "06/15/2023 01:49:21",
      "content": "<p>Congratulations.</p>",
      "rawMarkdown": "Congratulations.",
      "votes": null
    },
    {
      "id": "2303630",
      "postDate": "06/15/2023 11:45:47",
      "content": "<p>Do you share some code about these：</p>\n<ul>\n<li>Zaxis pooling</li>\n<li>Mean pooling</li>\n<li>Dialated CNNs </li>\n<li>Dynamic Pooling</li>\n</ul>",
      "rawMarkdown": "Do you share some code about these：\n- Zaxis pooling\n- Mean pooling\n- Dialated CNNs \n- Dynamic Pooling",
      "votes": null
    },
    {
      "id": "2303685",
      "postDate": "06/15/2023 12:12:42",
      "content": "<p>Yes sure in a couple of days</p>",
      "rawMarkdown": "Yes sure in a couple of days",
      "votes": null
    },
    {
      "id": "2303725",
      "postDate": "06/15/2023 12:39:12",
      "content": "<p>Congratulations！Thank you！</p>",
      "rawMarkdown": "Congratulations！Thank you！",
      "votes": null
    },
    {
      "id": "2304093",
      "postDate": "06/15/2023 17:11:23",
      "content": "<p>Notebooks : <a href=\"https://www.kaggle.com/competitions/vesuvius-challenge-ink-detection/discussion/417432\" target=\"_blank\">https://www.kaggle.com/competitions/vesuvius-challenge-ink-detection/discussion/417432</a></p>",
      "rawMarkdown": "Notebooks : https://www.kaggle.com/competitions/vesuvius-challenge-ink-detection/discussion/417432",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2302943,
      "author_name": "cutebomb",
      "author_url": "",
      "post_date": "06/15/2023 01:34:53",
      "content": "<p>can you tell which model is the best single model?</p>",
      "votes": null,
      "replies": [
        {
          "id": 2302947,
          "author_name": "arunodhayan",
          "author_url": "",
          "post_date": "06/15/2023 01:38:45",
          "content": "<p>Seresnet stacked with dynamic pooling </p>",
          "votes": null,
          "replies": [
            {
              "id": 2303630,
              "author_name": "wangxuc",
              "author_url": "",
              "post_date": "06/15/2023 11:45:47",
              "content": "<p>Do you share some code about these：</p>\n<ul>\n<li>Zaxis pooling</li>\n<li>Mean pooling</li>\n<li>Dialated CNNs </li>\n<li>Dynamic Pooling</li>\n</ul>",
              "votes": null,
              "replies": [
                {
                  "id": 2303685,
                  "author_name": "arunodhayan",
                  "author_url": "",
                  "post_date": "06/15/2023 12:12:42",
                  "content": "<p>Yes sure in a couple of days</p>",
                  "votes": null,
                  "replies": [
                    {
                      "id": 2303725,
                      "author_name": "wangxuc",
                      "author_url": "",
                      "post_date": "06/15/2023 12:39:12",
                      "content": "<p>Congratulations！Thank you！</p>",
                      "votes": null,
                      "replies": []
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "id": 2302959,
      "author_name": "robsonsan",
      "author_url": "",
      "post_date": "06/15/2023 01:49:21",
      "content": "<p>Congratulations.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2304093,
      "author_name": "arunodhayan",
      "author_url": "",
      "post_date": "06/15/2023 17:11:23",
      "content": "<p>Notebooks : <a href=\"https://www.kaggle.com/competitions/vesuvius-challenge-ink-detection/discussion/417432\" target=\"_blank\">https://www.kaggle.com/competitions/vesuvius-challenge-ink-detection/discussion/417432</a></p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2302899": "#Data Augmentation\n        A.Resize(size, size),\n        A.HorizontalFlip(p=0.5),\n        A.VerticalFlip(p=0.5),\n        A.RandomBrightnessContrast(p=0.75),\n        A.GaussNoise(var_limit=[10, 50]),\n        A.GaussianBlur(),\n        A.RandomGamma(p=0.5, gamma_limit=(50, 200)),\n        A.OneOf([A.OpticalDistortion(p=0.3), A.GridDistortion(p=0.3), A.ElasticTransform(p=0.1)], p=0.5),\n        A.GridDistortion(num_steps=5, distort_limit=0.3, p=0.5),\n        A.CoarseDropout(max_holes=1, max_width=int(size * 0.3), max_height=int(size * 0.3),mask_fill_value=0, \n         p=0.5),\n        A.Normalize(\n            mean= [0] * in_chanss,\n            std= [1] * in_chanss\n        ),\n        ToTensorV2(transpose_mask=True)\n\n#Resolution\n     Width*Height = 320*320\n#Loss\n      loss =0.3*BCE + 0.4*Dice + 0.3*Tversky\n#Model Architectures \n      - seresnext50_32x4d\n      - resnet10t\n      - resnet34d\n#Methods worked for me:\n      Stacked Networks Seresnet + resnet34D : \n          - Zaxis pooling\n          - Mean pooling  \n          - Dialated CNNs \n          - Dynamic Pooling\n\n#Post processing \n      #Apply post-processing techniques\n      kernel = np.ones((3, 3), np.uint8)\n      min_area_threshold = 100\n      kernel_size = 5\n      sigmaX = 1.0\n      threshold = TH  # Adjust the threshold value as needed\n      mask_pred = cv2.morphologyEx(mask_pred, cv2.MORPH_CLOSE, kernel)\n      labels, num_labels = scipy.ndimage.label(mask_pred)\n      for label_idx in range(1, num_labels + 1):\n         region_area = np.sum(labels == label_idx)\n         if region_area < min_area_threshold:\n            mask_pred[labels == label_idx] = 0\n      mask_pred = cv2.GaussianBlur(mask_pred.astype(np.float32), (kernel_size, kernel_size), sigmaX)\n      mask_pred = (mask_pred > threshold).astype(int)\n \n#Threshold\n      Thr - 0.6 with TTA rotate    \n\n##Best Score single model \n    -  Private : 0.63 \n    -  Public:  0.74\n\n## 6 Ensemble model score\n     - Private: 0.62\n     - Public : 0.76",
    "2302943": "can you tell which model is the best single model?",
    "2302947": "Seresnet stacked with dynamic pooling",
    "2302959": "Congratulations.",
    "2303630": "Do you share some code about these：\n- Zaxis pooling\n- Mean pooling\n- Dialated CNNs \n- Dynamic Pooling",
    "2303685": "Yes sure in a couple of days",
    "2303725": "Congratulations！Thank you！",
    "2304093": "Notebooks : https://www.kaggle.com/competitions/vesuvius-challenge-ink-detection/discussion/417432"
  },
  "source": "meta"
}